From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 1B0088D87 for ; Wed, 7 Sep 2016 09:10:26 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id 1so14388807wmz.1 for ; Wed, 07 Sep 2016 00:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=+mUkfkj2Yz9CCnl0oqa1pr8mrATzdhOrz3NcaNCsQZo=; b=Up7vFfH3nqAs6F3Ey5ccHmntqG01gTdVx6QzQmvuXFFC99HTI+QfIvb53LGfrud1gV lhMYfxh5UQ6fbkcJWYmzug9yyxD0XXmjwzO1ZOk9vPrliCUlfJ0qTXOyurxNGAsnZOZE vW9QfxPpAtDVcXCMZqfEP494VR+WcpvbubinoX78mJy+zgP3RYu1ldnFsXJ++eE/9L9Z hX6MPwFSIPyhEKaFK26CCJG5d6csHy6OxJ9KjYnV5ecE81Cwvuw9W+hhTqA8GxKOsLJh 3B7mbUj+24beuEWtNOPDMuQMDB9zDI5SwT5RZq3H5+Bl+VJw6phxOP82g3qA45U1Aiql 3ZpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=+mUkfkj2Yz9CCnl0oqa1pr8mrATzdhOrz3NcaNCsQZo=; b=CLmBZfHdcYYwO5X9y9UXBcuS6mLLDta740dwpX4X6vDcfXKSHqY4FR53SD/yZr6tlc yXL6j7VjPUaDf5FPM5SnB8HQQ5HAzkuMHOI0hlfqRkKCIsPUyglr+3clei1OTlzd+XyS Me3dfQ2xrUXWALuqo/2yv9kbFOctbIlyz2DCucZN9gThQdNzL+k2d0yn8MIaMS0cL/of 4FqMo/TkdWP2ojRXaXlhpfRIMCCRlN8bl9lCxrOae0ck2Cettgf/96y+tshkfsXOE4Jy mtr+lFTfOfiC+XdSn1zKt0KBPmwFgH1IYG7bZMYga6BFWUc08bs7osYDuCKqCuaILaJn dUGw== X-Gm-Message-State: AE9vXwOQpo4jMGr7ZiMJW/GyWbHgXRWy//kvxIWlVEpyuQDYII87N6asM2+HKcyYBTEkVNSH X-Received: by 10.28.25.71 with SMTP id 68mr2134987wmz.19.1473232225709; Wed, 07 Sep 2016 00:10:25 -0700 (PDT) Received: from ping.vm.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id w71sm2597456wmw.17.2016.09.07.00.10.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Sep 2016 00:10:25 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Date: Wed, 7 Sep 2016 09:09:57 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH 4/6] net/mlx5: reduce Tx structure size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2016 07:10:26 -0000 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 --- 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