From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0081.outbound.protection.outlook.com [104.47.37.81]) by dpdk.org (Postfix) with ESMTP id 64FB11396 for ; Mon, 4 Jul 2016 09:17:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bFDFviy/Bh71REQPa9l+wQfEP4H+LjZqaA5ZtK6fa8I=; b=ZIMf39KQ7d5AXadhlJBY1IKpn0CCS+yDiuUoQ2/Fvy+NRVKATJKm1AZhjzxs0XCzM1dKPZmxluIP9e2hZDoR+zoIHX4GOpSJ+5UPtBms8pRqTY6gLfDI+MgKKEx4gopXkjqx1qpHPbRpXsgo7jifkaxD03l0ke5PhjHZQnZ37YQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BLUPR0701MB1715.namprd07.prod.outlook.com (10.163.85.141) with Microsoft SMTP Server (TLS) id 15.1.534.14; Mon, 4 Jul 2016 07:17:01 +0000 From: Jerin Jacob To: CC: , , Kamil Rytarowski , Zyta Szpak , Jerin Jacob Date: Mon, 4 Jul 2016 12:46:14 +0530 Message-ID: <1467616574-10004-1-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0053.INDPRD01.PROD.OUTLOOK.COM (10.164.136.153) To BLUPR0701MB1715.namprd07.prod.outlook.com (10.163.85.141) X-MS-Office365-Filtering-Correlation-Id: ec5deada-1f89-4c83-5a02-08d3a3db32fe X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1715; 2:oi1SX60URw30QUYYdmGzt8Tk17Pqq+SexAc+gZ6VxUG+g5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kXTPwU86M4LJlVF3D+7PktsjY1mzIasZMh4pADyZtRMB0IrlEahJKSyA3tvKt8uKLVI7Y2f8p0B0vSJ3taTugAlADX9DxIyWjXmiX7aOI+LvbjaWmUdhflRN4u37GrjCyQ4otySbkY+x0nqIPfI5PXPmHegIgnZRi3Uygu65ZSzOoSLL7j+08SSqFMQfG9PCPhZmFF7leDQdih07lJPWkGdPzbYGN89ayaZSAEmHop3wIOd0q/aA1Z8T5P/hGztAU/ifaTsyfvavRYUbLyaI634dhCR6CWjwTCeT2DICQQ82pyvLNUbD0D0uS6yttN2KspZN3ZQ/+AEp6ATlu2YmHnp+5cVHrvkRMyuY0JadKzQS0FZXE9++IA9VyJ8kBF5Sj3FK8/tUEKwH4KHIPdzv4l0vl12EDEhs824skvUOk+sXA4BD/r2SkLt+7cZahAKdxikThlxKm4P+6uOluveQEXoUv33mJ1T8CA2D3N1T1cHs6mRrq+RxP+VWKj7kDO1pXbJMso1g1UNDmsy2Y6/nTivB20sdbB1nVcmOTYv9uS4ZphcFQQFevTaesw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:BLUPR0701MB1715; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1715; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1715; 4:cypt5Ms3BQFWcDjwZFYxjYZf0RREDFTzt541w3nG/eeIVgZJyyKzsmT/S+acZnxk59I4mWoNPeMi0y3/hcdlTtPahgeMCRKbrwWGVKn8HQJSvYwzRynuJxz1zC471gJz1DO9aOLv1wWKPr3uq3vspEV/tyKc18kNWQuoVHeomKmTUAIW7c0goUXqr/1X1201kGKr4dyBc67MP7z9nTJawtfyR2aAGNtLf0Z6sx3xPYEIgdKtM40WvB/YXPj1ujrANaNifNww10pRpU2ug2Lm45kWam9MetxdR5WMhhy7BNSxcrSQioWW+a8g++y40Yub8trKn1qNabSP6LHnwqKcg+ReBV18a+cp75tMTyqQaMn5tVwKsfW9zxVk+urjaiAS X-Forefront-PRVS: 0993689CD1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(199003)(189002)(3846002)(69596002)(6116002)(81166006)(81156014)(92566002)(19580395003)(19580405001)(4001430100002)(106356001)(586003)(8676002)(33646002)(4326007)(50986999)(2351001)(575784001)(101416001)(7736002)(229853001)(7846002)(77096005)(97736004)(50466002)(5009440100003)(5003940100001)(66066001)(107886002)(110136002)(48376002)(47776003)(42186005)(50226002)(36756003)(76506005)(105586002)(68736007)(53416004)(189998001)(305945005)(2906002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1715; H:localhost.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1715; 23:8QUZmqjzi8iDVBVajv0oYfsdD8yaYKOuD2ortjz?= =?us-ascii?Q?s6Lej5kv7Gas7jwNevW4+b4SLKfwXI4D1AbCtDarGYML92jrz9Mv5QlGHE0H?= =?us-ascii?Q?8rtBfRf5DDzs4uvEm5e2r08PbS1rFIYgB6vo/ZonUVDYcj8tgYPGK/cL3AUu?= =?us-ascii?Q?dlFBcuBCnHGkWfxDppiLe8GRuUwvtJ8YIiJ/zUDuFpGd55BlckL2HtaGa8Bp?= =?us-ascii?Q?CkohEGmKvYekneBt/OWcD97QqRIJQJcsQmIjbG5MMbJyWJL2eMK3ir06dNg9?= =?us-ascii?Q?HE2ia7cmLG9YQhTQR0P/0w2JLMI9C8opMwHZH0kifH/AoicSgcpuz4MLpGfm?= =?us-ascii?Q?J4S7neH+LaSOz8ZKrlGRzBvATuruuGuMuifVouMEmbNoUiRDARXMrFjzyHd6?= =?us-ascii?Q?Sjis9NkXaw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V3m6+jEphGZz9BX/4d/6wbnSHFEdOQxuwxNVRq0oqtpYrWmSG4BnGrycMz5C8vwmorwFzaau7QDz4u4s07eRr63ga8lXiktN0VozYexpFYuxtDXlM6KEvMeKvbgpwhBSGZM4deiE9h2ubv721Bu59VTOepBWOKKKoidPW78+JMkdWSk9Oj6diVSOZ4mvLCccLUdmT2G+KZfA9ax++Ql1mGLqsnS4dVhNdJwGkfng6TF+iWfv1vGLuRZlYQ0hKQ0QLYA=; 5:kAFBtGLJBCgx8XvwVnVvd1p0dz4Gwj83RgAGsXr3jvlxGA+4wpzpBXgzlkITkpH0tAvzSe0flbmJAMZqxiUdiE4cDd1jLBH0ZAvUE/viU5+AjhnHCaGD/qGFTMyEyco0fsuJxOMfxg026LSH+4Pm6w==; 24:Iu2ZjVmIAh7kCLZ0VmsEaLUYqvUcmHA3Cji5rx/6nVPCdal0cd8kKdPCkcBPWJYZo1rhbgKQorLTMB2kcrkDuGs1ZrCQ574ietjg+LrKSIE=; 7:M9f0skv//2wQmbKRXvAATtFCvsTwdG7i/gCz6ZZS51RUrxx8iBhvb4BNg6zrjAPK8e0yVae8mdIcKVx0PUpU12FWSOiJCBGxPSTppFFtiAMjdJU5iVWb3Y/AnsBfEBq3JGoTPCB2ROud/3QAyjr3RzNZ9bVYF/QDffUkGgp0DIfuntlMPtjYCfpOrvfTgjSYO7t25RJx+F6Sa1Ny9U0jbIItNKvp9PmrknJdEQq956/kl3VVNzAUuKevuHk1yFya SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2016 07:17:01.3985 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1715 Subject: [dpdk-dev] [PATCH] net/thunderx: fix start/stop with different queue size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2016 07:17:07 -0000 From: Kamil Rytarowski Allocate maximum supported hardware ring hardware descriptors memory on the first rte_eth_dma_zone_reserve call in-order to get sufficient hardware ring buffer space on subsequent queue setup request with different queue size. Fixes: aa0d976e501d ("net/thunderx: add Rx queue setup and release") Fixes: 3f3c6f9724a8 ("net/thunderx: add Tx queue setup and release") Fixes: 7413feee662d ("net/thunderx: add device start/stop and close") Signed-off-by: Kamil Rytarowski Signed-off-by: Zyta Szpak Signed-off-by: Jerin Jacob --- drivers/net/thunderx/base/nicvf_hw_defs.h | 3 +++ drivers/net/thunderx/nicvf_ethdev.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/thunderx/base/nicvf_hw_defs.h b/drivers/net/thunderx/base/nicvf_hw_defs.h index 88ecd17..2f2b225 100644 --- a/drivers/net/thunderx/base/nicvf_hw_defs.h +++ b/drivers/net/thunderx/base/nicvf_hw_defs.h @@ -164,6 +164,7 @@ #define RBDR_QUEUE_SZ_128K (128 * 1024) #define RBDR_QUEUE_SZ_256K (256 * 1024) #define RBDR_QUEUE_SZ_512K (512 * 1024) +#define RBDR_QUEUE_SZ_MAX RBDR_QUEUE_SZ_512K #define RBDR_SIZE_SHIFT (13) /* 8k */ @@ -174,6 +175,7 @@ #define SND_QUEUE_SZ_16K (16 * 1024) #define SND_QUEUE_SZ_32K (32 * 1024) #define SND_QUEUE_SZ_64K (64 * 1024) +#define SND_QUEUE_SZ_MAX SND_QUEUE_SZ_64K #define SND_QSIZE_SHIFT (10) /* 1k */ @@ -184,6 +186,7 @@ #define CMP_QUEUE_SZ_16K (16 * 1024) #define CMP_QUEUE_SZ_32K (32 * 1024) #define CMP_QUEUE_SZ_64K (64 * 1024) +#define CMP_QUEUE_SZ_MAX CMP_QUEUE_SZ_64K #define CMP_QSIZE_SHIFT (10) /* 1k */ diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 48ed381..f42de4b 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -495,7 +495,7 @@ nicvf_qset_cq_alloc(struct nicvf *nic, struct nicvf_rxq *rxq, uint16_t qidx, uint32_t desc_cnt) { const struct rte_memzone *rz; - uint32_t ring_size = desc_cnt * sizeof(union cq_entry_t); + uint32_t ring_size = CMP_QUEUE_SZ_MAX * sizeof(union cq_entry_t); rz = rte_eth_dma_zone_reserve(nic->eth_dev, "cq_ring", qidx, ring_size, NICVF_CQ_BASE_ALIGN_BYTES, nic->node); @@ -518,7 +518,7 @@ nicvf_qset_sq_alloc(struct nicvf *nic, struct nicvf_txq *sq, uint16_t qidx, uint32_t desc_cnt) { const struct rte_memzone *rz; - uint32_t ring_size = desc_cnt * sizeof(union sq_entry_t); + uint32_t ring_size = SND_QUEUE_SZ_MAX * sizeof(union sq_entry_t); rz = rte_eth_dma_zone_reserve(nic->eth_dev, "sq", qidx, ring_size, NICVF_SQ_BASE_ALIGN_BYTES, nic->node); @@ -551,7 +551,7 @@ nicvf_qset_rbdr_alloc(struct nicvf *nic, uint32_t desc_cnt, uint32_t buffsz) return -ENOMEM; } - ring_size = sizeof(struct rbdr_entry_t) * desc_cnt; + ring_size = sizeof(struct rbdr_entry_t) * RBDR_QUEUE_SZ_MAX; rz = rte_eth_dma_zone_reserve(nic->eth_dev, "rbdr", 0, ring_size, NICVF_RBDR_BASE_ALIGN_BYTES, nic->node); if (rz == NULL) { -- 2.5.5