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

Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
40GbE Intel Wired LAN Driver Updates 2019-08-05

This series contains updates to i40e driver only.

Dmitrii adds missing statistic counters for VEB and VEB TC's.

Slawomir adds support for logging the "Disable Firmware LLDP" flag
option and its current status.

Jake fixes an issue where VF's being notified of their link status
before their queues are enabled which was causing issues. So always
report link status down when the VF queues are not enabled. Also adds
future proofing when statistics are added or removed by adding checks to
ensure the data pointer for the strings lines up with the expected
statistics count.

Czeslaw fixes the advertised mode reported in ethtool for FEC, where the
"None BaseR RS" was always being displayed no matter what the mode it
was in. Also added logging information when the PF is entering or
leaving "allmulti" (or promiscuous) mode. Fixed up the logging logic
for VF's when leaving multicast mode to not include unicast as well.

v2: drop Aleksandr's patch (previously patch #2 in the series) to
display the VF MAC address that is set by the VF while community
feedback is addressed.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+90 -51
+1
drivers/net/ethernet/intel/i40e/i40e.h
··· 1021 1021 return NULL; 1022 1022 } 1023 1023 void i40e_update_stats(struct i40e_vsi *vsi); 1024 + void i40e_update_veb_stats(struct i40e_veb *veb); 1024 1025 void i40e_update_eth_stats(struct i40e_vsi *vsi); 1025 1026 struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi); 1026 1027 int i40e_fetch_switch_configuration(struct i40e_pf *pf,
+44 -30
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
··· 711 711 } 712 712 713 713 /** 714 + * i40e_get_settings_link_up_fec - Get the FEC mode encoding from mask 715 + * @req_fec_info: mask request FEC info 716 + * @ks: ethtool ksettings to fill in 717 + **/ 718 + static void i40e_get_settings_link_up_fec(u8 req_fec_info, 719 + struct ethtool_link_ksettings *ks) 720 + { 721 + ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE); 722 + ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS); 723 + ethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER); 724 + 725 + if (I40E_AQ_SET_FEC_REQUEST_RS & req_fec_info) { 726 + ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS); 727 + } else if (I40E_AQ_SET_FEC_REQUEST_KR & req_fec_info) { 728 + ethtool_link_ksettings_add_link_mode(ks, advertising, 729 + FEC_BASER); 730 + } else { 731 + ethtool_link_ksettings_add_link_mode(ks, advertising, 732 + FEC_NONE); 733 + if (I40E_AQ_SET_FEC_AUTO & req_fec_info) { 734 + ethtool_link_ksettings_add_link_mode(ks, advertising, 735 + FEC_RS); 736 + ethtool_link_ksettings_add_link_mode(ks, advertising, 737 + FEC_BASER); 738 + } 739 + } 740 + } 741 + 742 + /** 714 743 * i40e_get_settings_link_up - Get the Link settings for when link is up 715 744 * @hw: hw structure 716 745 * @ks: ethtool ksettings to fill in ··· 798 769 25000baseSR_Full); 799 770 ethtool_link_ksettings_add_link_mode(ks, advertising, 800 771 25000baseSR_Full); 801 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE); 802 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS); 803 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER); 804 - ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_NONE); 805 - ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS); 806 - ethtool_link_ksettings_add_link_mode(ks, advertising, 807 - FEC_BASER); 772 + i40e_get_settings_link_up_fec(hw_link_info->req_fec_info, ks); 808 773 ethtool_link_ksettings_add_link_mode(ks, supported, 809 774 10000baseSR_Full); 810 775 ethtool_link_ksettings_add_link_mode(ks, advertising, ··· 915 892 40000baseKR4_Full); 916 893 ethtool_link_ksettings_add_link_mode(ks, supported, 917 894 25000baseKR_Full); 918 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE); 919 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS); 920 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER); 921 895 ethtool_link_ksettings_add_link_mode(ks, supported, 922 896 20000baseKR2_Full); 923 897 ethtool_link_ksettings_add_link_mode(ks, supported, ··· 928 908 40000baseKR4_Full); 929 909 ethtool_link_ksettings_add_link_mode(ks, advertising, 930 910 25000baseKR_Full); 931 - ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_NONE); 932 - ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS); 933 - ethtool_link_ksettings_add_link_mode(ks, advertising, 934 - FEC_BASER); 911 + i40e_get_settings_link_up_fec(hw_link_info->req_fec_info, ks); 935 912 ethtool_link_ksettings_add_link_mode(ks, advertising, 936 913 20000baseKR2_Full); 937 914 ethtool_link_ksettings_add_link_mode(ks, advertising, ··· 946 929 25000baseCR_Full); 947 930 ethtool_link_ksettings_add_link_mode(ks, advertising, 948 931 25000baseCR_Full); 949 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE); 950 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS); 951 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER); 952 - ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_NONE); 953 - ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS); 954 - ethtool_link_ksettings_add_link_mode(ks, advertising, 955 - FEC_BASER); 932 + i40e_get_settings_link_up_fec(hw_link_info->req_fec_info, ks); 933 + 956 934 break; 957 935 case I40E_PHY_TYPE_25GBASE_AOC: 958 936 case I40E_PHY_TYPE_25GBASE_ACC: ··· 957 945 25000baseCR_Full); 958 946 ethtool_link_ksettings_add_link_mode(ks, advertising, 959 947 25000baseCR_Full); 960 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE); 961 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS); 962 - ethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER); 963 - ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_NONE); 964 - ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS); 965 - ethtool_link_ksettings_add_link_mode(ks, advertising, 966 - FEC_BASER); 948 + i40e_get_settings_link_up_fec(hw_link_info->req_fec_info, ks); 949 + 967 950 ethtool_link_ksettings_add_link_mode(ks, supported, 968 951 10000baseCR_Full); 969 952 ethtool_link_ksettings_add_link_mode(ks, advertising, ··· 2257 2250 struct i40e_netdev_priv *np = netdev_priv(netdev); 2258 2251 struct i40e_vsi *vsi = np->vsi; 2259 2252 struct i40e_pf *pf = vsi->back; 2260 - struct i40e_veb *veb = pf->veb[pf->lan_veb]; 2253 + struct i40e_veb *veb = NULL; 2261 2254 unsigned int i; 2262 2255 bool veb_stats; 2263 2256 u64 *p = data; ··· 2280 2273 goto check_data_pointer; 2281 2274 2282 2275 veb_stats = ((pf->lan_veb != I40E_NO_VEB) && 2276 + (pf->lan_veb < I40E_MAX_VEB) && 2283 2277 (pf->flags & I40E_FLAG_VEB_STATS_ENABLED)); 2278 + 2279 + if (veb_stats) { 2280 + veb = pf->veb[pf->lan_veb]; 2281 + i40e_update_veb_stats(veb); 2282 + } 2284 2283 2285 2284 /* If veb stats aren't enabled, pass NULL instead of the veb so that 2286 2285 * we initialize stats to zero and update the data pointer ··· 2342 2329 } 2343 2330 2344 2331 if (vsi != pf->vsi[pf->lan_vsi] || pf->hw.partition_id != 1) 2345 - return; 2332 + goto check_data_pointer; 2346 2333 2347 2334 i40e_add_stat_strings(&data, i40e_gstrings_veb_stats); 2348 2335 ··· 2354 2341 for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) 2355 2342 i40e_add_stat_strings(&data, i40e_gstrings_pfc_stats, i); 2356 2343 2344 + check_data_pointer: 2357 2345 WARN_ONCE(data - p != i40e_get_stats_count(netdev) * ETH_GSTRING_LEN, 2358 2346 "stat strings count mismatch!"); 2359 2347 }
+10 -1
drivers/net/ethernet/intel/i40e/i40e_main.c
··· 677 677 * i40e_update_veb_stats - Update Switch component statistics 678 678 * @veb: the VEB being updated 679 679 **/ 680 - static void i40e_update_veb_stats(struct i40e_veb *veb) 680 + void i40e_update_veb_stats(struct i40e_veb *veb) 681 681 { 682 682 struct i40e_pf *pf = veb->pf; 683 683 struct i40e_hw *hw = &pf->hw; ··· 2530 2530 vsi_name, 2531 2531 i40e_stat_str(hw, aq_ret), 2532 2532 i40e_aq_str(hw, hw->aq.asq_last_status)); 2533 + } else { 2534 + dev_info(&pf->pdev->dev, "%s is %s allmulti mode.\n", 2535 + vsi->netdev->name, 2536 + cur_multipromisc ? "entering" : "leaving"); 2533 2537 } 2534 2538 } 2535 2539 ··· 8489 8485 */ 8490 8486 dev_dbg(&pf->pdev->dev, "PFR requested\n"); 8491 8487 i40e_handle_reset_warning(pf, lock_acquired); 8488 + 8489 + dev_info(&pf->pdev->dev, 8490 + pf->flags & I40E_FLAG_DISABLE_FW_LLDP ? 8491 + "FW LLDP is disabled\n" : 8492 + "FW LLDP is enabled\n"); 8492 8493 8493 8494 } else if (reset_flags & BIT_ULL(__I40E_REINIT_REQUESTED)) { 8494 8495 int v;
+34 -20
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
··· 55 55 56 56 pfe.event = VIRTCHNL_EVENT_LINK_CHANGE; 57 57 pfe.severity = PF_EVENT_SEVERITY_INFO; 58 - if (vf->link_forced) { 58 + 59 + /* Always report link is down if the VF queues aren't enabled */ 60 + if (!vf->queues_enabled) { 61 + pfe.event_data.link_event.link_status = false; 62 + pfe.event_data.link_event.link_speed = 0; 63 + } else if (vf->link_forced) { 59 64 pfe.event_data.link_event.link_status = vf->link_up; 60 65 pfe.event_data.link_event.link_speed = 61 66 (vf->link_up ? VIRTCHNL_LINK_SPEED_40GB : 0); ··· 70 65 pfe.event_data.link_event.link_speed = 71 66 i40e_virtchnl_link_speed(ls->link_speed); 72 67 } 68 + 73 69 i40e_aq_send_msg_to_vf(hw, abs_vf_id, VIRTCHNL_OP_EVENT, 74 70 0, (u8 *)&pfe, sizeof(pfe), NULL); 75 71 } ··· 2043 2037 alluni = true; 2044 2038 aq_ret = i40e_config_vf_promiscuous_mode(vf, info->vsi_id, allmulti, 2045 2039 alluni); 2046 - if (!aq_ret) { 2047 - if (allmulti) { 2040 + if (aq_ret) 2041 + goto err_out; 2042 + 2043 + if (allmulti) { 2044 + if (!test_and_set_bit(I40E_VF_STATE_MC_PROMISC, 2045 + &vf->vf_states)) 2048 2046 dev_info(&pf->pdev->dev, 2049 2047 "VF %d successfully set multicast promiscuous mode\n", 2050 2048 vf->vf_id); 2051 - set_bit(I40E_VF_STATE_MC_PROMISC, &vf->vf_states); 2052 - } else { 2053 - dev_info(&pf->pdev->dev, 2054 - "VF %d successfully unset multicast promiscuous mode\n", 2055 - vf->vf_id); 2056 - clear_bit(I40E_VF_STATE_MC_PROMISC, &vf->vf_states); 2057 - } 2058 - if (alluni) { 2049 + } else if (test_and_clear_bit(I40E_VF_STATE_MC_PROMISC, 2050 + &vf->vf_states)) 2051 + dev_info(&pf->pdev->dev, 2052 + "VF %d successfully unset multicast promiscuous mode\n", 2053 + vf->vf_id); 2054 + 2055 + if (alluni) { 2056 + if (!test_and_set_bit(I40E_VF_STATE_UC_PROMISC, 2057 + &vf->vf_states)) 2059 2058 dev_info(&pf->pdev->dev, 2060 2059 "VF %d successfully set unicast promiscuous mode\n", 2061 2060 vf->vf_id); 2062 - set_bit(I40E_VF_STATE_UC_PROMISC, &vf->vf_states); 2063 - } else { 2064 - dev_info(&pf->pdev->dev, 2065 - "VF %d successfully unset unicast promiscuous mode\n", 2066 - vf->vf_id); 2067 - clear_bit(I40E_VF_STATE_UC_PROMISC, &vf->vf_states); 2068 - } 2069 - } 2061 + } else if (test_and_clear_bit(I40E_VF_STATE_UC_PROMISC, 2062 + &vf->vf_states)) 2063 + dev_info(&pf->pdev->dev, 2064 + "VF %d successfully unset unicast promiscuous mode\n", 2065 + vf->vf_id); 2066 + 2070 2067 err_out: 2071 2068 /* send the response to the VF */ 2072 2069 return i40e_vc_send_resp_to_vf(vf, ··· 2162 2153 * VF does not know about these additional VSIs and all 2163 2154 * it cares is about its own queues. PF configures these queues 2164 2155 * to its appropriate VSIs based on TC mapping 2165 - **/ 2156 + */ 2166 2157 if (vf->adq_enabled) { 2167 2158 if (idx >= ARRAY_SIZE(vf->ch)) { 2168 2159 aq_ret = I40E_ERR_NO_AVAILABLE_VSI; ··· 2373 2364 } 2374 2365 } 2375 2366 2367 + vf->queues_enabled = true; 2368 + 2376 2369 error_param: 2377 2370 /* send the response to the VF */ 2378 2371 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ENABLE_QUEUES, ··· 2395 2384 (struct virtchnl_queue_select *)msg; 2396 2385 struct i40e_pf *pf = vf->pf; 2397 2386 i40e_status aq_ret = 0; 2387 + 2388 + /* Immediately mark queues as disabled */ 2389 + vf->queues_enabled = false; 2398 2390 2399 2391 if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) { 2400 2392 aq_ret = I40E_ERR_PARAM;
+1
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
··· 99 99 unsigned int tx_rate; /* Tx bandwidth limit in Mbps */ 100 100 bool link_forced; 101 101 bool link_up; /* only valid if VF link is forced */ 102 + bool queues_enabled; /* true if the VF queues are enabled */ 102 103 bool spoofchk; 103 104 u16 num_mac; 104 105 u16 num_vlan;