ice: rename misleading grst_delay variable
Subsystems (2)
Tony Nguyen
maintainerPATCH 1/13 ice: rename misleading grst_delay variable
From: Nick Nunley <[email protected]>
The grst_delay variable in ice_check_reset contains the maximum time (in 100 msec units) that the driver will wait for a reset event to transition to the Device Active state. The value is the sum of three separate components:
1) The maximum time it may take for the firmware to process its outstanding command before handling the reset request.
2) The value in RSTCTL.GRSTDEL (the delay firmware inserts between first seeing the driver reset request and the actual hardware assertion).
3) The maximum expected reset processing time in hardware.
Referring to this total time as "grst_delay" is misleading and potentially confusing to someone checking the code and cross-referencing the hardware specification.
Fix this by renaming the variable to "grst_timeout", which is more descriptive of its actual use.
--- drivers/net/ethernet/intel/ice/ice_common.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice_common.c +5 -5
@@ -1027,23 +1027,23 @@ void ice_deinit_hw(struct ice_hw *hw)*/ enum ice_status ice_check_reset (struct ice_hw *hw) { -u32 cnt, reg =0 , grst_delay, uld_mask; +u32 cnt, reg =0 , grst_timeout, uld_mask;/* Poll for Device Active state in case a recent CORER, GLOBR, * or EMPR has occurred. The grst delay value is in 100ms units. * Add 1sec for outstanding AQ commands that can take a long time. */ - grst_delay = ((rd32 (hw,GLGEN_RSTCTL ) &GLGEN_RSTCTL_GRSTDEL_M ) >> -GLGEN_RSTCTL_GRSTDEL_S ) +10 ; + grst_timeout = ((rd32 (hw,GLGEN_RSTCTL ) &GLGEN_RSTCTL_GRSTDEL_M ) >> +GLGEN_RSTCTL_GRSTDEL_S ) +10 ; -for (cnt =0 ; cnt < grst_delay; cnt++) { +for (cnt =0 ; cnt < grst_timeout; cnt++) {mdelay (100 ); reg =rd32 (hw,GLGEN_RSTAT );if (!(reg &GLGEN_RSTAT_DEVSTATE_M ))break ; } -if (cnt == grst_delay) { +if (cnt == grst_timeout) {ice_debug (hw,ICE_DBG_INIT ,"Global reset polling failed to complete.\n" );return ICE_ERR_RESET_FAILED ;
Signature · 1 line
2.20.1
Tony Nguyen
maintainerPATCH 2/13 ice: fix the vsi_id mask to be 10 bit for set_rss_lut
From: Kiran Patil <[email protected]>
set_rss_lut failed due to incorrect vsi_id mask. vsi_id is 10 bit but mask was 0x1FF whereas it should be 0x3FF.
For vsi_num >= 512, FW set_rss_lut has been failing with return code EACCESS (VSI ownership issue) because software was providing incorrect vsi_num (dropping 10th bit due to incorrect mask) for set_rss_lut admin command
--- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +1 -1
@@ -1581,7 +1581,7 @@ struct ice_aqc_get_set_rss_keys {struct ice_aqc_get_set_rss_lut {#define ICE_AQC_GSET_RSS_LUT_VSI_VALID BIT(15)#define ICE_AQC_GSET_RSS_LUT_VSI_ID_S 0 -#define ICE_AQC_GSET_RSS_LUT_VSI_ID_M (0x1FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S) +#define ICE_AQC_GSET_RSS_LUT_VSI_ID_M (0x3FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S)__le16 vsi_id;#define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S 0#define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M \
Signature · 1 line
2.20.1
Bowers
PATCH 2/13 ice: fix the vsi_id mask to be 10 bit for set_rss_lut
Quoted 18 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 02/13] ice: fix thevsi_idmask to be 10 bit forset_rss_lutFrom: Kiran Patil <[email protected]>
set_rss_lutfailed due to incorrectvsi_idmask.vsi_idis 10 bit but mask was0x1FFwhereas it should be0x3FF.For
vsi_num>= 512, FWset_rss_luthas been failing with return code EACCESS (VSI ownership issue) because software was providing incorrectvsi_num(dropping 10th bit due to incorrect mask) forset_rss_lutadmin command
Quoted 4 lines
Signed-off-by Kiran Patil <[email protected]>--- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Tony Nguyen
maintainerPATCH 3/13 ice: Fix RSS profile locks
In reply to Tony NguyenFrom: Vignesh Sridhar <[email protected]>
Replacing flow profile locks with RSS profile locks in the function to remove all RSS rules for a given VSI. This is to align the locks used for RSS rule addition to VSI and removal during VSI teardown to avoid a race condition owing to several iterations of the above operations. In function to get RSS rules for given VSI and protocol header replacing the pointer reference of the RSS entry with a copy of hash value to ensure thread safety.
--- drivers/net/ethernet/intel/ice/ice_flow.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/ice/ice_flow.c +7 -6
@@ -1187,7 +1187,7 @@ enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle)if (list_empty (&hw->fl_profs[blk]))return 0 ; -mutex_lock (&hw->fl_profs_locks[blk]); +mutex_lock (&hw->rss_locks);list_for_each_entry_safe (p, t, &hw->fl_profs[blk], l_entry)if (test_bit (vsi_handle, p->vsis)) { status =ice_flow_disassoc_prof (hw, blk, p, vsi_handle);
@@ -1195,12 +1195,12 @@ enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle)break ;if (bitmap_empty (p->vsis,ICE_MAX_VSI )) { - status =ice_flow_rem_prof_sync (hw, blk, p); + status =ice_flow_rem_prof (hw, blk, p->id);if (status)break ; } } -mutex_unlock (&hw->fl_profs_locks[blk]); +mutex_unlock (&hw->rss_locks);return status; }
@@ -1597,7 +1597,8 @@ enum ice_status ice_replay_rss_cfg(struct ice_hw *hw, u16 vsi_handle)*/ u64 ice_get_rss_cfg (struct ice_hw *hw,u16 vsi_handle,u32 hdrs) { -struct ice_rss_cfg *r, *rss_cfg =NULL ; +u64 rss_hash =ICE_HASH_INVALID ; +struct ice_rss_cfg *r;/* verify if the protocol header is non zero and VSI is valid */ if (hdrs ==ICE_FLOW_SEG_HDR_NONE || !ice_is_vsi_valid (hw, vsi_handle))
@@ -1607,10 +1608,10 @@ u64 ice_get_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u32 hdrs)list_for_each_entry (r, &hw->rss_list_head, l_entry)if (test_bit (vsi_handle, r->vsis) && r->packet_hdr == hdrs) { - rss_cfg = r; + rss_hash = r->hashed_flds;break ; }mutex_unlock (&hw->rss_locks); -return rss_cfg ? rss_cfg->hashed_flds :ICE_HASH_INVALID ; +return rss_hash; }
Signature · 1 line
2.20.1
Bowers
PATCH 3/13 ice: Fix RSS profile locks
Quoted 17 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 03/13] ice: Fix RSS profile locksFrom: Vignesh Sridhar <[email protected]>
Replacing flow profile locks with RSS profile locks in the function to remove all RSS rules for a given VSI. This is to align the locks used for RSS rule addition to VSI and removal during VSI teardown to avoid a race condition owing to several iterations of the above operations.
In function to get RSS rules for given VSI and protocol header replacing the pointer reference of the RSS entry with a copy of hash value to ensure thread safety.
Quoted 4 lines
Signed-off-by Vignesh Sridhar <[email protected]>--- drivers/net/ethernet/intel/ice/ice_flow.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
Tony Nguyen
maintainerPATCH 4/13 ice: remove page_reuse statistic
In reply to Tony NguyenFrom: Jesse Brandeburg <[email protected]>
The page reuse statistic wasn't even being displayed to the user, even though the driver counted it. Don't waste the struct space and hot-path cycles since the driver doesn't display it.
--- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 -- drivers/net/ethernet/intel/ice/ice_txrx.h | 1 - 2 files changed, 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_txrx.c +0 -2
@@ -632,7 +632,6 @@ ice_alloc_mapped_page(struct ice_ring *rx_ring, struct ice_rx_buf *bi)/* since we are recycling buffers we should seldom need to alloc */ if (likely (page)) { - rx_ring->rx_stats.page_reuse_count++;return true; }
@@ -1033,7 +1032,6 @@ static void ice_put_rx_buf(struct ice_ring *rx_ring, struct ice_rx_buf *rx_buf)if (ice_can_reuse_rx_page (rx_buf)) {/* hand second half of page back to the ring */ ice_reuse_rx_page (rx_ring, rx_buf); - rx_ring->rx_stats.page_reuse_count++; }else {/* we are not reusing the buffer so unmap it */ dma_unmap_page_attrs(rx_ring->dev, rx_buf->dma,
drivers/net/ethernet/intel/ice/ice_txrx.h +0 -1
@@ -193,7 +193,6 @@ struct ice_rxq_stats {u64 non_eop_descs;u64 alloc_page_failed;u64 alloc_buf_failed; -u64 page_reuse_count; };/* this enum matches hardware bits and is meant to be used by DYN_CTLN
Signature · 1 line
2.20.1
Bowers
PATCH 4/13 ice: remove page_reuse statistic
Quoted 13 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 04/13] ice: removepage_reusestatisticFrom: Jesse Brandeburg <[email protected]>
The page reuse statistic wasn't even being displayed to the user, even though the driver counted it. Don't waste the struct space and hot-path cycles since the driver doesn't display it.
Quoted 6 lines
Signed-off-by Jesse Brandeburg <[email protected]>Signed-off-by Tony Nguyen <[email protected]>--- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 -- drivers/net/ethernet/intel/ice/ice_txrx.h | 1 - 2 files changed, 3 deletions(-)
Tony Nguyen
maintainerPATCH 5/13 ice: add useful statistics
In reply to Tony NguyenFrom: Jesse Brandeburg <[email protected]>
Display and count some useful hot-path statistics. The usefulness is as follows:
- tx_restart: use to determine if the transmit ring size is too small or if the transmit interrupt rate is too low.
- rx_gro_dropped: use to count drops from GRO layer, which previously were completely uncounted when occurring.
- tx_busy: use to determine when the driver is miscounting number of descriptors needed for an skb.
- tx_timeout: as our other drivers, count the number of times we've reset due to timeout because the kernel only prints a warning once per netdev.
Several of these were already counted but not displayed.
--- drivers/net/ethernet/intel/ice/ice.h | 1 + drivers/net/ethernet/intel/ice/ice_ethtool.c | 4 ++++ drivers/net/ethernet/intel/ice/ice_main.c | 4 +++- drivers/net/ethernet/intel/ice/ice_txrx.h | 1 + drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 7 ++++++- 5 files changed, 15 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +1 -0
@@ -256,6 +256,7 @@ struct ice_vsi {u32 tx_busy;u32 rx_buf_failed;u32 rx_page_failed; +u32 rx_gro_dropped;u16 num_q_vectors;u16 base_vector;/* IRQ base for OS reserved vectors */ enum ice_vsi_type type;
drivers/net/ethernet/intel/ice/ice_ethtool.c +4 -0
@@ -59,8 +59,11 @@ static const struct ice_stats ice_gstrings_vsi_stats[] = {ICE_VSI_STAT ("rx_unknown_protocol" , eth_stats.rx_unknown_protocol),ICE_VSI_STAT ("rx_alloc_fail" , rx_buf_failed),ICE_VSI_STAT ("rx_pg_alloc_fail" , rx_page_failed), +ICE_VSI_STAT ("rx_gro_dropped" , rx_gro_dropped),ICE_VSI_STAT ("tx_errors" , eth_stats.tx_errors),ICE_VSI_STAT ("tx_linearize" , tx_linearize), +ICE_VSI_STAT ("tx_busy" , tx_busy), + ICE_VSI_STAT("tx_restart", tx_restart), }; enum ice_ethtool_test_id {
@@ -100,6 +103,7 @@ static const struct ice_stats ice_gstrings_pf_stats[] = {ICE_PF_STAT ("rx_broadcast.nic" , stats.eth.rx_broadcast),ICE_PF_STAT ("tx_broadcast.nic" , stats.eth.tx_broadcast),ICE_PF_STAT ("tx_errors.nic" , stats.eth.tx_errors), +ICE_PF_STAT ("tx_timeout.nic" , tx_timeout_count),ICE_PF_STAT ("rx_size_64.nic" , stats.rx_size_64),ICE_PF_STAT ("tx_size_64.nic" , stats.tx_size_64), ICE_PF_STAT("rx_size_127.nic", stats.rx_size_127),
drivers/net/ethernet/intel/ice/ice_main.c +3 -1
@@ -5290,6 +5290,7 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi) vsi->tx_linearize =0 ; vsi->rx_buf_failed =0 ; vsi->rx_page_failed =0 ; + vsi->rx_gro_dropped =0 ;rcu_read_lock ();
@@ -5304,6 +5305,7 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi) vsi_stats->rx_bytes += bytes; vsi->rx_buf_failed += ring->rx_stats.alloc_buf_failed; vsi->rx_page_failed += ring->rx_stats.alloc_page_failed; + vsi->rx_gro_dropped += ring->rx_stats.gro_dropped; }/* update XDP Tx rings counters */
@@ -5335,7 +5337,7 @@ void ice_update_vsi_stats(struct ice_vsi *vsi)ice_update_eth_stats (vsi); cur_ns->tx_errors = cur_es->tx_errors; - cur_ns->rx_dropped = cur_es->rx_discards; + cur_ns->rx_dropped = cur_es->rx_discards + vsi->rx_gro_dropped; cur_ns->tx_dropped = cur_es->tx_discards; cur_ns->multicast = cur_es->rx_multicast;
drivers/net/ethernet/intel/ice/ice_txrx.h +1 -0
@@ -193,6 +193,7 @@ struct ice_rxq_stats {u64 non_eop_descs;u64 alloc_page_failed;u64 alloc_buf_failed; +u64 gro_dropped;/* GRO returned dropped */ };/* this enum matches hardware bits and is meant to be used by DYN_CTLN
drivers/net/ethernet/intel/ice/ice_txrx_lib.c +6 -1
@@ -191,7 +191,12 @@ ice_receive_skb(struct ice_ring *rx_ring, struct sk_buff *skb, u16 vlan_tag)if ((rx_ring->netdev->features &NETIF_F_HW_VLAN_CTAG_RX ) && (vlan_tag &VLAN_VID_MASK ))__vlan_hwaccel_put_tag (skb,htons (ETH_P_8021Q ), vlan_tag); -napi_gro_receive (&rx_ring->q_vector->napi, skb); +if (napi_gro_receive (&rx_ring->q_vector->napi, skb) ==GRO_DROP ) { +/* this is tracked separately to help us debug stack drops */ + rx_ring->rx_stats.gro_dropped++; +netdev_dbg (rx_ring->netdev,"Receive Queue %d: Dropped packet from GRO\n" , + rx_ring->q_index); + } }/**
Signature · 1 line
2.20.1
Bowers
PATCH 5/13 ice: add useful statistics
Quoted 24 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 05/13] ice: add useful statisticsFrom: Jesse Brandeburg <[email protected]>
Display and count some useful hot-path statistics. The usefulness is as follows:
-
tx_restart: use to determine if the transmit ring size is too small or if the transmit interrupt rate is too low.
-rx_gro_dropped: use to count drops from GRO layer, which previously were
completely uncounted when occurring.
-tx_busy: use to determine when the driver is miscounting number of descriptors needed for an skb.
-tx_timeout: as our other drivers, count the number of times we've reset due to timeout because the kernel only prints a warning once per netdev.Several of these were already counted but not displayed.
Quoted 8 lines
Signed-off-by Jesse Brandeburg <[email protected]>--- drivers/net/ethernet/intel/ice/ice.h | 1 + drivers/net/ethernet/intel/ice/ice_ethtool.c | 4 ++++ drivers/net/ethernet/intel/ice/ice_main.c | 4 +++- drivers/net/ethernet/intel/ice/ice_txrx.h | 1 + drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 7 ++++++- 5 files changed, 15 insertions(+), 2 deletions(-)
Tony Nguyen
maintainerPATCH 6/13 ice: Clear and free XLT entries on reset
In reply to Tony NguyenFrom: Vignesh Sridhar <[email protected]>
This fix has been added to address memory leak issues resulting from triggering a sudden driver reset which does not allow us to follow our normal removal flows for SW XLT entries for advanced features.
- Adding call to destroy flow profile locks when clearing SW XLT tables.
- Extraction sequence entries were not correctly cleared previously which could cause ownership conflicts for repeated reset-replay calls.
--- drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_flex_pipe.c +3 -1
@@ -2921,6 +2921,8 @@ static void ice_free_flow_profs(struct ice_hw *hw, u8 blk_idx) ICE_FLOW_ENTRY_HNDL(e));list_del (&p->l_entry); + +mutex_destroy (&p->entries_lock);devm_kfree (ice_hw_to_dev (hw), p); }mutex_unlock (&hw->fl_profs_locks[blk_idx]);
@@ -3038,7 +3040,7 @@ void ice_clear_hw_tbls(struct ice_hw *hw)memset (prof_redir->t,0 , prof_redir->count *sizeof (*prof_redir->t)); -memset (es->t,0 , es->count *sizeof (*es->t)); +memset (es->t,0 , es->count *sizeof (*es->t) * es->fvw);memset (es->ref_count,0 , es->count *sizeof (*es->ref_count));memset (es->written,0 , es->count *sizeof (*es->written)); }
Signature · 1 line
2.20.1
Bowers
PATCH 6/13 ice: Clear and free XLT entries on reset
Quoted 16 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 06/13] ice: Clear and free XLT entries on resetFrom: Vignesh Sridhar <[email protected]>
This fix has been added to address memory leak issues resulting from triggering a sudden driver reset which does not allow us to follow our normal removal flows for SW XLT entries for advanced features.
- Adding call to destroy flow profile locks when clearing SW XLT tables.
Quoted 8 lines
- Extraction sequence entries were not correctly cleared previously which could cause ownership conflicts for repeated reset-replay calls.
Fixes 31ad4e4ee1e4 ("ice: Allocate flow profile")Signed-off-by Vignesh Sridhar <[email protected]>--- drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Tony Nguyen
maintainerPATCH 7/13 ice: Allow 2 queue pairs per VF on SR-IOV initialization
In reply to Tony NguyenFrom: Brett Creeley <[email protected]>
Currently VFs are only allowed to get 16, 4, and 1 queue pair by default, which require 17, 5, and 2 MSI-X vectors respectively. This is because each VF needs a MSI-X per data queue and a MSI-X for its other interrupt. The calculation is based on the number of VFs created, MSI-X available, and queue pairs available at the time of VF creation.
Unfortunately the values above exclude 2 queue pairs when only 3 MSI-X are available to each VF based on resource constraints. The current calculation would default to 2 MSI-X and 1 queue pair. This is a waste of resources, so fix this by allowing 2 queue pairs per VF when there are between 2 and 5 MSI-X available per VF.
--- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 2 ++ drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h | 1 + 2 files changed, 3 insertions(+)
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +2 -0
@@ -932,6 +932,8 @@ static int ice_set_per_vf_res(struct ice_pf *pf) num_msix_per_vf =ICE_NUM_VF_MSIX_MED ; }else if (msix_avail_per_vf >=ICE_NUM_VF_MSIX_SMALL ) { num_msix_per_vf =ICE_NUM_VF_MSIX_SMALL ; + }else if (msix_avail_per_vf >=ICE_NUM_VF_MSIX_MULTIQ_MIN ) { + num_msix_per_vf =ICE_NUM_VF_MSIX_MULTIQ_MIN ; }else if (msix_avail_per_vf >=ICE_MIN_INTR_PER_VF ) { num_msix_per_vf =ICE_MIN_INTR_PER_VF ; }else {
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h +1 -0
@@ -32,6 +32,7 @@#define ICE_MAX_RSS_QS_PER_VF 16#define ICE_NUM_VF_MSIX_MED 17#define ICE_NUM_VF_MSIX_SMALL 5 +#define ICE_NUM_VF_MSIX_MULTIQ_MIN 3#define ICE_MIN_INTR_PER_VF (ICE_MIN_QS_PER_VF + 1)#define ICE_MAX_VF_RESET_TRIES 40#define ICE_MAX_VF_RESET_SLEEP_MS 20
Signature · 1 line
2.20.1
Bowers
PATCH 7/13 ice: Allow 2 queue pairs per VF on SR-IOV initialization
Quoted 22 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 07/13] ice: Allow 2 queue pairs per VF on SR-IOV initializationFrom: Brett Creeley <[email protected]>
Currently VFs are only allowed to get 16, 4, and 1 queue pair by default, which require 17, 5, and 2 MSI-X vectors respectively. This is because each VF needs a MSI-X per data queue and a MSI-X for its other interrupt. The calculation is based on the number of VFs created, MSI-X available, and queue pairs available at the time of VF creation.
Unfortunately the values above exclude 2 queue pairs when only 3 MSI-X are available to each VF based on resource constraints. The current calculation would default to 2 MSI-X and 1 queue pair. This is a waste of resources, so fix this by allowing 2 queue pairs per VF when there are between 2 and 5 MSI-X available per VF.
Quoted 5 lines
Signed-off-by Brett Creeley <[email protected]>--- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 2 ++ drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h | 1 + 2 files changed, 3 insertions(+)
Tony Nguyen
maintainerPATCH 8/13 ice: port fix for chk_linearlize
In reply to Tony NguyenFrom: Kiran Patil <[email protected]>
This is a port of commit 248de22e638f ("i40e/i40evf: Account for frags split over multiple descriptors in check linearize")
As part of testing workloads (read/write) using larger IO size (128K) tx_timeout is observed and whenever it happens, it was due to tx_linearize.
--- drivers/net/ethernet/intel/ice/ice_txrx.c | 26 ++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_txrx.c +23 -3
@@ -2292,10 +2292,30 @@ static bool __ice_chk_linearize(struct sk_buff *skb)/* Walk through fragments adding latest fragment, testing it, and * then removing stale fragments from the sum. */ - stale = &skb_shinfo (skb)->frags[0 ]; -for (;;) { +for (stale = &skb_shinfo (skb)->frags[0 ];; stale++) { +int stale_size =skb_frag_size (stale); + sum +=skb_frag_size (frag++); +/* The stale fragment may present us with a smaller +* descriptor than the actual fragment size. To account +* for that we need to remove all the data on the front and +* figure out what the remainder would be in the last +* descriptor associated with the fragment. +*/ +if (stale_size >ICE_MAX_DATA_PER_TXD ) { +int align_pad = -(skb_frag_off (stale)) & + (ICE_MAX_READ_REQ_SIZE -1 ); + + sum -= align_pad; + stale_size -= align_pad; + +do { + sum -=ICE_MAX_DATA_PER_TXD_ALIGNED ; + stale_size -=ICE_MAX_DATA_PER_TXD_ALIGNED ; + }while (stale_size >ICE_MAX_DATA_PER_TXD ); + } +/* if sum is negative we failed to make sufficient progress */ if (sum <0 )return true;
@@ -2303,7 +2323,7 @@ static bool __ice_chk_linearize(struct sk_buff *skb)if (!nr_frags--)break ; - sum -=skb_frag_size (stale++); + sum -= stale_size; }return false;
Signature · 1 line
2.20.1
Bowers
PATCH 8/13 ice: port fix for chk_linearlize
Quoted 12 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 08/13] ice: port fix forchk_linearlizeFrom: Kiran Patil <[email protected]>
This is a port of commit
248de22e638f("i40e/i40evf: Account for frags split over multiple descriptors in check linearize")
Quoted 7 lines
As part of testing workloads (read/write) using larger IO size (128K)
tx_timeoutis observed and whenever it happens, it was due totx_linearize.Signed-off-by Kiran Patil <[email protected]>--- drivers/net/ethernet/intel/ice/ice_txrx.c | 26 ++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-)
Tony Nguyen
maintainerPATCH 9/13 ice: Graceful error handling in HW table calloc failure
In reply to Tony NguyenFrom: Surabhi Boob <[email protected]>
In the ice_init_hw_tbls, if the devm_kcalloc for es->written fails, catch that error and bail out gracefully, instead of continuing with a NULL pointer.
--- drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_flex_pipe.c +5 -1
@@ -3152,9 +3152,13 @@ enum ice_status ice_init_hw_tbls(struct ice_hw *hw)sizeof (*es->ref_count), GFP_KERNEL); +if (!es->ref_count) + goto err; + es->written =devm_kcalloc (ice_hw_to_dev (hw), es->count,sizeof (*es->written),GFP_KERNEL ); -if (!es->ref_count) + +if (!es->written) goto err; }return 0 ;
Signature · 1 line
2.20.1
Bowers
PATCH 9/13 ice: Graceful error handling in HW table calloc failure
Quoted 10 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 09/13] ice: Graceful error handling in HW table calloc failureFrom: Surabhi Boob <[email protected]>
Quoted 8 lines
In the
ice_init_hw_tbls, if thedevm_kcallocfores->writtenfails, catch that error and bail out gracefully, instead of continuing with a NULL pointer.Fixes 32d63fa1e9f3 ("ice: Initialize DDP package structures")Signed-off-by Surabhi Boob <[email protected]>--- drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Tony Nguyen
maintainerPATCH 10/13 ice: Disable VLAN pruning in promiscuous mode
In reply to Tony NguyenFrom: Nick Nunley <[email protected]>
Disable VLAN pruning when entering promiscuous mode, and re-enable it when exiting.
Without this VLAN-over-bridge topologies created on the device won't be functional unless rx-vlan-filter is explicitly disabled with ethtool.
--- drivers/net/ethernet/intel/ice/ice_lib.c | 7 +++++++ drivers/net/ethernet/intel/ice/ice_main.c | 3 +++ 2 files changed, 10 insertions(+)
drivers/net/ethernet/intel/ice/ice_lib.c +7 -0
@@ -2017,6 +2017,13 @@ int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc)if (!vsi)return -EINVAL ; +/* Don't enable VLAN pruning if the netdev is currently in promiscuous +* mode. VLAN pruning will be enabled when the interface exits +* promiscuous mode if any VLAN filters are active. +*/ +if (vsi->netdev && vsi->netdev->flags &IFF_PROMISC && ena) +return 0 ; + pf = vsi->back; ctxt =kzalloc (sizeof (*ctxt),GFP_KERNEL );if (!ctxt)
drivers/net/ethernet/intel/ice/ice_main.c +3 -0
@@ -369,6 +369,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi) ~IFF_PROMISC ; goto out_promisc; } +ice_cfg_vlan_pruning (vsi, false, false); } }else {/* Clear Rx filter to remove traffic from wire */
@@ -381,6 +382,8 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)IFF_PROMISC ; goto out_promisc; } +if (vsi->num_vlan >1 ) +ice_cfg_vlan_pruning (vsi, true, false); } } }
Signature · 1 line
2.20.1
Bowers
PATCH 10/13 ice: Disable VLAN pruning in promiscuous mode
Quoted 13 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 10/13] ice: Disable VLAN pruning in promiscuous modeFrom: Nick Nunley <[email protected]>
Disable VLAN pruning when entering promiscuous mode, and re-enable it when exiting.
Quoted 8 lines
Without this VLAN-over-bridge topologies created on the device won't be functional unless rx-vlan-filter is explicitly disabled with ethtool.
Signed-off-by Nick Nunley <[email protected]>--- drivers/net/ethernet/intel/ice/ice_lib.c | 7 +++++++ drivers/net/ethernet/intel/ice/ice_main.c | 3 +++ 2 files changed, 10 insertions(+)
Tony Nguyen
maintainerPATCH 11/13 ice: update PTYPE lookup table
In reply to Tony NguyenUpdate the PTYPE lookup table to reflect values that can be set by the hardware.
--- .../net/ethernet/intel/ice/ice_lan_tx_rx.h | 314 ++++++++++++++++++ 1 file changed, 314 insertions(+)
drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h +314 -0
@@ -601,6 +601,7 @@ struct ice_tlan_ctx {/* shorter macros makes the table fit but are terse */ #define ICE_RX_PTYPE_NOF ICE_RX_PTYPE_NOT_FRAG +#define ICE_RX_PTYPE_FRG ICE_RX_PTYPE_FRAG/* Lookup table mapping the HW PTYPE to the bit field for decoding */ static const struct ice_rx_ptype_decoded ice_ptype_lkup[] = {
@@ -608,6 +609,319 @@ static const struct ice_rx_ptype_decoded ice_ptype_lkup[] = {ICE_PTT_UNUSED_ENTRY (0 ),ICE_PTT (1 ,L2 ,NONE ,NOF ,NONE ,NONE ,NOF ,NONE ,PAY2 ),ICE_PTT (2 ,L2 ,NONE ,NOF ,NONE ,NONE ,NOF ,NONE ,NONE ), +ICE_PTT_UNUSED_ENTRY (3 ), +ICE_PTT_UNUSED_ENTRY (4 ), +ICE_PTT_UNUSED_ENTRY (5 ), +ICE_PTT (6 ,L2 ,NONE ,NOF ,NONE ,NONE ,NOF ,NONE ,NONE ), +ICE_PTT (7 ,L2 ,NONE ,NOF ,NONE ,NONE ,NOF ,NONE ,NONE ), +ICE_PTT_UNUSED_ENTRY (8 ), +ICE_PTT_UNUSED_ENTRY (9 ), +ICE_PTT (10 ,L2 ,NONE ,NOF ,NONE ,NONE ,NOF ,NONE ,NONE ), +ICE_PTT (11 ,L2 ,NONE ,NOF ,NONE ,NONE ,NOF ,NONE ,NONE ), +ICE_PTT_UNUSED_ENTRY (12 ), +ICE_PTT_UNUSED_ENTRY (13 ), +ICE_PTT_UNUSED_ENTRY (14 ), +ICE_PTT_UNUSED_ENTRY (15 ), +ICE_PTT_UNUSED_ENTRY (16 ), +ICE_PTT_UNUSED_ENTRY (17 ), +ICE_PTT_UNUSED_ENTRY (18 ), +ICE_PTT_UNUSED_ENTRY (19 ), +ICE_PTT_UNUSED_ENTRY (20 ), +ICE_PTT_UNUSED_ENTRY (21 ), + +/* Non Tunneled IPv4 */ +ICE_PTT (22 ,IP ,IPV4 ,FRG ,NONE ,NONE ,NOF ,NONE ,PAY3 ), +ICE_PTT (23 ,IP ,IPV4 ,NOF ,NONE ,NONE ,NOF ,NONE ,PAY3 ), +ICE_PTT (24 ,IP ,IPV4 ,NOF ,NONE ,NONE ,NOF ,UDP ,PAY4 ), +ICE_PTT_UNUSED_ENTRY (25 ), +ICE_PTT (26 ,IP ,IPV4 ,NOF ,NONE ,NONE ,NOF ,TCP ,PAY4 ), +ICE_PTT (27 ,IP ,IPV4 ,NOF ,NONE ,NONE ,NOF ,SCTP ,PAY4 ), +ICE_PTT (28 ,IP ,IPV4 ,NOF ,NONE ,NONE ,NOF ,ICMP ,PAY4 ), + +/* IPv4 --> IPv4 */ +ICE_PTT (29 ,IP ,IPV4 ,NOF ,IP_IP ,IPV4 ,FRG ,NONE ,PAY3 ), +ICE_PTT (30 ,IP ,IPV4 ,NOF ,IP_IP ,IPV4 ,NOF ,NONE ,PAY3 ), +ICE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), +ICE_PTT_UNUSED_ENTRY (163 ), +ICE_PTT_UNUSED_ENTRY (164 ), +ICE_PTT_UNUSED_ENTRY (165 ), +ICE_PTT_UNUSED_ENTRY (166 ), +ICE_PTT_UNUSED_ENTRY (167 ), +ICE_PTT_UNUSED_ENTRY (168 ), +ICE_PTT_UNUSED_ENTRY (169 ), + +ICE_PTT_UNUSED_ENTRY (170 ), +ICE_PTT_UNUSED_ENTRY (171 ), +ICE_PTT_UNUSED_ENTRY (172 ), +ICE_PTT_UNUSED_ENTRY (173 ), +ICE_PTT_UNUSED_ENTRY (174 ), +ICE_PTT_UNUSED_ENTRY (175 ), +ICE_PTT_UNUSED_ENTRY (176 ), +ICE_PTT_UNUSED_ENTRY (177 ), +ICE_PTT_UNUSED_ENTRY (178 ), +ICE_PTT_UNUSED_ENTRY (179 ), + +ICE_PTT_UNUSED_ENTRY (180 ), +ICE_PTT_UNUSED_ENTRY (181 ), +ICE_PTT_UNUSED_ENTRY (182 ), +ICE_PTT_UNUSED_ENTRY (183 ), +ICE_PTT_UNUSED_ENTRY (184 ), +ICE_PTT_UNUSED_ENTRY (185 ), +ICE_PTT_UNUSED_ENTRY (186 ), +ICE_PTT_UNUSED_ENTRY (187 ), +ICE_PTT_UNUSED_ENTRY (188 ), +ICE_PTT_UNUSED_ENTRY (189 ), + +ICE_PTT_UNUSED_ENTRY (190 ), +ICE_PTT_UNUSED_ENTRY (191 ), +ICE_PTT_UNUSED_ENTRY (192 ), +ICE_PTT_UNUSED_ENTRY (193 ), +ICE_PTT_UNUSED_ENTRY (194 ), +ICE_PTT_UNUSED_ENTRY (195 ), +ICE_PTT_UNUSED_ENTRY (196 ), +ICE_PTT_UNUSED_ENTRY (197 ), +ICE_PTT_UNUSED_ENTRY (198 ), +ICE_PTT_UNUSED_ENTRY (199 ), + +ICE_PTT_UNUSED_ENTRY (200 ), +ICE_PTT_UNUSED_ENTRY (201 ), +ICE_PTT_UNUSED_ENTRY (202 ), +ICE_PTT_UNUSED_ENTRY (203 ), +ICE_PTT_UNUSED_ENTRY (204 ), +ICE_PTT_UNUSED_ENTRY (205 ), +ICE_PTT_UNUSED_ENTRY (206 ), +ICE_PTT_UNUSED_ENTRY (207 ), +ICE_PTT_UNUSED_ENTRY (208 ), +ICE_PTT_UNUSED_ENTRY (209 ), + +ICE_PTT_UNUSED_ENTRY (210 ), +ICE_PTT_UNUSED_ENTRY (211 ), +ICE_PTT_UNUSED_ENTRY (212 ), +ICE_PTT_UNUSED_ENTRY (213 ), +ICE_PTT_UNUSED_ENTRY (214 ), +ICE_PTT_UNUSED_ENTRY (215 ), +ICE_PTT_UNUSED_ENTRY (216 ), +ICE_PTT_UNUSED_ENTRY (217 ), +ICE_PTT_UNUSED_ENTRY (218 ), +ICE_PTT_UNUSED_ENTRY (219 ), + +ICE_PTT_UNUSED_ENTRY (220 ), +ICE_PTT_UNUSED_ENTRY (221 ), +ICE_PTT_UNUSED_ENTRY (222 ), +ICE_PTT_UNUSED_ENTRY (223 ), +ICE_PTT_UNUSED_ENTRY (224 ), +ICE_PTT_UNUSED_ENTRY (225 ), +ICE_PTT_UNUSED_ENTRY (226 ), +ICE_PTT_UNUSED_ENTRY (227 ), +ICE_PTT_UNUSED_ENTRY (228 ), +ICE_PTT_UNUSED_ENTRY (229 ), + +ICE_PTT_UNUSED_ENTRY (230 ), +ICE_PTT_UNUSED_ENTRY (231 ), +ICE_PTT_UNUSED_ENTRY (232 ), +ICE_PTT_UNUSED_ENTRY (233 ), +ICE_PTT_UNUSED_ENTRY (234 ), +ICE_PTT_UNUSED_ENTRY (235 ), +ICE_PTT_UNUSED_ENTRY (236 ), +ICE_PTT_UNUSED_ENTRY (237 ), +ICE_PTT_UNUSED_ENTRY (238 ), +ICE_PTT_UNUSED_ENTRY (239 ), + +ICE_PTT_UNUSED_ENTRY (240 ), +ICE_PTT_UNUSED_ENTRY (241 ), +ICE_PTT_UNUSED_ENTRY (242 ), +ICE_PTT_UNUSED_ENTRY (243 ), +ICE_PTT_UNUSED_ENTRY (244 ), +ICE_PTT_UNUSED_ENTRY (245 ), +ICE_PTT_UNUSED_ENTRY (246 ), +ICE_PTT_UNUSED_ENTRY (247 ), +ICE_PTT_UNUSED_ENTRY (248 ), +ICE_PTT_UNUSED_ENTRY (249 ), + +ICE_PTT_UNUSED_ENTRY (250 ), +ICE_PTT_UNUSED_ENTRY (251 ), +ICE_PTT_UNUSED_ENTRY (252 ), +ICE_PTT_UNUSED_ENTRY (253 ), +ICE_PTT_UNUSED_ENTRY (254 ), + ICE_PTT_UNUSED_ENTRY(255), };static inline struct ice_rx_ptype_decoded ice_decode_rx_desc_ptype (u16 ptype)
Signature · 1 line
2.20.1
Bowers
PATCH 11/13 ice: update PTYPE lookup table
Quoted 7 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 11/13] ice: update PTYPE lookup table
Quoted 7 lines
Update the PTYPE lookup table to reflect values that can be set by the hardware.
Signed-off-by Tony Nguyen <[email protected]>--- .../net/ethernet/intel/ice/ice_lan_tx_rx.h | 314 ++++++++++++++++++ 1 file changed, 314 insertions(+)
Tony Nguyen
maintainerPATCH 12/13 ice: adjust profile id map locks
In reply to Tony NguyenFrom: Victor Raj <[email protected]>
The profile id map lock should be held till the caller completes all references of that profile entries.
The current code releases the lock right after the match search. This caused a driver issue when the profile map entries were referenced after it was freed in other thread after the lock was released earlier.
--- .../net/ethernet/intel/ice/ice_flex_pipe.c | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-)
drivers/net/ethernet/intel/ice/ice_flex_pipe.c +45 -45
@@ -3880,16 +3880,16 @@ ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, u8 ptypes[], }/** -* ice_search_prof_id_low - Search for a profile tracking ID low level +* ice_search_prof_id - Search for a profile tracking ID * @hw: pointer to the HW struct * @blk: hardware block * @id: profile tracking ID * -* This will search for a profile tracking ID which was previously added. This -* version assumes that the caller has already acquired the prof map lock. +* This will search for a profile tracking ID which was previously added. +* The profile map lock should be held before calling this function. */ static struct ice_prof_map * -ice_search_prof_id_low (struct ice_hw *hw,enum ice_block blk,u64 id) +ice_search_prof_id (struct ice_hw *hw,enum ice_block blk,u64 id) {struct ice_prof_map *entry =NULL ;struct ice_prof_map *map;
@@ -3903,26 +3903,6 @@ ice_search_prof_id_low(struct ice_hw *hw, enum ice_block blk, u64 id)return entry; } -/** -* ice_search_prof_id - Search for a profile tracking ID -* @hw: pointer to the HW struct -* @blk: hardware block -* @id: profile tracking ID -* -* This will search for a profile tracking ID which was previously added. -*/ -static struct ice_prof_map * -ice_search_prof_id (struct ice_hw *hw,enum ice_block blk,u64 id) -{ -struct ice_prof_map *entry; - -mutex_lock (&hw->blk[blk].es.prof_map_lock); - entry =ice_search_prof_id_low (hw, blk, id); -mutex_unlock (&hw->blk[blk].es.prof_map_lock); - -return entry; -} -/** * ice_vsig_prof_id_count - count profiles in a VSIG * @hw: pointer to the HW struct
@@ -4139,7 +4119,7 @@ enum ice_status ice_rem_prof(struct ice_hw *hw, enum ice_block blk, u64 id)mutex_lock (&hw->blk[blk].es.prof_map_lock); - pmap =ice_search_prof_id_low (hw, blk, id); + pmap =ice_search_prof_id (hw, blk, id);if (!pmap) { status =ICE_ERR_DOES_NOT_EXIST ; goto err_ice_rem_prof;
@@ -4172,22 +4152,28 @@ static enum ice_status ice_get_prof(struct ice_hw *hw, enum ice_block blk, u64 hdl, struct list_head *chg) { + enum ice_status status = 0;struct ice_prof_map *map;struct ice_chs_chg *p;u16 i; +mutex_lock (&hw->blk[blk].es.prof_map_lock);/* Get the details on the profile specified by the handle ID */ map =ice_search_prof_id (hw, blk, hdl); -if (!map) -return ICE_ERR_DOES_NOT_EXIST ; +if (!map) { + status =ICE_ERR_DOES_NOT_EXIST ; + goto err_ice_get_prof; + }for (i =0 ; i < map->ptg_cnt; i++)if (!hw->blk[blk].es.written[map->prof_id]) {/* add ES to change list */ p =devm_kzalloc (ice_hw_to_dev (hw),sizeof (*p),GFP_KERNEL ); -if (!p) +if (!p) { + status =ICE_ERR_NO_MEMORY ; goto err_ice_get_prof; + } p->type =ICE_PTG_ES_ADD ; p->ptype =0 ;
@@ -4202,11 +4188,10 @@ ice_get_prof(struct ice_hw *hw, enum ice_block blk, u64 hdl,list_add (&p->list_entry, chg); } -return 0 ; - err_ice_get_prof: +mutex_unlock (&hw->blk[blk].es.prof_map_lock);/* let caller clean up the change list */ -return ICE_ERR_NO_MEMORY ; +return status; }/**
@@ -4260,17 +4245,23 @@ static enum ice_status ice_add_prof_to_lst(struct ice_hw *hw, enum ice_block blk, struct list_head *lst, u64 hdl) { + enum ice_status status = 0;struct ice_prof_map *map;struct ice_vsig_prof *p;u16 i; +mutex_lock (&hw->blk[blk].es.prof_map_lock); map =ice_search_prof_id (hw, blk, hdl); -if (!map) -return ICE_ERR_DOES_NOT_EXIST ; +if (!map) { + status =ICE_ERR_DOES_NOT_EXIST ; + goto err_ice_add_prof_to_lst; + } p =devm_kzalloc (ice_hw_to_dev (hw),sizeof (*p),GFP_KERNEL ); -if (!p) -return ICE_ERR_NO_MEMORY ; +if (!p) { + status =ICE_ERR_NO_MEMORY ; + goto err_ice_add_prof_to_lst; + } p->profile_cookie = map->profile_cookie; p->prof_id = map->prof_id;
@@ -4284,7 +4275,9 @@ ice_add_prof_to_lst(struct ice_hw *hw, enum ice_block blk,list_add (&p->list, lst); -return 0 ; +err_ice_add_prof_to_lst: +mutex_unlock (&hw->blk[blk].es.prof_map_lock); +return status; }/**
@@ -4502,16 +4495,12 @@ ice_add_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl,u8 vl_msk[ICE_TCAM_KEY_VAL_SZ ] = {0xFF ,0xFF ,0xFF ,0xFF ,0xFF };u8 dc_msk[ICE_TCAM_KEY_VAL_SZ ] = {0xFF ,0xFF ,0x00 ,0x00 ,0x00 };u8 nm_msk[ICE_TCAM_KEY_VAL_SZ ] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 }; +enum ice_status status =0 ;struct ice_prof_map *map;struct ice_vsig_prof *t;struct ice_chs_chg *p;u16 vsig_idx, i; -/* Get the details on the profile specified by the handle ID */ - map =ice_search_prof_id (hw, blk, hdl); -if (!map) -return ICE_ERR_DOES_NOT_EXIST ; -/* Error, if this VSIG already has this profile */ if (ice_has_prof_vsig (hw, blk, vsig, hdl))return ICE_ERR_ALREADY_EXISTS ;
@@ -4521,19 +4510,28 @@ ice_add_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl,if (!t)return ICE_ERR_NO_MEMORY ; +mutex_lock (&hw->blk[blk].es.prof_map_lock); +/* Get the details on the profile specified by the handle ID */ + map =ice_search_prof_id (hw, blk, hdl); +if (!map) { + status =ICE_ERR_DOES_NOT_EXIST ; + goto err_ice_add_prof_id_vsig; + } + t->profile_cookie = map->profile_cookie; t->prof_id = map->prof_id; t->tcam_count = map->ptg_cnt;/* create TCAM entries */ for (i =0 ; i < map->ptg_cnt; i++) { -enum ice_status status;u16 tcam_idx;/* add TCAM to change list */ p =devm_kzalloc (ice_hw_to_dev (hw),sizeof (*p),GFP_KERNEL ); -if (!p) +if (!p) { + status =ICE_ERR_NO_MEMORY ; goto err_ice_add_prof_id_vsig; + }/* allocate the TCAM entry index */ status =ice_alloc_tcam_ent (hw, blk, &tcam_idx);
@@ -4577,12 +4575,14 @@ ice_add_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl,list_add (&t->list, &hw->blk[blk].xlt2.vsig_tbl[vsig_idx].prop_lst); -return 0 ; +mutex_unlock (&hw->blk[blk].es.prof_map_lock); +return status; err_ice_add_prof_id_vsig: +mutex_unlock (&hw->blk[blk].es.prof_map_lock);/* let caller clean up the change list */ devm_kfree (ice_hw_to_dev (hw), t); -return ICE_ERR_NO_MEMORY ; +return status; }/**
Signature · 1 line
2.20.1
Bowers
PATCH 12/13 ice: adjust profile id map locks
Quoted 12 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 12/13] ice: adjust profile id map locksFrom: Victor Raj <[email protected]>
The profile id map lock should be held till the caller completes all references of that profile entries.
Quoted 8 lines
The current code releases the lock right after the match search. This caused a driver issue when the profile map entries were referenced after it was freed in other thread after the lock was released earlier.
Signed-off-by Victor Raj <[email protected]>--- .../net/ethernet/intel/ice/ice_flex_pipe.c | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-)
Tony Nguyen
maintainerPATCH 13/13 ice: Misc minor fixes
In reply to Tony NguyenThis is a collection of minor fixes including typos, whitespace, and style. No functional changes.
--- drivers/net/ethernet/intel/ice/ice_common.c | 5 ++--- drivers/net/ethernet/intel/ice/ice_devlink.c | 2 +- drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 2 +- drivers/net/ethernet/intel/ice/ice_hw_autogen.h | 4 ++-- drivers/net/ethernet/intel/ice/ice_sched.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 7 +++---- drivers/net/ethernet/intel/ice/ice_type.h | 2 +- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_xsk.c | 2 -- 9 files changed, 14 insertions(+), 18 deletions(-)
drivers/net/ethernet/intel/ice/ice_common.c +2 -3
@@ -1718,8 +1718,7 @@ ice_alloc_hw_res(struct ice_hw *hw, u16 type, u16 num, bool btm, u16 *res)* @num: number of resources * @res: pointer to array that contains the resources to free */ -enum ice_status -ice_free_hw_res (struct ice_hw *hw,u16 type,u16 num,u16 *res) +enum ice_status ice_free_hw_res (struct ice_hw *hw,u16 type,u16 num,u16 *res) {struct ice_aqc_alloc_free_res_elem *buf;enum ice_status status;
@@ -2121,7 +2120,7 @@ ice_parse_fdir_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,* @cap_count: the number of capabilities * * Helper device to parse device (0x000B) capabilities list. For -* capabilities shared between device and device, this relies on +* capabilities shared between device and function, this relies on * ice_parse_common_caps. * * Loop through the list of provided capabilities and extract the relevant
drivers/net/ethernet/intel/ice/ice_devlink.c +1 -1
@@ -357,7 +357,7 @@ void ice_devlink_unregister(struct ice_pf *pf)* * Create and register a devlink_port for this PF. Note that although each * physical function is connected to a separate devlink instance, the port -* will still be numbered according to the physical function id. +* will still be numbered according to the physical function ID. * * Return: zero on success or an error code on failure. */
drivers/net/ethernet/intel/ice/ice_flex_pipe.c +1 -1
@@ -644,7 +644,7 @@ static bool ice_bits_max_set(const u8 *mask, u16 size, u16 max)* This function generates a key from a value, a don't care mask and a never * match mask. * upd, dc, and nm are optional parameters, and can be NULL: -* upd == NULL --> udp mask is all 1's (update all bits) +* upd == NULL --> upd mask is all 1's (update all bits) * dc == NULL --> dc mask is all 0's (no don't care bits) * nm == NULL --> nm mask is all 0's (no never match bits) */
drivers/net/ethernet/intel/ice/ice_hw_autogen.h +2 -2
@@ -57,7 +57,7 @@#define PRTDCB_GENS 0x00083020#define PRTDCB_GENS_DCBX_STATUS_S 0#define PRTDCB_GENS_DCBX_STATUS_M ICE_M(0x7, 0) -#define PRTDCB_TUP2TC 0x001D26C0/* Reset Source: CORER */ +#define PRTDCB_TUP2TC 0x001D26C0#define GL_PREEXT_L2_PMASK0 (_i) (0x0020F0FC + ((_i) * 4))#define GL_PREEXT_L2_PMASK1 (_i) (0x0020F108 + ((_i) * 4))#define GLFLXP_RXDID_FLX_WRD_0 (_i) (0x0045c800 + ((_i) * 4))
@@ -362,6 +362,7 @@#define GLV_TEPC (_VSI) (0x00312000 + ((_VSI) * 4))#define GLV_UPRCL (_i) (0x003B2000 + ((_i) * 8))#define GLV_UPTCL (_i) (0x0030A000 + ((_i) * 8)) +#define PRTRPB_RDPC 0x000AC260#define VSIQF_FD_CNT (_VSI) (0x00464000 + ((_VSI) * 4))#define VSIQF_FD_CNT_FD_GCNT_S 0#define VSIQF_FD_CNT_FD_GCNT_M ICE_M(0x3FFF, 0)
@@ -378,6 +379,5 @@#define PFPM_WUS_FW_RST_WK_M BIT(31)#define VFINT_DYN_CTLN (_i) (0x00003800 + ((_i) * 4))#define VFINT_DYN_CTLN_CLEARPBA_M BIT(1) -#define PRTRPB_RDPC 0x000AC260#endif /* _ICE_HW_AUTOGEN_H_ */
drivers/net/ethernet/intel/ice/ice_sched.c +2 -2
@@ -170,7 +170,7 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer,return ICE_ERR_PARAM ; } -/* query the current node information from FW before additing it +/* query the current node information from FW before adding it * to the SW DB */ status =ice_sched_query_elem (hw,le32_to_cpu (info->node_teid), &elem);
@@ -578,7 +578,7 @@ ice_alloc_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 new_numqs)/** * ice_aq_rl_profile - performs a rate limiting task * @hw: pointer to the HW struct -* @opcode:opcode for add, query, or remove profile(s) +* @opcode: opcode for add, query, or remove profile(s) * @num_profiles: the number of profiles * @buf: pointer to buffer * @buf_size: buffer size in bytes
drivers/net/ethernet/intel/ice/ice_txrx.c +3 -4
@@ -631,9 +631,8 @@ ice_alloc_mapped_page(struct ice_ring *rx_ring, struct ice_rx_buf *bi)dma_addr_t dma;/* since we are recycling buffers we should seldom need to alloc */ -if (likely (page)) { +if (likely (page))return true; - }/* alloc new page for storage */ page =dev_alloc_pages (ice_rx_pg_order (rx_ring));
@@ -1252,12 +1251,12 @@ int ice_clean_rx_irq(struct ice_ring *rx_ring, int budget)* @itr: ITR value to update * * Calculate how big of an increment should be applied to the ITR value passed -* in based on wmem_default, SKB overhead, Ethernet overhead, and the current +* in based on wmem_default, SKB overhead, ethernet overhead, and the current * link speed. * * The following is a calculation derived from: * wmem_default / (size + overhead) = desired_pkts_per_int -* rate / bits_per_byte / (size + Ethernet overhead) = pkt_rate +* rate / bits_per_byte / (size + ethernet overhead) = pkt_rate * (desired_pkt_rate / pkt_rate) * usecs_per_sec = ITR value * * Assuming wmem_default is 212992 and overhead is 640 bytes per
drivers/net/ethernet/intel/ice/ice_type.h +1 -1
@@ -321,7 +321,7 @@ struct ice_nvm_info {u32 flash_size;/* Size of available flash in bytes */ u8 major_ver;/* major version of NVM package */ u8 minor_ver;/* minor version of dev starter */ -u8 blank_nvm_mode;/* is NVM empty (no FW present) */ +u8 blank_nvm_mode;/* is NVM empty (no FW present) */ };struct ice_link_default_override_tlv {
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +2 -2
@@ -2973,8 +2973,8 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg) vsi->max_frame = qpi->rxq.max_pkt_size; } -/* VF can request to configure less than allocated queues -* or default allocated queues. So update the VSI with new number +/* VF can request to configure less than allocated queues or default +* allocated queues. So update the VSI with new number */ vsi->num_txq = num_txq; vsi->num_rxq = num_rxq;
drivers/net/ethernet/intel/ice/ice_xsk.c +0 -2
@@ -298,7 +298,6 @@ static void ice_xsk_remove_umem(struct ice_vsi *vsi, u16 qid) } } -/** * ice_xsk_umem_disable - disable a UMEM region * @vsi: Current VSI
@@ -594,7 +593,6 @@ int ice_clean_rx_irq_zc(struct ice_ring *rx_ring, int budget)if (!size)break ; - rx_buf = &rx_ring->rx_buf[rx_ring->next_to_clean]; rx_buf->xdp->data_end = rx_buf->xdp->data + size;xsk_buff_dma_sync_for_cpu (rx_buf->xdp);
Signature · 1 line
2.20.1
Bowers
PATCH 13/13 ice: Misc minor fixes
Quoted 11 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 13/13] ice: Misc minor fixesThis is a collection of minor fixes including typos, whitespace, and style. No functional changes.
Signed-off-by Tony Nguyen <[email protected]>
Quoted 11 lines
--- drivers/net/ethernet/intel/ice/ice_common.c | 5 ++--- drivers/net/ethernet/intel/ice/ice_devlink.c | 2 +- drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 2 +- drivers/net/ethernet/intel/ice/ice_hw_autogen.h | 4 ++-- drivers/net/ethernet/intel/ice/ice_sched.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 7 +++---- drivers/net/ethernet/intel/ice/ice_type.h | 2 +- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_xsk.c | 2 -- 9 files changed, 14 insertions(+), 18 deletions(-)
Bowers
PATCH 1/13 ice: rename misleading grst_delay variable
In reply to Tony NguyenQuoted 23 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Wednesday, July 29, 2020 5:19 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH S51 01/13] ice: rename misleadinggrst_delayvariableFrom: Nick Nunley <[email protected]>
The
grst_delayvariable inice_check_resetcontains the maximum time (in 100 msec units) that the driver will wait for a reset event to transition to the Device Active state. The value is the sum of three separate components:
1) The maximum time it may take for the firmware to process its outstanding command before handling the reset request.
2) The value in RSTCTL.GRSTDEL (the delay firmware inserts between first seeing the driver reset request and the actual hardware assertion).
3) The maximum expected reset processing time in hardware.Referring to this total time as "
grst_delay" is misleading and potentially confusing to someone checking the code and cross-referencing the hardware specification.
Quoted 7 lines
Fix this by renaming the variable to "
grst_timeout", which is more descriptive of its actual use.Signed-off-by Nick Nunley <[email protected]>--- drivers/net/ethernet/intel/ice/ice_common.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)