All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: David Ahern <dsahern@gmail.com>,
	David Ahern <dahern@digitalocean.com>,
	David Ahern <dsahern@kernel.org>,
	netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org,
	"Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH RFC net-next] virtio_net: Relax queue requirement for using XDP
Date: Wed, 26 Feb 2020 13:51:00 +0800	[thread overview]
Message-ID: <9d2769ba-b104-dcd2-98f6-df9fa1f568ea@redhat.com> (raw)
In-Reply-To: <5861350a-a0f6-9a74-e06d-4b7fd688e5e7@gmail.com>


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

>


  reply	other threads:[~2020-02-26  5:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26  0:57 [PATCH RFC net-next] virtio_net: Relax queue requirement for using XDP David Ahern
2020-02-26  1:37 ` Jakub Kicinski
2020-02-26  3:00 ` Jason Wang
2020-02-26  3:24   ` David Ahern
2020-02-26  3:29     ` Jason Wang
2020-02-26  3:34       ` David Ahern
2020-02-26  3:52         ` Jason Wang
2020-02-26  4:35           ` David Ahern
2020-02-26  5:51             ` Jason Wang [this message]
2020-02-26  8:19     ` Toke Høiland-Jørgensen
2020-02-26  8:23       ` Michael S. Tsirkin
2020-02-26  8:34         ` Toke Høiland-Jørgensen
2020-02-26  8:42           ` Michael S. Tsirkin
2020-02-26  9:02             ` Toke Høiland-Jørgensen
2020-02-26  9:32               ` Michael S. Tsirkin
2020-02-26 15:58           ` David Ahern
2020-02-26 16:21             ` Toke Høiland-Jørgensen
2020-02-26 17:08             ` Michael S. Tsirkin
2020-02-26 21:31               ` Toke Høiland-Jørgensen
2020-02-27  3:27           ` David Ahern
2020-02-27 10:19             ` Toke Høiland-Jørgensen
2020-02-27 10:41               ` Magnus Karlsson
2020-09-28  3:13                 ` David Ahern
2020-09-28 14:25                   ` Magnus Karlsson
2020-09-29  2:44                     ` David Ahern
2020-02-26  6:48   ` Michael S. Tsirkin
2020-02-26  7:28     ` Jason Wang
2020-02-26  8:21       ` Michael S. Tsirkin
2020-02-26  6:43 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d2769ba-b104-dcd2-98f6-df9fa1f568ea@redhat.com \
    --to=jasowang@redhat.com \
    --cc=dahern@digitalocean.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=kuba@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.