DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 03/13] net/sfc: do not use Rx queue control state on datapath
Date: Thu, 2 Mar 2017 07:07:09 +0000	[thread overview]
Message-ID: <1488438439-14776-4-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1488438439-14776-1-git-send-email-arybchenko@solarflare.com>

Rx queue flags should keep the information required on datapath.

It is a preparation to split control and data paths.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/sfc_ev.c |  5 +++--
 drivers/net/sfc/sfc_rx.c | 12 +++++++-----
 drivers/net/sfc/sfc_rx.h | 12 +++++-------
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c
index c0f2218..7f79c7e 100644
--- a/drivers/net/sfc/sfc_ev.c
+++ b/drivers/net/sfc/sfc_ev.c
@@ -99,7 +99,7 @@
 
 	SFC_ASSERT(rxq != NULL);
 	SFC_ASSERT(rxq->evq == evq);
-	SFC_ASSERT(rxq->state & SFC_RXQ_STARTED);
+	SFC_ASSERT(rxq->flags & SFC_RXQ_FLAG_STARTED);
 
 	stop = (id + 1) & rxq->ptr_mask;
 	pending_id = rxq->pending & rxq->ptr_mask;
@@ -432,7 +432,8 @@
 		struct sfc_adapter *sa = evq->sa;
 		int rc;
 
-		if ((evq->rxq != NULL) && (evq->rxq->state & SFC_RXQ_RUNNING)) {
+		if ((evq->rxq != NULL) &&
+		    (evq->rxq->flags & SFC_RXQ_FLAG_RUNNING)) {
 			unsigned int rxq_sw_index = sfc_rxq_sw_index(evq->rxq);
 
 			sfc_warn(sa,
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index e72cc3b..61654fc 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -217,7 +217,7 @@
 	boolean_t discard_next = B_FALSE;
 	struct rte_mbuf *scatter_pkt = NULL;
 
-	if (unlikely((rxq->state & SFC_RXQ_RUNNING) == 0))
+	if (unlikely((rxq->flags & SFC_RXQ_FLAG_RUNNING) == 0))
 		return 0;
 
 	sfc_ev_qpoll(rxq->evq);
@@ -318,7 +318,7 @@
 	SFC_ASSERT(sw_index < sa->rxq_count);
 	rxq = sa->rxq_info[sw_index].rxq;
 
-	if (rxq == NULL || (rxq->state & SFC_RXQ_RUNNING) == 0)
+	if (rxq == NULL || (rxq->flags & SFC_RXQ_FLAG_RUNNING) == 0)
 		return 0;
 
 	sfc_ev_qpoll(rxq->evq);
@@ -329,7 +329,7 @@
 int
 sfc_rx_qdesc_done(struct sfc_rxq *rxq, unsigned int offset)
 {
-	if ((rxq->state & SFC_RXQ_RUNNING) == 0)
+	if ((rxq->flags & SFC_RXQ_FLAG_RUNNING) == 0)
 		return 0;
 
 	sfc_ev_qpoll(rxq->evq);
@@ -434,7 +434,8 @@
 
 	rxq->pending = rxq->completed = rxq->added = rxq->pushed = 0;
 
-	rxq->state |= (SFC_RXQ_STARTED | SFC_RXQ_RUNNING);
+	rxq->state |= SFC_RXQ_STARTED;
+	rxq->flags |= SFC_RXQ_FLAG_STARTED | SFC_RXQ_FLAG_RUNNING;
 
 	sfc_rx_qrefill(rxq);
 
@@ -483,13 +484,14 @@
 	sa->eth_dev->data->rx_queue_state[sw_index] =
 		RTE_ETH_QUEUE_STATE_STOPPED;
 
-	rxq->state &= ~SFC_RXQ_RUNNING;
+	rxq->flags &= ~SFC_RXQ_FLAG_RUNNING;
 
 	if (sw_index == 0)
 		efx_mac_filter_default_rxq_clear(sa->nic);
 
 	sfc_rx_qflush(sa, sw_index);
 
+	rxq->flags &= ~SFC_RXQ_FLAG_STARTED;
 	rxq->state = SFC_RXQ_INITIALIZED;
 
 	efx_rx_qdestroy(rxq->common);
diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h
index 622d66a..881453c 100644
--- a/drivers/net/sfc/sfc_rx.h
+++ b/drivers/net/sfc/sfc_rx.h
@@ -59,8 +59,6 @@ enum sfc_rxq_state_bit {
 #define SFC_RXQ_INITIALIZED	(1 << SFC_RXQ_INITIALIZED_BIT)
 	SFC_RXQ_STARTED_BIT,
 #define SFC_RXQ_STARTED		(1 << SFC_RXQ_STARTED_BIT)
-	SFC_RXQ_RUNNING_BIT,
-#define SFC_RXQ_RUNNING		(1 << SFC_RXQ_RUNNING_BIT)
 	SFC_RXQ_FLUSHING_BIT,
 #define SFC_RXQ_FLUSHING	(1 << SFC_RXQ_FLUSHING_BIT)
 	SFC_RXQ_FLUSHED_BIT,
@@ -77,16 +75,15 @@ struct sfc_rxq {
 	/* Used on data path */
 	struct sfc_evq		*evq;
 	struct sfc_rx_sw_desc	*sw_desc;
-	unsigned int		state;
+	unsigned int		flags;
+#define SFC_RXQ_FLAG_STARTED	0x1
+#define SFC_RXQ_FLAG_RUNNING	0x2
+#define SFC_RXQ_FLAG_RSS_HASH	0x4
 	unsigned int		ptr_mask;
 	unsigned int		pending;
 	unsigned int		completed;
 	uint16_t		batch_max;
 	uint16_t		prefix_size;
-#if EFSYS_OPT_RX_SCALE
-	unsigned int		flags;
-#define SFC_RXQ_FLAG_RSS_HASH	0x1
-#endif
 
 	/* Used on refill */
 	unsigned int		added;
@@ -100,6 +97,7 @@ struct sfc_rxq {
 
 	/* Not used on data path */
 	unsigned int		hw_index;
+	unsigned int		state;
 };
 
 static inline unsigned int
-- 
1.8.2.3

  parent reply	other threads:[~2017-03-02  7:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02  7:07 [dpdk-dev] [PATCH 00/13] Improve Solarflare PMD performance Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 01/13] net/sfc: callbacks should depend on EvQ usage Andrew Rybchenko
2017-03-04 21:04   ` Ferruh Yigit
2017-03-02  7:07 ` [dpdk-dev] [PATCH 02/13] net/sfc: emphasis that RSS hash flag is an Rx queue flag Andrew Rybchenko
2017-03-02  7:07 ` Andrew Rybchenko [this message]
2017-03-02  7:07 ` [dpdk-dev] [PATCH 04/13] net/sfc: factor out libefx-based Rx datapath Andrew Rybchenko
2017-03-04 21:05   ` Ferruh Yigit
2017-03-13 13:12     ` Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 05/13] net/sfc: Rx scatter is a datapath-dependent feature Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 06/13] net/sfc: implement EF10 native Rx datapath Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 07/13] net/sfc: factory out libefx-based Tx datapath Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 08/13] net/sfc: VLAN insertion is a datapath dependent feature Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 09/13] net/sfc: TSO " Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 10/13] net/sfc: implement EF10 native Tx datapath Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 11/13] net/sfc: multi-segment support as is Tx datapath features Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 12/13] net/sfc: implement simple EF10 native Tx datapath Andrew Rybchenko
2017-03-02  7:07 ` [dpdk-dev] [PATCH 13/13] net/sfc: support Rx packed stream EF10-specific datapath Andrew Rybchenko
2017-03-04 21:07 ` [dpdk-dev] [PATCH 00/13] Improve Solarflare PMD performance Ferruh Yigit
2017-03-20 10:15 ` [dpdk-dev] [PATCH v2 " Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 01/13] net/sfc: use different callbacks for event queues Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 02/13] net/sfc: emphasis that RSS hash flag is an Rx queue flag Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 03/13] net/sfc: do not use Rx queue control state on datapath Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 04/13] net/sfc: factor out libefx-based Rx datapath Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 05/13] net/sfc: make Rx scatter a datapath-dependent feature Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 06/13] net/sfc: remove few conditions in Rx queue refill Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 07/13] net/sfc: implement EF10 native Rx datapath Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 08/13] net/sfc: factor out libefx-based Tx datapath Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 09/13] net/sfc: make VLAN insertion a datapath-dependent feature Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 10/13] net/sfc: make TSO " Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 11/13] net/sfc: implement EF10 native Tx datapath Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 12/13] net/sfc: make multi-segment support a Tx datapath feature Andrew Rybchenko
2017-03-20 10:15   ` [dpdk-dev] [PATCH v2 13/13] net/sfc: implement simple EF10 native Tx datapath Andrew Rybchenko
2017-03-20 15:37   ` [dpdk-dev] [PATCH v2 00/13] Improve Solarflare PMD performance Ferruh Yigit

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=1488438439-14776-4-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.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;
as well as URLs for NNTP newsgroup(s).