summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_trigger.c
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_trigger.c
parent18bee130968a90292cb18730022ddf12d52120f9 (diff)
downloaddpdk-7d6bf6b866b8c25ec06539b3eeed1db4f785577c.zip
dpdk-7d6bf6b866b8c25ec06539b3eeed1db4f785577c.tar.gz
dpdk-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_trigger.c')
-rw-r--r--drivers/net/mlx5/mlx5_trigger.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 36b7c9e..3e7c0a9 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -102,6 +102,9 @@ mlx5_rxq_start(struct rte_eth_dev *dev)
unsigned int i;
int ret = 0;
+ /* Allocate/reuse/resize mempool for Multi-Packet RQ. */
+ if (mlx5_mprq_alloc_mp(dev))
+ goto error;
for (i = 0; i != priv->rxqs_n; ++i) {
struct mlx5_rxq_ctrl *rxq_ctrl = mlx5_rxq_get(dev, i);
struct rte_mempool *mp;
@@ -109,7 +112,8 @@ mlx5_rxq_start(struct rte_eth_dev *dev)
if (!rxq_ctrl)
continue;
/* Pre-register Rx mempool. */
- mp = rxq_ctrl->rxq.mp;
+ mp = mlx5_rxq_mprq_enabled(&rxq_ctrl->rxq) ?
+ rxq_ctrl->rxq.mprq_mp : rxq_ctrl->rxq.mp;
DRV_LOG(DEBUG,
"port %u Rx queue %u registering"
" mp %s having %u chunks",