From: Simon Horman <horms@kernel.org>
To: David Wei <dw@davidwei.uk>
Cc: Michael Chan <michael.chan@broadcom.com>,
Andy Gospodarek <andrew.gospodarek@broadcom.com>,
Adrian Alvarado <adrian.alvarado@broadcom.com>,
Somnath Kotur <somnath.kotur@broadcom.com>,
netdev@vger.kernel.org, Pavel Begunkov <asml.silence@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
David Ahern <dsahern@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next v1 3/3] bnxt_en: implement netdev_queue_mgmt_ops
Date: Fri, 14 Jun 2024 21:07:51 +0100 [thread overview]
Message-ID: <20240614200751.GY8447@kernel.org> (raw)
In-Reply-To: <20240611023324.1485426-4-dw@davidwei.uk>
On Mon, Jun 10, 2024 at 07:33:24PM -0700, David Wei wrote:
> Implement netdev_queue_mgmt_ops for bnxt added in [1].
>
> Two bnxt_rx_ring_info structs are allocated to hold the new/old queue
> memory. Queue memory is copied from/to the main bp->rx_ring[idx]
> bnxt_rx_ring_info.
>
> Queue memory is pre-allocated in bnxt_queue_mem_alloc() into a clone,
> and then copied into bp->rx_ring[idx] in bnxt_queue_mem_start().
>
> Similarly, when bp->rx_ring[idx] is stopped its queue memory is copied
> into a clone, and then freed later in bnxt_queue_mem_free().
>
> I tested this patchset with netdev_rx_queue_restart(), including
> inducing errors in all places that returns an error code. In all cases,
> the queue is left in a good working state.
>
> Rx queues are stopped/started using bnxt_hwrm_vnic_update(), which only
> affects queues that are not in the default RSS context. This is
> different to the GVE that also implemented the queue API recently where
> arbitrary Rx queues can be stopped. Due to this limitation, all ndos
> returns EOPNOTSUPP if the queue is in the default RSS context.
>
> Thanks to Somnath for helping me with using bnxt_hwrm_vnic_update() to
> stop/start an Rx queue. With their permission I've added them as
> Acked-by.
>
> [1]: https://lore.kernel.org/netdev/20240501232549.1327174-2-shailend@google.com/
>
> Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Signed-off-by: David Wei <dw@davidwei.uk>
> ---
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 307 ++++++++++++++++++++++
> 1 file changed, 307 insertions(+)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
...
> +static void bnxt_queue_mem_free(struct net_device *dev, void *qmem)
> +{
> + struct bnxt_rx_ring_info *rxr = qmem;
> + struct bnxt *bp = netdev_priv(dev);
> + struct bnxt_ring_struct *ring;
> +
> + if (bnxt_get_max_rss_ring(bp) >= idx)
> + return -EOPNOTSUPP;
Hi David,
I guess there was some last minute refactoring and these sloped through the
cracks. The two lines above seem a bit out of place here.
* idx doesn't exist in this context
* The return type of this function is void
> +
> + bnxt_free_one_rx_ring(bp, rxr);
> + bnxt_free_one_rx_agg_ring(bp, rxr);
> +
> + /* At this point, this NAPI instance has another page pool associated
> + * with it. Disconnect here before freeing the old page pool to avoid
> + * warnings.
> + */
> + rxr->page_pool->p.napi = NULL;
> + page_pool_destroy(rxr->page_pool);
> + rxr->page_pool = NULL;
> +
> + ring = &rxr->rx_ring_struct;
> + bnxt_free_ring(bp, &ring->ring_mem);
> +
> + ring = &rxr->rx_agg_ring_struct;
> + bnxt_free_ring(bp, &ring->ring_mem);
> +
> + kfree(rxr->rx_agg_bmap);
> + rxr->rx_agg_bmap = NULL;
> +}
...
next prev parent reply other threads:[~2024-06-14 20:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 2:33 [PATCH net-next v1 0/3] bnxt_en: implement netdev_queue_mgmt_ops David Wei
2024-06-11 2:33 ` [PATCH net-next v1 1/3] bnxt_en: Add support to call FW to update a VNIC David Wei
2024-06-11 2:33 ` [PATCH net-next v1 2/3] bnxt_en: split rx ring helpers out from ring helpers David Wei
2024-06-14 20:01 ` Simon Horman
2024-06-11 2:33 ` [PATCH net-next v1 3/3] bnxt_en: implement netdev_queue_mgmt_ops David Wei
2024-06-14 20:07 ` Simon Horman [this message]
2024-06-18 4:36 ` David Wei
2024-06-11 2:40 ` [PATCH net-next v1 0/3] " David Ahern
2024-06-11 3:41 ` David Wei
2024-06-12 15:52 ` David Ahern
2024-06-12 18:19 ` David Wei
2024-06-12 21:11 ` Jakub Kicinski
2024-06-12 21:54 ` Andy Gospodarek
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=20240614200751.GY8447@kernel.org \
--to=horms@kernel.org \
--cc=adrian.alvarado@broadcom.com \
--cc=andrew.gospodarek@broadcom.com \
--cc=asml.silence@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=dw@davidwei.uk \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=somnath.kotur@broadcom.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 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.