Skip to content

Commit c4d2d23

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2024-03-25 (ice, ixgbe, igc) This series contains updates to ice, ixgbe, and igc drivers. Steven fixes incorrect casting of bitmap type for ice driver. Jesse fixes memory corruption issue with suspend flow on ice. Przemek adds GFP_ATOMIC flag to avoid sleeping in IRQ context for ixgbe. Kurt Kanzenbach removes no longer valid comment on igc. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: igc: Remove stale comment about Tx timestamping ixgbe: avoid sleeping allocation in ixgbe_ipsec_vf_add_sa() ice: fix memory corruption bug with suspend and rebuild ice: Refactor FW data type and fix bitmap casting issue ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents f7442a6 + 47ce295 commit c4d2d23

File tree

7 files changed

+37
-36
lines changed

7 files changed

+37
-36
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,9 @@ struct ice_aqc_recipe_data_elem {
593593
struct ice_aqc_recipe_to_profile {
594594
__le16 profile_id;
595595
u8 rsvd[6];
596-
DECLARE_BITMAP(recipe_assoc, ICE_MAX_NUM_RECIPES);
596+
__le64 recipe_assoc;
597597
};
598+
static_assert(sizeof(struct ice_aqc_recipe_to_profile) == 16);
598599

599600
/* Add/Update/Remove/Get switch rules (indirect 0x02A0, 0x02A1, 0x02A2, 0x02A3)
600601
*/

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,15 +2041,15 @@ int ice_init_lag(struct ice_pf *pf)
20412041
/* associate recipes to profiles */
20422042
for (n = 0; n < ICE_PROFID_IPV6_GTPU_IPV6_TCP_INNER; n++) {
20432043
err = ice_aq_get_recipe_to_profile(&pf->hw, n,
2044-
(u8 *)&recipe_bits, NULL);
2044+
&recipe_bits, NULL);
20452045
if (err)
20462046
continue;
20472047

20482048
if (recipe_bits & BIT(ICE_SW_LKUP_DFLT)) {
20492049
recipe_bits |= BIT(lag->pf_recipe) |
20502050
BIT(lag->lport_recipe);
20512051
ice_aq_map_recipe_to_profile(&pf->hw, n,
2052-
(u8 *)&recipe_bits, NULL);
2052+
recipe_bits, NULL);
20532053
}
20542054
}
20552055

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3091,7 +3091,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
30913091
{
30923092
struct ice_vsi_cfg_params params = {};
30933093
struct ice_coalesce_stored *coalesce;
3094-
int prev_num_q_vectors = 0;
3094+
int prev_num_q_vectors;
30953095
struct ice_pf *pf;
30963096
int ret;
30973097

@@ -3105,13 +3105,6 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
31053105
if (WARN_ON(vsi->type == ICE_VSI_VF && !vsi->vf))
31063106
return -EINVAL;
31073107

3108-
coalesce = kcalloc(vsi->num_q_vectors,
3109-
sizeof(struct ice_coalesce_stored), GFP_KERNEL);
3110-
if (!coalesce)
3111-
return -ENOMEM;
3112-
3113-
prev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi, coalesce);
3114-
31153108
ret = ice_vsi_realloc_stat_arrays(vsi);
31163109
if (ret)
31173110
goto err_vsi_cfg;
@@ -3121,6 +3114,13 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
31213114
if (ret)
31223115
goto err_vsi_cfg;
31233116

3117+
coalesce = kcalloc(vsi->num_q_vectors,
3118+
sizeof(struct ice_coalesce_stored), GFP_KERNEL);
3119+
if (!coalesce)
3120+
return -ENOMEM;
3121+
3122+
prev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi, coalesce);
3123+
31243124
ret = ice_vsi_cfg_tc_lan(pf, vsi);
31253125
if (ret) {
31263126
if (vsi_flags & ICE_VSI_FLAG_INIT) {
@@ -3139,8 +3139,8 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
31393139

31403140
err_vsi_cfg_tc_lan:
31413141
ice_vsi_decfg(vsi);
3142-
err_vsi_cfg:
31433142
kfree(coalesce);
3143+
err_vsi_cfg:
31443144
return ret;
31453145
}
31463146

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,12 +2025,12 @@ ice_update_recipe_lkup_idx(struct ice_hw *hw,
20252025
* ice_aq_map_recipe_to_profile - Map recipe to packet profile
20262026
* @hw: pointer to the HW struct
20272027
* @profile_id: package profile ID to associate the recipe with
2028-
* @r_bitmap: Recipe bitmap filled in and need to be returned as response
2028+
* @r_assoc: Recipe bitmap filled in and need to be returned as response
20292029
* @cd: pointer to command details structure or NULL
20302030
* Recipe to profile association (0x0291)
20312031
*/
20322032
int
2033-
ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
2033+
ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 r_assoc,
20342034
struct ice_sq_cd *cd)
20352035
{
20362036
struct ice_aqc_recipe_to_profile *cmd;
@@ -2042,7 +2042,7 @@ ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
20422042
/* Set the recipe ID bit in the bitmask to let the device know which
20432043
* profile we are associating the recipe to
20442044
*/
2045-
memcpy(cmd->recipe_assoc, r_bitmap, sizeof(cmd->recipe_assoc));
2045+
cmd->recipe_assoc = cpu_to_le64(r_assoc);
20462046

20472047
return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
20482048
}
@@ -2051,12 +2051,12 @@ ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
20512051
* ice_aq_get_recipe_to_profile - Map recipe to packet profile
20522052
* @hw: pointer to the HW struct
20532053
* @profile_id: package profile ID to associate the recipe with
2054-
* @r_bitmap: Recipe bitmap filled in and need to be returned as response
2054+
* @r_assoc: Recipe bitmap filled in and need to be returned as response
20552055
* @cd: pointer to command details structure or NULL
20562056
* Associate profile ID with given recipe (0x0293)
20572057
*/
20582058
int
2059-
ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
2059+
ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 *r_assoc,
20602060
struct ice_sq_cd *cd)
20612061
{
20622062
struct ice_aqc_recipe_to_profile *cmd;
@@ -2069,7 +2069,7 @@ ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
20692069

20702070
status = ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
20712071
if (!status)
2072-
memcpy(r_bitmap, cmd->recipe_assoc, sizeof(cmd->recipe_assoc));
2072+
*r_assoc = le64_to_cpu(cmd->recipe_assoc);
20732073

20742074
return status;
20752075
}
@@ -2108,15 +2108,17 @@ int ice_alloc_recipe(struct ice_hw *hw, u16 *rid)
21082108
static void ice_get_recp_to_prof_map(struct ice_hw *hw)
21092109
{
21102110
DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES);
2111+
u64 recp_assoc;
21112112
u16 i;
21122113

21132114
for (i = 0; i < hw->switch_info->max_used_prof_index + 1; i++) {
21142115
u16 j;
21152116

21162117
bitmap_zero(profile_to_recipe[i], ICE_MAX_NUM_RECIPES);
21172118
bitmap_zero(r_bitmap, ICE_MAX_NUM_RECIPES);
2118-
if (ice_aq_get_recipe_to_profile(hw, i, (u8 *)r_bitmap, NULL))
2119+
if (ice_aq_get_recipe_to_profile(hw, i, &recp_assoc, NULL))
21192120
continue;
2121+
bitmap_from_arr64(r_bitmap, &recp_assoc, ICE_MAX_NUM_RECIPES);
21202122
bitmap_copy(profile_to_recipe[i], r_bitmap,
21212123
ICE_MAX_NUM_RECIPES);
21222124
for_each_set_bit(j, r_bitmap, ICE_MAX_NUM_RECIPES)
@@ -5390,22 +5392,24 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
53905392
*/
53915393
list_for_each_entry(fvit, &rm->fv_list, list_entry) {
53925394
DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES);
5395+
u64 recp_assoc;
53935396
u16 j;
53945397

53955398
status = ice_aq_get_recipe_to_profile(hw, fvit->profile_id,
5396-
(u8 *)r_bitmap, NULL);
5399+
&recp_assoc, NULL);
53975400
if (status)
53985401
goto err_unroll;
53995402

5403+
bitmap_from_arr64(r_bitmap, &recp_assoc, ICE_MAX_NUM_RECIPES);
54005404
bitmap_or(r_bitmap, r_bitmap, rm->r_bitmap,
54015405
ICE_MAX_NUM_RECIPES);
54025406
status = ice_acquire_change_lock(hw, ICE_RES_WRITE);
54035407
if (status)
54045408
goto err_unroll;
54055409

5410+
bitmap_to_arr64(&recp_assoc, r_bitmap, ICE_MAX_NUM_RECIPES);
54065411
status = ice_aq_map_recipe_to_profile(hw, fvit->profile_id,
5407-
(u8 *)r_bitmap,
5408-
NULL);
5412+
recp_assoc, NULL);
54095413
ice_release_change_lock(hw);
54105414

54115415
if (status)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,10 @@ int ice_aq_add_recipe(struct ice_hw *hw,
424424
struct ice_aqc_recipe_data_elem *s_recipe_list,
425425
u16 num_recipes, struct ice_sq_cd *cd);
426426
int
427-
ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
427+
ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 *r_assoc,
428428
struct ice_sq_cd *cd);
429429
int
430-
ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
430+
ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 r_assoc,
431431
struct ice_sq_cd *cd);
432432

433433
#endif /* _ICE_SWITCH_H_ */

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,10 +1642,6 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
16421642

16431643
if (unlikely(test_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags) &&
16441644
skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
1645-
/* FIXME: add support for retrieving timestamps from
1646-
* the other timer registers before skipping the
1647-
* timestamping request.
1648-
*/
16491645
unsigned long flags;
16501646
u32 tstamp_flags;
16511647

drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,13 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
914914
goto err_out;
915915
}
916916

917-
xs = kzalloc(sizeof(*xs), GFP_KERNEL);
917+
algo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1);
918+
if (unlikely(!algo)) {
919+
err = -ENOENT;
920+
goto err_out;
921+
}
922+
923+
xs = kzalloc(sizeof(*xs), GFP_ATOMIC);
918924
if (unlikely(!xs)) {
919925
err = -ENOMEM;
920926
goto err_out;
@@ -930,14 +936,8 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
930936
memcpy(&xs->id.daddr.a4, sam->addr, sizeof(xs->id.daddr.a4));
931937
xs->xso.dev = adapter->netdev;
932938

933-
algo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1);
934-
if (unlikely(!algo)) {
935-
err = -ENOENT;
936-
goto err_xs;
937-
}
938-
939939
aead_len = sizeof(*xs->aead) + IXGBE_IPSEC_KEY_BITS / 8;
940-
xs->aead = kzalloc(aead_len, GFP_KERNEL);
940+
xs->aead = kzalloc(aead_len, GFP_ATOMIC);
941941
if (unlikely(!xs->aead)) {
942942
err = -ENOMEM;
943943
goto err_xs;

0 commit comments

Comments
 (0)