summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_rxtx.h
diff options
context:
space:
mode:
authorMatan Azrad <matan@mellanox.com>2019-07-22 14:52:20 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-07-23 14:31:36 +0200
commit3a22f3877c9d8b13d7d1cdbd4c130b38cdbc8bcb (patch)
treedc44a8920bb4a09bd31f964081f395eb68ee13e8 /drivers/net/mlx5/mlx5_rxtx.h
parent940f0a1d072d05b7894db4fd4efff5eea08246ba (diff)
downloaddpdk-3a22f3877c9d8b13d7d1cdbd4c130b38cdbc8bcb.zip
dpdk-3a22f3877c9d8b13d7d1cdbd4c130b38cdbc8bcb.tar.gz
dpdk-3a22f3877c9d8b13d7d1cdbd4c130b38cdbc8bcb.tar.xz
net/mlx5: replace external mbuf shared memory
As an arrangement to the LRO support when a packet can consume all the stride memory, the external mbuf shared information cannot be anymore in the end of the stride, because the HW may write the packet data to all the stride memory. Move the shared information memory from the stride to the control memory of the external mbuf. Signed-off-by: Matan Azrad <matan@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_rxtx.h')
-rw-r--r--drivers/net/mlx5/mlx5_rxtx.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index ed5f637..bbd9b31 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -75,10 +75,20 @@ struct mlx5_mprq_buf {
struct rte_mempool *mp;
rte_atomic16_t refcnt; /* Atomically accessed refcnt. */
uint8_t pad[RTE_PKTMBUF_HEADROOM]; /* Headroom for the first packet. */
+ struct rte_mbuf_ext_shared_info shinfos[];
+ /*
+ * Shared information per stride.
+ * More memory will be allocated for the first stride head-room and for
+ * the strides data.
+ */
} __rte_cache_aligned;
/* Get pointer to the first stride. */
-#define mlx5_mprq_buf_addr(ptr) ((ptr) + 1)
+#define mlx5_mprq_buf_addr(ptr, strd_n) (RTE_PTR_ADD((ptr), \
+ sizeof(struct mlx5_mprq_buf) + \
+ (strd_n) * \
+ sizeof(struct rte_mbuf_ext_shared_info) + \
+ RTE_PKTMBUF_HEADROOM))
#define MLX5_MIN_SINGLE_STRIDE_LOG_NUM_BYTES 6
#define MLX5_MIN_SINGLE_WQE_LOG_NUM_STRIDES 9