From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 2CACAA0AC5 for ; Mon, 27 May 2019 10:35:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E3ED41B946; Mon, 27 May 2019 10:35:47 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id AC3291B944 for ; Mon, 27 May 2019 10:35:45 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4R8ZVbb003400; Mon, 27 May 2019 01:35:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=nDxmj1ppyFYqE+knpHYyCYjV46XfBrQn48hpeJXH4w4=; b=FZE41z7/8O8RW5GWCIux3mbKhEnwJTAkFglpuA3UjstXoaELnfuSBnxWTRPQuwWclQ3f SMa8oIAMvPgoW2ZivwgZLJJ5/A4EYJhNLd1mgewTQ/VW3gaOdX0IlfKw0cWsO5tUS73M +drkOZi+cskdSckS1L4NrFJMAsNWc/ZBBB5/rSdleFg5dpfxfrpHJXq5UHUzzKyfo9JW mhqlebWiaNmFx92EwOgkPDEcMlWt1JCwvMzMYnNjM+6vxYI1BrjSUnne4c5GZF+NsWsc 33Ia/4VxVPAXoCl5JpYV3jm3k3ypODZ3IUCMntgGZvPThDNCmuKilybpK3fdyKN8oxPW KA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2sqwjwarkq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 27 May 2019 01:35:44 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 27 May 2019 01:35:44 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 27 May 2019 01:35:44 -0700 Received: from dc7-eodlnx05.marvell.com (dc7-eodlnx05.marvell.com [10.28.113.55]) by maili.marvell.com (Postfix) with ESMTP id 455BA3F7043; Mon, 27 May 2019 01:35:42 -0700 (PDT) From: Sunil Kumar Kori To: , , , , , CC: , Sunil Kumar Kori Date: Mon, 27 May 2019 14:05:29 +0530 Message-ID: <1558946129-5816-3-git-send-email-skori@marvell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1558946129-5816-1-git-send-email-skori@marvell.com> References: <1558946129-5816-1-git-send-email-skori@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-27_06:, , signatures=0 Subject: [dpdk-dev] [PATCH 2/2] app/testpmd: creating mbuf pool based on maximum supported segments X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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