DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 11/30] net/sfc: move datapath RxQ handle to shared RxQ info
Date: Thu, 7 Feb 2019 12:17:34 +0000	[thread overview]
Message-ID: <1549541873-17403-12-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1549541873-17403-1-git-send-email-arybchenko@solarflare.com>

If datapath supports multi-process, it should be possible to get
its RxQ structure by the queue index.

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

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 7118d2293..71be88f3e 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -415,7 +415,7 @@ sfc_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 	if (rc != 0)
 		goto fail_rx_qinit;
 
-	dev->data->rx_queues[rx_queue_id] = sa->rxq_info[rx_queue_id].rxq->dp;
+	dev->data->rx_queues[rx_queue_id] = sa->rxq_info[rx_queue_id].dp;
 
 	sfc_adapter_unlock(sa);
 
@@ -1123,16 +1123,14 @@ sfc_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 	const struct sfc_adapter_priv *sap = sfc_adapter_priv_by_eth_dev(dev);
 	struct sfc_adapter *sa = dev->data->dev_private;
 	struct sfc_rxq_info *rxq_info;
-	struct sfc_rxq *rxq;
 
 	SFC_ASSERT(rx_queue_id < sa->rxq_count);
 	rxq_info = &sa->rxq_info[rx_queue_id];
-	rxq = rxq_info->rxq;
 
-	if (rxq == NULL || (rxq_info->state & SFC_RXQ_STARTED) == 0)
+	if ((rxq_info->state & SFC_RXQ_STARTED) == 0)
 		return 0;
 
-	return sap->dp_rx->qdesc_npending(rxq->dp);
+	return sap->dp_rx->qdesc_npending(rxq_info->dp);
 }
 
 static int
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index 130270dba..886a7a2fd 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -590,7 +590,7 @@ sfc_rx_qflush(struct sfc_adapter *sa, unsigned int sw_index)
 			sfc_notice(sa, "RxQ %u flushed", sw_index);
 	}
 
-	sa->priv.dp_rx->qpurge(rxq->dp);
+	sa->priv.dp_rx->qpurge(rxq_info->dp);
 }
 
 static int
@@ -704,7 +704,7 @@ sfc_rx_qstart(struct sfc_adapter *sa, unsigned int sw_index)
 
 	efx_rx_qenable(rxq->common);
 
-	rc = sa->priv.dp_rx->qstart(rxq->dp, evq->read_ptr);
+	rc = sa->priv.dp_rx->qstart(rxq_info->dp, evq->read_ptr);
 	if (rc != 0)
 		goto fail_dp_qstart;
 
@@ -723,7 +723,7 @@ sfc_rx_qstart(struct sfc_adapter *sa, unsigned int sw_index)
 	return 0;
 
 fail_mac_filter_default_rxq_set:
-	sa->priv.dp_rx->qstop(rxq->dp, &rxq->evq->read_ptr);
+	sa->priv.dp_rx->qstop(rxq_info->dp, &rxq->evq->read_ptr);
 
 fail_dp_qstart:
 	sfc_rx_qflush(sa, sw_index);
@@ -758,7 +758,7 @@ sfc_rx_qstop(struct sfc_adapter *sa, unsigned int sw_index)
 	sa->eth_dev->data->rx_queue_state[sw_index] =
 		RTE_ETH_QUEUE_STATE_STOPPED;
 
-	sa->priv.dp_rx->qstop(rxq->dp, &rxq->evq->read_ptr);
+	sa->priv.dp_rx->qstop(rxq_info->dp, &rxq->evq->read_ptr);
 
 	if (sw_index == 0)
 		efx_mac_filter_default_rxq_clear(sa->nic);
@@ -1051,11 +1051,11 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index,
 
 	rc = sa->priv.dp_rx->qcreate(sa->eth_dev->data->port_id, sw_index,
 				     &RTE_ETH_DEV_TO_PCI(sa->eth_dev)->addr,
-				     socket_id, &info, &rxq->dp);
+				     socket_id, &info, &rxq_info->dp);
 	if (rc != 0)
 		goto fail_dp_rx_qcreate;
 
-	evq->dp_rxq = rxq->dp;
+	evq->dp_rxq = rxq_info->dp;
 
 	rxq_info->state = SFC_RXQ_INITIALIZED;
 
@@ -1096,8 +1096,8 @@ sfc_rx_qfini(struct sfc_adapter *sa, unsigned int sw_index)
 	rxq = rxq_info->rxq;
 	SFC_ASSERT(rxq_info->state == SFC_RXQ_INITIALIZED);
 
-	sa->priv.dp_rx->qdestroy(rxq->dp);
-	rxq->dp = NULL;
+	sa->priv.dp_rx->qdestroy(rxq_info->dp);
+	rxq_info->dp = NULL;
 
 	rxq_info->rxq = NULL;
 	rxq_info->entries = 0;
diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h
index be64004d0..9c946d7cb 100644
--- a/drivers/net/sfc/sfc_rx.h
+++ b/drivers/net/sfc/sfc_rx.h
@@ -59,7 +59,6 @@ struct sfc_rxq {
 	efsys_mem_t		mem;
 	unsigned int		hw_index;
 	uint16_t		buf_size;
-	struct sfc_dp_rxq	*dp;
 };
 
 static inline unsigned int
@@ -124,6 +123,7 @@ struct sfc_rxq_info {
 	efx_rxq_type_t		type;
 	unsigned int		type_flags;
 	struct sfc_rxq		*rxq;
+	struct sfc_dp_rxq	*dp;
 	boolean_t		deferred_start;
 	boolean_t		deferred_started;
 	unsigned int		refill_threshold;
-- 
2.17.1

  parent reply	other threads:[~2019-02-07 12:18 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-07 12:17 [dpdk-dev] [PATCH 00/30] net/sfc: improve multi-process support Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 01/30] net/sfc: log port ID as 16-bit unsigned integer on panic Andrew Rybchenko
2019-02-08 10:13   ` Ferruh Yigit
2019-02-08 10:31     ` Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 02/30] net/sfc: remove control path logging from Rx queue count Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 03/30] net/sfc: fix logging from secondary process Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 04/30] net/sfc: avoid usage of RxQ control structure in info get Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 05/30] net/sfc: avoid usage of TxQ " Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 06/30] net/sfc: remove wrappers around Rx descriptor count and done Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 07/30] net/sfc: make it simpler to change datapath ops location Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 08/30] net/sfc: move datapath ops pointers to process private data Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 09/30] net/sfc: move main log type " Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 10/30] net/sfc: move RxQ state to multi-process shared location Andrew Rybchenko
2019-02-07 12:17 ` Andrew Rybchenko [this message]
2019-02-07 12:17 ` [dpdk-dev] [PATCH 12/30] net/sfc: support Rx descriptor status in secondary process Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 13/30] net/sfc: move TxQ state to multi-process shared location Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 14/30] net/sfc: move datapath TxQ handle to shared TxQ info Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 15/30] net/sfc: support Tx descriptor status in secondary process Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 16/30] net/sfc: support RSS RETA and hash config get in secondary Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 17/30] net/sfc: remove unnecessary functions to get RxQ index Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 18/30] net/sfc: remove unnecessary functions to get TxQ index Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 19/30] net/sfc: remove RxQ control from shared RxQ info Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 20/30] net/sfc: remove TxQ control from shared TxQ info Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 21/30] net/sfc: start to factor out multi-process shared data Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 22/30] net/sfc: move Rx/Tx datapath names to shared state Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 23/30] net/sfc: make main logging macro reusable in secondary Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 24/30] net/sfc: move RxQ shared information to adapter shared Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 25/30] net/sfc: move TxQ " Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 26/30] net/sfc: move RSS config " Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 27/30] net/sfc: move isolated flag in " Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 28/30] net/sfc: remove adapter locks from secondary process ops Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 29/30] net/sfc: separate adapter primary process and shared data Andrew Rybchenko
2019-02-07 12:17 ` [dpdk-dev] [PATCH 30/30] net/sfc: support Rx packet types get in secondary process Andrew Rybchenko
2019-02-07 15:08 ` [dpdk-dev] [PATCH 00/30] net/sfc: improve multi-process support 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=1549541873-17403-12-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).