ice: lower default irq/queue counts on high-core systems
Subsystems (3)
PATCH 1/1 ice: lower default irq/queue counts on high-core systems
On some high-core systems loading ice driver with default values can lead to queue/irq exhaustion. It will result in no additional resources for SR-IOV.
In most cases there is no performance reason for more than 64 queues. Limit the default value to 64. Still, using ethtool the number of queues can be changed up to num_online_cpus().
This change affects only the default queue amount on systems with more than 64 cores.
--- drivers/net/ethernet/intel/ice/ice.h | 20 ++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_irq.c | 6 ++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 8 ++++---- 3 files changed, 28 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +20 -0
@@ -1133,4 +1133,24 @@ static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) else return &pf->adapter->ctrl_pf->hw; } + +/** +* ice_capped_num_cpus - normalize the number of CPUs to a reasonable limit +* +* This function returns the number of online CPUs, but caps it at suitable +* default to prevent excessive resource allocation on systems with very high +* CPU counts. +* +* Note: suitable default is currently at 64, which is reflected in default_cpus +* constant. In most cases there is no much benefit for more than 64 and it is a +* power of 2 number. +* +* Return: number of online CPUs, capped at suitable default. +*/ +static inline u16 ice_capped_num_cpus (void ) +{ +const int default_cpus =64 ; + +return min (num_online_cpus (), default_cpus); +}#endif /* _ICE_H_ */
drivers/net/ethernet/intel/ice/ice_irq.c +4 -2
@@ -106,9 +106,11 @@ static struct ice_irq_entry *ice_get_irq_res(struct ice_pf *pf,#define ICE_RDMA_AEQ_MSIX 1static int ice_get_default_msix_amount (struct ice_pf *pf) { -return ICE_MIN_LAN_OICR_MSIX +num_online_cpus () + +u16 cpus =ice_capped_num_cpus (); + +return ICE_MIN_LAN_OICR_MSIX + cpus + (test_bit (ICE_FLAG_FD_ENA , pf->flags) ?ICE_FDIR_MSIX :0 ) + - (ice_is_rdma_ena (pf) ?num_online_cpus () +ICE_RDMA_AEQ_MSIX :0 ); + (ice_is_rdma_ena (pf) ? cpus +ICE_RDMA_AEQ_MSIX :0 ); }/**
drivers/net/ethernet/intel/ice/ice_lib.c +4 -4
@@ -159,12 +159,12 @@ static void ice_vsi_set_num_desc(struct ice_vsi *vsi)static u16 ice_get_rxq_count (struct ice_pf *pf) { -return min (ice_get_avail_rxq_count (pf),num_online_cpus ()); +return min (ice_get_avail_rxq_count (pf),ice_capped_num_cpus ()); }static u16 ice_get_txq_count (struct ice_pf *pf) { -return min (ice_get_avail_txq_count (pf),num_online_cpus ()); +return min (ice_get_avail_txq_count (pf),ice_capped_num_cpus ()); }/**
@@ -907,13 +907,13 @@ static void ice_vsi_set_rss_params(struct ice_vsi *vsi)if (vsi->type ==ICE_VSI_CHNL ) vsi->rss_size =min_t (u16, vsi->num_rxq, max_rss_size);else - vsi->rss_size =min_t (u16,num_online_cpus (), + vsi->rss_size =min_t (u16,ice_capped_num_cpus (), max_rss_size); vsi->rss_lut_type =ICE_LUT_PF ;break ;case ICE_VSI_SF : vsi->rss_table_size =ICE_LUT_VSI_SIZE ; - vsi->rss_size =min_t (u16,num_online_cpus (), max_rss_size); + vsi->rss_size =min_t (u16,ice_capped_num_cpus (), max_rss_size); vsi->rss_lut_type =ICE_LUT_VSI ;break ;case ICE_VSI_VF :
Signature · 1 line
2.49.0
Dear Michal,
Thank you for the patch. I’d mention the 64 in the summary:
Quoted 1 line
ice: lower default irq/queue counts to 64 on > 64 core systems
Am 16.10.25 um 08:22 schrieb Michal Swiatkowski:
Quoted 10 lines
On some high-core systems loading ice driver with default values can lead to queue/irq exhaustion. It will result in no additional resources for SR-IOV.
In most cases there is no performance reason for more than 64 queues. Limit the default value to 64. Still, using ethtool the number of queues can be changed up to
num_online_cpus().This change affects only the default queue amount on systems with more than 64 cores.
Please document a specific system and steps to reproduce the issue.
Please also document how to override the value.
Quoted 16 lines
Reviewed-by Jacob Keller <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/ice/ice.h | 20 ++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_irq.c | 6 ++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 8 ++++---- 3 files changed, 28 insertions(+), 6 deletions(-)drivers/net/ethernet/intel/ice/ice.h +0
-0@@ -1133,4 +1133,24 @@ static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf)else return &pf->adapter->ctrl_pf->hw; }
drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1145
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice.h +10
-0+ +/** +* ice_capped_num_cpus - normalize the number of CPUs to a reasonable limit +* +* This function returns the number of online CPUs, but caps it at suitable +* default to prevent excessive resource allocation on systems with very high +* CPU counts. +* +* Note: suitable default is currently at 64, which is reflected in default_cpus +* constant. In most cases there is no much benefit for more than 64 and it is a
no*t* much
drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1150
Quoted 5 lines
drivers/net/ethernet/intel/ice/ice.h +5
-0+* power of 2 number. +* +* Return: number of online CPUs, capped at suitable default. +*/ +static inline u16 ice_capped_num_cpus (void )
Why not return unsigned int or size_t?
Quoted 49 lines
drivers/net/ethernet/intel/ice/ice.h +5
-0+{ +const int default_cpus =64 ; + +return min (num_online_cpus (), default_cpus); +}#endif /* _ICE_H_ */ drivers/net/ethernet/intel/ice/ice_irq.c +4
-2@@ -106,9 +106,11 @@ static struct ice_irq_entry *ice_get_irq_res(struct ice_pf *pf,#define ICE_RDMA_AEQ_MSIX 1static int ice_get_default_msix_amount (struct ice_pf *pf) { -return ICE_MIN_LAN_OICR_MSIX +num_online_cpus () + +u16 cpus =ice_capped_num_cpus (); + +return ICE_MIN_LAN_OICR_MSIX + cpus + (test_bit (ICE_FLAG_FD_ENA , pf->flags) ?ICE_FDIR_MSIX :0 ) + - (ice_is_rdma_ena (pf) ?num_online_cpus () +ICE_RDMA_AEQ_MSIX :0 ); + (ice_is_rdma_ena (pf) ? cpus +ICE_RDMA_AEQ_MSIX :0 ); }/** drivers/net/ethernet/intel/ice/ice_lib.c +3
-3@@ -159,12 +159,12 @@ static void ice_vsi_set_num_desc(struct ice_vsi *vsi)static u16 ice_get_rxq_count (struct ice_pf *pf) { -return min (ice_get_avail_rxq_count (pf),num_online_cpus ()); +return min (ice_get_avail_rxq_count (pf),ice_capped_num_cpus ()); }static u16 ice_get_txq_count (struct ice_pf *pf) { -return min (ice_get_avail_txq_count (pf),num_online_cpus ()); +return min (ice_get_avail_txq_count (pf),ice_capped_num_cpus ()); }/** @@ -907,13 +907,13 @@ static void ice_vsi_set_rss_params(struct ice_vsi *vsi)if (vsi->type ==ICE_VSI_CHNL ) vsi->rss_size =min_t (u16, vsi->num_rxq, max_rss_size);else - vsi->rss_size = min_t(u16, num_online_cpus(), + vsi->rss_size = min_t(u16, ice_capped_num_cpus(),
drivers/net/ethernet/intel/ice/ice_lib.c static void ice_vsi_set_rss_params(struct ice_vsi *vsi) · line 919
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_lib.c +1
-1max_rss_size); vsi->rss_lut_type =ICE_LUT_PF ;break ;case ICE_VSI_SF : vsi->rss_table_size =ICE_LUT_VSI_SIZE ; - vsi->rss_size =min_t (u16,num_online_cpus (), max_rss_size); + vsi->rss_size =min_t (u16,ice_capped_num_cpus (), max_rss_size); vsi->rss_lut_type =ICE_LUT_VSI ;break ;case ICE_VSI_VF :
With the changes addressed, feel free to add:
Kind regards,
Paul
Quoted 5 lines · Paul Menzel
Dear Michal,
Thank you for the patch. I’d mention the 64 in the summary:
Sure, I will add it.
Quoted 12 lines
Quoted 1 line
ice: lower default irq/queue counts to 64 on > 64 core systems
Am 16.10.25 um 08:22 schrieb Michal Swiatkowski:
Quoted 8 lines
On some high-core systems loading ice driver with default values can lead to queue/irq exhaustion. It will result in no additional resources for SR-IOV.
In most cases there is no performance reason for more than 64 queues. Limit the default value to 64. Still, using ethtool the number of queues can be changed up to
num_online_cpus().
Quoted 6 lines
Quoted 2 lines
This change affects only the default queue amount on systems with more than 64 cores.
Please document a specific system and steps to reproduce the issue.
Please also document how to override the value.
Ok, will add.
Quoted 21 lines
Quoted 21 lines
Reviewed-by Jacob Keller <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/ice/ice.h | 20 ++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_irq.c | 6 ++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 8 ++++---- 3 files changed, 28 insertions(+), 6 deletions(-)drivers/net/ethernet/intel/ice/ice.h +4
-0@@ -1133,4 +1133,24 @@ static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf)else return &pf->adapter->ctrl_pf->hw; } + +/** +* ice_capped_num_cpus - normalize the number of CPUs to a reasonable limit +*
Quoted 9 lines
drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1145
Quoted 6 lines
drivers/net/ethernet/intel/ice/ice.h +6
-0+* This function returns the number of online CPUs, but caps it at suitable +* default to prevent excessive resource allocation on systems with very high +* CPU counts. +* +* Note: suitable default is currently at 64, which is reflected in default_cpus +* constant. In most cases there is no much benefit for more than 64 and it is a no*t* much
Will fix
Quoted 8 lines
drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1150
Quoted 5 lines
drivers/net/ethernet/intel/ice/ice.h +5
-0+* power of 2 number. +* +* Return: number of online CPUs, capped at suitable default. +*/ +static inline u16 ice_capped_num_cpus (void )Why not return
unsigned intorsize_t?
Just because u16 is used for queue counts, but I can go with unsigned int, makes more sense as num_online_cpus() is returning unsigned int.
Quoted 58 lines
Quoted 45 lines
drivers/net/ethernet/intel/ice/ice.h +5
-0+{ +const int default_cpus =64 ; + +return min (num_online_cpus (), default_cpus); +}#endif /* _ICE_H_ */ drivers/net/ethernet/intel/ice/ice_irq.c +4
-2@@ -106,9 +106,11 @@ static struct ice_irq_entry *ice_get_irq_res(struct ice_pf *pf,#define ICE_RDMA_AEQ_MSIX 1static int ice_get_default_msix_amount (struct ice_pf *pf) { -return ICE_MIN_LAN_OICR_MSIX +num_online_cpus () + +u16 cpus =ice_capped_num_cpus (); + +return ICE_MIN_LAN_OICR_MSIX + cpus + (test_bit (ICE_FLAG_FD_ENA , pf->flags) ?ICE_FDIR_MSIX :0 ) + - (ice_is_rdma_ena (pf) ?num_online_cpus () +ICE_RDMA_AEQ_MSIX :0 ); + (ice_is_rdma_ena (pf) ? cpus +ICE_RDMA_AEQ_MSIX :0 ); }/** drivers/net/ethernet/intel/ice/ice_lib.c +3
-3@@ -159,12 +159,12 @@ static void ice_vsi_set_num_desc(struct ice_vsi *vsi)static u16 ice_get_rxq_count (struct ice_pf *pf) { -return min (ice_get_avail_rxq_count (pf),num_online_cpus ()); +return min (ice_get_avail_rxq_count (pf),ice_capped_num_cpus ()); }static u16 ice_get_txq_count (struct ice_pf *pf) { -return min (ice_get_avail_txq_count (pf),num_online_cpus ()); +return min (ice_get_avail_txq_count (pf),ice_capped_num_cpus ()); }/** @@ -907,13 +907,13 @@ static void ice_vsi_set_rss_params(struct ice_vsi *vsi)if (vsi->type ==ICE_VSI_CHNL ) vsi->rss_size =min_t (u16, vsi->num_rxq, max_rss_size);else - vsi->rss_size = min_t(u16, num_online_cpus(), + vsi->rss_size = min_t(u16, ice_capped_num_cpus(),drivers/net/ethernet/intel/ice/ice_lib.c static void ice_vsi_set_rss_params(struct ice_vsi *vsi) · line 919
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_lib.c +1
-1max_rss_size); vsi->rss_lut_type =ICE_LUT_PF ;break ;case ICE_VSI_SF : vsi->rss_table_size =ICE_LUT_VSI_SIZE ; - vsi->rss_size =min_t (u16,num_online_cpus (), max_rss_size); + vsi->rss_size =min_t (u16,ice_capped_num_cpus (), max_rss_size); vsi->rss_lut_type =ICE_LUT_VSI ;break ;case ICE_VSI_VF :With the changes addressed, feel free to add:
Quoted 2 lines
Reviewed-by Paul Menzel <[email protected]>
Thanks
Quoted 4 lines
Kind regards,
Paul
From: Michal Swiatkowski <[email protected]>
Date: Thu, 16 Oct 2025 08:22:50 +0200
Quoted 34 lines
On some high-core systems loading ice driver with default values can lead to queue/irq exhaustion. It will result in no additional resources for SR-IOV.
In most cases there is no performance reason for more than 64 queues. Limit the default value to 64. Still, using ethtool the number of queues can be changed up to
num_online_cpus().This change affects only the default queue amount on systems with more than 64 cores.
Reviewed-by Jacob Keller <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/ice/ice.h | 20 ++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_irq.c | 6 ++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 8 ++++---- 3 files changed, 28 insertions(+), 6 deletions(-)drivers/net/ethernet/intel/ice/ice.h +7
-0@@ -1133,4 +1133,24 @@ static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf)else return &pf->adapter->ctrl_pf->hw; } + +/** +* ice_capped_num_cpus - normalize the number of CPUs to a reasonable limit +* +* This function returns the number of online CPUs, but caps it at suitable +* default to prevent excessive resource allocation on systems with very high +* CPU counts.
drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1152
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice.h +10
-0+* +* Note: suitable default is currently at 64, which is reflected in default_cpus +* constant. In most cases there is no much benefit for more than 64 and it is a +* power of 2 number. +* +* Return: number of online CPUs, capped at suitable default. +*/ +static inline u16 ice_capped_num_cpus (void ) +{ +const int default_cpus =64 ;
Maybe we should just use netif_get_num_default_rss_queues() like I did in idpf?
Or it still can be too high e.g. on clusters with > 256 CPUs?
drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1156
Quoted 4 lines
drivers/net/ethernet/intel/ice/ice.h +3
-0+ + return min(num_online_cpus(), default_cpus); +}#endif /* _ICE_H_ */
Thanks,
Olek
Przemek Kitszel
maintainerQuoted 51 lines · Alexander Lobakin
From: Michal Swiatkowski <[email protected]>
Date: Thu, 16 Oct 2025 08:22:50 +0200Quoted 34 lines
On some high-core systems loading ice driver with default values can lead to queue/irq exhaustion. It will result in no additional resources for SR-IOV.
In most cases there is no performance reason for more than 64 queues. Limit the default value to 64. Still, using ethtool the number of queues can be changed up to
num_online_cpus().This change affects only the default queue amount on systems with more than 64 cores.
Reviewed-by Jacob Keller <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/ice/ice.h | 20 ++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_irq.c | 6 ++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 8 ++++---- 3 files changed, 28 insertions(+), 6 deletions(-)drivers/net/ethernet/intel/ice/ice.h +7
-0@@ -1133,4 +1133,24 @@ static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf)else return &pf->adapter->ctrl_pf->hw; } + +/** +* ice_capped_num_cpus - normalize the number of CPUs to a reasonable limit +* +* This function returns the number of online CPUs, but caps it at suitable +* default to prevent excessive resource allocation on systems with very high +* CPU counts. drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1152
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice.h +10
-0+* +* Note: suitable default is currently at 64, which is reflected in default_cpus +* constant. In most cases there is no much benefit for more than 64 and it is a +* power of 2 number. +* +* Return: number of online CPUs, capped at suitable default. +*/ +static inline u16 ice_capped_num_cpus (void ) +{ +const int default_cpus =64 ;Maybe we should just use
netif_get_num_default_rss_queues()like I did in idpf?
Quoted 1 line
Or it still can be too high e.g. on clusters with > 256 CPUs?
good point,
perhaps we should both use it and change the (kernel) func to cap at 64
Quoted 8 lines
drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1156
Quoted 5 lines
drivers/net/ethernet/intel/ice/ice.h +3
-0+ + return min(num_online_cpus(), default_cpus); +}#endif /* _ICE_H_ */ Thanks,
Olek
Quoted 52 lines · Przemek Kitszel
Quoted 51 lines · Alexander Lobakin
From: Michal Swiatkowski <[email protected]>
Date: Thu, 16 Oct 2025 08:22:50 +0200Quoted 34 lines
On some high-core systems loading ice driver with default values can lead to queue/irq exhaustion. It will result in no additional resources for SR-IOV.
In most cases there is no performance reason for more than 64 queues. Limit the default value to 64. Still, using ethtool the number of queues can be changed up to
num_online_cpus().This change affects only the default queue amount on systems with more than 64 cores.
Reviewed-by Jacob Keller <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/ice/ice.h | 20 ++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_irq.c | 6 ++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 8 ++++---- 3 files changed, 28 insertions(+), 6 deletions(-)drivers/net/ethernet/intel/ice/ice.h +7
-0@@ -1133,4 +1133,24 @@ static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf)else return &pf->adapter->ctrl_pf->hw; } + +/** +* ice_capped_num_cpus - normalize the number of CPUs to a reasonable limit +* +* This function returns the number of online CPUs, but caps it at suitable +* default to prevent excessive resource allocation on systems with very high +* CPU counts. drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1152
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice.h +10
-0+* +* Note: suitable default is currently at 64, which is reflected in default_cpus +* constant. In most cases there is no much benefit for more than 64 and it is a +* power of 2 number. +* +* Return: number of online CPUs, capped at suitable default. +*/ +static inline u16 ice_capped_num_cpus (void ) +{ +const int default_cpus =64 ;Maybe we should just use
netif_get_num_default_rss_queues()like I did in idpf?
Quoted 5 lines
Quoted 1 line
Or it still can be too high e.g. on clusters with > 256 CPUs?
good point,
perhaps we should both use it and change the (kernel) func to cap at 64
Sounds good, thanks for pointing the function.
Do you think it is ok to cap the generic function? Maybe other vendors want more default queues.
What about capping netif_get_num_default_rss_queues() at 64 just for ice?
Quoted 9 lines
Quoted 8 lines
drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1156
Quoted 5 lines
drivers/net/ethernet/intel/ice/ice.h +3
-0+ + return min(num_online_cpus(), default_cpus); +}#endif /* _ICE_H_ */ Thanks,
Olek
From: Michal Swiatkowski <[email protected]>
Date: Fri, 17 Oct 2025 09:30:44 +0200
Quoted 55 lines · Przemek Kitszel
Quoted 54 lines · Alexander Lobakin
Quoted 52 lines
From: Michal Swiatkowski <[email protected]>
Date: Thu, 16 Oct 2025 08:22:50 +0200Quoted 34 lines
On some high-core systems loading ice driver with default values can lead to queue/irq exhaustion. It will result in no additional resources for SR-IOV.
In most cases there is no performance reason for more than 64 queues. Limit the default value to 64. Still, using ethtool the number of queues can be changed up to
num_online_cpus().This change affects only the default queue amount on systems with more than 64 cores.
Reviewed-by Jacob Keller <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/ice/ice.h | 20 ++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_irq.c | 6 ++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 8 ++++---- 3 files changed, 28 insertions(+), 6 deletions(-)drivers/net/ethernet/intel/ice/ice.h +7
-0@@ -1133,4 +1133,24 @@ static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf)else return &pf->adapter->ctrl_pf->hw; } + +/** +* ice_capped_num_cpus - normalize the number of CPUs to a reasonable limit +* +* This function returns the number of online CPUs, but caps it at suitable +* default to prevent excessive resource allocation on systems with very high +* CPU counts. drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1152
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice.h +10
-0+* +* Note: suitable default is currently at 64, which is reflected in default_cpus +* constant. In most cases there is no much benefit for more than 64 and it is a +* power of 2 number. +* +* Return: number of online CPUs, capped at suitable default. +*/ +static inline u16 ice_capped_num_cpus (void ) +{ +const int default_cpus =64 ;Maybe we should just use
netif_get_num_default_rss_queues()like I did in idpf?Or it still can be too high e.g. on clusters with > 256 CPUs?
Quoted 8 lines
Quoted 3 lines
good point,
perhaps we should both use it and change the (kernel) func to cap at 64Sounds good, thanks for pointing the function.
Do you think it is ok to cap the generic function? Maybe other vendors want more default queues.
Nah I don't think it's a good idea to hardcode any numbers in the generic function.
Quoted 3 lines
What about capping
netif_get_num_default_rss_queues()at 64 just for ice?
netif_get_num_default_rss_queues() returns *half* of the number of *physical* cores. I.e. it will return something bigger than 64 only in case of > 256 threads in the system (considering SMT).
Do we need to still cap this to 64 in ice at all?
Thanks,
Olek
Quoted 71 lines · Alexander Lobakin
From: Michal Swiatkowski <[email protected]>
Date: Fri, 17 Oct 2025 09:30:44 +0200Quoted 55 lines · Przemek Kitszel
Quoted 54 lines · Alexander Lobakin
Quoted 52 lines
From: Michal Swiatkowski <[email protected]>
Date: Thu, 16 Oct 2025 08:22:50 +0200Quoted 34 lines
On some high-core systems loading ice driver with default values can lead to queue/irq exhaustion. It will result in no additional resources for SR-IOV.
In most cases there is no performance reason for more than 64 queues. Limit the default value to 64. Still, using ethtool the number of queues can be changed up to
num_online_cpus().This change affects only the default queue amount on systems with more than 64 cores.
Reviewed-by Jacob Keller <[email protected]>Signed-off-by Michal Swiatkowski <[email protected]>--- drivers/net/ethernet/intel/ice/ice.h | 20 ++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_irq.c | 6 ++++-- drivers/net/ethernet/intel/ice/ice_lib.c | 8 ++++---- 3 files changed, 28 insertions(+), 6 deletions(-)drivers/net/ethernet/intel/ice/ice.h +7
-0@@ -1133,4 +1133,24 @@ static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf)else return &pf->adapter->ctrl_pf->hw; } + +/** +* ice_capped_num_cpus - normalize the number of CPUs to a reasonable limit +* +* This function returns the number of online CPUs, but caps it at suitable +* default to prevent excessive resource allocation on systems with very high +* CPU counts. drivers/net/ethernet/intel/ice/ice.h static inline struct ice_hw *ice_get_primary_hw(struct ice_pf *pf) · line 1152
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice.h +10
-0+* +* Note: suitable default is currently at 64, which is reflected in default_cpus +* constant. In most cases there is no much benefit for more than 64 and it is a +* power of 2 number. +* +* Return: number of online CPUs, capped at suitable default. +*/ +static inline u16 ice_capped_num_cpus (void ) +{ +const int default_cpus =64 ;Maybe we should just use
netif_get_num_default_rss_queues()like I did in idpf?Or it still can be too high e.g. on clusters with > 256 CPUs?
Quoted 8 lines
Quoted 3 lines
good point,
perhaps we should both use it and change the (kernel) func to cap at 64Sounds good, thanks for pointing the function.
Do you think it is ok to cap the generic function? Maybe other vendors want more default queues.
Nah I don't think it's a good idea to hardcode any numbers in the generic function.
Quoted 1 line
Quoted 8 lines
Quoted 2 lines
What about capping
netif_get_num_default_rss_queues()at 64 just for ice?
netif_get_num_default_rss_queues()returns *half* of the number of *physical* cores. I.e. it will return something bigger than 64 only in case of > 256 threads in the system (considering SMT).Do we need to still cap this to 64 in ice at all?
That can be good enough. I will send next version with just call to this function.
Quoted 3 lines
Thanks,
Olek