DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 07/13] net/sfc: move event support init to attach stage
Date: Fri, 31 Mar 2017 11:22:17 +0100	[thread overview]
Message-ID: <1490955743-9868-8-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1490955743-9868-1-git-send-email-arybchenko@solarflare.com>

Prepare to fix device reconfigure.
Device arguments should be parsed once on attach.
Management event queue should be initialized once on attach.

Fixes: 58294ee65afb ("net/sfc: support event queue")
Fixes: c22d3c508e0c ("net/sfc: support parameter to choose performance profile")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 drivers/net/sfc/sfc.c    | 17 ++++++++---------
 drivers/net/sfc/sfc_ev.c |  4 ++--
 drivers/net/sfc/sfc_ev.h |  4 ++--
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index ad3dab1..a5d4736 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -409,10 +409,6 @@ sfc_configure(struct sfc_adapter *sa)
 	if (rc != 0)
 		goto fail_intr_configure;
 
-	rc = sfc_ev_init(sa);
-	if (rc != 0)
-		goto fail_ev_init;
-
 	rc = sfc_port_init(sa);
 	if (rc != 0)
 		goto fail_port_init;
@@ -436,9 +432,6 @@ sfc_configure(struct sfc_adapter *sa)
 	sfc_port_fini(sa);
 
 fail_port_init:
-	sfc_ev_fini(sa);
-
-fail_ev_init:
 	sfc_intr_close(sa);
 
 fail_intr_configure:
@@ -461,7 +454,6 @@ sfc_close(struct sfc_adapter *sa)
 	sfc_tx_fini(sa);
 	sfc_rx_fini(sa);
 	sfc_port_fini(sa);
-	sfc_ev_fini(sa);
 	sfc_intr_close(sa);
 
 	sa->state = SFC_ADAPTER_INITIALIZED;
@@ -607,6 +599,10 @@ sfc_attach(struct sfc_adapter *sa)
 	if (rc != 0)
 		goto fail_intr_attach;
 
+	rc = sfc_ev_attach(sa);
+	if (rc != 0)
+		goto fail_ev_attach;
+
 	efx_phy_adv_cap_get(sa->nic, EFX_PHY_CAP_PERM,
 			    &sa->port.phy_adv_cap_mask);
 
@@ -630,6 +626,9 @@ sfc_attach(struct sfc_adapter *sa)
 
 fail_filter_attach:
 fail_set_rss_defaults:
+	sfc_ev_detach(sa);
+
+fail_ev_attach:
 	sfc_intr_detach(sa);
 
 fail_intr_attach:
@@ -652,7 +651,7 @@ sfc_detach(struct sfc_adapter *sa)
 	sfc_flow_fini(sa);
 
 	sfc_filter_detach(sa);
-
+	sfc_ev_detach(sa);
 	sfc_intr_detach(sa);
 
 	sa->state = SFC_ADAPTER_UNINITIALIZED;
diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c
index b007af8..26e6b2f 100644
--- a/drivers/net/sfc/sfc_ev.c
+++ b/drivers/net/sfc/sfc_ev.c
@@ -869,7 +869,7 @@ sfc_kvarg_perf_profile_handler(__rte_unused const char *key,
 }
 
 int
-sfc_ev_init(struct sfc_adapter *sa)
+sfc_ev_attach(struct sfc_adapter *sa)
 {
 	int rc;
 
@@ -908,7 +908,7 @@ sfc_ev_init(struct sfc_adapter *sa)
 }
 
 void
-sfc_ev_fini(struct sfc_adapter *sa)
+sfc_ev_detach(struct sfc_adapter *sa)
 {
 	sfc_log_init(sa, "entry");
 
diff --git a/drivers/net/sfc/sfc_ev.h b/drivers/net/sfc/sfc_ev.h
index f73201b..065defe 100644
--- a/drivers/net/sfc/sfc_ev.h
+++ b/drivers/net/sfc/sfc_ev.h
@@ -106,8 +106,8 @@ sfc_evq_index_by_txq_sw_index(struct sfc_adapter *sa, unsigned int txq_sw_index)
 	return 1 + sa->eth_dev->data->nb_rx_queues + txq_sw_index;
 }
 
-int sfc_ev_init(struct sfc_adapter *sa);
-void sfc_ev_fini(struct sfc_adapter *sa);
+int sfc_ev_attach(struct sfc_adapter *sa);
+void sfc_ev_detach(struct sfc_adapter *sa);
 int sfc_ev_start(struct sfc_adapter *sa);
 void sfc_ev_stop(struct sfc_adapter *sa);
 
-- 
2.9.3

  parent reply	other threads:[~2017-03-31 10:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 10:22 [dpdk-dev] [PATCH 00/13] net/sfc: fix device reconfigure Andrew Rybchenko
2017-03-31 10:22 ` [dpdk-dev] [PATCH 01/13] net/sfc: clarify interrupts support function names Andrew Rybchenko
2017-03-31 10:22 ` [dpdk-dev] [PATCH 02/13] net/sfc: bind EvQ DMA space to EvQ type and type-local index Andrew Rybchenko
2017-03-31 10:22 ` [dpdk-dev] [PATCH 03/13] net/sfc: remove unused max entries from EvQ info Andrew Rybchenko
2017-03-31 10:22 ` [dpdk-dev] [PATCH 04/13] net/sfc: move EvQ entries to the EvQ control structure Andrew Rybchenko
2017-03-31 10:22 ` [dpdk-dev] [PATCH 05/13] net/sfc: remove flags from EvQ info Andrew Rybchenko
2017-03-31 10:22 ` [dpdk-dev] [PATCH 06/13] net/sfc: remove EvQ info array to simplify reconfigure Andrew Rybchenko
2017-03-31 10:22 ` Andrew Rybchenko [this message]
2017-03-31 10:22 ` [dpdk-dev] [PATCH 08/13] net/sfc: initialize port data on attach Andrew Rybchenko
2017-03-31 10:22 ` [dpdk-dev] [PATCH 09/13] net/sfc: clarify Rx subsystem configure/close function names Andrew Rybchenko
2017-03-31 10:22 ` [dpdk-dev] [PATCH 10/13] net/sfc: clarify Tx " Andrew Rybchenko
2017-03-31 10:22 ` [dpdk-dev] [PATCH 11/13] net/sfc: support changing the number of receive queues Andrew Rybchenko
2017-03-31 10:22 ` [dpdk-dev] [PATCH 12/13] net/sfc: support changing the number of transmit queues Andrew Rybchenko
2017-03-31 10:22 ` [dpdk-dev] [PATCH 13/13] net/sfc: fix device reconfigure Andrew Rybchenko
2017-03-31 15:31 ` [dpdk-dev] [PATCH 00/13] " 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=1490955743-9868-8-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).