Jason Wang
2021-Jan-20 03:23 UTC
[PATCH net-next v2 2/7] virtio-net, xsk: distinguish XDP_TX and XSK XMIT ctx
On 2021/1/18 ??7:54, Xuan Zhuo wrote:> On Mon, 18 Jan 2021 14:45:16 +0800, Jason Wang <jasowang at redhat.com> wrote: >> On 2021/1/16 ??10:59, Xuan Zhuo wrote: >>> If support xsk, a new ptr will be recovered during the >>> process of freeing the old ptr. In order to distinguish between ctx sent >>> by XDP_TX and ctx sent by xsk, a struct is added here to distinguish >>> between these two situations. virtnet_xdp_type.type It is used to >>> distinguish different ctx, and virtnet_xdp_type.offset is used to record >>> the offset between "true ctx" and virtnet_xdp_type. >>> >>> The newly added virtnet_xsk_hdr will be used for xsk. >>> >>> Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com> >> >> Any reason that you can't simply encode the type in the pointer itself >> as we used to do? >> >> #define VIRTIO_XSK_FLAG??? BIT(1) >> >> ? > Since xdp socket does not use xdp_frame, we will encounter three data types when > recycling: skb, xdp_frame, xdp socket.Just to make sure we are in the same page. Currently, the pointer type is encoded with 1 bit in the pointer. Can we simply use 2 bit to distinguish skb, xdp, xsk? Thanks>