mbox series

[net-next,v1,0/3] bnxt_en: implement netdev_queue_mgmt_ops

Message ID 20240611023324.1485426-1-dw@davidwei.uk (mailing list archive)
Headers show
Series bnxt_en: implement netdev_queue_mgmt_ops | expand

Message

David Wei June 11, 2024, 2:33 a.m. UTC
Implement netdev_queue_mgmt_ops for bnxt added in [1]. This will be used
in the io_uring ZC Rx patchset to configure queues with a custom page
pool w/ a special memory provider for zero copy support.

The first two patches prep the driver, while the final patch adds the
implementation.

This implementation can only reset Rx queues that are _not_ in the main
RSS context. That is, ethtool -X must be called to reserve a number of
queues outside of the main RSS context, and only these queues work with
netdev_queue_mgmt_ops. Otherwise, EOPNOTSUPP is returned.

I didn't include the netdev core API using this netdev_queue_mgmt_ops
because Mina is adding it in his devmem TCP series [2]. But I'm happy to
include it if folks want to include a user with this series.

I tested this series on BCM957504-N1100FY4 with FW 229.1.123.0. I
manually injected failures at all the places that can return an errno
and confirmed that the device/queue is never left in a broken state.

[1]: https://lore.kernel.org/netdev/20240501232549.1327174-2-shailend@google.com/
[2]: https://lore.kernel.org/netdev/20240607005127.3078656-2-almasrymina@google.com/

David Wei (2):
  bnxt_en: split rx ring helpers out from ring helpers
  bnxt_en: implement queue API

Michael Chan (1):
  bnxt_en: Add support to call FW to update a VNIC

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 623 +++++++++++++++---
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |   3 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h |  37 ++
 3 files changed, 555 insertions(+), 108 deletions(-)

Comments

David Ahern June 11, 2024, 2:40 a.m. UTC | #1
On 6/10/24 8:33 PM, David Wei wrote:
> Implement netdev_queue_mgmt_ops for bnxt added in [1]. This will be used
> in the io_uring ZC Rx patchset to configure queues with a custom page
> pool w/ a special memory provider for zero copy support.
> 


I do not see it explicitly called out, so asking here: does this change
enable / require header split if using memory from this "special memory
provider"?
David Wei June 11, 2024, 3:41 a.m. UTC | #2
On 2024-06-10 19:40, David Ahern wrote:
> On 6/10/24 8:33 PM, David Wei wrote:
>> Implement netdev_queue_mgmt_ops for bnxt added in [1]. This will be used
>> in the io_uring ZC Rx patchset to configure queues with a custom page
>> pool w/ a special memory provider for zero copy support.
>>
> 
> 
> I do not see it explicitly called out, so asking here: does this change
> enable / require header split if using memory from this "special memory
> provider"?

This patchset is orthogonal to header split and page pool memory
providers. It implements netdev_queue_mgmt_ops which enables dynamically
resetting a single Rx queue without needing a full device close/open,
and pre-allocates queue descriptor memory _before_ stopping the queue to
minimise downtime. It shows that, with FW support and carefully written
code, it is possible for drivers to move away from doing full resets on
changes.

My first intent is to use it for reconfiguring an Rx queue with a
different page pool, but that isn't the only purpose. For example, it
opens up the possibility of dynamically creating queues that share a
single napi instance.
David Ahern June 12, 2024, 3:52 p.m. UTC | #3
On 6/10/24 9:41 PM, David Wei wrote:
> 
> This patchset is orthogonal to header split and page pool memory
> providers. It implements netdev_queue_mgmt_ops which enables dynamically

Ok, where is the validation that these queues must be configured for
header-data split to use non-kernel memory?
David Wei June 12, 2024, 6:19 p.m. UTC | #4
On 2024-06-12 08:52, David Ahern wrote:
> On 6/10/24 9:41 PM, David Wei wrote:
>>
>> This patchset is orthogonal to header split and page pool memory
>> providers. It implements netdev_queue_mgmt_ops which enables dynamically
> 
> Ok, where is the validation that these queues must be configured for
> header-data split to use non-kernel memory?

Any validation would be done outside of this patchset, which only
focuses on resetting an Rx queue. Reconfiguring page pools and HDS is
orthogonal and unrelated to this patchset.

The netdev core API consuming netdev_queue_mgmt_ops would be
netdev_rx_queue_restart() added in [1].

[1]: https://lore.kernel.org/lkml/20240607005127.3078656-2-almasrymina@google.com/

Validation would be done at a layer above, i.e. whatever that calls
netdev_rx_queue_restart(), as opposed to netdev_rx_queue_restart() or
netdev_queue_mgmt_ops itself.
Jakub Kicinski June 12, 2024, 9:11 p.m. UTC | #5
On Wed, 12 Jun 2024 11:19:47 -0700 David Wei wrote:
> Any validation would be done outside of this patchset, which only
> focuses on resetting an Rx queue. Reconfiguring page pools and HDS is
> orthogonal and unrelated to this patchset.
> 
> The netdev core API consuming netdev_queue_mgmt_ops would be
> netdev_rx_queue_restart() added in [1].
> 
> [1]: https://lore.kernel.org/lkml/20240607005127.3078656-2-almasrymina@google.com/
> 
> Validation would be done at a layer above, i.e. whatever that calls
> netdev_rx_queue_restart(), as opposed to netdev_rx_queue_restart() or
> netdev_queue_mgmt_ops itself.

One could be tempted to pass a "configuration" object to tell the
driver that this queue will be required to run with HDS enabled.
I wonder where I've seen such a thing...
Andy Gospodarek June 12, 2024, 9:54 p.m. UTC | #6
On Wed, Jun 12, 2024 at 11:19:47AM -0700, David Wei wrote:
> On 2024-06-12 08:52, David Ahern wrote:
> > On 6/10/24 9:41 PM, David Wei wrote:
> >>
> >> This patchset is orthogonal to header split and page pool memory
> >> providers. It implements netdev_queue_mgmt_ops which enables dynamically
> > 
> > Ok, where is the validation that these queues must be configured for
> > header-data split to use non-kernel memory?
> 
> Any validation would be done outside of this patchset, which only
> focuses on resetting an Rx queue. Reconfiguring page pools and HDS is
> orthogonal and unrelated to this patchset.

I can confirm this.  These changes are just to keep the allocation
schemes the same as they are today, but add support for stopping/freeing
and starting/allocating rings individually and via the new API.

> The netdev core API consuming netdev_queue_mgmt_ops would be
> netdev_rx_queue_restart() added in [1].
> 
> [1]: https://lore.kernel.org/lkml/20240607005127.3078656-2-almasrymina@google.com/
> 
> Validation would be done at a layer above, i.e. whatever that calls
> netdev_rx_queue_restart(), as opposed to netdev_rx_queue_restart() or
> netdev_queue_mgmt_ops itself.