diff options
author | Denis Kirjanov <kda@linux-powerpc.org> | 2020-06-29 16:13:29 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-02 01:25:14 +0300 |
commit | 1c9535c701fb287c2f292bc7fb39a07c5f8a25fd (patch) | |
tree | 47073640bbb0b027c96b37c6d556e4d14741476b /drivers/net/xen-netback/rx.c | |
parent | 6c5aa6fc4defc2a0977a2c59e4710d50fa1e834c (diff) | |
download | linux-1c9535c701fb287c2f292bc7fb39a07c5f8a25fd.tar.xz |
xen networking: add XDP offset adjustment to xen-netback
the patch basically adds the offset adjustment and netfront
state reading to make XDP work on netfront side.
Reviewed-by: Paul Durrant <paul@xen.org>
Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback/rx.c')
-rw-r--r-- | drivers/net/xen-netback/rx.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c index ef5887037b22..ac034f69a170 100644 --- a/drivers/net/xen-netback/rx.c +++ b/drivers/net/xen-netback/rx.c @@ -258,6 +258,19 @@ static void xenvif_rx_next_skb(struct xenvif_queue *queue, pkt->extra_count++; } + if (queue->vif->xdp_headroom) { + struct xen_netif_extra_info *extra; + + extra = &pkt->extras[XEN_NETIF_EXTRA_TYPE_XDP - 1]; + + memset(extra, 0, sizeof(struct xen_netif_extra_info)); + extra->u.xdp.headroom = queue->vif->xdp_headroom; + extra->type = XEN_NETIF_EXTRA_TYPE_XDP; + extra->flags = 0; + + pkt->extra_count++; + } + if (skb->sw_hash) { struct xen_netif_extra_info *extra; @@ -356,7 +369,7 @@ static void xenvif_rx_data_slot(struct xenvif_queue *queue, struct xen_netif_rx_request *req, struct xen_netif_rx_response *rsp) { - unsigned int offset = 0; + unsigned int offset = queue->vif->xdp_headroom; unsigned int flags; do { |