Commit dadd1701 authored by Dave Ertman's avatar Dave Ertman Committed by Jakub Kicinski

ice: Add check for lport extraction to LAG init

To fully support initializing the LAG support code, a DDP package that
extracts the logical port from the metadata is required.  If such a
package is not present, there could be difficulties in supporting some
bond types.

Add a check into the initialization flow that will bypass the new paths
if any of the support pieces are missing.
Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Fixes: df006dd4 ("ice: Add initial support framework for LAG")
Signed-off-by: default avatarDave Ertman <david.m.ertman@intel.com>
Reviewed-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Tested-by: default avatarSujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Link: https://lore.kernel.org/r/20240213183957.1483857-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 63a3dd6e
...@@ -151,6 +151,27 @@ ice_lag_find_hw_by_lport(struct ice_lag *lag, u8 lport) ...@@ -151,6 +151,27 @@ ice_lag_find_hw_by_lport(struct ice_lag *lag, u8 lport)
return NULL; return NULL;
} }
/**
* ice_pkg_has_lport_extract - check if lport extraction supported
* @hw: HW struct
*/
static bool ice_pkg_has_lport_extract(struct ice_hw *hw)
{
int i;
for (i = 0; i < hw->blk[ICE_BLK_SW].es.count; i++) {
u16 offset;
u8 fv_prot;
ice_find_prot_off(hw, ICE_BLK_SW, ICE_SW_DEFAULT_PROFILE, i,
&fv_prot, &offset);
if (fv_prot == ICE_FV_PROT_MDID &&
offset == ICE_LP_EXT_BUF_OFFSET)
return true;
}
return false;
}
/** /**
* ice_lag_find_primary - returns pointer to primary interfaces lag struct * ice_lag_find_primary - returns pointer to primary interfaces lag struct
* @lag: local interfaces lag struct * @lag: local interfaces lag struct
...@@ -1206,7 +1227,7 @@ static void ice_lag_del_prune_list(struct ice_lag *lag, struct ice_pf *event_pf) ...@@ -1206,7 +1227,7 @@ static void ice_lag_del_prune_list(struct ice_lag *lag, struct ice_pf *event_pf)
} }
/** /**
* ice_lag_init_feature_support_flag - Check for NVM support for LAG * ice_lag_init_feature_support_flag - Check for package and NVM support for LAG
* @pf: PF struct * @pf: PF struct
*/ */
static void ice_lag_init_feature_support_flag(struct ice_pf *pf) static void ice_lag_init_feature_support_flag(struct ice_pf *pf)
...@@ -1219,7 +1240,7 @@ static void ice_lag_init_feature_support_flag(struct ice_pf *pf) ...@@ -1219,7 +1240,7 @@ static void ice_lag_init_feature_support_flag(struct ice_pf *pf)
else else
ice_clear_feature_support(pf, ICE_F_ROCE_LAG); ice_clear_feature_support(pf, ICE_F_ROCE_LAG);
if (caps->sriov_lag) if (caps->sriov_lag && ice_pkg_has_lport_extract(&pf->hw))
ice_set_feature_support(pf, ICE_F_SRIOV_LAG); ice_set_feature_support(pf, ICE_F_SRIOV_LAG);
else else
ice_clear_feature_support(pf, ICE_F_SRIOV_LAG); ice_clear_feature_support(pf, ICE_F_SRIOV_LAG);
......
...@@ -17,6 +17,9 @@ enum ice_lag_role { ...@@ -17,6 +17,9 @@ enum ice_lag_role {
#define ICE_LAG_INVALID_PORT 0xFF #define ICE_LAG_INVALID_PORT 0xFF
#define ICE_LAG_RESET_RETRIES 5 #define ICE_LAG_RESET_RETRIES 5
#define ICE_SW_DEFAULT_PROFILE 0
#define ICE_FV_PROT_MDID 255
#define ICE_LP_EXT_BUF_OFFSET 32
struct ice_pf; struct ice_pf;
struct ice_vf; struct ice_vf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment