[0/2] add function to set dedicated queue size

Message ID 20240605055520.2587034-1-chaoyong.he@corigine.com (mailing list archive)
Headers
Series add function to set dedicated queue size |

Message

Chaoyong He June 5, 2024, 5:55 a.m. UTC
This patch series mainly add a function to bonding PMD to set
dedicated queue size, also add a command to testpmd application
to invoke this function.

At the same time, standard the log message of bonding PMD.

Long Wu (2):
  net/bonding: standard the log message
  net/bonding: add command to set dedicated queue size

 .../link_bonding_poll_mode_drv_lib.rst        |   8 ++
 doc/guides/rel_notes/release_24_07.rst        |   4 +
 drivers/net/bonding/bonding_testpmd.c         | 126 ++++++++++++++----
 drivers/net/bonding/eth_bond_8023ad_private.h |   3 +
 drivers/net/bonding/rte_eth_bond_8023ad.c     |  39 ++++++
 drivers/net/bonding/rte_eth_bond_8023ad.h     |  23 ++++
 drivers/net/bonding/rte_eth_bond_pmd.c        |   6 +-
 drivers/net/bonding/version.map               |   1 +
 8 files changed, 185 insertions(+), 25 deletions(-)
  

Comments

Stephen Hemminger June 5, 2024, 3:57 p.m. UTC | #1
On Wed,  5 Jun 2024 13:55:18 +0800
Chaoyong He <chaoyong.he@corigine.com> wrote:

> This patch series mainly add a function to bonding PMD to set
> dedicated queue size, also add a command to testpmd application
> to invoke this function.
> 
> At the same time, standard the log message of bonding PMD.
> 
> Long Wu (2):
>   net/bonding: standard the log message
>   net/bonding: add command to set dedicated queue size
> 
>  .../link_bonding_poll_mode_drv_lib.rst        |   8 ++
>  doc/guides/rel_notes/release_24_07.rst        |   4 +
>  drivers/net/bonding/bonding_testpmd.c         | 126 ++++++++++++++----
>  drivers/net/bonding/eth_bond_8023ad_private.h |   3 +
>  drivers/net/bonding/rte_eth_bond_8023ad.c     |  39 ++++++
>  drivers/net/bonding/rte_eth_bond_8023ad.h     |  23 ++++
>  drivers/net/bonding/rte_eth_bond_pmd.c        |   6 +-
>  drivers/net/bonding/version.map               |   1 +
>  8 files changed, 185 insertions(+), 25 deletions(-)
> 

This is confusing.
The patch goes to all the effort to configure rx_queue_size but it is
never actually used in the driver.
  
Chaoyong He June 6, 2024, 1:41 a.m. UTC | #2
> On Wed,  5 Jun 2024 13:55:18 +0800
> Chaoyong He <chaoyong.he@corigine.com> wrote:
> 
> > This patch series mainly add a function to bonding PMD to set
> > dedicated queue size, also add a command to testpmd application to
> > invoke this function.
> >
> > At the same time, standard the log message of bonding PMD.
> >
> > Long Wu (2):
> >   net/bonding: standard the log message
> >   net/bonding: add command to set dedicated queue size
> >
> >  .../link_bonding_poll_mode_drv_lib.rst        |   8 ++
> >  doc/guides/rel_notes/release_24_07.rst        |   4 +
> >  drivers/net/bonding/bonding_testpmd.c         | 126 ++++++++++++++----
> >  drivers/net/bonding/eth_bond_8023ad_private.h |   3 +
> >  drivers/net/bonding/rte_eth_bond_8023ad.c     |  39 ++++++
> >  drivers/net/bonding/rte_eth_bond_8023ad.h     |  23 ++++
> >  drivers/net/bonding/rte_eth_bond_pmd.c        |   6 +-
> >  drivers/net/bonding/version.map               |   1 +
> >  8 files changed, 185 insertions(+), 25 deletions(-)
> >
> 
> This is confusing.
> The patch goes to all the effort to configure rx_queue_size but it is never
> actually used in the driver.

We do used it in the function 'member_configure_slow_queue()' of file 'drivers/net/bonding/rte_eth_bond_pmd.c'.

The original logic hardcodes the value of dedicated hardware Rx/Tx queue size into (128/512) and this will cause the
bonding port start fail if the NIC requires more Rx/Tx descriptors than the hardcoded number.

And this is the situation for our NFP card:
```
testpmd> port stop all
testpmd> create bonding device 4 0
testpmd> set bonding balance_xmit_policy 2 l34
testpmd> add bonding member 0 2
testpmd> add bonding member 1 2
testpmd> set bonding lacp dedicated_queues 2 enable
testpmd> show bonding config 2
testpmd> port start 2
Configuring Port 2 (socket 0)
ETHDEV: Device with port_id=0 already stopped
ETHDEV: Device with port_id=1 already stopped
ETHDEV: Device with port_id=0 already stopped
ETHDEV: Invalid value for nb_rx_desc(=128), should be: <= 32768, >= 512, and a product of 128
member_configure_slow_queue(1699) - rte_eth_rx_queue_setup: port=0 queue_id 1, err (-22)
ETHDEV: Device with port_id=1 already stopped
ETHDEV: Invalid value for nb_rx_desc(=128), should be: <= 32768, >= 512, and a product of 128
member_configure_slow_queue(1699) - rte_eth_rx_queue_setup: port=1 queue_id 1, err (-22)
Port 2: 88:3C:C5:A0:32:46
Checking link statuses...
Done
```

And if apply this patch and configure the 'rx_queue_size', then we can start the bonding port successfully.