Skip to contentSkip to conversation

net/mlx5: improve single core performance

PATCH In review Nelio Laranjeiro 3 participants 13 messages Nov 24, 2016 – Jan 18, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

cover net/mlx5: improve single core performance

This series applies on top of
"[PATCH] eal: define generic vector types" [1][2]

Using built-in vector types forces compilers to consider SIMD instructions in specific places in order to improve performance on both IBM POWER8 and Intel architectures.

For example, testpmd single-thread I/O forwarding packets per second performance is improved by 6% on Intel platforms.

[1] http://dpdk.org/ml/archives/dev/2016-November/050261.html
[2] http://dpdk.org/dev/patchwork/patch/17024/

Nelio Laranjeiro (7):
net/mlx5: prepare Tx vectorization net/mlx5: use work queue buffer as a raw buffer net/mlx5: use vector types to speed up processing net/mlx5: fix missing inline attributes net/mlx5: move static prototype
net/mlx5: optimize copy of Ethernet header net/mlx5: remove inefficient prefetching

 drivers/net/mlx5/mlx5_prm.h  |  20 +++-
 drivers/net/mlx5/mlx5_rxtx.c | 243 +++++++++++++++++++++++--------------------
 drivers/net/mlx5/mlx5_rxtx.h |   2 +-
 drivers/net/mlx5/mlx5_txq.c  |   8 +-
 4 files changed, 150 insertions(+), 123 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/7 net/mlx5: prepare Tx vectorization

Prepare the code to write the Work Queue Element with vectorized instructions.

---
 drivers/net/mlx5/mlx5_rxtx.c | 44 ++++++++++++++++++++++++++++----------------
 1 file changed, 28 insertions(+), 16 deletions(-)
drivers/net/mlx5/mlx5_rxtx.c +28 -16
index ffd09ac..5dacd93 100644
@@ -391,6 +391,8 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		uint32_t length;
 		unsigned int ds = 0;
 		uintptr_t addr;
+		uint16_t pkt_inline_sz = MLX5_WQE_DWORD_SIZE;
+		uint8_t ehdr[2];
 #ifdef MLX5_PMD_SOFT_COUNTERS
 		uint32_t total_length = 0;
 #endif
@@ -416,6 +418,8 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			rte_prefetch0(*pkts);
 		addr = rte_pktmbuf_mtod(buf, uintptr_t);
 		length = DATA_LEN(buf);
+		ehdr[0] = ((uint8_t *)addr)[0];
+		ehdr[1] = ((uint8_t *)addr)[1];
 #ifdef MLX5_PMD_SOFT_COUNTERS
 		total_length = length;
 #endif
@@ -439,24 +443,20 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		} else {
 			wqe->eseg.cs_flags = 0;
 		}
-		raw  = (uint8_t *)(uintptr_t)&wqe->eseg.inline_hdr[0];
-		/* Start the know and common part of the WQE structure. */
-		wqe->ctrl[0] = htonl((txq->wqe_ci << 8) | MLX5_OPCODE_SEND);
-		wqe->ctrl[2] = 0;
-		wqe->ctrl[3] = 0;
-		wqe->eseg.rsvd0 = 0;
-		wqe->eseg.rsvd1 = 0;
-		wqe->eseg.mss = 0;
-		wqe->eseg.rsvd2 = 0;
-		/* Start by copying the Ethernet Header. */
-		memcpy((uint8_t *)raw, ((uint8_t *)addr), 16);
+		raw = ((uint8_t *)(uintptr_t)wqe) + 2 * MLX5_WQE_DWORD_SIZE;
+		/*
+		 * Start by copying the Ethernet header minus the first two
+		 * bytes which will be appended at the end of the Ethernet
+		 * segment.
+		 */
+		memcpy((uint8_t *)raw, ((uint8_t *)addr) + 2, 16);
 		length -= MLX5_WQE_DWORD_SIZE;
 		addr += MLX5_WQE_DWORD_SIZE;
 		/* Replace the Ethernet type by the VLAN if necessary. */
 		if (buf->ol_flags & PKT_TX_VLAN_PKT) {
 			uint32_t vlan = htonl(0x81000000 | buf->vlan_tci);
 
-			memcpy((uint8_t *)(raw + MLX5_WQE_DWORD_SIZE -
+			memcpy((uint8_t *)(raw + MLX5_WQE_DWORD_SIZE - 2 -
 					   sizeof(vlan)),
 			       &vlan, sizeof(vlan));
 			addr -= sizeof(vlan);
@@ -468,10 +468,13 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 				(uintptr_t)&(*txq->wqes)[1 << txq->wqe_n];
 			uint16_t max_inline =
 				txq->max_inline * RTE_CACHE_LINE_SIZE;
-			uint16_t pkt_inline_sz = MLX5_WQE_DWORD_SIZE;
 			uint16_t room;
 
-			raw += MLX5_WQE_DWORD_SIZE;
+			/*
+			 * raw starts two bytes before the boundary to
+			 * continue the above copy of packet data.
+			 */
+			raw += MLX5_WQE_DWORD_SIZE - 2;
 			room = end - (uintptr_t)raw;
 			if (room > max_inline) {
 				uintptr_t addr_end = (addr + max_inline) &
@@ -487,8 +490,6 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 				/* Sanity check. */
 				assert(addr <= addr_end);
 			}
-			/* Store the inlined packet size in the WQE. */
-			wqe->eseg.inline_hdr_sz = htons(pkt_inline_sz);
 			/*
 			 * 2 DWORDs consumed by the WQE header + 1 DSEG +
 			 * the size of the inline part of the packet.
@@ -570,7 +571,18 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			--pkts_n;
 next_pkt:
 		++i;
+		/* Initialize known and common part of the WQE structure. */
+		wqe->ctrl[0] = htonl((txq->wqe_ci << 8) | MLX5_OPCODE_SEND);
 		wqe->ctrl[1] = htonl(txq->qp_num_8s | ds);
+		wqe->ctrl[2] = 0;
+		wqe->ctrl[3] = 0;
+		wqe->eseg.rsvd0 = 0;
+		wqe->eseg.rsvd1 = 0;
+		wqe->eseg.mss = 0;
+		wqe->eseg.rsvd2 = 0;
+		wqe->eseg.inline_hdr_sz = htons(pkt_inline_sz);
+		wqe->eseg.inline_hdr[0] = ehdr[0];
+		wqe->eseg.inline_hdr[1] = ehdr[1];
 		txq->wqe_ci += (ds + 3) / 4;
 #ifdef MLX5_PMD_SOFT_COUNTERS
 		/* Increment sent bytes counter. */
Signature · 1 line
2.1.4
#2 lore raw

PATCH 2/7 net/mlx5: use work queue buffer as a raw buffer

In reply to Nelio Laranjeiro

Define a single work queue element type that encompasses them all. It includes control, Ethernet segment and raw data all grouped in a single place.

---
 drivers/net/mlx5/mlx5_prm.h  |  13 ++++--
 drivers/net/mlx5/mlx5_rxtx.c | 103 ++++++++++++++++++++++---------------------
 drivers/net/mlx5/mlx5_rxtx.h |   2 +-
 drivers/net/mlx5/mlx5_txq.c  |   8 ++--
 4 files changed, 68 insertions(+), 58 deletions(-)
drivers/net/mlx5/mlx5_prm.h +10 -3
index 7f31a2f..3dd4cbe 100644
@@ -114,12 +114,19 @@ struct mlx5_wqe_eth_seg_small {
 	uint32_t rsvd2;
 	uint16_t inline_hdr_sz;
 	uint8_t inline_hdr[2];
-};
+} __rte_aligned(MLX5_WQE_DWORD_SIZE);
 
 struct mlx5_wqe_inl_small {
 	uint32_t byte_cnt;
 	uint8_t raw;
-};
+} __rte_aligned(MLX5_WQE_DWORD_SIZE);
+
+struct mlx5_wqe_ctrl {
+	uint32_t ctrl0;
+	uint32_t ctrl1;
+	uint32_t ctrl2;
+	uint32_t ctrl3;
+} __rte_aligned(MLX5_WQE_DWORD_SIZE);
 
 /* Small common part of the WQE. */
 struct mlx5_wqe {
@@ -131,7 +138,7 @@ struct mlx5_wqe {
 struct mlx5_wqe64 {
 	struct mlx5_wqe hdr;
 	uint8_t raw[32];
-} __rte_aligned(64);
+} __rte_aligned(MLX5_WQE_SIZE);
 
 /* MPW session status. */
 enum mlx5_mpw_state {
drivers/net/mlx5/mlx5_rxtx.c +53 -50

222 lines not on this page · raw message

drivers/net/mlx5/mlx5_rxtx.h +1 -1
index 8f2cddb..b9b90a7 100644
@@ -259,7 +259,7 @@ struct txq {
 	uint16_t max_inline; /* Multiple of RTE_CACHE_LINE_SIZE to inline. */
 	uint32_t qp_num_8s; /* QP number shifted by 8. */
 	volatile struct mlx5_cqe (*cqes)[]; /* Completion queue. */
-	volatile struct mlx5_wqe64 (*wqes)[]; /* Work queue. */
+	volatile void *wqes; /* Work queue (use volatile to write into). */
 	volatile uint32_t *qp_db; /* Work queue doorbell. */
 	volatile uint32_t *cq_db; /* Completion queue doorbell. */
 	volatile void *bf_reg; /* Blueflame register. */
drivers/net/mlx5/mlx5_txq.c +4 -4
index 053665d..f4c6682 100644
@@ -82,7 +82,9 @@ txq_alloc_elts(struct txq_ctrl *txq_ctrl, unsigned int elts_n)
 	for (i = 0; (i != elts_n); ++i)
 		(*txq_ctrl->txq.elts)[i] = NULL;
 	for (i = 0; (i != (1u << txq_ctrl->txq.wqe_n)); ++i) {
-		volatile struct mlx5_wqe64 *wqe = &(*txq_ctrl->txq.wqes)[i];
+		volatile struct mlx5_wqe64 *wqe =
+			(volatile struct mlx5_wqe64 *)
+			txq_ctrl->txq.wqes + i;
 
 		memset((void *)(uintptr_t)wqe, 0x0, sizeof(*wqe));
 	}
@@ -214,9 +216,7 @@ txq_setup(struct txq_ctrl *tmpl, struct txq_ctrl *txq_ctrl)
 	}
 	tmpl->txq.cqe_n = log2above(ibcq->cqe);
 	tmpl->txq.qp_num_8s = qp->ctrl_seg.qp_num << 8;
-	tmpl->txq.wqes =
-		(volatile struct mlx5_wqe64 (*)[])
-		(uintptr_t)qp->gen_data.sqstart;
+	tmpl->txq.wqes = qp->gen_data.sqstart;
 	tmpl->txq.wqe_n = log2above(qp->sq.wqe_cnt);
 	tmpl->txq.qp_db = &qp->gen_data.db[MLX5_SND_DBR];
 	tmpl->txq.bf_reg = qp->gen_data.bf->reg;
Signature · 1 line
2.1.4
#3 lore raw

PATCH 3/7 net/mlx5: use vector types to speed up processing

In reply to Nelio Laranjeiro

Let compiler automatically use the vector capabilities of the target machine to optimize instructions.

---
 drivers/net/mlx5/mlx5_prm.h  |  7 +++++
 drivers/net/mlx5/mlx5_rxtx.c | 74 +++++++++++++++++++++++---------------------
 2 files changed, 46 insertions(+), 35 deletions(-)
drivers/net/mlx5/mlx5_prm.h +7 -0
index 3dd4cbe..9cd9fdf 100644
@@ -44,6 +44,7 @@
 #pragma GCC diagnostic error "-Wpedantic"
 #endif
 
+#include <rte_vect.h>
 #include "mlx5_autoconf.h"
 
 /* Get CQE owner bit. */
@@ -134,6 +135,12 @@ struct mlx5_wqe {
 	struct mlx5_wqe_eth_seg_small eseg;
 };
 
+/* Vectorize WQE header. */
+struct mlx5_wqe_v {
+	rte_v128u32_t ctrl;
+	rte_v128u32_t eseg;
+};
+
 /* WQE. */
 struct mlx5_wqe64 {
 	struct mlx5_wqe hdr;
drivers/net/mlx5/mlx5_rxtx.c +39 -35

148 lines not on this page · raw message

Signature · 1 line
2.1.4
#4 lore raw

PATCH 4/7 net/mlx5: fix missing inline attributes

In reply to Nelio Laranjeiro

These functions must be forced inline for better performance.

Fixes 99c12dcca65d ("net/mlx5: handle Rx CQE compression")
Fixes 1d88ba171942 ("net/mlx5: refactor Tx data path")
Fixes 67fa62bc672d ("mlx5: support checksum offload")
---
 drivers/net/mlx5/mlx5_rxtx.c | 34 +++++++++++++++++++++++++---------
 1 file changed, 25 insertions(+), 9 deletions(-)
drivers/net/mlx5/mlx5_rxtx.c +25 -9
index e161cd9..52733da 100644
@@ -71,6 +71,31 @@
 #include "mlx5_defs.h"
 #include "mlx5_prm.h"
 
+static inline int
+check_cqe(volatile struct mlx5_cqe *cqe,
+	  unsigned int cqes_n, const uint16_t ci)
+	  __attribute__((always_inline));
+
+static inline uint32_t
+txq_mp2mr(struct txq *txq, struct rte_mempool *mp)
+	__attribute__((always_inline));
+
+static inline void
+mlx5_tx_dbrec(struct txq *txq) __attribute__((always_inline));
+
+static inline uint32_t
+rxq_cq_to_pkt_type(volatile struct mlx5_cqe *cqe)
+	__attribute__((always_inline));
+
+static inline int
+mlx5_rx_poll_len(struct rxq *rxq, volatile struct mlx5_cqe *cqe,
+		 uint16_t cqe_cnt, uint32_t *rss_hash)
+		 __attribute__((always_inline));
+
+static inline uint32_t
+rxq_cq_to_ol_flags(struct rxq *rxq, volatile struct mlx5_cqe *cqe)
+		   __attribute__((always_inline));
+
 #ifndef NDEBUG
 
 /**
@@ -100,11 +125,6 @@ check_cqe_seen(volatile struct mlx5_cqe *cqe)
 
 #endif /* NDEBUG */
 
-static inline int
-check_cqe(volatile struct mlx5_cqe *cqe,
-	  unsigned int cqes_n, const uint16_t ci)
-	  __attribute__((always_inline));
-
 /**
  * Check whether CQE is valid.
  *
@@ -266,10 +286,6 @@ txq_mb2mp(struct rte_mbuf *buf)
 	return buf->pool;
 }
 
-static inline uint32_t
-txq_mp2mr(struct txq *txq, struct rte_mempool *mp)
-	__attribute__((always_inline));
-
 /**
  * Get Memory Region (MR) <-> Memory Pool (MP) association from txq->mp2mr[].
  * Add MP to txq->mp2mr[] if it's not registered yet. If mp2mr[] is full,
Signature · 1 line
2.1.4
#5 lore raw

PATCH 5/7 net/mlx5: move static prototype

In reply to Nelio Laranjeiro

Gather function prototypes at the beginning of the file.

---
 drivers/net/mlx5/mlx5_rxtx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/mlx5/mlx5_rxtx.c +3 -3
index 52733da..0d0b807 100644
@@ -76,6 +76,9 @@ check_cqe(volatile struct mlx5_cqe *cqe,
 	  unsigned int cqes_n, const uint16_t ci)
 	  __attribute__((always_inline));
 
+static inline void
+txq_complete(struct txq *txq) __attribute__((always_inline));
+
 static inline uint32_t
 txq_mp2mr(struct txq *txq, struct rte_mempool *mp)
 	__attribute__((always_inline));
@@ -192,9 +195,6 @@ tx_mlx5_wqe(struct txq *txq, uint16_t ci)
 	return (uintptr_t *)((uintptr_t)txq->wqes + ci * MLX5_WQE_SIZE);
 }
 
-static inline void
-txq_complete(struct txq *txq) __attribute__((always_inline));
-
 /**
  * Manage TX completions.
  *
Signature · 1 line
2.1.4
#6 lore raw

PATCH 6/7 net/mlx5: optimize copy of Ethernet header

In reply to Nelio Laranjeiro

Use fewer instructions to copy the first two bytes of Ethernet headers to work queue elements.

---
 drivers/net/mlx5/mlx5_rxtx.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/net/mlx5/mlx5_rxtx.c +4 -5
index 0d0b807..4b8c197 100644
@@ -409,7 +409,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		unsigned int ds = 0;
 		uintptr_t addr;
 		uint16_t pkt_inline_sz = MLX5_WQE_DWORD_SIZE;
-		uint8_t ehdr[2];
+		uint16_t ehdr;
 		uint8_t cs_flags = 0;
 #ifdef MLX5_PMD_SOFT_COUNTERS
 		uint32_t total_length = 0;
@@ -436,8 +436,8 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			rte_prefetch0(*pkts);
 		addr = rte_pktmbuf_mtod(buf, uintptr_t);
 		length = DATA_LEN(buf);
-		ehdr[0] = ((uint8_t *)addr)[0];
-		ehdr[1] = ((uint8_t *)addr)[1];
+		ehdr = (((uint8_t *)addr)[1] << 8) |
+		       ((uint8_t *)addr)[0];
 #ifdef MLX5_PMD_SOFT_COUNTERS
 		total_length = length;
 #endif
@@ -600,8 +600,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			0,
 			cs_flags,
 			0,
-			(ehdr[1] << 24) | (ehdr[0] << 16) |
-			htons(pkt_inline_sz),
+			(ehdr << 16) | htons(pkt_inline_sz),
 		};
 		txq->wqe_ci += (ds + 3) / 4;
 #ifdef MLX5_PMD_SOFT_COUNTERS
Signature · 1 line
2.1.4
#7 lore raw

PATCH 7/7 net/mlx5: remove inefficient prefetching

In reply to Nelio Laranjeiro

Prefetching completion queue entries is inefficient because too few CPU cycles are spent before their use, which results into cache misses anyway.

---
 drivers/net/mlx5/mlx5_rxtx.c | 21 ---------------------
 1 file changed, 21 deletions(-)
drivers/net/mlx5/mlx5_rxtx.c +0 -21
index 4b8c197..9f74fd4 100644
@@ -348,23 +348,6 @@ mlx5_tx_dbrec(struct txq *txq)
 }
 
 /**
- * Prefetch a CQE.
- *
- * @param txq
- *   Pointer to TX queue structure.
- * @param cqe_ci
- *   CQE consumer index.
- */
-static inline void
-tx_prefetch_cqe(struct txq *txq, uint16_t ci)
-{
-	volatile struct mlx5_cqe *cqe;
-
-	cqe = &(*txq->cqes)[ci & ((1 << txq->cqe_n) - 1)];
-	rte_prefetch0(cqe);
-}
-
-/**
  * DPDK callback for TX.
  *
  * @param dpdk_txq
@@ -395,8 +378,6 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 	if (unlikely(!pkts_n))
 		return 0;
 	/* Prefetch first packet cacheline. */
-	tx_prefetch_cqe(txq, txq->cq_ci);
-	tx_prefetch_cqe(txq, txq->cq_ci + 1);
 	rte_prefetch0(*pkts);
 	/* Start processing. */
 	txq_complete(txq);
@@ -733,7 +714,6 @@ mlx5_tx_burst_mpw(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 	if (unlikely(!pkts_n))
 		return 0;
 	/* Prefetch first packet cacheline. */
-	tx_prefetch_cqe(txq, txq->cq_ci);
 	rte_prefetch0(tx_mlx5_wqe(txq, txq->wqe_ci));
 	rte_prefetch0(tx_mlx5_wqe(txq, txq->wqe_ci + 1));
 	/* Start processing. */
@@ -938,7 +918,6 @@ mlx5_tx_burst_mpw_inline(void *dpdk_txq, struct rte_mbuf **pkts,
 	if (unlikely(!pkts_n))
 		return 0;
 	/* Prefetch first packet cacheline. */
-	tx_prefetch_cqe(txq, txq->cq_ci);
 	rte_prefetch0(tx_mlx5_wqe(txq, txq->wqe_ci));
 	rte_prefetch0(tx_mlx5_wqe(txq, txq->wqe_ci + 1));
 	/* Start processing. */
Signature · 1 line
2.1.4
#8 lore raw
In reply to Nelio Laranjeiro
Quoted 13 lines · Nelio Laranjeiro

This series applies on top of
"[PATCH] eal: define generic vector types" [1][2]

Using built-in vector types forces compilers to consider SIMD instructions in specific places in order to improve performance on both IBM POWER8 and Intel architectures.

For example, testpmd single-thread I/O forwarding packets per second performance is improved by 6% on Intel platforms.

[1] http://dpdk.org/ml/archives/dev/2016-November/050261.html
[2] http://dpdk.org/dev/patchwork/patch/17024/

Quoted 9 lines

Nelio Laranjeiro (7):
net/mlx5: prepare Tx vectorization net/mlx5: use work queue buffer as a raw buffer net/mlx5: use vector types to speed up processing net/mlx5: fix missing inline attributes net/mlx5: move static prototype
net/mlx5: optimize copy of Ethernet header net/mlx5: remove inefficient prefetching

<...>

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

#9 lore raw

2017-01-05 14:13, Ferruh Yigit:

Quoted 23 lines · Nelio Laranjeiro
Quoted 13 lines

This series applies on top of
"[PATCH] eal: define generic vector types" [1][2]

Using built-in vector types forces compilers to consider SIMD instructions in specific places in order to improve performance on both IBM POWER8 and Intel architectures.

For example, testpmd single-thread I/O forwarding packets per second performance is improved by 6% on Intel platforms.

[1] http://dpdk.org/ml/archives/dev/2016-November/050261.html
[2] http://dpdk.org/dev/patchwork/patch/17024/

Quoted 8 lines

Nelio Laranjeiro (7):
net/mlx5: prepare Tx vectorization net/mlx5: use work queue buffer as a raw buffer net/mlx5: use vector types to speed up processing net/mlx5: fix missing inline attributes net/mlx5: move static prototype
net/mlx5: optimize copy of Ethernet header net/mlx5: remove inefficient prefetching

Quoted 1 line

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

It will not be pulled in mainline because compilation fails on 32-bit:

drivers/net/mlx5/mlx5_rxtx.c: In function ‘mlx5_tx_burst’:
drivers/net/mlx5/mlx5_rxtx.c:523:10: error:
right shift count >= width of type [-Werror=shift-count-overflow]

     addr >> 32,
          ^~

Please Ferruh, remove the series from next-net.

#10 lore raw
Quoted 28 lines · Thomas Monjalon

2017-01-05 14:13, Ferruh Yigit:

Quoted 23 lines · Nelio Laranjeiro
Quoted 13 lines

This series applies on top of
"[PATCH] eal: define generic vector types" [1][2]

Using built-in vector types forces compilers to consider SIMD instructions in specific places in order to improve performance on both IBM POWER8 and Intel architectures.

For example, testpmd single-thread I/O forwarding packets per second performance is improved by 6% on Intel platforms.

[1] http://dpdk.org/ml/archives/dev/2016-November/050261.html
[2] http://dpdk.org/dev/patchwork/patch/17024/

Quoted 8 lines

Nelio Laranjeiro (7):
net/mlx5: prepare Tx vectorization net/mlx5: use work queue buffer as a raw buffer net/mlx5: use vector types to speed up processing net/mlx5: fix missing inline attributes net/mlx5: move static prototype
net/mlx5: optimize copy of Ethernet header net/mlx5: remove inefficient prefetching

Quoted 1 line

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

It will not be pulled in mainline because compilation fails on 32-bit:

Quoted 7 lines

drivers/net/mlx5/mlx5_rxtx.c: In function ‘mlx5_tx_burst’:
drivers/net/mlx5/mlx5_rxtx.c:523:10: error:
right shift count >= width of type [-Werror=shift-count-overflow]

     addr >> 32,
          ^~

Please Ferruh, remove the series from next-net.

Hi Thomas,

Wait, I'll submit a fix in few minutes.

Regards,

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

PATCH 1/1 net/mlx5: fix 32bits compilation issue

In reply to Thomas Monjalon
Fixes 02bb06aca20f ("net/mlx5: use vector types to speed up processing")

---

Please squash it in the original patch if possible.

---
 drivers/net/mlx5/mlx5_rxtx.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/mlx5/mlx5_rxtx.c +7 -6
index 8cf68c5..0177428 100644
@@ -390,6 +390,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		uint32_t length;
 		unsigned int ds = 0;
 		uintptr_t addr;
+		uint64_t naddr;
 		uint16_t pkt_inline_sz = MLX5_WQE_DWORD_SIZE;
 		uint8_t ehdr[2];
 		uint8_t cs_flags = 0;
@@ -515,12 +516,12 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			ds = 3;
 use_dseg:
 			/* Add the remaining packet as a simple ds. */
-			addr = htonll(addr);
+			naddr = htonll(addr);
 			*dseg = (rte_v128u32_t){
 				htonl(length),
 				txq_mp2mr(txq, txq_mb2mp(buf)),
-				addr,
-				addr >> 32,
+				naddr,
+				naddr >> 32,
 			};
 			++ds;
 			if (!segs_n)
@@ -554,12 +555,12 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		total_length += length;
 #endif
 		/* Store segment information. */
-		addr = htonll(rte_pktmbuf_mtod(buf, uintptr_t));
+		naddr = htonll(rte_pktmbuf_mtod(buf, uintptr_t));
 		*dseg = (rte_v128u32_t){
 			htonl(length),
 			txq_mp2mr(txq, txq_mb2mp(buf)),
-			addr,
-			addr >> 32,
+			naddr,
+			naddr >> 32,
 		};
 		(*txq->elts)[elts_head] = buf;
 		elts_head = (elts_head + 1) & (elts_n - 1);
Signature · 1 line
2.1.4