Skip to content

Commit dadd170

Browse files
dmertmankuba-moo
authored andcommitted
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: Przemek Kitszel <[email protected]> Fixes: df006dd ("ice: Add initial support framework for LAG") Signed-off-by: Dave Ertman <[email protected]> Reviewed-by: Marcin Szycik <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 63a3dd6 commit dadd170

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

drivers/net/ethernet/intel/ice/ice_lag.c

+23-2
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,27 @@ ice_lag_find_hw_by_lport(struct ice_lag *lag, u8 lport)
151151
return NULL;
152152
}
153153

154+
/**
155+
* ice_pkg_has_lport_extract - check if lport extraction supported
156+
* @hw: HW struct
157+
*/
158+
static bool ice_pkg_has_lport_extract(struct ice_hw *hw)
159+
{
160+
int i;
161+
162+
for (i = 0; i < hw->blk[ICE_BLK_SW].es.count; i++) {
163+
u16 offset;
164+
u8 fv_prot;
165+
166+
ice_find_prot_off(hw, ICE_BLK_SW, ICE_SW_DEFAULT_PROFILE, i,
167+
&fv_prot, &offset);
168+
if (fv_prot == ICE_FV_PROT_MDID &&
169+
offset == ICE_LP_EXT_BUF_OFFSET)
170+
return true;
171+
}
172+
return false;
173+
}
174+
154175
/**
155176
* ice_lag_find_primary - returns pointer to primary interfaces lag struct
156177
* @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)
12061227
}
12071228

12081229
/**
1209-
* ice_lag_init_feature_support_flag - Check for NVM support for LAG
1230+
* ice_lag_init_feature_support_flag - Check for package and NVM support for LAG
12101231
* @pf: PF struct
12111232
*/
12121233
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)
12191240
else
12201241
ice_clear_feature_support(pf, ICE_F_ROCE_LAG);
12211242

1222-
if (caps->sriov_lag)
1243+
if (caps->sriov_lag && ice_pkg_has_lport_extract(&pf->hw))
12231244
ice_set_feature_support(pf, ICE_F_SRIOV_LAG);
12241245
else
12251246
ice_clear_feature_support(pf, ICE_F_SRIOV_LAG);

drivers/net/ethernet/intel/ice/ice_lag.h

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ enum ice_lag_role {
1717
#define ICE_LAG_INVALID_PORT 0xFF
1818

1919
#define ICE_LAG_RESET_RETRIES 5
20+
#define ICE_SW_DEFAULT_PROFILE 0
21+
#define ICE_FV_PROT_MDID 255
22+
#define ICE_LP_EXT_BUF_OFFSET 32
2023

2124
struct ice_pf;
2225
struct ice_vf;

0 commit comments

Comments
 (0)