Skip to content

Commit bd363f5

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2021-04-14 This series contains updates to ice driver only. Bruce changes and removes open coded values to instead use existing kernel defines and suppresses false cppcheck issues. Ani adds new VSI states to track netdev allocation and registration. He also removes leading underscores in the ice_pf_state enum. Jesse refactors ITR by introducing helpers to reduce duplicated code and structures to simplify checking of ITR mode. He also triggers a software interrupt when exiting napi poll or busy-poll to ensure all work is processed. Modifies /proc/iomem to display driver name instead of PCI address. He also changes the checks of vsi->type to use a local variable in ice_vsi_rebuild() and removes an unneeded struct member. Jake replaces the driver's adaptive interrupt moderation algorithm to use the kernel's DIM library implementation. Scott reworks module reads to reduce the number of reads needed and remove excessive increment of QSFP page. Brett sets the vsi->vf_id to invalid for non-VF VSIs. Paul removes the return value from ice_vsi_manage_rss_lut() as it's not communicating anything critical. He also reduces the scope of a variable. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 3a1aa53 + 4c26f69 commit bd363f5

22 files changed

+597
-624
lines changed

drivers/net/ethernet/intel/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ config ICE
294294
tristate "Intel(R) Ethernet Connection E800 Series Support"
295295
default n
296296
depends on PCI_MSI
297+
select DIMLIB
297298
select NET_DEVLINK
298299
select PLDMFW
299300
help

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

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <linux/bpf.h>
3737
#include <linux/avf/virtchnl.h>
3838
#include <linux/cpu_rmap.h>
39+
#include <linux/dim.h>
3940
#include <net/devlink.h>
4041
#include <net/ipv6.h>
4142
#include <net/xdp_sock.h>
@@ -44,6 +45,9 @@
4445
#include <net/gre.h>
4546
#include <net/udp_tunnel.h>
4647
#include <net/vxlan.h>
48+
#if IS_ENABLED(CONFIG_DCB)
49+
#include <scsi/iscsi_proto.h>
50+
#endif /* CONFIG_DCB */
4751
#include "ice_devids.h"
4852
#include "ice_type.h"
4953
#include "ice_txrx.h"
@@ -194,50 +198,52 @@ struct ice_sw {
194198
};
195199

196200
enum ice_pf_state {
197-
__ICE_TESTING,
198-
__ICE_DOWN,
199-
__ICE_NEEDS_RESTART,
200-
__ICE_PREPARED_FOR_RESET, /* set by driver when prepared */
201-
__ICE_RESET_OICR_RECV, /* set by driver after rcv reset OICR */
202-
__ICE_PFR_REQ, /* set by driver and peers */
203-
__ICE_CORER_REQ, /* set by driver and peers */
204-
__ICE_GLOBR_REQ, /* set by driver and peers */
205-
__ICE_CORER_RECV, /* set by OICR handler */
206-
__ICE_GLOBR_RECV, /* set by OICR handler */
207-
__ICE_EMPR_RECV, /* set by OICR handler */
208-
__ICE_SUSPENDED, /* set on module remove path */
209-
__ICE_RESET_FAILED, /* set by reset/rebuild */
201+
ICE_TESTING,
202+
ICE_DOWN,
203+
ICE_NEEDS_RESTART,
204+
ICE_PREPARED_FOR_RESET, /* set by driver when prepared */
205+
ICE_RESET_OICR_RECV, /* set by driver after rcv reset OICR */
206+
ICE_PFR_REQ, /* set by driver and peers */
207+
ICE_CORER_REQ, /* set by driver and peers */
208+
ICE_GLOBR_REQ, /* set by driver and peers */
209+
ICE_CORER_RECV, /* set by OICR handler */
210+
ICE_GLOBR_RECV, /* set by OICR handler */
211+
ICE_EMPR_RECV, /* set by OICR handler */
212+
ICE_SUSPENDED, /* set on module remove path */
213+
ICE_RESET_FAILED, /* set by reset/rebuild */
210214
/* When checking for the PF to be in a nominal operating state, the
211215
* bits that are grouped at the beginning of the list need to be
212-
* checked. Bits occurring before __ICE_STATE_NOMINAL_CHECK_BITS will
216+
* checked. Bits occurring before ICE_STATE_NOMINAL_CHECK_BITS will
213217
* be checked. If you need to add a bit into consideration for nominal
214218
* operating state, it must be added before
215-
* __ICE_STATE_NOMINAL_CHECK_BITS. Do not move this entry's position
219+
* ICE_STATE_NOMINAL_CHECK_BITS. Do not move this entry's position
216220
* without appropriate consideration.
217221
*/
218-
__ICE_STATE_NOMINAL_CHECK_BITS,
219-
__ICE_ADMINQ_EVENT_PENDING,
220-
__ICE_MAILBOXQ_EVENT_PENDING,
221-
__ICE_MDD_EVENT_PENDING,
222-
__ICE_VFLR_EVENT_PENDING,
223-
__ICE_FLTR_OVERFLOW_PROMISC,
224-
__ICE_VF_DIS,
225-
__ICE_CFG_BUSY,
226-
__ICE_SERVICE_SCHED,
227-
__ICE_SERVICE_DIS,
228-
__ICE_FD_FLUSH_REQ,
229-
__ICE_OICR_INTR_DIS, /* Global OICR interrupt disabled */
230-
__ICE_MDD_VF_PRINT_PENDING, /* set when MDD event handle */
231-
__ICE_VF_RESETS_DISABLED, /* disable resets during ice_remove */
232-
__ICE_LINK_DEFAULT_OVERRIDE_PENDING,
233-
__ICE_PHY_INIT_COMPLETE,
234-
__ICE_FD_VF_FLUSH_CTX, /* set at FD Rx IRQ or timeout */
235-
__ICE_STATE_NBITS /* must be last */
222+
ICE_STATE_NOMINAL_CHECK_BITS,
223+
ICE_ADMINQ_EVENT_PENDING,
224+
ICE_MAILBOXQ_EVENT_PENDING,
225+
ICE_MDD_EVENT_PENDING,
226+
ICE_VFLR_EVENT_PENDING,
227+
ICE_FLTR_OVERFLOW_PROMISC,
228+
ICE_VF_DIS,
229+
ICE_CFG_BUSY,
230+
ICE_SERVICE_SCHED,
231+
ICE_SERVICE_DIS,
232+
ICE_FD_FLUSH_REQ,
233+
ICE_OICR_INTR_DIS, /* Global OICR interrupt disabled */
234+
ICE_MDD_VF_PRINT_PENDING, /* set when MDD event handle */
235+
ICE_VF_RESETS_DISABLED, /* disable resets during ice_remove */
236+
ICE_LINK_DEFAULT_OVERRIDE_PENDING,
237+
ICE_PHY_INIT_COMPLETE,
238+
ICE_FD_VF_FLUSH_CTX, /* set at FD Rx IRQ or timeout */
239+
ICE_STATE_NBITS /* must be last */
236240
};
237241

238242
enum ice_vsi_state {
239243
ICE_VSI_DOWN,
240244
ICE_VSI_NEEDS_RESTART,
245+
ICE_VSI_NETDEV_ALLOCD,
246+
ICE_VSI_NETDEV_REGISTERED,
241247
ICE_VSI_UMAC_FLTR_CHANGED,
242248
ICE_VSI_MMAC_FLTR_CHANGED,
243249
ICE_VSI_VLAN_FLTR_CHANGED,
@@ -346,7 +352,7 @@ struct ice_q_vector {
346352
u16 reg_idx;
347353
u8 num_ring_rx; /* total number of Rx rings in vector */
348354
u8 num_ring_tx; /* total number of Tx rings in vector */
349-
u8 itr_countdown; /* when 0 should adjust adaptive ITR */
355+
u8 wb_on_itr:1; /* if true, WB on ITR is enabled */
350356
/* in usecs, need to use ice_intrl_to_usecs_reg() before writing this
351357
* value to the device
352358
*/
@@ -361,6 +367,8 @@ struct ice_q_vector {
361367
struct irq_affinity_notify affinity_notify;
362368

363369
char name[ICE_INT_NAME_STR_LEN];
370+
371+
u16 total_events; /* net_dim(): number of interrupts processed */
364372
} ____cacheline_internodealigned_in_smp;
365373

366374
enum ice_pf_flags {
@@ -418,7 +426,7 @@ struct ice_pf {
418426
u16 num_msix_per_vf;
419427
/* used to ratelimit the MDD event logging */
420428
unsigned long last_printed_mdd_jiffies;
421-
DECLARE_BITMAP(state, __ICE_STATE_NBITS);
429+
DECLARE_BITMAP(state, ICE_STATE_NBITS);
422430
DECLARE_BITMAP(flags, ICE_PF_FLAGS_NBITS);
423431
unsigned long *avail_txqs; /* bitmap to track PF Tx queue usage */
424432
unsigned long *avail_rxqs; /* bitmap to track PF Rx queue usage */

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

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ static int ice_vsi_alloc_q_vector(struct ice_vsi *vsi, u16 v_idx)
113113
q_vector->v_idx = v_idx;
114114
q_vector->tx.itr_setting = ICE_DFLT_TX_ITR;
115115
q_vector->rx.itr_setting = ICE_DFLT_RX_ITR;
116+
q_vector->tx.itr_mode = ITR_DYNAMIC;
117+
q_vector->rx.itr_mode = ITR_DYNAMIC;
118+
116119
if (vsi->type == ICE_VSI_VF)
117120
goto out;
118121
/* only set affinity_mask if the CPU is online */
@@ -740,25 +743,13 @@ void ice_cfg_itr(struct ice_hw *hw, struct ice_q_vector *q_vector)
740743
{
741744
ice_cfg_itr_gran(hw);
742745

743-
if (q_vector->num_ring_rx) {
744-
struct ice_ring_container *rc = &q_vector->rx;
745-
746-
rc->target_itr = ITR_TO_REG(rc->itr_setting);
747-
rc->next_update = jiffies + 1;
748-
rc->current_itr = rc->target_itr;
749-
wr32(hw, GLINT_ITR(rc->itr_idx, q_vector->reg_idx),
750-
ITR_REG_ALIGN(rc->current_itr) >> ICE_ITR_GRAN_S);
751-
}
746+
if (q_vector->num_ring_rx)
747+
ice_write_itr(&q_vector->rx, q_vector->rx.itr_setting);
752748

753-
if (q_vector->num_ring_tx) {
754-
struct ice_ring_container *rc = &q_vector->tx;
749+
if (q_vector->num_ring_tx)
750+
ice_write_itr(&q_vector->tx, q_vector->tx.itr_setting);
755751

756-
rc->target_itr = ITR_TO_REG(rc->itr_setting);
757-
rc->next_update = jiffies + 1;
758-
rc->current_itr = rc->target_itr;
759-
wr32(hw, GLINT_ITR(rc->itr_idx, q_vector->reg_idx),
760-
ITR_REG_ALIGN(rc->current_itr) >> ICE_ITR_GRAN_S);
761-
}
752+
ice_write_intrl(q_vector, q_vector->intrl);
762753
}
763754

764755
/**

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,7 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
10971097
struct ice_rq_event_info *e, u16 *pending)
10981098
{
10991099
u16 ntc = cq->rq.next_to_clean;
1100+
enum ice_aq_err rq_last_status;
11001101
enum ice_status ret_code = 0;
11011102
struct ice_aq_desc *desc;
11021103
struct ice_dma_mem *bi;
@@ -1130,13 +1131,12 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
11301131
desc = ICE_CTL_Q_DESC(cq->rq, ntc);
11311132
desc_idx = ntc;
11321133

1133-
cq->rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval);
1134+
rq_last_status = (enum ice_aq_err)le16_to_cpu(desc->retval);
11341135
flags = le16_to_cpu(desc->flags);
11351136
if (flags & ICE_AQ_FLAG_ERR) {
11361137
ret_code = ICE_ERR_AQ_ERROR;
11371138
ice_debug(hw, ICE_DBG_AQ_MSG, "Control Receive Queue Event 0x%04X received with error 0x%X\n",
1138-
le16_to_cpu(desc->opcode),
1139-
cq->rq_last_status);
1139+
le16_to_cpu(desc->opcode), rq_last_status);
11401140
}
11411141
memcpy(&e->desc, desc, sizeof(e->desc));
11421142
datalen = le16_to_cpu(desc->datalen);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ struct ice_rq_event_info {
8383
/* Control Queue information */
8484
struct ice_ctl_q_info {
8585
enum ice_ctl_q qtype;
86-
enum ice_aq_err rq_last_status; /* last status on receive queue */
8786
struct ice_ctl_q_ring rq; /* receive queue */
8887
struct ice_ctl_q_ring sq; /* send queue */
8988
u32 sq_cmd_timeout; /* send queue cmd write back timeout */

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -804,22 +804,22 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg,
804804
ice_aqc_cee_app_mask = ICE_AQC_CEE_APP_FCOE_M;
805805
ice_aqc_cee_app_shift = ICE_AQC_CEE_APP_FCOE_S;
806806
ice_app_sel_type = ICE_APP_SEL_ETHTYPE;
807-
ice_app_prot_id_type = ICE_APP_PROT_ID_FCOE;
807+
ice_app_prot_id_type = ETH_P_FCOE;
808808
} else if (i == 1) {
809809
/* iSCSI APP */
810810
ice_aqc_cee_status_mask = ICE_AQC_CEE_ISCSI_STATUS_M;
811811
ice_aqc_cee_status_shift = ICE_AQC_CEE_ISCSI_STATUS_S;
812812
ice_aqc_cee_app_mask = ICE_AQC_CEE_APP_ISCSI_M;
813813
ice_aqc_cee_app_shift = ICE_AQC_CEE_APP_ISCSI_S;
814814
ice_app_sel_type = ICE_APP_SEL_TCPIP;
815-
ice_app_prot_id_type = ICE_APP_PROT_ID_ISCSI;
815+
ice_app_prot_id_type = ISCSI_LISTEN_PORT;
816816

817817
for (j = 0; j < cmp_dcbcfg->numapps; j++) {
818818
u16 prot_id = cmp_dcbcfg->app[j].prot_id;
819819
u8 sel = cmp_dcbcfg->app[j].selector;
820820

821821
if (sel == ICE_APP_SEL_TCPIP &&
822-
(prot_id == ICE_APP_PROT_ID_ISCSI ||
822+
(prot_id == ISCSI_LISTEN_PORT ||
823823
prot_id == ICE_APP_PROT_ID_ISCSI_860)) {
824824
ice_app_prot_id_type = prot_id;
825825
break;
@@ -832,7 +832,7 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg,
832832
ice_aqc_cee_app_mask = ICE_AQC_CEE_APP_FIP_M;
833833
ice_aqc_cee_app_shift = ICE_AQC_CEE_APP_FIP_S;
834834
ice_app_sel_type = ICE_APP_SEL_ETHTYPE;
835-
ice_app_prot_id_type = ICE_APP_PROT_ID_FIP;
835+
ice_app_prot_id_type = ETH_P_FIP;
836836
}
837837

838838
status = (tlv_status & ice_aqc_cee_status_mask) >>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool ets_willing, bool locked)
563563
dcbcfg->numapps = 1;
564564
dcbcfg->app[0].selector = ICE_APP_SEL_ETHTYPE;
565565
dcbcfg->app[0].priority = 3;
566-
dcbcfg->app[0].prot_id = ICE_APP_PROT_ID_FCOE;
566+
dcbcfg->app[0].prot_id = ETH_P_FCOE;
567567

568568
ret = ice_pf_dcb_cfg(pf, dcbcfg, locked);
569569
kfree(dcbcfg);

0 commit comments

Comments
 (0)