[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230308225140.46c22c89@kernel.org>
Date: Wed, 8 Mar 2023 22:51:40 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Yunsheng Lin <linyunsheng@...wei.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Jason Wang <jasowang@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
virtualization@...ts.linux-foundation.org, bpf@...r.kernel.org,
Yichun Zhang <yichun@...nresty.com>,
Alexander Duyck <alexanderduyck@...com>, netdev@...r.kernel.org
Subject: Re: [PATCH net, stable v1 3/3] virtio_net: add checking sq is full
inside xdp xmit
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.
Powered by blists - more mailing lists