From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id BB4438E81 for ; Wed, 14 Sep 2016 14:18:28 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id i130so45356296wmf.0 for ; Wed, 14 Sep 2016 05:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=+mUkfkj2Yz9CCnl0oqa1pr8mrATzdhOrz3NcaNCsQZo=; b=cwm+XpnUpsJ3HSPpxJY27KXDEu6SypqOBZI7/iG3VZPLz7L7rIB8wZl1fkyyrVmJjG yympbdkVAwUvOWFCCQlM+EcRtnGALvSd+CwMhGYnUhgYpJRty0OcQ2XJ8Y3cBqfX+Yoo wZCBXFuftdPMxOHL0F7WixHGqJk+fT245lM/Vlu61a56bBFOxN9VpzxQCmlxaj4Or0V3 ZKXVk0pZ/+kJfhFmE2OTp7cyeMKj8wQrmcF119qfzAfFyT/Mz6POkrj120y4wcCxZdib OwGGh1zT8E9WOVfJGeXbwSbSjoNOuruE9NlLOiRpFfFjbO0HJK5U3biK3s+Rh8Vg+y+W yfow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=+mUkfkj2Yz9CCnl0oqa1pr8mrATzdhOrz3NcaNCsQZo=; b=RE2W04mYepjyNbBrjoxh1D2qSc5XD4ojZMLof+SXmLU1eBZTu9zM7zxWenVkAC0Fhu YFU5Djn8OQmIyWzUK7QoDP3YOrktx2iX3d03ZyFPVeoZQqh19E54bdUdBEBvNCigc98P Lb8BbcFVkJicxHk27yLoj9s2pKIueU3NLhSsPOJUXflWk458mpMkzqzDBcLCEq30y7fT iBlvxm4dnRaNdX31q4N8ENar5NHN07Xt98VoQ0/M5h6p8Nak+O9Igv6VMgjzH6j/IDbL +MJSkqecbhG/cFyocC1+PBzbr0kzvLLWdQ/jJFwWJJVVJyeuMUHRAkwyPr1gt4Fd1FR4 Gbbg== X-Gm-Message-State: AE9vXwNLR1lOjMoIzBclCBmSBn2auO1aDBmr5oGOFKP5HL3+sV4OzxvvNeHK60S6xcBf0Oau X-Received: by 10.194.78.4 with SMTP id x4mr2349117wjw.158.1473855508433; Wed, 14 Sep 2016 05:18:28 -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 lj2sm3892992wjc.38.2016.09.14.05.18.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Sep 2016 05:18:25 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Cc: Adrien Mazarguil Date: Wed, 14 Sep 2016 14:18:05 +0200 Message-Id: <16afb0501eefa02096ca1beb9c5a5591643ae29b.1473854800.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 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, 14 Sep 2016 12:18:29 -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