]> git.droids-corp.org - dpdk.git/commitdiff
net/sfc: fix device reconfigure
authorAndrew Rybchenko <arybchenko@solarflare.com>
Fri, 31 Mar 2017 10:22:23 +0000 (11:22 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 17:03:01 +0000 (19:03 +0200)
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")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
drivers/net/sfc/sfc.c
drivers/net/sfc/sfc.h
drivers/net/sfc/sfc_ethdev.c

index 22141c60373b6fd4acb469bed17b02e17b1251ec..4e241b22349b42a7d58164cf2f068dae44039be9 100644 (file)
@@ -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);
index cee1eb8492f3d82e4e4e37ee39ae5c087ff30fae..fad0ce0457b994cb5cd1f048dcaa37346e1238b4 100644 (file)
@@ -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                       |
index 7edb17d7e278c03188ea8a786fa628b264d96d6d..4f7b640fac5c268b14953ec71c224081b3b6d271 100644 (file)
@@ -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);