For adapters that support it, this flag improves performance outside of VF
context.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
---
 drivers/net/mlx5/Makefile   | 5 +++++
 drivers/net/mlx5/mlx5_txq.c | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index 54f1e89..6ced4ac 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -116,6 +116,11 @@ mlx5_autoconf.h: $(RTE_SDK)/scripts/auto-config-h.sh
                HAVE_EXP_QUERY_DEVICE \
                infiniband/verbs.h \
                type 'struct ibv_exp_device_attr' $(AUTOCONF_OUTPUT)
+       $Q sh -- '$<' '$@' \
+               HAVE_EXP_QP_BURST_CREATE_ENABLE_MULTI_PACKET_SEND_WR \
+               infiniband/verbs.h \
+               enum IBV_EXP_QP_BURST_CREATE_ENABLE_MULTI_PACKET_SEND_WR \
+               $(AUTOCONF_OUTPUT)

 mlx5.o: mlx5_autoconf.h

diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index a53b128..aa7581f 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -395,6 +395,13 @@ txq_setup(struct rte_eth_dev *dev, struct txq *txq, 
uint16_t desc,
                .intf_scope = IBV_EXP_INTF_GLOBAL,
                .intf = IBV_EXP_INTF_QP_BURST,
                .obj = tmpl.qp,
+#ifdef HAVE_EXP_QP_BURST_CREATE_ENABLE_MULTI_PACKET_SEND_WR
+               /* Multi packet send WR can only be used outside of VF. */
+               .family_flags =
+                       (!priv->vf ?
+                        IBV_EXP_QP_BURST_CREATE_ENABLE_MULTI_PACKET_SEND_WR :
+                        0),
+#endif
        };
        tmpl.if_qp = ibv_exp_query_intf(priv->ctx, &attr.params, &status);
        if (tmpl.if_qp == NULL) {
-- 
2.1.0

Reply via email to