Commit 5d274cb4 authored by Jesper Dangaard Brouer's avatar Jesper Dangaard Brouer Committed by Alexei Starovoitov

virtio_net: implement flush flag for ndo_xdp_xmit

When passed the XDP_XMIT_FLUSH flag virtnet_xdp_xmit now performs the
same virtqueue_kick as virtnet_xdp_flush.
Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 0c9d917b
...@@ -481,7 +481,7 @@ static int virtnet_xdp_xmit(struct net_device *dev, ...@@ -481,7 +481,7 @@ static int virtnet_xdp_xmit(struct net_device *dev,
int err; int err;
int i; int i;
if (unlikely(flags & ~XDP_XMIT_FLAGS_NONE)) if (unlikely(flags & ~XDP_XMIT_FLAGS_MASK))
return -EINVAL; return -EINVAL;
qp = vi->curr_queue_pairs - vi->xdp_queue_pairs + smp_processor_id(); qp = vi->curr_queue_pairs - vi->xdp_queue_pairs + smp_processor_id();
...@@ -507,6 +507,10 @@ static int virtnet_xdp_xmit(struct net_device *dev, ...@@ -507,6 +507,10 @@ static int virtnet_xdp_xmit(struct net_device *dev,
drops++; drops++;
} }
} }
if (flags & XDP_XMIT_FLUSH)
virtqueue_kick(sq->vq);
return n - drops; return n - drops;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment