Skip to content

Commit f551588

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 40GbE Intel Wired LAN Driver Updates 2016-02-16 This series contains updates to i40e/i40evf only. Shannon adds flags to MAC allocation requests to signify that the MAC VLAN filters should come from the shared resource pool. Added a new "set switch config" admin queue command and the new Cisco VXLAN-GPE cloud tunnel type for the admin queue commands. Added more detail to the NVM update debug message in order to see the full ethtool request data. Also added a few more bits of netdev data into the debugfs output for dump VSI. Pandi fixes the width of two datatypes which were being declared a different size from what they are assigned. Anjali fixes an issue where we were not doing write-back on interrupt throttle for legacy case in x722. Mitch adds a counter for ARQ overflows since sometimes an ever-growing number indicates that something bad is happening. Also added 20G speed for Tx bandwidth calculations. Jesse refactors the DCB function based on a community suggestion to change the multi-level if statement into a switch statement. Cleans up VF device IDs in the PF, since it does not need to know them. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 86f4477 + 82f399c commit f551588

15 files changed

+138
-43
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ struct i40e_pf {
393393
struct i40e_vf *vf;
394394
int num_alloc_vfs; /* actual number of VFs allocated */
395395
u32 vf_aq_requests;
396+
u32 arq_overflows; /* Not fatal, possibly indicative of problems */
396397

397398
/* DCBx/DCBNL capability for PF that indicates
398399
* whether DCBx is managed by firmware or host

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

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535

3636
#define I40E_FW_API_VERSION_MAJOR 0x0001
37-
#define I40E_FW_API_VERSION_MINOR 0x0004
37+
#define I40E_FW_API_VERSION_MINOR 0x0005
3838

3939
struct i40e_aq_desc {
4040
__le16 flags;
@@ -145,6 +145,7 @@ enum i40e_admin_queue_opc {
145145
i40e_aqc_opc_remove_statistics = 0x0202,
146146
i40e_aqc_opc_set_port_parameters = 0x0203,
147147
i40e_aqc_opc_get_switch_resource_alloc = 0x0204,
148+
i40e_aqc_opc_set_switch_config = 0x0205,
148149

149150
i40e_aqc_opc_add_vsi = 0x0210,
150151
i40e_aqc_opc_update_vsi_parameters = 0x0211,
@@ -229,6 +230,7 @@ enum i40e_admin_queue_opc {
229230
i40e_aqc_opc_nvm_config_read = 0x0704,
230231
i40e_aqc_opc_nvm_config_write = 0x0705,
231232
i40e_aqc_opc_oem_post_update = 0x0720,
233+
i40e_aqc_opc_thermal_sensor = 0x0721,
232234

233235
/* virtualization commands */
234236
i40e_aqc_opc_send_msg_to_pf = 0x0801,
@@ -683,6 +685,17 @@ struct i40e_aqc_switch_resource_alloc_element_resp {
683685

684686
I40E_CHECK_STRUCT_LEN(0x10, i40e_aqc_switch_resource_alloc_element_resp);
685687

688+
/* Set Switch Configuration (direct 0x0205) */
689+
struct i40e_aqc_set_switch_config {
690+
__le16 flags;
691+
#define I40E_AQ_SET_SWITCH_CFG_PROMISC 0x0001
692+
#define I40E_AQ_SET_SWITCH_CFG_L2_FILTER 0x0002
693+
__le16 valid_flags;
694+
u8 reserved[12];
695+
};
696+
697+
I40E_CHECK_CMD_LENGTH(i40e_aqc_set_switch_config);
698+
686699
/* Add VSI (indirect 0x0210)
687700
* this indirect command uses struct i40e_aqc_vsi_properties_data
688701
* as the indirect buffer (128 bytes)
@@ -909,7 +922,8 @@ struct i40e_aqc_add_veb {
909922
I40E_AQC_ADD_VEB_PORT_TYPE_SHIFT)
910923
#define I40E_AQC_ADD_VEB_PORT_TYPE_DEFAULT 0x2
911924
#define I40E_AQC_ADD_VEB_PORT_TYPE_DATA 0x4
912-
#define I40E_AQC_ADD_VEB_ENABLE_L2_FILTER 0x8
925+
#define I40E_AQC_ADD_VEB_ENABLE_L2_FILTER 0x8 /* deprecated */
926+
#define I40E_AQC_ADD_VEB_ENABLE_DISABLE_STATS 0x10
913927
u8 enable_tcs;
914928
u8 reserved[9];
915929
};
@@ -976,6 +990,7 @@ struct i40e_aqc_add_macvlan_element_data {
976990
#define I40E_AQC_MACVLAN_ADD_HASH_MATCH 0x0002
977991
#define I40E_AQC_MACVLAN_ADD_IGNORE_VLAN 0x0004
978992
#define I40E_AQC_MACVLAN_ADD_TO_QUEUE 0x0008
993+
#define I40E_AQC_MACVLAN_ADD_USE_SHARED_MAC 0x0010
979994
__le16 queue_number;
980995
#define I40E_AQC_MACVLAN_CMD_QUEUE_SHIFT 0
981996
#define I40E_AQC_MACVLAN_CMD_QUEUE_MASK (0x7FF << \
@@ -1264,6 +1279,12 @@ struct i40e_aqc_add_remove_cloud_filters_element_data {
12641279
#define I40E_AQC_ADD_CLOUD_TNL_TYPE_NVGRE_OMAC 1
12651280
#define I40E_AQC_ADD_CLOUD_TNL_TYPE_GENEVE 2
12661281
#define I40E_AQC_ADD_CLOUD_TNL_TYPE_IP 3
1282+
#define I40E_AQC_ADD_CLOUD_TNL_TYPE_RESERVED 4
1283+
#define I40E_AQC_ADD_CLOUD_TNL_TYPE_VXLAN_GPE 5
1284+
1285+
#define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_OUTER_MAC 0x2000
1286+
#define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_INNER_MAC 0x4000
1287+
#define I40E_AQC_ADD_CLOUD_FLAGS_SHARED_OUTER_IP 0x8000
12671288

12681289
__le32 tenant_id;
12691290
u8 reserved[4];
@@ -1932,6 +1953,22 @@ struct i40e_aqc_nvm_oem_post_update_buffer {
19321953

19331954
I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer);
19341955

1956+
/* Thermal Sensor (indirect 0x0721)
1957+
* read or set thermal sensor configs and values
1958+
* takes a sensor and command specific data buffer, not detailed here
1959+
*/
1960+
struct i40e_aqc_thermal_sensor {
1961+
u8 sensor_action;
1962+
#define I40E_AQ_THERMAL_SENSOR_READ_CONFIG 0
1963+
#define I40E_AQ_THERMAL_SENSOR_SET_CONFIG 1
1964+
#define I40E_AQ_THERMAL_SENSOR_READ_TEMP 2
1965+
u8 reserved[7];
1966+
__le32 addr_high;
1967+
__le32 addr_low;
1968+
};
1969+
1970+
I40E_CHECK_CMD_LENGTH(i40e_aqc_thermal_sensor);
1971+
19351972
/* Send to PF command (indirect 0x0801) id is only used by PF
19361973
* Send to VF command (indirect 0x0802) id is only used by PF
19371974
* Send to Peer PF command (indirect 0x0803)
@@ -2211,6 +2248,7 @@ struct i40e_aqc_add_udp_tunnel {
22112248
#define I40E_AQC_TUNNEL_TYPE_VXLAN 0x00
22122249
#define I40E_AQC_TUNNEL_TYPE_NGE 0x01
22132250
#define I40E_AQC_TUNNEL_TYPE_TEREDO 0x10
2251+
#define I40E_AQC_TUNNEL_TYPE_VXLAN_GPE 0x11
22142252
u8 reserved1[10];
22152253
};
22162254

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw)
6262
case I40E_DEV_ID_10G_BASE_T_X722:
6363
hw->mac.type = I40E_MAC_X722;
6464
break;
65-
case I40E_DEV_ID_X722_VF:
66-
case I40E_DEV_ID_X722_VF_HV:
67-
hw->mac.type = I40E_MAC_X722_VF;
68-
break;
69-
case I40E_DEV_ID_VF:
70-
case I40E_DEV_ID_VF_HV:
71-
hw->mac.type = I40E_MAC_VF;
72-
break;
7365
default:
7466
hw->mac.type = I40E_MAC_GENERIC;
7567
break;

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,17 +380,20 @@ static void i40e_parse_cee_app_tlv(struct i40e_cee_feat_tlv *tlv,
380380
{
381381
u16 length, typelength, offset = 0;
382382
struct i40e_cee_app_prio *app;
383-
u8 i, up, selector;
383+
u8 i;
384384

385385
typelength = ntohs(tlv->hdr.typelen);
386386
length = (u16)((typelength & I40E_LLDP_TLV_LEN_MASK) >>
387387
I40E_LLDP_TLV_LEN_SHIFT);
388388

389389
dcbcfg->numapps = length / sizeof(*app);
390+
390391
if (!dcbcfg->numapps)
391392
return;
392393

393394
for (i = 0; i < dcbcfg->numapps; i++) {
395+
u8 up, selector;
396+
394397
app = (struct i40e_cee_app_prio *)(tlv->tlvinfo + offset);
395398
for (up = 0; up < I40E_MAX_USER_PRIORITY; up++) {
396399
if (app->prio_map & BIT(up))
@@ -400,13 +403,17 @@ static void i40e_parse_cee_app_tlv(struct i40e_cee_feat_tlv *tlv,
400403

401404
/* Get Selector from lower 2 bits, and convert to IEEE */
402405
selector = (app->upper_oui_sel & I40E_CEE_APP_SELECTOR_MASK);
403-
if (selector == I40E_CEE_APP_SEL_ETHTYPE)
406+
switch (selector) {
407+
case I40E_CEE_APP_SEL_ETHTYPE:
404408
dcbcfg->app[i].selector = I40E_APP_SEL_ETHTYPE;
405-
else if (selector == I40E_CEE_APP_SEL_TCPIP)
409+
break;
410+
case I40E_CEE_APP_SEL_TCPIP:
406411
dcbcfg->app[i].selector = I40E_APP_SEL_TCPIP;
407-
else
412+
break;
413+
default:
408414
/* Keep selector as it is for unknown types */
409415
dcbcfg->app[i].selector = selector;
416+
}
410417

411418
dcbcfg->app[i].protocolid = ntohs(app->protocol);
412419
/* Move to next app */

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -379,19 +379,27 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)
379379
return;
380380
}
381381
dev_info(&pf->pdev->dev, "vsi seid %d\n", seid);
382-
if (vsi->netdev)
383-
dev_info(&pf->pdev->dev,
384-
" netdev: name = %s\n",
385-
vsi->netdev->name);
382+
if (vsi->netdev) {
383+
struct net_device *nd = vsi->netdev;
384+
385+
dev_info(&pf->pdev->dev, " netdev: name = %s, state = %lu, flags = 0x%08x\n",
386+
nd->name, nd->state, nd->flags);
387+
dev_info(&pf->pdev->dev, " features = 0x%08lx\n",
388+
(unsigned long int)nd->features);
389+
dev_info(&pf->pdev->dev, " hw_features = 0x%08lx\n",
390+
(unsigned long int)nd->hw_features);
391+
dev_info(&pf->pdev->dev, " vlan_features = 0x%08lx\n",
392+
(unsigned long int)nd->vlan_features);
393+
}
386394
if (vsi->active_vlans)
387395
dev_info(&pf->pdev->dev,
388396
" vlgrp: & = %p\n", vsi->active_vlans);
389397
dev_info(&pf->pdev->dev,
390-
" netdev_registered = %i, current_netdev_flags = 0x%04x, state = %li flags = 0x%08lx\n",
391-
vsi->netdev_registered,
392-
vsi->current_netdev_flags, vsi->state, vsi->flags);
398+
" state = %li flags = 0x%08lx, netdev_registered = %i, current_netdev_flags = 0x%04x\n",
399+
vsi->state, vsi->flags,
400+
vsi->netdev_registered, vsi->current_netdev_flags);
393401
if (vsi == pf->vsi[pf->lan_vsi])
394-
dev_info(&pf->pdev->dev, "MAC address: %pM SAN MAC: %pM Port MAC: %pM\n",
402+
dev_info(&pf->pdev->dev, " MAC address: %pM SAN MAC: %pM Port MAC: %pM\n",
395403
pf->hw.mac.addr,
396404
pf->hw.mac.san_addr,
397405
pf->hw.mac.port_addr);

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,11 @@
3939
#define I40E_DEV_ID_20G_KR2 0x1587
4040
#define I40E_DEV_ID_20G_KR2_A 0x1588
4141
#define I40E_DEV_ID_10G_BASE_T4 0x1589
42-
#define I40E_DEV_ID_VF 0x154C
43-
#define I40E_DEV_ID_VF_HV 0x1571
4442
#define I40E_DEV_ID_KX_X722 0x37CE
4543
#define I40E_DEV_ID_QSFP_X722 0x37CF
4644
#define I40E_DEV_ID_SFP_X722 0x37D0
4745
#define I40E_DEV_ID_1G_BASE_T_X722 0x37D1
4846
#define I40E_DEV_ID_10G_BASE_T_X722 0x37D2
49-
#define I40E_DEV_ID_X722_VF 0x37CD
50-
#define I40E_DEV_ID_X722_VF_HV 0x37D9
5147

5248
#define i40e_is_40G_device(d) ((d) == I40E_DEV_ID_QSFP_A || \
5349
(d) == I40E_DEV_ID_QSFP_B || \

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ static struct i40e_stats i40e_gstrings_stats[] = {
143143
I40E_PF_STAT("rx_oversize", stats.rx_oversize),
144144
I40E_PF_STAT("rx_jabber", stats.rx_jabber),
145145
I40E_PF_STAT("VF_admin_queue_requests", vf_aq_requests),
146+
I40E_PF_STAT("arq_overflows", arq_overflows),
146147
I40E_PF_STAT("rx_hwtstamp_cleared", rx_hwtstamp_cleared),
147148
I40E_PF_STAT("fdir_flush_cnt", fd_flush_cnt),
148149
I40E_PF_STAT("fdir_atr_match", stats.fd_atr_match),

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static const char i40e_driver_string[] =
5151

5252
#define DRV_VERSION_MAJOR 1
5353
#define DRV_VERSION_MINOR 4
54-
#define DRV_VERSION_BUILD 10
54+
#define DRV_VERSION_BUILD 11
5555
#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
5656
__stringify(DRV_VERSION_MINOR) "." \
5757
__stringify(DRV_VERSION_BUILD) DRV_KERN
@@ -6257,6 +6257,7 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
62576257
if (hw->debug_mask & I40E_DEBUG_AQ)
62586258
dev_info(&pf->pdev->dev, "ARQ Overflow Error detected\n");
62596259
val &= ~I40E_PF_ARQLEN_ARQOVFL_MASK;
6260+
pf->arq_overflows++;
62606261
}
62616262
if (val & I40E_PF_ARQLEN_ARQCRIT_MASK) {
62626263
if (hw->debug_mask & I40E_DEBUG_AQ)
@@ -10645,7 +10646,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1064510646
u16 wol_nvm_bits;
1064610647
u16 link_status;
1064710648
int err;
10648-
u32 len;
1064910649
u32 val;
1065010650
u32 i;
1065110651
u8 set_fc_aq_fail;
@@ -10904,8 +10904,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1090410904
pf->num_alloc_vsi = pf->hw.func_caps.num_vsis;
1090510905

1090610906
/* Set up the *vsi struct and our local tracking of the MAIN PF vsi. */
10907-
len = sizeof(struct i40e_vsi *) * pf->num_alloc_vsi;
10908-
pf->vsi = kzalloc(len, GFP_KERNEL);
10907+
pf->vsi = kcalloc(pf->num_alloc_vsi, sizeof(struct i40e_vsi *),
10908+
GFP_KERNEL);
1090910909
if (!pf->vsi) {
1091010910
err = -ENOMEM;
1091110911
goto err_switch_setup;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,10 +693,11 @@ i40e_status i40e_nvmupd_command(struct i40e_hw *hw,
693693
/* early check for status command and debug msgs */
694694
upd_cmd = i40e_nvmupd_validate_command(hw, cmd, perrno);
695695

696-
i40e_debug(hw, I40E_DEBUG_NVM, "%s state %d nvm_release_on_hold %d\n",
696+
i40e_debug(hw, I40E_DEBUG_NVM, "%s state %d nvm_release_on_hold %d cmd 0x%08x config 0x%08x offset 0x%08x data_size 0x%08x\n",
697697
i40e_nvm_update_state_str[upd_cmd],
698698
hw->nvmupd_state,
699-
hw->aq.nvm_release_on_done);
699+
hw->aq.nvm_release_on_done,
700+
cmd->command, cmd->config, cmd->offset, cmd->data_size);
700701

701702
if (upd_cmd == I40E_NVMUPD_INVALID) {
702703
*perrno = -EFAULT;

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -789,12 +789,20 @@ void i40e_force_wb(struct i40e_vsi *vsi, struct i40e_q_vector *q_vector)
789789
if (q_vector->arm_wb_state)
790790
return;
791791

792-
val = I40E_PFINT_DYN_CTLN_WB_ON_ITR_MASK;
792+
if (vsi->back->flags & I40E_FLAG_MSIX_ENABLED) {
793+
val = I40E_PFINT_DYN_CTLN_WB_ON_ITR_MASK |
794+
I40E_PFINT_DYN_CTLN_ITR_INDX_MASK; /* set noitr */
795+
796+
wr32(&vsi->back->hw,
797+
I40E_PFINT_DYN_CTLN(q_vector->v_idx +
798+
vsi->base_vector - 1),
799+
val);
800+
} else {
801+
val = I40E_PFINT_DYN_CTL0_WB_ON_ITR_MASK |
802+
I40E_PFINT_DYN_CTL0_ITR_INDX_MASK; /* set noitr */
793803

794-
wr32(&vsi->back->hw,
795-
I40E_PFINT_DYN_CTLN(q_vector->v_idx +
796-
vsi->base_vector - 1),
797-
val);
804+
wr32(&vsi->back->hw, I40E_PFINT_DYN_CTL0, val);
805+
}
798806
q_vector->arm_wb_state = true;
799807
} else if (vsi->back->flags & I40E_FLAG_MSIX_ENABLED) {
800808
u32 val = I40E_PFINT_DYN_CTLN_INTENA_MASK |

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,6 +2306,9 @@ int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate,
23062306
case I40E_LINK_SPEED_40GB:
23072307
speed = 40000;
23082308
break;
2309+
case I40E_LINK_SPEED_20GB:
2310+
speed = 20000;
2311+
break;
23092312
case I40E_LINK_SPEED_10GB:
23102313
speed = 10000;
23112314
break;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ struct i40e_vf {
9191
* When assigned, these will be non-zero, because VSI 0 is always
9292
* the main LAN VSI for the PF.
9393
*/
94-
u8 lan_vsi_idx; /* index into PF struct */
95-
u8 lan_vsi_id; /* ID as used by firmware */
94+
u16 lan_vsi_idx; /* index into PF struct */
95+
u16 lan_vsi_id; /* ID as used by firmware */
9696

9797
u8 num_queue_pairs; /* num of qps assigned to VF vsis */
9898
u64 num_mdd_events; /* num of mdd events detected */

0 commit comments

Comments
 (0)