DPDK patches and discussions
 help / color / mirror / Atom feed
From: Sunil Kumar Kori <skori@marvell.com>
To: <thomas@monjalon.net>, <ferruh.yigit@intel.com>,
	<arybchenko@solarflare.com>, <wenzhuo.lu@intel.com>,
	<jingjing.wu@intel.com>, <bernard.iremonger@intel.com>
Cc: <dev@dpdk.org>, Sunil Kumar Kori <skori@marvell.com>
Subject: [dpdk-dev] [PATCH 2/2] app/testpmd: creating mbuf pool based on maximum supported segments
Date: Mon, 27 May 2019 14:05:29 +0530	[thread overview]
Message-ID: <1558946129-5816-3-git-send-email-skori@marvell.com> (raw)
In-Reply-To: <1558946129-5816-1-git-send-email-skori@marvell.com>

Configuring buffer size based following parameters:
- max-pkt-len
- max supported segments per MTU

Buffer size are configured as given below:
- If platform supports infinite segments per packet then default
  buffer size is used.
- If platform supports nb_mtu_seg_max segments then buffer size
  is configured as (max-pkt-len / nb_mtu_seg_max) + headroom

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 app/test-pmd/testpmd.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index f0061d9..b8c006b 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1100,6 +1100,8 @@ struct extmem_param {
 	uint8_t port_per_socket[RTE_MAX_NUMA_NODES];
 	struct rte_gro_param gro_param;
 	uint32_t gso_types;
+	uint16_t data_size;
+	bool warning = 0;
 	int k;
 
 	memset(port_per_socket,0,RTE_MAX_NUMA_NODES);
@@ -1167,8 +1169,27 @@ struct extmem_param {
 		port->need_reconfig = 1;
 		port->need_reconfig_queues = 1;
 		port->tx_metadata = 0;
+
+		/* Check for maximum number of segments per MTU. Accordingly
+		 * update the mbuf data size.
+		 */
+		if (port->dev_info.rx_desc_lim.nb_mtu_seg_max != UINT16_MAX) {
+			data_size = rx_mode.max_rx_pkt_len /
+				port->dev_info.rx_desc_lim.nb_mtu_seg_max;
+
+			if ((data_size + RTE_PKTMBUF_HEADROOM) >
+							mbuf_data_size) {
+				mbuf_data_size = data_size +
+						 RTE_PKTMBUF_HEADROOM;
+				warning = 1;
+			}
+		}
 	}
 
+	if (warning)
+		TESTPMD_LOG(WARNING, "Configured mbuf size %hu\n",
+			    mbuf_data_size);
+
 	/*
 	 * Create pools of mbuf.
 	 * If NUMA support is disabled, create a single pool of mbuf in
-- 
1.8.3.1


  parent reply	other threads:[~2019-05-27  8:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27  8:35 [dpdk-dev] [PATCH 0/2] Enabling default mbuf segments support Sunil Kumar Kori
2019-05-27  8:35 ` [dpdk-dev] [PATCH 1/2] lib/librte_ethdev: add in default value of rte_eth_dev_info Sunil Kumar Kori
2019-06-09 14:33   ` Andrew Rybchenko
2019-06-10 17:35     ` Ferruh Yigit
2019-06-14  5:31   ` Mo, YufengX
2019-06-14 16:51     ` Ferruh Yigit
2019-06-14 17:21       ` Ferruh Yigit
2019-06-17  1:38         ` Mo, YufengX
2019-05-27  8:35 ` Sunil Kumar Kori [this message]
2019-06-10 17:45   ` [dpdk-dev] [PATCH 2/2] app/testpmd: creating mbuf pool based on maximum supported segments Ferruh Yigit

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=1558946129-5816-3-git-send-email-skori@marvell.com \
    --to=skori@marvell.com \
    --cc=arybchenko@solarflare.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@intel.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).