All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, matan@nvidia.com, akozyrev@nvidia.com,
	rasland@nvidia.com, orika@nvidia.com
Subject: [dpdk-dev] [PATCH v3 4/6] net/mlx5: update Rx datapath to support split
Date: Mon, 26 Oct 2020 10:11:57 +0000	[thread overview]
Message-ID: <1603707119-20672-5-git-send-email-viacheslavo@nvidia.com> (raw)
In-Reply-To: <1603707119-20672-1-git-send-email-viacheslavo@nvidia.com>

Only the regular rx_burst routine is updated to support split,
because the vectorized ones does not support scatter and MPRQ
does not support split at all.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_rxq.c  | 11 +++++------
 drivers/net/mlx5/mlx5_rxtx.c |  3 ++-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 17fd89e..a19ca7c 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -210,9 +210,10 @@
 
 	/* Iterate on segments. */
 	for (i = 0; (i != elts_n); ++i) {
+		struct mlx5_eth_rxseg *seg = &rxq_ctrl->rxq.rxseg[i % sges_n];
 		struct rte_mbuf *buf;
 
-		buf = rte_pktmbuf_alloc(rxq_ctrl->rxq.mp);
+		buf = rte_pktmbuf_alloc(seg->mp);
 		if (buf == NULL) {
 			DRV_LOG(ERR, "port %u empty mbuf pool",
 				PORT_ID(rxq_ctrl->priv));
@@ -225,12 +226,10 @@
 		MLX5_ASSERT(rte_pktmbuf_data_len(buf) == 0);
 		MLX5_ASSERT(rte_pktmbuf_pkt_len(buf) == 0);
 		MLX5_ASSERT(!buf->next);
-		/* Only the first segment keeps headroom. */
-		if (i % sges_n)
-			SET_DATA_OFF(buf, 0);
+		SET_DATA_OFF(buf, seg->offset);
 		PORT(buf) = rxq_ctrl->rxq.port_id;
-		DATA_LEN(buf) = rte_pktmbuf_tailroom(buf);
-		PKT_LEN(buf) = DATA_LEN(buf);
+		DATA_LEN(buf) = seg->length;
+		PKT_LEN(buf) = seg->length;
 		NB_SEGS(buf) = 1;
 		(*rxq_ctrl->rxq.elts)[i] = buf;
 	}
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index b530ff4..dd84249 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -1334,7 +1334,8 @@ enum mlx5_txcmp_code {
 		rte_prefetch0(seg);
 		rte_prefetch0(cqe);
 		rte_prefetch0(wqe);
-		rep = rte_mbuf_raw_alloc(rxq->mp);
+		/* Allocate the buf from the same pool. */
+		rep = rte_mbuf_raw_alloc(seg->pool);
 		if (unlikely(rep == NULL)) {
 			++rxq->stats.rx_nombuf;
 			if (!pkt) {
-- 
1.8.3.1


  parent reply	other threads:[~2020-10-26 10:13 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     ` Viacheslav Ovsiienko [this message]
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   ` [dpdk-dev] [PATCH] net/mlx5: fix Rx queue initialization for scattered segment Viacheslav Ovsiienko
2020-10-26 18:07     ` 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=1603707119-20672-5-git-send-email-viacheslavo@nvidia.com \
    --to=viacheslavo@nvidia.com \
    --cc=akozyrev@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=thomas@monjalon.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.