[RFC,v2,25/26] config: make queues per port a meson config option

Message ID 20240813160003.423935-26-bruce.richards@intel.com (mailing list archive)
State Superseded
Delegated to: Thomas Monjalon
Headers
Series add meson config options for queues per port |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Aug. 13, 2024, 4 p.m. UTC
From: Bruce Richardson <bruce.richardson@intel.com>

The default number of ethernet queues per port is currently set to
1k which is more than enough for most applications, but still is lower
than the total number of queues which may be available on modern NICs.
Rather than increasing the max queues further, which will increase
the memory footprint (since the value is used in array dimensioning),
we can instead make the value a meson tunable option - and reduce the
default value to 256 in the process. This means that:

* most apps which don't need hundreds of queues will see lower mem use.
* apps which do need to use thousands of queues can configure DPDK to
  allow this, without having to modify DPDK files (i.e. rte_config.h)

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build                     |  2 ++
 config/rte_config.h                    |  3 ---
 doc/guides/rel_notes/release_24_11.rst | 13 +++++++++++--
 meson_options.txt                      |  4 ++++
 4 files changed, 17 insertions(+), 5 deletions(-)
  

Patch

diff --git a/config/meson.build b/config/meson.build
index 8c8b019c25..fc41354c53 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -352,6 +352,8 @@  endforeach
 
 # set other values pulled from the build options
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
+dpdk_conf.set('RTE_MAX_ETHPORT_RX_QUEUES', get_option('max_ethport_rx_queues'))
+dpdk_conf.set('RTE_MAX_ETHPORT_TX_QUEUES', get_option('max_ethport_tx_queues'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_STDATOMIC', get_option('enable_stdatomic'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
diff --git a/config/rte_config.h b/config/rte_config.h
index 2c11b4eeec..7450e0d648 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -64,9 +64,6 @@ 
 #define RTE_MBUF_DEFAULT_MEMPOOL_OPS "ring_mp_mc"
 
 /* ether defines */
-#define RTE_MAX_QUEUES_PER_PORT 1024
-#define RTE_MAX_ETHPORT_RX_QUEUES 1024
-#define RTE_MAX_ETHPORT_TX_QUEUES 1024
 #define RTE_ETHDEV_QUEUE_STAT_CNTRS 16 /* max 256 */
 #define RTE_ETHDEV_RXTX_CALLBACKS 1
 #define RTE_MAX_MULTI_HOST_CTRLS 4
diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst
index 3725c056ba..825cc0fad9 100644
--- a/doc/guides/rel_notes/release_24_11.rst
+++ b/doc/guides/rel_notes/release_24_11.rst
@@ -58,8 +58,17 @@  New Features
 * **New configuration settings for Rx and Tx Ethernet Queues.**
 
    New defines have been added to DPDK to allow independent tracking of the maximum number of Rx and Tx queues.
-   These defines as ``RTE_MAX_ETHPORT_RX_QUEUES`` and ``RTE_MAX_ETHPORT_TX_QUEUES``,
-   and should be used in place of the older macro ``RTE_MAX_QUEUES_PER_PORT``.
+   These defines are ``RTE_MAX_ETHPORT_RX_QUEUES`` and ``RTE_MAX_ETHPORT_TX_QUEUES``,
+   and these new defines should be used in place of the older define ``RTE_MAX_QUEUES_PER_PORT``.
+   Unlike the older define, these new defines are build-time configurable via meson options:
+   ``max_ethport_rx_queues`` and ``max_ethport_tx_queues``.
+
+.. note::
+
+   The default max values for Rx and Tx queue limits are reduced from 1024, in previous releases,
+   to 256 in this release.
+   For application that require large numbers of queues,
+   these defaults can be changed via the meson configuration options described above.
 
 
 Removed Items
diff --git a/meson_options.txt b/meson_options.txt
index e49b2fc089..a9a7052ba6 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -40,6 +40,10 @@  option('machine', type: 'string', value: 'auto', description:
        'Alias of cpu_instruction_set.')
 option('max_ethports', type: 'integer', value: 32, description:
        'maximum number of Ethernet devices')
+option('max_ethport_rx_queues', type: 'integer', value: 256, description:
+       'maximum number of Rx queues on an Ethernet device')
+option('max_ethport_tx_queues', type: 'integer', value: 256, description:
+       'maximum number of Tx queues on an Ethernet device')
 option('max_lcores', type: 'string', value: 'default', description:
        'Set maximum number of cores/threads supported by EAL; "default" is different per-arch, "detect" detects the number of cores on the build machine.')
 option('max_numa_nodes', type: 'string', value: 'default', description: