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

Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2021-02-22

Dave corrects reporting of max TCs to use the value from hardware
capabilities and setting of DCBx capability bits when changing between
SW and FW LLDP.

Brett fixes trusted VF multicast promiscuous not receiving expected
packets and corrects VF max packet size when a port VLAN is configured.

Henry updates available RSS queues following a change in channel count
with a user defined LUT.

* '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
ice: update the number of available RSS queues
ice: Fix state bits on LLDP mode switch
ice: Account for port VLAN in VF max packet size calculation
ice: Set trusted VF as default VSI when setting allmulti on
ice: report correct max number of TCs
====================

Link: https://lore.kernel.org/r/20210222235814.834282-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+64 -13
-2
drivers/net/ethernet/intel/ice/ice.h
··· 454 454 struct ice_hw_port_stats stats_prev; 455 455 struct ice_hw hw; 456 456 u8 stat_prev_loaded:1; /* has previous stats been loaded */ 457 - #ifdef CONFIG_DCB 458 457 u16 dcbx_cap; 459 - #endif /* CONFIG_DCB */ 460 458 u32 tx_timeout_count; 461 459 unsigned long tx_timeout_last_recovery; 462 460 u32 tx_timeout_recovery_level;
+5 -1
drivers/net/ethernet/intel/ice/ice_dcb_nl.c
··· 134 134 if (!test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags)) 135 135 return -EINVAL; 136 136 137 - *num = IEEE_8021QAZ_MAX_TCS; 137 + *num = pf->hw.func_caps.common_cap.maxtc; 138 138 return 0; 139 139 } 140 140 ··· 158 158 { 159 159 struct ice_pf *pf = ice_netdev_to_pf(netdev); 160 160 struct ice_qos_cfg *qos_cfg; 161 + 162 + /* if FW LLDP agent is running, DCBNL not allowed to change mode */ 163 + if (test_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags)) 164 + return ICE_DCB_NO_HW_CHG; 161 165 162 166 /* No support for LLD_MANAGED modes or CEE+IEEE */ 163 167 if ((mode & DCB_CAP_DCBX_LLD_MANAGED) ||
+26 -8
drivers/net/ethernet/intel/ice/ice_ethtool.c
··· 8 8 #include "ice_fltr.h" 9 9 #include "ice_lib.h" 10 10 #include "ice_dcb_lib.h" 11 + #include <net/dcbnl.h> 11 12 12 13 struct ice_stats { 13 14 char stat_string[ETH_GSTRING_LEN]; ··· 1239 1238 status = ice_init_pf_dcb(pf, true); 1240 1239 if (status) 1241 1240 dev_warn(dev, "Fail to init DCB\n"); 1241 + 1242 + pf->dcbx_cap &= ~DCB_CAP_DCBX_LLD_MANAGED; 1243 + pf->dcbx_cap |= DCB_CAP_DCBX_HOST; 1242 1244 } else { 1243 1245 enum ice_status status; 1244 1246 bool dcbx_agent_status; ··· 1283 1279 status = ice_cfg_lldp_mib_change(&pf->hw, true); 1284 1280 if (status) 1285 1281 dev_dbg(dev, "Fail to enable MIB change events\n"); 1282 + 1283 + pf->dcbx_cap &= ~DCB_CAP_DCBX_HOST; 1284 + pf->dcbx_cap |= DCB_CAP_DCBX_LLD_MANAGED; 1286 1285 1287 1286 ice_nway_reset(netdev); 1288 1287 } ··· 3329 3322 } 3330 3323 3331 3324 /** 3325 + * ice_get_valid_rss_size - return valid number of RSS queues 3326 + * @hw: pointer to the HW structure 3327 + * @new_size: requested RSS queues 3328 + */ 3329 + static int ice_get_valid_rss_size(struct ice_hw *hw, int new_size) 3330 + { 3331 + struct ice_hw_common_caps *caps = &hw->func_caps.common_cap; 3332 + 3333 + return min_t(int, new_size, BIT(caps->rss_table_entry_width)); 3334 + } 3335 + 3336 + /** 3332 3337 * ice_vsi_set_dflt_rss_lut - set default RSS LUT with requested RSS size 3333 3338 * @vsi: VSI to reconfigure RSS LUT on 3334 3339 * @req_rss_size: requested range of queue numbers for hashing ··· 3367 3348 return -ENOMEM; 3368 3349 3369 3350 /* set RSS LUT parameters */ 3370 - if (!test_bit(ICE_FLAG_RSS_ENA, pf->flags)) { 3351 + if (!test_bit(ICE_FLAG_RSS_ENA, pf->flags)) 3371 3352 vsi->rss_size = 1; 3372 - } else { 3373 - struct ice_hw_common_caps *caps = &hw->func_caps.common_cap; 3374 - 3375 - vsi->rss_size = min_t(int, req_rss_size, 3376 - BIT(caps->rss_table_entry_width)); 3377 - } 3353 + else 3354 + vsi->rss_size = ice_get_valid_rss_size(hw, req_rss_size); 3378 3355 3379 3356 /* create/set RSS LUT */ 3380 3357 ice_fill_rss_lut(lut, vsi->rss_table_size, vsi->rss_size); ··· 3449 3434 3450 3435 ice_vsi_recfg_qs(vsi, new_rx, new_tx); 3451 3436 3452 - if (new_rx && !netif_is_rxfh_configured(dev)) 3437 + if (!netif_is_rxfh_configured(dev)) 3453 3438 return ice_vsi_set_dflt_rss_lut(vsi, new_rx); 3439 + 3440 + /* Update rss_size due to change in Rx queues */ 3441 + vsi->rss_size = ice_get_valid_rss_size(&pf->hw, new_rx); 3454 3442 3455 3443 return 0; 3456 3444 }
+33 -2
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
··· 1919 1919 } 1920 1920 1921 1921 /** 1922 + * ice_vc_get_max_frame_size - get max frame size allowed for VF 1923 + * @vf: VF used to determine max frame size 1924 + * 1925 + * Max frame size is determined based on the current port's max frame size and 1926 + * whether a port VLAN is configured on this VF. The VF is not aware whether 1927 + * it's in a port VLAN so the PF needs to account for this in max frame size 1928 + * checks and sending the max frame size to the VF. 1929 + */ 1930 + static u16 ice_vc_get_max_frame_size(struct ice_vf *vf) 1931 + { 1932 + struct ice_vsi *vsi = vf->pf->vsi[vf->lan_vsi_idx]; 1933 + struct ice_port_info *pi = vsi->port_info; 1934 + u16 max_frame_size; 1935 + 1936 + max_frame_size = pi->phy.link_info.max_frame_size; 1937 + 1938 + if (vf->port_vlan_info) 1939 + max_frame_size -= VLAN_HLEN; 1940 + 1941 + return max_frame_size; 1942 + } 1943 + 1944 + /** 1922 1945 * ice_vc_get_vf_res_msg 1923 1946 * @vf: pointer to the VF info 1924 1947 * @msg: pointer to the msg buffer ··· 2023 2000 vfres->max_vectors = pf->num_msix_per_vf; 2024 2001 vfres->rss_key_size = ICE_VSIQF_HKEY_ARRAY_SIZE; 2025 2002 vfres->rss_lut_size = ICE_VSIQF_HLUT_ARRAY_SIZE; 2003 + vfres->max_mtu = ice_vc_get_max_frame_size(vf); 2026 2004 2027 2005 vfres->vsi_res[0].vsi_id = vf->lan_vsi_num; 2028 2006 vfres->vsi_res[0].vsi_type = VIRTCHNL_VSI_SRIOV; ··· 2444 2420 } 2445 2421 2446 2422 if (!test_bit(ICE_FLAG_VF_TRUE_PROMISC_ENA, pf->flags)) { 2447 - bool set_dflt_vsi = !!(info->flags & FLAG_VF_UNICAST_PROMISC); 2423 + bool set_dflt_vsi = alluni || allmulti; 2448 2424 2449 2425 if (set_dflt_vsi && !ice_is_dflt_vsi_in_use(pf->first_sw)) 2450 2426 /* only attempt to set the default forwarding VSI if ··· 3022 2998 3023 2999 /* copy Rx queue info from VF into VSI */ 3024 3000 if (qpi->rxq.ring_len > 0) { 3001 + u16 max_frame_size = ice_vc_get_max_frame_size(vf); 3002 + 3025 3003 num_rxq++; 3026 3004 vsi->rx_rings[i]->dma = qpi->rxq.dma_ring_addr; 3027 3005 vsi->rx_rings[i]->count = qpi->rxq.ring_len; ··· 3036 3010 } 3037 3011 vsi->rx_buf_len = qpi->rxq.databuffer_size; 3038 3012 vsi->rx_rings[i]->rx_buf_len = vsi->rx_buf_len; 3039 - if (qpi->rxq.max_pkt_size >= (16 * 1024) || 3013 + if (qpi->rxq.max_pkt_size > max_frame_size || 3040 3014 qpi->rxq.max_pkt_size < 64) { 3041 3015 v_ret = VIRTCHNL_STATUS_ERR_PARAM; 3042 3016 goto error_param; ··· 3044 3018 } 3045 3019 3046 3020 vsi->max_frame = qpi->rxq.max_pkt_size; 3021 + /* add space for the port VLAN since the VF driver is not 3022 + * expected to account for it in the MTU calculation 3023 + */ 3024 + if (vf->port_vlan_info) 3025 + vsi->max_frame += VLAN_HLEN; 3047 3026 } 3048 3027 3049 3028 /* VF can request to configure less than allocated queues or default