i40e: don't degrade __le16
Subsystems (2)
PATCH 1/15 i40e: don't degrade __le16
From: Mitch Williams <[email protected]>
Sparse cries when we compare an __le16 to a u16, almost like it cares about architectures other than x86. Weird. Use the le16_to_cpu macro to make it stop crying.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++ drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -0
@@ -1255,6 +1255,8 @@ struct i40e_mac_filter *i40e_put_mac_in_vlan(struct i40e_vsi *vsi, u8 *macaddr,struct i40e_mac_filter *f; list_for_each_entry(f, &vsi->mac_filter_list, list) { + if (vsi->info.pvid) + f->vlan = le16_to_cpu(vsi->info.pvid); if (!i40e_find_filter(vsi, macaddr, f->vlan, is_vf, is_netdev)) { if (!i40e_add_filter(vsi, macaddr, f->vlan,
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +3 -2
@@ -2106,11 +2106,12 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, goto error_pvid; } -if (vsi->info.pvid == (vlan_id | (qos <<I40E_VLAN_PRIORITY_SHIFT ))) +if (le16_to_cpu (vsi->info.pvid) == + (vlan_id | (qos <<I40E_VLAN_PRIORITY_SHIFT )))/* duplicate request, so just return success */ goto error_pvid; -if (vsi->info.pvid ==0 &&i40e_is_vsi_in_vlan (vsi)) { +if (le16_to_cpu (vsi->info.pvid) ==0 &&i40e_is_vsi_in_vlan (vsi)) {dev_err (&pf->pdev->dev,"VF %d has already configured VLAN filters and the administrator is requesting a port VLAN override.\nPlease unload and reload the VF driver for this change to take effect.\n" , vf_id);
Signature · 1 line
1.9.3
PATCH 2/15 i40e: add RX to port CRC errors label
From: Shannon Nelson <[email protected]>
The port.crc_errors is really an RX counter, so let's mark it as such.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -1
@@ -114,7 +114,7 @@ static struct i40e_stats i40e_gstrings_stats[] = {I40E_PF_STAT ("tx_errors" , stats.eth.tx_errors),I40E_PF_STAT ("rx_dropped" , stats.eth.rx_discards),I40E_PF_STAT ("tx_dropped_link_down" , stats.tx_dropped_link_down), -I40E_PF_STAT ("crc_errors" , stats.crc_errors), +I40E_PF_STAT ("rx_crc_errors" , stats.crc_errors),I40E_PF_STAT ("illegal_bytes" , stats.illegal_bytes),I40E_PF_STAT ("mac_local_faults" , stats.mac_local_faults), I40E_PF_STAT("mac_remote_faults", stats.mac_remote_faults),
Signature · 1 line
1.9.3
PATCH 3/15 i40e/i40evf: Move helper functions to a header file
In reply to Catherine SullivanFrom: Anjali Singhai Jain <[email protected]>
A new header file i40e_helper.h is added to both the PF and VF driver with functions used by both drivers.
--- drivers/net/ethernet/intel/i40e/i40e_helper.h | 102 ++++++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_main.c | 72 +---------------- drivers/net/ethernet/intel/i40evf/i40e_helper.h | 102 ++++++++++++++++++++++++ drivers/net/ethernet/intel/i40evf/i40evf_main.c | 80 +------------------ 4 files changed, 206 insertions(+), 150 deletions(-) create mode 100644 drivers/net/ethernet/intel/i40e/i40e_helper.h create mode 100644 drivers/net/ethernet/intel/i40evf/i40e_helper.h
drivers/net/ethernet/intel/i40e/i40e_helper.h new file +102 -0
@@ -0,0 +1,102 @@ +/******************************************************************************* +* +* Intel Ethernet Controller XL710 Family Linux Driver +* Copyright(c) 2013 - 2015 Intel Corporation. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms and conditions of the GNU General Public License, +* version 2, as published by the Free Software Foundation. +* +* This program is distributed in the hope it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along +* with this program. If not, see <http://www.gnu.org/licenses/>. +* +* The full GNU General Public License is included in this distribution in +* the file called "COPYING". +* +* Contact Information: +* e1000-devel Mailing List <[email protected]> +* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 +* +******************************************************************************/ + +#ifndef _I40E_HELPER_H_ +#define _I40E_HELPER_H_ + +/** +* i40e_allocate_dma_mem_d - OS specific memory alloc for shared code +* @hw: pointer to the HW structure +* @mem: ptr to mem struct to fill out +* @size: size of memory requested +* @alignment: what to align the allocation to +**/ +inline int i40e_allocate_dma_mem_d (struct i40e_hw *hw, +struct i40e_dma_mem *mem, +u64 size,u32 alignment) +{ +struct i40e_pf *nf = (struct i40e_pf *)hw->back; + + mem->size =ALIGN (size, alignment); + mem->va =dma_zalloc_coherent (&nf->pdev->dev, mem->size, + &mem->pa,GFP_KERNEL ); +if (!mem->va) +return -ENOMEM ; + +return 0 ; +} + +/** +* i40e_free_dma_mem_d - OS specific memory free for shared code +* @hw: pointer to the HW structure +* @mem: ptr to mem struct to free +**/ +inline int i40e_free_dma_mem_d (struct i40e_hw *hw,struct i40e_dma_mem *mem) +{ +struct i40e_pf *nf = (struct i40e_pf *)hw->back; + +dma_free_coherent (&nf->pdev->dev, mem->size, mem->va, mem->pa); + mem->va =NULL ; + mem->pa =0 ; + mem->size =0 ; + +return 0 ; +} + +/** +* i40e_allocate_virt_mem_d - OS specific memory alloc for shared code +* @hw: pointer to the HW structure +* @mem: ptr to mem struct to fill out +* @size: size of memory requested +**/ +inline int i40e_allocate_virt_mem_d (struct i40e_hw *hw, +struct i40e_virt_mem *mem, +u32 size) +{ + mem->size = size; + mem->va =kzalloc (size,GFP_KERNEL ); + +if (!mem->va) +return -ENOMEM ; + +return 0 ; +} + +/** +* i40e_free_virt_mem_d - OS specific memory free for shared code +* @hw: pointer to the HW structure +* @mem: ptr to mem struct to free +**/ +inline int i40e_free_virt_mem_d (struct i40e_hw *hw,struct i40e_virt_mem *mem) +{ +/* it's ok to kfree a NULL pointer */ +kfree (mem->va); + mem->va =NULL ; + mem->size =0 ; + +return 0 ; +} +#endif /* _I40E_HELPER_H_ */
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -71
84 lines not on this page · raw message
drivers/net/ethernet/intel/i40evf/i40e_helper.h new file +102 -0
102 lines not on this page · raw message
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -79
92 lines not on this page · raw message
Signature · 1 line
1.9.3
PATCH 4/15 i40e: Move function calls to i40e_shutdown instead of i40e_suspend
In reply to Catherine SullivanWe should be stopping the service task and flow director on shutdown not on suspension.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +13 -3
@@ -10380,6 +10380,19 @@ static void i40e_shutdown(struct pci_dev *pdev)wr32 (hw,I40E_PFPM_APM , (pf->wol_en ?I40E_PFPM_APM_APME_MASK :0 ));wr32 (hw,I40E_PFPM_WUFC , (pf->wol_en ?I40E_PFPM_WUFC_MAG_MASK :0 )); +del_timer_sync (&pf->service_timer); +cancel_work_sync (&pf->service_task); +i40e_fdir_teardown (pf); + +rtnl_lock (); +i40e_prep_for_reset (pf); +rtnl_unlock (); + +wr32 (hw,I40E_PFPM_APM , + (pf->wol_en ?I40E_PFPM_APM_APME_MASK :0 )); +wr32 (hw,I40E_PFPM_WUFC , + (pf->wol_en ?I40E_PFPM_WUFC_MAG_MASK :0 )); +i40e_clear_interrupt_scheme (pf);if (system_state ==SYSTEM_POWER_OFF ) {
@@ -10400,9 +10413,6 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state)set_bit (__I40E_SUSPENDED, &pf->state);set_bit (__I40E_DOWN, &pf->state); -del_timer_sync (&pf->service_timer); -cancel_work_sync (&pf->service_task); -i40e_fdir_teardown (pf);rtnl_lock ();i40e_prep_for_reset (pf);
Signature · 1 line
1.9.3
PATCH 5/15 i40e: Fix legacy interrupt mode in the driver
In reply to Catherine SullivanFrom: Anjali Singhai Jain <[email protected]>
This patch fixes the driver flow to take into account legacy interrupts. Over time we added code that assumes MSIX is the only mode that the driver runs in. It also enables a legacy workaround to trigger SWINT when the TX ring has non-cache aligned descriptors pending and interrupts are disabled.
We work with a single vector in MSI mode too, so apply the same restrictions as Legacy.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +12 -4
@@ -1480,7 +1480,10 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,* vectors available and so we need to lower the used * q count. */ - qcount =min_t (int, vsi->alloc_queue_pairs, pf->num_lan_msix); +if (pf->flags &I40E_FLAG_MSIX_ENABLED ) + qcount =min_t (int, vsi->alloc_queue_pairs, pf->num_lan_msix); +else + qcount = vsi->alloc_queue_pairs; num_tc_qps = qcount / numtc; num_tc_qps =min_t (int, num_tc_qps,i40e_pf_get_max_q_per_tc (pf));
@@ -1544,7 +1547,7 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,if ((vsi->type ==I40E_VSI_MAIN ) && (numtc ==1 )) {if (vsi->req_queue_pairs >0 ) vsi->num_queue_pairs = vsi->req_queue_pairs; -else +else if (pf->flags &I40E_FLAG_MSIX_ENABLED ) vsi->num_queue_pairs = pf->num_lan_msix; }
@@ -3346,7 +3349,7 @@ static irqreturn_t i40e_fdir_clean_ring(int irq, void *data)* @v_idx: vector index * @qp_idx: queue pair index **/ -static void map_vector_to_qp (struct i40e_vsi *vsi,int v_idx,int qp_idx) +static void i40e_map_vector_to_qp (struct i40e_vsi *vsi,int v_idx,int qp_idx) {struct i40e_q_vector *q_vector = vsi->q_vectors[v_idx];struct i40e_ring *tx_ring = vsi->tx_rings[qp_idx];
@@ -3400,7 +3403,7 @@ static void i40e_vsi_map_rings_to_vectors(struct i40e_vsi *vsi) q_vector->tx.ring =NULL ;while (num_ringpairs--) { -map_vector_to_qp (vsi, v_start, qp_idx); +i40e_map_vector_to_qp (vsi, v_start, qp_idx); qp_idx++; qp_remaining--; }
@@ -8728,6 +8731,11 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi) goto vector_setup_out; } +/* In Legacy mode, we do not have to get any other vector since we +* piggyback on the misc/ICR0 for queue interrupts. +*/ +if (!(pf->flags &I40E_FLAG_MSIX_ENABLED )) +return ret;if (vsi->num_q_vectors) vsi->base_vector =i40e_get_lump (pf, pf->irq_pile, vsi->num_q_vectors, vsi->idx);
Signature · 1 line
1.9.3
PATCH 6/15 i40e: Fix ethtool offline diagnostic with netqueues
In reply to Catherine SullivanFrom: Greg Rose <[email protected]>
Treat netqueues the same way we do virtual functions when someone wants to run the ethtool offline diagnostic test.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +17 -2
@@ -1559,6 +1559,21 @@ static inline bool i40e_active_vfs(struct i40e_pf *pf)return false; } +static inline bool i40e_active_vmdqs (struct i40e_pf *pf) +{ +struct i40e_vsi **vsi = pf->vsi; +int i; + +for (i =0 ; i < pf->num_alloc_vsi; i++) { +if (!vsi[i]) +continue ; +if (vsi[i]->type ==I40E_VSI_VMDQ2 ) +return true; + } + +return false; +} +static void i40e_diag_test (struct net_device *netdev,struct ethtool_test *eth_test,u64 *data) {
@@ -1572,9 +1587,9 @@ static void i40e_diag_test(struct net_device *netdev,set_bit (__I40E_TESTING, &pf->state); -if (i40e_active_vfs (pf)) { +if (i40e_active_vfs (pf) ||i40e_active_vmdqs (pf)) {dev_warn (&pf->pdev->dev, -"Please take active VFS offline and restart the adapter before running NIC diagnostics\n" ); +"Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n" ); data[I40E_ETH_TEST_REG ] =1 ; data[I40E_ETH_TEST_EEPROM ] =1 ; data[I40E_ETH_TEST_INTR ] =1 ;
Signature · 1 line
1.9.3
PATCH 7/15 i40e/i40evf: Add capability to gather VEB per TC stats
In reply to Catherine SullivanFrom: Neerav Parikh <[email protected]>
This patch adds capability to update per VEB per TC statistics and dump it via ethtool. It also adds a structure to hold VEB per TC statistics. The fields can be filled by reading the GLVEBTC_* counters.
--- drivers/net/ethernet/intel/i40e/i40e.h | 2 ++ drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 23 ++++++++++++++++++++- drivers/net/ethernet/intel/i40e/i40e_main.c | 28 +++++++++++++++++++++++++- drivers/net/ethernet/intel/i40e/i40e_type.h | 8 ++++++++ drivers/net/ethernet/intel/i40evf/i40e_type.h | 8 ++++++++ 5 files changed, 67 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +2 -0
@@ -442,6 +442,8 @@ struct i40e_veb {bool stat_offsets_loaded;struct i40e_eth_stats stats;struct i40e_eth_stats stats_offsets; +struct i40e_veb_tc_stats tc_stats; +struct i40e_veb_tc_stats tc_stats_offsets; };/* struct that defines a VSI, associated with a dev */
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +22 -1
@@ -197,7 +197,14 @@ static const struct i40e_stats i40e_gstrings_fcoe_stats[] = { FIELD_SIZEOF(struct i40e_pf, stats.priority_xon_tx) + \ FIELD_SIZEOF(struct i40e_pf, stats.priority_xon_2_xoff)) \ / sizeof(u64)) +#define I40E_VEB_TC_STATS_LEN ( \ + (FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_rx_packets) + \ + FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_rx_bytes) + \ + FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_tx_packets) + \ + FIELD_SIZEOF(struct i40e_veb, tc_stats.tc_tx_bytes)) \ + / sizeof(u64))#define I40E_VEB_STATS_LEN ARRAY_SIZE(i40e_gstrings_veb_stats) +#define I40E_VEB_STATS_TOTAL (I40E_VEB_STATS_LEN + I40E_VEB_TC_STATS_LEN)#define I40E_PF_STATS_LEN (n) (I40E_GLOBAL_STATS_LEN + \ I40E_PFC_STATS_LEN + \ I40E_VSI_STATS_LEN((n)))
@@ -1257,7 +1264,7 @@ static int i40e_get_sset_count(struct net_device *netdev, int sset)int len =I40E_PF_STATS_LEN (netdev);if (pf->lan_veb !=I40E_NO_VEB ) - len +=I40E_VEB_STATS_LEN ; + len +=I40E_VEB_STATS_TOTAL ;return len; }else {return I40E_VSI_STATS_LEN (netdev);
@@ -1408,6 +1415,20 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset, i40e_gstrings_veb_stats[i].stat_string); p +=ETH_GSTRING_LEN ; } +for (i =0 ; i <I40E_MAX_TRAFFIC_CLASS ; i++) { +snprintf (p,ETH_GSTRING_LEN , +"veb.tc_%u_tx_packets" , i); + p +=ETH_GSTRING_LEN ; +snprintf (p,ETH_GSTRING_LEN , +"veb.tc_%u_tx_bytes" , i); + p +=ETH_GSTRING_LEN ; +snprintf (p,ETH_GSTRING_LEN , +"veb.tc_%u_rx_packets" , i); + p +=ETH_GSTRING_LEN ; +snprintf (p,ETH_GSTRING_LEN , +"veb.tc_%u_rx_bytes" , i); + p +=ETH_GSTRING_LEN ; + } }for (i =0 ; i <I40E_GLOBAL_STATS_LEN ; i++) { snprintf(p, ETH_GSTRING_LEN, "port.%s",
drivers/net/ethernet/intel/i40e/i40e_main.c +27 -1
@@ -554,11 +554,15 @@ static void i40e_update_veb_stats(struct i40e_veb *veb)struct i40e_hw *hw = &pf->hw;struct i40e_eth_stats *oes;struct i40e_eth_stats *es;/* device's eth stats */ -int idx =0 ; +struct i40e_veb_tc_stats *veb_oes; +struct i40e_veb_tc_stats *veb_es; +int i, idx =0 ; idx = veb->stats_idx; es = &veb->stats; oes = &veb->stats_offsets; + veb_es = &veb->tc_stats; + veb_oes = &veb->tc_stats_offsets;/* Gather up the stats that the hw collects */ i40e_stat_update32(hw, I40E_GLSW_TDPC(idx),
@@ -594,6 +598,28 @@ static void i40e_update_veb_stats(struct i40e_veb *veb)i40e_stat_update48 (hw,I40E_GLSW_BPTCH (idx),I40E_GLSW_BPTCL (idx), veb->stat_offsets_loaded, &oes->tx_broadcast, &es->tx_broadcast); +for (i =0 ; i <I40E_MAX_TRAFFIC_CLASS ; i++) { +i40e_stat_update48 (hw,I40E_GLVEBTC_RPCH (i, idx), +I40E_GLVEBTC_RPCL (i, idx), + veb->stat_offsets_loaded, + &veb_oes->tc_rx_packets[i], + &veb_es->tc_rx_packets[i]); +i40e_stat_update48 (hw,I40E_GLVEBTC_RBCH (i, idx), +I40E_GLVEBTC_RBCL (i, idx), + veb->stat_offsets_loaded, + &veb_oes->tc_rx_bytes[i], + &veb_es->tc_rx_bytes[i]); +i40e_stat_update48 (hw,I40E_GLVEBTC_TPCH (i, idx), +I40E_GLVEBTC_TPCL (i, idx), + veb->stat_offsets_loaded, + &veb_oes->tc_tx_packets[i], + &veb_es->tc_tx_packets[i]); +i40e_stat_update48 (hw,I40E_GLVEBTC_TBCH (i, idx), +I40E_GLVEBTC_TBCL (i, idx), + veb->stat_offsets_loaded, + &veb_oes->tc_tx_bytes[i], + &veb_es->tc_tx_bytes[i]); + } veb->stat_offsets_loaded = true; }
drivers/net/ethernet/intel/i40e/i40e_type.h +8 -0
@@ -1105,6 +1105,14 @@ struct i40e_eth_stats {u64 tx_errors;/* tepc */ }; +/* Statistics collected per VEB per TC */ +struct i40e_veb_tc_stats { +u64 tc_rx_packets[I40E_MAX_TRAFFIC_CLASS ]; +u64 tc_rx_bytes[I40E_MAX_TRAFFIC_CLASS ]; +u64 tc_tx_packets[I40E_MAX_TRAFFIC_CLASS ]; +u64 tc_tx_bytes[I40E_MAX_TRAFFIC_CLASS ]; +}; +#ifdef I40E_FCOE /* Statistics collected per function for FCoE */ struct i40e_fcoe_stats {
drivers/net/ethernet/intel/i40evf/i40e_type.h +8 -0
@@ -1095,6 +1095,14 @@ struct i40e_eth_stats {u64 tx_errors;/* tepc */ }; +/* Statistics collected per VEB per TC */ +struct i40e_veb_tc_stats { +u64 tc_rx_packets[I40E_MAX_TRAFFIC_CLASS ]; +u64 tc_rx_bytes[I40E_MAX_TRAFFIC_CLASS ]; +u64 tc_tx_packets[I40E_MAX_TRAFFIC_CLASS ]; +u64 tc_tx_bytes[I40E_MAX_TRAFFIC_CLASS ]; +}; +/* Statistics collected by the MAC */ struct i40e_hw_port_stats {/* eth stats collected by the port */
Signature · 1 line
1.9.3
PATCH 8/15 i40e: Fix comment for ethtool diagnostic link test
In reply to Catherine SullivanFrom: Greg Rose <[email protected]>
The existing comment is incorrect. Add new comment to point out that the PF reset does not affect link but if the reset is changed to a different type that does affect link then the link test would need to be moved to before the reset.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +5 -3
@@ -1626,11 +1626,13 @@ static void i40e_diag_test(struct net_device *netdev,/* indicate we're in test mode */ dev_close (netdev); else +/* This reset does not affect link - if it is +* changed to a type of reset that does affect +* link then the following link test would have +* to be moved to before the reset +*/ i40e_do_reset (pf ,BIT (__I40E_PF_RESET_REQUESTED )); -/* Link test performed before hardware reset -* so autoneg doesn't interfere with test result -*/ if (i40e_link_test (netdev, &data[I40E_ETH_TEST_LINK ])) eth_test->flags |=ETH_TEST_FL_FAILED ;
Signature · 1 line
1.9.3
PATCH 9/15 i40e: correct spelling error
In reply to Catherine SullivanFrom: Mitch Williams <[email protected]>
Turns out that 'inavlid' is an inavlid spelling for 'invalid'.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -1
@@ -2546,7 +2546,7 @@ static int i40e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,* @indir: indirection table * @key: hash key * -* Returns -EINVAL if the table specifies an inavlid queue id, otherwise +* Returns -EINVAL if the table specifies an invalid queue id, otherwise * returns 0 after programming the table. **/ static int i40e_set_rxfh(struct net_device *netdev, const u32 *indir,
Signature · 1 line
1.9.3
PATCH 10/15 i40evf: Use the correct defines to match the VF registers
In reply to Catherine SullivanFrom: Anjali Singhai Jain <[email protected]>
Use CTLN1 instead of CTLN for the VF relative register space.
--- drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 28 +++++++++--------- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 38 ++++++++++++------------- 2 files changed, 33 insertions(+), 33 deletions(-)
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +14 -14
@@ -1293,17 +1293,17 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi, old_itr = q_vector->rx.itr;i40e_set_new_dynamic_itr (&q_vector->rx);if (old_itr != q_vector->rx.itr) { - val =I40E_VFINT_DYN_CTLN_INTENA_MASK | -I40E_VFINT_DYN_CTLN_CLEARPBA_MASK | + val =I40E_VFINT_DYN_CTLN1_INTENA_MASK | +I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK | (I40E_RX_ITR << -I40E_VFINT_DYN_CTLN_ITR_INDX_SHIFT ) | +I40E_VFINT_DYN_CTLN1_ITR_INDX_SHIFT ) | (q_vector->rx.itr << -I40E_VFINT_DYN_CTLN_INTERVAL_SHIFT ); +I40E_VFINT_DYN_CTLN1_INTERVAL_SHIFT ); }else { - val =I40E_VFINT_DYN_CTLN_INTENA_MASK | -I40E_VFINT_DYN_CTLN_CLEARPBA_MASK | + val =I40E_VFINT_DYN_CTLN1_INTENA_MASK | +I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK | (I40E_ITR_NONE << -I40E_VFINT_DYN_CTLN_ITR_INDX_SHIFT ); +I40E_VFINT_DYN_CTLN1_ITR_INDX_SHIFT ); }if (!test_bit (__I40E_DOWN, &vsi->state))wr32 (hw,I40E_VFINT_DYN_CTLN1 (vector -1 ), val);
@@ -1315,18 +1315,18 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi, old_itr = q_vector->tx.itr;i40e_set_new_dynamic_itr (&q_vector->tx);if (old_itr != q_vector->tx.itr) { - val =I40E_VFINT_DYN_CTLN_INTENA_MASK | -I40E_VFINT_DYN_CTLN_CLEARPBA_MASK | + val =I40E_VFINT_DYN_CTLN1_INTENA_MASK | +I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK | (I40E_TX_ITR << -I40E_VFINT_DYN_CTLN_ITR_INDX_SHIFT ) | +I40E_VFINT_DYN_CTLN1_ITR_INDX_SHIFT ) | (q_vector->tx.itr << -I40E_VFINT_DYN_CTLN_INTERVAL_SHIFT ); +I40E_VFINT_DYN_CTLN1_INTERVAL_SHIFT ); }else { - val =I40E_VFINT_DYN_CTLN_INTENA_MASK | -I40E_VFINT_DYN_CTLN_CLEARPBA_MASK | + val =I40E_VFINT_DYN_CTLN1_INTENA_MASK | +I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK | (I40E_ITR_NONE << -I40E_VFINT_DYN_CTLN_ITR_INDX_SHIFT ); +I40E_VFINT_DYN_CTLN1_ITR_INDX_SHIFT ); }if (!test_bit (__I40E_DOWN, &vsi->state))wr32 (hw,I40E_VFINT_DYN_CTLN1 (vector -1 ), val);
drivers/net/ethernet/intel/i40evf/i40evf_main.c +19 -19
@@ -126,7 +126,7 @@ static void i40evf_misc_irq_enable(struct i40evf_adapter *adapter)wr32 (hw,I40E_VFINT_DYN_CTL01 ,I40E_VFINT_DYN_CTL01_INTENA_MASK |I40E_VFINT_DYN_CTL01_ITR_INDX_MASK ); -wr32 (hw,I40E_VFINT_ICR0_ENA1 ,I40E_VFINT_ICR0_ENA_ADMINQ_MASK ); +wr32 (hw,I40E_VFINT_ICR0_ENA1 ,I40E_VFINT_ICR0_ENA1_ADMINQ_MASK );/* read flush */ rd32 (hw,I40E_VFGEN_RSTAT );
@@ -167,7 +167,7 @@ void i40evf_irq_enable_queues(struct i40evf_adapter *adapter, u32 mask)wr32 (hw,I40E_VFINT_DYN_CTLN1 (i -1 ),I40E_VFINT_DYN_CTLN1_INTENA_MASK |I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK | -I40E_VFINT_DYN_CTLN_CLEARPBA_MASK ); +I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK ); } } }
@@ -185,17 +185,17 @@ static void i40evf_fire_sw_int(struct i40evf_adapter *adapter, u32 mask)if (mask &1 ) { dyn_ctl =rd32 (hw,I40E_VFINT_DYN_CTL01 ); - dyn_ctl |=I40E_VFINT_DYN_CTLN_SWINT_TRIG_MASK | + dyn_ctl |=I40E_VFINT_DYN_CTLN1_SWINT_TRIG_MASK |I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK | -I40E_VFINT_DYN_CTLN_CLEARPBA_MASK ; +I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK ;wr32 (hw,I40E_VFINT_DYN_CTL01 , dyn_ctl); }for (i =1 ; i < adapter->num_msix_vectors; i++) {if (mask &BIT (i)) { dyn_ctl =rd32 (hw,I40E_VFINT_DYN_CTLN1 (i -1 )); - dyn_ctl |=I40E_VFINT_DYN_CTLN_SWINT_TRIG_MASK | + dyn_ctl |=I40E_VFINT_DYN_CTLN1_SWINT_TRIG_MASK |I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK | -I40E_VFINT_DYN_CTLN_CLEARPBA_MASK ; +I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK ;wr32 (hw,I40E_VFINT_DYN_CTLN1 (i -1 ), dyn_ctl); } }
@@ -235,7 +235,7 @@ static irqreturn_t i40evf_msix_aq(int irq, void *data) val =rd32 (hw,I40E_VFINT_DYN_CTL01 ); - val = val |I40E_PFINT_DYN_CTL0_CLEARPBA_MASK ; + val = val |I40E_VFINT_DYN_CTL01_CLEARPBA_MASK ;wr32 (hw,I40E_VFINT_DYN_CTL01 , val);/* schedule work on the private workqueue */
@@ -1701,34 +1701,34 @@ static void i40evf_adminq_task(struct work_struct *work)/* check for error indications */ val =rd32 (hw, hw->aq.arq.len); oldval = val; -if (val &I40E_VF_ARQLEN_ARQVFE_MASK ) { +if (val &I40E_VF_ARQLEN1_ARQVFE_MASK ) {dev_info (&adapter->pdev->dev,"ARQ VF Error detected\n" ); - val &= ~I40E_VF_ARQLEN_ARQVFE_MASK ; + val &= ~I40E_VF_ARQLEN1_ARQVFE_MASK ; } -if (val &I40E_VF_ARQLEN_ARQOVFL_MASK ) { +if (val &I40E_VF_ARQLEN1_ARQOVFL_MASK ) {dev_info (&adapter->pdev->dev,"ARQ Overflow Error detected\n" ); - val &= ~I40E_VF_ARQLEN_ARQOVFL_MASK ; + val &= ~I40E_VF_ARQLEN1_ARQOVFL_MASK ; } -if (val &I40E_VF_ARQLEN_ARQCRIT_MASK ) { +if (val &I40E_VF_ARQLEN1_ARQCRIT_MASK ) {dev_info (&adapter->pdev->dev,"ARQ Critical Error detected\n" ); - val &= ~I40E_VF_ARQLEN_ARQCRIT_MASK ; + val &= ~I40E_VF_ARQLEN1_ARQCRIT_MASK ; }if (oldval != val)wr32 (hw, hw->aq.arq.len, val); val =rd32 (hw, hw->aq.asq.len); oldval = val; -if (val &I40E_VF_ATQLEN_ATQVFE_MASK ) { +if (val &I40E_VF_ATQLEN1_ATQVFE_MASK ) {dev_info (&adapter->pdev->dev,"ASQ VF Error detected\n" ); - val &= ~I40E_VF_ATQLEN_ATQVFE_MASK ; + val &= ~I40E_VF_ATQLEN1_ATQVFE_MASK ; } -if (val &I40E_VF_ATQLEN_ATQOVFL_MASK ) { +if (val &I40E_VF_ATQLEN1_ATQOVFL_MASK ) {dev_info (&adapter->pdev->dev,"ASQ Overflow Error detected\n" ); - val &= ~I40E_VF_ATQLEN_ATQOVFL_MASK ; + val &= ~I40E_VF_ATQLEN1_ATQOVFL_MASK ; } -if (val &I40E_VF_ATQLEN_ATQCRIT_MASK ) { +if (val &I40E_VF_ATQLEN1_ATQCRIT_MASK ) {dev_info (&adapter->pdev->dev,"ASQ Critical Error detected\n" ); - val &= ~I40E_VF_ATQLEN_ATQCRIT_MASK ; + val &= ~I40E_VF_ATQLEN1_ATQCRIT_MASK ; }if (oldval != val)wr32 (hw, hw->aq.asq.len, val);
Signature · 1 line
1.9.3
PATCH 11/15 i40evf: Remove PF specific register definitions from the VF
In reply to Catherine SullivanFrom: Anjali Singhai Jain <[email protected]>
There were quite a few issues when the wrong defines were getting used in the VF driver. This patch fixes the code where PF driver registers were getting used for VF driver, and also removes the registers that are not being used from the VF register file.
--- drivers/net/ethernet/intel/i40evf/i40e_adminq.c | 17 +- drivers/net/ethernet/intel/i40evf/i40e_common.c | 2 +- drivers/net/ethernet/intel/i40evf/i40e_register.h | 3093 --------------------- 3 files changed, 4 insertions(+), 3108 deletions(-)
drivers/net/ethernet/intel/i40evf/i40e_adminq.c +3 -14
@@ -60,17 +60,6 @@ static void i40e_adminq_init_regs(struct i40e_hw *hw) hw->aq.arq.len =I40E_VF_ARQLEN1 ; hw->aq.arq.bal =I40E_VF_ARQBAL1 ; hw->aq.arq.bah =I40E_VF_ARQBAH1 ; - }else { - hw->aq.asq.tail =I40E_PF_ATQT ; - hw->aq.asq.head =I40E_PF_ATQH ; - hw->aq.asq.len =I40E_PF_ATQLEN ; - hw->aq.asq.bal =I40E_PF_ATQBAL ; - hw->aq.asq.bah =I40E_PF_ATQBAH ; - hw->aq.arq.tail =I40E_PF_ARQT ; - hw->aq.arq.head =I40E_PF_ARQH ; - hw->aq.arq.len =I40E_PF_ARQLEN ; - hw->aq.arq.bal =I40E_PF_ARQBAL ; - hw->aq.arq.bah =I40E_PF_ARQBAH ; } }
@@ -308,7 +297,7 @@ static i40e_status i40e_config_asq_regs(struct i40e_hw *hw)/* set starting point */ wr32 (hw, hw->aq.asq.len, (hw->aq.num_asq_entries | -I40E_PF_ATQLEN_ATQENABLE_MASK )); +I40E_VF_ATQLEN1_ATQENABLE_MASK ));wr32 (hw, hw->aq.asq.bal,lower_32_bits (hw->aq.asq.desc_buf.pa));wr32 (hw, hw->aq.asq.bah,upper_32_bits (hw->aq.asq.desc_buf.pa));
@@ -337,7 +326,7 @@ static i40e_status i40e_config_arq_regs(struct i40e_hw *hw)/* set starting point */ wr32 (hw, hw->aq.arq.len, (hw->aq.num_arq_entries | -I40E_PF_ARQLEN_ARQENABLE_MASK )); +I40E_VF_ARQLEN1_ARQENABLE_MASK ));wr32 (hw, hw->aq.arq.bal,lower_32_bits (hw->aq.arq.desc_buf.pa));wr32 (hw, hw->aq.arq.bah,upper_32_bits (hw->aq.arq.desc_buf.pa));
@@ -899,7 +888,7 @@ i40e_status i40evf_clean_arq_element(struct i40e_hw *hw,mutex_lock (&hw->aq.arq_mutex);/* set next_to_use to head */ - ntu = (rd32 (hw, hw->aq.arq.head) &I40E_PF_ARQH_ARQH_MASK ); + ntu = (rd32 (hw, hw->aq.arq.head) &I40E_VF_ARQH1_ARQH_MASK );if (ntu == ntc) {/* nothing to do - shouldn't need to update ring's values */ ret_code =I40E_ERR_ADMIN_QUEUE_NO_WORK ;
drivers/net/ethernet/intel/i40evf/i40e_common.c +1 -1
@@ -361,7 +361,7 @@ bool i40evf_check_asq_alive(struct i40e_hw *hw) {if (hw->aq.asq.len)return !!(rd32 (hw, hw->aq.asq.len) & -I40E_PF_ATQLEN_ATQENABLE_MASK ); +I40E_VF_ATQLEN1_ATQENABLE_MASK );else return false; }
drivers/net/ethernet/intel/i40evf/i40e_register.h +0 -3093
2,951 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.9.3
Part of the diff is not shown here. View the raw message.
PATCH 12/15 i40e: Remove redundant and unneeded messages
In reply to Catherine SullivanFrom: Greg Rose <[email protected]>
The kernel notifies all VXLAN capable registered drivers, i.e. any driver that implements ndo_add_vxlan_port(), of the addition of a port so that the driver can track which ports are in use. There's no need to log this - it just fills the system log with useless and irksome noise.
Also, when failing to init SR-IOV interfaces the driver was printing the same message twice. Just remove the inner printk and let the outer message catch enable as well as the other failures.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 -- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 -- 2 files changed, 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +0 -2
@@ -7998,8 +7998,6 @@ static void i40e_add_vxlan_port(struct net_device *netdev, pf->vxlan_ports[next_idx] = port; pf->pending_vxlan_bitmap |=BIT_ULL (next_idx); pf->flags |=I40E_FLAG_VXLAN_FILTER_SYNC ; - -dev_info (&pf->pdev->dev,"adding vxlan port %d\n" ,ntohs (port)); }/**
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +0 -2
@@ -921,8 +921,6 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)if (pci_num_vf (pf->pdev) != num_alloc_vfs) { ret =pci_enable_sriov (pf->pdev, num_alloc_vfs);if (ret) { -dev_err (&pf->pdev->dev, -"Failed to enable SR-IOV, error %d.\n" , ret); pf->num_alloc_vfs =0 ; goto err_iov; }
Signature · 1 line
1.9.3
PATCH 13/15 i40e/i40evf: add VIRTCHNL_VF_OFFLOAD flag
In reply to Catherine SullivanFrom: Anjali Singhai Jain <[email protected]>
Add virtual channel offload capability to support RX polling mode in the VF.
--- drivers/net/ethernet/intel/i40e/i40e_register.h | 7 +++++++ drivers/net/ethernet/intel/i40e/i40e_virtchnl.h | 1 + drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 12 ++++++++++++ drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h | 1 + 4 files changed, 21 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_register.h +7 -0
@@ -873,6 +873,13 @@#define I40E_PFINT_CEQCTL_CAUSE_ENA_MASK I40E_MASK(0x1, I40E_PFINT_CEQCTL_CAUSE_ENA_SHIFT)#define I40E_PFINT_CEQCTL_INTEVENT_SHIFT 31#define I40E_PFINT_CEQCTL_INTEVENT_MASK I40E_MASK(0x1, I40E_PFINT_CEQCTL_INTEVENT_SHIFT) +#define I40E_GLINT_CTL 0x0003F800/* Reset: CORER */ +#define I40E_GLINT_CTL_DIS_AUTOMASK_PF0_SHIFT 0 +#define I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_PF0_SHIFT) +#define I40E_GLINT_CTL_DIS_AUTOMASK_VF0_SHIFT 1 +#define I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_VF0_SHIFT) +#define I40E_GLINT_CTL_DIS_AUTOMASK_N_SHIFT 2 +#define I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK I40E_MASK(0x1, I40E_GLINT_CTL_DIS_AUTOMASK_N_SHIFT)#define I40E_PFINT_DYN_CTL0 0x00038480/* Reset: PFR */ #define I40E_PFINT_DYN_CTL0_INTENA_SHIFT 0#define I40E_PFINT_DYN_CTL0_INTENA_MASK I40E_MASK(0x1, I40E_PFINT_DYN_CTL0_INTENA_SHIFT)
drivers/net/ethernet/intel/i40e/i40e_virtchnl.h +1 -0
@@ -152,6 +152,7 @@ struct i40e_virtchnl_vsi_resource {#define I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ 0x00000008#define I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG 0x00000010#define I40E_VIRTCHNL_VF_OFFLOAD_VLAN 0x00010000 +#define I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING 0x00020000struct i40e_virtchnl_vf_resource {u16 num_vsis;
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +12 -0
@@ -335,6 +335,18 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id,wr32 (hw, reg_idx, reg); } +/* if the vf is running in polling mode and using interrupt zero, +* need to disable auto-mask on enabling zero interrupt for VFs. +*/ +if ((vf->driver_caps &I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING ) && + (vector_id ==0 )) { + reg =rd32 (hw,I40E_GLINT_CTL ); +if (!(reg &I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK )) { + reg |=I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK ; +wr32 (hw,I40E_GLINT_CTL , reg); + } + } + irq_list_done:i40e_flush (hw); }
drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h +1 -0
@@ -152,6 +152,7 @@ struct i40e_virtchnl_vsi_resource {#define I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ 0x00000008#define I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG 0x00000010#define I40E_VIRTCHNL_VF_OFFLOAD_VLAN 0x00010000 +#define I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING 0x00020000struct i40e_virtchnl_vf_resource {u16 num_vsis;
Signature · 1 line
1.9.3
PATCH 14/15 i40e/i40evf: Cache the CEE TLV status returned from firmware
In reply to Catherine SullivanFrom: Neerav Parikh <[email protected]>
Store the CEE TLV status returned by firmware to allow drivers to dump that for debug purposes.
--- drivers/net/ethernet/intel/i40e/i40e_dcb.c | 4 ++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 1 + drivers/net/ethernet/intel/i40evf/i40e_type.h | 1 + 3 files changed, 6 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_dcb.c +4 -0
@@ -588,6 +588,8 @@ i40e_status i40e_get_dcb_config(struct i40e_hw *hw)if (!ret) {/* CEE mode */ hw->local_dcbx_config.dcbx_mode =I40E_DCBX_MODE_CEE ; + hw->local_dcbx_config.tlv_status = +le16_to_cpu (cee_v1_cfg.tlv_status);i40e_cee_to_dcb_v1_config (&cee_v1_cfg, &hw->local_dcbx_config); }
@@ -597,6 +599,8 @@ i40e_status i40e_get_dcb_config(struct i40e_hw *hw)if (!ret) {/* CEE mode */ hw->local_dcbx_config.dcbx_mode =I40E_DCBX_MODE_CEE ; + hw->local_dcbx_config.tlv_status = +le32_to_cpu (cee_cfg.tlv_status);i40e_cee_to_dcb_config (&cee_cfg, &hw->local_dcbx_config); }
drivers/net/ethernet/intel/i40e/i40e_type.h +1 -0
@@ -440,6 +440,7 @@ struct i40e_dcbx_config {#define I40E_DCBX_MODE_CEE 0x1#define I40E_DCBX_MODE_IEEE 0x2u32 numapps; +u32 tlv_status;/* CEE mode TLV status */ struct i40e_dcb_ets_config etscfg;struct i40e_dcb_ets_config etsrec;struct i40e_dcb_pfc_config pfc;
drivers/net/ethernet/intel/i40evf/i40e_type.h +1 -0
@@ -434,6 +434,7 @@ struct i40e_ieee_app_priority_table {struct i40e_dcbx_config {u32 numapps; +u32 tlv_status;/* CEE mode TLV status */ struct i40e_ieee_ets_config etscfg;struct i40e_ieee_ets_recommend etsrec;struct i40e_ieee_pfc_config pfc;
Signature · 1 line
1.9.3
PATCH 15/15 i40e/i40evf: Bump i40e to 1.3.9 and i40evf to 1.3.5
In reply to Catherine SullivanBump version and update the copyright year for i40evf.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -40,7 +40,7 @@ static const char i40e_driver_string[] =#define DRV_VERSION_MAJOR 1#define DRV_VERSION_MINOR 3 -#define DRV_VERSION_BUILD 6 +#define DRV_VERSION_BUILD 9#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ __stringify(DRV_VERSION_MINOR) "." \ __stringify(DRV_VERSION_BUILD) DRV_KERN
drivers/net/ethernet/intel/i40evf/i40evf_main.c +2 -2
@@ -35,10 +35,10 @@ char i40evf_driver_name[] = "i40evf";static const char i40evf_driver_string[] ="Intel(R) XL710/X710 Virtual Function Network Driver" ; -#define DRV_VERSION "1.3.2" +#define DRV_VERSION "1.3.5"const char i40evf_driver_version[] =DRV_VERSION ;static const char i40evf_copyright[] = -"Copyright (c) 2013 - 2014 Intel Corporation." ; +"Copyright (c) 2013 - 2015 Intel Corporation." ;/* i40evf_pci_tbl - PCI Device ID Table *
Signature · 1 line
1.9.3