Commit 05bb5203 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents aa733660 558e93c9
...@@ -1021,6 +1021,7 @@ i40e_find_vsi_by_type(struct i40e_pf *pf, u16 type) ...@@ -1021,6 +1021,7 @@ i40e_find_vsi_by_type(struct i40e_pf *pf, u16 type)
return NULL; return NULL;
} }
void i40e_update_stats(struct i40e_vsi *vsi); void i40e_update_stats(struct i40e_vsi *vsi);
void i40e_update_veb_stats(struct i40e_veb *veb);
void i40e_update_eth_stats(struct i40e_vsi *vsi); void i40e_update_eth_stats(struct i40e_vsi *vsi);
struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi); struct rtnl_link_stats64 *i40e_get_vsi_stats_struct(struct i40e_vsi *vsi);
int i40e_fetch_switch_configuration(struct i40e_pf *pf, int i40e_fetch_switch_configuration(struct i40e_pf *pf,
......
...@@ -710,6 +710,35 @@ static void i40e_phy_type_to_ethtool(struct i40e_pf *pf, ...@@ -710,6 +710,35 @@ static void i40e_phy_type_to_ethtool(struct i40e_pf *pf,
} }
} }
/**
* i40e_get_settings_link_up_fec - Get the FEC mode encoding from mask
* @req_fec_info: mask request FEC info
* @ks: ethtool ksettings to fill in
**/
static void i40e_get_settings_link_up_fec(u8 req_fec_info,
struct ethtool_link_ksettings *ks)
{
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER);
if (I40E_AQ_SET_FEC_REQUEST_RS & req_fec_info) {
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS);
} else if (I40E_AQ_SET_FEC_REQUEST_KR & req_fec_info) {
ethtool_link_ksettings_add_link_mode(ks, advertising,
FEC_BASER);
} else {
ethtool_link_ksettings_add_link_mode(ks, advertising,
FEC_NONE);
if (I40E_AQ_SET_FEC_AUTO & req_fec_info) {
ethtool_link_ksettings_add_link_mode(ks, advertising,
FEC_RS);
ethtool_link_ksettings_add_link_mode(ks, advertising,
FEC_BASER);
}
}
}
/** /**
* i40e_get_settings_link_up - Get the Link settings for when link is up * i40e_get_settings_link_up - Get the Link settings for when link is up
* @hw: hw structure * @hw: hw structure
...@@ -769,13 +798,7 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw, ...@@ -769,13 +798,7 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,
25000baseSR_Full); 25000baseSR_Full);
ethtool_link_ksettings_add_link_mode(ks, advertising, ethtool_link_ksettings_add_link_mode(ks, advertising,
25000baseSR_Full); 25000baseSR_Full);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE); i40e_get_settings_link_up_fec(hw_link_info->req_fec_info, ks);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER);
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_NONE);
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS);
ethtool_link_ksettings_add_link_mode(ks, advertising,
FEC_BASER);
ethtool_link_ksettings_add_link_mode(ks, supported, ethtool_link_ksettings_add_link_mode(ks, supported,
10000baseSR_Full); 10000baseSR_Full);
ethtool_link_ksettings_add_link_mode(ks, advertising, ethtool_link_ksettings_add_link_mode(ks, advertising,
...@@ -892,9 +915,6 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw, ...@@ -892,9 +915,6 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,
40000baseKR4_Full); 40000baseKR4_Full);
ethtool_link_ksettings_add_link_mode(ks, supported, ethtool_link_ksettings_add_link_mode(ks, supported,
25000baseKR_Full); 25000baseKR_Full);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER);
ethtool_link_ksettings_add_link_mode(ks, supported, ethtool_link_ksettings_add_link_mode(ks, supported,
20000baseKR2_Full); 20000baseKR2_Full);
ethtool_link_ksettings_add_link_mode(ks, supported, ethtool_link_ksettings_add_link_mode(ks, supported,
...@@ -908,10 +928,7 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw, ...@@ -908,10 +928,7 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,
40000baseKR4_Full); 40000baseKR4_Full);
ethtool_link_ksettings_add_link_mode(ks, advertising, ethtool_link_ksettings_add_link_mode(ks, advertising,
25000baseKR_Full); 25000baseKR_Full);
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_NONE); i40e_get_settings_link_up_fec(hw_link_info->req_fec_info, ks);
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS);
ethtool_link_ksettings_add_link_mode(ks, advertising,
FEC_BASER);
ethtool_link_ksettings_add_link_mode(ks, advertising, ethtool_link_ksettings_add_link_mode(ks, advertising,
20000baseKR2_Full); 20000baseKR2_Full);
ethtool_link_ksettings_add_link_mode(ks, advertising, ethtool_link_ksettings_add_link_mode(ks, advertising,
...@@ -929,13 +946,8 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw, ...@@ -929,13 +946,8 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,
25000baseCR_Full); 25000baseCR_Full);
ethtool_link_ksettings_add_link_mode(ks, advertising, ethtool_link_ksettings_add_link_mode(ks, advertising,
25000baseCR_Full); 25000baseCR_Full);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE); i40e_get_settings_link_up_fec(hw_link_info->req_fec_info, ks);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER);
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_NONE);
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS);
ethtool_link_ksettings_add_link_mode(ks, advertising,
FEC_BASER);
break; break;
case I40E_PHY_TYPE_25GBASE_AOC: case I40E_PHY_TYPE_25GBASE_AOC:
case I40E_PHY_TYPE_25GBASE_ACC: case I40E_PHY_TYPE_25GBASE_ACC:
...@@ -945,13 +957,8 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw, ...@@ -945,13 +957,8 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,
25000baseCR_Full); 25000baseCR_Full);
ethtool_link_ksettings_add_link_mode(ks, advertising, ethtool_link_ksettings_add_link_mode(ks, advertising,
25000baseCR_Full); 25000baseCR_Full);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_NONE); i40e_get_settings_link_up_fec(hw_link_info->req_fec_info, ks);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS);
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_BASER);
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_NONE);
ethtool_link_ksettings_add_link_mode(ks, advertising, FEC_RS);
ethtool_link_ksettings_add_link_mode(ks, advertising,
FEC_BASER);
ethtool_link_ksettings_add_link_mode(ks, supported, ethtool_link_ksettings_add_link_mode(ks, supported,
10000baseCR_Full); 10000baseCR_Full);
ethtool_link_ksettings_add_link_mode(ks, advertising, ethtool_link_ksettings_add_link_mode(ks, advertising,
...@@ -2250,7 +2257,7 @@ static void i40e_get_ethtool_stats(struct net_device *netdev, ...@@ -2250,7 +2257,7 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
struct i40e_netdev_priv *np = netdev_priv(netdev); struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi; struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back; struct i40e_pf *pf = vsi->back;
struct i40e_veb *veb = pf->veb[pf->lan_veb]; struct i40e_veb *veb = NULL;
unsigned int i; unsigned int i;
bool veb_stats; bool veb_stats;
u64 *p = data; u64 *p = data;
...@@ -2273,8 +2280,14 @@ static void i40e_get_ethtool_stats(struct net_device *netdev, ...@@ -2273,8 +2280,14 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
goto check_data_pointer; goto check_data_pointer;
veb_stats = ((pf->lan_veb != I40E_NO_VEB) && veb_stats = ((pf->lan_veb != I40E_NO_VEB) &&
(pf->lan_veb < I40E_MAX_VEB) &&
(pf->flags & I40E_FLAG_VEB_STATS_ENABLED)); (pf->flags & I40E_FLAG_VEB_STATS_ENABLED));
if (veb_stats) {
veb = pf->veb[pf->lan_veb];
i40e_update_veb_stats(veb);
}
/* If veb stats aren't enabled, pass NULL instead of the veb so that /* If veb stats aren't enabled, pass NULL instead of the veb so that
* we initialize stats to zero and update the data pointer * we initialize stats to zero and update the data pointer
* intelligently * intelligently
...@@ -2329,7 +2342,7 @@ static void i40e_get_stat_strings(struct net_device *netdev, u8 *data) ...@@ -2329,7 +2342,7 @@ static void i40e_get_stat_strings(struct net_device *netdev, u8 *data)
} }
if (vsi != pf->vsi[pf->lan_vsi] || pf->hw.partition_id != 1) if (vsi != pf->vsi[pf->lan_vsi] || pf->hw.partition_id != 1)
return; goto check_data_pointer;
i40e_add_stat_strings(&data, i40e_gstrings_veb_stats); i40e_add_stat_strings(&data, i40e_gstrings_veb_stats);
...@@ -2341,6 +2354,7 @@ static void i40e_get_stat_strings(struct net_device *netdev, u8 *data) ...@@ -2341,6 +2354,7 @@ static void i40e_get_stat_strings(struct net_device *netdev, u8 *data)
for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) for (i = 0; i < I40E_MAX_USER_PRIORITY; i++)
i40e_add_stat_strings(&data, i40e_gstrings_pfc_stats, i); i40e_add_stat_strings(&data, i40e_gstrings_pfc_stats, i);
check_data_pointer:
WARN_ONCE(data - p != i40e_get_stats_count(netdev) * ETH_GSTRING_LEN, WARN_ONCE(data - p != i40e_get_stats_count(netdev) * ETH_GSTRING_LEN,
"stat strings count mismatch!"); "stat strings count mismatch!");
} }
......
...@@ -677,7 +677,7 @@ void i40e_update_eth_stats(struct i40e_vsi *vsi) ...@@ -677,7 +677,7 @@ void i40e_update_eth_stats(struct i40e_vsi *vsi)
* i40e_update_veb_stats - Update Switch component statistics * i40e_update_veb_stats - Update Switch component statistics
* @veb: the VEB being updated * @veb: the VEB being updated
**/ **/
static void i40e_update_veb_stats(struct i40e_veb *veb) void i40e_update_veb_stats(struct i40e_veb *veb)
{ {
struct i40e_pf *pf = veb->pf; struct i40e_pf *pf = veb->pf;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
...@@ -2530,6 +2530,10 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) ...@@ -2530,6 +2530,10 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
vsi_name, vsi_name,
i40e_stat_str(hw, aq_ret), i40e_stat_str(hw, aq_ret),
i40e_aq_str(hw, hw->aq.asq_last_status)); i40e_aq_str(hw, hw->aq.asq_last_status));
} else {
dev_info(&pf->pdev->dev, "%s is %s allmulti mode.\n",
vsi->netdev->name,
cur_multipromisc ? "entering" : "leaving");
} }
} }
...@@ -8486,6 +8490,11 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired) ...@@ -8486,6 +8490,11 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired)
dev_dbg(&pf->pdev->dev, "PFR requested\n"); dev_dbg(&pf->pdev->dev, "PFR requested\n");
i40e_handle_reset_warning(pf, lock_acquired); i40e_handle_reset_warning(pf, lock_acquired);
dev_info(&pf->pdev->dev,
pf->flags & I40E_FLAG_DISABLE_FW_LLDP ?
"FW LLDP is disabled\n" :
"FW LLDP is enabled\n");
} else if (reset_flags & BIT_ULL(__I40E_REINIT_REQUESTED)) { } else if (reset_flags & BIT_ULL(__I40E_REINIT_REQUESTED)) {
int v; int v;
......
...@@ -55,7 +55,12 @@ static void i40e_vc_notify_vf_link_state(struct i40e_vf *vf) ...@@ -55,7 +55,12 @@ static void i40e_vc_notify_vf_link_state(struct i40e_vf *vf)
pfe.event = VIRTCHNL_EVENT_LINK_CHANGE; pfe.event = VIRTCHNL_EVENT_LINK_CHANGE;
pfe.severity = PF_EVENT_SEVERITY_INFO; pfe.severity = PF_EVENT_SEVERITY_INFO;
if (vf->link_forced) {
/* Always report link is down if the VF queues aren't enabled */
if (!vf->queues_enabled) {
pfe.event_data.link_event.link_status = false;
pfe.event_data.link_event.link_speed = 0;
} else if (vf->link_forced) {
pfe.event_data.link_event.link_status = vf->link_up; pfe.event_data.link_event.link_status = vf->link_up;
pfe.event_data.link_event.link_speed = pfe.event_data.link_event.link_speed =
(vf->link_up ? VIRTCHNL_LINK_SPEED_40GB : 0); (vf->link_up ? VIRTCHNL_LINK_SPEED_40GB : 0);
...@@ -65,6 +70,7 @@ static void i40e_vc_notify_vf_link_state(struct i40e_vf *vf) ...@@ -65,6 +70,7 @@ static void i40e_vc_notify_vf_link_state(struct i40e_vf *vf)
pfe.event_data.link_event.link_speed = pfe.event_data.link_event.link_speed =
i40e_virtchnl_link_speed(ls->link_speed); i40e_virtchnl_link_speed(ls->link_speed);
} }
i40e_aq_send_msg_to_vf(hw, abs_vf_id, VIRTCHNL_OP_EVENT, i40e_aq_send_msg_to_vf(hw, abs_vf_id, VIRTCHNL_OP_EVENT,
0, (u8 *)&pfe, sizeof(pfe), NULL); 0, (u8 *)&pfe, sizeof(pfe), NULL);
} }
...@@ -2037,30 +2043,33 @@ static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2037,30 +2043,33 @@ static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf, u8 *msg)
alluni = true; alluni = true;
aq_ret = i40e_config_vf_promiscuous_mode(vf, info->vsi_id, allmulti, aq_ret = i40e_config_vf_promiscuous_mode(vf, info->vsi_id, allmulti,
alluni); alluni);
if (!aq_ret) { if (aq_ret)
if (allmulti) { goto err_out;
if (allmulti) {
if (!test_and_set_bit(I40E_VF_STATE_MC_PROMISC,
&vf->vf_states))
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"VF %d successfully set multicast promiscuous mode\n", "VF %d successfully set multicast promiscuous mode\n",
vf->vf_id); vf->vf_id);
set_bit(I40E_VF_STATE_MC_PROMISC, &vf->vf_states); } else if (test_and_clear_bit(I40E_VF_STATE_MC_PROMISC,
} else { &vf->vf_states))
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"VF %d successfully unset multicast promiscuous mode\n", "VF %d successfully unset multicast promiscuous mode\n",
vf->vf_id); vf->vf_id);
clear_bit(I40E_VF_STATE_MC_PROMISC, &vf->vf_states);
} if (alluni) {
if (alluni) { if (!test_and_set_bit(I40E_VF_STATE_UC_PROMISC,
&vf->vf_states))
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"VF %d successfully set unicast promiscuous mode\n", "VF %d successfully set unicast promiscuous mode\n",
vf->vf_id); vf->vf_id);
set_bit(I40E_VF_STATE_UC_PROMISC, &vf->vf_states); } else if (test_and_clear_bit(I40E_VF_STATE_UC_PROMISC,
} else { &vf->vf_states))
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"VF %d successfully unset unicast promiscuous mode\n", "VF %d successfully unset unicast promiscuous mode\n",
vf->vf_id); vf->vf_id);
clear_bit(I40E_VF_STATE_UC_PROMISC, &vf->vf_states);
}
}
err_out: err_out:
/* send the response to the VF */ /* send the response to the VF */
return i40e_vc_send_resp_to_vf(vf, return i40e_vc_send_resp_to_vf(vf,
...@@ -2153,7 +2162,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2153,7 +2162,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
* VF does not know about these additional VSIs and all * VF does not know about these additional VSIs and all
* it cares is about its own queues. PF configures these queues * it cares is about its own queues. PF configures these queues
* to its appropriate VSIs based on TC mapping * to its appropriate VSIs based on TC mapping
**/ */
if (vf->adq_enabled) { if (vf->adq_enabled) {
if (idx >= ARRAY_SIZE(vf->ch)) { if (idx >= ARRAY_SIZE(vf->ch)) {
aq_ret = I40E_ERR_NO_AVAILABLE_VSI; aq_ret = I40E_ERR_NO_AVAILABLE_VSI;
...@@ -2364,6 +2373,8 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2364,6 +2373,8 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg)
} }
} }
vf->queues_enabled = true;
error_param: error_param:
/* send the response to the VF */ /* send the response to the VF */
return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ENABLE_QUEUES, return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ENABLE_QUEUES,
...@@ -2385,6 +2396,9 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2385,6 +2396,9 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg)
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
i40e_status aq_ret = 0; i40e_status aq_ret = 0;
/* Immediately mark queues as disabled */
vf->queues_enabled = false;
if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) { if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {
aq_ret = I40E_ERR_PARAM; aq_ret = I40E_ERR_PARAM;
goto error_param; goto error_param;
......
...@@ -99,6 +99,7 @@ struct i40e_vf { ...@@ -99,6 +99,7 @@ struct i40e_vf {
unsigned int tx_rate; /* Tx bandwidth limit in Mbps */ unsigned int tx_rate; /* Tx bandwidth limit in Mbps */
bool link_forced; bool link_forced;
bool link_up; /* only valid if VF link is forced */ bool link_up; /* only valid if VF link is forced */
bool queues_enabled; /* true if the VF queues are enabled */
bool spoofchk; bool spoofchk;
u16 num_mac; u16 num_mac;
u16 num_vlan; u16 num_vlan;
......
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