]> www.infradead.org Git - users/dwmw2/linux.git/commit
virtio_net: refactor the xmit type
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>
Tue, 12 Nov 2024 01:29:23 +0000 (09:29 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 16 Nov 2024 02:46:55 +0000 (18:46 -0800)
commit7db956707f5f57e18c5ebf1681db2923eb6144e1
tree1ae75886ce0fcad11bd20f52624eb5e89b9a3b92
parent880ebcbe06636c42cfb328039581e177c6cd6ba5
virtio_net: refactor the xmit type

Because the af-xdp will introduce a new xmit type, so I refactor the
xmit type mechanism first.

We know both xdp_frame and sk_buff are at least 4 bytes aligned.
For the xdp tx, we do not pass any pointer to virtio core as data,
we just need to pass the len of the packet. So we will push len
to the void pointer. We can make sure the pointer is 4 bytes aligned.

And the data structure of AF_XDP also is at least 4 bytes aligned.

So the last two bits of the pointers are free, we can't use these to
distinguish them.

    00 for skb
    01 for SKB_ORPHAN
    10 for XDP
    11 for AF-XDP tx

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