Skip to content

Commit 6ee2425

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-03-10 This series contains updates to ice and iavf drivers. Cleaned up unnecessary parenthesis, which was pointed out by Sergei Shtylyov. Mitch updates the iavf and ice drivers to expand the limitation on the number of queues that the driver can support to account for the newer 800-series capabilities. Brett cleans up the error messages for both SR-IOV and non SR-IOV use cases. Fixed the logic when the ice driver is removed and a bare-metal VF is passing traffic, which was causing a transmit hang on the VF. Updated the ice driver to display "Link detected" field via ethtool, when the driver is in safe mode. Updated ice driver to properly set VLAN pruning when transmit anti-spoof is off. Avinash fixed a corner case in DCB, when switching from IEEE to CEE mode, the DCBX mode does not get properly updated. Dave updates the logic when switching from software DCB to firmware DCB to renegotiate DCBX to ensure the firmware agent has up to date information about the DCB settings of the link partner. Lukasz increases the PF's mailbox receive queue size to the maximum to prevent potential bottleneck or slow down occurring from the PF's mailbox receive queue being full. Bruce updates the ice driver to use strscpy() instead of strlcpy(). Cleaned up variable names that were not very descriptive with names that had more meaning. Anirudh replaces the use of ENOTSUPP with EOPNOTSUPP in the ice driver. Jake fixed up a function header comment to properly reflect the variable size and use. v2: Dropped patch 5 of the original series, where Tony added tunnel offload support. Based on community feedback, the patch needed changes, so giving Tony additional time to work on those changes and not hold up the remaining changes in the series. ==================== Acked-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2 parents 13e787c + dab02de commit 6ee2425

File tree

16 files changed

+396
-398
lines changed

16 files changed

+396
-398
lines changed

drivers/net/ethernet/intel/iavf/iavf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct iavf_vsi {
8181
#define IAVF_TX_DESC(R, i) (&(((struct iavf_tx_desc *)((R)->desc))[i]))
8282
#define IAVF_TX_CTXTDESC(R, i) \
8383
(&(((struct iavf_tx_context_desc *)((R)->desc))[i]))
84-
#define IAVF_MAX_REQ_QUEUES 4
84+
#define IAVF_MAX_REQ_QUEUES 16
8585

8686
#define IAVF_HKEY_ARRAY_SIZE ((IAVF_VFQF_HKEY_MAX_INDEX + 1) * 4)
8787
#define IAVF_HLUT_ARRAY_SIZE ((IAVF_VFQF_HLUT_MAX_INDEX + 1) * 4)

drivers/net/ethernet/intel/iavf/iavf_ethtool.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ static void iavf_get_channels(struct net_device *netdev,
860860
struct iavf_adapter *adapter = netdev_priv(netdev);
861861

862862
/* Report maximum channels */
863-
ch->max_combined = IAVF_MAX_REQ_QUEUES;
863+
ch->max_combined = adapter->vsi_res->num_queue_pairs;
864864

865865
ch->max_other = NONQ_VECS;
866866
ch->other_count = NONQ_VECS;
@@ -881,14 +881,7 @@ static int iavf_set_channels(struct net_device *netdev,
881881
struct ethtool_channels *ch)
882882
{
883883
struct iavf_adapter *adapter = netdev_priv(netdev);
884-
int num_req = ch->combined_count;
885-
886-
if (num_req != adapter->num_active_queues &&
887-
!(adapter->vf_res->vf_cap_flags &
888-
VIRTCHNL_VF_OFFLOAD_REQ_QUEUES)) {
889-
dev_info(&adapter->pdev->dev, "PF is not capable of queue negotiation.\n");
890-
return -EINVAL;
891-
}
884+
u32 num_req = ch->combined_count;
892885

893886
if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&
894887
adapter->num_tc) {
@@ -899,14 +892,19 @@ static int iavf_set_channels(struct net_device *netdev,
899892
/* All of these should have already been checked by ethtool before this
900893
* even gets to us, but just to be sure.
901894
*/
902-
if (num_req <= 0 || num_req > IAVF_MAX_REQ_QUEUES)
895+
if (num_req > adapter->vsi_res->num_queue_pairs)
903896
return -EINVAL;
904897

898+
if (num_req == adapter->num_active_queues)
899+
return 0;
900+
905901
if (ch->rx_count || ch->tx_count || ch->other_count != NONQ_VECS)
906902
return -EINVAL;
907903

908904
adapter->num_req_queues = num_req;
909-
return iavf_request_queues(adapter, num_req);
905+
adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
906+
iavf_schedule_reset(adapter);
907+
return 0;
910908
}
911909

912910
/**

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3450,7 +3450,7 @@ int iavf_process_config(struct iavf_adapter *adapter)
34503450
}
34513451

34523452
if (num_req_queues &&
3453-
num_req_queues != adapter->vsi_res->num_queue_pairs) {
3453+
num_req_queues > adapter->vsi_res->num_queue_pairs) {
34543454
/* Problem. The PF gave us fewer queues than what we had
34553455
* negotiated in our request. Need a reset to see if we can't
34563456
* get back to a working state.

drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -396,33 +396,6 @@ void iavf_map_queues(struct iavf_adapter *adapter)
396396
kfree(vimi);
397397
}
398398

399-
/**
400-
* iavf_request_queues
401-
* @adapter: adapter structure
402-
* @num: number of requested queues
403-
*
404-
* We get a default number of queues from the PF. This enables us to request a
405-
* different number. Returns 0 on success, negative on failure
406-
**/
407-
int iavf_request_queues(struct iavf_adapter *adapter, int num)
408-
{
409-
struct virtchnl_vf_res_request vfres;
410-
411-
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) {
412-
/* bail because we already have a command pending */
413-
dev_err(&adapter->pdev->dev, "Cannot request queues, command %d pending\n",
414-
adapter->current_op);
415-
return -EBUSY;
416-
}
417-
418-
vfres.num_queue_pairs = min_t(int, num, num_online_cpus());
419-
420-
adapter->current_op = VIRTCHNL_OP_REQUEST_QUEUES;
421-
adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
422-
return iavf_send_pf_msg(adapter, VIRTCHNL_OP_REQUEST_QUEUES,
423-
(u8 *)&vfres, sizeof(vfres));
424-
}
425-
426399
/**
427400
* iavf_add_ether_addrs
428401
* @adapter: adapter structure

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ extern const char ice_drv_ver[];
6060
#define ICE_INT_NAME_STR_LEN (IFNAMSIZ + 16)
6161
#define ICE_AQ_LEN 64
6262
#define ICE_MBXSQ_LEN 64
63-
#define ICE_MBXRQ_LEN 512
6463
#define ICE_MIN_MSIX 2
6564
#define ICE_NO_VSI 0xffff
6665
#define ICE_VSI_MAP_CONTIG 0
@@ -70,7 +69,6 @@ extern const char ice_drv_ver[];
7069
#define ICE_Q_WAIT_RETRY_LIMIT 10
7170
#define ICE_Q_WAIT_MAX_RETRY (5 * ICE_Q_WAIT_RETRY_LIMIT)
7271
#define ICE_MAX_LG_RSS_QS 256
73-
#define ICE_MAX_SMALL_RSS_QS 8
7472
#define ICE_RES_VALID_BIT 0x8000
7573
#define ICE_RES_MISC_VEC_ID (ICE_RES_VALID_BIT - 1)
7674
#define ICE_INVAL_Q_INDEX 0xffff
@@ -213,6 +211,7 @@ enum ice_state {
213211
__ICE_SERVICE_DIS,
214212
__ICE_OICR_INTR_DIS, /* Global OICR interrupt disabled */
215213
__ICE_MDD_VF_PRINT_PENDING, /* set when MDD event handle */
214+
__ICE_VF_RESETS_DISABLED, /* disable resets during ice_remove */
216215
__ICE_STATE_NBITS /* must be last */
217216
};
218217

@@ -363,8 +362,8 @@ struct ice_pf {
363362
struct ice_vf *vf;
364363
int num_alloc_vfs; /* actual number of VFs allocated */
365364
u16 num_vfs_supported; /* num VFs supported for this PF */
366-
u16 num_vf_qps; /* num queue pairs per VF */
367-
u16 num_vf_msix; /* num vectors per VF */
365+
u16 num_qps_per_vf;
366+
u16 num_msix_per_vf;
368367
/* used to ratelimit the MDD event logging */
369368
unsigned long last_printed_mdd_jiffies;
370369
DECLARE_BITMAP(state, __ICE_STATE_NBITS);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,8 @@ static void ice_get_itr_intrl_gran(struct ice_hw *hw)
620620
* @oem_ver: 8 bit NVM version
621621
* @oem_build: 16 bit NVM build number
622622
* @oem_patch: 8 NVM patch number
623-
* @ver_hi: high 16 bits of the NVM version
624-
* @ver_lo: low 16 bits of the NVM version
623+
* @ver_hi: high 8 bits of the NVM version
624+
* @ver_lo: low 8 bits of the NVM version
625625
*/
626626
void
627627
ice_get_nvm_version(struct ice_hw *hw, u8 *oem_ver, u16 *oem_build,

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ static u8 ice_dcb_get_mode(struct ice_port_info *port_info, bool host)
7777
mode = DCB_CAP_DCBX_LLD_MANAGED;
7878

7979
if (port_info->local_dcbx_cfg.dcbx_mode & ICE_DCBX_MODE_CEE)
80-
return (mode | DCB_CAP_DCBX_VER_CEE);
80+
return mode | DCB_CAP_DCBX_VER_CEE;
8181
else
82-
return (mode | DCB_CAP_DCBX_VER_IEEE);
82+
return mode | DCB_CAP_DCBX_VER_IEEE;
8383
}
8484

8585
/**
@@ -779,7 +779,7 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,
779779
bool need_reconfig = false;
780780
struct ice_port_info *pi;
781781
struct ice_vsi *pf_vsi;
782-
u8 type;
782+
u8 mib_type;
783783
int ret;
784784

785785
/* Not DCB capable or capability disabled */
@@ -794,16 +794,16 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,
794794
pi = pf->hw.port_info;
795795
mib = (struct ice_aqc_lldp_get_mib *)&event->desc.params.raw;
796796
/* Ignore if event is not for Nearest Bridge */
797-
type = ((mib->type >> ICE_AQ_LLDP_BRID_TYPE_S) &
798-
ICE_AQ_LLDP_BRID_TYPE_M);
799-
dev_dbg(dev, "LLDP event MIB bridge type 0x%x\n", type);
800-
if (type != ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID)
797+
mib_type = ((mib->type >> ICE_AQ_LLDP_BRID_TYPE_S) &
798+
ICE_AQ_LLDP_BRID_TYPE_M);
799+
dev_dbg(dev, "LLDP event MIB bridge type 0x%x\n", mib_type);
800+
if (mib_type != ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID)
801801
return;
802802

803803
/* Check MIB Type and return if event for Remote MIB update */
804-
type = mib->type & ICE_AQ_LLDP_MIB_TYPE_M;
805-
dev_dbg(dev, "LLDP event mib type %s\n", type ? "remote" : "local");
806-
if (type == ICE_AQ_LLDP_MIB_REMOTE) {
804+
mib_type = mib->type & ICE_AQ_LLDP_MIB_TYPE_M;
805+
dev_dbg(dev, "LLDP event mib type %s\n", mib_type ? "remote" : "local");
806+
if (mib_type == ICE_AQ_LLDP_MIB_REMOTE) {
807807
/* Update the remote cached instance and return */
808808
ret = ice_aq_get_dcb_cfg(pi->hw, ICE_AQ_LLDP_MIB_REMOTE,
809809
ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID,
@@ -832,10 +832,11 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,
832832
/* No change detected in DCBX configs */
833833
if (!memcmp(&tmp_dcbx_cfg, &pi->local_dcbx_cfg, sizeof(tmp_dcbx_cfg))) {
834834
dev_dbg(dev, "No change detected in DCBX configuration.\n");
835-
pf->dcbx_cap = ice_dcb_get_mode(pi, false);
836835
goto out;
837836
}
838837

838+
pf->dcbx_cap = ice_dcb_get_mode(pi, false);
839+
839840
need_reconfig = ice_dcb_need_recfg(pf, &tmp_dcbx_cfg,
840841
&pi->local_dcbx_cfg);
841842
ice_dcbnl_flush_apps(pf, &tmp_dcbx_cfg, &pi->local_dcbx_cfg);

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

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ ice_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
173173
struct ice_hw *hw = &pf->hw;
174174
u16 oem_build;
175175

176-
strlcpy(drvinfo->driver, KBUILD_MODNAME, sizeof(drvinfo->driver));
177-
strlcpy(drvinfo->version, ice_drv_ver, sizeof(drvinfo->version));
176+
strscpy(drvinfo->driver, KBUILD_MODNAME, sizeof(drvinfo->driver));
177+
strscpy(drvinfo->version, ice_drv_ver, sizeof(drvinfo->version));
178178

179179
/* Display NVM version (from which the firmware version can be
180180
* determined) which contains more pertinent information.
@@ -185,7 +185,7 @@ ice_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
185185
"%x.%02x 0x%x %d.%d.%d", nvm_ver_hi, nvm_ver_lo,
186186
hw->nvm.eetrack, oem_ver, oem_build, oem_patch);
187187

188-
strlcpy(drvinfo->bus_info, pci_name(pf->pdev),
188+
strscpy(drvinfo->bus_info, pci_name(pf->pdev),
189189
sizeof(drvinfo->bus_info));
190190
drvinfo->n_priv_flags = ICE_PRIV_FLAG_ARRAY_SIZE;
191191
}
@@ -1131,6 +1131,33 @@ ice_get_fecparam(struct net_device *netdev, struct ethtool_fecparam *fecparam)
11311131
return err;
11321132
}
11331133

1134+
/**
1135+
* ice_nway_reset - restart autonegotiation
1136+
* @netdev: network interface device structure
1137+
*/
1138+
static int ice_nway_reset(struct net_device *netdev)
1139+
{
1140+
struct ice_netdev_priv *np = netdev_priv(netdev);
1141+
struct ice_vsi *vsi = np->vsi;
1142+
struct ice_port_info *pi;
1143+
enum ice_status status;
1144+
1145+
pi = vsi->port_info;
1146+
/* If VSI state is up, then restart autoneg with link up */
1147+
if (!test_bit(__ICE_DOWN, vsi->back->state))
1148+
status = ice_aq_set_link_restart_an(pi, true, NULL);
1149+
else
1150+
status = ice_aq_set_link_restart_an(pi, false, NULL);
1151+
1152+
if (status) {
1153+
netdev_info(netdev, "link restart failed, err %d aq_err %d\n",
1154+
status, pi->hw->adminq.sq_last_status);
1155+
return -EIO;
1156+
}
1157+
1158+
return 0;
1159+
}
1160+
11341161
/**
11351162
* ice_get_priv_flags - report device private flags
11361163
* @netdev: network interface device structure
@@ -1264,6 +1291,8 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)
12641291
status = ice_cfg_lldp_mib_change(&pf->hw, true);
12651292
if (status)
12661293
dev_dbg(dev, "Fail to enable MIB change events\n");
1294+
1295+
ice_nway_reset(netdev);
12671296
}
12681297
}
12691298
if (test_bit(ICE_FLAG_LEGACY_RX, change_flags)) {
@@ -2775,30 +2804,6 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
27752804
return err;
27762805
}
27772806

2778-
static int ice_nway_reset(struct net_device *netdev)
2779-
{
2780-
/* restart autonegotiation */
2781-
struct ice_netdev_priv *np = netdev_priv(netdev);
2782-
struct ice_vsi *vsi = np->vsi;
2783-
struct ice_port_info *pi;
2784-
enum ice_status status;
2785-
2786-
pi = vsi->port_info;
2787-
/* If VSI state is up, then restart autoneg with link up */
2788-
if (!test_bit(__ICE_DOWN, vsi->back->state))
2789-
status = ice_aq_set_link_restart_an(pi, true, NULL);
2790-
else
2791-
status = ice_aq_set_link_restart_an(pi, false, NULL);
2792-
2793-
if (status) {
2794-
netdev_info(netdev, "link restart failed, err %d aq_err %d\n",
2795-
status, pi->hw->adminq.sq_last_status);
2796-
return -EIO;
2797-
}
2798-
2799-
return 0;
2800-
}
2801-
28022807
/**
28032808
* ice_get_pauseparam - Get Flow Control status
28042809
* @netdev: network interface device structure
@@ -3813,6 +3818,7 @@ static const struct ethtool_ops ice_ethtool_safe_mode_ops = {
38133818
.get_regs = ice_get_regs,
38143819
.get_msglevel = ice_get_msglevel,
38153820
.set_msglevel = ice_set_msglevel,
3821+
.get_link = ethtool_op_get_link,
38163822
.get_eeprom_len = ice_get_eeprom_len,
38173823
.get_eeprom = ice_get_eeprom,
38183824
.get_strings = ice_get_strings,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ ice_flow_rem_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id)
694694
* ice_flow_set_fld_ext - specifies locations of field from entry's input buffer
695695
* @seg: packet segment the field being set belongs to
696696
* @fld: field to be set
697-
* @type: type of the field
697+
* @field_type: type of the field
698698
* @val_loc: if not ICE_FLOW_FLD_OFF_INVAL, location of the value to match from
699699
* entry's input buffer
700700
* @mask_loc: if not ICE_FLOW_FLD_OFF_INVAL, location of mask value from entry's
@@ -715,16 +715,16 @@ ice_flow_rem_prof(struct ice_hw *hw, enum ice_block blk, u64 prof_id)
715715
*/
716716
static void
717717
ice_flow_set_fld_ext(struct ice_flow_seg_info *seg, enum ice_flow_field fld,
718-
enum ice_flow_fld_match_type type, u16 val_loc,
718+
enum ice_flow_fld_match_type field_type, u16 val_loc,
719719
u16 mask_loc, u16 last_loc)
720720
{
721721
u64 bit = BIT_ULL(fld);
722722

723723
seg->match |= bit;
724-
if (type == ICE_FLOW_FLD_TYPE_RANGE)
724+
if (field_type == ICE_FLOW_FLD_TYPE_RANGE)
725725
seg->range |= bit;
726726

727-
seg->fields[fld].type = type;
727+
seg->fields[fld].type = field_type;
728728
seg->fields[fld].src.val = val_loc;
729729
seg->fields[fld].src.mask = mask_loc;
730730
seg->fields[fld].src.last = last_loc;

0 commit comments

Comments
 (0)