Skip to contentSkip to conversation

net/mlx5: cleanups

PATCH Superseded Nelio Laranjeiro 2 participants 25 messages Aug 1, 2017 – Aug 23, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

cover net/mlx5: cleanups

This Series make some cleanup in mlx5 PMD by removing useless code or non working code.

This series apply on top of:
[PATCH 0/5] net/mlx5: enable/disable vPMD and some cleanups
Specifically on patch: net/mlx5: cleanup Rx ring in free functions

http://dpdk.org/dev/patchwork/patch/27303/

Nelio Laranjeiro (5):
net/mlx5: remove flow drop useless if branches net/mlx5: remove pdentic pragma
net/mlx5: fix non working secondary process by removing it net/mlx5: remove multiple drop RSS queues net/mlx5: remove old MLNX_OFED 3.3 verification

 drivers/net/mlx5/Makefile            |   5 -
 drivers/net/mlx5/mlx5.c              |  40 +-------
 drivers/net/mlx5/mlx5.h              |  21 -----
 drivers/net/mlx5/mlx5_ethdev.c       | 173 +----------------------------------
 drivers/net/mlx5/mlx5_fdir.c         |   7 --
 drivers/net/mlx5/mlx5_flow.c         |  59 ++++--------
 drivers/net/mlx5/mlx5_mac.c          |   7 --
 drivers/net/mlx5/mlx5_mr.c           |   7 --
 drivers/net/mlx5/mlx5_rss.c          |   7 --
 drivers/net/mlx5/mlx5_rxmode.c       |   7 --
 drivers/net/mlx5/mlx5_rxq.c          |  48 ----------
 drivers/net/mlx5/mlx5_rxtx.c         |   7 --
 drivers/net/mlx5/mlx5_rxtx.h         |   9 --
 drivers/net/mlx5/mlx5_rxtx_vec_sse.c |   7 --
 drivers/net/mlx5/mlx5_stats.c        |   7 --
 drivers/net/mlx5/mlx5_trigger.c      |   7 --
 drivers/net/mlx5/mlx5_txq.c          |  48 ----------
 drivers/net/mlx5/mlx5_vlan.c         |   7 --
 18 files changed, 21 insertions(+), 452 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/5 net/mlx5: remove flow drop useless if branches

Those two if statements are useless as there is a verification on the drop field of the flow to jump to the end of the function just above.

---
 drivers/net/mlx5/mlx5_flow.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/net/mlx5/mlx5_flow.c +0 -4
index 86be929..d62ccff 100644
@@ -1279,10 +1279,6 @@ priv_flow_destroy(struct priv *priv,
 		claim_zero(ibv_destroy_qp(flow->qp));
 	if (flow->ind_table)
 		claim_zero(ibv_exp_destroy_rwq_ind_table(flow->ind_table));
-	if (flow->drop && flow->wq)
-		claim_zero(ibv_exp_destroy_wq(flow->wq));
-	if (flow->drop && flow->cq)
-		claim_zero(ibv_destroy_cq(flow->cq));
 	if (flow->mark) {
 		struct rte_flow *tmp;
 		struct rxq *rxq;
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/5 net/mlx5: remove pdentic pragma

In reply to Nelio Laranjeiro

Those are useless since DPDK headers have been cleaned up.

---
 drivers/net/mlx5/mlx5.c              | 7 -------
 drivers/net/mlx5/mlx5.h              | 7 -------
 drivers/net/mlx5/mlx5_ethdev.c       | 7 -------
 drivers/net/mlx5/mlx5_fdir.c         | 7 -------
 drivers/net/mlx5/mlx5_mac.c          | 7 -------
 drivers/net/mlx5/mlx5_mr.c           | 7 -------
 drivers/net/mlx5/mlx5_rss.c          | 7 -------
 drivers/net/mlx5/mlx5_rxmode.c       | 7 -------
 drivers/net/mlx5/mlx5_rxq.c          | 7 -------
 drivers/net/mlx5/mlx5_rxtx.c         | 7 -------
 drivers/net/mlx5/mlx5_rxtx.h         | 7 -------
 drivers/net/mlx5/mlx5_rxtx_vec_sse.c | 7 -------
 drivers/net/mlx5/mlx5_stats.c        | 7 -------
 drivers/net/mlx5/mlx5_trigger.c      | 7 -------
 drivers/net/mlx5/mlx5_txq.c          | 7 -------
 drivers/net/mlx5/mlx5_vlan.c         | 7 -------
 16 files changed, 112 deletions(-)
drivers/net/mlx5/mlx5.c +0 -7
index b7e5046..bfcff70 100644
@@ -50,19 +50,12 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_pci.h>
 #include <rte_pci.h>
 #include <rte_common.h>
 #include <rte_kvargs.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_utils.h"
drivers/net/mlx5/mlx5.h +0 -7
index 43c5384..31d0c49 100644
@@ -50,10 +50,6 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_pci.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
@@ -61,9 +57,6 @@
 #include <rte_interrupts.h>
 #include <rte_errno.h>
 #include <rte_flow.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5_utils.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_ethdev.c +0 -7
index ad5b28a..36872b5 100644
@@ -50,10 +50,6 @@
 #include <linux/version.h>
 #include <fcntl.h>
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_atomic.h>
 #include <rte_ethdev.h>
 #include <rte_mbuf.h>
@@ -61,9 +57,6 @@
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_malloc.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_fdir.c +0 -7
index 34a7e69..ad256e4 100644
@@ -47,19 +47,12 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ether.h>
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
 #include <rte_common.h>
 #include <rte_flow.h>
 #include <rte_flow_driver.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_mac.c +0 -7
index 8489ea6..45d23e4 100644
@@ -51,16 +51,9 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_common.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_utils.h"
drivers/net/mlx5/mlx5_mr.c +0 -7
index 2873351..9593830 100644
@@ -41,14 +41,7 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mempool.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_rss.c +0 -7
index a2dd7d1..1249943 100644
@@ -47,15 +47,8 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_rxmode.c +0 -7
index a67e542..4a51e47 100644
@@ -45,14 +45,7 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ethdev.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_rxq.c +0 -7
index 68dce04..2ea7a35 100644
@@ -50,19 +50,12 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
 #include <rte_common.h>
 #include <rte_interrupts.h>
 #include <rte_debug.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_rxtx.c +0 -7
index 83101f6..59d9ce0 100644
@@ -48,19 +48,12 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mbuf.h>
 #include <rte_mempool.h>
 #include <rte_prefetch.h>
 #include <rte_common.h>
 #include <rte_branch_prediction.h>
 #include <rte_ether.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_utils.h"
drivers/net/mlx5/mlx5_rxtx.h +0 -7
index 300d097..baf2b25 100644
@@ -48,16 +48,9 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mbuf.h>
 #include <rte_mempool.h>
 #include <rte_common.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5_utils.h"
 #include "mlx5.h"
drivers/net/mlx5/mlx5_rxtx_vec_sse.c +0 -7
index 3339ac1..290d6cf 100644
@@ -49,16 +49,9 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mbuf.h>
 #include <rte_mempool.h>
 #include <rte_prefetch.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_utils.h"
drivers/net/mlx5/mlx5_stats.c +0 -7
index 703f48c..7b45c8c 100644
@@ -34,16 +34,9 @@
 #include <linux/sockios.h>
 #include <linux/ethtool.h>
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ethdev.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_trigger.c +0 -7
index 595a9e0..3fa9401 100644
@@ -31,17 +31,10 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_txq.c +0 -7
index 98aaa7c..45e9037 100644
@@ -47,17 +47,10 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
 #include <rte_common.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5_utils.h"
 #include "mlx5_defs.h"
drivers/net/mlx5/mlx5_vlan.c +0 -7
index 1b0fa40..353ae49 100644
@@ -36,15 +36,8 @@
 #include <assert.h>
 #include <stdint.h>
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ethdev.h>
 #include <rte_common.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5_utils.h"
 #include "mlx5.h"
Signature · 1 line
2.1.4
#5 lore raw

PATCH 3/5 net/mlx5: fix non working secondary process by removing it

In reply to Nelio Laranjeiro

Secondary process is a copy/paste of the mlx4 drivers, it was never tested and it even segfault at the secondary process start in the mlx5_pci_probe().

This makes more sense to wipe this non working feature to re-write a working and functional version.

Fixes a48deada651b ("mlx5: allow operation in secondary processes")
---
 drivers/net/mlx5/mlx5.c        |  33 +-------
 drivers/net/mlx5/mlx5.h        |   9 ---
 drivers/net/mlx5/mlx5_ethdev.c | 166 +----------------------------------------
 drivers/net/mlx5/mlx5_rxq.c    |  41 ----------
 drivers/net/mlx5/mlx5_rxtx.h   |   2 -
 drivers/net/mlx5/mlx5_txq.c    |  41 ----------
 6 files changed, 4 insertions(+), 288 deletions(-)
drivers/net/mlx5/mlx5.c +2 -31
index bfcff70..bd66a7c 100644
@@ -771,37 +771,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 			err = ENOMEM;
 			goto port_error;
 		}
-
-		/* Secondary processes have to use local storage for their
-		 * private data as well as a copy of eth_dev->data, but this
-		 * pointer must not be modified before burst functions are
-		 * actually called. */
-		if (mlx5_is_secondary()) {
-			struct mlx5_secondary_data *sd =
-				&mlx5_secondary_data[eth_dev->data->port_id];
-			sd->primary_priv = eth_dev->data->dev_private;
-			if (sd->primary_priv == NULL) {
-				ERROR("no private data for port %u",
-						eth_dev->data->port_id);
-				err = EINVAL;
-				goto port_error;
-			}
-			sd->shared_dev_data = eth_dev->data;
-			rte_spinlock_init(&sd->lock);
-			memcpy(sd->data.name, sd->shared_dev_data->name,
-				   sizeof(sd->data.name));
-			sd->data.dev_private = priv;
-			sd->data.rx_mbuf_alloc_failed = 0;
-			sd->data.mtu = ETHER_MTU;
-			sd->data.port_id = sd->shared_dev_data->port_id;
-			sd->data.mac_addrs = priv->mac;
-			eth_dev->tx_pkt_burst = mlx5_tx_burst_secondary_setup;
-			eth_dev->rx_pkt_burst = mlx5_rx_burst_secondary_setup;
-		} else {
-			eth_dev->data->dev_private = priv;
-			eth_dev->data->mac_addrs = priv->mac;
-		}
-
+		eth_dev->data->dev_private = priv;
+		eth_dev->data->mac_addrs = priv->mac;
 		eth_dev->device = &pci_dev->device;
 		rte_eth_copy_pci_info(eth_dev, pci_dev);
 		eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
drivers/net/mlx5/mlx5.h +0 -9
index 31d0c49..2392be5 100644
@@ -158,14 +158,6 @@ struct priv {
 	rte_spinlock_t lock; /* Lock for control functions. */
 };
 
-/* Local storage for secondary process data. */
-struct mlx5_secondary_data {
-	struct rte_eth_dev_data data; /* Local device data. */
-	struct priv *primary_priv; /* Private structure from primary. */
-	struct rte_eth_dev_data *shared_dev_data; /* Shared device data. */
-	rte_spinlock_t lock; /* Port configuration lock. */
-} mlx5_secondary_data[RTE_MAX_ETHPORTS];
-
 /**
  * Lock private structure to protect it from concurrent access in the
  * control path.
@@ -221,7 +213,6 @@ void priv_dev_interrupt_handler_uninstall(struct priv *, struct rte_eth_dev *);
 void priv_dev_interrupt_handler_install(struct priv *, struct rte_eth_dev *);
 int mlx5_set_link_down(struct rte_eth_dev *dev);
 int mlx5_set_link_up(struct rte_eth_dev *dev);
-struct priv *mlx5_secondary_data_setup(struct priv *priv);
 void priv_select_tx_function(struct priv *);
 void priv_select_rx_function(struct priv *);
 
drivers/net/mlx5/mlx5_ethdev.c +2 -164

184 lines not on this page · raw message

drivers/net/mlx5/mlx5_rxq.c +0 -41

47 lines not on this page · raw message

drivers/net/mlx5/mlx5_rxtx.h +0 -2
index baf2b25..333e5af 100644
@@ -305,7 +305,6 @@ int rxq_ctrl_setup(struct rte_eth_dev *, struct rxq_ctrl *, uint16_t,
 int mlx5_rx_queue_setup(struct rte_eth_dev *, uint16_t, uint16_t, unsigned int,
 			const struct rte_eth_rxconf *, struct rte_mempool *);
 void mlx5_rx_queue_release(void *);
-uint16_t mlx5_rx_burst_secondary_setup(void *, struct rte_mbuf **, uint16_t);
 int priv_rx_intr_vec_enable(struct priv *priv);
 void priv_rx_intr_vec_disable(struct priv *priv);
 #ifdef HAVE_UPDATE_CQ_CI
@@ -321,7 +320,6 @@ int txq_ctrl_setup(struct rte_eth_dev *, struct txq_ctrl *, uint16_t,
 int mlx5_tx_queue_setup(struct rte_eth_dev *, uint16_t, uint16_t, unsigned int,
 			const struct rte_eth_txconf *);
 void mlx5_tx_queue_release(void *);
-uint16_t mlx5_tx_burst_secondary_setup(void *, struct rte_mbuf **, uint16_t);
 
 /* mlx5_rxtx.c */
 
drivers/net/mlx5/mlx5_txq.c +0 -41

44 lines not on this page · raw message

Signature · 1 line
2.1.4
#8 lore raw

PATCH 4/5 net/mlx5: remove multiple drop RSS queues

In reply to Nelio Laranjeiro

Since MLNX_OFED 4.1 this code is no more useful.

---
 drivers/net/mlx5/Makefile    |  5 ----
 drivers/net/mlx5/mlx5_flow.c | 55 ++++++++++++++------------------------------
 2 files changed, 17 insertions(+), 43 deletions(-)
drivers/net/mlx5/Makefile +0 -5
index 8736de5..14b739a 100644
@@ -104,11 +104,6 @@ mlx5_autoconf.h.new: FORCE
 mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
 	$Q $(RM) -f -- '$@'
 	$Q sh -- '$<' '$@' \
-		HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP \
-		infiniband/verbs_exp.h \
-		enum IBV_EXP_FLOW_SPEC_ACTION_DROP \
-		$(AUTOCONF_OUTPUT)
-	$Q sh -- '$<' '$@' \
 		HAVE_VERBS_IBV_EXP_CQ_COMPRESSED_CQE \
 		infiniband/verbs_exp.h \
 		enum IBV_EXP_CQ_COMPRESSED_CQE \
drivers/net/mlx5/mlx5_flow.c +17 -38

130 lines not on this page · raw message

Signature · 1 line
2.1.4
#11 lore raw

PATCH 5/5 net/mlx5: remove old MLNX_OFED 3.3 verification

In reply to Nelio Laranjeiro

This version of MLNX_OFED is no more supported.

---
 drivers/net/mlx5/mlx5.h | 5 -----
 1 file changed, 5 deletions(-)
drivers/net/mlx5/mlx5.h +0 -5
index 2392be5..e89aba8 100644
@@ -63,11 +63,6 @@
 #include "mlx5_autoconf.h"
 #include "mlx5_defs.h"
 
-#if !defined(HAVE_VERBS_IBV_EXP_CQ_COMPRESSED_CQE) || \
-	!defined(HAVE_VERBS_MLX5_ETH_VLAN_INLINE_HEADER_SIZE)
-#error Mellanox OFED >= 3.3 is required, please refer to the documentation.
-#endif
-
 enum {
 	PCI_VENDOR_ID_MELLANOX = 0x15b3,
 };
Signature · 1 line
2.1.4
#14 lore raw
In reply to Nelio Laranjeiro
Quoted 8 lines · Nelio Laranjeiro

This Series make some cleanup in mlx5 PMD by removing useless code or non working code.

This series apply on top of:
[PATCH 0/5] net/mlx5: enable/disable vPMD and some cleanups
Specifically on patch: net/mlx5: cleanup Rx ring in free functions

http://dpdk.org/dev/patchwork/patch/27303/

Differed to the next release,

Thanks

Signature · 2 lines
Nélio Laranjeiro
6WIND
#6 lore raw

Re: [PATCH 3/5] net/mlx5: fix non working secondary process by removing it

In reply to Nelio Laranjeiro
Quoted 3 lines · Nelio Laranjeiro

Secondary process is a copy/paste of the mlx4 drivers, it was never tested and it even segfault at the secondary process start in the mlx5_pci_probe().

Does this means multi process support for mlx5 broken with this patch? If so features file and release notes should be updated if this won't be fixed back in this release..

And what is special required for mlx5 secondary process support?

Quoted 8 lines

This makes more sense to wipe this non working feature to re-write a working and functional version.

Fixes a48deada651b ("mlx5: allow operation in secondary processes")

<...>

#3 lore raw

Re: [PATCH 2/5] net/mlx5: remove pdentic pragma

In reply to Nelio Laranjeiro
Quoted 4 lines · Nelio Laranjeiro

Those are useless since DPDK headers have been cleaned up.

<...>

drivers/net/mlx5/mlx5.c line 56

Quoted 5 lines
drivers/net/mlx5/mlx5.c +0 -4
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif

Good to see that they are going, thanks. Is verbs.h one still required?

#13 lore raw

Re: [PATCH 5/5] net/mlx5: remove old MLNX_OFED 3.3 verification

In reply to Ferruh Yigit
Quoted 8 lines · Ferruh Yigit
Quoted 1 line · Nelio Laranjeiro

This version of MLNX_OFED is no more supported.

Does it make sense to document minimum supported MLNX_OFED version?

Quoted 3 lines

Hi Ferruh,

This is already documented in the NIC guides, see section "20.5. Prerequisites" [1].

Thanks,

[1] http://dpdk.org/doc/guides/nics/mlx5.html

Signature · 2 lines
Nélio Laranjeiro
6WIND
#10 lore raw

Re: [PATCH 4/5] net/mlx5: remove multiple drop RSS queues

In reply to Ferruh Yigit
Quoted 4 lines · Ferruh Yigit
Quoted 1 line · Nelio Laranjeiro

Since MLNX_OFED 4.1 this code is no more useful.

Can you please elaborate what is changed with MLNX_OFED 4.1?

Hardware drop queues are supported since this version, before that, the flow drop was handled by software queues not polled.

Quoted 1 line

Also how one can know his MLNX_OFED version?

Currently the user has to download and install it to have a working PMD, the NIC documentation provides the related information on where to get this Mellanox OFED from their website. So the user knows which version of MLNX OFED is installed in his system.

Quoted 4 lines
Quoted 2 lines

<...>

Thanks,

Signature · 2 lines
Nélio Laranjeiro
6WIND
#7 lore raw

Re: [PATCH 3/5] net/mlx5: fix non working secondary process by removing it

In reply to Ferruh Yigit
Quoted 8 lines · Ferruh Yigit
Quoted 3 lines · Nelio Laranjeiro

Secondary process is a copy/paste of the mlx4 drivers, it was never tested and it even segfault at the secondary process start in the mlx5_pci_probe().

Does this means multi process support for mlx5 broken with this patch? If so features file and release notes should be updated if this won't be fixed back in this release..

No currently the secondary process in mlx5 is not working at all. This is only removing a non working code from the PMD.

Quoted 1 line

And what is special required for mlx5 secondary process support?

There is some work to make this secondary process work correctly, but as it will be totally different, it does not make sense to keep a non working code to replace it by a working one.

Concerning the release note and features, this new implementation is expected in 17.11 same release as this patch.

Quoted 9 lines
Quoted 7 lines

This makes more sense to wipe this non working feature to re-write a working and functional version.

Fixes a48deada651b ("mlx5: allow operation in secondary processes")

<...>

I'll update the feature documentation in a v2 to remove the "Multiprocess aware" from the feature list in this patch.
It will be added back with the new implementation.

Thanks,

Signature · 2 lines
Nélio Laranjeiro
6WIND
#4 lore raw

Re: [PATCH 2/5] net/mlx5: remove pdentic pragma

In reply to Ferruh Yigit
Quoted 9 lines · Ferruh Yigit
Quoted 4 lines · Nelio Laranjeiro

Those are useless since DPDK headers have been cleaned up.

<...>

Quoted 1 line
Quoted 6 lines

drivers/net/mlx5/mlx5.c line 56

Quoted 4 lines
drivers/net/mlx5/mlx5.c +0 -4
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif

Good to see that they are going, thanks. Is verbs.h one still required?

Yes it is, Adrien is pushing some patch to the OFED community to make it also pedantic.

Thanks,

Signature · 2 lines
Nélio Laranjeiro
6WIND
#15 lore raw

v2 cover net/mlx5: cleanups

In reply to Nelio Laranjeiro

This Series make some cleanup in mlx5 PMD by removing useless code or non working code.

Changes in v2:

- update mlx5 feature list to remove the multi process awareness.

Nelio Laranjeiro (8):
net/mlx5: avoid reusing old queue's mbuf on reconfigure net/mlx5: prepare vector Rx ring at setup time net/mlx5: cleanup Rx ring in free functions net/mlx5: remove flow drop useless if branches net/mlx5: remove pdentic pragma
net/mlx5: fix non working secondary process by removing it net/mlx5: remove multiple drop RSS queues net/mlx5: remove old MLNX_OFED 3.3 verification

 doc/guides/nics/features/mlx5.ini    |   1 -
 drivers/net/mlx5/Makefile            |   5 -
 drivers/net/mlx5/mlx5.c              |  40 +-------
 drivers/net/mlx5/mlx5.h              |  21 -----
 drivers/net/mlx5/mlx5_ethdev.c       | 174 +----------------------------------
 drivers/net/mlx5/mlx5_fdir.c         |   7 --
 drivers/net/mlx5/mlx5_flow.c         |  59 ++++--------
 drivers/net/mlx5/mlx5_mac.c          |   7 --
 drivers/net/mlx5/mlx5_mr.c           |   7 --
 drivers/net/mlx5/mlx5_rss.c          |   7 --
 drivers/net/mlx5/mlx5_rxmode.c       |   7 --
 drivers/net/mlx5/mlx5_rxq.c          | 166 +++++++++++----------------------
 drivers/net/mlx5/mlx5_rxtx.c         |  13 ---
 drivers/net/mlx5/mlx5_rxtx.h         |  13 +--
 drivers/net/mlx5/mlx5_rxtx_vec_sse.c |  45 ---------
 drivers/net/mlx5/mlx5_stats.c        |   7 --
 drivers/net/mlx5/mlx5_trigger.c      |   7 --
 drivers/net/mlx5/mlx5_txq.c          |  48 ----------
 drivers/net/mlx5/mlx5_vlan.c         |   7 --
 19 files changed, 77 insertions(+), 564 deletions(-)
Signature · 1 line
2.1.4
#16 lore raw

PATCH v2 1/8 net/mlx5: avoid reusing old queue's mbuf on reconfigure

This patch prepare the merge of fake mbuf allocation needed by the vector code with rxq_alloc_elts() where all mbuf of the queues should be allocated.

---
 drivers/net/mlx5/mlx5_rxq.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)
drivers/net/mlx5/mlx5_rxq.c +3 -20
index 74387a7..550e648 100644
@@ -666,16 +666,12 @@ rxq_trim_elts(struct rxq *rxq)
  *   Pointer to RX queue structure.
  * @param elts_n
  *   Number of elements to allocate.
- * @param[in] pool
- *   If not NULL, fetch buffers from this array instead of allocating them
- *   with rte_pktmbuf_alloc().
  *
  * @return
  *   0 on success, errno value on failure.
  */
 static int
-rxq_alloc_elts(struct rxq_ctrl *rxq_ctrl, unsigned int elts_n,
-	       struct rte_mbuf *(*pool)[])
+rxq_alloc_elts(struct rxq_ctrl *rxq_ctrl, unsigned int elts_n)
 {
 	const unsigned int sges_n = 1 << rxq_ctrl->rxq.sges_n;
 	unsigned int i;
@@ -687,12 +683,7 @@ rxq_alloc_elts(struct rxq_ctrl *rxq_ctrl, unsigned int elts_n,
 		volatile struct mlx5_wqe_data_seg *scat =
 			&(*rxq_ctrl->rxq.wqes)[i];
 
-		buf = (pool != NULL) ? (*pool)[i] : NULL;
-		if (buf != NULL) {
-			rte_pktmbuf_reset(buf);
-			rte_pktmbuf_refcnt_update(buf, 1);
-		} else
-			buf = rte_pktmbuf_alloc(rxq_ctrl->rxq.mp);
+		buf = rte_pktmbuf_alloc(rxq_ctrl->rxq.mp);
 		if (buf == NULL) {
 			ERROR("%p: empty mbuf pool", (void *)rxq_ctrl);
 			ret = ENOMEM;
@@ -725,7 +716,6 @@ rxq_alloc_elts(struct rxq_ctrl *rxq_ctrl, unsigned int elts_n,
 	assert(ret == 0);
 	return 0;
 error:
-	assert(pool == NULL);
 	elts_n = i;
 	for (i = 0; (i != elts_n); ++i) {
 		if ((*rxq_ctrl->rxq.elts)[i] != NULL)
@@ -1064,14 +1054,7 @@ rxq_ctrl_setup(struct rte_eth_dev *dev, struct rxq_ctrl *rxq_ctrl,
 		      (void *)dev, strerror(ret));
 		goto error;
 	}
-	/* Reuse buffers from original queue if possible. */
-	if (rxq_ctrl->rxq.elts_n) {
-		assert(1 << rxq_ctrl->rxq.elts_n == desc);
-		assert(rxq_ctrl->rxq.elts != tmpl.rxq.elts);
-		rxq_trim_elts(&rxq_ctrl->rxq);
-		ret = rxq_alloc_elts(&tmpl, desc, rxq_ctrl->rxq.elts);
-	} else
-		ret = rxq_alloc_elts(&tmpl, desc, NULL);
+	ret = rxq_alloc_elts(&tmpl, desc);
 	if (ret) {
 		ERROR("%p: RXQ allocation failed: %s",
 		      (void *)dev, strerror(ret));
Signature · 1 line
2.1.4
#17 lore raw

PATCH v2 2/8 net/mlx5: prepare vector Rx ring at setup time

In reply to Nelio Laranjeiro

To use the vector, it needs to add to the PMD Rx mbuf ring four extra mbuf to avoid memory corruption. This additional mbuf are added on dev_start() whereas all other mbuf are allocated on queue setup.

This patch brings this allocation back to the same place as other mbuf allocation.

---
 drivers/net/mlx5/mlx5_ethdev.c       |  1 -
 drivers/net/mlx5/mlx5_rxq.c          | 43 ++++++++++++++++++++++++++++--------
 drivers/net/mlx5/mlx5_rxtx.c         |  6 -----
 drivers/net/mlx5/mlx5_rxtx.h         |  1 -
 drivers/net/mlx5/mlx5_rxtx_vec_sse.c | 38 -------------------------------
 5 files changed, 34 insertions(+), 55 deletions(-)
drivers/net/mlx5/mlx5_ethdev.c +0 -1
index b0eb3cd..014edc7 100644
@@ -1540,7 +1540,6 @@ void
 priv_select_rx_function(struct priv *priv)
 {
 	if (priv_check_vec_rx_support(priv) > 0) {
-		priv_prep_vec_rx_function(priv);
 		priv->dev->rx_pkt_burst = mlx5_rx_burst_vec;
 		DEBUG("selected RX vectorized function");
 	} else {
drivers/net/mlx5/mlx5_rxq.c +34 -9

80 lines not on this page · raw message

drivers/net/mlx5/mlx5_rxtx.c +0 -6
index b07bcd1..e9c4502 100644
@@ -2028,9 +2028,3 @@ priv_check_vec_rx_support(struct priv *priv)
 	(void)priv;
 	return -ENOTSUP;
 }
-
-void __attribute__((weak))
-priv_prep_vec_rx_function(struct priv *priv)
-{
-	(void)priv;
-}
drivers/net/mlx5/mlx5_rxtx.h +0 -1
index 7de1d10..d85ea16 100644
@@ -348,7 +348,6 @@ int priv_check_raw_vec_tx_support(struct priv *);
 int priv_check_vec_tx_support(struct priv *);
 int rxq_check_vec_support(struct rxq *);
 int priv_check_vec_rx_support(struct priv *);
-void priv_prep_vec_rx_function(struct priv *);
 uint16_t mlx5_tx_burst_raw_vec(void *, struct rte_mbuf **, uint16_t);
 uint16_t mlx5_tx_burst_vec(void *, struct rte_mbuf **, uint16_t);
 uint16_t mlx5_rx_burst_vec(void *, struct rte_mbuf **, uint16_t);
drivers/net/mlx5/mlx5_rxtx_vec_sse.c +0 -38
index 8560f74..67f63c6 100644
@@ -1377,41 +1377,3 @@ priv_check_vec_rx_support(struct priv *priv)
 		return -ENOTSUP;
 	return 1;
 }
-
-/**
- * Prepare for vectorized RX.
- *
- * @param priv
- *   Pointer to private structure.
- */
-void
-priv_prep_vec_rx_function(struct priv *priv)
-{
-	uint16_t i;
-
-	for (i = 0; i < priv->rxqs_n; ++i) {
-		struct rxq *rxq = (*priv->rxqs)[i];
-		struct rte_mbuf *mbuf_init = &rxq->fake_mbuf;
-		const uint16_t desc = 1 << rxq->elts_n;
-		int j;
-
-		assert(rxq->elts_n == rxq->cqe_n);
-		/* Initialize default rearm_data for vPMD. */
-		mbuf_init->data_off = RTE_PKTMBUF_HEADROOM;
-		rte_mbuf_refcnt_set(mbuf_init, 1);
-		mbuf_init->nb_segs = 1;
-		mbuf_init->port = rxq->port_id;
-		/*
-		 * prevent compiler reordering:
-		 * rearm_data covers previous fields.
-		 */
-		rte_compiler_barrier();
-		rxq->mbuf_initializer =
-			*(uint64_t *)&mbuf_init->rearm_data;
-		/* Padding with a fake mbuf for vectorized Rx. */
-		for (j = 0; j < MLX5_VPMD_DESCS_PER_LOOP; ++j)
-			(*rxq->elts)[desc + j] = &rxq->fake_mbuf;
-		/* Mark that it need to be cleaned up for rxq_alloc_elts(). */
-		rxq->trim_elts = 1;
-	}
-}
Signature · 1 line
2.1.4
#18 lore raw

PATCH v2 3/8 net/mlx5: cleanup Rx ring in free functions

In reply to Nelio Laranjeiro

Vector PMD returns buffers to the application without setting the pointers in the Rx queue to null nor allocating them. When the PMD cleanup the ring it needs to take a special care to those pointers to not free the mbufs before the application have used them nor if the application have already freed them.

---
 drivers/net/mlx5/mlx5_rxq.c  | 54 ++++++++++++++++----------------------------
 drivers/net/mlx5/mlx5_rxtx.h |  3 +--
 2 files changed, 20 insertions(+), 37 deletions(-)
drivers/net/mlx5/mlx5_rxq.c +19 -35
index de54175..2119dfa 100644
@@ -634,32 +634,6 @@ priv_rehash_flows(struct priv *priv)
 }
 
 /**
- * Unlike regular Rx function, vPMD Rx doesn't replace mbufs immediately when
- * receiving packets. Instead it replaces later in bulk. In rxq->elts[], entries
- * from rq_pi to rq_ci are owned by device but the rest is already delivered to
- * application. In order not to reuse those mbufs by rxq_alloc_elts(), this
- * function must be called to replace used mbufs.
- *
- * @param rxq
- *   Pointer to RX queue structure.
- */
-static void
-rxq_trim_elts(struct rxq *rxq)
-{
-	const uint16_t q_n = (1 << rxq->elts_n);
-	const uint16_t q_mask = q_n - 1;
-	uint16_t used = q_n - (rxq->rq_ci - rxq->rq_pi);
-	uint16_t i;
-
-	if (!rxq->trim_elts)
-		return;
-	for (i = 0; i < used; ++i)
-		(*rxq->elts)[(rxq->rq_ci + i) & q_mask] = NULL;
-	rxq->trim_elts = 0;
-	return;
-}
-
-/**
  * Allocate RX queue elements.
  *
  * @param rxq_ctrl
@@ -730,7 +704,6 @@ rxq_alloc_elts(struct rxq_ctrl *rxq_ctrl, unsigned int elts_n)
 		/* Padding with a fake mbuf for vectorized Rx. */
 		for (i = 0; i < MLX5_VPMD_DESCS_PER_LOOP; ++i)
 			(*rxq->elts)[elts_n + i] = &rxq->fake_mbuf;
-		rxq->trim_elts = 1;
 	}
 	DEBUG("%p: allocated and configured %u segments (max %u packets)",
 	      (void *)rxq_ctrl, elts_n, elts_n / (1 << rxq_ctrl->rxq.sges_n));
@@ -757,17 +730,28 @@ rxq_alloc_elts(struct rxq_ctrl *rxq_ctrl, unsigned int elts_n)
 static void
 rxq_free_elts(struct rxq_ctrl *rxq_ctrl)
 {
-	unsigned int i;
+	struct rxq *rxq = &rxq_ctrl->rxq;
+	const uint16_t q_n = (1 << rxq->elts_n);
+	const uint16_t q_mask = q_n - 1;
+	uint16_t used = q_n - (rxq->rq_ci - rxq->rq_pi);
+	uint16_t i;
 
-	rxq_trim_elts(&rxq_ctrl->rxq);
 	DEBUG("%p: freeing WRs", (void *)rxq_ctrl);
-	if (rxq_ctrl->rxq.elts == NULL)
+	if (rxq->elts == NULL)
 		return;
-
-	for (i = 0; (i != (1u << rxq_ctrl->rxq.elts_n)); ++i) {
-		if ((*rxq_ctrl->rxq.elts)[i] != NULL)
-			rte_pktmbuf_free_seg((*rxq_ctrl->rxq.elts)[i]);
-		(*rxq_ctrl->rxq.elts)[i] = NULL;
+	/**
+	 * Some mbuf in the Ring belongs to the application.  They cannot be
+	 * freed.
+	 */
+	if (rxq_check_vec_support(rxq) > 0) {
+		for (i = 0; i < used; ++i)
+			(*rxq->elts)[(rxq->rq_ci + i) & q_mask] = NULL;
+		rxq->rq_pi = rxq->rq_ci;
+	}
+	for (i = 0; (i != (1u << rxq->elts_n)); ++i) {
+		if ((*rxq->elts)[i] != NULL)
+			rte_pktmbuf_free_seg((*rxq->elts)[i]);
+		(*rxq->elts)[i] = NULL;
 	}
 }
 
drivers/net/mlx5/mlx5_rxtx.h +1 -2
index d85ea16..39b217b 100644
@@ -116,8 +116,7 @@ struct rxq {
 	unsigned int rss_hash:1; /* RSS hash result is enabled. */
 	unsigned int mark:1; /* Marked flow available on the queue. */
 	unsigned int pending_err:1; /* CQE error needs to be handled. */
-	unsigned int trim_elts:1; /* Whether elts needs clean-up. */
-	unsigned int :6; /* Remaining bits. */
+	unsigned int :7; /* Remaining bits. */
 	volatile uint32_t *rq_db;
 	volatile uint32_t *cq_db;
 	uint16_t rq_ci;
Signature · 1 line
2.1.4
#19 lore raw

PATCH v2 4/8 net/mlx5: remove flow drop useless if branches

In reply to Nelio Laranjeiro

Those two if statements are useless as there is a verification on the drop field of the flow to jump to the end of the function just above.

---
 drivers/net/mlx5/mlx5_flow.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/net/mlx5/mlx5_flow.c +0 -4
index 86be929..d62ccff 100644
@@ -1279,10 +1279,6 @@ priv_flow_destroy(struct priv *priv,
 		claim_zero(ibv_destroy_qp(flow->qp));
 	if (flow->ind_table)
 		claim_zero(ibv_exp_destroy_rwq_ind_table(flow->ind_table));
-	if (flow->drop && flow->wq)
-		claim_zero(ibv_exp_destroy_wq(flow->wq));
-	if (flow->drop && flow->cq)
-		claim_zero(ibv_destroy_cq(flow->cq));
 	if (flow->mark) {
 		struct rte_flow *tmp;
 		struct rxq *rxq;
Signature · 1 line
2.1.4
#20 lore raw

PATCH v2 5/8 net/mlx5: remove pdentic pragma

In reply to Nelio Laranjeiro

Those are useless since DPDK headers have been cleaned up.

---
 drivers/net/mlx5/mlx5.c              | 7 -------
 drivers/net/mlx5/mlx5.h              | 7 -------
 drivers/net/mlx5/mlx5_ethdev.c       | 7 -------
 drivers/net/mlx5/mlx5_fdir.c         | 7 -------
 drivers/net/mlx5/mlx5_mac.c          | 7 -------
 drivers/net/mlx5/mlx5_mr.c           | 7 -------
 drivers/net/mlx5/mlx5_rss.c          | 7 -------
 drivers/net/mlx5/mlx5_rxmode.c       | 7 -------
 drivers/net/mlx5/mlx5_rxq.c          | 7 -------
 drivers/net/mlx5/mlx5_rxtx.c         | 7 -------
 drivers/net/mlx5/mlx5_rxtx.h         | 7 -------
 drivers/net/mlx5/mlx5_rxtx_vec_sse.c | 7 -------
 drivers/net/mlx5/mlx5_stats.c        | 7 -------
 drivers/net/mlx5/mlx5_trigger.c      | 7 -------
 drivers/net/mlx5/mlx5_txq.c          | 7 -------
 drivers/net/mlx5/mlx5_vlan.c         | 7 -------
 16 files changed, 112 deletions(-)
drivers/net/mlx5/mlx5.c +0 -7
index b7e5046..bfcff70 100644
@@ -50,19 +50,12 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
 #include <rte_ethdev_pci.h>
 #include <rte_pci.h>
 #include <rte_common.h>
 #include <rte_kvargs.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_utils.h"
drivers/net/mlx5/mlx5.h +0 -7
index 43c5384..31d0c49 100644
@@ -50,10 +50,6 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_pci.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
@@ -61,9 +57,6 @@
 #include <rte_interrupts.h>
 #include <rte_errno.h>
 #include <rte_flow.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5_utils.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_ethdev.c +0 -7
index 014edc7..8258d4a 100644
@@ -50,10 +50,6 @@
 #include <linux/version.h>
 #include <fcntl.h>
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_atomic.h>
 #include <rte_ethdev.h>
 #include <rte_mbuf.h>
@@ -61,9 +57,6 @@
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_malloc.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_fdir.c +0 -7
index 34a7e69..ad256e4 100644
@@ -47,19 +47,12 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ether.h>
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
 #include <rte_common.h>
 #include <rte_flow.h>
 #include <rte_flow_driver.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_mac.c +0 -7
index 8489ea6..45d23e4 100644
@@ -51,16 +51,9 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_common.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_utils.h"
drivers/net/mlx5/mlx5_mr.c +0 -7
index 2873351..9593830 100644
@@ -41,14 +41,7 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mempool.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_rss.c +0 -7
index a2dd7d1..1249943 100644
@@ -47,15 +47,8 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_rxmode.c +0 -7
index a67e542..4a51e47 100644
@@ -45,14 +45,7 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ethdev.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_rxq.c +0 -7
index 2119dfa..94fdd32 100644
@@ -50,19 +50,12 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
 #include <rte_common.h>
 #include <rte_interrupts.h>
 #include <rte_debug.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_rxtx.c +0 -7
index e9c4502..fe9e7ea 100644
@@ -48,19 +48,12 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mbuf.h>
 #include <rte_mempool.h>
 #include <rte_prefetch.h>
 #include <rte_common.h>
 #include <rte_branch_prediction.h>
 #include <rte_ether.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_utils.h"
drivers/net/mlx5/mlx5_rxtx.h +0 -7
index 39b217b..0226ff9 100644
@@ -48,16 +48,9 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mbuf.h>
 #include <rte_mempool.h>
 #include <rte_common.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5_utils.h"
 #include "mlx5.h"
drivers/net/mlx5/mlx5_rxtx_vec_sse.c +0 -7
index 67f63c6..37854a7 100644
@@ -49,16 +49,9 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mbuf.h>
 #include <rte_mempool.h>
 #include <rte_prefetch.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_utils.h"
drivers/net/mlx5/mlx5_stats.c +0 -7
index 703f48c..7b45c8c 100644
@@ -34,16 +34,9 @@
 #include <linux/sockios.h>
 #include <linux/ethtool.h>
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ethdev.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_trigger.c +0 -7
index 595a9e0..3fa9401 100644
@@ -31,17 +31,10 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5.h"
 #include "mlx5_rxtx.h"
drivers/net/mlx5/mlx5_txq.c +0 -7
index 98aaa7c..45e9037 100644
@@ -47,17 +47,10 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
 #include <rte_ethdev.h>
 #include <rte_common.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5_utils.h"
 #include "mlx5_defs.h"
drivers/net/mlx5/mlx5_vlan.c +0 -7
index 1b0fa40..353ae49 100644
@@ -36,15 +36,8 @@
 #include <assert.h>
 #include <stdint.h>
 
-/* DPDK headers don't like -pedantic. */
-#ifdef PEDANTIC
-#pragma GCC diagnostic ignored "-Wpedantic"
-#endif
 #include <rte_ethdev.h>
 #include <rte_common.h>
-#ifdef PEDANTIC
-#pragma GCC diagnostic error "-Wpedantic"
-#endif
 
 #include "mlx5_utils.h"
 #include "mlx5.h"
Signature · 1 line
2.1.4
#21 lore raw

PATCH v2 6/8 net/mlx5: fix non working secondary process by removing it

In reply to Nelio Laranjeiro

Secondary process is a copy/paste of the mlx4 drivers, it was never tested and it even segfault at the secondary process start in the mlx5_pci_probe().

This makes more sense to wipe this non working feature to re-write a working and functional version.

Fixes a48deada651b ("mlx5: allow operation in secondary processes")
---
 doc/guides/nics/features/mlx5.ini |   1 -
 drivers/net/mlx5/mlx5.c           |  33 +-------
 drivers/net/mlx5/mlx5.h           |   9 ---
 drivers/net/mlx5/mlx5_ethdev.c    | 166 +-------------------------------------
 drivers/net/mlx5/mlx5_rxq.c       |  41 ----------
 drivers/net/mlx5/mlx5_rxtx.h      |   2 -
 drivers/net/mlx5/mlx5_txq.c       |  41 ----------
 7 files changed, 4 insertions(+), 289 deletions(-)
doc/guides/nics/features/mlx5.ini +0 -1
index 2913591..99a8d93 100644
@@ -34,7 +34,6 @@ Tx descriptor status = Y
 Basic stats          = Y
 Extended stats       = Y
 Stats per queue      = Y
-Multiprocess aware   = Y
 Other kdrv           = Y
 ARMv8                = Y
 Power8               = Y
drivers/net/mlx5/mlx5.c +2 -31
index bfcff70..bd66a7c 100644
@@ -771,37 +771,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 			err = ENOMEM;
 			goto port_error;
 		}
-
-		/* Secondary processes have to use local storage for their
-		 * private data as well as a copy of eth_dev->data, but this
-		 * pointer must not be modified before burst functions are
-		 * actually called. */
-		if (mlx5_is_secondary()) {
-			struct mlx5_secondary_data *sd =
-				&mlx5_secondary_data[eth_dev->data->port_id];
-			sd->primary_priv = eth_dev->data->dev_private;
-			if (sd->primary_priv == NULL) {
-				ERROR("no private data for port %u",
-						eth_dev->data->port_id);
-				err = EINVAL;
-				goto port_error;
-			}
-			sd->shared_dev_data = eth_dev->data;
-			rte_spinlock_init(&sd->lock);
-			memcpy(sd->data.name, sd->shared_dev_data->name,
-				   sizeof(sd->data.name));
-			sd->data.dev_private = priv;
-			sd->data.rx_mbuf_alloc_failed = 0;
-			sd->data.mtu = ETHER_MTU;
-			sd->data.port_id = sd->shared_dev_data->port_id;
-			sd->data.mac_addrs = priv->mac;
-			eth_dev->tx_pkt_burst = mlx5_tx_burst_secondary_setup;
-			eth_dev->rx_pkt_burst = mlx5_rx_burst_secondary_setup;
-		} else {
-			eth_dev->data->dev_private = priv;
-			eth_dev->data->mac_addrs = priv->mac;
-		}
-
+		eth_dev->data->dev_private = priv;
+		eth_dev->data->mac_addrs = priv->mac;
 		eth_dev->device = &pci_dev->device;
 		rte_eth_copy_pci_info(eth_dev, pci_dev);
 		eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
drivers/net/mlx5/mlx5.h +0 -9
index 31d0c49..2392be5 100644
@@ -158,14 +158,6 @@ struct priv {
 	rte_spinlock_t lock; /* Lock for control functions. */
 };
 
-/* Local storage for secondary process data. */
-struct mlx5_secondary_data {
-	struct rte_eth_dev_data data; /* Local device data. */
-	struct priv *primary_priv; /* Private structure from primary. */
-	struct rte_eth_dev_data *shared_dev_data; /* Shared device data. */
-	rte_spinlock_t lock; /* Port configuration lock. */
-} mlx5_secondary_data[RTE_MAX_ETHPORTS];
-
 /**
  * Lock private structure to protect it from concurrent access in the
  * control path.
@@ -221,7 +213,6 @@ void priv_dev_interrupt_handler_uninstall(struct priv *, struct rte_eth_dev *);
 void priv_dev_interrupt_handler_install(struct priv *, struct rte_eth_dev *);
 int mlx5_set_link_down(struct rte_eth_dev *dev);
 int mlx5_set_link_up(struct rte_eth_dev *dev);
-struct priv *mlx5_secondary_data_setup(struct priv *priv);
 void priv_select_tx_function(struct priv *);
 void priv_select_rx_function(struct priv *);
 
drivers/net/mlx5/mlx5_ethdev.c +2 -164

184 lines not on this page · raw message

drivers/net/mlx5/mlx5_rxq.c +0 -41

47 lines not on this page · raw message

drivers/net/mlx5/mlx5_rxtx.h +0 -2
index 0226ff9..b3b161d 100644
@@ -302,7 +302,6 @@ void rxq_cleanup(struct rxq_ctrl *);
 int mlx5_rx_queue_setup(struct rte_eth_dev *, uint16_t, uint16_t, unsigned int,
 			const struct rte_eth_rxconf *, struct rte_mempool *);
 void mlx5_rx_queue_release(void *);
-uint16_t mlx5_rx_burst_secondary_setup(void *, struct rte_mbuf **, uint16_t);
 int priv_rx_intr_vec_enable(struct priv *priv);
 void priv_rx_intr_vec_disable(struct priv *priv);
 #ifdef HAVE_UPDATE_CQ_CI
@@ -318,7 +317,6 @@ int txq_ctrl_setup(struct rte_eth_dev *, struct txq_ctrl *, uint16_t,
 int mlx5_tx_queue_setup(struct rte_eth_dev *, uint16_t, uint16_t, unsigned int,
 			const struct rte_eth_txconf *);
 void mlx5_tx_queue_release(void *);
-uint16_t mlx5_tx_burst_secondary_setup(void *, struct rte_mbuf **, uint16_t);
 
 /* mlx5_rxtx.c */
 
drivers/net/mlx5/mlx5_txq.c +0 -41

44 lines not on this page · raw message

Signature · 1 line
2.1.4
#22 lore raw

PATCH v2 7/8 net/mlx5: remove multiple drop RSS queues

In reply to Nelio Laranjeiro

Since MLNX_OFED 4.1 this code is no more useful.

---
 drivers/net/mlx5/Makefile    |  5 ----
 drivers/net/mlx5/mlx5_flow.c | 55 ++++++++++++++------------------------------
 2 files changed, 17 insertions(+), 43 deletions(-)
drivers/net/mlx5/Makefile +0 -5
index 8736de5..14b739a 100644
@@ -104,11 +104,6 @@ mlx5_autoconf.h.new: FORCE
 mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
 	$Q $(RM) -f -- '$@'
 	$Q sh -- '$<' '$@' \
-		HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP \
-		infiniband/verbs_exp.h \
-		enum IBV_EXP_FLOW_SPEC_ACTION_DROP \
-		$(AUTOCONF_OUTPUT)
-	$Q sh -- '$<' '$@' \
 		HAVE_VERBS_IBV_EXP_CQ_COMPRESSED_CQE \
 		infiniband/verbs_exp.h \
 		enum IBV_EXP_CQ_COMPRESSED_CQE \
drivers/net/mlx5/mlx5_flow.c +17 -38

130 lines not on this page · raw message

Signature · 1 line
2.1.4
#23 lore raw

PATCH v2 8/8 net/mlx5: remove old MLNX_OFED 3.3 verification

In reply to Nelio Laranjeiro

This version of MLNX_OFED is no more supported.

---
 drivers/net/mlx5/mlx5.h | 5 -----
 1 file changed, 5 deletions(-)
drivers/net/mlx5/mlx5.h +0 -5
index 2392be5..e89aba8 100644
@@ -63,11 +63,6 @@
 #include "mlx5_autoconf.h"
 #include "mlx5_defs.h"
 
-#if !defined(HAVE_VERBS_IBV_EXP_CQ_COMPRESSED_CQE) || \
-	!defined(HAVE_VERBS_MLX5_ETH_VLAN_INLINE_HEADER_SIZE)
-#error Mellanox OFED >= 3.3 is required, please refer to the documentation.
-#endif
-
 enum {
 	PCI_VENDOR_ID_MELLANOX = 0x15b3,
 };
Signature · 1 line
2.1.4
#24 lore raw
In reply to Nelio Laranjeiro
Quoted 7 lines · Nelio Laranjeiro

This Series make some cleanup in mlx5 PMD by removing useless code or non working code.

Changes in v2:

- update mlx5 feature list to remove the multi process awareness.

Quoted 9 lines

Nelio Laranjeiro (8):
net/mlx5: avoid reusing old queue's mbuf on reconfigure net/mlx5: prepare vector Rx ring at setup time net/mlx5: cleanup Rx ring in free functions net/mlx5: remove flow drop useless if branches net/mlx5: remove pdentic pragma
net/mlx5: fix non working secondary process by removing it net/mlx5: remove multiple drop RSS queues net/mlx5: remove old MLNX_OFED 3.3 verification

Series applied to dpdk-next-net/master, thanks.