summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_defs.h
diff options
context:
space:
mode:
authorYongseok Koh <yskoh@mellanox.com>2018-05-09 04:13:50 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-14 22:31:52 +0100
commit7d6bf6b866b8c25ec06539b3eeed1db4f785577c (patch)
treef5ac3b92de0c35659a1582edaab4e5b3969c7aa7 /drivers/net/mlx5/mlx5_defs.h
parent18bee130968a90292cb18730022ddf12d52120f9 (diff)
downloaddpdk-next-eventdev-7d6bf6b866b8c25ec06539b3eeed1db4f785577c.zip
dpdk-next-eventdev-7d6bf6b866b8c25ec06539b3eeed1db4f785577c.tar.gz
dpdk-next-eventdev-7d6bf6b866b8c25ec06539b3eeed1db4f785577c.tar.xz
net/mlx5: add Multi-Packet Rx support
Multi-Packet Rx Queue (MPRQ a.k.a Striding RQ) can further save PCIe bandwidth by posting a single large buffer for multiple packets. Instead of posting a buffer per a packet, one large buffer is posted in order to receive multiple packets on the buffer. A MPRQ buffer consists of multiple fixed-size strides and each stride receives one packet. Rx packet is mem-copied to a user-provided mbuf if the size of Rx packet is comparatively small, or PMD attaches the Rx packet to the mbuf by external buffer attachment - rte_pktmbuf_attach_extbuf(). A mempool for external buffers will be allocated and managed by PMD. Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_defs.h')
-rw-r--r--drivers/net/mlx5/mlx5_defs.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
index 72e80af..51124cd 100644
--- a/drivers/net/mlx5/mlx5_defs.h
+++ b/drivers/net/mlx5/mlx5_defs.h
@@ -95,4 +95,22 @@
*/
#define MLX5_UAR_OFFSET (1ULL << 32)
+/* Log 2 of the default number of strides per WQE for Multi-Packet RQ. */
+#define MLX5_MPRQ_STRIDE_NUM_N 4U
+
+/* Two-byte shift is disabled for Multi-Packet RQ. */
+#define MLX5_MPRQ_TWO_BYTE_SHIFT 0
+
+/*
+ * Minimum size of packet to be memcpy'd instead of being attached as an
+ * external buffer.
+ */
+#define MLX5_MPRQ_MEMCPY_DEFAULT_LEN 128
+
+/* Minimum number Rx queues to enable Multi-Packet RQ. */
+#define MLX5_MPRQ_MIN_RXQS 12
+
+/* Cache size of mempool for Multi-Packet RQ. */
+#define MLX5_MPRQ_MP_CACHE_SZ 32
+
#endif /* RTE_PMD_MLX5_DEFS_H_ */