Skip to content

Commit e28383d

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2015-10-07 This series contains updates to i40e and i40evf only. Paul updates i40e to simply increase the amount of time we wait for a reset to complete since we have seen in some rare occasions the reset can take longer to complete. Shannon updates the driver to turn on Wake-on-LAN by default if it is enabled in the hardware config to begin with, rather than always disable it and wait for the user to expressly turn it on. Added new device id's and support for future devices. Fixed a possible type compare problem between a size and possible negative number. Also fixed a shift value that was wrong, which ended up with a bad bitmask. Did general house cleaning of the driver to cleanup several low lying fruit in the driver. Fixed an issue where new unicast address's would be added to the VSI list and then immediately removed and would never actually make it down to the hardware. Resolved the issue by removing the separation from unicast and multicast in the search for filters to be deleted. Mitch fixes an issue where the hardware would continue to access the memory formerly used by the rings for a VF which have been removed, causing memory corruption or DMAR errors. To relieve this condition, explicitly stop all rings associated with each VF before releasing its resources. Also fixed a panic if the driver is unable to enable MSI-X or its unable to acquire enough vectors, so propagate interrupt allocation failure information to the calling function. Cleaned up opcode that is not required. Carolyn extends the size of the test available for the interrupt names so that all the descriptive data available for the Flow Director interrupts is not truncated. Catherine fixes an issue where there was a possibility of speed getting set to 0 if advertised is set to 0 (which is the case when autoneg is disabled). Jesse fixes the checksum on big endian machines, so added code to swap it correctly. Also fixed a bug in the return from get_link_status() where only true or false was being returned, but false could mean multiple things. So allow the caller to get all the return values in the call chain bubbled back to the source so that the reason for the failure does not get lost. Anjali adds statistics to keep track of how many times we ask the stack to linearize the SKB because the hardware cannot handle SKBs with more than 8 frags per segment/single packet. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 61d0372 + 7fd0ac6 commit e28383d

26 files changed

+207
-171
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
#define I40E_MAX_USER_PRIORITY 8
9898
#define I40E_DEFAULT_MSG_ENABLE 4
9999
#define I40E_QUEUE_WAIT_RETRY_LIMIT 10
100-
#define I40E_INT_NAME_STR_LEN (IFNAMSIZ + 9)
100+
#define I40E_INT_NAME_STR_LEN (IFNAMSIZ + 16)
101101

102102
/* Ethtool Private Flags */
103103
#define I40E_PRIV_FLAGS_NPAR_FLAG BIT(0)
@@ -475,6 +475,7 @@ struct i40e_vsi {
475475
#endif
476476
u32 tx_restart;
477477
u32 tx_busy;
478+
u64 tx_linearize;
478479
u32 rx_buf_failed;
479480
u32 rx_page_failed;
480481

@@ -740,7 +741,7 @@ int i40e_fcoe_vsi_init(struct i40e_vsi *vsi, struct i40e_vsi_context *ctxt);
740741
u8 i40e_get_fcoe_tc_map(struct i40e_pf *pf);
741742
void i40e_fcoe_config_netdev(struct net_device *netdev, struct i40e_vsi *vsi);
742743
void i40e_fcoe_vsi_setup(struct i40e_pf *pf);
743-
int i40e_init_pf_fcoe(struct i40e_pf *pf);
744+
void i40e_init_pf_fcoe(struct i40e_pf *pf);
744745
int i40e_fcoe_setup_ddp_resources(struct i40e_vsi *vsi);
745746
void i40e_fcoe_free_ddp_resources(struct i40e_vsi *vsi);
746747
int i40e_fcoe_handle_offload(struct i40e_ring *rx_ring,

drivers/net/ethernet/intel/i40e/i40e_adminq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,8 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
756756
goto asq_send_command_error;
757757
}
758758

759+
hw->aq.asq_last_status = I40E_AQ_RC_OK;
760+
759761
val = rd32(hw, hw->aq.asq.head);
760762
if (val >= hw->aq.num_asq_entries) {
761763
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,

drivers/net/ethernet/intel/i40e/i40e_adminq.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ static inline int i40e_aq_rc_to_posix(int aq_ret, int aq_rc)
144144
if (aq_ret == I40E_ERR_ADMIN_QUEUE_TIMEOUT)
145145
return -EAGAIN;
146146

147-
if (aq_rc >= (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0])) ||
148-
aq_rc < 0)
147+
if (!((u32)aq_rc < (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0]))))
149148
return -ERANGE;
150149

151150
return aq_to_posix[aq_rc];

drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2062,6 +2062,7 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
20622062
#define I40E_AQC_CEE_APP_ISCSI_MASK (0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT)
20632063
#define I40E_AQC_CEE_APP_FIP_SHIFT 0x8
20642064
#define I40E_AQC_CEE_APP_FIP_MASK (0x7 << I40E_AQC_CEE_APP_FIP_SHIFT)
2065+
20652066
#define I40E_AQC_CEE_PG_STATUS_SHIFT 0x0
20662067
#define I40E_AQC_CEE_PG_STATUS_MASK (0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT)
20672068
#define I40E_AQC_CEE_PFC_STATUS_SHIFT 0x3
@@ -2070,7 +2071,7 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
20702071
#define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT)
20712072
#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8
20722073
#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT)
2073-
#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xA
2074+
#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xB
20742075
#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT)
20752076
#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10
20762077
#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT)

drivers/net/ethernet/intel/i40e/i40e_common.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw)
5151
case I40E_DEV_ID_QSFP_B:
5252
case I40E_DEV_ID_QSFP_C:
5353
case I40E_DEV_ID_10G_BASE_T:
54+
case I40E_DEV_ID_10G_BASE_T4:
5455
case I40E_DEV_ID_20G_KR2:
5556
case I40E_DEV_ID_20G_KR2_A:
5657
hw->mac.type = I40E_MAC_XL710;
@@ -1256,7 +1257,7 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
12561257
grst_del = (rd32(hw, I40E_GLGEN_RSTCTL) &
12571258
I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >>
12581259
I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT;
1259-
for (cnt = 0; cnt < grst_del + 2; cnt++) {
1260+
for (cnt = 0; cnt < grst_del + 10; cnt++) {
12601261
reg = rd32(hw, I40E_GLGEN_RSTAT);
12611262
if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK))
12621263
break;
@@ -2234,27 +2235,28 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw,
22342235
/**
22352236
* i40e_get_link_status - get status of the HW network link
22362237
* @hw: pointer to the hw struct
2238+
* @link_up: pointer to bool (true/false = linkup/linkdown)
22372239
*
2238-
* Returns true if link is up, false if link is down.
2240+
* Variable link_up true if link is up, false if link is down.
2241+
* The variable link_up is invalid if returned value of status != 0
22392242
*
22402243
* Side effect: LinkStatusEvent reporting becomes enabled
22412244
**/
2242-
bool i40e_get_link_status(struct i40e_hw *hw)
2245+
i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
22432246
{
22442247
i40e_status status = 0;
2245-
bool link_status = false;
22462248

22472249
if (hw->phy.get_link_info) {
22482250
status = i40e_aq_get_link_info(hw, true, NULL, NULL);
22492251

22502252
if (status)
2251-
goto i40e_get_link_status_exit;
2253+
i40e_debug(hw, I40E_DEBUG_LINK, "get link failed: status %d\n",
2254+
status);
22522255
}
22532256

2254-
link_status = hw->phy.link_info.link_info & I40E_AQ_LINK_UP;
2257+
*link_up = hw->phy.link_info.link_info & I40E_AQ_LINK_UP;
22552258

2256-
i40e_get_link_status_exit:
2257-
return link_status;
2259+
return status;
22582260
}
22592261

22602262
/**

drivers/net/ethernet/intel/i40e/i40e_dcb.c

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -531,37 +531,55 @@ static void i40e_cee_to_dcb_config(
531531
dcbcfg->pfc.pfcenable = cee_cfg->oper_pfc_en;
532532
dcbcfg->pfc.pfccap = I40E_MAX_TRAFFIC_CLASS;
533533

534-
status = (tlv_status & I40E_AQC_CEE_APP_STATUS_MASK) >>
535-
I40E_AQC_CEE_APP_STATUS_SHIFT;
534+
i = 0;
535+
status = (tlv_status & I40E_AQC_CEE_FCOE_STATUS_MASK) >>
536+
I40E_AQC_CEE_FCOE_STATUS_SHIFT;
536537
err = (status & I40E_TLV_STATUS_ERR) ? 1 : 0;
537538
sync = (status & I40E_TLV_STATUS_SYNC) ? 1 : 0;
538539
oper = (status & I40E_TLV_STATUS_OPER) ? 1 : 0;
539-
/* Add APPs if Error is False and Oper/Sync is True */
540+
/* Add FCoE APP if Error is False and Oper/Sync is True */
540541
if (!err && sync && oper) {
541-
/* CEE operating configuration supports FCoE/iSCSI/FIP only */
542-
dcbcfg->numapps = I40E_CEE_OPER_MAX_APPS;
543-
544542
/* FCoE APP */
545-
dcbcfg->app[0].priority =
543+
dcbcfg->app[i].priority =
546544
(app_prio & I40E_AQC_CEE_APP_FCOE_MASK) >>
547545
I40E_AQC_CEE_APP_FCOE_SHIFT;
548-
dcbcfg->app[0].selector = I40E_APP_SEL_ETHTYPE;
549-
dcbcfg->app[0].protocolid = I40E_APP_PROTOID_FCOE;
546+
dcbcfg->app[i].selector = I40E_APP_SEL_ETHTYPE;
547+
dcbcfg->app[i].protocolid = I40E_APP_PROTOID_FCOE;
548+
i++;
549+
}
550550

551+
status = (tlv_status & I40E_AQC_CEE_ISCSI_STATUS_MASK) >>
552+
I40E_AQC_CEE_ISCSI_STATUS_SHIFT;
553+
err = (status & I40E_TLV_STATUS_ERR) ? 1 : 0;
554+
sync = (status & I40E_TLV_STATUS_SYNC) ? 1 : 0;
555+
oper = (status & I40E_TLV_STATUS_OPER) ? 1 : 0;
556+
/* Add iSCSI APP if Error is False and Oper/Sync is True */
557+
if (!err && sync && oper) {
551558
/* iSCSI APP */
552-
dcbcfg->app[1].priority =
559+
dcbcfg->app[i].priority =
553560
(app_prio & I40E_AQC_CEE_APP_ISCSI_MASK) >>
554561
I40E_AQC_CEE_APP_ISCSI_SHIFT;
555-
dcbcfg->app[1].selector = I40E_APP_SEL_TCPIP;
556-
dcbcfg->app[1].protocolid = I40E_APP_PROTOID_ISCSI;
562+
dcbcfg->app[i].selector = I40E_APP_SEL_TCPIP;
563+
dcbcfg->app[i].protocolid = I40E_APP_PROTOID_ISCSI;
564+
i++;
565+
}
557566

567+
status = (tlv_status & I40E_AQC_CEE_FIP_STATUS_MASK) >>
568+
I40E_AQC_CEE_FIP_STATUS_SHIFT;
569+
err = (status & I40E_TLV_STATUS_ERR) ? 1 : 0;
570+
sync = (status & I40E_TLV_STATUS_SYNC) ? 1 : 0;
571+
oper = (status & I40E_TLV_STATUS_OPER) ? 1 : 0;
572+
/* Add FIP APP if Error is False and Oper/Sync is True */
573+
if (!err && sync && oper) {
558574
/* FIP APP */
559-
dcbcfg->app[2].priority =
575+
dcbcfg->app[i].priority =
560576
(app_prio & I40E_AQC_CEE_APP_FIP_MASK) >>
561577
I40E_AQC_CEE_APP_FIP_SHIFT;
562-
dcbcfg->app[2].selector = I40E_APP_SEL_ETHTYPE;
563-
dcbcfg->app[2].protocolid = I40E_APP_PROTOID_FIP;
578+
dcbcfg->app[i].selector = I40E_APP_SEL_ETHTYPE;
579+
dcbcfg->app[i].protocolid = I40E_APP_PROTOID_FIP;
580+
i++;
564581
}
582+
dcbcfg->numapps = i;
565583
}
566584

567585
/**

drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,8 @@ static void i40e_dcbnl_del_app(struct i40e_pf *pf,
240240
if (pf->vsi[v] && pf->vsi[v]->netdev) {
241241
err = i40e_dcbnl_vsi_del_app(pf->vsi[v], app);
242242
if (err)
243-
dev_info(&pf->pdev->dev, "%s: Failed deleting app for VSI seid=%d err=%d sel=%d proto=0x%x prio=%d\n",
244-
__func__, pf->vsi[v]->seid,
245-
err, app->selector,
243+
dev_info(&pf->pdev->dev, "Failed deleting app for VSI seid=%d err=%d sel=%d proto=0x%x prio=%d\n",
244+
pf->vsi[v]->seid, err, app->selector,
246245
app->protocolid, app->priority);
247246
}
248247
}

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ static const struct i40e_stats i40e_gstrings_misc_stats[] = {
8787
I40E_VSI_STAT("rx_broadcast", eth_stats.rx_broadcast),
8888
I40E_VSI_STAT("tx_broadcast", eth_stats.tx_broadcast),
8989
I40E_VSI_STAT("rx_unknown_protocol", eth_stats.rx_unknown_protocol),
90+
I40E_VSI_STAT("tx_linearize", tx_linearize),
9091
};
9192

9293
static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
@@ -425,6 +426,7 @@ static void i40e_get_settings_link_down(struct i40e_hw *hw,
425426
ecmd->advertising = ADVERTISED_10000baseKR_Full;
426427
break;
427428
case I40E_DEV_ID_10G_BASE_T:
429+
case I40E_DEV_ID_10G_BASE_T4:
428430
ecmd->supported = SUPPORTED_10000baseT_Full |
429431
SUPPORTED_1000baseT_Full |
430432
SUPPORTED_100baseT_Full;
@@ -665,6 +667,13 @@ static int i40e_set_settings(struct net_device *netdev,
665667
advertise & ADVERTISED_40000baseLR4_Full)
666668
config.link_speed |= I40E_LINK_SPEED_40GB;
667669

670+
/* If speed didn't get set, set it to what it currently is.
671+
* This is needed because if advertise is 0 (as it is when autoneg
672+
* is disabled) then speed won't get set.
673+
*/
674+
if (!config.link_speed)
675+
config.link_speed = abilities.link_speed;
676+
668677
if (change || (abilities.link_speed != config.link_speed)) {
669678
/* copy over the rest of the abilities */
670679
config.phy_type = abilities.phy_type;
@@ -1508,9 +1517,18 @@ static int i40e_link_test(struct net_device *netdev, u64 *data)
15081517
{
15091518
struct i40e_netdev_priv *np = netdev_priv(netdev);
15101519
struct i40e_pf *pf = np->vsi->back;
1520+
i40e_status status;
1521+
bool link_up = false;
15111522

15121523
netif_info(pf, hw, netdev, "link test\n");
1513-
if (i40e_get_link_status(&pf->hw))
1524+
status = i40e_get_link_status(&pf->hw, &link_up);
1525+
if (status) {
1526+
netif_err(pf, drv, netdev, "link query timed out, please retry test\n");
1527+
*data = 1;
1528+
return *data;
1529+
}
1530+
1531+
if (link_up)
15141532
*data = 0;
15151533
else
15161534
*data = 1;

drivers/net/ethernet/intel/i40e/i40e_fcoe.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,8 @@ static int i40e_fcoe_ddp_put(struct net_device *netdev, u16 xid)
272272
/**
273273
* i40e_fcoe_sw_init - sets up the HW for FCoE
274274
* @pf: pointer to PF
275-
*
276-
* Returns 0 if FCoE is supported otherwise the error code
277275
**/
278-
int i40e_init_pf_fcoe(struct i40e_pf *pf)
276+
void i40e_init_pf_fcoe(struct i40e_pf *pf)
279277
{
280278
struct i40e_hw *hw = &pf->hw;
281279
u32 val;
@@ -287,13 +285,13 @@ int i40e_init_pf_fcoe(struct i40e_pf *pf)
287285

288286
if (!pf->hw.func_caps.fcoe) {
289287
dev_info(&pf->pdev->dev, "FCoE capability is disabled\n");
290-
return 0;
288+
return;
291289
}
292290

293291
if (!pf->hw.func_caps.dcb) {
294292
dev_warn(&pf->pdev->dev,
295293
"Hardware is not DCB capable not enabling FCoE.\n");
296-
return 0;
294+
return;
297295
}
298296

299297
/* enable FCoE hash filter */
@@ -326,7 +324,7 @@ int i40e_init_pf_fcoe(struct i40e_pf *pf)
326324
wr32(hw, I40E_GLFCOE_RCTL, val);
327325

328326
dev_info(&pf->pdev->dev, "FCoE is supported.\n");
329-
return 0;
327+
return;
330328
}
331329

332330
/**

0 commit comments

Comments
 (0)