Skip to content

Commit f1be1e0

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-11-27 (i40e, iavf) This series contains updates to i40e and iavf drivers. Ivan Vecera performs more cleanups on i40e and iavf drivers; removing unused fields, defines, and unneeded fields. Petr Oros utilizes iavf_schedule_aq_request() helper to replace open coded equivalents. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: iavf: use iavf_schedule_aq_request() helper iavf: Remove queue tracking fields from iavf_adminq_ring i40e: Remove queue tracking fields from i40e_adminq_ring i40e: Remove AQ register definitions for VF types i40e: Delete unused and useless i40e_pf fields ==================== Link: https://lore.kernel.org/r/20231127211037.1135403-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents cd04b44 + 9526081 commit f1be1e0

File tree

12 files changed

+90
-200
lines changed

12 files changed

+90
-200
lines changed

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,7 @@ struct i40e_pf {
468468
struct i40e_hw hw;
469469
DECLARE_BITMAP(state, __I40E_STATE_SIZE__);
470470
struct msix_entry *msix_entries;
471-
bool fc_autoneg_status;
472471

473-
u16 eeprom_version;
474472
u16 num_vmdq_vsis; /* num vmdq vsis this PF has set up */
475473
u16 num_vmdq_qps; /* num queue pairs per vmdq pool */
476474
u16 num_vmdq_msix; /* num queue vectors per vmdq pool */
@@ -486,7 +484,6 @@ struct i40e_pf {
486484
u16 rss_size_max; /* HW defined max RSS queues */
487485
u16 fdir_pf_filter_count; /* num of guaranteed filters for this PF */
488486
u16 num_alloc_vsi; /* num VSIs this driver supports */
489-
u8 atr_sample_rate;
490487
bool wol_en;
491488

492489
struct hlist_head fdir_filter_list;
@@ -524,12 +521,10 @@ struct i40e_pf {
524521
struct hlist_head cloud_filter_list;
525522
u16 num_cloud_filters;
526523

527-
enum i40e_interrupt_policy int_policy;
528524
u16 rx_itr_default;
529525
u16 tx_itr_default;
530526
u32 msg_enable;
531527
char int_name[I40E_INT_NAME_STR_LEN];
532-
u16 adminq_work_limit; /* num of admin receive queue desc to process */
533528
unsigned long service_timer_period;
534529
unsigned long service_timer_previous;
535530
struct timer_list service_timer;
@@ -543,7 +538,6 @@ struct i40e_pf {
543538
u32 tx_timeout_count;
544539
u32 tx_timeout_recovery_level;
545540
unsigned long tx_timeout_last_recovery;
546-
u32 tx_sluggish_count;
547541
u32 hw_csum_rx_error;
548542
u32 led_status;
549543
u16 corer_count; /* Core reset count */
@@ -565,17 +559,13 @@ struct i40e_pf {
565559
struct i40e_lump_tracking *irq_pile;
566560

567561
/* switch config info */
568-
u16 pf_seid;
569562
u16 main_vsi_seid;
570563
u16 mac_seid;
571-
struct kobject *switch_kobj;
572564
#ifdef CONFIG_DEBUG_FS
573565
struct dentry *i40e_dbg_pf;
574566
#endif /* CONFIG_DEBUG_FS */
575567
bool cur_promisc;
576568

577-
u16 instance; /* A unique number per i40e_pf instance in the system */
578-
579569
/* sr-iov config info */
580570
struct i40e_vf *vf;
581571
int num_alloc_vfs; /* actual number of VFs allocated */
@@ -669,20 +659,15 @@ struct i40e_pf {
669659
unsigned long ptp_tx_start;
670660
struct hwtstamp_config tstamp_config;
671661
struct timespec64 ptp_prev_hw_time;
672-
struct work_struct ptp_pps_work;
673662
struct work_struct ptp_extts0_work;
674-
struct work_struct ptp_extts1_work;
675663
ktime_t ptp_reset_start;
676664
struct mutex tmreg_lock; /* Used to protect the SYSTIME registers. */
677665
u32 ptp_adj_mult;
678666
u32 tx_hwtstamp_timeouts;
679667
u32 tx_hwtstamp_skipped;
680668
u32 rx_hwtstamp_cleared;
681669
u32 latch_event_flags;
682-
u64 ptp_pps_start;
683-
u32 pps_delay;
684670
spinlock_t ptp_rx_lock; /* Used to protect Rx timestamp registers. */
685-
struct ptp_pin_desc ptp_pin[3];
686671
unsigned long latch_events[4];
687672
bool ptp_tx;
688673
bool ptp_rx;
@@ -695,7 +680,6 @@ struct i40e_pf {
695680
u32 fd_inv;
696681
u16 phy_led_val;
697682

698-
u16 override_q_count;
699683
u16 last_sw_conf_flags;
700684
u16 last_sw_conf_valid_flags;
701685
/* List to keep previous DDP profiles to be rolled back in the future */

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

Lines changed: 31 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,6 @@
88

99
static void i40e_resume_aq(struct i40e_hw *hw);
1010

11-
/**
12-
* i40e_adminq_init_regs - Initialize AdminQ registers
13-
* @hw: pointer to the hardware structure
14-
*
15-
* This assumes the alloc_asq and alloc_arq functions have already been called
16-
**/
17-
static void i40e_adminq_init_regs(struct i40e_hw *hw)
18-
{
19-
/* set head and tail registers in our local struct */
20-
hw->aq.asq.tail = I40E_PF_ATQT;
21-
hw->aq.asq.head = I40E_PF_ATQH;
22-
hw->aq.asq.len = I40E_PF_ATQLEN;
23-
hw->aq.asq.bal = I40E_PF_ATQBAL;
24-
hw->aq.asq.bah = I40E_PF_ATQBAH;
25-
hw->aq.arq.tail = I40E_PF_ARQT;
26-
hw->aq.arq.head = I40E_PF_ARQH;
27-
hw->aq.arq.len = I40E_PF_ARQLEN;
28-
hw->aq.arq.bal = I40E_PF_ARQBAL;
29-
hw->aq.arq.bah = I40E_PF_ARQBAH;
30-
}
31-
3211
/**
3312
* i40e_alloc_adminq_asq_ring - Allocate Admin Queue send rings
3413
* @hw: pointer to the hardware structure
@@ -254,17 +233,17 @@ static int i40e_config_asq_regs(struct i40e_hw *hw)
254233
u32 reg = 0;
255234

256235
/* Clear Head and Tail */
257-
wr32(hw, hw->aq.asq.head, 0);
258-
wr32(hw, hw->aq.asq.tail, 0);
236+
wr32(hw, I40E_PF_ATQH, 0);
237+
wr32(hw, I40E_PF_ATQT, 0);
259238

260239
/* set starting point */
261-
wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries |
240+
wr32(hw, I40E_PF_ATQLEN, (hw->aq.num_asq_entries |
262241
I40E_PF_ATQLEN_ATQENABLE_MASK));
263-
wr32(hw, hw->aq.asq.bal, lower_32_bits(hw->aq.asq.desc_buf.pa));
264-
wr32(hw, hw->aq.asq.bah, upper_32_bits(hw->aq.asq.desc_buf.pa));
242+
wr32(hw, I40E_PF_ATQBAL, lower_32_bits(hw->aq.asq.desc_buf.pa));
243+
wr32(hw, I40E_PF_ATQBAH, upper_32_bits(hw->aq.asq.desc_buf.pa));
265244

266245
/* Check one register to verify that config was applied */
267-
reg = rd32(hw, hw->aq.asq.bal);
246+
reg = rd32(hw, I40E_PF_ATQBAL);
268247
if (reg != lower_32_bits(hw->aq.asq.desc_buf.pa))
269248
ret_code = -EIO;
270249

@@ -283,20 +262,20 @@ static int i40e_config_arq_regs(struct i40e_hw *hw)
283262
u32 reg = 0;
284263

285264
/* Clear Head and Tail */
286-
wr32(hw, hw->aq.arq.head, 0);
287-
wr32(hw, hw->aq.arq.tail, 0);
265+
wr32(hw, I40E_PF_ARQH, 0);
266+
wr32(hw, I40E_PF_ARQT, 0);
288267

289268
/* set starting point */
290-
wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries |
269+
wr32(hw, I40E_PF_ARQLEN, (hw->aq.num_arq_entries |
291270
I40E_PF_ARQLEN_ARQENABLE_MASK));
292-
wr32(hw, hw->aq.arq.bal, lower_32_bits(hw->aq.arq.desc_buf.pa));
293-
wr32(hw, hw->aq.arq.bah, upper_32_bits(hw->aq.arq.desc_buf.pa));
271+
wr32(hw, I40E_PF_ARQBAL, lower_32_bits(hw->aq.arq.desc_buf.pa));
272+
wr32(hw, I40E_PF_ARQBAH, upper_32_bits(hw->aq.arq.desc_buf.pa));
294273

295274
/* Update tail in the HW to post pre-allocated buffers */
296-
wr32(hw, hw->aq.arq.tail, hw->aq.num_arq_entries - 1);
275+
wr32(hw, I40E_PF_ARQT, hw->aq.num_arq_entries - 1);
297276

298277
/* Check one register to verify that config was applied */
299-
reg = rd32(hw, hw->aq.arq.bal);
278+
reg = rd32(hw, I40E_PF_ARQBAL);
300279
if (reg != lower_32_bits(hw->aq.arq.desc_buf.pa))
301280
ret_code = -EIO;
302281

@@ -439,11 +418,11 @@ static int i40e_shutdown_asq(struct i40e_hw *hw)
439418
}
440419

441420
/* Stop firmware AdminQ processing */
442-
wr32(hw, hw->aq.asq.head, 0);
443-
wr32(hw, hw->aq.asq.tail, 0);
444-
wr32(hw, hw->aq.asq.len, 0);
445-
wr32(hw, hw->aq.asq.bal, 0);
446-
wr32(hw, hw->aq.asq.bah, 0);
421+
wr32(hw, I40E_PF_ATQH, 0);
422+
wr32(hw, I40E_PF_ATQT, 0);
423+
wr32(hw, I40E_PF_ATQLEN, 0);
424+
wr32(hw, I40E_PF_ATQBAL, 0);
425+
wr32(hw, I40E_PF_ATQBAH, 0);
447426

448427
hw->aq.asq.count = 0; /* to indicate uninitialized queue */
449428

@@ -473,11 +452,11 @@ static int i40e_shutdown_arq(struct i40e_hw *hw)
473452
}
474453

475454
/* Stop firmware AdminQ processing */
476-
wr32(hw, hw->aq.arq.head, 0);
477-
wr32(hw, hw->aq.arq.tail, 0);
478-
wr32(hw, hw->aq.arq.len, 0);
479-
wr32(hw, hw->aq.arq.bal, 0);
480-
wr32(hw, hw->aq.arq.bah, 0);
455+
wr32(hw, I40E_PF_ARQH, 0);
456+
wr32(hw, I40E_PF_ARQT, 0);
457+
wr32(hw, I40E_PF_ARQLEN, 0);
458+
wr32(hw, I40E_PF_ARQBAL, 0);
459+
wr32(hw, I40E_PF_ARQBAH, 0);
481460

482461
hw->aq.arq.count = 0; /* to indicate uninitialized queue */
483462

@@ -608,9 +587,6 @@ int i40e_init_adminq(struct i40e_hw *hw)
608587
goto init_adminq_exit;
609588
}
610589

611-
/* Set up register offsets */
612-
i40e_adminq_init_regs(hw);
613-
614590
/* setup ASQ command write back timeout */
615591
hw->aq.asq_cmd_timeout = I40E_ASQ_CMD_TIMEOUT;
616592

@@ -720,9 +696,9 @@ static u16 i40e_clean_asq(struct i40e_hw *hw)
720696

721697
desc = I40E_ADMINQ_DESC(*asq, ntc);
722698
details = I40E_ADMINQ_DETAILS(*asq, ntc);
723-
while (rd32(hw, hw->aq.asq.head) != ntc) {
699+
while (rd32(hw, I40E_PF_ATQH) != ntc) {
724700
i40e_debug(hw, I40E_DEBUG_AQ_COMMAND,
725-
"ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head));
701+
"ntc %d head %d.\n", ntc, rd32(hw, I40E_PF_ATQH));
726702

727703
if (details->callback) {
728704
I40E_ADMINQ_CALLBACK cb_func =
@@ -756,7 +732,7 @@ static bool i40e_asq_done(struct i40e_hw *hw)
756732
/* AQ designers suggest use of head for better
757733
* timing reliability than DD bit
758734
*/
759-
return rd32(hw, hw->aq.asq.head) == hw->aq.asq.next_to_use;
735+
return rd32(hw, I40E_PF_ATQH) == hw->aq.asq.next_to_use;
760736

761737
}
762738

@@ -797,7 +773,7 @@ i40e_asq_send_command_atomic_exec(struct i40e_hw *hw,
797773

798774
hw->aq.asq_last_status = I40E_AQ_RC_OK;
799775

800-
val = rd32(hw, hw->aq.asq.head);
776+
val = rd32(hw, I40E_PF_ATQH);
801777
if (val >= hw->aq.num_asq_entries) {
802778
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
803779
"AQTX: head overrun at %d\n", val);
@@ -889,7 +865,7 @@ i40e_asq_send_command_atomic_exec(struct i40e_hw *hw,
889865
if (hw->aq.asq.next_to_use == hw->aq.asq.count)
890866
hw->aq.asq.next_to_use = 0;
891867
if (!details->postpone)
892-
wr32(hw, hw->aq.asq.tail, hw->aq.asq.next_to_use);
868+
wr32(hw, I40E_PF_ATQT, hw->aq.asq.next_to_use);
893869

894870
/* if cmd_details are not defined or async flag is not set,
895871
* we need to wait for desc write back
@@ -949,7 +925,7 @@ i40e_asq_send_command_atomic_exec(struct i40e_hw *hw,
949925
/* update the error if time out occurred */
950926
if ((!cmd_completed) &&
951927
(!details->async && !details->postpone)) {
952-
if (rd32(hw, hw->aq.asq.len) & I40E_GL_ATQLEN_ATQCRIT_MASK) {
928+
if (rd32(hw, I40E_PF_ATQLEN) & I40E_GL_ATQLEN_ATQCRIT_MASK) {
953929
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
954930
"AQTX: AQ Critical error.\n");
955931
status = -EIO;
@@ -1103,7 +1079,7 @@ int i40e_clean_arq_element(struct i40e_hw *hw,
11031079
}
11041080

11051081
/* set next_to_use to head */
1106-
ntu = rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK;
1082+
ntu = rd32(hw, I40E_PF_ARQH) & I40E_PF_ARQH_ARQH_MASK;
11071083
if (ntu == ntc) {
11081084
/* nothing to do - shouldn't need to update ring's values */
11091085
ret_code = -EALREADY;
@@ -1151,7 +1127,7 @@ int i40e_clean_arq_element(struct i40e_hw *hw,
11511127
desc->params.external.addr_low = cpu_to_le32(lower_32_bits(bi->pa));
11521128

11531129
/* set tail = the last cleaned desc index. */
1154-
wr32(hw, hw->aq.arq.tail, ntc);
1130+
wr32(hw, I40E_PF_ARQT, ntc);
11551131
/* ntc is updated to tail + 1 */
11561132
ntc++;
11571133
if (ntc == hw->aq.num_arq_entries)

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ struct i40e_adminq_ring {
2929
/* used for interrupt processing */
3030
u16 next_to_use;
3131
u16 next_to_clean;
32-
33-
/* used for queue tracking */
34-
u32 head;
35-
u32 tail;
36-
u32 len;
37-
u32 bah;
38-
u32 bal;
3932
};
4033

4134
/* ASQ transaction details */

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc,
195195
**/
196196
bool i40e_check_asq_alive(struct i40e_hw *hw)
197197
{
198-
if (hw->aq.asq.len)
199-
return !!(rd32(hw, hw->aq.asq.len) &
200-
I40E_PF_ATQLEN_ATQENABLE_MASK);
201-
else
198+
/* Check if the queue is initialized */
199+
if (!hw->aq.asq.count)
202200
return false;
201+
202+
return !!(rd32(hw, I40E_PF_ATQLEN) & I40E_PF_ATQLEN_ATQENABLE_MASK);
203203
}
204204

205205
/**

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,9 +1028,6 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
10281028
"emp reset count: %d\n", pf->empr_count);
10291029
dev_info(&pf->pdev->dev,
10301030
"pf reset count: %d\n", pf->pfr_count);
1031-
dev_info(&pf->pdev->dev,
1032-
"pf tx sluggish count: %d\n",
1033-
pf->tx_sluggish_count);
10341031
} else if (strncmp(&cmd_buf[5], "port", 4) == 0) {
10351032
struct i40e_aqc_query_port_ets_config_resp *bw_data;
10361033
struct i40e_dcbx_config *cfg =

0 commit comments

Comments
 (0)