|
@@ -4235,8 +4235,8 @@ static void i40e_control_tx_q(struct i40e_pf *pf, int pf_q, bool enable)
|
|
|
* @is_xdp: true if the queue is used for XDP
|
|
|
* @enable: start or stop the queue
|
|
|
**/
|
|
|
-static int i40e_control_wait_tx_q(int seid, struct i40e_pf *pf, int pf_q,
|
|
|
- bool is_xdp, bool enable)
|
|
|
+int i40e_control_wait_tx_q(int seid, struct i40e_pf *pf, int pf_q,
|
|
|
+ bool is_xdp, bool enable)
|
|
|
{
|
|
|
int ret;
|
|
|
|
|
@@ -4281,7 +4281,6 @@ static int i40e_vsi_control_tx(struct i40e_vsi *vsi, bool enable)
|
|
|
if (ret)
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
@@ -4320,9 +4319,9 @@ static int i40e_pf_rxq_wait(struct i40e_pf *pf, int pf_q, bool enable)
|
|
|
* @pf_q: the PF queue to configure
|
|
|
* @enable: start or stop the queue
|
|
|
*
|
|
|
- * This function enables or disables a single queue. Note that any delay
|
|
|
- * required after the operation is expected to be handled by the caller of
|
|
|
- * this function.
|
|
|
+ * This function enables or disables a single queue. Note that
|
|
|
+ * any delay required after the operation is expected to be
|
|
|
+ * handled by the caller of this function.
|
|
|
**/
|
|
|
static void i40e_control_rx_q(struct i40e_pf *pf, int pf_q, bool enable)
|
|
|
{
|
|
@@ -4351,6 +4350,30 @@ static void i40e_control_rx_q(struct i40e_pf *pf, int pf_q, bool enable)
|
|
|
wr32(hw, I40E_QRX_ENA(pf_q), rx_reg);
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * i40e_control_wait_rx_q
|
|
|
+ * @pf: the PF structure
|
|
|
+ * @pf_q: queue being configured
|
|
|
+ * @enable: start or stop the rings
|
|
|
+ *
|
|
|
+ * This function enables or disables a single queue along with waiting
|
|
|
+ * for the change to finish. The caller of this function should handle
|
|
|
+ * the delays needed in the case of disabling queues.
|
|
|
+ **/
|
|
|
+int i40e_control_wait_rx_q(struct i40e_pf *pf, int pf_q, bool enable)
|
|
|
+{
|
|
|
+ int ret = 0;
|
|
|
+
|
|
|
+ i40e_control_rx_q(pf, pf_q, enable);
|
|
|
+
|
|
|
+ /* wait for the change to finish */
|
|
|
+ ret = i40e_pf_rxq_wait(pf, pf_q, enable);
|
|
|
+ if (ret)
|
|
|
+ return ret;
|
|
|
+
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* i40e_vsi_control_rx - Start or stop a VSI's rings
|
|
|
* @vsi: the VSI being configured
|
|
@@ -4363,10 +4386,7 @@ static int i40e_vsi_control_rx(struct i40e_vsi *vsi, bool enable)
|
|
|
|
|
|
pf_q = vsi->base_queue;
|
|
|
for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
|
|
|
- i40e_control_rx_q(pf, pf_q, enable);
|
|
|
-
|
|
|
- /* wait for the change to finish */
|
|
|
- ret = i40e_pf_rxq_wait(pf, pf_q, enable);
|
|
|
+ ret = i40e_control_wait_rx_q(pf, pf_q, enable);
|
|
|
if (ret) {
|
|
|
dev_info(&pf->pdev->dev,
|
|
|
"VSI seid %d Rx ring %d %sable timeout\n",
|