DPDK patches and discussions
 help / color / mirror / Atom feed
From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
To: dev@dpdk.org
Cc: yskoh@mellanox.com, matan@mellanox.com
Subject: [dpdk-dev] [PATCH v2 4/6] net/mlx5: fix inline data settings
Date: Mon,  5 Aug 2019 13:03:52 +0000	[thread overview]
Message-ID: <1565010234-21769-5-git-send-email-viacheslavo@mellanox.com> (raw)
In-Reply-To: <1565010234-21769-1-git-send-email-viacheslavo@mellanox.com>

If the minimal inline data are required the data inline feature
must be engaged. There were the incorrect settings enabling the
entire small packet inline (in size up to 82B) which may result
in sending rate declining if there is no enough cores. The same
problem was raised if inline was enabled to support VLAN tag
insertion by software.

Fixes: 38b4b397a57d ("net/mlx5: add Tx configuration and setup")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_txq.c | 39 ++++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index fe3b4ec..81f3b40 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -784,13 +784,11 @@ struct mlx5_txq_ibv *
 	txq_ctrl->txq.vlan_en = config->hw_vlan_insert;
 	vlan_inline = (dev_txoff & DEV_TX_OFFLOAD_VLAN_INSERT) &&
 		      !config->hw_vlan_insert;
-	if (vlan_inline)
-		inlen_send = RTE_MAX(inlen_send, MLX5_ESEG_MIN_INLINE_SIZE);
 	/*
 	 * If there are few Tx queues it is prioritized
 	 * to save CPU cycles and disable data inlining at all.
 	 */
-	if ((inlen_send && priv->txqs_n >= txqs_inline) || vlan_inline) {
+	if (inlen_send && priv->txqs_n >= txqs_inline) {
 		/*
 		 * The data sent with ordinal MLX5_OPCODE_SEND
 		 * may be inlined in Ethernet Segment, align the
@@ -825,32 +823,31 @@ struct mlx5_txq_ibv *
 				     MLX5_WQE_CSEG_SIZE -
 				     MLX5_WQE_ESEG_SIZE -
 				     MLX5_WQE_DSEG_SIZE * 2);
-		txq_ctrl->txq.inlen_send = inlen_send;
-		txq_ctrl->txq.inlen_mode = inlen_mode;
-		txq_ctrl->txq.inlen_empw = 0;
-	} else {
+	} else if (inlen_mode) {
 		/*
 		 * If minimal inlining is requested we must
 		 * enable inlining in general, despite the
-		 * number of configured queues.
+		 * number of configured queues. Ignore the
+		 * txq_inline_max devarg, this is not
+		 * full-featured inline.
 		 */
 		inlen_send = inlen_mode;
-		if (inlen_mode) {
-			/*
-			 * Extend space for inline data to allow
-			 * optional alignment of data buffer
-			 * start address, it may improve PCIe
-			 * performance.
-			 */
-			inlen_send = RTE_MIN(inlen_send + MLX5_WQE_SIZE,
-					     MLX5_SEND_MAX_INLINE_LEN);
-		}
-		txq_ctrl->txq.inlen_send = inlen_send;
-		txq_ctrl->txq.inlen_mode = inlen_mode;
-		txq_ctrl->txq.inlen_empw = 0;
+		inlen_empw = 0;
+	} else if (vlan_inline) {
+		/*
+		 * Hardware does not report offload for
+		 * VLAN insertion, we must enable data inline
+		 * to implement feature by software.
+		 */
+		inlen_send = MLX5_ESEG_MIN_INLINE_SIZE;
+		inlen_empw = 0;
+	} else {
 		inlen_send = 0;
 		inlen_empw = 0;
 	}
+	txq_ctrl->txq.inlen_send = inlen_send;
+	txq_ctrl->txq.inlen_mode = inlen_mode;
+	txq_ctrl->txq.inlen_empw = 0;
 	if (inlen_send && inlen_empw && priv->txqs_n >= txqs_inline) {
 		/*
 		 * The data sent with MLX5_OPCODE_ENHANCED_MPSW
-- 
1.8.3.1


  parent reply	other threads:[~2019-08-05 13:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05 13:03 [dpdk-dev] [PATCH v2 0/6] fix transmit datapath cumulative series Viacheslav Ovsiienko
2019-08-05 13:03 ` [dpdk-dev] [PATCH v2 1/6] net/mlx5: fix default minimal data inline Viacheslav Ovsiienko
2019-08-05 14:41   ` Raslan Darawsheh
2019-08-05 13:03 ` [dpdk-dev] [PATCH v2 2/6] net/mlx5: fix inline data len assert condition Viacheslav Ovsiienko
2019-08-05 13:03 ` [dpdk-dev] [PATCH v2 3/6] net/mlx5: fix completion queue drain loop Viacheslav Ovsiienko
2019-08-05 13:03 ` Viacheslav Ovsiienko [this message]
2019-08-05 13:03 ` [dpdk-dev] [PATCH v2 5/6] net/mlx5: fix packet size inline settings Viacheslav Ovsiienko
2019-08-05 13:03 ` [dpdk-dev] [PATCH v2 6/6] net/mlx5: fix completion queue overflow for large bursts Viacheslav Ovsiienko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1565010234-21769-5-git-send-email-viacheslavo@mellanox.com \
    --to=viacheslavo@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=yskoh@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).