Commit 6fbd15c0 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 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.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents fcb30073 0393e46a
...@@ -454,9 +454,7 @@ struct ice_pf { ...@@ -454,9 +454,7 @@ struct ice_pf {
struct ice_hw_port_stats stats_prev; struct ice_hw_port_stats stats_prev;
struct ice_hw hw; struct ice_hw hw;
u8 stat_prev_loaded:1; /* has previous stats been loaded */ u8 stat_prev_loaded:1; /* has previous stats been loaded */
#ifdef CONFIG_DCB
u16 dcbx_cap; u16 dcbx_cap;
#endif /* CONFIG_DCB */
u32 tx_timeout_count; u32 tx_timeout_count;
unsigned long tx_timeout_last_recovery; unsigned long tx_timeout_last_recovery;
u32 tx_timeout_recovery_level; u32 tx_timeout_recovery_level;
......
...@@ -134,7 +134,7 @@ ice_dcbnl_getnumtcs(struct net_device *dev, int __always_unused tcid, u8 *num) ...@@ -134,7 +134,7 @@ ice_dcbnl_getnumtcs(struct net_device *dev, int __always_unused tcid, u8 *num)
if (!test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags)) if (!test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags))
return -EINVAL; return -EINVAL;
*num = IEEE_8021QAZ_MAX_TCS; *num = pf->hw.func_caps.common_cap.maxtc;
return 0; return 0;
} }
...@@ -159,6 +159,10 @@ static u8 ice_dcbnl_setdcbx(struct net_device *netdev, u8 mode) ...@@ -159,6 +159,10 @@ static u8 ice_dcbnl_setdcbx(struct net_device *netdev, u8 mode)
struct ice_pf *pf = ice_netdev_to_pf(netdev); struct ice_pf *pf = ice_netdev_to_pf(netdev);
struct ice_qos_cfg *qos_cfg; struct ice_qos_cfg *qos_cfg;
/* if FW LLDP agent is running, DCBNL not allowed to change mode */
if (test_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags))
return ICE_DCB_NO_HW_CHG;
/* No support for LLD_MANAGED modes or CEE+IEEE */ /* No support for LLD_MANAGED modes or CEE+IEEE */
if ((mode & DCB_CAP_DCBX_LLD_MANAGED) || if ((mode & DCB_CAP_DCBX_LLD_MANAGED) ||
((mode & DCB_CAP_DCBX_VER_IEEE) && (mode & DCB_CAP_DCBX_VER_CEE)) || ((mode & DCB_CAP_DCBX_VER_IEEE) && (mode & DCB_CAP_DCBX_VER_CEE)) ||
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "ice_fltr.h" #include "ice_fltr.h"
#include "ice_lib.h" #include "ice_lib.h"
#include "ice_dcb_lib.h" #include "ice_dcb_lib.h"
#include <net/dcbnl.h>
struct ice_stats { struct ice_stats {
char stat_string[ETH_GSTRING_LEN]; char stat_string[ETH_GSTRING_LEN];
...@@ -1238,6 +1239,9 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags) ...@@ -1238,6 +1239,9 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)
status = ice_init_pf_dcb(pf, true); status = ice_init_pf_dcb(pf, true);
if (status) if (status)
dev_warn(dev, "Fail to init DCB\n"); dev_warn(dev, "Fail to init DCB\n");
pf->dcbx_cap &= ~DCB_CAP_DCBX_LLD_MANAGED;
pf->dcbx_cap |= DCB_CAP_DCBX_HOST;
} else { } else {
enum ice_status status; enum ice_status status;
bool dcbx_agent_status; bool dcbx_agent_status;
...@@ -1280,6 +1284,9 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags) ...@@ -1280,6 +1284,9 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)
if (status) if (status)
dev_dbg(dev, "Fail to enable MIB change events\n"); dev_dbg(dev, "Fail to enable MIB change events\n");
pf->dcbx_cap &= ~DCB_CAP_DCBX_HOST;
pf->dcbx_cap |= DCB_CAP_DCBX_LLD_MANAGED;
ice_nway_reset(netdev); ice_nway_reset(netdev);
} }
} }
...@@ -3321,6 +3328,18 @@ ice_get_channels(struct net_device *dev, struct ethtool_channels *ch) ...@@ -3321,6 +3328,18 @@ ice_get_channels(struct net_device *dev, struct ethtool_channels *ch)
ch->max_other = ch->other_count; ch->max_other = ch->other_count;
} }
/**
* ice_get_valid_rss_size - return valid number of RSS queues
* @hw: pointer to the HW structure
* @new_size: requested RSS queues
*/
static int ice_get_valid_rss_size(struct ice_hw *hw, int new_size)
{
struct ice_hw_common_caps *caps = &hw->func_caps.common_cap;
return min_t(int, new_size, BIT(caps->rss_table_entry_width));
}
/** /**
* ice_vsi_set_dflt_rss_lut - set default RSS LUT with requested RSS size * ice_vsi_set_dflt_rss_lut - set default RSS LUT with requested RSS size
* @vsi: VSI to reconfigure RSS LUT on * @vsi: VSI to reconfigure RSS LUT on
...@@ -3348,14 +3367,10 @@ static int ice_vsi_set_dflt_rss_lut(struct ice_vsi *vsi, int req_rss_size) ...@@ -3348,14 +3367,10 @@ static int ice_vsi_set_dflt_rss_lut(struct ice_vsi *vsi, int req_rss_size)
return -ENOMEM; return -ENOMEM;
/* set RSS LUT parameters */ /* set RSS LUT parameters */
if (!test_bit(ICE_FLAG_RSS_ENA, pf->flags)) { if (!test_bit(ICE_FLAG_RSS_ENA, pf->flags))
vsi->rss_size = 1; vsi->rss_size = 1;
} else { else
struct ice_hw_common_caps *caps = &hw->func_caps.common_cap; vsi->rss_size = ice_get_valid_rss_size(hw, req_rss_size);
vsi->rss_size = min_t(int, req_rss_size,
BIT(caps->rss_table_entry_width));
}
/* create/set RSS LUT */ /* create/set RSS LUT */
ice_fill_rss_lut(lut, vsi->rss_table_size, vsi->rss_size); ice_fill_rss_lut(lut, vsi->rss_table_size, vsi->rss_size);
...@@ -3434,9 +3449,12 @@ static int ice_set_channels(struct net_device *dev, struct ethtool_channels *ch) ...@@ -3434,9 +3449,12 @@ static int ice_set_channels(struct net_device *dev, struct ethtool_channels *ch)
ice_vsi_recfg_qs(vsi, new_rx, new_tx); ice_vsi_recfg_qs(vsi, new_rx, new_tx);
if (new_rx && !netif_is_rxfh_configured(dev)) if (!netif_is_rxfh_configured(dev))
return ice_vsi_set_dflt_rss_lut(vsi, new_rx); return ice_vsi_set_dflt_rss_lut(vsi, new_rx);
/* Update rss_size due to change in Rx queues */
vsi->rss_size = ice_get_valid_rss_size(&pf->hw, new_rx);
return 0; return 0;
} }
......
...@@ -1918,6 +1918,29 @@ static int ice_vc_get_ver_msg(struct ice_vf *vf, u8 *msg) ...@@ -1918,6 +1918,29 @@ static int ice_vc_get_ver_msg(struct ice_vf *vf, u8 *msg)
sizeof(struct virtchnl_version_info)); sizeof(struct virtchnl_version_info));
} }
/**
* ice_vc_get_max_frame_size - get max frame size allowed for VF
* @vf: VF used to determine max frame size
*
* Max frame size is determined based on the current port's max frame size and
* whether a port VLAN is configured on this VF. The VF is not aware whether
* it's in a port VLAN so the PF needs to account for this in max frame size
* checks and sending the max frame size to the VF.
*/
static u16 ice_vc_get_max_frame_size(struct ice_vf *vf)
{
struct ice_vsi *vsi = vf->pf->vsi[vf->lan_vsi_idx];
struct ice_port_info *pi = vsi->port_info;
u16 max_frame_size;
max_frame_size = pi->phy.link_info.max_frame_size;
if (vf->port_vlan_info)
max_frame_size -= VLAN_HLEN;
return max_frame_size;
}
/** /**
* ice_vc_get_vf_res_msg * ice_vc_get_vf_res_msg
* @vf: pointer to the VF info * @vf: pointer to the VF info
...@@ -2000,6 +2023,7 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg) ...@@ -2000,6 +2023,7 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)
vfres->max_vectors = pf->num_msix_per_vf; vfres->max_vectors = pf->num_msix_per_vf;
vfres->rss_key_size = ICE_VSIQF_HKEY_ARRAY_SIZE; vfres->rss_key_size = ICE_VSIQF_HKEY_ARRAY_SIZE;
vfres->rss_lut_size = ICE_VSIQF_HLUT_ARRAY_SIZE; vfres->rss_lut_size = ICE_VSIQF_HLUT_ARRAY_SIZE;
vfres->max_mtu = ice_vc_get_max_frame_size(vf);
vfres->vsi_res[0].vsi_id = vf->lan_vsi_num; vfres->vsi_res[0].vsi_id = vf->lan_vsi_num;
vfres->vsi_res[0].vsi_type = VIRTCHNL_VSI_SRIOV; vfres->vsi_res[0].vsi_type = VIRTCHNL_VSI_SRIOV;
...@@ -2420,7 +2444,7 @@ static int ice_vc_cfg_promiscuous_mode_msg(struct ice_vf *vf, u8 *msg) ...@@ -2420,7 +2444,7 @@ static int ice_vc_cfg_promiscuous_mode_msg(struct ice_vf *vf, u8 *msg)
} }
if (!test_bit(ICE_FLAG_VF_TRUE_PROMISC_ENA, pf->flags)) { if (!test_bit(ICE_FLAG_VF_TRUE_PROMISC_ENA, pf->flags)) {
bool set_dflt_vsi = !!(info->flags & FLAG_VF_UNICAST_PROMISC); bool set_dflt_vsi = alluni || allmulti;
if (set_dflt_vsi && !ice_is_dflt_vsi_in_use(pf->first_sw)) if (set_dflt_vsi && !ice_is_dflt_vsi_in_use(pf->first_sw))
/* only attempt to set the default forwarding VSI if /* only attempt to set the default forwarding VSI if
...@@ -2998,6 +3022,8 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg) ...@@ -2998,6 +3022,8 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
/* copy Rx queue info from VF into VSI */ /* copy Rx queue info from VF into VSI */
if (qpi->rxq.ring_len > 0) { if (qpi->rxq.ring_len > 0) {
u16 max_frame_size = ice_vc_get_max_frame_size(vf);
num_rxq++; num_rxq++;
vsi->rx_rings[i]->dma = qpi->rxq.dma_ring_addr; vsi->rx_rings[i]->dma = qpi->rxq.dma_ring_addr;
vsi->rx_rings[i]->count = qpi->rxq.ring_len; vsi->rx_rings[i]->count = qpi->rxq.ring_len;
...@@ -3010,7 +3036,7 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg) ...@@ -3010,7 +3036,7 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
} }
vsi->rx_buf_len = qpi->rxq.databuffer_size; vsi->rx_buf_len = qpi->rxq.databuffer_size;
vsi->rx_rings[i]->rx_buf_len = vsi->rx_buf_len; vsi->rx_rings[i]->rx_buf_len = vsi->rx_buf_len;
if (qpi->rxq.max_pkt_size >= (16 * 1024) || if (qpi->rxq.max_pkt_size > max_frame_size ||
qpi->rxq.max_pkt_size < 64) { qpi->rxq.max_pkt_size < 64) {
v_ret = VIRTCHNL_STATUS_ERR_PARAM; v_ret = VIRTCHNL_STATUS_ERR_PARAM;
goto error_param; goto error_param;
...@@ -3018,6 +3044,11 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg) ...@@ -3018,6 +3044,11 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
} }
vsi->max_frame = qpi->rxq.max_pkt_size; vsi->max_frame = qpi->rxq.max_pkt_size;
/* add space for the port VLAN since the VF driver is not
* expected to account for it in the MTU calculation
*/
if (vf->port_vlan_info)
vsi->max_frame += VLAN_HLEN;
} }
/* VF can request to configure less than allocated queues or default /* VF can request to configure less than allocated queues or default
......
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