Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+37 -36
+2 -1
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
··· 593 593 struct ice_aqc_recipe_to_profile { 594 594 __le16 profile_id; 595 595 u8 rsvd[6]; 596 - DECLARE_BITMAP(recipe_assoc, ICE_MAX_NUM_RECIPES); 596 + __le64 recipe_assoc; 597 597 }; 598 + static_assert(sizeof(struct ice_aqc_recipe_to_profile) == 16); 598 599 599 600 /* Add/Update/Remove/Get switch rules (indirect 0x02A0, 0x02A1, 0x02A2, 0x02A3) 600 601 */
+2 -2
drivers/net/ethernet/intel/ice/ice_lag.c
··· 2041 2041 /* associate recipes to profiles */ 2042 2042 for (n = 0; n < ICE_PROFID_IPV6_GTPU_IPV6_TCP_INNER; n++) { 2043 2043 err = ice_aq_get_recipe_to_profile(&pf->hw, n, 2044 - (u8 *)&recipe_bits, NULL); 2044 + &recipe_bits, NULL); 2045 2045 if (err) 2046 2046 continue; 2047 2047 ··· 2049 2049 recipe_bits |= BIT(lag->pf_recipe) | 2050 2050 BIT(lag->lport_recipe); 2051 2051 ice_aq_map_recipe_to_profile(&pf->hw, n, 2052 - (u8 *)&recipe_bits, NULL); 2052 + recipe_bits, NULL); 2053 2053 } 2054 2054 } 2055 2055
+9 -9
drivers/net/ethernet/intel/ice/ice_lib.c
··· 3091 3091 { 3092 3092 struct ice_vsi_cfg_params params = {}; 3093 3093 struct ice_coalesce_stored *coalesce; 3094 - int prev_num_q_vectors = 0; 3094 + int prev_num_q_vectors; 3095 3095 struct ice_pf *pf; 3096 3096 int ret; 3097 3097 ··· 3105 3105 if (WARN_ON(vsi->type == ICE_VSI_VF && !vsi->vf)) 3106 3106 return -EINVAL; 3107 3107 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 - 3115 3108 ret = ice_vsi_realloc_stat_arrays(vsi); 3116 3109 if (ret) 3117 3110 goto err_vsi_cfg; ··· 3113 3120 ret = ice_vsi_cfg_def(vsi, &params); 3114 3121 if (ret) 3115 3122 goto err_vsi_cfg; 3123 + 3124 + coalesce = kcalloc(vsi->num_q_vectors, 3125 + sizeof(struct ice_coalesce_stored), GFP_KERNEL); 3126 + if (!coalesce) 3127 + return -ENOMEM; 3128 + 3129 + prev_num_q_vectors = ice_vsi_rebuild_get_coalesce(vsi, coalesce); 3116 3130 3117 3131 ret = ice_vsi_cfg_tc_lan(pf, vsi); 3118 3132 if (ret) { ··· 3139 3139 3140 3140 err_vsi_cfg_tc_lan: 3141 3141 ice_vsi_decfg(vsi); 3142 - err_vsi_cfg: 3143 3142 kfree(coalesce); 3143 + err_vsi_cfg: 3144 3144 return ret; 3145 3145 } 3146 3146
+14 -10
drivers/net/ethernet/intel/ice/ice_switch.c
··· 2025 2025 * ice_aq_map_recipe_to_profile - Map recipe to packet profile 2026 2026 * @hw: pointer to the HW struct 2027 2027 * @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 2029 2029 * @cd: pointer to command details structure or NULL 2030 2030 * Recipe to profile association (0x0291) 2031 2031 */ 2032 2032 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, 2034 2034 struct ice_sq_cd *cd) 2035 2035 { 2036 2036 struct ice_aqc_recipe_to_profile *cmd; ··· 2042 2042 /* Set the recipe ID bit in the bitmask to let the device know which 2043 2043 * profile we are associating the recipe to 2044 2044 */ 2045 - memcpy(cmd->recipe_assoc, r_bitmap, sizeof(cmd->recipe_assoc)); 2045 + cmd->recipe_assoc = cpu_to_le64(r_assoc); 2046 2046 2047 2047 return ice_aq_send_cmd(hw, &desc, NULL, 0, cd); 2048 2048 } ··· 2051 2051 * ice_aq_get_recipe_to_profile - Map recipe to packet profile 2052 2052 * @hw: pointer to the HW struct 2053 2053 * @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 2055 2055 * @cd: pointer to command details structure or NULL 2056 2056 * Associate profile ID with given recipe (0x0293) 2057 2057 */ 2058 2058 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, 2060 2060 struct ice_sq_cd *cd) 2061 2061 { 2062 2062 struct ice_aqc_recipe_to_profile *cmd; ··· 2069 2069 2070 2070 status = ice_aq_send_cmd(hw, &desc, NULL, 0, cd); 2071 2071 if (!status) 2072 - memcpy(r_bitmap, cmd->recipe_assoc, sizeof(cmd->recipe_assoc)); 2072 + *r_assoc = le64_to_cpu(cmd->recipe_assoc); 2073 2073 2074 2074 return status; 2075 2075 } ··· 2108 2108 static void ice_get_recp_to_prof_map(struct ice_hw *hw) 2109 2109 { 2110 2110 DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES); 2111 + u64 recp_assoc; 2111 2112 u16 i; 2112 2113 2113 2114 for (i = 0; i < hw->switch_info->max_used_prof_index + 1; i++) { ··· 2116 2115 2117 2116 bitmap_zero(profile_to_recipe[i], ICE_MAX_NUM_RECIPES); 2118 2117 bitmap_zero(r_bitmap, ICE_MAX_NUM_RECIPES); 2119 - if (ice_aq_get_recipe_to_profile(hw, i, (u8 *)r_bitmap, NULL)) 2118 + if (ice_aq_get_recipe_to_profile(hw, i, &recp_assoc, NULL)) 2120 2119 continue; 2120 + bitmap_from_arr64(r_bitmap, &recp_assoc, ICE_MAX_NUM_RECIPES); 2121 2121 bitmap_copy(profile_to_recipe[i], r_bitmap, 2122 2122 ICE_MAX_NUM_RECIPES); 2123 2123 for_each_set_bit(j, r_bitmap, ICE_MAX_NUM_RECIPES) ··· 5392 5390 */ 5393 5391 list_for_each_entry(fvit, &rm->fv_list, list_entry) { 5394 5392 DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES); 5393 + u64 recp_assoc; 5395 5394 u16 j; 5396 5395 5397 5396 status = ice_aq_get_recipe_to_profile(hw, fvit->profile_id, 5398 - (u8 *)r_bitmap, NULL); 5397 + &recp_assoc, NULL); 5399 5398 if (status) 5400 5399 goto err_unroll; 5401 5400 5401 + bitmap_from_arr64(r_bitmap, &recp_assoc, ICE_MAX_NUM_RECIPES); 5402 5402 bitmap_or(r_bitmap, r_bitmap, rm->r_bitmap, 5403 5403 ICE_MAX_NUM_RECIPES); 5404 5404 status = ice_acquire_change_lock(hw, ICE_RES_WRITE); 5405 5405 if (status) 5406 5406 goto err_unroll; 5407 5407 5408 + bitmap_to_arr64(&recp_assoc, r_bitmap, ICE_MAX_NUM_RECIPES); 5408 5409 status = ice_aq_map_recipe_to_profile(hw, fvit->profile_id, 5409 - (u8 *)r_bitmap, 5410 - NULL); 5410 + recp_assoc, NULL); 5411 5411 ice_release_change_lock(hw); 5412 5412 5413 5413 if (status)
+2 -2
drivers/net/ethernet/intel/ice/ice_switch.h
··· 424 424 struct ice_aqc_recipe_data_elem *s_recipe_list, 425 425 u16 num_recipes, struct ice_sq_cd *cd); 426 426 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, 428 428 struct ice_sq_cd *cd); 429 429 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, 431 431 struct ice_sq_cd *cd); 432 432 433 433 #endif /* _ICE_SWITCH_H_ */
-4
drivers/net/ethernet/intel/igc/igc_main.c
··· 1642 1642 1643 1643 if (unlikely(test_bit(IGC_RING_FLAG_TX_HWTSTAMP, &tx_ring->flags) && 1644 1644 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 - */ 1649 1645 unsigned long flags; 1650 1646 u32 tstamp_flags; 1651 1647
+8 -8
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
··· 914 914 goto err_out; 915 915 } 916 916 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); 918 924 if (unlikely(!xs)) { 919 925 err = -ENOMEM; 920 926 goto err_out; ··· 936 930 memcpy(&xs->id.daddr.a4, sam->addr, sizeof(xs->id.daddr.a4)); 937 931 xs->xso.dev = adapter->netdev; 938 932 939 - algo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1); 940 - if (unlikely(!algo)) { 941 - err = -ENOENT; 942 - goto err_xs; 943 - } 944 - 945 933 aead_len = sizeof(*xs->aead) + IXGBE_IPSEC_KEY_BITS / 8; 946 - xs->aead = kzalloc(aead_len, GFP_KERNEL); 934 + xs->aead = kzalloc(aead_len, GFP_ATOMIC); 947 935 if (unlikely(!xs->aead)) { 948 936 err = -ENOMEM; 949 937 goto err_xs;