]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ice: fix reservation of resources for RDMA when disabled
authorJesse Brandeburg <jbrandeburg@cloudflare.com>
Thu, 6 Mar 2025 17:56:34 +0000 (09:56 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 18 Mar 2025 16:38:15 +0000 (09:38 -0700)
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. The result
of this change is a large savings in resources for older kernels, and a
cleaner driver configuration for the IRDMA=n case for old and new kernels.

Implement this by avoiding enabling the RDMA capability when scanning
hardware capabilities.

Note: Loading the out-of-tree irdma driver in connection to the in-kernel
ice driver, is not supported, and should not be attempted, especially when
disabling IRDMA in the kernel config.

Fixes: d25a0fc41c1f ("ice: Initialize RDMA support")
Signed-off-by: Jesse Brandeburg <jbrandeburg@cloudflare.com>
Acked-by: Dave Ertman <david.m.ertman@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_common.c

index 7a2a2e8da8fabde79fc7befc52a2b6e4ef6a43b7..1e801300310e9f3b2d0fab3f011c93b6bebee46a 100644 (file)
@@ -2271,7 +2271,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: