diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2022-04-07 13:21:34 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-04-11 18:25:47 -0700 |
commit | 1cb9d3b6185b2a4d1d592632a7faf5d8c8e5f9b3 (patch) | |
tree | 68522402fda7955ad6defc5a0b5bb447c6d10738 /drivers/net/hyperv/netvsc.c | |
parent | 2e36437f44b3b71f383c36491b86be4bdd7fd12a (diff) | |
download | linux-1cb9d3b6185b2a4d1d592632a7faf5d8c8e5f9b3.tar.gz linux-1cb9d3b6185b2a4d1d592632a7faf5d8c8e5f9b3.tar.bz2 linux-1cb9d3b6185b2a4d1d592632a7faf5d8c8e5f9b3.zip |
hv_netvsc: Add support for XDP_REDIRECT
Handle XDP_REDIRECT action in netvsc driver.
Also, transparently pass ndo_xdp_xmit to VF when available.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://lore.kernel.org/r/1649362894-20077-1-git-send-email-haiyangz@microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/hyperv/netvsc.c')
-rw-r--r-- | drivers/net/hyperv/netvsc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 4061af5baaea..6e42cb03e226 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -20,6 +20,7 @@ #include <linux/vmalloc.h> #include <linux/rtnetlink.h> #include <linux/prefetch.h> +#include <linux/filter.h> #include <asm/sync_bitops.h> #include <asm/mshyperv.h> @@ -805,7 +806,7 @@ static void netvsc_send_tx_complete(struct net_device *ndev, struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)skb->cb; u32 send_index = packet->send_buf_index; - struct netvsc_stats *tx_stats; + struct netvsc_stats_tx *tx_stats; if (send_index != NETVSC_INVALID_INDEX) netvsc_free_send_slot(net_device, send_index); @@ -1670,12 +1671,17 @@ int netvsc_poll(struct napi_struct *napi, int budget) if (!nvchan->desc) nvchan->desc = hv_pkt_iter_first(channel); + nvchan->xdp_flush = false; + while (nvchan->desc && work_done < budget) { work_done += netvsc_process_raw_pkt(device, nvchan, net_device, ndev, nvchan->desc, budget); nvchan->desc = hv_pkt_iter_next(channel, nvchan->desc); } + if (nvchan->xdp_flush) + xdp_do_flush(); + /* Send any pending receive completions */ ret = send_recv_completions(ndev, net_device, nvchan); |