mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 15:15:46 +00:00
net: Added SetSteeringEBPF method for NetClientState.
For now, that method supported only by Linux TAP. Linux TAP uses TUNSETSTEERINGEBPF ioctl. Signed-off-by: Andrew Melnychenko <andrew@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
committed by
Jason Wang
parent
78258debe0
commit
8f364e344c
@ -347,6 +347,14 @@ static void tap_poll(NetClientState *nc, bool enable)
|
||||
tap_write_poll(s, enable);
|
||||
}
|
||||
|
||||
static bool tap_set_steering_ebpf(NetClientState *nc, int prog_fd)
|
||||
{
|
||||
TAPState *s = DO_UPCAST(TAPState, nc, nc);
|
||||
assert(nc->info->type == NET_CLIENT_DRIVER_TAP);
|
||||
|
||||
return tap_fd_set_steering_ebpf(s->fd, prog_fd) == 0;
|
||||
}
|
||||
|
||||
int tap_get_fd(NetClientState *nc)
|
||||
{
|
||||
TAPState *s = DO_UPCAST(TAPState, nc, nc);
|
||||
@ -372,6 +380,7 @@ static NetClientInfo net_tap_info = {
|
||||
.set_vnet_hdr_len = tap_set_vnet_hdr_len,
|
||||
.set_vnet_le = tap_set_vnet_le,
|
||||
.set_vnet_be = tap_set_vnet_be,
|
||||
.set_steering_ebpf = tap_set_steering_ebpf,
|
||||
};
|
||||
|
||||
static TAPState *net_tap_fd_init(NetClientState *peer,
|
||||
|
Reference in New Issue
Block a user