[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zw3lHHEuMt_llNt8@LQ3V64L9R2>
Date: Mon, 14 Oct 2024 20:44:28 -0700
From: Joe Damato <jdamato@...tly.com>
To: Vinicius Costa Gomes <vinicius.gomes@...el.com>
Cc: netdev@...r.kernel.org, kurt@...utronix.de,
Tony Nguyen <anthony.l.nguyen@...el.com>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, 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>,
"moderated list:INTEL ETHERNET DRIVERS" <intel-wired-lan@...ts.osuosl.org>,
open list <linux-kernel@...r.kernel.org>,
"open list:XDP (eXpress Data Path)" <bpf@...r.kernel.org>
Subject: Re: [RFC net-next v2 2/2] igc: Link queues to NAPI instances
On Mon, Oct 14, 2024 at 06:51:57PM -0700, Vinicius Costa Gomes wrote:
> Joe Damato <jdamato@...tly.com> writes:
[...]
> > +void igc_set_queue_napi(struct igc_adapter *adapter, int q_idx,
> > + struct napi_struct *napi)
> > +{
> > + if (adapter->flags & IGC_FLAG_QUEUE_PAIRS) {
> > + netif_queue_set_napi(adapter->netdev, q_idx,
> > + NETDEV_QUEUE_TYPE_RX, napi);
> > + netif_queue_set_napi(adapter->netdev, q_idx,
> > + NETDEV_QUEUE_TYPE_TX, napi);
> > + } else {
> > + if (q_idx < adapter->num_rx_queues) {
> > + netif_queue_set_napi(adapter->netdev, q_idx,
> > + NETDEV_QUEUE_TYPE_RX, napi);
> > + } else {
> > + q_idx -= adapter->num_rx_queues;
> > + netif_queue_set_napi(adapter->netdev, q_idx,
> > + NETDEV_QUEUE_TYPE_TX, napi);
> > + }
> > + }
> > +}
> > +
> > +void igc_unset_queue_napi(struct igc_adapter *adapter, int q_idx)
> > +{
> > + struct net_device *netdev = adapter->netdev;
> > +
> > + if (adapter->flags & IGC_FLAG_QUEUE_PAIRS) {
> > + netif_queue_set_napi(netdev, q_idx, NETDEV_QUEUE_TYPE_RX,
> > + NULL);
> > + netif_queue_set_napi(netdev, q_idx, NETDEV_QUEUE_TYPE_TX,
> > + NULL);
> > + } else {
> > + if (q_idx < adapter->num_rx_queues) {
> > + netif_queue_set_napi(adapter->netdev, q_idx,
> > + NETDEV_QUEUE_TYPE_RX, NULL);
> > + } else {
> > + q_idx -= adapter->num_rx_queues;
> > + netif_queue_set_napi(adapter->netdev, q_idx,
> > + NETDEV_QUEUE_TYPE_TX, NULL);
> > + }
> > + }
> > +}
>
> It seems that igc_unset_queue_napi() is igc_set_queue_napi(x, y, NULL),
> so I would suggest either implementing "unset" in terms of "set", or
> using igc_set_queue_napi(x, y, NULL) directly in the "unlink" case (I
> have a slight preference for the second option).
Ah, yes, of course. That is much simpler; I'll go with the second
option for the v3. Thank you for catching that in your review.
Unless any other significant feedback comes in, I'll likely send the
v3 as a PATCH instead of an RFC later this week.
Powered by blists - more mailing lists