DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org
Cc: Adrien Mazarguil <adrien.mazarguil@6wind.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 2/3] net/mlx5: fix wrong htons
Date: Thu, 17 Nov 2016 10:49:55 +0100	[thread overview]
Message-ID: <92fae1c8490a9dfa782bbd62bac21076832d4cee.1479376117.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <e636af2f3f462bc75bc461eb8f8a2f429270e458.1479376117.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <e636af2f3f462bc75bc461eb8f8a2f429270e458.1479376117.git.nelio.laranjeiro@6wind.com>

Completion queue entry data uses network endian, to access them we should use
ntoh*().

Fixes: c305090bbaf8 ("net/mlx5: replace countdown with threshold for Tx completions")

CC: stable@dpdk.org
Reported-by: Liming Sun <lsun@mellanox.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 9bd4d80..04860bb 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -201,7 +201,7 @@ txq_complete(struct txq *txq)
 	} while (1);
 	if (unlikely(cqe == NULL))
 		return;
-	wqe = &(*txq->wqes)[htons(cqe->wqe_counter) &
+	wqe = &(*txq->wqes)[ntohs(cqe->wqe_counter) &
 			    ((1 << txq->wqe_n) - 1)].hdr;
 	elts_tail = wqe->ctrl[3];
 	assert(elts_tail < (1 << txq->wqe_n));
-- 
2.1.4

  reply	other threads:[~2016-11-17  9:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17  9:49 [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs Nelio Laranjeiro
2016-11-17  9:49 ` Nelio Laranjeiro [this message]
2016-11-17 10:38   ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix wrong htons Adrien Mazarguil
2016-11-18  9:55     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2016-11-17  9:49 ` [dpdk-dev] [PATCH 3/3] net/mlx5: do not invalidate title CQE Nelio Laranjeiro
2016-11-17 10:38   ` Adrien Mazarguil
2016-11-18  9:55     ` Ferruh Yigit
2016-11-17 10:37 ` [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs Adrien Mazarguil
2016-11-18  9:55   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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=92fae1c8490a9dfa782bbd62bac21076832d4cee.1479376117.git.nelio.laranjeiro@6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).