Commit 401ce33b authored by Brett Creeley's avatar Brett Creeley Committed by Jeff Kirsher

ice: Always clear QRXFLXP_CNTXT before writing new value

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: default avatarBrett Creeley <brett.creeley@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent cf0bf41d
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <net/xdp_sock_drv.h> #include <net/xdp_sock_drv.h>
#include "ice_base.h" #include "ice_base.h"
#include "ice_lib.h"
#include "ice_dcb_lib.h" #include "ice_dcb_lib.h"
/** /**
...@@ -288,7 +289,6 @@ int ice_setup_rx_ctx(struct ice_ring *ring) ...@@ -288,7 +289,6 @@ int ice_setup_rx_ctx(struct ice_ring *ring)
u32 rxdid = ICE_RXDID_FLEX_NIC; u32 rxdid = ICE_RXDID_FLEX_NIC;
struct ice_rlan_ctx rlan_ctx; struct ice_rlan_ctx rlan_ctx;
struct ice_hw *hw; struct ice_hw *hw;
u32 regval;
u16 pf_q; u16 pf_q;
int err; int err;
...@@ -385,27 +385,16 @@ int ice_setup_rx_ctx(struct ice_ring *ring) ...@@ -385,27 +385,16 @@ int ice_setup_rx_ctx(struct ice_ring *ring)
/* Rx queue threshold in units of 64 */ /* Rx queue threshold in units of 64 */
rlan_ctx.lrxqthresh = 1; rlan_ctx.lrxqthresh = 1;
/* Enable Flexible Descriptors in the queue context which /* Enable Flexible Descriptors in the queue context which
* allows this driver to select a specific receive descriptor format * allows this driver to select a specific receive descriptor format
*/ * increasing context priority to pick up profile ID; default is 0x01;
regval = rd32(hw, QRXFLXP_CNTXT(pf_q)); * setting to 0x03 to ensure profile is programming if prev context is
if (vsi->type != ICE_VSI_VF) { * of same priority
regval |= (rxdid << QRXFLXP_CNTXT_RXDID_IDX_S) & */
QRXFLXP_CNTXT_RXDID_IDX_M; if (vsi->type != ICE_VSI_VF)
ice_write_qrxflxp_cntxt(hw, pf_q, rxdid, 0x3);
/* increasing context priority to pick up profile ID; else
* default is 0x01; setting to 0x03 to ensure profile ice_write_qrxflxp_cntxt(hw, pf_q, ICE_RXDID_LEGACY_1, 0x3);
* 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);
/* Absolute queue number out of 2K needs to be passed */ /* Absolute queue number out of 2K needs to be passed */
err = ice_write_rxq_ctx(hw, &rlan_ctx, pf_q); err = ice_write_rxq_ctx(hw, &rlan_ctx, pf_q);
......
...@@ -1595,6 +1595,32 @@ void ice_vsi_cfg_frame_size(struct ice_vsi *vsi) ...@@ -1595,6 +1595,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 * ice_vsi_cfg_rxqs - Configure the VSI for Rx
* @vsi: the VSI being configured * @vsi: the VSI being configured
......
...@@ -74,6 +74,9 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi); ...@@ -74,6 +74,9 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi);
bool ice_is_reset_in_progress(unsigned long *state); 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_put_qs(struct ice_vsi *vsi);
void ice_vsi_dis_irq(struct ice_vsi *vsi); void ice_vsi_dis_irq(struct ice_vsi *vsi);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment