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>
Subject: [dpdk-dev] [PATCH v2 4/6] net/mlx5: reduce Tx structure size
Date: Wed, 14 Sep 2016 14:18:05 +0200	[thread overview]
Message-ID: <16afb0501eefa02096ca1beb9c5a5591643ae29b.1473854800.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <cover.1473854800.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <cover.1473854800.git.nelio.laranjeiro@6wind.com>

Blue Flame is a buffer allocated with a power of two value, its size is
returned by Verbs in log2.

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

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 4f28aa9..214922b 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -413,7 +413,7 @@ mlx5_tx_dbrec(struct txq *txq)
 	/* Ensure ordering between DB record and BF copy. */
 	rte_wmb();
 	rte_mov16(dst, (uint8_t *)data);
-	txq->bf_offset ^= txq->bf_buf_size;
+	txq->bf_offset ^= (1 << txq->bf_buf_size);
 }
 
 /**
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 224614e..3dca8ca 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -249,8 +249,8 @@ struct txq {
 	uint16_t wqe_n; /* Number of WQ elements. */
 	uint16_t elts_n:4; /* (*elts)[] length (in log2). */
 	uint16_t cqe_n:4; /* Number of CQ elements (in log2). */
+	uint16_t bf_buf_size:4; /* Log2 Blueflame size. */
 	uint16_t bf_offset; /* Blueflame offset. */
-	uint16_t bf_buf_size; /* Blueflame size. */
 	uint16_t max_inline; /* Multiple of RTE_CACHE_LINE_SIZE to inline. */
 	uint32_t qp_num_8s; /* QP number shifted by 8. */
 	volatile struct mlx5_cqe (*cqes)[]; /* Completion queue. */
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 6145b69..9919e37 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -221,7 +221,7 @@ txq_setup(struct txq_ctrl *tmpl, struct txq_ctrl *txq_ctrl)
 	tmpl->txq.qp_db = &qp->gen_data.db[MLX5_SND_DBR];
 	tmpl->txq.bf_reg = qp->gen_data.bf->reg;
 	tmpl->txq.bf_offset = qp->gen_data.bf->offset;
-	tmpl->txq.bf_buf_size = qp->gen_data.bf->buf_size;
+	tmpl->txq.bf_buf_size = log2above(qp->gen_data.bf->buf_size);
 	tmpl->txq.cq_db = cq->dbrec;
 	tmpl->txq.cqes =
 		(volatile struct mlx5_cqe (*)[])
-- 
2.1.4

  parent reply	other threads:[~2016-09-14 12:18 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  7:09 [dpdk-dev] [PATCH 0/6] net/mlx5: performance improvement Nelio Laranjeiro
2016-09-07  7:09 ` [dpdk-dev] [PATCH 1/6] net/mlx5: rework hardware structures Nelio Laranjeiro
2016-09-07  7:09 ` [dpdk-dev] [PATCH 2/6] net/mlx5: reduce Tx and Rx structure size Nelio Laranjeiro
2016-09-07  7:09 ` [dpdk-dev] [PATCH 3/6] " Nelio Laranjeiro
2016-09-07  7:09 ` [dpdk-dev] [PATCH 4/6] net/mlx5: reduce Tx " Nelio Laranjeiro
2016-09-07  7:09 ` [dpdk-dev] [PATCH 5/6] net/mlx5: reduce Tx and Rx " Nelio Laranjeiro
2016-09-07  7:09 ` [dpdk-dev] [PATCH 6/6] net/mlx5: remove gather loop on segments Nelio Laranjeiro
2016-09-14 12:18 ` [dpdk-dev] [PATCH v2 0/6] net/mlx5: performance improvement Nelio Laranjeiro
2016-09-19 16:17   ` Bruce Richardson
2016-09-20  7:25     ` Nélio Laranjeiro
2016-09-20  8:53   ` [dpdk-dev] [PATCH v3 " Nelio Laranjeiro
2016-09-20  8:53     ` [dpdk-dev] [PATCH v3 1/6] net/mlx5: rework hardware structures Nelio Laranjeiro
2016-09-20  8:53     ` [dpdk-dev] [PATCH v3 2/6] net/mlx5: reduce memory overhead of Rx/Tx descriptors Nelio Laranjeiro
2016-09-20  8:53     ` [dpdk-dev] [PATCH v3 3/6] net/mlx5: reduce memory overhead for CQE handling Nelio Laranjeiro
2016-09-20  8:53     ` [dpdk-dev] [PATCH v3 4/6] net/mlx5: reduce memory overhead for BF handling Nelio Laranjeiro
2016-09-20  8:53     ` [dpdk-dev] [PATCH v3 5/6] net/mlx5: reduce memory overhead for WQE handling Nelio Laranjeiro
2016-09-20  8:53     ` [dpdk-dev] [PATCH v3 6/6] net/mlx5: remove gather loop on segments Nelio Laranjeiro
2016-09-21 10:22     ` [dpdk-dev] [PATCH v3 0/6] net/mlx5: performance improvement Bruce Richardson
2016-09-14 12:18 ` [dpdk-dev] [PATCH v2 1/6] net/mlx5: rework hardware structures Nelio Laranjeiro
2016-09-19 16:14   ` Bruce Richardson
2016-09-20  7:09     ` Nélio Laranjeiro
2016-09-14 12:18 ` [dpdk-dev] [PATCH v2 2/6] net/mlx5: reduce Tx and Rx structure size Nelio Laranjeiro
2016-09-14 12:18 ` [dpdk-dev] [PATCH v2 3/6] " Nelio Laranjeiro
2016-09-14 12:18 ` Nelio Laranjeiro [this message]
2016-09-14 12:18 ` [dpdk-dev] [PATCH v2 5/6] " Nelio Laranjeiro
2016-09-14 12:18 ` [dpdk-dev] [PATCH v2 6/6] net/mlx5: remove gather loop on segments 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=16afb0501eefa02096ca1beb9c5a5591643ae29b.1473854800.git.nelio.laranjeiro@6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@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).