DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org
Cc: Yongseok Koh <yskoh@mellanox.com>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>
Subject: [dpdk-dev] [PATCH 5/5] net/mlx5: remove redundant inline variable
Date: Thu, 23 Nov 2017 10:22:36 +0100	[thread overview]
Message-ID: <d9924af664f4a3984d551b88a12b3a71b7025207.1511428846.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <cover.1511428846.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <cover.1511428846.git.nelio.laranjeiro@6wind.com>

A non max_inline 0 means an inline is requested, there is no need to
duplicate this information.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 5 ++---
 drivers/net/mlx5/mlx5_rxtx.h | 1 -
 drivers/net/mlx5/mlx5_txq.c  | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index d735e646c..28c0ad8ab 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -348,6 +348,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 	unsigned int comp;
 	volatile struct mlx5_wqe_ctrl *last_wqe = NULL;
 	unsigned int segs_n = 0;
+	const unsigned int max_inline = txq->max_inline;
 
 	if (unlikely(!pkts_n))
 		return 0;
@@ -360,8 +361,6 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 	if (unlikely(!max_wqe))
 		return 0;
 	do {
-		unsigned int max_inline = txq->max_inline;
-		const unsigned int inline_en = !!max_inline && txq->inline_en;
 		struct rte_mbuf *buf = NULL;
 		uint8_t *raw;
 		volatile struct mlx5_wqe_v *wqe = NULL;
@@ -516,7 +515,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			}
 		}
 		/* Inline if enough room. */
-		if (inline_en || tso) {
+		if (max_inline || tso) {
 			uint32_t inl;
 			uintptr_t end = (uintptr_t)
 				(((uintptr_t)txq->wqes) +
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 63eb12c66..b8c7925a3 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -191,7 +191,6 @@ struct mlx5_txq_data {
 	uint16_t elts_n:4; /* (*elts)[] length (in log2). */
 	uint16_t cqe_n:4; /* Number of CQ elements (in log2). */
 	uint16_t wqe_n:4; /* Number of of WQ elements (in log2). */
-	uint16_t inline_en:1; /* When set inline is enabled. */
 	uint16_t tso_en:1; /* When set hardware TSO is enabled. */
 	uint16_t tunnel_en:1;
 	/* When set TX offload for tunneled packets are supported. */
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 84d37be19..a786a6b63 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -353,7 +353,7 @@ mlx5_priv_txq_ibv_new(struct priv *priv, uint16_t idx)
 		.pd = priv->pd,
 		.comp_mask = IBV_QP_INIT_ATTR_PD,
 	};
-	if (txq_data->inline_en)
+	if (txq_data->max_inline)
 		attr.init.cap.max_inline_data = txq_ctrl->max_inline_data;
 	if (txq_data->tso_en) {
 		attr.init.max_tso_header = txq_ctrl->max_tso_header;
@@ -589,7 +589,6 @@ mlx5_priv_txq_new(struct priv *priv, uint16_t idx, uint16_t desc,
 		tmpl->txq.max_inline =
 			((priv->txq_inline + (RTE_CACHE_LINE_SIZE - 1)) /
 			 RTE_CACHE_LINE_SIZE);
-		tmpl->txq.inline_en = 1;
 		/* TSO and MPS can't be enabled concurrently. */
 		assert(!priv->tso || !priv->mps);
 		if (priv->mps == MLX5_MPW_ENHANCED) {
-- 
2.11.0

      parent reply	other threads:[~2017-11-23  9:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-23  9:22 [dpdk-dev] [PATCH 0/5] net/mlx5: cleanups Nelio Laranjeiro
2017-11-23  9:22 ` [dpdk-dev] [PATCH 1/5] net/mlx5: remove get priv internal function Nelio Laranjeiro
2017-11-27  7:30   ` Shahaf Shuler
2017-11-23  9:22 ` [dpdk-dev] [PATCH 2/5] net/mlx5: fix secondary process verification Nelio Laranjeiro
2017-11-23  9:22 ` [dpdk-dev] [PATCH 3/5] net/mlx5: removes 32bits support Nelio Laranjeiro
2017-11-23  9:22 ` [dpdk-dev] [PATCH 4/5] net/mlx5: move variable declaration Nelio Laranjeiro
2017-11-23  9:22 ` Nelio Laranjeiro [this message]

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=d9924af664f4a3984d551b88a12b3a71b7025207.1511428846.git.nelio.laranjeiro@6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --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).