virtio_net: convert to use generic xdp_frame and xdp_return_frame API
authorJesper Dangaard Brouer <brouer@redhat.com>
Tue, 17 Apr 2018 14:45:52 +0000 (16:45 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Apr 2018 14:50:28 +0000 (10:50 -0400)
commitcac320c850efb25480cd0f71383b84ec61c0e138
treedac73f69c98d6c8e086f023022ceac112377fcab
parent1ffcbc8537d0bc32aaca7000cb9c904ec4b6300f
virtio_net: convert to use generic xdp_frame and xdp_return_frame API

The virtio_net driver assumes XDP frames are always released based on
page refcnt (via put_page).  Thus, is only queues the XDP data pointer
address and uses virt_to_head_page() to retrieve struct page.

Use the XDP return API to get away from such assumptions. Instead
queue an xdp_frame, which allow us to use the xdp_return_frame API,
when releasing the frame.

V8: Avoid endianness issues (found by kbuild test robot)
V9: Change __virtnet_xdp_xmit from bool to int return value (found by Dan Carpenter)

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c