netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Yunsheng Lin <linyunsheng@huawei.com>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	Jason Wang <jasowang@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	virtualization@lists.linux-foundation.org, bpf@vger.kernel.org,
	Yichun Zhang <yichun@openresty.com>,
	Alexander Duyck <alexanderduyck@fb.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net, stable v1 3/3] virtio_net: add checking sq is full inside xdp xmit
Date: Wed, 8 Mar 2023 22:51:40 -0800	[thread overview]
Message-ID: <20230308225140.46c22c89@kernel.org> (raw)
In-Reply-To: <20230308071921-mutt-send-email-mst@kernel.org>

On Wed, 8 Mar 2023 07:21:07 -0500 Michael S. Tsirkin wrote:
> > >  * netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb,
> > >  *                               struct net_device *dev);
> > >  *	Called when a packet needs to be transmitted.
> > >  *	Returns NETDEV_TX_OK.  Can return NETDEV_TX_BUSY, but you should stop
> > >  *	the queue before that can happen; it's for obsolete devices and weird
> > >  *	corner cases, but the stack really does a non-trivial amount
> > >  *	of useless work if you return NETDEV_TX_BUSY.
> > >  *	Required; cannot be NULL.  
> > 
> > Thanks for the pointer. It is intersting, it seems most driver is not flollowing
> > the suggestion.  
> 
> Yes - I don't know why.

Most modern drivers don't stop the queue upfront?
We try to catch it in review, so anything remotely recent should. 
But a lot of people DTRT *and* check at the start of .xmit if 
the skb fits (return BUSY if it doesn't) - defensive programming.
But the BUSY path should never hit.

  parent reply	other threads:[~2023-03-09  6:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08  2:49 [PATCH net, stable v1 0/3] add checking sq is full inside xdp xmit Xuan Zhuo
2023-03-08  2:49 ` [PATCH net, stable v1 1/3] virtio_net: reorder some funcs Xuan Zhuo
2023-03-08  5:20   ` Jason Wang
2023-03-08  6:53   ` Michael S. Tsirkin
2023-03-08  2:49 ` [PATCH net, stable v1 2/3] virtio_net: separate the logic of checking whether sq is full Xuan Zhuo
2023-03-08  5:20   ` Jason Wang
2023-03-08  2:49 ` [PATCH net, stable v1 3/3] virtio_net: add checking sq is full inside xdp xmit Xuan Zhuo
2023-03-08  5:20   ` Jason Wang
2023-03-08  6:59   ` Yunsheng Lin
2023-03-08  7:14     ` Xuan Zhuo
2023-03-08  8:13       ` Yunsheng Lin
2023-03-08 12:21         ` Michael S. Tsirkin
2023-03-09  1:49           ` Yunsheng Lin
2023-03-09  6:51           ` Jakub Kicinski [this message]
2023-03-11  0:50 ` [PATCH net, stable v1 0/3] " patchwork-bot+netdevbpf

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=20230308225140.46c22c89@kernel.org \
    --to=kuba@kernel.org \
    --cc=alexanderduyck@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=linyunsheng@huawei.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xuanzhuo@linux.alibaba.com \
    --cc=yichun@openresty.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).