Skip to content

Commit e620d24

Browse files
iveceraanguy11
authored andcommitted
i40e: Delete unused and useless i40e_pf fields
Removed fields: .fc_autoneg_status Since commit c56999f ("i40e/i40evf: Add set_fc and init of FC settings") write-only and otherwise unused .eeprom_version Write-only and otherwise unused .atr_sample_rate Has only one possible value (I40E_DEFAULT_ATR_SAMPLE_RATE). Remove it and replace its occurrences by I40E_DEFAULT_ATR_SAMPLE_RATE .adminq_work_limit Has only one possible value (I40E_AQ_WORK_LIMIT). Remove it and replace its occurrences by I40E_AQ_WORK_LIMIT .tx_sluggish_count Unused, never written .pf_seid Used to store VSI downlink seid and it is referenced only once in the same codepath. There is no need to save it into i40e_pf. Remove it and use downlink_seid directly in the mentioned log message. .instance Write only. Remove it as well as ugly static local variable 'pfs_found' in i40e_probe. .int_policy .switch_kobj .ptp_pps_work .ptp_extts1_work .ptp_pps_start .pps_delay .ptp_pin .override_q_count All these unused at all Prior the patch: pahole -Ci40e_pf drivers/net/ethernet/intel/i40e/i40e.ko | tail -5 /* size: 5368, cachelines: 84, members: 127 */ /* sum members: 5297, holes: 20, sum holes: 71 */ /* paddings: 6, sum paddings: 19 */ /* last cacheline: 56 bytes */ }; After the patch: pahole -Ci40e_pf drivers/net/ethernet/intel/i40e/i40e.ko | tail -5 /* size: 4976, cachelines: 78, members: 112 */ /* sum members: 4905, holes: 17, sum holes: 71 */ /* paddings: 6, sum paddings: 19 */ /* last cacheline: 48 bytes */ }; Signed-off-by: Ivan Vecera <ivecera@redhat.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent e1df520 commit e620d24

File tree

3 files changed

+4
-33
lines changed

3 files changed

+4
-33
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_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 =

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3465,7 +3465,7 @@ static int i40e_configure_tx_ring(struct i40e_ring *ring)
34653465

34663466
/* some ATR related tx ring init */
34673467
if (test_bit(I40E_FLAG_FD_ATR_ENA, vsi->back->flags)) {
3468-
ring->atr_sample_rate = vsi->back->atr_sample_rate;
3468+
ring->atr_sample_rate = I40E_DEFAULT_ATR_SAMPLE_RATE;
34693469
ring->atr_count = 0;
34703470
} else {
34713471
ring->atr_sample_rate = 0;
@@ -10226,9 +10226,9 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
1022610226
opcode);
1022710227
break;
1022810228
}
10229-
} while (i++ < pf->adminq_work_limit);
10229+
} while (i++ < I40E_AQ_WORK_LIMIT);
1023010230

10231-
if (i < pf->adminq_work_limit)
10231+
if (i < I40E_AQ_WORK_LIMIT)
1023210232
clear_bit(__I40E_ADMINQ_EVENT_PENDING, pf->state);
1023310233

1023410234
/* re-enable Admin queue interrupt cause */
@@ -12769,7 +12769,6 @@ static int i40e_sw_init(struct i40e_pf *pf)
1276912769
if ((pf->hw.func_caps.fd_filters_guaranteed > 0) ||
1277012770
(pf->hw.func_caps.fd_filters_best_effort > 0)) {
1277112771
set_bit(I40E_FLAG_FD_ATR_ENA, pf->flags);
12772-
pf->atr_sample_rate = I40E_DEFAULT_ATR_SAMPLE_RATE;
1277312772
if (test_bit(I40E_FLAG_MFP_ENA, pf->flags) &&
1277412773
pf->hw.num_partitions > 1)
1277512774
dev_info(&pf->pdev->dev,
@@ -12815,7 +12814,6 @@ static int i40e_sw_init(struct i40e_pf *pf)
1281512814
I40E_MAX_VF_COUNT);
1281612815
}
1281712816
#endif /* CONFIG_PCI_IOV */
12818-
pf->eeprom_version = 0xDEAD;
1281912817
pf->lan_veb = I40E_NO_VEB;
1282012818
pf->lan_vsi = I40E_NO_VSI;
1282112819

@@ -14976,12 +14974,11 @@ static void i40e_setup_pf_switch_element(struct i40e_pf *pf,
1497614974
* the PF's VSI
1497714975
*/
1497814976
pf->mac_seid = uplink_seid;
14979-
pf->pf_seid = downlink_seid;
1498014977
pf->main_vsi_seid = seid;
1498114978
if (printconfig)
1498214979
dev_info(&pf->pdev->dev,
1498314980
"pf_seid=%d main_vsi_seid=%d\n",
14984-
pf->pf_seid, pf->main_vsi_seid);
14981+
downlink_seid, pf->main_vsi_seid);
1498514982
break;
1498614983
case I40E_SWITCH_ELEMENT_TYPE_PF:
1498714984
case I40E_SWITCH_ELEMENT_TYPE_VF:
@@ -15160,10 +15157,6 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acqui
1516015157
/* fill in link information and enable LSE reporting */
1516115158
i40e_link_event(pf);
1516215159

15163-
/* Initialize user-specific link properties */
15164-
pf->fc_autoneg_status = ((pf->hw.phy.link_info.an_info &
15165-
I40E_AQ_AN_COMPLETED) ? true : false);
15166-
1516715160
i40e_ptp_init(pf);
1516815161

1516915162
if (!lock_acquired)
@@ -15637,7 +15630,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1563715630
#endif /* CONFIG_I40E_DCB */
1563815631
struct i40e_pf *pf;
1563915632
struct i40e_hw *hw;
15640-
static u16 pfs_found;
1564115633
u16 wol_nvm_bits;
1564215634
char nvm_ver[32];
1564315635
u16 link_status;
@@ -15715,7 +15707,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1571515707
hw->bus.device = PCI_SLOT(pdev->devfn);
1571615708
hw->bus.func = PCI_FUNC(pdev->devfn);
1571715709
hw->bus.bus_id = pdev->bus->number;
15718-
pf->instance = pfs_found;
1571915710

1572015711
/* Select something other than the 802.1ad ethertype for the
1572115712
* switch to use internally and drop on ingress.
@@ -15777,7 +15768,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1577715768
}
1577815769
hw->aq.arq_buf_size = I40E_MAX_AQ_BUF_SIZE;
1577915770
hw->aq.asq_buf_size = I40E_MAX_AQ_BUF_SIZE;
15780-
pf->adminq_work_limit = I40E_AQ_WORK_LIMIT;
1578115771

1578215772
snprintf(pf->int_name, sizeof(pf->int_name) - 1,
1578315773
"%s-%s:misc",

0 commit comments

Comments
 (0)