Skip to content

Commit f1ff4e8

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-11-08 Another series that contains updates to the ice driver only. Anirudh cleans up the code of kernel config of ifdef wrappers by moving code that is needed by DCB to disable and enable the PF VSI for configuration. Implements ice_vsi_type_str() to convert an VSI type enum value to its string equivalent to help identify VSI types from module print statements. Usha and Tarun add support for setting the maximum per-queue bit rate for transmit queues. Dave implements dcb_nl set functions and supporting software DCB functions to support the callbacks defined in the dcbnl_rtnl_ops structure. Henry adds a check to ensure we are not resetting the device when trying to configure it, and to return -EBUSY during a reset. Usha fixes a call trace caused by the receive/transmit descriptor size change request via ethtool when DCB is configured by using the number of enabled queues and not the total number of allocated queues. Paul cleans up and refactors the software LLDP configuration to handle when firmware DCBX is disabled. Akeem adds checks to ensure the VF or PF is not disabled before honoring mailbox messages to configure the VF. Brett corrects the check to make sure the vector_id passed down from iavf is less than the max allowed interrupts per VF. Updates a flag bit to align with the current specification. Bruce updates a switch statement to use the correct status of the Download Package AQ command. Does some housekeeping by cleaning up a conditional check that is not needed. Mitch shortens up the delay for SQ responses to resolve issues with VF resets failing. Jake cleans up the code reducing namespace pollution and to simplify ice_debug_cq() since it always uses the same mask, not need to pass it in. Improve debugging by adding the command opcode in the debug messages that print an error code. v2: fixed reverse christmas tree issue in patch 3 of the series. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents bbab7ef + fb0254b commit f1ff4e8

24 files changed

+2751
-218
lines changed

drivers/net/ethernet/intel/ice/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ ice-y := ice_main.o \
2020
ice_flex_pipe.o \
2121
ice_ethtool.o
2222
ice-$(CONFIG_PCI_IOV) += ice_virtchnl_pf.o ice_sriov.o
23-
ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_lib.o
23+
ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o
2424
ice-$(CONFIG_XDP_SOCKETS) += ice_xsk.o

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ enum ice_state {
180180
__ICE_NEEDS_RESTART,
181181
__ICE_PREPARED_FOR_RESET, /* set by driver when prepared */
182182
__ICE_RESET_OICR_RECV, /* set by driver after rcv reset OICR */
183+
__ICE_DCBNL_DEVRESET, /* set by dcbnl devreset */
183184
__ICE_PFR_REQ, /* set by driver and peers */
184185
__ICE_CORER_REQ, /* set by driver and peers */
185186
__ICE_GLOBR_REQ, /* set by driver and peers */
@@ -365,6 +366,7 @@ struct ice_pf {
365366
struct work_struct serv_task;
366367
struct mutex avail_q_mutex; /* protects access to avail_[rx|tx]qs */
367368
struct mutex sw_mutex; /* lock for protecting VSI alloc flow */
369+
struct mutex tc_mutex; /* lock to protect TC changes */
368370
u32 msg_enable;
369371
u32 hw_csum_rx_error;
370372
u32 oicr_idx; /* Other interrupt cause MSIX vector index */
@@ -502,10 +504,6 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);
502504
int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);
503505
void ice_fill_rss_lut(u8 *lut, u16 rss_table_size, u16 rss_size);
504506
void ice_print_link_msg(struct ice_vsi *vsi, bool isup);
505-
#ifdef CONFIG_DCB
506-
int ice_pf_ena_all_vsi(struct ice_pf *pf, bool locked);
507-
void ice_pf_dis_all_vsi(struct ice_pf *pf, bool locked);
508-
#endif /* CONFIG_DCB */
509507
int ice_open(struct net_device *netdev);
510508
int ice_stop(struct net_device *netdev);
511509

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,10 @@ struct ice_aqc_add_elem {
742742
struct ice_aqc_txsched_elem_data generic[1];
743743
};
744744

745+
struct ice_aqc_conf_elem {
746+
struct ice_aqc_txsched_elem_data generic[1];
747+
};
748+
745749
struct ice_aqc_get_elem {
746750
struct ice_aqc_txsched_elem_data generic[1];
747751
};
@@ -783,6 +787,44 @@ struct ice_aqc_port_ets_elem {
783787
__le32 tc_node_teid[8]; /* Used for response, reserved in command */
784788
};
785789

790+
/* Rate limiting profile for
791+
* Add RL profile (indirect 0x0410)
792+
* Query RL profile (indirect 0x0411)
793+
* Remove RL profile (indirect 0x0415)
794+
* These indirect commands acts on single or multiple
795+
* RL profiles with specified data.
796+
*/
797+
struct ice_aqc_rl_profile {
798+
__le16 num_profiles;
799+
__le16 num_processed; /* Only for response. Reserved in Command. */
800+
u8 reserved[4];
801+
__le32 addr_high;
802+
__le32 addr_low;
803+
};
804+
805+
struct ice_aqc_rl_profile_elem {
806+
u8 level;
807+
u8 flags;
808+
#define ICE_AQC_RL_PROFILE_TYPE_S 0x0
809+
#define ICE_AQC_RL_PROFILE_TYPE_M (0x3 << ICE_AQC_RL_PROFILE_TYPE_S)
810+
#define ICE_AQC_RL_PROFILE_TYPE_CIR 0
811+
#define ICE_AQC_RL_PROFILE_TYPE_EIR 1
812+
#define ICE_AQC_RL_PROFILE_TYPE_SRL 2
813+
/* The following flag is used for Query RL Profile Data */
814+
#define ICE_AQC_RL_PROFILE_INVAL_S 0x7
815+
#define ICE_AQC_RL_PROFILE_INVAL_M (0x1 << ICE_AQC_RL_PROFILE_INVAL_S)
816+
817+
__le16 profile_id;
818+
__le16 max_burst_size;
819+
__le16 rl_multiply;
820+
__le16 wake_up_calc;
821+
__le16 rl_encode;
822+
};
823+
824+
struct ice_aqc_rl_profile_generic_elem {
825+
struct ice_aqc_rl_profile_elem generic[1];
826+
};
827+
786828
/* Query Scheduler Resource Allocation (indirect 0x0412)
787829
* This indirect command retrieves the scheduler resources allocated by
788830
* EMP Firmware to the given PF.
@@ -1657,6 +1699,7 @@ struct ice_aq_desc {
16571699
struct ice_aqc_sched_elem_cmd sched_elem_cmd;
16581700
struct ice_aqc_query_txsched_res query_sched_res;
16591701
struct ice_aqc_query_port_ets port_ets;
1702+
struct ice_aqc_rl_profile rl_profile;
16601703
struct ice_aqc_nvm nvm;
16611704
struct ice_aqc_nvm_checksum nvm_checksum;
16621705
struct ice_aqc_pf_vf_msg virt;
@@ -1758,12 +1801,15 @@ enum ice_adminq_opc {
17581801
/* transmit scheduler commands */
17591802
ice_aqc_opc_get_dflt_topo = 0x0400,
17601803
ice_aqc_opc_add_sched_elems = 0x0401,
1804+
ice_aqc_opc_cfg_sched_elems = 0x0403,
17611805
ice_aqc_opc_get_sched_elems = 0x0404,
17621806
ice_aqc_opc_suspend_sched_elems = 0x0409,
17631807
ice_aqc_opc_resume_sched_elems = 0x040A,
17641808
ice_aqc_opc_query_port_ets = 0x040E,
17651809
ice_aqc_opc_delete_sched_elems = 0x040F,
1810+
ice_aqc_opc_add_rl_profiles = 0x0410,
17661811
ice_aqc_opc_query_sched_res = 0x0412,
1812+
ice_aqc_opc_remove_rl_profiles = 0x0415,
17671813

17681814
/* PHY commands */
17691815
ice_aqc_opc_get_phy_caps = 0x0600,

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

Lines changed: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,9 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
855855
goto err_unroll_sched;
856856
}
857857
INIT_LIST_HEAD(&hw->agg_list);
858+
/* Initialize max burst size */
859+
if (!hw->max_burst_size)
860+
ice_cfg_rl_burst_size(hw, ICE_SCHED_DFLT_BURST_SIZE);
858861

859862
status = ice_init_fltr_mgmt_struct(hw);
860863
if (status)
@@ -1248,56 +1251,6 @@ const struct ice_ctx_ele ice_tlan_ctx_info[] = {
12481251
{ 0 }
12491252
};
12501253

1251-
/**
1252-
* ice_debug_cq
1253-
* @hw: pointer to the hardware structure
1254-
* @mask: debug mask
1255-
* @desc: pointer to control queue descriptor
1256-
* @buf: pointer to command buffer
1257-
* @buf_len: max length of buf
1258-
*
1259-
* Dumps debug log about control command with descriptor contents.
1260-
*/
1261-
void
1262-
ice_debug_cq(struct ice_hw *hw, u32 __maybe_unused mask, void *desc, void *buf,
1263-
u16 buf_len)
1264-
{
1265-
struct ice_aq_desc *cq_desc = (struct ice_aq_desc *)desc;
1266-
u16 len;
1267-
1268-
#ifndef CONFIG_DYNAMIC_DEBUG
1269-
if (!(mask & hw->debug_mask))
1270-
return;
1271-
#endif
1272-
1273-
if (!desc)
1274-
return;
1275-
1276-
len = le16_to_cpu(cq_desc->datalen);
1277-
1278-
ice_debug(hw, mask,
1279-
"CQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n",
1280-
le16_to_cpu(cq_desc->opcode),
1281-
le16_to_cpu(cq_desc->flags),
1282-
le16_to_cpu(cq_desc->datalen), le16_to_cpu(cq_desc->retval));
1283-
ice_debug(hw, mask, "\tcookie (h,l) 0x%08X 0x%08X\n",
1284-
le32_to_cpu(cq_desc->cookie_high),
1285-
le32_to_cpu(cq_desc->cookie_low));
1286-
ice_debug(hw, mask, "\tparam (0,1) 0x%08X 0x%08X\n",
1287-
le32_to_cpu(cq_desc->params.generic.param0),
1288-
le32_to_cpu(cq_desc->params.generic.param1));
1289-
ice_debug(hw, mask, "\taddr (h,l) 0x%08X 0x%08X\n",
1290-
le32_to_cpu(cq_desc->params.generic.addr_high),
1291-
le32_to_cpu(cq_desc->params.generic.addr_low));
1292-
if (buf && cq_desc->datalen != 0) {
1293-
ice_debug(hw, mask, "Buffer:\n");
1294-
if (buf_len < len)
1295-
len = buf_len;
1296-
1297-
ice_debug_array(hw, mask, 16, 1, (u8 *)buf, len);
1298-
}
1299-
}
1300-
13011254
/* FW Admin Queue command wrappers */
13021255

13031256
/* Software lock/mutex that is meant to be held while the Global Config Lock
@@ -3260,7 +3213,7 @@ ice_set_ctx(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)
32603213
* @tc: TC number
32613214
* @q_handle: software queue handle
32623215
*/
3263-
static struct ice_q_ctx *
3216+
struct ice_q_ctx *
32643217
ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle)
32653218
{
32663219
struct ice_vsi_ctx *vsi;
@@ -3357,9 +3310,12 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle,
33573310
node.node_teid = buf->txqs[0].q_teid;
33583311
node.data.elem_type = ICE_AQC_ELEM_TYPE_LEAF;
33593312
q_ctx->q_handle = q_handle;
3313+
q_ctx->q_teid = le32_to_cpu(node.node_teid);
33603314

3361-
/* add a leaf node into schduler tree queue layer */
3315+
/* add a leaf node into scheduler tree queue layer */
33623316
status = ice_sched_add_node(pi, hw->num_tx_sched_layers - 1, &node);
3317+
if (!status)
3318+
status = ice_sched_replay_q_bw(pi, q_ctx);
33633319

33643320
ena_txq_exit:
33653321
mutex_unlock(&pi->sched_lock);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
enum ice_status ice_nvm_validate_checksum(struct ice_hw *hw);
1515

16-
void
17-
ice_debug_cq(struct ice_hw *hw, u32 mask, void *desc, void *buf, u16 buf_len);
1816
enum ice_status ice_init_hw(struct ice_hw *hw);
1917
void ice_deinit_hw(struct ice_hw *hw);
2018
enum ice_status
@@ -141,6 +139,8 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle,
141139
enum ice_status ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle);
142140
void ice_replay_post(struct ice_hw *hw);
143141
void ice_output_fw_log(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf);
142+
struct ice_q_ctx *
143+
ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle);
144144
void
145145
ice_stat_update40(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
146146
u64 *prev_stat, u64 *cur_stat);

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

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,52 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
809809
return ICE_CTL_Q_DESC_UNUSED(sq);
810810
}
811811

812+
/**
813+
* ice_debug_cq
814+
* @hw: pointer to the hardware structure
815+
* @desc: pointer to control queue descriptor
816+
* @buf: pointer to command buffer
817+
* @buf_len: max length of buf
818+
*
819+
* Dumps debug log about control command with descriptor contents.
820+
*/
821+
static void ice_debug_cq(struct ice_hw *hw, void *desc, void *buf, u16 buf_len)
822+
{
823+
struct ice_aq_desc *cq_desc = (struct ice_aq_desc *)desc;
824+
u16 len;
825+
826+
if (!IS_ENABLED(CONFIG_DYNAMIC_DEBUG) &&
827+
!((ICE_DBG_AQ_DESC | ICE_DBG_AQ_DESC_BUF) & hw->debug_mask))
828+
return;
829+
830+
if (!desc)
831+
return;
832+
833+
len = le16_to_cpu(cq_desc->datalen);
834+
835+
ice_debug(hw, ICE_DBG_AQ_DESC,
836+
"CQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n",
837+
le16_to_cpu(cq_desc->opcode),
838+
le16_to_cpu(cq_desc->flags),
839+
le16_to_cpu(cq_desc->datalen), le16_to_cpu(cq_desc->retval));
840+
ice_debug(hw, ICE_DBG_AQ_DESC, "\tcookie (h,l) 0x%08X 0x%08X\n",
841+
le32_to_cpu(cq_desc->cookie_high),
842+
le32_to_cpu(cq_desc->cookie_low));
843+
ice_debug(hw, ICE_DBG_AQ_DESC, "\tparam (0,1) 0x%08X 0x%08X\n",
844+
le32_to_cpu(cq_desc->params.generic.param0),
845+
le32_to_cpu(cq_desc->params.generic.param1));
846+
ice_debug(hw, ICE_DBG_AQ_DESC, "\taddr (h,l) 0x%08X 0x%08X\n",
847+
le32_to_cpu(cq_desc->params.generic.addr_high),
848+
le32_to_cpu(cq_desc->params.generic.addr_low));
849+
if (buf && cq_desc->datalen != 0) {
850+
ice_debug(hw, ICE_DBG_AQ_DESC_BUF, "Buffer:\n");
851+
if (buf_len < len)
852+
len = buf_len;
853+
854+
ice_debug_array(hw, ICE_DBG_AQ_DESC_BUF, 16, 1, (u8 *)buf, len);
855+
}
856+
}
857+
812858
/**
813859
* ice_sq_done - check if FW has processed the Admin Send Queue (ATQ)
814860
* @hw: pointer to the HW struct
@@ -934,10 +980,10 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
934980
}
935981

936982
/* Debug desc and buffer */
937-
ice_debug(hw, ICE_DBG_AQ_MSG,
983+
ice_debug(hw, ICE_DBG_AQ_DESC,
938984
"ATQ: Control Send queue desc and buffer:\n");
939985

940-
ice_debug_cq(hw, ICE_DBG_AQ_CMD, (void *)desc_on_ring, buf, buf_size);
986+
ice_debug_cq(hw, (void *)desc_on_ring, buf, buf_size);
941987

942988
(cq->sq.next_to_use)++;
943989
if (cq->sq.next_to_use == cq->sq.count)
@@ -948,7 +994,7 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
948994
if (ice_sq_done(hw, cq))
949995
break;
950996

951-
mdelay(1);
997+
udelay(ICE_CTL_Q_SQ_CMD_USEC);
952998
total_delay++;
953999
} while (total_delay < cq->sq_cmd_timeout);
9541000

@@ -971,7 +1017,8 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
9711017
retval = le16_to_cpu(desc->retval);
9721018
if (retval) {
9731019
ice_debug(hw, ICE_DBG_AQ_MSG,
974-
"Control Send Queue command completed with error 0x%x\n",
1020+
"Control Send Queue command 0x%04X completed with error 0x%X\n",
1021+
le16_to_cpu(desc->opcode),
9751022
retval);
9761023

9771024
/* strip off FW internal code */
@@ -986,7 +1033,7 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
9861033
ice_debug(hw, ICE_DBG_AQ_MSG,
9871034
"ATQ: desc and buffer writeback:\n");
9881035

989-
ice_debug_cq(hw, ICE_DBG_AQ_CMD, (void *)desc, buf, buf_size);
1036+
ice_debug_cq(hw, (void *)desc, buf, buf_size);
9901037

9911038
/* save writeback AQ if requested */
9921039
if (details->wb_desc)
@@ -1075,7 +1122,8 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
10751122
if (flags & ICE_AQ_FLAG_ERR) {
10761123
ret_code = ICE_ERR_AQ_ERROR;
10771124
ice_debug(hw, ICE_DBG_AQ_MSG,
1078-
"Control Receive Queue Event received with error 0x%x\n",
1125+
"Control Receive Queue Event 0x%04X received with error 0x%X\n",
1126+
le16_to_cpu(desc->opcode),
10791127
cq->rq_last_status);
10801128
}
10811129
memcpy(&e->desc, desc, sizeof(e->desc));
@@ -1084,10 +1132,9 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
10841132
if (e->msg_buf && e->msg_len)
10851133
memcpy(e->msg_buf, cq->rq.r.rq_bi[desc_idx].va, e->msg_len);
10861134

1087-
ice_debug(hw, ICE_DBG_AQ_MSG, "ARQ: desc and buffer:\n");
1135+
ice_debug(hw, ICE_DBG_AQ_DESC, "ARQ: desc and buffer:\n");
10881136

1089-
ice_debug_cq(hw, ICE_DBG_AQ_CMD, (void *)desc, e->msg_buf,
1090-
cq->rq_buf_size);
1137+
ice_debug_cq(hw, (void *)desc, e->msg_buf, cq->rq_buf_size);
10911138

10921139
/* Restore the original datalen and buffer address in the desc,
10931140
* FW updates datalen to indicate the event message size

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ enum ice_ctl_q {
3131
ICE_CTL_Q_MAILBOX,
3232
};
3333

34-
/* Control Queue default settings */
35-
#define ICE_CTL_Q_SQ_CMD_TIMEOUT 250 /* msecs */
34+
/* Control Queue timeout settings - max delay 250ms */
35+
#define ICE_CTL_Q_SQ_CMD_TIMEOUT 2500 /* Count 2500 times */
36+
#define ICE_CTL_Q_SQ_CMD_USEC 100 /* Check every 100usec */
3637

3738
struct ice_ctl_q_ring {
3839
void *dma_head; /* Virtual address to DMA head */

0 commit comments

Comments
 (0)