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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2021/1/18 下午7:54, Xuan Zhuo wrote:
On Mon, 18 Jan 2021 14:45:16 +0800, Jason Wang <jasowang@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxxx>

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







[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux