ice: do not reserve resources for RDMA when disabled
Subsystems (3)
PATCH 1/1 ice: do not reserve resources for RDMA when disabled
From: Jesse Brandeburg <[email protected]>
If the CONFIG_INFINIBAND_IRDMA symbol is not enabled as a module or a built-in, then don't let the driver reserve resources for RDMA.
Do this by avoiding enabling the capability when scanning hardware capabilities.
--- drivers/net/ethernet/intel/ice/ice_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_common.c +2 -1
@@ -2174,7 +2174,8 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, caps->nvm_unified_update);break ;case ICE_AQC_CAPS_RDMA : - caps->rdma = (number ==1 ); +if (IS_ENABLED (CONFIG_INFINIBAND_IRDMA )) + caps->rdma = (number ==1 );ice_debug (hw,ICE_DBG_INIT ,"%s: rdma = %d\n" , prefix, caps->rdma);break ;case ICE_AQC_CAPS_MAX_MTU :
base-commit: 2d5404caa8c7bb5c4e0435f94b28834ae5456623
Signature · 1 line
2.39.5
Quoted 20 lines · On Wed, Nov 13, 2024 at 04:00:56PM -0800, [email protected] wrote:
From: Jesse Brandeburg <[email protected]>
If the
CONFIG_INFINIBAND_IRDMAsymbol is not enabled as a module or a built-in, then don't let the driver reserve resources for RDMA.Do this by avoiding enabling the capability when scanning hardware capabilities.
Fixes d25a0fc41c1f ("ice: Initialize RDMA support")CC Dave Ertman <[email protected]>Signed-off-by Jesse Brandeburg <[email protected]>--- drivers/net/ethernet/intel/ice/ice_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/ice/ice_common.c +0
-0
drivers/net/ethernet/intel/ice/ice_common.c ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, · line 2177
Quoted 5 lines
drivers/net/ethernet/intel/ice/ice_common.c +1
-1@@ -2174,7 +2174,8 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, caps->nvm_unified_update);break ;case ICE_AQC_CAPS_RDMA : - caps->rdma = (number ==1 ); +if (IS_ENABLED (CONFIG_INFINIBAND_IRDMA ))
ice_eth is not dependent on CONFIG_INFINIBAND_IRDMA and can be built perfectly without irdma. So technically, you disabled RDMA for such kernels and users won't be able to load out-of-tree built module.
I don't care about out-of-tree code, but it is worth to add into commit message, so users will know what to do it IRDMA stopped to work for them.
Thanks
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_common.c +1
-0+ caps->rdma = (number ==1 );ice_debug (hw,ICE_DBG_INIT ,"%s: rdma = %d\n" , prefix, caps->rdma);break ;case ICE_AQC_CAPS_MAX_MTU :base-commit:
2d5404caa8c7bb5c4e0435f94b28834ae5456623Signature · 1 line
2.39.5
Quoted 36 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Wednesday, November 13, 2024 4:01 PM
To: [email protected]
Cc: Brandeburg, Jesse <[email protected]>; Jesse Brandeburg <[email protected]>; [email protected]; Ertman, David M <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>
Subject: [PATCH net v1] ice: do not reserve resources for RDMA when disabledFrom: Jesse Brandeburg <[email protected]>
If the
CONFIG_INFINIBAND_IRDMAsymbol is not enabled as a module or a built-in, then don't let the driver reserve resources for RDMA.Do this by avoiding enabling the capability when scanning hardware capabilities.
Fixes d25a0fc41c1f ("ice: Initialize RDMA support")CC Dave Ertman <[email protected]>Signed-off-by Jesse Brandeburg <[email protected]>--- drivers/net/ethernet/intel/ice/ice_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/ice/ice_common.c +0
-0
drivers/net/ethernet/intel/ice/ice_common.c ice_parse_common_caps(struct ice_hw *hw, struct · line 2180
Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_common.c +2
-1@@ -2174,7 +2174,8 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, caps->nvm_unified_update);break ;case ICE_AQC_CAPS_RDMA : - caps->rdma = (number ==1 ); +if (IS_ENABLED (CONFIG_INFINIBAND_IRDMA )) + caps->rdma = (number ==1 ); ice_debug(hw, ICE_DBG_INIT, "%s: rdma = %d\n", prefix,
The HW caps struct should always accurately reflect the capabilities of the HW being probed. Since this is a kernel configuration (i.e. software) consideration, the more appropriate approach would be to control the PF flag "ICE_FLAG_RDMA_ENA" based on the kernel CONFIG setting.
Thanks,
DaveE
Quoted 7 lines · David M
drivers/net/ethernet/intel/ice/ice_common.c ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps,
Quoted 5 lines
case
ICE_AQC_CAPS_RDMA:drivers/net/ethernet/intel/ice/ice_common.c +2
-1- caps->rdma = (number ==1 ); +if (IS_ENABLED (CONFIG_INFINIBAND_IRDMA )) + caps->rdma = (number ==1 ); ice_debug(hw, ICE_DBG_INIT, "%s: rdma = %d\n", prefix,The HW caps struct should always accurately reflect the capabilities of the HW being probed. Since this
why must it accurately reflect the capability of the hardware? The driver state and capability is a reflection of the combination of both, so I'm not sure what the point of your statement.
Quoted 2 lines
is a kernel configuration (i.e. software) consideration, the more appropriate approach would be to control the PF flag "
ICE_FLAG_RDMA_ENA" based on the kernel CONFIG setting.
I started making the changes you suggested, but the ICE_FLAG_RDMA_ENA is blindly set by the LAG code, if the cap.rdma is enabled. see ice_set_rdma_cap(). This means the disable won't stick.
Unless I'm misunderstanding something, ICE_FLAG_RDMA_ENA is used both as a gate and as a state, which is a design issue. This leaves no choice but to implement the way I did in this v1 patch. Do you see any other option to make a simple change that is safe for backporting to stable?
Thanks,
Jesse
Quoted 9 lines · Jesse Brandeburg
Quoted 7 lines · David M
Quoted 5 lines
case
ICE_AQC_CAPS_RDMA:
-caps->rdma= (number == 1);
+ if (IS_ENABLED(CONFIG_INFINIBAND_IRDMA))
+caps->rdma= (number == 1);
ice_debug(hw,ICE_DBG_INIT, "%s: rdma = %d\n", prefix,The HW caps struct should always accurately reflect the capabilities of the HW being probed. Since this
Quoted 8 lines
why must it accurately reflect the capability of the hardware? The driver state and capability is a reflection of the combination of both, so I'm not sure what the point of your statement.
Quoted 2 lines
is a kernel configuration (i.e. software) consideration, the more appropriate approach would be to control the PF flag "
ICE_FLAG_RDMA_ENA" based on the kernel CONFIG setting.I started making the changes you suggested, but the
ICE_FLAG_RDMA_ENAis blindly set by the LAG code, if the cap.rdma is enabled. seeice_set_rdma_cap(). This means the disable won't stick.Unless I'm misunderstanding something,
ICE_FLAG_RDMA_ENAis used both as a gate and as a state, which is a design issue. This leaves no choice but to implement the way I did in this v1 patch. Do you see any other option to make a simple change that is safe for backporting to stable?
Any comments here Dave?
Ertman, David M
Acked-byQuoted 31 lines
-----Original Message-----
From: Jesse Brandeburg <[email protected]>
Sent: Thursday, November 21, 2024 5:50 PM
To: Ertman, David M <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH net v1] ice: do not reserve resources for RDMA when disabledQuoted 22 lines · Jesse Brandeburg
Quoted 8 lines · David M
Quoted 5 lines
case
ICE_AQC_CAPS_RDMA:
-caps->rdma= (number == 1);
+ if (IS_ENABLED(CONFIG_INFINIBAND_IRDMA))
+caps->rdma= (number == 1);
ice_debug(hw,ICE_DBG_INIT, "%s: rdma = %d\n", prefix,The HW caps struct should always accurately reflect the capabilities of the HW being probed. Since this
why must it accurately reflect the capability of the hardware? The driver state and capability is a reflection of the combination of both, so I'm not sure what the point of your statement.
Quoted 3 lines
is a kernel configuration (i.e. software) consideration, the more appropriate approach would be to control
the PF flag "ICE_FLAG_RDMA_ENA" based on the kernel CONFIG setting.I started making the changes you suggested, but the
ICE_FLAG_RDMA_ENAis blindly set by the LAG code, if the cap.rdma is enabled. seeice_set_rdma_cap(). This means the disable won't stick.
Quoted 6 lines
Quoted 4 lines
Unless I'm misunderstanding something,
ICE_FLAG_RDMA_ENAis used both as a gate and as a state, which is a design issue. This leaves no choice but to implement the way I did in this v1 patch. Do you see any other option to make a simple change that is safe for backporting to stable?Any comments here Dave?
Jesse,
Looking at the FLAG as used in the ice driver, it is used as an ephemeral state for the enablement of RDMA (gated by the value of the capabilities struct). So, I agree that a kernel-wide config value should not be tied to it as well.
Since the kernel config value will not change for the life of the driver, it should be OK to alter the capabilities struct value based on the kernel's configuration.
Sorry for the thrash.
DaveE
Przemek Kitszel
maintainer[CC IWL]
Quoted 52 lines · David M
Quoted 31 lines
-----Original Message-----
From: Jesse Brandeburg <[email protected]>
Sent: Thursday, November 21, 2024 5:50 PM
To: Ertman, David M <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH net v1] ice: do not reserve resources for RDMA when disabledQuoted 22 lines · Jesse Brandeburg
Quoted 8 lines · David M
Quoted 5 lines
case
ICE_AQC_CAPS_RDMA:
-caps->rdma= (number == 1);
+ if (IS_ENABLED(CONFIG_INFINIBAND_IRDMA))
+caps->rdma= (number == 1);
ice_debug(hw,ICE_DBG_INIT, "%s: rdma = %d\n", prefix,The HW caps struct should always accurately reflect the capabilities of the HW being probed. Since this
why must it accurately reflect the capability of the hardware? The driver state and capability is a reflection of the combination of both, so I'm not sure what the point of your statement.
Quoted 3 lines
is a kernel configuration (i.e. software) consideration, the more appropriate approach would be to control
the PF flag "ICE_FLAG_RDMA_ENA" based on the kernel CONFIG setting.I started making the changes you suggested, but the
ICE_FLAG_RDMA_ENAis blindly set by the LAG code, if the cap.rdma is enabled. seeice_set_rdma_cap(). This means the disable won't stick.Quoted 6 lines
Quoted 4 lines
Unless I'm misunderstanding something,
ICE_FLAG_RDMA_ENAis used both as a gate and as a state, which is a design issue. This leaves no choice but to implement the way I did in this v1 patch. Do you see any other option to make a simple change that is safe for backporting to stable?Any comments here Dave?
Jesse,
Looking at the FLAG as used in the ice driver, it is used as an ephemeral state for the enablement of RDMA (gated by the value of the capabilities struct). So, I agree that a kernel-wide config value should not be tied to it as well.
Since the kernel config value will not change for the life of the driver, it should be OK to alter the capabilities struct value based on the kernel's configuration.
Sorry for the thrash.
DaveE
Acked-by Dave Ertman <[email protected]>
Przemek Kitszel
maintainerQuoted 5 lines · On 11/14/24 01:00, [email protected] wrote:
From: Jesse Brandeburg <[email protected]>
If the
CONFIG_INFINIBAND_IRDMAsymbol is not enabled as a module or a built-in, then don't let the driver reserve resources for RDMA.
Quoted 7 lines
Do this by avoiding enabling the capability when scanning hardware capabilities.
Fixes d25a0fc41c1f ("ice: Initialize RDMA support")CC Dave Ertman <[email protected]>Signed-off-by Jesse Brandeburg <[email protected]>---
Hi Jesse, it's good to hear back from you :)
we are already working on resolving the issue of miss-allocating
too many resources (would be good to know what beyond MSI-x'es
you care about) for RDMA in the default (likely non-RDMA heavy) case. Here is a series from Michal that lets user to manage it a bit:
https://lore.kernel.org/netdev/[email protected]/T/
and we want to post another one later that changes defaults from the current "grab a lot when there are many CPUs" policy to more resonable
Quoted 10 lines · Przemek Kitszel
Quoted 8 lines · On 11/14/24 01:00, [email protected] wrote:
From: Jesse Brandeburg <[email protected]>
If the
CONFIG_INFINIBAND_IRDMAsymbol is not enabled as a module or a built-in, then don't let the driver reserve resources for RDMA.Do this by avoiding enabling the capability when scanning hardware capabilities.
Quoted 6 lines
Quoted 4 lines
Fixes d25a0fc41c1f ("ice: Initialize RDMA support")CC Dave Ertman <[email protected]>Signed-off-by Jesse Brandeburg <[email protected]>---
Hi Jesse, it's good to hear back from you :)
Hi Przemek! You too.
Quoted 5 lines
we are already working on resolving the issue of miss-allocating too many resources (would be good to know what beyond MSI-x'es you care about) for RDMA in the default (likely non-RDMA heavy) case. Here is a series from Michal that lets user to manage it a bit:
https://lore.kernel.org/netdev/[email protected]/T/
I agree, but that whole series is far too big to backport to stable, right?
Quoted 2 lines
and we want to post another one later that changes defaults from the current "grab a lot when there are many CPUs" policy to more resonable
I'm looking forward to those series, and in fact had been looking to backport one of the patches from michal's series, but found that for us at least with RDMA disabled this limit seemed far simpler, and also I doubt it will conflict with the more complicated work of managing features when all are enabled.
Please see my other reply to dave (and yes I'm replying from two different accounts, as I'm figuring out the best way to work here at my new job.)