Skip to content

Commit 884714c

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 2019-05-23 This series contains updates to ice driver only. Anirudh cleans up white space issues and other code formatting issues in the driver. Also implemented LLDP persistence across reboots and start/stop of the LLDP agent. Updated print statements for driver capabilities to include if it is a device or function capability. Bruce cleaned up variable declarations by removing unneeded assignment. Dave fixes a potential hang due to a couple of flows that recursively acquire the RTNL lock which results in a deadlock. Tony updates the driver to advertise what link modes we are capable of when the user does not request a specific link mode. Usha fixes up the LLDP MIB change event handling by cleaning up workarounds and print the DCB configuration changes detected. Brett fixes the driver to handle failures in the VF reset path, which was failing to free resources upon an error. Richard fixed the reported of stats via ethtool to align with our other Intel drivers. Jesse optimizes the transmit buffer and ring structures to have more efficient ordering to get hot cache lines to have packed data. Also optimized the VF structure to use less memory, since it is used hundreds of times throughout the driver. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 9395da4 + feee3cb commit 884714c

File tree

14 files changed

+400
-234
lines changed

14 files changed

+400
-234
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,10 @@ struct ice_vsi {
277277
struct list_head tmp_sync_list; /* MAC filters to be synced */
278278
struct list_head tmp_unsync_list; /* MAC filters to be unsynced */
279279

280-
u8 irqs_ready;
281-
u8 current_isup; /* Sync 'link up' logging */
282-
u8 stat_offsets_loaded;
283-
u8 vlan_ena;
280+
u8 irqs_ready:1;
281+
u8 current_isup:1; /* Sync 'link up' logging */
282+
u8 stat_offsets_loaded:1;
283+
u8 vlan_ena:1;
284284

285285
/* queue information */
286286
u8 tx_mapping_mode; /* ICE_MAP_MODE_[CONTIG|SCATTER] */
@@ -330,7 +330,7 @@ enum ice_pf_flags {
330330
ICE_FLAG_DCB_CAPABLE,
331331
ICE_FLAG_DCB_ENA,
332332
ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA,
333-
ICE_FLAG_DISABLE_FW_LLDP,
333+
ICE_FLAG_ENABLE_FW_LLDP,
334334
ICE_FLAG_ETHTOOL_CTXT, /* set when ethtool holds RTNL lock */
335335
ICE_PF_FLAGS_NBITS /* must be last */
336336
};
@@ -384,7 +384,7 @@ struct ice_pf {
384384
struct ice_hw_port_stats stats;
385385
struct ice_hw_port_stats stats_prev;
386386
struct ice_hw hw;
387-
u8 stat_prev_loaded; /* has previous stats been loaded */
387+
u8 stat_prev_loaded:1; /* has previous stats been loaded */
388388
#ifdef CONFIG_DCB
389389
u16 dcbx_cap;
390390
#endif /* CONFIG_DCB */
@@ -451,7 +451,6 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);
451451
int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);
452452
void ice_fill_rss_lut(u8 *lut, u16 rss_table_size, u16 rss_size);
453453
void ice_print_link_msg(struct ice_vsi *vsi, bool isup);
454-
void ice_napi_del(struct ice_vsi *vsi);
455454
#ifdef CONFIG_DCB
456455
int ice_pf_ena_all_vsi(struct ice_pf *pf, bool locked);
457456
void ice_pf_dis_all_vsi(struct ice_pf *pf, bool locked);

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

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,7 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count,
14471447
struct ice_hw_func_caps *func_p = NULL;
14481448
struct ice_hw_dev_caps *dev_p = NULL;
14491449
struct ice_hw_common_caps *caps;
1450+
char const *prefix;
14501451
u32 i;
14511452

14521453
if (!buf)
@@ -1457,9 +1458,11 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count,
14571458
if (opc == ice_aqc_opc_list_dev_caps) {
14581459
dev_p = &hw->dev_caps;
14591460
caps = &dev_p->common_cap;
1461+
prefix = "dev cap";
14601462
} else if (opc == ice_aqc_opc_list_func_caps) {
14611463
func_p = &hw->func_caps;
14621464
caps = &func_p->common_cap;
1465+
prefix = "func cap";
14631466
} else {
14641467
ice_debug(hw, ICE_DBG_INIT, "wrong opcode\n");
14651468
return;
@@ -1475,98 +1478,99 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count,
14751478
case ICE_AQC_CAPS_VALID_FUNCTIONS:
14761479
caps->valid_functions = number;
14771480
ice_debug(hw, ICE_DBG_INIT,
1478-
"HW caps: Valid Functions = %d\n",
1481+
"%s: valid functions = %d\n", prefix,
14791482
caps->valid_functions);
14801483
break;
14811484
case ICE_AQC_CAPS_SRIOV:
14821485
caps->sr_iov_1_1 = (number == 1);
14831486
ice_debug(hw, ICE_DBG_INIT,
1484-
"HW caps: SR-IOV = %d\n", caps->sr_iov_1_1);
1487+
"%s: SR-IOV = %d\n", prefix,
1488+
caps->sr_iov_1_1);
14851489
break;
14861490
case ICE_AQC_CAPS_VF:
14871491
if (dev_p) {
14881492
dev_p->num_vfs_exposed = number;
14891493
ice_debug(hw, ICE_DBG_INIT,
1490-
"HW caps: VFs exposed = %d\n",
1494+
"%s: VFs exposed = %d\n", prefix,
14911495
dev_p->num_vfs_exposed);
14921496
} else if (func_p) {
14931497
func_p->num_allocd_vfs = number;
14941498
func_p->vf_base_id = logical_id;
14951499
ice_debug(hw, ICE_DBG_INIT,
1496-
"HW caps: VFs allocated = %d\n",
1500+
"%s: VFs allocated = %d\n", prefix,
14971501
func_p->num_allocd_vfs);
14981502
ice_debug(hw, ICE_DBG_INIT,
1499-
"HW caps: VF base_id = %d\n",
1503+
"%s: VF base_id = %d\n", prefix,
15001504
func_p->vf_base_id);
15011505
}
15021506
break;
15031507
case ICE_AQC_CAPS_VSI:
15041508
if (dev_p) {
15051509
dev_p->num_vsi_allocd_to_host = number;
15061510
ice_debug(hw, ICE_DBG_INIT,
1507-
"HW caps: Dev.VSI cnt = %d\n",
1511+
"%s: num VSI alloc to host = %d\n",
1512+
prefix,
15081513
dev_p->num_vsi_allocd_to_host);
15091514
} else if (func_p) {
15101515
func_p->guar_num_vsi =
15111516
ice_get_num_per_func(hw, ICE_MAX_VSI);
15121517
ice_debug(hw, ICE_DBG_INIT,
1513-
"HW caps: Func.VSI cnt = %d\n",
1514-
number);
1518+
"%s: num guaranteed VSI (fw) = %d\n",
1519+
prefix, number);
1520+
ice_debug(hw, ICE_DBG_INIT,
1521+
"%s: num guaranteed VSI = %d\n",
1522+
prefix, func_p->guar_num_vsi);
15151523
}
15161524
break;
15171525
case ICE_AQC_CAPS_RSS:
15181526
caps->rss_table_size = number;
15191527
caps->rss_table_entry_width = logical_id;
15201528
ice_debug(hw, ICE_DBG_INIT,
1521-
"HW caps: RSS table size = %d\n",
1529+
"%s: RSS table size = %d\n", prefix,
15221530
caps->rss_table_size);
15231531
ice_debug(hw, ICE_DBG_INIT,
1524-
"HW caps: RSS table width = %d\n",
1532+
"%s: RSS table width = %d\n", prefix,
15251533
caps->rss_table_entry_width);
15261534
break;
15271535
case ICE_AQC_CAPS_RXQS:
15281536
caps->num_rxq = number;
15291537
caps->rxq_first_id = phys_id;
15301538
ice_debug(hw, ICE_DBG_INIT,
1531-
"HW caps: Num Rx Qs = %d\n", caps->num_rxq);
1539+
"%s: num Rx queues = %d\n", prefix,
1540+
caps->num_rxq);
15321541
ice_debug(hw, ICE_DBG_INIT,
1533-
"HW caps: Rx first queue ID = %d\n",
1542+
"%s: Rx first queue ID = %d\n", prefix,
15341543
caps->rxq_first_id);
15351544
break;
15361545
case ICE_AQC_CAPS_TXQS:
15371546
caps->num_txq = number;
15381547
caps->txq_first_id = phys_id;
15391548
ice_debug(hw, ICE_DBG_INIT,
1540-
"HW caps: Num Tx Qs = %d\n", caps->num_txq);
1549+
"%s: num Tx queues = %d\n", prefix,
1550+
caps->num_txq);
15411551
ice_debug(hw, ICE_DBG_INIT,
1542-
"HW caps: Tx first queue ID = %d\n",
1552+
"%s: Tx first queue ID = %d\n", prefix,
15431553
caps->txq_first_id);
15441554
break;
15451555
case ICE_AQC_CAPS_MSIX:
15461556
caps->num_msix_vectors = number;
15471557
caps->msix_vector_first_id = phys_id;
15481558
ice_debug(hw, ICE_DBG_INIT,
1549-
"HW caps: MSIX vector count = %d\n",
1559+
"%s: MSIX vector count = %d\n", prefix,
15501560
caps->num_msix_vectors);
15511561
ice_debug(hw, ICE_DBG_INIT,
1552-
"HW caps: MSIX first vector index = %d\n",
1562+
"%s: MSIX first vector index = %d\n", prefix,
15531563
caps->msix_vector_first_id);
15541564
break;
15551565
case ICE_AQC_CAPS_MAX_MTU:
15561566
caps->max_mtu = number;
1557-
if (dev_p)
1558-
ice_debug(hw, ICE_DBG_INIT,
1559-
"HW caps: Dev.MaxMTU = %d\n",
1560-
caps->max_mtu);
1561-
else if (func_p)
1562-
ice_debug(hw, ICE_DBG_INIT,
1563-
"HW caps: func.MaxMTU = %d\n",
1564-
caps->max_mtu);
1567+
ice_debug(hw, ICE_DBG_INIT, "%s: max MTU = %d\n",
1568+
prefix, caps->max_mtu);
15651569
break;
15661570
default:
15671571
ice_debug(hw, ICE_DBG_INIT,
1568-
"HW caps: Unknown capability[%d]: 0x%x\n", i,
1569-
cap);
1572+
"%s: unknown capability[%d]: 0x%x\n", prefix,
1573+
i, cap);
15701574
break;
15711575
}
15721576
}

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,14 @@ ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,
8282
* @hw: pointer to the HW struct
8383
* @shutdown_lldp_agent: True if LLDP Agent needs to be Shutdown
8484
* False if LLDP Agent needs to be Stopped
85+
* @persist: True if Stop/Shutdown of LLDP Agent needs to be persistent across
86+
* reboots
8587
* @cd: pointer to command details structure or NULL
8688
*
8789
* Stop or Shutdown the embedded LLDP Agent (0x0A05)
8890
*/
8991
enum ice_status
90-
ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent,
92+
ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist,
9193
struct ice_sq_cd *cd)
9294
{
9395
struct ice_aqc_lldp_stop *cmd;
@@ -100,17 +102,22 @@ ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent,
100102
if (shutdown_lldp_agent)
101103
cmd->command |= ICE_AQ_LLDP_AGENT_SHUTDOWN;
102104

105+
if (persist)
106+
cmd->command |= ICE_AQ_LLDP_AGENT_PERSIST_DIS;
107+
103108
return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
104109
}
105110

106111
/**
107112
* ice_aq_start_lldp
108113
* @hw: pointer to the HW struct
114+
* @persist: True if Start of LLDP Agent needs to be persistent across reboots
109115
* @cd: pointer to command details structure or NULL
110116
*
111117
* Start the embedded LLDP Agent on all ports. (0x0A06)
112118
*/
113-
enum ice_status ice_aq_start_lldp(struct ice_hw *hw, struct ice_sq_cd *cd)
119+
enum ice_status
120+
ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd)
114121
{
115122
struct ice_aqc_lldp_start *cmd;
116123
struct ice_aq_desc desc;
@@ -121,6 +128,9 @@ enum ice_status ice_aq_start_lldp(struct ice_hw *hw, struct ice_sq_cd *cd)
121128

122129
cmd->command = ICE_AQ_LLDP_AGENT_START;
123130

131+
if (persist)
132+
cmd->command |= ICE_AQ_LLDP_AGENT_PERSIST_ENA;
133+
124134
return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
125135
}
126136

@@ -163,7 +173,7 @@ ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,
163173
*
164174
* Get the DCBX status from the Firmware
165175
*/
166-
u8 ice_get_dcbx_status(struct ice_hw *hw)
176+
static u8 ice_get_dcbx_status(struct ice_hw *hw)
167177
{
168178
u32 reg;
169179

@@ -614,7 +624,8 @@ ice_parse_org_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
614624
*
615625
* Parse DCB configuration from the LLDPDU
616626
*/
617-
enum ice_status ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg)
627+
static enum ice_status
628+
ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg)
618629
{
619630
struct ice_lldp_org_tlv *tlv;
620631
enum ice_status ret = 0;
@@ -664,7 +675,7 @@ enum ice_status ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg)
664675
*
665676
* Query DCB configuration from the firmware
666677
*/
667-
static enum ice_status
678+
enum ice_status
668679
ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype,
669680
struct ice_dcbx_cfg *dcbcfg)
670681
{

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ struct ice_cee_app_prio {
120120
u8 prio_map;
121121
} __packed;
122122

123-
u8 ice_get_dcbx_status(struct ice_hw *hw);
124-
enum ice_status ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg);
123+
enum ice_status
124+
ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype,
125+
struct ice_dcbx_cfg *dcbcfg);
125126
enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi);
126127
enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi);
127128
enum ice_status ice_init_dcb(struct ice_hw *hw);
@@ -131,9 +132,10 @@ ice_query_port_ets(struct ice_port_info *pi,
131132
struct ice_sq_cd *cmd_details);
132133
#ifdef CONFIG_DCB
133134
enum ice_status
134-
ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent,
135+
ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist,
135136
struct ice_sq_cd *cd);
136-
enum ice_status ice_aq_start_lldp(struct ice_hw *hw, struct ice_sq_cd *cd);
137+
enum ice_status
138+
ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd);
137139
enum ice_status
138140
ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent,
139141
bool *dcbx_agent_status, struct ice_sq_cd *cd);
@@ -144,13 +146,15 @@ ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,
144146
static inline enum ice_status
145147
ice_aq_stop_lldp(struct ice_hw __always_unused *hw,
146148
bool __always_unused shutdown_lldp_agent,
149+
bool __always_unused persist,
147150
struct ice_sq_cd __always_unused *cd)
148151
{
149152
return 0;
150153
}
151154

152155
static inline enum ice_status
153156
ice_aq_start_lldp(struct ice_hw __always_unused *hw,
157+
bool __always_unused persist,
154158
struct ice_sq_cd __always_unused *cd)
155159
{
156160
return 0;

0 commit comments

Comments
 (0)