Skip to content

Commit 2a2e01e

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 100GbE Intel Wired LAN Driver Updates 2020-05-31 This series contains updates to the ice driver only. Brett modifies the driver to allow users to clear a VF's administratively set MAC address on the PF. Fixes the driver to recognize an existing VLAN tag when DMAC/SMAC is enabled in a packet. Fixes an issue, so that VF's are reset after any VF port VLAN modifications are made on the PF. Made sure the register QRXFLXP_CNTXT is cleared before writing a new value to ensure the previous value is not passed forward. Updates the PF to allow the VF to request a reset as soon as it has been initialized. Fixes an issue to ensure when a VSI is created, it uses the current coalesce value, not the default value. Paul allows untrusted VF's to add 16 filters. Dan increases the timeout needed after a PFR to allow ample time for package download. Chinh adjust the define value for the number of PHY speeds we currently support. Changes the driver to ignore EMODE error when configuring the PHY. Jesse fixes an issue which was preventing a user from configuring the interface before bringing it up. Henry fixes the logic for adding back perfect flows after flow director filter does a deletion. Bruce fixes line wrappings to make it more consistent. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 03eaeda + b5e19a6 commit 2a2e01e

16 files changed

+142
-156
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ struct ice_aqc_get_phy_caps {
974974
#define ICE_PHY_TYPE_HIGH_100G_CAUI2 BIT_ULL(2)
975975
#define ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC BIT_ULL(3)
976976
#define ICE_PHY_TYPE_HIGH_100G_AUI2 BIT_ULL(4)
977-
#define ICE_PHY_TYPE_HIGH_MAX_INDEX 19
977+
#define ICE_PHY_TYPE_HIGH_MAX_INDEX 5
978978

979979
struct ice_aqc_get_phy_caps_data {
980980
__le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */
@@ -1826,6 +1826,7 @@ enum ice_aq_err {
18261826
ICE_AQ_RC_EINVAL = 14, /* Invalid argument */
18271827
ICE_AQ_RC_ENOSPC = 16, /* No space left or allocation failure */
18281828
ICE_AQ_RC_ENOSYS = 17, /* Function not implemented */
1829+
ICE_AQ_RC_EMODE = 21, /* Op not allowed in current dev mode */
18291830
ICE_AQ_RC_ENOSEC = 24, /* Missing security manifest */
18301831
ICE_AQ_RC_EBADSIG = 25, /* Bad RSA signature */
18311832
ICE_AQ_RC_ESVN = 26, /* SVN number prohibits this package */

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

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <net/xdp_sock_drv.h>
55
#include "ice_base.h"
6+
#include "ice_lib.h"
67
#include "ice_dcb_lib.h"
78

89
/**
@@ -288,7 +289,6 @@ int ice_setup_rx_ctx(struct ice_ring *ring)
288289
u32 rxdid = ICE_RXDID_FLEX_NIC;
289290
struct ice_rlan_ctx rlan_ctx;
290291
struct ice_hw *hw;
291-
u32 regval;
292292
u16 pf_q;
293293
int err;
294294

@@ -385,27 +385,16 @@ int ice_setup_rx_ctx(struct ice_ring *ring)
385385
/* Rx queue threshold in units of 64 */
386386
rlan_ctx.lrxqthresh = 1;
387387

388-
/* Enable Flexible Descriptors in the queue context which
389-
* allows this driver to select a specific receive descriptor format
390-
*/
391-
regval = rd32(hw, QRXFLXP_CNTXT(pf_q));
392-
if (vsi->type != ICE_VSI_VF) {
393-
regval |= (rxdid << QRXFLXP_CNTXT_RXDID_IDX_S) &
394-
QRXFLXP_CNTXT_RXDID_IDX_M;
395-
396-
/* increasing context priority to pick up profile ID;
397-
* default is 0x01; setting to 0x03 to ensure profile
398-
* is programming if prev context is of same priority
399-
*/
400-
regval |= (0x03 << QRXFLXP_CNTXT_RXDID_PRIO_S) &
401-
QRXFLXP_CNTXT_RXDID_PRIO_M;
402-
403-
} else {
404-
regval &= ~(QRXFLXP_CNTXT_RXDID_IDX_M |
405-
QRXFLXP_CNTXT_RXDID_PRIO_M |
406-
QRXFLXP_CNTXT_TS_M);
407-
}
408-
wr32(hw, QRXFLXP_CNTXT(pf_q), regval);
388+
/* Enable Flexible Descriptors in the queue context which
389+
* allows this driver to select a specific receive descriptor format
390+
* increasing context priority to pick up profile ID; default is 0x01;
391+
* setting to 0x03 to ensure profile is programming if prev context is
392+
* of same priority
393+
*/
394+
if (vsi->type != ICE_VSI_VF)
395+
ice_write_qrxflxp_cntxt(hw, pf_q, rxdid, 0x3);
396+
else
397+
ice_write_qrxflxp_cntxt(hw, pf_q, ICE_RXDID_LEGACY_1, 0x3);
409398

410399
/* Absolute queue number out of 2K needs to be passed */
411400
err = ice_write_rxq_ctx(hw, &rlan_ctx, pf_q);

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,12 @@ static enum ice_status ice_pf_reset(struct ice_hw *hw)
964964

965965
wr32(hw, PFGEN_CTRL, (reg | PFGEN_CTRL_PFSWR_M));
966966

967-
for (cnt = 0; cnt < ICE_PF_RESET_WAIT_COUNT; cnt++) {
967+
/* Wait for the PFR to complete. The wait time is the global config lock
968+
* timeout plus the PFR timeout which will account for a possible reset
969+
* that is occurring during a download package operation.
970+
*/
971+
for (cnt = 0; cnt < ICE_GLOBAL_CFG_LOCK_TIMEOUT +
972+
ICE_PF_RESET_WAIT_COUNT; cnt++) {
968973
reg = rd32(hw, PFGEN_CTRL);
969974
if (!(reg & PFGEN_CTRL_PFSWR_M))
970975
break;
@@ -2227,6 +2232,7 @@ ice_aq_set_phy_cfg(struct ice_hw *hw, u8 lport,
22272232
struct ice_aqc_set_phy_cfg_data *cfg, struct ice_sq_cd *cd)
22282233
{
22292234
struct ice_aq_desc desc;
2235+
enum ice_status status;
22302236

22312237
if (!cfg)
22322238
return ICE_ERR_PARAM;
@@ -2255,7 +2261,11 @@ ice_aq_set_phy_cfg(struct ice_hw *hw, u8 lport,
22552261
ice_debug(hw, ICE_DBG_LINK, "eeer_value = 0x%x\n", cfg->eeer_value);
22562262
ice_debug(hw, ICE_DBG_LINK, "link_fec_opt = 0x%x\n", cfg->link_fec_opt);
22572263

2258-
return ice_aq_send_cmd(hw, &desc, cfg, sizeof(*cfg), cd);
2264+
status = ice_aq_send_cmd(hw, &desc, cfg, sizeof(*cfg), cd);
2265+
if (hw->adminq.sq_last_status == ICE_AQ_RC_EMODE)
2266+
status = 0;
2267+
2268+
return status;
22592269
}
22602270

22612271
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,7 @@ enum ice_status ice_create_all_ctrlq(struct ice_hw *hw)
769769
*
770770
* Destroys the send and receive queue locks for a given control queue.
771771
*/
772-
static void
773-
ice_destroy_ctrlq_locks(struct ice_ctl_q_info *cq)
772+
static void ice_destroy_ctrlq_locks(struct ice_ctl_q_info *cq)
774773
{
775774
mutex_destroy(&cq->sq_lock);
776775
mutex_destroy(&cq->rq_lock);

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

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -791,39 +791,31 @@ void ice_update_dcb_stats(struct ice_pf *pf)
791791
* ice_tx_prepare_vlan_flags_dcb - prepare VLAN tagging for DCB
792792
* @tx_ring: ring to send buffer on
793793
* @first: pointer to struct ice_tx_buf
794+
*
795+
* This should not be called if the outer VLAN is software offloaded as the VLAN
796+
* tag will already be configured with the correct ID and priority bits
794797
*/
795-
int
798+
void
796799
ice_tx_prepare_vlan_flags_dcb(struct ice_ring *tx_ring,
797800
struct ice_tx_buf *first)
798801
{
799802
struct sk_buff *skb = first->skb;
800803

801804
if (!test_bit(ICE_FLAG_DCB_ENA, tx_ring->vsi->back->flags))
802-
return 0;
805+
return;
803806

804807
/* Insert 802.1p priority into VLAN header */
805-
if ((first->tx_flags & (ICE_TX_FLAGS_HW_VLAN | ICE_TX_FLAGS_SW_VLAN)) ||
808+
if ((first->tx_flags & ICE_TX_FLAGS_HW_VLAN) ||
806809
skb->priority != TC_PRIO_CONTROL) {
807810
first->tx_flags &= ~ICE_TX_FLAGS_VLAN_PR_M;
808811
/* Mask the lower 3 bits to set the 802.1p priority */
809812
first->tx_flags |= (skb->priority & 0x7) <<
810813
ICE_TX_FLAGS_VLAN_PR_S;
811-
if (first->tx_flags & ICE_TX_FLAGS_SW_VLAN) {
812-
struct vlan_ethhdr *vhdr;
813-
int rc;
814-
815-
rc = skb_cow_head(skb, 0);
816-
if (rc < 0)
817-
return rc;
818-
vhdr = (struct vlan_ethhdr *)skb->data;
819-
vhdr->h_vlan_TCI = htons(first->tx_flags >>
820-
ICE_TX_FLAGS_VLAN_S);
821-
} else {
822-
first->tx_flags |= ICE_TX_FLAGS_HW_VLAN;
823-
}
814+
/* if this is not already set it means a VLAN 0 + priority needs
815+
* to be offloaded
816+
*/
817+
first->tx_flags |= ICE_TX_FLAGS_HW_VLAN;
824818
}
825-
826-
return 0;
827819
}
828820

829821
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void ice_pf_dcb_recfg(struct ice_pf *pf);
2727
void ice_vsi_cfg_dcb_rings(struct ice_vsi *vsi);
2828
int ice_init_pf_dcb(struct ice_pf *pf, bool locked);
2929
void ice_update_dcb_stats(struct ice_pf *pf);
30-
int
30+
void
3131
ice_tx_prepare_vlan_flags_dcb(struct ice_ring *tx_ring,
3232
struct ice_tx_buf *first);
3333
void

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3189,10 +3189,6 @@ ice_get_channels(struct net_device *dev, struct ethtool_channels *ch)
31893189
struct ice_vsi *vsi = np->vsi;
31903190
struct ice_pf *pf = vsi->back;
31913191

3192-
/* check to see if VSI is active */
3193-
if (test_bit(__ICE_DOWN, vsi->state))
3194-
return;
3195-
31963192
/* report maximum channels */
31973193
ch->max_rx = ice_get_max_rxq(pf);
31983194
ch->max_tx = ice_get_max_txq(pf);

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,31 @@ void ice_vsi_manage_fdir(struct ice_vsi *vsi, bool ena)
13631363
mutex_unlock(&hw->fdir_fltr_lock);
13641364
}
13651365

1366+
/**
1367+
* ice_fdir_do_rem_flow - delete flow and possibly add perfect flow
1368+
* @pf: PF structure
1369+
* @flow_type: FDir flow type to release
1370+
*/
1371+
static void
1372+
ice_fdir_do_rem_flow(struct ice_pf *pf, enum ice_fltr_ptype flow_type)
1373+
{
1374+
struct ice_hw *hw = &pf->hw;
1375+
bool need_perfect = false;
1376+
1377+
if (flow_type == ICE_FLTR_PTYPE_NONF_IPV4_TCP ||
1378+
flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP ||
1379+
flow_type == ICE_FLTR_PTYPE_NONF_IPV6_TCP ||
1380+
flow_type == ICE_FLTR_PTYPE_NONF_IPV6_UDP)
1381+
need_perfect = true;
1382+
1383+
if (need_perfect && test_bit(flow_type, hw->fdir_perfect_fltr))
1384+
return;
1385+
1386+
ice_fdir_rem_flow(hw, ICE_BLK_FD, flow_type);
1387+
if (need_perfect)
1388+
ice_create_init_fdir_rule(pf, flow_type);
1389+
}
1390+
13661391
/**
13671392
* ice_fdir_update_list_entry - add or delete a filter from the filter list
13681393
* @pf: PF structure
@@ -1393,7 +1418,7 @@ ice_fdir_update_list_entry(struct ice_pf *pf, struct ice_fdir_fltr *input,
13931418
/* we just deleted the last filter of flow_type so we
13941419
* should also delete the HW filter info.
13951420
*/
1396-
ice_fdir_rem_flow(hw, ICE_BLK_FD, old_fltr->flow_type);
1421+
ice_fdir_do_rem_flow(pf, old_fltr->flow_type);
13971422
list_del(&old_fltr->fltr_node);
13981423
devm_kfree(ice_hw_to_dev(hw), old_fltr);
13991424
}

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

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,32 @@ void ice_vsi_cfg_frame_size(struct ice_vsi *vsi)
15951595
}
15961596
}
15971597

1598+
/**
1599+
* ice_write_qrxflxp_cntxt - write/configure QRXFLXP_CNTXT register
1600+
* @hw: HW pointer
1601+
* @pf_q: index of the Rx queue in the PF's queue space
1602+
* @rxdid: flexible descriptor RXDID
1603+
* @prio: priority for the RXDID for this queue
1604+
*/
1605+
void
1606+
ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio)
1607+
{
1608+
int regval = rd32(hw, QRXFLXP_CNTXT(pf_q));
1609+
1610+
/* clear any previous values */
1611+
regval &= ~(QRXFLXP_CNTXT_RXDID_IDX_M |
1612+
QRXFLXP_CNTXT_RXDID_PRIO_M |
1613+
QRXFLXP_CNTXT_TS_M);
1614+
1615+
regval |= (rxdid << QRXFLXP_CNTXT_RXDID_IDX_S) &
1616+
QRXFLXP_CNTXT_RXDID_IDX_M;
1617+
1618+
regval |= (prio << QRXFLXP_CNTXT_RXDID_PRIO_S) &
1619+
QRXFLXP_CNTXT_RXDID_PRIO_M;
1620+
1621+
wr32(hw, QRXFLXP_CNTXT(pf_q), regval);
1622+
}
1623+
15981624
/**
15991625
* ice_vsi_cfg_rxqs - Configure the VSI for Rx
16001626
* @vsi: the VSI being configured
@@ -2681,15 +2707,13 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi,
26812707
ice_vsi_rebuild_update_coalesce(vsi->q_vectors[i],
26822708
&coalesce[i]);
26832709

2684-
for (; i < vsi->num_q_vectors; i++) {
2685-
struct ice_coalesce_stored coalesce_dflt = {
2686-
.itr_tx = ICE_DFLT_TX_ITR,
2687-
.itr_rx = ICE_DFLT_RX_ITR,
2688-
.intrl = 0
2689-
};
2710+
/* number of q_vectors increased, so assume coalesce settings were
2711+
* changed globally (i.e. ethtool -C eth0 instead of per-queue) and use
2712+
* the previous settings from q_vector 0 for all of the new q_vectors
2713+
*/
2714+
for (; i < vsi->num_q_vectors; i++)
26902715
ice_vsi_rebuild_update_coalesce(vsi->q_vectors[i],
2691-
&coalesce_dflt);
2692-
}
2716+
&coalesce[0]);
26932717
}
26942718

26952719
/**

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi);
7474

7575
bool ice_is_reset_in_progress(unsigned long *state);
7676

77+
void
78+
ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio);
79+
7780
void ice_vsi_put_qs(struct ice_vsi *vsi);
7881

7982
void ice_vsi_dis_irq(struct ice_vsi *vsi);

0 commit comments

Comments
 (0)