Thread (1 message) 1 message, 1 author, 2021-01-20

Re: [PATCH net-next v2 2/7] virtio-net, xsk: distinguish XDP_TX and XSK XMIT ctx

From: Jason Wang <hidden>
Date: 2021-01-20 03:25:32
Also in: bpf, virtualization

On 2021/1/18 下午7:54, Xuan Zhuo wrote:
On Mon, 18 Jan 2021 14:45:16 +0800, Jason Wang [off-list ref] wrote:
quoted
On 2021/1/16 上午10:59, Xuan Zhuo wrote:
quoted
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@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

  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help