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 4/5] net/mlx5: move variable declaration
Date: Thu, 23 Nov 2017 10:22:35 +0100	[thread overview]
Message-ID: <c1fbb7398d4c4504dea194dfc9c171a833b94cfa.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>

Most of the variable in mlx5_tx_burst() are defined too soon.
This commit moves them their uses C block of code.

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

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 932470602..d735e646c 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -344,15 +344,10 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 	unsigned int j = 0;
 	unsigned int k = 0;
 	uint16_t max_elts;
-	unsigned int max_inline = txq->max_inline;
-	const unsigned int inline_en = !!max_inline && txq->inline_en;
 	uint16_t max_wqe;
 	unsigned int comp;
-	volatile struct mlx5_wqe_v *wqe = NULL;
 	volatile struct mlx5_wqe_ctrl *last_wqe = NULL;
 	unsigned int segs_n = 0;
-	struct rte_mbuf *buf = NULL;
-	uint8_t *raw;
 
 	if (unlikely(!pkts_n))
 		return 0;
@@ -365,6 +360,11 @@ 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;
 		volatile rte_v128u32_t *dseg = NULL;
 		uint32_t length;
 		unsigned int ds = 0;
-- 
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 ` Nelio Laranjeiro [this message]
2017-11-23  9:22 ` [dpdk-dev] [PATCH 5/5] net/mlx5: remove redundant inline variable Nelio Laranjeiro

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=c1fbb7398d4c4504dea194dfc9c171a833b94cfa.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).