patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] patch 'net/mlx5: fix queue rollback when starting device' has been queued to LTS release 17.11.4
@ 2018-07-27  2:33 Yongseok Koh
  2018-07-27  2:33 ` [dpdk-stable] patch 'maintainers: update for Mellanox PMDs' " Yongseok Koh
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yongseok Koh @ 2018-07-27  2:33 UTC (permalink / raw)
  To: Yongseok Koh; +Cc: dpdk stable

Hi,

FYI, your patch has been queued to LTS release 17.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/28/18. So please
shout if anyone has objections.

Thanks.

Yongseok

---
>From 997e25edbb09bb08e6289ad2b77b6e833c18287c Mon Sep 17 00:00:00 2001
From: Yongseok Koh <yskoh@mellanox.com>
Date: Mon, 23 Jul 2018 13:57:04 -0700
Subject: [PATCH] net/mlx5: fix queue rollback when starting device

[ upstream commit 24f653a7e8bff5f500894a07771dd6718966e9be ]

mlx5_rxq_start() and mlx5_rxq_stop() must be strictly paired because
internal reference counter is increased or decreased inside. Also,
mlx5_rxq_get() must be paired with mlx5_rxq_release().

Fixes: 7d6bf6b866b8 ("net/mlx5: add Multi-Packet Rx support")
Fixes: a1366b1a2be3 ("net/mlx5: add reference counter on DPDK Rx queues")
Fixes: 6e78005a9b30 ("net/mlx5: add reference counter on DPDK Tx queues")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_trigger.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 49f1c1331..9a1d6f954 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -73,7 +73,6 @@ mlx5_txq_start(struct rte_eth_dev *dev)
 	unsigned int i;
 	int ret;
 
-	/* Add memory regions to Tx queues. */
 	for (i = 0; i != priv->txqs_n; ++i) {
 		unsigned int idx = 0;
 		struct mlx5_mr *mr;
@@ -94,12 +93,17 @@ mlx5_txq_start(struct rte_eth_dev *dev)
 		}
 	}
 	ret = mlx5_tx_uar_remap(dev, priv->ctx->cmd_fd);
-	if (ret)
+	if (ret) {
+		/* Adjust index for rollback. */
+		i = priv->txqs_n - 1;
 		goto error;
+	}
 	return 0;
 error:
 	ret = rte_errno; /* Save rte_errno before cleanup. */
-	mlx5_txq_stop(dev);
+	do {
+		mlx5_txq_release(dev, i);
+	} while (i-- != 0);
 	rte_errno = ret; /* Restore rte_errno. */
 	return -rte_errno;
 }
@@ -151,7 +155,9 @@ mlx5_rxq_start(struct rte_eth_dev *dev)
 	return 0;
 error:
 	ret = rte_errno; /* Save rte_errno before cleanup. */
-	mlx5_rxq_stop(dev);
+	do {
+		mlx5_rxq_release(dev, i);
+	} while (i-- != 0);
 	rte_errno = ret; /* Restore rte_errno. */
 	return -rte_errno;
 }
@@ -174,28 +180,28 @@ mlx5_dev_start(struct rte_eth_dev *dev)
 	struct mlx5_mr *mr = NULL;
 	int ret;
 
-	dev->data->dev_started = 1;
+	DRV_LOG(DEBUG, "port %u starting device", dev->data->port_id);
 	ret = mlx5_flow_create_drop_queue(dev);
 	if (ret) {
 		DRV_LOG(ERR, "port %u drop queue allocation failed: %s",
 			dev->data->port_id, strerror(rte_errno));
 		goto error;
 	}
-	DRV_LOG(DEBUG, "port %u allocating and configuring hash Rx queues",
-		dev->data->port_id);
 	rte_mempool_walk(mlx5_mp2mr_iter, priv);
 	ret = mlx5_txq_start(dev);
 	if (ret) {
 		DRV_LOG(ERR, "port %u Tx queue allocation failed: %s",
 			dev->data->port_id, strerror(rte_errno));
-		goto error;
+		return -rte_errno;
 	}
 	ret = mlx5_rxq_start(dev);
 	if (ret) {
 		DRV_LOG(ERR, "port %u Rx queue allocation failed: %s",
 			dev->data->port_id, strerror(rte_errno));
-		goto error;
+		mlx5_txq_stop(dev);
+		return -rte_errno;
 	}
+	dev->data->dev_started = 1;
 	ret = mlx5_rx_intr_vec_enable(dev);
 	if (ret) {
 		DRV_LOG(ERR, "port %u Rx interrupt vector creation failed",
@@ -254,8 +260,7 @@ mlx5_dev_stop(struct rte_eth_dev *dev)
 	dev->tx_pkt_burst = removed_tx_burst;
 	rte_wmb();
 	usleep(1000 * priv->rxqs_n);
-	DRV_LOG(DEBUG, "port %u cleaning up and destroying hash Rx queues",
-		dev->data->port_id);
+	DRV_LOG(DEBUG, "port %u stopping device", dev->data->port_id);
 	mlx5_flow_stop(dev, &priv->flows);
 	mlx5_traffic_disable(dev);
 	mlx5_rx_intr_vec_disable(dev);
-- 
2.11.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] patch 'maintainers: update for Mellanox PMDs' has been queued to LTS release 17.11.4
  2018-07-27  2:33 [dpdk-stable] patch 'net/mlx5: fix queue rollback when starting device' has been queued to LTS release 17.11.4 Yongseok Koh
@ 2018-07-27  2:33 ` Yongseok Koh
  2018-07-27  2:33 ` [dpdk-stable] patch 'net/mlx5: fix error number handling' " Yongseok Koh
  2018-07-27  2:33 ` [dpdk-stable] patch 'net/mlx5: fix compilation for rdma-core v19' " Yongseok Koh
  2 siblings, 0 replies; 4+ messages in thread
From: Yongseok Koh @ 2018-07-27  2:33 UTC (permalink / raw)
  To: Adrien Mazarguil
  Cc: Nelio Laranjeiro, Shahaf Shuler, Matan Azrad, Yongseok Koh, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 17.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/28/18. So please
shout if anyone has objections.

Thanks.

Yongseok

---
>From dda713affdb906043714649d08f236696932e621 Mon Sep 17 00:00:00 2001
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Date: Thu, 5 Jul 2018 11:19:46 +0200
Subject: [PATCH] maintainers: update for Mellanox PMDs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit c754c7d809347e264cc305b1e389cb322e1e1ab3 ]

Shahaf and Matan volunteered to replace Nélio and myself as maintainers for
mlx4 and mlx5 PMDs. Cheers!

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 MAINTAINERS | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f0baeb423..125cc9999 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -428,14 +428,14 @@ F: drivers/net/fm10k/
 F: doc/guides/nics/features/fm10k*.ini
 
 Mellanox mlx4
-M: Adrien Mazarguil <adrien.mazarguil@6wind.com>
+M: Matan Azrad <matan@mellanox.com>
+M: Shahaf Shuler <shahafs@mellanox.com>
 F: drivers/net/mlx4/
 F: doc/guides/nics/mlx4.rst
 F: doc/guides/nics/features/mlx4.ini
 
 Mellanox mlx5
-M: Adrien Mazarguil <adrien.mazarguil@6wind.com>
-M: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
+M: Shahaf Shuler <shahafs@mellanox.com>
 M: Yongseok Koh <yskoh@mellanox.com>
 F: drivers/net/mlx5/
 F: doc/guides/nics/mlx5.rst
-- 
2.11.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] patch 'net/mlx5: fix error number handling' has been queued to LTS release 17.11.4
  2018-07-27  2:33 [dpdk-stable] patch 'net/mlx5: fix queue rollback when starting device' has been queued to LTS release 17.11.4 Yongseok Koh
  2018-07-27  2:33 ` [dpdk-stable] patch 'maintainers: update for Mellanox PMDs' " Yongseok Koh
@ 2018-07-27  2:33 ` Yongseok Koh
  2018-07-27  2:33 ` [dpdk-stable] patch 'net/mlx5: fix compilation for rdma-core v19' " Yongseok Koh
  2 siblings, 0 replies; 4+ messages in thread
From: Yongseok Koh @ 2018-07-27  2:33 UTC (permalink / raw)
  To: Yongseok Koh; +Cc: Nelio Laranjeiro, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 17.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/28/18. So please
shout if anyone has objections.

Thanks.

Yongseok

---
>From 8e47ba2b073a2cb6eb87b97e81436346f729737c Mon Sep 17 00:00:00 2001
From: Yongseok Koh <yskoh@mellanox.com>
Date: Tue, 19 Jun 2018 16:13:13 -0700
Subject: [PATCH] net/mlx5: fix error number handling

[ upstream commit 5cffc8b28dc874d04df7675abf7187c271524f70 ]

rte_errno should be saved only if error has occurred because rte_errno
could have garbage value.

Fixes: a6d83b6a9209 ("net/mlx5: standardize on negative errno values")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 57b654c35..d261ba13b 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2991,15 +2991,17 @@ wrong_flow:
 		/* The flow does not match. */
 		continue;
 	}
-	ret = rte_errno; /* Save rte_errno before cleanup. */
 	if (flow)
 		mlx5_flow_list_destroy(dev, &priv->flows, flow);
 exit:
+	if (ret)
+		ret = rte_errno; /* Save rte_errno before cleanup. */
 	for (i = 0; i != hash_rxq_init_n; ++i) {
 		if (parser.queue[i].ibv_attr)
 			rte_free(parser.queue[i].ibv_attr);
 	}
-	rte_errno = ret; /* Restore rte_errno. */
+	if (ret)
+		rte_errno = ret; /* Restore rte_errno. */
 	return -rte_errno;
 }
 
-- 
2.11.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] patch 'net/mlx5: fix compilation for rdma-core v19' has been queued to LTS release 17.11.4
  2018-07-27  2:33 [dpdk-stable] patch 'net/mlx5: fix queue rollback when starting device' has been queued to LTS release 17.11.4 Yongseok Koh
  2018-07-27  2:33 ` [dpdk-stable] patch 'maintainers: update for Mellanox PMDs' " Yongseok Koh
  2018-07-27  2:33 ` [dpdk-stable] patch 'net/mlx5: fix error number handling' " Yongseok Koh
@ 2018-07-27  2:33 ` Yongseok Koh
  2 siblings, 0 replies; 4+ messages in thread
From: Yongseok Koh @ 2018-07-27  2:33 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: Stephen Hemminger, Ferruh Yigit, Ori Kam, dpdk stable

Hi,

FYI, your patch has been queued to LTS release 17.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/28/18. So please
shout if anyone has objections.

Thanks.

Yongseok

---
>From c815929830ee0947563da3260bc9f5d62da80d9a Mon Sep 17 00:00:00 2001
From: Shahaf Shuler <shahafs@mellanox.com>
Date: Thu, 26 Jul 2018 09:00:02 +0300
Subject: [PATCH] net/mlx5: fix compilation for rdma-core v19

[ backported from upstream commit 06b1fe3f6d2121009b3b879e92b8cca25d4c0c42 ]

The flow counter support introduced by
commit 9a761de8ea14 ("net/mlx5: flow counter support") was intend to
work only with MLNX_OFED_4.2 as the upstream rdma-core
libraries were lack such support.

On rdma-core v19 the support for the flow counters was added but with
different user APIs, hence causing compilation issues on the PMD.

This patch fix the compilation errors by forcing the flow counters
to be enabled only with MLNX_OFED APIs.
Once MLNX_OFED and rdma-core APIs will be aligned, a proper patch to
support the new API will be submitted.

Fixes: 9a761de8ea14 ("net/mlx5: flow counter support")

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
 drivers/net/mlx5/Makefile    |  2 +-
 drivers/net/mlx5/mlx5_flow.c | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index a3984eb9f..6f0d51a29 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -145,7 +145,7 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
 	$Q sh -- '$<' '$@' \
 		HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT \
 		infiniband/verbs.h \
-		enum IBV_FLOW_SPEC_ACTION_COUNT \
+		type 'struct ibv_counter_set_init_attr' \
 		$(AUTOCONF_OUTPUT)
 
 # Create mlx5_autoconf.h or update it in case it differs from the new one.
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index d261ba13b..7e4b84292 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -63,12 +63,6 @@
 #define MLX5_IPV6 6
 
 #ifndef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT
-struct ibv_counter_set_init_attr {
-	int dummy;
-};
-struct ibv_flow_spec_counter_action {
-	int dummy;
-};
 struct ibv_counter_set {
 	int dummy;
 };
@@ -885,10 +879,17 @@ mlx5_flow_convert_items_validate(const struct rte_flow_item items[],
 				sizeof(struct ibv_flow_spec_action_tag);
 	}
 	if (parser->count) {
+#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT
 		unsigned int size = sizeof(struct ibv_flow_spec_counter_action);
 
 		for (i = 0; i != hash_rxq_init_n; ++i)
 			parser->queue[i].offset += size;
+#else
+		rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
+				   items,
+				   "Count action supported only on "
+				   "MLNX_OFED_4.2 and above");
+#endif
 	}
 	return 0;
 exit_item_not_supported:
-- 
2.11.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-27  2:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27  2:33 [dpdk-stable] patch 'net/mlx5: fix queue rollback when starting device' has been queued to LTS release 17.11.4 Yongseok Koh
2018-07-27  2:33 ` [dpdk-stable] patch 'maintainers: update for Mellanox PMDs' " Yongseok Koh
2018-07-27  2:33 ` [dpdk-stable] patch 'net/mlx5: fix error number handling' " Yongseok Koh
2018-07-27  2:33 ` [dpdk-stable] patch 'net/mlx5: fix compilation for rdma-core v19' " Yongseok Koh

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).