lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 20 Jan 2021 11:23:06 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
Cc:     "Michael S. Tsirkin" <mst@...hat.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Björn Töpel <bjorn.topel@...el.com>,
        Magnus Karlsson <magnus.karlsson@...el.com>,
        Jonathan Lemon <jonathan.lemon@...il.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        KP Singh <kpsingh@...nel.org>,
        virtualization@...ts.linux-foundation.org, bpf@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [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@...hat.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@...ux.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


>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ