DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qiming Yang <qiming.yang@intel.com>
To: dev@dpdk.org
Cc: beilei.xing@intel.com, qi.z.zhang@intel.com,
	Qiming Yang <qiming.yang@intel.com>,
	Mingjin Ye <mingjinx.ye@intel.com>
Subject: [PATCH 3/3] net/e1000: fix Rx and Tx queue status
Date: Wed, 12 Jul 2023 07:42:15 +0000	[thread overview]
Message-ID: <20230712074215.3249336-4-qiming.yang@intel.com> (raw)
In-Reply-To: <20230712074215.3249336-1-qiming.yang@intel.com>

Igb driver don't enable queue start/stop functions, queue status is not
updated when the HW queue enabled or disabled. It caused application can't
get correct queue status.
This patch fixes the issue by updating the queue states when the queue is
disabled or enabled.

Fixes: be2d648a2dd3 ("igb: add PF support")

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
---
 drivers/net/e1000/igb_rxtx.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 25ad9eb4e5..61c6394310 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -1854,6 +1854,7 @@ igb_dev_clear_queues(struct rte_eth_dev *dev)
 		if (txq != NULL) {
 			igb_tx_queue_release_mbufs(txq);
 			igb_reset_tx_queue(txq, dev);
+			dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
 		}
 	}
 
@@ -1862,6 +1863,7 @@ igb_dev_clear_queues(struct rte_eth_dev *dev)
 		if (rxq != NULL) {
 			igb_rx_queue_release_mbufs(rxq);
 			igb_reset_rx_queue(rxq);
+			dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
 		}
 	}
 }
@@ -2442,6 +2444,7 @@ eth_igb_rx_init(struct rte_eth_dev *dev)
 		rxdctl |= ((rxq->hthresh & 0x1F) << 8);
 		rxdctl |= ((rxq->wthresh & 0x1F) << 16);
 		E1000_WRITE_REG(hw, E1000_RXDCTL(rxq->reg_idx), rxdctl);
+		dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
 	}
 
 	if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_SCATTER) {
@@ -2606,6 +2609,7 @@ eth_igb_tx_init(struct rte_eth_dev *dev)
 		txdctl |= ((txq->wthresh & 0x1F) << 16);
 		txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
 		E1000_WRITE_REG(hw, E1000_TXDCTL(txq->reg_idx), txdctl);
+		dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
 	}
 
 	/* Program the Transmit Control Register. */
-- 
2.25.1


      parent reply	other threads:[~2023-07-12  8:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12  7:42 [PATCH 0/3] fix Rx and Tx queue status get Qiming Yang
2023-07-12  7:42 ` [PATCH 1/3] net/ixgbevf: " Qiming Yang
2023-07-12  7:42 ` [PATCH 2/3] net/igc: " Qiming Yang
2023-07-12  7:42 ` Qiming Yang [this message]

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=20230712074215.3249336-4-qiming.yang@intel.com \
    --to=qiming.yang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=mingjinx.ye@intel.com \
    --cc=qi.z.zhang@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).