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

RSS get requests are supported in secondary process.

Prepare to make sfc_adapter primary process private data.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/sfc.c        |  2 +-
 drivers/net/sfc/sfc.h        |  4 ++--
 drivers/net/sfc/sfc_ethdev.c | 15 +++++++++------
 drivers/net/sfc/sfc_flow.c   |  6 ++++--
 drivers/net/sfc/sfc_rx.c     | 26 +++++++++++++-------------
 drivers/net/sfc/sfc_rx.h     |  3 +--
 6 files changed, 30 insertions(+), 26 deletions(-)

diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 4e4c4e445..8526a84b5 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -642,7 +642,7 @@ static const uint8_t default_rss_key[EFX_RSS_KEY_SIZE] = {
 static int
 sfc_rss_attach(struct sfc_adapter *sa)
 {
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
 	int rc;
 
 	rc = efx_intr_init(sa->nic, sa->intr.type, NULL);
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index 2c6715027..72992d68b 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -182,6 +182,8 @@ struct sfc_adapter_shared {
 	unsigned int			txq_count;
 	struct sfc_txq_info		*txq_info;
 
+	struct sfc_rss			rss;
+
 	struct rte_pci_addr		pci_addr;
 	uint16_t			port_id;
 
@@ -283,8 +285,6 @@ struct sfc_adapter {
 	boolean_t			tso;
 
 	uint32_t			rxd_wait_timeout_ns;
-
-	struct sfc_rss			rss;
 };
 
 static inline struct sfc_adapter_shared *
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 6572aa1a0..034229f37 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -85,8 +85,9 @@ static void
 sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
 	const struct sfc_adapter_priv *sap = sfc_adapter_priv_by_eth_dev(dev);
+	struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
 	struct sfc_adapter *sa = dev->data->dev_private;
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sas->rss;
 	uint64_t txq_offloads_def = 0;
 
 	sfc_log_init(sa, "entry");
@@ -1419,8 +1420,9 @@ static int
 sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 			  struct rte_eth_rss_conf *rss_conf)
 {
+	struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
 	struct sfc_adapter *sa = dev->data->dev_private;
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sas->rss;
 
 	if (rss->context_type != EFX_RX_SCALE_EXCLUSIVE)
 		return -ENOTSUP;
@@ -1433,7 +1435,7 @@ sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 	 * flags which corresponds to the active EFX configuration stored
 	 * locally in 'sfc_adapter' and kept up-to-date
 	 */
-	rss_conf->rss_hf = sfc_rx_hf_efx_to_rte(sa, rss->hash_types);
+	rss_conf->rss_hf = sfc_rx_hf_efx_to_rte(rss, rss->hash_types);
 	rss_conf->rss_key_len = EFX_RSS_KEY_SIZE;
 	if (rss_conf->rss_key != NULL)
 		rte_memcpy(rss_conf->rss_key, rss->key, EFX_RSS_KEY_SIZE);
@@ -1448,7 +1450,7 @@ sfc_dev_rss_hash_update(struct rte_eth_dev *dev,
 			struct rte_eth_rss_conf *rss_conf)
 {
 	struct sfc_adapter *sa = dev->data->dev_private;
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
 	struct sfc_port *port = &sa->port;
 	unsigned int efx_hash_types;
 	int rc = 0;
@@ -1524,8 +1526,9 @@ sfc_dev_rss_reta_query(struct rte_eth_dev *dev,
 		       struct rte_eth_rss_reta_entry64 *reta_conf,
 		       uint16_t reta_size)
 {
+	struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev);
 	struct sfc_adapter *sa = dev->data->dev_private;
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sas->rss;
 	struct sfc_port *port = &sa->port;
 	int entry;
 
@@ -1559,7 +1562,7 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev,
 			uint16_t reta_size)
 {
 	struct sfc_adapter *sa = dev->data->dev_private;
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
 	struct sfc_port *port = &sa->port;
 	unsigned int *rss_tbl_new;
 	uint16_t entry;
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index ab5f24f51..201c6cd06 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -1255,7 +1255,8 @@ sfc_flow_parse_rss(struct sfc_adapter *sa,
 		   const struct rte_flow_action_rss *action_rss,
 		   struct rte_flow *flow)
 {
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
+	struct sfc_rss *rss = &sas->rss;
 	unsigned int rxq_sw_index;
 	struct sfc_rxq *rxq;
 	unsigned int rxq_hw_index_min;
@@ -1400,7 +1401,8 @@ static int
 sfc_flow_filter_insert(struct sfc_adapter *sa,
 		       struct rte_flow *flow)
 {
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
+	struct sfc_rss *rss = &sas->rss;
 	struct sfc_flow_rss *flow_rss = &flow->rss_conf;
 	uint32_t efs_rss_context = EFX_RSS_CONTEXT_DEFAULT;
 	unsigned int i;
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index 8af9d2148..3b4b65f6e 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -618,7 +618,7 @@ sfc_rx_qflush(struct sfc_adapter *sa, unsigned int sw_index)
 static int
 sfc_rx_default_rxq_set_filter(struct sfc_adapter *sa, struct sfc_rxq *rxq)
 {
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
 	boolean_t need_rss = (rss->channels > 0) ? B_TRUE : B_FALSE;
 	struct sfc_port *port = &sa->port;
 	int rc;
@@ -961,7 +961,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index,
 	     struct rte_mempool *mb_pool)
 {
 	const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic);
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
 	int rc;
 	unsigned int rxq_entries;
 	unsigned int evq_entries;
@@ -1176,7 +1176,7 @@ sfc_rx_hash_types_mask_supp(efx_rx_hash_type_t hash_type,
 int
 sfc_rx_hash_init(struct sfc_adapter *sa)
 {
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
 	const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic);
 	uint32_t alg_mask = encp->enc_rx_scale_hash_alg_mask;
 	efx_rx_hash_alg_t alg;
@@ -1232,7 +1232,7 @@ sfc_rx_hash_init(struct sfc_adapter *sa)
 void
 sfc_rx_hash_fini(struct sfc_adapter *sa)
 {
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
 
 	rte_free(rss->hf_map);
 }
@@ -1241,7 +1241,7 @@ int
 sfc_rx_hf_rte_to_efx(struct sfc_adapter *sa, uint64_t rte,
 		     efx_rx_hash_type_t *efx)
 {
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
 	efx_rx_hash_type_t hash_types = 0;
 	unsigned int i;
 
@@ -1265,9 +1265,8 @@ sfc_rx_hf_rte_to_efx(struct sfc_adapter *sa, uint64_t rte,
 }
 
 uint64_t
-sfc_rx_hf_efx_to_rte(struct sfc_adapter *sa, efx_rx_hash_type_t efx)
+sfc_rx_hf_efx_to_rte(struct sfc_rss *rss, efx_rx_hash_type_t efx)
 {
-	struct sfc_rss *rss = &sa->rss;
 	uint64_t rte = 0;
 	unsigned int i;
 
@@ -1285,9 +1284,9 @@ static int
 sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa,
 			    struct rte_eth_rss_conf *conf)
 {
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
 	efx_rx_hash_type_t efx_hash_types = rss->hash_types;
-	uint64_t rss_hf = sfc_rx_hf_efx_to_rte(sa, efx_hash_types);
+	uint64_t rss_hf = sfc_rx_hf_efx_to_rte(rss, efx_hash_types);
 	int rc;
 
 	if (rss->context_type != EFX_RX_SCALE_EXCLUSIVE) {
@@ -1319,7 +1318,7 @@ sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa,
 static int
 sfc_rx_rss_config(struct sfc_adapter *sa)
 {
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
 	int rc = 0;
 
 	if (rss->channels > 0) {
@@ -1418,9 +1417,10 @@ sfc_rx_qinit_info(struct sfc_adapter *sa, unsigned int sw_index)
 static int
 sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
 {
+	struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
 	uint64_t offloads_supported = sfc_rx_get_dev_offload_caps(sa) |
 				      sfc_rx_get_queue_offload_caps(sa);
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sas->rss;
 	int rc = 0;
 
 	switch (rxmode->mq_mode) {
@@ -1492,7 +1492,7 @@ int
 sfc_rx_configure(struct sfc_adapter *sa)
 {
 	struct sfc_adapter_shared * const sas = sfc_sa2shared(sa);
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sas->rss;
 	struct rte_eth_conf *dev_conf = &sa->eth_dev->data->dev_conf;
 	const unsigned int nb_rx_queues = sa->eth_dev->data->nb_rx_queues;
 	int rc;
@@ -1603,7 +1603,7 @@ sfc_rx_configure(struct sfc_adapter *sa)
 void
 sfc_rx_close(struct sfc_adapter *sa)
 {
-	struct sfc_rss *rss = &sa->rss;
+	struct sfc_rss *rss = &sfc_sa2shared(sa)->rss;
 
 	sfc_rx_fini_queues(sa, 0);
 
diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h
index 73b70249c..ee1402022 100644
--- a/drivers/net/sfc/sfc_rx.h
+++ b/drivers/net/sfc/sfc_rx.h
@@ -141,8 +141,7 @@ int sfc_rx_hash_init(struct sfc_adapter *sa);
 void sfc_rx_hash_fini(struct sfc_adapter *sa);
 int sfc_rx_hf_rte_to_efx(struct sfc_adapter *sa, uint64_t rte,
 			 efx_rx_hash_type_t *efx);
-uint64_t sfc_rx_hf_efx_to_rte(struct sfc_adapter *sa,
-			      efx_rx_hash_type_t efx);
+uint64_t sfc_rx_hf_efx_to_rte(struct sfc_rss *rss, efx_rx_hash_type_t efx);
 
 #ifdef __cplusplus
 }
-- 
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 ` [dpdk-dev] [PATCH 11/30] net/sfc: move datapath RxQ handle to shared RxQ info Andrew Rybchenko
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 ` Andrew Rybchenko [this message]
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-27-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).