Commit c4d2d23d authored by Jakub Kicinski's avatar Jakub Kicinski

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/20240325200659.993749-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents f7442a63 47ce2956
...@@ -593,8 +593,9 @@ struct ice_aqc_recipe_data_elem { ...@@ -593,8 +593,9 @@ struct ice_aqc_recipe_data_elem {
struct ice_aqc_recipe_to_profile { struct ice_aqc_recipe_to_profile {
__le16 profile_id; __le16 profile_id;
u8 rsvd[6]; u8 rsvd[6];
DECLARE_BITMAP(recipe_assoc, ICE_MAX_NUM_RECIPES); __le64 recipe_assoc;
}; };
static_assert(sizeof(struct ice_aqc_recipe_to_profile) == 16);
/* Add/Update/Remove/Get switch rules (indirect 0x02A0, 0x02A1, 0x02A2, 0x02A3) /* Add/Update/Remove/Get switch rules (indirect 0x02A0, 0x02A1, 0x02A2, 0x02A3)
*/ */
......
...@@ -2041,7 +2041,7 @@ int ice_init_lag(struct ice_pf *pf) ...@@ -2041,7 +2041,7 @@ int ice_init_lag(struct ice_pf *pf)
/* associate recipes to profiles */ /* associate recipes to profiles */
for (n = 0; n < ICE_PROFID_IPV6_GTPU_IPV6_TCP_INNER; n++) { for (n = 0; n < ICE_PROFID_IPV6_GTPU_IPV6_TCP_INNER; n++) {
err = ice_aq_get_recipe_to_profile(&pf->hw, n, err = ice_aq_get_recipe_to_profile(&pf->hw, n,
(u8 *)&recipe_bits, NULL); &recipe_bits, NULL);
if (err) if (err)
continue; continue;
...@@ -2049,7 +2049,7 @@ int ice_init_lag(struct ice_pf *pf) ...@@ -2049,7 +2049,7 @@ int ice_init_lag(struct ice_pf *pf)
recipe_bits |= BIT(lag->pf_recipe) | recipe_bits |= BIT(lag->pf_recipe) |
BIT(lag->lport_recipe); BIT(lag->lport_recipe);
ice_aq_map_recipe_to_profile(&pf->hw, n, ice_aq_map_recipe_to_profile(&pf->hw, n,
(u8 *)&recipe_bits, NULL); recipe_bits, NULL);
} }
} }
......
...@@ -3091,7 +3091,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags) ...@@ -3091,7 +3091,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
{ {
struct ice_vsi_cfg_params params = {}; struct ice_vsi_cfg_params params = {};
struct ice_coalesce_stored *coalesce; struct ice_coalesce_stored *coalesce;
int prev_num_q_vectors = 0; int prev_num_q_vectors;
struct ice_pf *pf; struct ice_pf *pf;
int ret; int ret;
...@@ -3105,13 +3105,6 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags) ...@@ -3105,13 +3105,6 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
if (WARN_ON(vsi->type == ICE_VSI_VF && !vsi->vf)) if (WARN_ON(vsi->type == ICE_VSI_VF && !vsi->vf))
return -EINVAL; return -EINVAL;
coalesce = kcalloc(vsi->num_q_vectors,
sizeof(struct ice_coalesce_stored), GFP_KERNEL);
if (!coalesce)
return -ENOMEM;
prev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi, coalesce);
ret = ice_vsi_realloc_stat_arrays(vsi); ret = ice_vsi_realloc_stat_arrays(vsi);
if (ret) if (ret)
goto err_vsi_cfg; goto err_vsi_cfg;
...@@ -3121,6 +3114,13 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags) ...@@ -3121,6 +3114,13 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
if (ret) if (ret)
goto err_vsi_cfg; goto err_vsi_cfg;
coalesce = kcalloc(vsi->num_q_vectors,
sizeof(struct ice_coalesce_stored), GFP_KERNEL);
if (!coalesce)
return -ENOMEM;
prev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi, coalesce);
ret = ice_vsi_cfg_tc_lan(pf, vsi); ret = ice_vsi_cfg_tc_lan(pf, vsi);
if (ret) { if (ret) {
if (vsi_flags & ICE_VSI_FLAG_INIT) { if (vsi_flags & ICE_VSI_FLAG_INIT) {
...@@ -3139,8 +3139,8 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags) ...@@ -3139,8 +3139,8 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
err_vsi_cfg_tc_lan: err_vsi_cfg_tc_lan:
ice_vsi_decfg(vsi); ice_vsi_decfg(vsi);
err_vsi_cfg:
kfree(coalesce); kfree(coalesce);
err_vsi_cfg:
return ret; return ret;
} }
......
...@@ -2025,12 +2025,12 @@ ice_update_recipe_lkup_idx(struct ice_hw *hw, ...@@ -2025,12 +2025,12 @@ ice_update_recipe_lkup_idx(struct ice_hw *hw,
* ice_aq_map_recipe_to_profile - Map recipe to packet profile * ice_aq_map_recipe_to_profile - Map recipe to packet profile
* @hw: pointer to the HW struct * @hw: pointer to the HW struct
* @profile_id: package profile ID to associate the recipe with * @profile_id: package profile ID to associate the recipe with
* @r_bitmap: Recipe bitmap filled in and need to be returned as response * @r_assoc: Recipe bitmap filled in and need to be returned as response
* @cd: pointer to command details structure or NULL * @cd: pointer to command details structure or NULL
* Recipe to profile association (0x0291) * Recipe to profile association (0x0291)
*/ */
int int
ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 r_assoc,
struct ice_sq_cd *cd) struct ice_sq_cd *cd)
{ {
struct ice_aqc_recipe_to_profile *cmd; 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, ...@@ -2042,7 +2042,7 @@ ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
/* Set the recipe ID bit in the bitmask to let the device know which /* Set the recipe ID bit in the bitmask to let the device know which
* profile we are associating the recipe to * profile we are associating the recipe to
*/ */
memcpy(cmd->recipe_assoc, r_bitmap, sizeof(cmd->recipe_assoc)); cmd->recipe_assoc = cpu_to_le64(r_assoc);
return ice_aq_send_cmd(hw, &desc, NULL, 0, cd); return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
} }
...@@ -2051,12 +2051,12 @@ ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, ...@@ -2051,12 +2051,12 @@ ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
* ice_aq_get_recipe_to_profile - Map recipe to packet profile * ice_aq_get_recipe_to_profile - Map recipe to packet profile
* @hw: pointer to the HW struct * @hw: pointer to the HW struct
* @profile_id: package profile ID to associate the recipe with * @profile_id: package profile ID to associate the recipe with
* @r_bitmap: Recipe bitmap filled in and need to be returned as response * @r_assoc: Recipe bitmap filled in and need to be returned as response
* @cd: pointer to command details structure or NULL * @cd: pointer to command details structure or NULL
* Associate profile ID with given recipe (0x0293) * Associate profile ID with given recipe (0x0293)
*/ */
int int
ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 *r_assoc,
struct ice_sq_cd *cd) struct ice_sq_cd *cd)
{ {
struct ice_aqc_recipe_to_profile *cmd; 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, ...@@ -2069,7 +2069,7 @@ ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap,
status = ice_aq_send_cmd(hw, &desc, NULL, 0, cd); status = ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
if (!status) if (!status)
memcpy(r_bitmap, cmd->recipe_assoc, sizeof(cmd->recipe_assoc)); *r_assoc = le64_to_cpu(cmd->recipe_assoc);
return status; return status;
} }
...@@ -2108,6 +2108,7 @@ int ice_alloc_recipe(struct ice_hw *hw, u16 *rid) ...@@ -2108,6 +2108,7 @@ int ice_alloc_recipe(struct ice_hw *hw, u16 *rid)
static void ice_get_recp_to_prof_map(struct ice_hw *hw) static void ice_get_recp_to_prof_map(struct ice_hw *hw)
{ {
DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES); DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES);
u64 recp_assoc;
u16 i; u16 i;
for (i = 0; i < hw->switch_info->max_used_prof_index + 1; i++) { for (i = 0; i < hw->switch_info->max_used_prof_index + 1; i++) {
...@@ -2115,8 +2116,9 @@ static void ice_get_recp_to_prof_map(struct ice_hw *hw) ...@@ -2115,8 +2116,9 @@ static void ice_get_recp_to_prof_map(struct ice_hw *hw)
bitmap_zero(profile_to_recipe[i], ICE_MAX_NUM_RECIPES); bitmap_zero(profile_to_recipe[i], ICE_MAX_NUM_RECIPES);
bitmap_zero(r_bitmap, ICE_MAX_NUM_RECIPES); bitmap_zero(r_bitmap, ICE_MAX_NUM_RECIPES);
if (ice_aq_get_recipe_to_profile(hw, i, (u8 *)r_bitmap, NULL)) if (ice_aq_get_recipe_to_profile(hw, i, &recp_assoc, NULL))
continue; continue;
bitmap_from_arr64(r_bitmap, &recp_assoc, ICE_MAX_NUM_RECIPES);
bitmap_copy(profile_to_recipe[i], r_bitmap, bitmap_copy(profile_to_recipe[i], r_bitmap,
ICE_MAX_NUM_RECIPES); ICE_MAX_NUM_RECIPES);
for_each_set_bit(j, r_bitmap, ICE_MAX_NUM_RECIPES) 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, ...@@ -5390,22 +5392,24 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
*/ */
list_for_each_entry(fvit, &rm->fv_list, list_entry) { list_for_each_entry(fvit, &rm->fv_list, list_entry) {
DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES); DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES);
u64 recp_assoc;
u16 j; u16 j;
status = ice_aq_get_recipe_to_profile(hw, fvit->profile_id, status = ice_aq_get_recipe_to_profile(hw, fvit->profile_id,
(u8 *)r_bitmap, NULL); &recp_assoc, NULL);
if (status) if (status)
goto err_unroll; goto err_unroll;
bitmap_from_arr64(r_bitmap, &recp_assoc, ICE_MAX_NUM_RECIPES);
bitmap_or(r_bitmap, r_bitmap, rm->r_bitmap, bitmap_or(r_bitmap, r_bitmap, rm->r_bitmap,
ICE_MAX_NUM_RECIPES); ICE_MAX_NUM_RECIPES);
status = ice_acquire_change_lock(hw, ICE_RES_WRITE); status = ice_acquire_change_lock(hw, ICE_RES_WRITE);
if (status) if (status)
goto err_unroll; goto err_unroll;
bitmap_to_arr64(&recp_assoc, r_bitmap, ICE_MAX_NUM_RECIPES);
status = ice_aq_map_recipe_to_profile(hw, fvit->profile_id, status = ice_aq_map_recipe_to_profile(hw, fvit->profile_id,
(u8 *)r_bitmap, recp_assoc, NULL);
NULL);
ice_release_change_lock(hw); ice_release_change_lock(hw);
if (status) if (status)
......
...@@ -424,10 +424,10 @@ int ice_aq_add_recipe(struct ice_hw *hw, ...@@ -424,10 +424,10 @@ int ice_aq_add_recipe(struct ice_hw *hw,
struct ice_aqc_recipe_data_elem *s_recipe_list, struct ice_aqc_recipe_data_elem *s_recipe_list,
u16 num_recipes, struct ice_sq_cd *cd); u16 num_recipes, struct ice_sq_cd *cd);
int int
ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, ice_aq_get_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 *r_assoc,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
int int
ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u8 *r_bitmap, ice_aq_map_recipe_to_profile(struct ice_hw *hw, u32 profile_id, u64 r_assoc,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
#endif /* _ICE_SWITCH_H_ */ #endif /* _ICE_SWITCH_H_ */
...@@ -1642,10 +1642,6 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb, ...@@ -1642,10 +1642,6 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
if (unlikely(test_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags) && if (unlikely(test_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags) &&
skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) { skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
/* FIXME: add support for retrieving timestamps from
* the other timer registers before skipping the
* timestamping request.
*/
unsigned long flags; unsigned long flags;
u32 tstamp_flags; u32 tstamp_flags;
......
...@@ -914,7 +914,13 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) ...@@ -914,7 +914,13 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
goto err_out; goto err_out;
} }
xs = kzalloc(sizeof(*xs), GFP_KERNEL); algo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1);
if (unlikely(!algo)) {
err = -ENOENT;
goto err_out;
}
xs = kzalloc(sizeof(*xs), GFP_ATOMIC);
if (unlikely(!xs)) { if (unlikely(!xs)) {
err = -ENOMEM; err = -ENOMEM;
goto err_out; goto err_out;
...@@ -930,14 +936,8 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) ...@@ -930,14 +936,8 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
memcpy(&xs->id.daddr.a4, sam->addr, sizeof(xs->id.daddr.a4)); memcpy(&xs->id.daddr.a4, sam->addr, sizeof(xs->id.daddr.a4));
xs->xso.dev = adapter->netdev; xs->xso.dev = adapter->netdev;
algo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1);
if (unlikely(!algo)) {
err = -ENOENT;
goto err_xs;
}
aead_len = sizeof(*xs->aead) + IXGBE_IPSEC_KEY_BITS / 8; aead_len = sizeof(*xs->aead) + IXGBE_IPSEC_KEY_BITS / 8;
xs->aead = kzalloc(aead_len, GFP_KERNEL); xs->aead = kzalloc(aead_len, GFP_ATOMIC);
if (unlikely(!xs->aead)) { if (unlikely(!xs->aead)) {
err = -ENOMEM; err = -ENOMEM;
goto err_xs; goto err_xs;
......
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