virtio_net: optimize mergeable_xdp_get_buf()
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>
Mon, 8 May 2023 06:14:05 +0000 (14:14 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 10 May 2023 02:44:26 +0000 (19:44 -0700)
commitdbe4fec2447dd215964aad88b0e06f96c6958ee9
treed8c403b313f42b9f7f7290597078119e854ad4a6
parentad4858beb824aeba53deeae660ea7fab9e624bc0
virtio_net: optimize mergeable_xdp_get_buf()

The previous patch, in order to facilitate review, I do not do any
modification. This patch has made some optimization on the top.

* remove some repeated logics in this function.
* add fast check for passing without any alloc.

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