DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@mellanox.com>
To: Shahaf Shuler <shahafs@mellanox.com>,
	Yongseok Koh <yskoh@mellanox.com>,
	Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Cc: dev@dpdk.org, Dekel Peled <dekelp@mellanox.com>
Subject: [dpdk-dev] [PATCH 05/11] net/mlx5: fix DevX scattered Rx queue size
Date: Mon, 29 Jul 2019 11:53:23 +0000	[thread overview]
Message-ID: <1564401209-18752-6-git-send-email-matan@mellanox.com> (raw)
In-Reply-To: <1564401209-18752-1-git-send-email-matan@mellanox.com>

The WQ size configuration via DevX didn't take into acount the maximum
number of segments per packet what wrongly caused to configure bigger
WQE size than the size expected by the PMD in other places.

The scatter mode stride size should be the size of segment multiplied
by the number of maximum segments per packet.
The number of WQEs per WQ should be the number of descriptors divided by
the number of the maximum segments per packet.

Fix the size calculations to the above rule.

Fixes: dc9ceff73c99 ("net/mlx5: create advanced RxQ via DevX")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index d10c5c1..c95627e 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1090,7 +1090,7 @@
 	struct mlx5_rxq_ctrl *rxq_ctrl =
 		container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
 	struct mlx5_devx_create_rq_attr rq_attr;
-	uint32_t wqe_n = 1 << rxq_data->elts_n;
+	uint32_t wqe_n = 1 << (rxq_data->elts_n - rxq_data->sges_n);
 	uint32_t wq_size = 0;
 	uint32_t wqe_size = 0;
 	uint32_t log_wqe_size = 0;
@@ -1118,17 +1118,11 @@
 				MLX5_MIN_SINGLE_STRIDE_LOG_NUM_BYTES;
 		wqe_size = sizeof(struct mlx5_wqe_mprq);
 	} else {
-		int max_sge = 0;
-		int num_scatter = 0;
-
-		rq_attr.wq_attr.wq_type = MLX5_WQ_TYPE_CYCLIC;
-		max_sge = 1 << rxq_data->sges_n;
-		num_scatter = RTE_MAX(max_sge, 1);
-		wqe_size = sizeof(struct mlx5_wqe_data_seg) * num_scatter;
+		wqe_size = sizeof(struct mlx5_wqe_data_seg);
 	}
-	log_wqe_size = log2above(wqe_size);
+	log_wqe_size = log2above(wqe_size) + rxq_data->sges_n;
 	rq_attr.wq_attr.log_wq_stride = log_wqe_size;
-	rq_attr.wq_attr.log_wq_sz = rxq_data->elts_n;
+	rq_attr.wq_attr.log_wq_sz = rxq_data->elts_n - rxq_data->sges_n;
 	/* Calculate and allocate WQ memory space. */
 	wqe_size = 1 << log_wqe_size; /* round up power of two.*/
 	wq_size = wqe_n * wqe_size;
-- 
1.8.3.1


  parent reply	other threads:[~2019-07-29 12:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29 11:53 [dpdk-dev] [PATCH 00/11] net/mlx5: LRO fixes and enhancements Matan Azrad
2019-07-29 11:53 ` [dpdk-dev] [PATCH 01/11] net/mlx5: fix Rx scatter mode validation Matan Azrad
2019-07-29 11:53 ` [dpdk-dev] [PATCH 02/11] net/mlx5: limit LRO size to the maximum Rx packet Matan Azrad
2019-07-29 11:53 ` [dpdk-dev] [PATCH 03/11] net/mlx5: remove redundant offload flag reset Matan Azrad
2019-07-29 11:53 ` [dpdk-dev] [PATCH 04/11] net/mlx5: support mbuf headroom for LRO packet Matan Azrad
2019-07-29 11:53 ` Matan Azrad [this message]
2019-07-29 11:53 ` [dpdk-dev] [PATCH 06/11] net/mlx5: fix DevX Rx queue type Matan Azrad
2019-07-29 11:53 ` [dpdk-dev] [PATCH 07/11] net/mlx5: allow LRO in regular Rx queue Matan Azrad
2019-07-29 11:53 ` [dpdk-dev] [PATCH 08/11] net/mlx5: fix DevX Rx queue memory alignment Matan Azrad
2019-07-29 11:53 ` [dpdk-dev] [PATCH 09/11] net/mlx5: handle LRO packets in regular Rx queue Matan Azrad
2019-07-29 11:53 ` [dpdk-dev] [PATCH 10/11] net/mlx5: allow implicit LRO flow Matan Azrad
2019-07-29 11:53 ` [dpdk-dev] [PATCH 11/11] net/mlx5: allow LRO per Rx queue Matan Azrad
2019-07-29 12:32 ` [dpdk-dev] [PATCH 00/11] net/mlx5: LRO fixes and enhancements Slava Ovsiienko
2019-07-29 14:37 ` Raslan Darawsheh

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=1564401209-18752-6-git-send-email-matan@mellanox.com \
    --to=matan@mellanox.com \
    --cc=dekelp@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=shahafs@mellanox.com \
    --cc=viacheslavo@mellanox.com \
    --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).