virtio_net: introduce mergeable_xdp_get_buf()
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>
Mon, 8 May 2023 06:14:04 +0000 (14:14 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 10 May 2023 02:44:26 +0000 (19:44 -0700)
commitad4858beb824aeba53deeae660ea7fab9e624bc0
tree25b6af79b453b033f5ed1f494fb0902319aef849
parent363d8ce4b94719a87dad865e2829f1dba0f7ef71
virtio_net: introduce mergeable_xdp_get_buf()

Separating the logic of preparation for xdp from receive_mergeable.

The purpose of this is to simplify the logic of execution of XDP.

The main logic here is that when headroom is insufficient, we need to
allocate a new page and calculate offset. It should be noted that if
there is new page, the variable page will refer to the new page.

Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/virtio_net.c