All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Subject: [PATCH 13/13] net/sfc: fix device reconfigure
Date: Fri, 31 Mar 2017 11:22:23 +0100	[thread overview]
Message-ID: <1490955743-9868-14-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1490955743-9868-1-git-send-email-arybchenko@solarflare.com>

Device reconfigure should be done without close which releases
all transmit and receive queue. ethdev API assumes that previously
setup queues (minimum from configured before and now) are kept
across device reconfigure.

Fixes: aaa3f5f0f79d ("net/sfc: add configure and close stubs")

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

diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 22141c6..4e241b2 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -398,7 +398,8 @@ sfc_configure(struct sfc_adapter *sa)
 
 	SFC_ASSERT(sfc_adapter_is_locked(sa));
 
-	SFC_ASSERT(sa->state == SFC_ADAPTER_INITIALIZED);
+	SFC_ASSERT(sa->state == SFC_ADAPTER_INITIALIZED ||
+		   sa->state == SFC_ADAPTER_CONFIGURED);
 	sa->state = SFC_ADAPTER_CONFIGURING;
 
 	rc = sfc_check_conf(sa);
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index cee1eb8..fad0ce0 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -64,20 +64,20 @@ extern "C" {
  *	V			|
  * +---------------+------------+
  * |  INITIALIZED  |
- * +---------------+<-----------+
- *	|.dev_configure		|
- *	V			|
- * +---------------+		|
- * |  CONFIGURING  |------------^
- * +---------------+ failed	|
- *	|success		|
- *	|		+---------------+
- *	|		|    CLOSING    |
- *	|		+---------------+
- *	|			^
- *	V			|.dev_close
- * +---------------+------------+
- * |  CONFIGURED   |
+ * +---------------+<-----------<---------------+
+ *	|.dev_configure		|		|
+ *	V			|failed		|
+ * +---------------+------------+		|
+ * |  CONFIGURING  |				|
+ * +---------------+----+			|
+ *	|success	|			|
+ *	|		|		+---------------+
+ *	|		|		|    CLOSING    |
+ *	|		|		+---------------+
+ *	|		|			^
+ *	V		|.dev_configure		|
+ * +---------------+----+			|.dev_close
+ * |  CONFIGURED   |----------------------------+
  * +---------------+<-----------+
  *	|.dev_start		|
  *	V			|
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 7edb17d..4f7b640 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -192,8 +192,6 @@ sfc_dev_configure(struct rte_eth_dev *dev)
 	sfc_adapter_lock(sa);
 	switch (sa->state) {
 	case SFC_ADAPTER_CONFIGURED:
-		sfc_close(sa);
-		SFC_ASSERT(sa->state == SFC_ADAPTER_INITIALIZED);
 		/* FALLTHROUGH */
 	case SFC_ADAPTER_INITIALIZED:
 		rc = sfc_configure(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 [PATCH 00/13] net/sfc: fix device reconfigure Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 01/13] net/sfc: clarify interrupts support function names Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 02/13] net/sfc: bind EvQ DMA space to EvQ type and type-local index Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 03/13] net/sfc: remove unused max entries from EvQ info Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 04/13] net/sfc: move EvQ entries to the EvQ control structure Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 05/13] net/sfc: remove flags from EvQ info Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 06/13] net/sfc: remove EvQ info array to simplify reconfigure Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 07/13] net/sfc: move event support init to attach stage Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 08/13] net/sfc: initialize port data on attach Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 09/13] net/sfc: clarify Rx subsystem configure/close function names Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 10/13] net/sfc: clarify Tx " Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 11/13] net/sfc: support changing the number of receive queues Andrew Rybchenko
2017-03-31 10:22 ` [PATCH 12/13] net/sfc: support changing the number of transmit queues Andrew Rybchenko
2017-03-31 10:22 ` Andrew Rybchenko [this message]
2017-03-31 15:31 ` [PATCH 00/13] net/sfc: fix device reconfigure 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-14-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.