Skip to content

Commit 26821ec

Browse files
committed
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-06-04 This series contains updates to virtchnl header file and ice driver. Brett fixes VF being unable to request a different number of queues then allocated and adds clearing of VF_MBX_ATQLEN register for VF reset. Haiyue handles error of rebuilding VF VSI during reset. Paul fixes reporting of autoneg to use the PHY capabilities. Dave allows LLDP packets without priority of TC_PRIO_CONTROL to be transmitted. Geert Uytterhoeven adds explicit padding to virtchnl_proto_hdrs structure in the virtchnl header file. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 6fd815b + 519d8ab commit 26821ec

File tree

6 files changed

+27
-52
lines changed

6 files changed

+27
-52
lines changed

drivers/net/ethernet/intel/ice/ice_ethtool.c

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,49 +1773,6 @@ ice_phy_type_to_ethtool(struct net_device *netdev,
17731773
ice_ethtool_advertise_link_mode(ICE_AQ_LINK_SPEED_100GB,
17741774
100000baseKR4_Full);
17751775
}
1776-
1777-
/* Autoneg PHY types */
1778-
if (phy_types_low & ICE_PHY_TYPE_LOW_100BASE_TX ||
1779-
phy_types_low & ICE_PHY_TYPE_LOW_1000BASE_T ||
1780-
phy_types_low & ICE_PHY_TYPE_LOW_1000BASE_KX ||
1781-
phy_types_low & ICE_PHY_TYPE_LOW_2500BASE_T ||
1782-
phy_types_low & ICE_PHY_TYPE_LOW_2500BASE_KX ||
1783-
phy_types_low & ICE_PHY_TYPE_LOW_5GBASE_T ||
1784-
phy_types_low & ICE_PHY_TYPE_LOW_5GBASE_KR ||
1785-
phy_types_low & ICE_PHY_TYPE_LOW_10GBASE_T ||
1786-
phy_types_low & ICE_PHY_TYPE_LOW_10GBASE_KR_CR1 ||
1787-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_T ||
1788-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_CR ||
1789-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_CR_S ||
1790-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_CR1 ||
1791-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_KR ||
1792-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_KR_S ||
1793-
phy_types_low & ICE_PHY_TYPE_LOW_25GBASE_KR1 ||
1794-
phy_types_low & ICE_PHY_TYPE_LOW_40GBASE_CR4 ||
1795-
phy_types_low & ICE_PHY_TYPE_LOW_40GBASE_KR4) {
1796-
ethtool_link_ksettings_add_link_mode(ks, supported,
1797-
Autoneg);
1798-
ethtool_link_ksettings_add_link_mode(ks, advertising,
1799-
Autoneg);
1800-
}
1801-
if (phy_types_low & ICE_PHY_TYPE_LOW_50GBASE_CR2 ||
1802-
phy_types_low & ICE_PHY_TYPE_LOW_50GBASE_KR2 ||
1803-
phy_types_low & ICE_PHY_TYPE_LOW_50GBASE_CP ||
1804-
phy_types_low & ICE_PHY_TYPE_LOW_50GBASE_KR_PAM4) {
1805-
ethtool_link_ksettings_add_link_mode(ks, supported,
1806-
Autoneg);
1807-
ethtool_link_ksettings_add_link_mode(ks, advertising,
1808-
Autoneg);
1809-
}
1810-
if (phy_types_low & ICE_PHY_TYPE_LOW_100GBASE_CR4 ||
1811-
phy_types_low & ICE_PHY_TYPE_LOW_100GBASE_KR4 ||
1812-
phy_types_low & ICE_PHY_TYPE_LOW_100GBASE_KR_PAM4 ||
1813-
phy_types_low & ICE_PHY_TYPE_LOW_100GBASE_CP2) {
1814-
ethtool_link_ksettings_add_link_mode(ks, supported,
1815-
Autoneg);
1816-
ethtool_link_ksettings_add_link_mode(ks, advertising,
1817-
Autoneg);
1818-
}
18191776
}
18201777

18211778
#define TEST_SET_BITS_TIMEOUT 50
@@ -1972,9 +1929,7 @@ ice_get_link_ksettings(struct net_device *netdev,
19721929
ks->base.port = PORT_TP;
19731930
break;
19741931
case ICE_MEDIA_BACKPLANE:
1975-
ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg);
19761932
ethtool_link_ksettings_add_link_mode(ks, supported, Backplane);
1977-
ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg);
19781933
ethtool_link_ksettings_add_link_mode(ks, advertising,
19791934
Backplane);
19801935
ks->base.port = PORT_NONE;
@@ -2049,6 +2004,12 @@ ice_get_link_ksettings(struct net_device *netdev,
20492004
if (caps->link_fec_options & ICE_AQC_PHY_FEC_25G_RS_CLAUSE91_EN)
20502005
ethtool_link_ksettings_add_link_mode(ks, supported, FEC_RS);
20512006

2007+
/* Set supported and advertised autoneg */
2008+
if (ice_is_phy_caps_an_enabled(caps)) {
2009+
ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg);
2010+
ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg);
2011+
}
2012+
20522013
done:
20532014
kfree(caps);
20542015
return err;

drivers/net/ethernet/intel/ice/ice_hw_autogen.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#define PF_FW_ATQLEN_ATQOVFL_M BIT(29)
3232
#define PF_FW_ATQLEN_ATQCRIT_M BIT(30)
3333
#define VF_MBX_ARQLEN(_VF) (0x0022BC00 + ((_VF) * 4))
34+
#define VF_MBX_ATQLEN(_VF) (0x0022A800 + ((_VF) * 4))
3435
#define PF_FW_ATQLEN_ATQENABLE_M BIT(31)
3536
#define PF_FW_ATQT 0x00080400
3637
#define PF_MBX_ARQBAH 0x0022E400

drivers/net/ethernet/intel/ice/ice_lib.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ static void ice_vsi_set_num_qs(struct ice_vsi *vsi, u16 vf_id)
200200
break;
201201
case ICE_VSI_VF:
202202
vf = &pf->vf[vsi->vf_id];
203+
if (vf->num_req_qs)
204+
vf->num_vf_qs = vf->num_req_qs;
203205
vsi->alloc_txq = vf->num_vf_qs;
204206
vsi->alloc_rxq = vf->num_vf_qs;
205207
/* pf->num_msix_per_vf includes (VF miscellaneous vector +

drivers/net/ethernet/intel/ice/ice_txrx.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2149,6 +2149,7 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_ring *tx_ring)
21492149
struct ice_tx_offload_params offload = { 0 };
21502150
struct ice_vsi *vsi = tx_ring->vsi;
21512151
struct ice_tx_buf *first;
2152+
struct ethhdr *eth;
21522153
unsigned int count;
21532154
int tso, csum;
21542155

@@ -2195,7 +2196,9 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_ring *tx_ring)
21952196
goto out_drop;
21962197

21972198
/* allow CONTROL frames egress from main VSI if FW LLDP disabled */
2198-
if (unlikely(skb->priority == TC_PRIO_CONTROL &&
2199+
eth = (struct ethhdr *)skb_mac_header(skb);
2200+
if (unlikely((skb->priority == TC_PRIO_CONTROL ||
2201+
eth->h_proto == htons(ETH_P_LLDP)) &&
21992202
vsi->type == ICE_VSI_PF &&
22002203
vsi->port_info->qos_cfg.is_sw_lldp))
22012204
offload.cd_qw1 |= (u64)(ICE_TX_DESC_DTYPE_CTX |

drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -713,13 +713,15 @@ static void ice_trigger_vf_reset(struct ice_vf *vf, bool is_vflr, bool is_pfr)
713713
*/
714714
clear_bit(ICE_VF_STATE_INIT, vf->vf_states);
715715

716-
/* VF_MBX_ARQLEN is cleared by PFR, so the driver needs to clear it
717-
* in the case of VFR. If this is done for PFR, it can mess up VF
718-
* resets because the VF driver may already have started cleanup
719-
* by the time we get here.
716+
/* VF_MBX_ARQLEN and VF_MBX_ATQLEN are cleared by PFR, so the driver
717+
* needs to clear them in the case of VFR/VFLR. If this is done for
718+
* PFR, it can mess up VF resets because the VF driver may already
719+
* have started cleanup by the time we get here.
720720
*/
721-
if (!is_pfr)
721+
if (!is_pfr) {
722722
wr32(hw, VF_MBX_ARQLEN(vf->vf_id), 0);
723+
wr32(hw, VF_MBX_ATQLEN(vf->vf_id), 0);
724+
}
723725

724726
/* In the case of a VFLR, the HW has already reset the VF and we
725727
* just need to clean up, so don't hit the VFRTRIG register.
@@ -1698,7 +1700,12 @@ bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)
16981700
ice_vf_ctrl_vsi_release(vf);
16991701

17001702
ice_vf_pre_vsi_rebuild(vf);
1701-
ice_vf_rebuild_vsi_with_release(vf);
1703+
1704+
if (ice_vf_rebuild_vsi_with_release(vf)) {
1705+
dev_err(dev, "Failed to release and setup the VF%u's VSI\n", vf->vf_id);
1706+
return false;
1707+
}
1708+
17021709
ice_vf_post_vsi_rebuild(vf);
17031710

17041711
/* if the VF has been reset allow it to come up again */

include/linux/avf/virtchnl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ VIRTCHNL_CHECK_STRUCT_LEN(72, virtchnl_proto_hdr);
830830

831831
struct virtchnl_proto_hdrs {
832832
u8 tunnel_level;
833+
u8 pad[3];
833834
/**
834835
* specify where protocol header start from.
835836
* 0 - from the outer layer

0 commit comments

Comments
 (0)