> -----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 > 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. > > 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(-) > > diff --git a/drivers/net/ethernet/intel/ice/ice_common.c > b/drivers/net/ethernet/intel/ice/ice_common.c > index 009716a12a26..70be07ad2c10 100644 > --- a/drivers/net/ethernet/intel/ice/ice_common.c > +++ b/drivers/net/ethernet/intel/ice/ice_common.c > @@ -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
