virtio-net: construct multi-buffer xdp in mergeable
authorHeng Qi <hengqi@linux.alibaba.com>
Sat, 14 Jan 2023 08:22:25 +0000 (16:22 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Jan 2023 11:15:48 +0000 (11:15 +0000)
commit22174f79a44baf5e46faafff1d7b21363431b93a
treeade39be98ad7608ada7f2932260caaee6bea8960
parentef75cb51f13941cf7633227ade43c4d86ecbc336
virtio-net: construct multi-buffer xdp in mergeable

Build multi-buffer xdp using virtnet_build_xdp_buff_mrg().

For the prefilled buffer before xdp is set, we will probably use
vq reset in the future. At the same time, virtio net currently
uses comp pages, and bpf_xdp_frags_increase_tail() needs to calculate
the tailroom of the last frag, which will involve the offset of the
corresponding page and cause a negative value, so we disable tail
increase by not setting xdp_rxq->frag_size.

Signed-off-by: Heng Qi <hengqi@linux.alibaba.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c