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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d2769ba-b104-dcd2-98f6-df9fa1f568ea@redhat.com>
Date:   Wed, 26 Feb 2020 13:51:00 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     David Ahern <dsahern@...il.com>,
        David Ahern <dahern@...italocean.com>,
        David Ahern <dsahern@...nel.org>, netdev@...r.kernel.org
Cc:     davem@...emloft.net, kuba@...nel.org,
        "Michael S . Tsirkin" <mst@...hat.com>
Subject: Re: [PATCH RFC net-next] virtio_net: Relax queue requirement for
 using XDP


On 2020/2/26 下午12:35, David Ahern wrote:
> On 2/25/20 8:52 PM, Jason Wang wrote:
>> On 2020/2/26 上午11:34, David Ahern wrote:
>>> On 2/25/20 8:29 PM, Jason Wang wrote:
>>>> TAP uses spinlock for XDP_TX.
>>> code reference? I can not find that.
>>>
>> In tun_xdp_xmit(), ptr_ring is synchronized through producer_lock.
>>
> thanks. I was confused by the tap comment when it is the tun code.


Ah, I see, yes, the tap is kind of confusing.


>
> So you mean a spinlock around virtnet_xdp_xmit for XDP_TX:
>
> +                       if (!vi->can_do_xdp_tx)
> +                               spin_lock(&vi->xdp_tx_lock);
>                          err = virtnet_xdp_xmit(dev, 1, &xdpf, 0);
> +                       if (!vi->can_do_xdp_tx)
> +                               spin_unlock(&vi->xdp_tx_lock);


Something like this, but probably need to use __netif_tx_lock_bh() 
inside virtnet_xdp_xmit().

Need to calculate a sendqueue before in virtnet_xdp_sq().

Thanks

>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ