Skip to content

Commit 4f3ebb0

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Fixes 2018-10-24 This series contains fixes for the ice driver. Anirudh fixes a namespace issue which was introduced with a previous patch to remove ice_netpoll. Fixed up the device ID define names to align with the branding string names. Use the capability count returned by the firmware, instead of calculating the count. Introduced driver workarounds due to current firmware limitations. Fixed the queue mapping for a VF, which needs to be set in the config and scatter queue modes. Fixed the driver which is setup to handle link status events (LSE), even though the firmware does not have this feature yet, so add the ability to poll for link status changes while we wait for updated firmware. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 4ed591c + 4f4be03 commit 4f3ebb0

9 files changed

Lines changed: 77 additions & 138 deletions

File tree

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

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,23 @@ static enum ice_status ice_set_mac_type(struct ice_hw *hw)
4242
return 0;
4343
}
4444

45+
/**
46+
* ice_dev_onetime_setup - Temporary HW/FW workarounds
47+
* @hw: pointer to the HW structure
48+
*
49+
* This function provides temporary workarounds for certain issues
50+
* that are expected to be fixed in the HW/FW.
51+
*/
52+
void ice_dev_onetime_setup(struct ice_hw *hw)
53+
{
54+
/* configure Rx - set non pxe mode */
55+
wr32(hw, GLLAN_RCTL_0, 0x1);
56+
57+
#define MBX_PF_VT_PFALLOC 0x00231E80
58+
/* set VFs per PF */
59+
wr32(hw, MBX_PF_VT_PFALLOC, rd32(hw, PF_VT_PFALLOC_HIF));
60+
}
61+
4562
/**
4663
* ice_clear_pf_cfg - Clear PF configuration
4764
* @hw: pointer to the hardware structure
@@ -218,7 +235,7 @@ static enum ice_media_type ice_get_media_type(struct ice_port_info *pi)
218235
*
219236
* Get Link Status (0x607). Returns the link status of the adapter.
220237
*/
221-
enum ice_status
238+
static enum ice_status
222239
ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse,
223240
struct ice_link_status *link, struct ice_sq_cd *cd)
224241
{
@@ -740,6 +757,8 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
740757
if (status)
741758
goto err_unroll_sched;
742759

760+
ice_dev_onetime_setup(hw);
761+
743762
/* Get MAC information */
744763
/* A single port can report up to two (LAN and WoL) addresses */
745764
mac_buf = devm_kcalloc(ice_hw_to_dev(hw), 2,
@@ -1531,9 +1550,7 @@ ice_aq_discover_caps(struct ice_hw *hw, void *buf, u16 buf_size, u32 *cap_count,
15311550
if (!status)
15321551
ice_parse_caps(hw, buf, le32_to_cpu(cmd->count), opc);
15331552
else if (hw->adminq.sq_last_status == ICE_AQ_RC_ENOMEM)
1534-
*cap_count =
1535-
DIV_ROUND_UP(le16_to_cpu(desc.datalen),
1536-
sizeof(struct ice_aqc_list_caps_elem));
1553+
*cap_count = le32_to_cpu(cmd->count);
15371554
return status;
15381555
}
15391556

@@ -1987,33 +2004,6 @@ ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link,
19872004
return ice_aq_send_cmd(pi->hw, &desc, NULL, 0, cd);
19882005
}
19892006

1990-
/**
1991-
* ice_aq_set_event_mask
1992-
* @hw: pointer to the hw struct
1993-
* @port_num: port number of the physical function
1994-
* @mask: event mask to be set
1995-
* @cd: pointer to command details structure or NULL
1996-
*
1997-
* Set event mask (0x0613)
1998-
*/
1999-
enum ice_status
2000-
ice_aq_set_event_mask(struct ice_hw *hw, u8 port_num, u16 mask,
2001-
struct ice_sq_cd *cd)
2002-
{
2003-
struct ice_aqc_set_event_mask *cmd;
2004-
struct ice_aq_desc desc;
2005-
2006-
cmd = &desc.params.set_event_mask;
2007-
2008-
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_event_mask);
2009-
2010-
cmd->lport_num = port_num;
2011-
2012-
cmd->event_mask = cpu_to_le16(mask);
2013-
2014-
return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
2015-
}
2016-
20172007
/**
20182008
* __ice_aq_get_set_rss_lut
20192009
* @hw: pointer to the hardware structure

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
3434
struct ice_sq_cd *cd);
3535
void ice_clear_pxe_mode(struct ice_hw *hw);
3636
enum ice_status ice_get_caps(struct ice_hw *hw);
37+
38+
void ice_dev_onetime_setup(struct ice_hw *hw);
39+
3740
enum ice_status
3841
ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx,
3942
u32 rxq_index);
@@ -83,12 +86,6 @@ enum ice_status
8386
ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link,
8487
struct ice_sq_cd *cd);
8588
enum ice_status
86-
ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse,
87-
struct ice_link_status *link, struct ice_sq_cd *cd);
88-
enum ice_status
89-
ice_aq_set_event_mask(struct ice_hw *hw, u8 port_num, u16 mask,
90-
struct ice_sq_cd *cd);
91-
enum ice_status
9289
ice_dis_vsi_txq(struct ice_port_info *pi, u8 num_queues, u16 *q_ids,
9390
u32 *q_teids, enum ice_disq_rst_src rst_src, u16 vmvf_num,
9491
struct ice_sq_cd *cmd_details);

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919

2020
/* Defines that help manage the driver vs FW API checks.
2121
* Take a look at ice_aq_ver_check in ice_controlq.c for actual usage.
22-
*
2322
*/
2423
#define EXP_FW_API_VER_BRANCH 0x00
25-
#define EXP_FW_API_VER_MAJOR 0x00
26-
#define EXP_FW_API_VER_MINOR 0x01
24+
#define EXP_FW_API_VER_MAJOR 0x01
25+
#define EXP_FW_API_VER_MINOR 0x03
2726

2827
/* Different control queue types: These are mainly for SW consumption. */
2928
enum ice_ctl_q {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
/* Device IDs */
88
/* Intel(R) Ethernet Controller E810-C for backplane */
9-
#define ICE_DEV_ID_C810_BACKPLANE 0x1591
9+
#define ICE_DEV_ID_E810C_BACKPLANE 0x1591
1010
/* Intel(R) Ethernet Controller E810-C for QSFP */
11-
#define ICE_DEV_ID_C810_QSFP 0x1592
11+
#define ICE_DEV_ID_E810C_QSFP 0x1592
1212
/* Intel(R) Ethernet Controller E810-C for SFP */
13-
#define ICE_DEV_ID_C810_SFP 0x1593
13+
#define ICE_DEV_ID_E810C_SFP 0x1593
1414

1515
#endif /* _ICE_DEVIDS_H_ */

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@
157157
#define VPINT_ALLOC_LAST_S 12
158158
#define VPINT_ALLOC_LAST_M ICE_M(0x7FF, 12)
159159
#define VPINT_ALLOC_VALID_M BIT(31)
160+
#define VPINT_ALLOC_PCI(_VF) (0x0009D000 + ((_VF) * 4))
161+
#define VPINT_ALLOC_PCI_FIRST_S 0
162+
#define VPINT_ALLOC_PCI_FIRST_M ICE_M(0x7FF, 0)
163+
#define VPINT_ALLOC_PCI_LAST_S 12
164+
#define VPINT_ALLOC_PCI_LAST_M ICE_M(0x7FF, 12)
165+
#define VPINT_ALLOC_PCI_VALID_M BIT(31)
166+
#define GLLAN_RCTL_0 0x002941F8
160167
#define QRX_CONTEXT(_i, _QRX) (0x00280000 + ((_i) * 8192 + (_QRX) * 4))
161168
#define QRX_CTRL(_QRX) (0x00120000 + ((_QRX) * 4))
162169
#define QRX_CTRL_MAX_INDEX 2047
@@ -320,6 +327,7 @@
320327
#define GLV_UPRCL(_i) (0x003B2000 + ((_i) * 8))
321328
#define GLV_UPTCH(_i) (0x0030A004 + ((_i) * 8))
322329
#define GLV_UPTCL(_i) (0x0030A000 + ((_i) * 8))
330+
#define PF_VT_PFALLOC_HIF 0x0009DD80
323331
#define VSIQF_HKEY_MAX_INDEX 12
324332
#define VSIQF_HLUT_MAX_INDEX 15
325333
#define VFINT_DYN_CTLN(_i) (0x00003800 + ((_i) * 4))

‎drivers/net/ethernet/intel/ice/ice_lib.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ int ice_vsi_clear(struct ice_vsi *vsi)
433433
* @irq: interrupt number
434434
* @data: pointer to a q_vector
435435
*/
436-
irqreturn_t ice_msix_clean_rings(int __always_unused irq, void *data)
436+
static irqreturn_t ice_msix_clean_rings(int __always_unused irq, void *data)
437437
{
438438
struct ice_q_vector *q_vector = (struct ice_q_vector *)data;
439439

@@ -2529,6 +2529,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi)
25292529
vsi->hw_base_vector = 0;
25302530
ice_vsi_clear_rings(vsi);
25312531
ice_vsi_free_arrays(vsi, false);
2532+
ice_dev_onetime_setup(&vsi->back->hw);
25322533
ice_vsi_set_num_qs(vsi);
25332534

25342535
/* Initialize VSI struct elements and create VSI in FW */

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,4 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc);
7373

7474
int ice_vsi_manage_rss_lut(struct ice_vsi *vsi, bool ena);
7575

76-
irqreturn_t ice_msix_clean_rings(int __always_unused irq, void *data);
7776
#endif /* !_ICE_LIB_H_ */

‎drivers/net/ethernet/intel/ice/ice_main.c‎

Lines changed: 27 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -456,35 +456,6 @@ static void ice_reset_subtask(struct ice_pf *pf)
456456
}
457457
}
458458

459-
/**
460-
* ice_watchdog_subtask - periodic tasks not using event driven scheduling
461-
* @pf: board private structure
462-
*/
463-
static void ice_watchdog_subtask(struct ice_pf *pf)
464-
{
465-
int i;
466-
467-
/* if interface is down do nothing */
468-
if (test_bit(__ICE_DOWN, pf->state) ||
469-
test_bit(__ICE_CFG_BUSY, pf->state))
470-
return;
471-
472-
/* make sure we don't do these things too often */
473-
if (time_before(jiffies,
474-
pf->serv_tmr_prev + pf->serv_tmr_period))
475-
return;
476-
477-
pf->serv_tmr_prev = jiffies;
478-
479-
/* Update the stats for active netdevs so the network stack
480-
* can look at updated numbers whenever it cares to
481-
*/
482-
ice_update_pf_stats(pf);
483-
for (i = 0; i < pf->num_alloc_vsi; i++)
484-
if (pf->vsi[i] && pf->vsi[i]->netdev)
485-
ice_update_vsi_stats(pf->vsi[i]);
486-
}
487-
488459
/**
489460
* ice_print_link_msg - print link up or down message
490461
* @vsi: the VSI whose link status is being queried
@@ -554,36 +525,6 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup)
554525
speed, fc);
555526
}
556527

557-
/**
558-
* ice_init_link_events - enable/initialize link events
559-
* @pi: pointer to the port_info instance
560-
*
561-
* Returns -EIO on failure, 0 on success
562-
*/
563-
static int ice_init_link_events(struct ice_port_info *pi)
564-
{
565-
u16 mask;
566-
567-
mask = ~((u16)(ICE_AQ_LINK_EVENT_UPDOWN | ICE_AQ_LINK_EVENT_MEDIA_NA |
568-
ICE_AQ_LINK_EVENT_MODULE_QUAL_FAIL));
569-
570-
if (ice_aq_set_event_mask(pi->hw, pi->lport, mask, NULL)) {
571-
dev_dbg(ice_hw_to_dev(pi->hw),
572-
"Failed to set link event mask for port %d\n",
573-
pi->lport);
574-
return -EIO;
575-
}
576-
577-
if (ice_aq_get_link_info(pi, true, NULL, NULL)) {
578-
dev_dbg(ice_hw_to_dev(pi->hw),
579-
"Failed to enable link events for port %d\n",
580-
pi->lport);
581-
return -EIO;
582-
}
583-
584-
return 0;
585-
}
586-
587528
/**
588529
* ice_vsi_link_event - update the vsi's netdev
589530
* @vsi: the vsi on which the link event occurred
@@ -671,27 +612,35 @@ ice_link_event(struct ice_pf *pf, struct ice_port_info *pi)
671612
}
672613

673614
/**
674-
* ice_handle_link_event - handle link event via ARQ
675-
* @pf: pf that the link event is associated with
676-
*
677-
* Return -EINVAL if port_info is null
678-
* Return status on succes
615+
* ice_watchdog_subtask - periodic tasks not using event driven scheduling
616+
* @pf: board private structure
679617
*/
680-
static int ice_handle_link_event(struct ice_pf *pf)
618+
static void ice_watchdog_subtask(struct ice_pf *pf)
681619
{
682-
struct ice_port_info *port_info;
683-
int status;
620+
int i;
684621

685-
port_info = pf->hw.port_info;
686-
if (!port_info)
687-
return -EINVAL;
622+
/* if interface is down do nothing */
623+
if (test_bit(__ICE_DOWN, pf->state) ||
624+
test_bit(__ICE_CFG_BUSY, pf->state))
625+
return;
688626

689-
status = ice_link_event(pf, port_info);
690-
if (status)
691-
dev_dbg(&pf->pdev->dev,
692-
"Could not process link event, error %d\n", status);
627+
/* make sure we don't do these things too often */
628+
if (time_before(jiffies,
629+
pf->serv_tmr_prev + pf->serv_tmr_period))
630+
return;
693631

694-
return status;
632+
pf->serv_tmr_prev = jiffies;
633+
634+
if (ice_link_event(pf, pf->hw.port_info))
635+
dev_dbg(&pf->pdev->dev, "ice_link_event failed\n");
636+
637+
/* Update the stats for active netdevs so the network stack
638+
* can look at updated numbers whenever it cares to
639+
*/
640+
ice_update_pf_stats(pf);
641+
for (i = 0; i < pf->num_alloc_vsi; i++)
642+
if (pf->vsi[i] && pf->vsi[i]->netdev)
643+
ice_update_vsi_stats(pf->vsi[i]);
695644
}
696645

697646
/**
@@ -797,11 +746,6 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)
797746
opcode = le16_to_cpu(event.desc.opcode);
798747

799748
switch (opcode) {
800-
case ice_aqc_opc_get_link_status:
801-
if (ice_handle_link_event(pf))
802-
dev_err(&pf->pdev->dev,
803-
"Could not handle link event\n");
804-
break;
805749
case ice_mbx_opc_send_msg_to_pf:
806750
ice_vc_process_vf_msg(pf, &event);
807751
break;
@@ -2207,12 +2151,6 @@ static int ice_probe(struct pci_dev *pdev,
22072151
/* since everything is good, start the service timer */
22082152
mod_timer(&pf->serv_tmr, round_jiffies(jiffies + pf->serv_tmr_period));
22092153

2210-
err = ice_init_link_events(pf->hw.port_info);
2211-
if (err) {
2212-
dev_err(&pdev->dev, "ice_init_link_events failed: %d\n", err);
2213-
goto err_alloc_sw_unroll;
2214-
}
2215-
22162154
return 0;
22172155

22182156
err_alloc_sw_unroll:
@@ -2271,9 +2209,9 @@ static void ice_remove(struct pci_dev *pdev)
22712209
* Class, Class Mask, private data (not used) }
22722210
*/
22732211
static const struct pci_device_id ice_pci_tbl[] = {
2274-
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_C810_BACKPLANE), 0 },
2275-
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_C810_QSFP), 0 },
2276-
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_C810_SFP), 0 },
2212+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E810C_BACKPLANE), 0 },
2213+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E810C_QSFP), 0 },
2214+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E810C_SFP), 0 },
22772215
/* required last entry */
22782216
{ 0, }
22792217
};

‎drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ static void ice_dis_vf_mappings(struct ice_vf *vf)
173173
vsi = pf->vsi[vf->lan_vsi_idx];
174174

175175
wr32(hw, VPINT_ALLOC(vf->vf_id), 0);
176+
wr32(hw, VPINT_ALLOC_PCI(vf->vf_id), 0);
176177

177178
first = vf->first_vector_idx;
178179
last = first + pf->num_vf_msix - 1;
@@ -519,6 +520,10 @@ static void ice_ena_vf_mappings(struct ice_vf *vf)
519520
VPINT_ALLOC_VALID_M);
520521
wr32(hw, VPINT_ALLOC(vf->vf_id), reg);
521522

523+
reg = (((first << VPINT_ALLOC_PCI_FIRST_S) & VPINT_ALLOC_PCI_FIRST_M) |
524+
((last << VPINT_ALLOC_PCI_LAST_S) & VPINT_ALLOC_PCI_LAST_M) |
525+
VPINT_ALLOC_PCI_VALID_M);
526+
wr32(hw, VPINT_ALLOC_PCI(vf->vf_id), reg);
522527
/* map the interrupts to its functions */
523528
for (v = first; v <= last; v++) {
524529
reg = (((abs_vf_id << GLINT_VECT2FUNC_VF_NUM_S) &
@@ -528,10 +533,11 @@ static void ice_ena_vf_mappings(struct ice_vf *vf)
528533
wr32(hw, GLINT_VECT2FUNC(v), reg);
529534
}
530535

536+
/* set regardless of mapping mode */
537+
wr32(hw, VPLAN_TXQ_MAPENA(vf->vf_id), VPLAN_TXQ_MAPENA_TX_ENA_M);
538+
531539
/* VF Tx queues allocation */
532540
if (vsi->tx_mapping_mode == ICE_VSI_MAP_CONTIG) {
533-
wr32(hw, VPLAN_TXQ_MAPENA(vf->vf_id),
534-
VPLAN_TXQ_MAPENA_TX_ENA_M);
535541
/* set the VF PF Tx queue range
536542
* VFNUMQ value should be set to (number of queues - 1). A value
537543
* of 0 means 1 queue and a value of 255 means 256 queues
@@ -546,10 +552,11 @@ static void ice_ena_vf_mappings(struct ice_vf *vf)
546552
"Scattered mode for VF Tx queues is not yet implemented\n");
547553
}
548554

555+
/* set regardless of mapping mode */
556+
wr32(hw, VPLAN_RXQ_MAPENA(vf->vf_id), VPLAN_RXQ_MAPENA_RX_ENA_M);
557+
549558
/* VF Rx queues allocation */
550559
if (vsi->rx_mapping_mode == ICE_VSI_MAP_CONTIG) {
551-
wr32(hw, VPLAN_RXQ_MAPENA(vf->vf_id),
552-
VPLAN_RXQ_MAPENA_RX_ENA_M);
553560
/* set the VF PF Rx queue range
554561
* VFNUMQ value should be set to (number of queues - 1). A value
555562
* of 0 means 1 queue and a value of 255 means 256 queues

0 commit comments

Comments
 (0)