[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240105193029.004ee174@kernel.org>
Date: Fri, 5 Jan 2024 19:30:29 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Shinas Rasheed <srasheed@...vell.com>
Cc: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<hgani@...vell.com>, <vimleshk@...vell.com>, <sedara@...vell.com>,
<egallen@...hat.com>, <mschmidt@...hat.com>, <pabeni@...hat.com>,
<horms@...nel.org>, <wizhao@...hat.com>, <kheib@...hat.com>,
<konguyen@...hat.com>, Veerasenareddy Burru <vburru@...vell.com>, Satananda
Burla <sburla@...vell.com>, "David S. Miller" <davem@...emloft.net>, Eric
Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net-next v3 6/8] octeon_ep_vf: add Tx/Rx processing and
interrupt support
On Fri, 5 Jan 2024 12:38:21 -0800 Shinas Rasheed wrote:
> +static int octep_vf_iq_full_check(struct octep_vf_iq *iq)
> +{
> + if (likely((IQ_INSTR_SPACE(iq)) >
> + OCTEP_VF_WAKE_QUEUE_THRESHOLD))
> + return 0;
> +
> + /* Stop the queue if unable to send */
> + netif_stop_subqueue(iq->netdev, iq->q_no);
> +
> + /* check again and restart the queue, in case NAPI has just freed
> + * enough Tx ring entries.
> + */
> + if (unlikely(IQ_INSTR_SPACE(iq) >
> + OCTEP_VF_WAKE_QUEUE_THRESHOLD)) {
> + netif_start_subqueue(iq->netdev, iq->q_no);
> + iq->stats.restart_cnt++;
> + return 0;
> + }
Please use the macros from netdev_queues.h here as well.
Looks like you may be missing a memory barrier here.
And please call this function after queuing an skb to
make sure NETDEV_TX_BUSY is almost never returned.
See Documentation/networking/driver.rst
Powered by blists - more mailing lists