From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH S46 2/9] ice: Always clear QRXFLXP_CNTXT before writing new value
Date: Fri, 15 May 2020 17:54:59 -0700 [thread overview]
Message-ID: <20200516005506.5113-2-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20200516005506.5113-1-anthony.l.nguyen@intel.com>
From: Brett Creeley <brett.creeley@intel.com>
Always clear the previous value in QRXFLXP_CNTXT before writing a new
value. This will make it so re-used queues will not accidentally take the
previously configured settings.
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_base.c | 33 ++++++++---------------
drivers/net/ethernet/intel/ice/ice_lib.c | 26 ++++++++++++++++++
drivers/net/ethernet/intel/ice/ice_lib.h | 3 +++
3 files changed, 40 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c
index 798b173e81e0..04be6f2d1861 100644
--- a/drivers/net/ethernet/intel/ice/ice_base.c
+++ b/drivers/net/ethernet/intel/ice/ice_base.c
@@ -2,6 +2,7 @@
/* Copyright (c) 2019, Intel Corporation. */
#include "ice_base.h"
+#include "ice_lib.h"
#include "ice_dcb_lib.h"
/**
@@ -285,7 +286,6 @@ static int ice_setup_rx_ctx(struct ice_ring *ring)
u32 rxdid = ICE_RXDID_FLEX_NIC;
struct ice_rlan_ctx rlan_ctx;
struct ice_hw *hw;
- u32 regval;
u16 pf_q;
int err;
@@ -346,27 +346,16 @@ static int ice_setup_rx_ctx(struct ice_ring *ring)
/* Rx queue threshold in units of 64 */
rlan_ctx.lrxqthresh = 1;
- /* Enable Flexible Descriptors in the queue context which
- * allows this driver to select a specific receive descriptor format
- */
- regval = rd32(hw, QRXFLXP_CNTXT(pf_q));
- if (vsi->type != ICE_VSI_VF) {
- regval |= (rxdid << QRXFLXP_CNTXT_RXDID_IDX_S) &
- QRXFLXP_CNTXT_RXDID_IDX_M;
-
- /* increasing context priority to pick up profile ID;
- * default is 0x01; setting to 0x03 to ensure profile
- * is programming if prev context is of same priority
- */
- regval |= (0x03 << QRXFLXP_CNTXT_RXDID_PRIO_S) &
- QRXFLXP_CNTXT_RXDID_PRIO_M;
-
- } else {
- regval &= ~(QRXFLXP_CNTXT_RXDID_IDX_M |
- QRXFLXP_CNTXT_RXDID_PRIO_M |
- QRXFLXP_CNTXT_TS_M);
- }
- wr32(hw, QRXFLXP_CNTXT(pf_q), regval);
+ /* Enable Flexible Descriptors in the queue context which
+ * allows this driver to select a specific receive descriptor format
+ * increasing context priority to pick up profile ID; default is 0x01;
+ * setting to 0x03 to ensure profile is programming if prev context is
+ * of same priority
+ */
+ if (vsi->type != ICE_VSI_VF)
+ ice_write_qrxflxp_cntxt(hw, pf_q, rxdid, 0x3);
+ else
+ ice_write_qrxflxp_cntxt(hw, pf_q, ICE_RXDID_LEGACY_1, 0x3);
/* Absolute queue number out of 2K needs to be passed */
err = ice_write_rxq_ctx(hw, &rlan_ctx, pf_q);
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 7ab7408b3a05..7cd4afcade13 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -1630,6 +1630,32 @@ void ice_vsi_cfg_frame_size(struct ice_vsi *vsi)
}
}
+/**
+ * ice_write_qrxflxp_cntxt - write/configure QRXFLXP_CNTXT register
+ * @hw: HW pointer
+ * @pf_q: index of the Rx queue in the PF's queue space
+ * @rxdid: flexible descriptor RXDID
+ * @prio: priority for the RXDID for this queue
+ */
+void
+ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio)
+{
+ int regval = rd32(hw, QRXFLXP_CNTXT(pf_q));
+
+ /* clear any previous values */
+ regval &= ~(QRXFLXP_CNTXT_RXDID_IDX_M |
+ QRXFLXP_CNTXT_RXDID_PRIO_M |
+ QRXFLXP_CNTXT_TS_M);
+
+ regval |= (rxdid << QRXFLXP_CNTXT_RXDID_IDX_S) &
+ QRXFLXP_CNTXT_RXDID_IDX_M;
+
+ regval |= (prio << QRXFLXP_CNTXT_RXDID_PRIO_S) &
+ QRXFLXP_CNTXT_RXDID_PRIO_M;
+
+ wr32(hw, QRXFLXP_CNTXT(pf_q), regval);
+}
+
/**
* ice_vsi_cfg_rxqs - Configure the VSI for Rx
* @vsi: the VSI being configured
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h
index 0d11a3dbed78..9223d3e88869 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.h
+++ b/drivers/net/ethernet/intel/ice/ice_lib.h
@@ -76,6 +76,9 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi);
bool ice_is_reset_in_progress(unsigned long *state);
+void
+ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio);
+
void ice_vsi_put_qs(struct ice_vsi *vsi);
void ice_vsi_dis_irq(struct ice_vsi *vsi);
--
2.20.1
next prev parent reply other threads:[~2020-05-16 0:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-16 0:54 [Intel-wired-lan] [PATCH S46 1/9] ice: Reset VF for all port VLAN changes from host Tony Nguyen
2020-05-16 0:54 ` Tony Nguyen [this message]
2020-05-28 23:18 ` [Intel-wired-lan] [PATCH S46 2/9] ice: Always clear QRXFLXP_CNTXT before writing new value Bowers, AndrewX
2020-05-16 0:55 ` [Intel-wired-lan] [PATCH S46 3/9] ice: Fix inability to set channels when down Tony Nguyen
2020-05-28 23:18 ` Bowers, AndrewX
2020-05-16 0:55 ` [Intel-wired-lan] [PATCH S46 4/9] ice: Allow VF to request reset as soon as it's initialized Tony Nguyen
2020-05-28 23:18 ` Bowers, AndrewX
2020-05-16 0:55 ` [Intel-wired-lan] [PATCH S46 5/9] ice: fix function signature style format Tony Nguyen
2020-05-28 23:19 ` Bowers, AndrewX
2020-05-16 0:55 ` [Intel-wired-lan] [PATCH S46 6/9] ice: fix PCI device serial number to be lowercase values Tony Nguyen
2020-05-28 23:19 ` Bowers, AndrewX
2020-05-16 0:55 ` [Intel-wired-lan] [PATCH S46 7/9] ice: Use coalesce values from q_vector 0 when increasing q_vectors Tony Nguyen
2020-05-28 23:20 ` Bowers, AndrewX
2020-05-16 0:55 ` [Intel-wired-lan] [PATCH S46 8/9] ice: fix aRFS after flow director delete Tony Nguyen
2020-05-28 23:20 ` Bowers, AndrewX
2020-05-16 0:55 ` [Intel-wired-lan] [PATCH S46 9/9] ice: Ignore EMODE when setting PHY config Tony Nguyen
2020-05-28 23:21 ` Bowers, AndrewX
2020-05-28 23:17 ` [Intel-wired-lan] [PATCH S46 1/9] ice: Reset VF for all port VLAN changes from host Bowers, AndrewX
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200516005506.5113-2-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@osuosl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox