DPDK patches and discussions
 help / color / mirror / Atom feed
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
To: dev@dpdk.org
Cc: rasland@nvidia.com
Subject: [dpdk-dev] [PATCH] net/mlx5: fix Rx queue initialization for scattered segment
Date: Mon, 26 Oct 2020 17:17:36 +0000	[thread overview]
Message-ID: <1603732656-24395-1-git-send-email-viacheslavo@nvidia.com> (raw)
In-Reply-To: <1603381371-5360-2-git-send-email-viacheslavo@nvidia.com>

During integration/rebase there was introduced the bugs:

- double memory allocation for queue structure resulting in
  losing the part of configuration settings and following
  crash

- the erroneous fix for the segment logarithm

Fixes: 919ef3e26cff ("net/mlx5: configure Rx queue to support split")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5.h     |  1 +
 drivers/net/mlx5/mlx5_rxq.c | 11 +----------
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 258be03..8d65828 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -730,6 +730,7 @@ struct mlx5_ind_table_obj {
 };
 
 /* Hash Rx queue. */
+__extension__
 struct mlx5_hrxq {
 	ILIST_ENTRY(uint32_t)next; /* Index to the next element. */
 	rte_atomic32_t refcnt; /* Reference counter. */
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 1cc477a..4e17535 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1486,15 +1486,6 @@ struct mlx5_rxq_ctrl *
 		rte_errno = ENOSPC;
 		return NULL;
 	}
-	tmpl = mlx5_malloc(MLX5_MEM_RTE | MLX5_MEM_ZERO,
-		sizeof(*tmpl) + desc_n * sizeof(struct rte_mbuf *) +
-		(desc >> mprq_stride_nums) * sizeof(struct mlx5_mprq_buf *),
-		0, socket);
-
-	if (!tmpl) {
-		rte_errno = ENOMEM;
-		return NULL;
-	}
 	tmpl->type = MLX5_RXQ_TYPE_STANDARD;
 	if (mlx5_mr_btree_init(&tmpl->rxq.mr_ctrl.cache_bh,
 			       MLX5_MR_BTREE_CACHE_N, socket)) {
@@ -1560,7 +1551,7 @@ struct mlx5_rxq_ctrl *
 		 * Determine the number of SGEs needed for a full packet
 		 * and round it to the next power of two.
 		 */
-		sges_n = tmpl->rxq.rxseg_n;
+		sges_n = log2above(tmpl->rxq.rxseg_n);
 		if (sges_n > MLX5_MAX_LOG_RQ_SEGS) {
 			DRV_LOG(ERR,
 				"port %u too many SGEs (%u) needed to handle"
-- 
1.8.3.1


  parent reply	other threads:[~2020-10-26 17:17 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 15:42 [dpdk-dev] [PATCH 0/5] net/mlx5: add Rx buffer split support Viacheslav Ovsiienko
2020-10-22 15:42 ` [dpdk-dev] [PATCH 1/5] net/mlx5: add extended Rx queue setup routine Viacheslav Ovsiienko
2020-10-23  9:46   ` [dpdk-dev] [PATCH v2 0/5] net/mlx5: add Rx buffer split support Viacheslav Ovsiienko
2020-10-23  9:46     ` [dpdk-dev] [PATCH v2 1/5] net/mlx5: configure Rx queue to support split Viacheslav Ovsiienko
2020-10-23  9:46     ` [dpdk-dev] [PATCH v2 2/5] net/mlx5: register multiple pool for Rx queue Viacheslav Ovsiienko
2020-10-23  9:46     ` [dpdk-dev] [PATCH v2 3/5] net/mlx5: update Rx datapath to support split Viacheslav Ovsiienko
2020-10-23  9:46     ` [dpdk-dev] [PATCH v2 4/5] net/mlx5: report Rx segmentation capabilities Viacheslav Ovsiienko
2020-10-23  9:46     ` [dpdk-dev] [PATCH v2 5/5] doc: add buffer split feature limitation to mlx5 guide Viacheslav Ovsiienko
2020-10-26 10:11   ` [dpdk-dev] [PATCH v3 0/6] net/mlx5: add Rx buffer split support Viacheslav Ovsiienko
2020-10-26 10:11     ` [dpdk-dev] [PATCH v3 1/6] net/mlx5: add extended Rx queue setup routine Viacheslav Ovsiienko
2020-10-26 10:11     ` [dpdk-dev] [PATCH v3 2/6] net/mlx5: configure Rx queue to support split Viacheslav Ovsiienko
2020-10-26 10:11     ` [dpdk-dev] [PATCH v3 3/6] net/mlx5: register multiple pool for Rx queue Viacheslav Ovsiienko
2020-10-26 10:11     ` [dpdk-dev] [PATCH v3 4/6] net/mlx5: update Rx datapath to support split Viacheslav Ovsiienko
2020-10-26 10:11     ` [dpdk-dev] [PATCH v3 5/6] net/mlx5: report Rx segmentation capabilities Viacheslav Ovsiienko
2020-10-26 10:11     ` [dpdk-dev] [PATCH v3 6/6] doc: add buffer split feature limitation to mlx5 guide Viacheslav Ovsiienko
2020-10-26 11:54   ` [dpdk-dev] [PATCH v4 0/6] net/mlx5: add Rx buffer split support Viacheslav Ovsiienko
2020-10-26 11:55     ` [dpdk-dev] [PATCH v4 1/6] net/mlx5: add extended Rx queue setup routine Viacheslav Ovsiienko
2020-10-26 11:55     ` [dpdk-dev] [PATCH v4 2/6] net/mlx5: configure Rx queue to support split Viacheslav Ovsiienko
2020-10-26 11:55     ` [dpdk-dev] [PATCH v4 3/6] net/mlx5: register multiple pool for Rx queue Viacheslav Ovsiienko
2020-10-26 11:55     ` [dpdk-dev] [PATCH v4 4/6] net/mlx5: update Rx datapath to support split Viacheslav Ovsiienko
2020-10-26 11:55     ` [dpdk-dev] [PATCH v4 5/6] net/mlx5: report Rx segmentation capabilities Viacheslav Ovsiienko
2020-10-26 11:55     ` [dpdk-dev] [PATCH v4 6/6] doc: add buffer split feature limitation to mlx5 guide Viacheslav Ovsiienko
2020-10-26 15:25     ` [dpdk-dev] [PATCH v4 0/6] net/mlx5: add Rx buffer split support Raslan Darawsheh
2020-10-26 17:04       ` Ferruh Yigit
2020-10-26 17:38         ` Slava Ovsiienko
2020-10-27 11:05           ` Ferruh Yigit
2020-10-27 19:05             ` Slava Ovsiienko
2020-10-29 13:09               ` Ferruh Yigit
2020-10-29 14:21                 ` Slava Ovsiienko
2020-10-26 17:17   ` Viacheslav Ovsiienko [this message]
2020-10-26 18:07     ` [dpdk-dev] [PATCH] net/mlx5: fix Rx queue initialization for scattered segment Raslan Darawsheh
2020-10-22 15:42 ` [dpdk-dev] [PATCH 2/5] net/mlx5: configure Rx queue to support split Viacheslav Ovsiienko
2020-10-22 15:42 ` [dpdk-dev] [PATCH 3/5] net/mlx5: register multiple pool for Rx queue Viacheslav Ovsiienko
2020-10-22 15:42 ` [dpdk-dev] [PATCH 4/5] net/mlx5: update Rx datapath to support split Viacheslav Ovsiienko
2020-10-22 15:42 ` [dpdk-dev] [PATCH 5/5] net/mlx5: report Rx segmentation capabilies Viacheslav Ovsiienko

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=1603732656-24395-1-git-send-email-viacheslavo@nvidia.com \
    --to=viacheslavo@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=rasland@nvidia.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).