From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0059.outbound.protection.outlook.com [104.47.42.59]) by dpdk.org (Postfix) with ESMTP id A9C18108D for ; Fri, 31 Mar 2017 12:11:21 +0200 (CEST) Received: from BN3PR0301CA0063.namprd03.prod.outlook.com (10.160.152.159) by BL2PR03MB276.namprd03.prod.outlook.com (10.255.231.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Fri, 31 Mar 2017 10:11:19 +0000 Received: from BN1BFFO11FD032.protection.gbl (2a01:111:f400:7c10::1:114) by BN3PR0301CA0063.outlook.office365.com (2a01:111:e400:401e::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10 via Frontend Transport; Fri, 31 Mar 2017 10:11:20 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD032.mail.protection.outlook.com (10.58.144.95) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1005.5 via Frontend Transport; Fri, 31 Mar 2017 10:11:19 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v2VABFvN004202; Fri, 31 Mar 2017 03:11:16 -0700 From: Shreyansh Jain To: CC: , , Shreyansh Jain Date: Fri, 31 Mar 2017 15:47:49 +0530 Message-ID: <1490955469-16216-1-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131354286796441377; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39450400003)(39840400002)(39860400002)(39400400002)(39850400002)(39380400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(5660300001)(356003)(33646002)(48376002)(47776003)(54906002)(86362001)(189998001)(50466002)(5003940100001)(8656002)(50986999)(77096006)(6666003)(6916009)(305945005)(36756003)(106466001)(2351001)(81166006)(8676002)(2906002)(38730400002)(110136004)(4326008)(53936002)(50226002)(85426001)(8936002)(104016004)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB276; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD032; 1:RICVa2Os9Ydf08pNcoKUBtZFOPoE9v8yLMj6vPHGk34dndggXJUkdnOb/cQAkBh9thDd8TvN4PALCH9Fq64Jwo5w2ZlqI/BDmfKC4JLKpFnF5iiqRJ1aAvQHFjbmWrDjq/4gGzbzkaiziB1Om64c41txOWEt5SqfX2tGx4E8OSMcHb0XGZUX8QkmpDqIbGZx33Vlc6Ac5u40EnL0y9SCLD3h3dZljN188qK15L5L/4I9qU2Ar0zGyBeDTcCTJj/nJrjikbTY4L7IlbdTuX25vGcV19/sFrfL4RfujogvWwmo4yKjguNWYoKDHxRUdzS3zZ2ZlLHkKreYc1Fj4Pn7AICFKTtjY1C2XfCmGPQKZobGkGiY7Yw7fg5NUyNspw9WUc8X3iwBuYHR1q7YUNFxReAnoTmh8vdUeaDIc6xDZxZ8xHDtB0ey0wWlvoMljYepSdnA2AHBvnFmcm8ybOlxqhFTrDVnq5Ct81RBPJTS79utcwENFT0ZU1c//TfYOr7OltZLYo5xeqR13LpbjBnW1u48EfKbeWt4XmeIfkWLUGIY/Lk+sKh1Mz6f0V0eZrm5efAQIj7UIFeCv9Raejziqt34YThb8T//5SFuKtWfeQvTPDbIqm2Sem8KipI+NhhhvvrilVOqpo/riYDGGVr7FQoToXngyT/Eg8DpK6jxvc/s4gMfh+2IlrhTDW/XMENJTpHCAtxanHld54mnDJM7/+D2vQgM/qDrT7mvwThTHzI= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 76873118-710b-4b14-a5c0-08d4781e46ae X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030255075)(201703131430075)(201703131517081); SRVR:BL2PR03MB276; X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB276; 3:UysCyFPh/OkEWGZkfYj7lDt+W8temIOwq9z5Fu+Ngd7nDLF9Ylv147gqpwwphhAlvSZuL7CodPsqDlijm9sDjkRt05KN1wnD/ezpSU/fBly4QRgdTcVOni/G812g4wDZ462tVoKX30fwfIjJWwwbl/0lEMImrsEp4j+HmO6SAq25tl4tr7eqjsgWvuQkzADAQysUnHa2Gn9zdt7gbHnG7MuSy1U16fH7HSw6cr2DX5x/83NoZqaEQEWz3J0CxmnAxnxGrS/DfIWJjYALlTA1ZCDHe+BdwJqeHwEJ5oEEYBE69zSIduGCI2d7fc5H9QETM2G/LuC3E1amOHaMKm8GYPFCdmTDd+lPfTG4fs9Bfnqla0Ouu/71teQ+3hAh0XOxwPyI05avB5rGwP9zVLvzr+dtnzojURgsGSgd3x90HZ7Or9fCSNtOFH/8xf03oH8qSI5cs0S6puxfAg0QyUOqUA==; 25:60StpF8ENExHXJ0Uv7N2Ev+Bv7tamqf2NOHqGUPHWuUgmkRguTmYB1h7Y5ZMHB5ZaTjVWJUN2kkxwdfcONAmKqFu3fcexmW0N6Hm99nb3W7Y0auh6MTkbmJBapoCEJpBUew9UrPc9HRIPv+vIfaHamF8F2qsZnMsjGxZtvdY/HYpb9e4YPoDrCpzllgV8JYmkP1Kw+EBglgBs5optcBZtWwRfVi9AJgrumgRofWVvDrDS2LZwNE0hUNw3DT0PzDq0waSo2jxng78GwHiPc0sTuYAL512aytvLzeVlJeKICCV0yaAzzlzd+LyF7E5Zobg5Jky7ohv+ghJ0y3Hk9x1m3s3fXz8jrs9Jnc/RNvup5DHICeI8dE+qXzzuLqPu8I2UnmkwdjiIAIoeDC0XAy2wJrNw/W27apGYAO2OQl3GgA1JSJcJJSEzyOKu2Dd+zGLe53EdqzBBY+4DCIBjkXksQ== X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB276; 31:HVqqG1zgX8b9gWCkxC4qH3wZoc+LYtJCd+RgH/S6Gci+AR/EihjnRZaw1e0o4o3dVEl6ShkKIDG00iy3GnAPLJVSHDgrwv1WCM0cEtypQzQmLyCkndkzNCRo2UxSUV4r1Ephm0e6DxYQcv8a6DyRrRuuqXjxpVJ1zsqg5OLDX+sba6Vh/G2nEsOWvAGsWrpOafzsM6z5ItnsyPuzU458TTDMe5ud760aOGHYG88HFsC+dJVIR/Qpv3iVIVYt8qkOAnAqdUHxw02QMR+n1FCwValljs1dHV2905Qc8Rbq6ZY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397)(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13018025)(13023025)(13015025)(13024025)(13017025)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123563025)(20161123561025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259075)(20161123556025)(20161123565025); SRVR:BL2PR03MB276; BCL:0; PCL:0; RULEID:(400006); SRVR:BL2PR03MB276; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR03MB276; 4:OeLFmgP8giM8ip+m8+9dWjp+NsvgfY4XXfNZ7MqxT2z?= =?us-ascii?Q?s5Zjx6GoXh+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BtUFnYO?= =?us-ascii?Q?gLVtO2PFf1jL2YYAKIAK9BJATo6UdcrPg/9pSeA=3D=3D?= X-Forefront-PRVS: 02638D901B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR03MB276; 23:1PXz8CrjGyKhedMNXE8LvtingEwUmBlGNrs/blDPMr?= =?us-ascii?Q?sHCNDw5xiJ5INxVeqYwuqJ3YWF5FvAP//wZQ9qmDX+I1FrJqDUvyCPFwlz66?= =?us-ascii?Q?/MAXymnJFKzApPYGjjopw+Yz7FOXx906YAOmw6QIF8EJxWFAh/89D3lMVseC?= =?us-ascii?Q?+HCLkbA2GyhxXhV8e5N06eklJ+wNKsp3JvYaur9k0gYzJsoxMM8yG73nriew?= =?us-ascii?Q?GlGfeoCihOiRPKw+DMBsSzvKotWlNulgqjlk0kH1Gbje/oC92fI6ZB4lz1KE?= =?us-ascii?Q?+7VD0S57iPWnK7vaXb1F2FsER5ysw2G5T9YcxRBSaQZU+HkZ7LJAgTf+7UYH?= =?us-ascii?Q?dO9LVfgB1sUi7nrtbC2ouMVq9NcCnUj4S66yG3mJ7xt555G3oWOlm9ue1G7y?= =?us-ascii?Q?g0sqy5ak6djUeHEUIG6moUe7FHZCB4WDp1WL66nlJt9C1o5zifNvD2M/o+fM?= =?us-ascii?Q?cxZ54sFZSnOBtlS7cDPvzDFIfGd92hSKlJhXPDLUucUdyUwOYHLeTsGP/+dN?= =?us-ascii?Q?XSCEIBoZHQ1ct6VTHSNE9OM+D74pACaJvBvqzO/Lz/+z98LOKb5jyqm3xzD2?= =?us-ascii?Q?zPJIZJ++bdYLHrbT1Mtpij92cByFwzCeBXMfpcjPgbH+HGQ4gwV/L9jWsM08?= =?us-ascii?Q?760pXSiVLXmE5J+y1kWophc8nRHXvklo3qwNQ2QqcHNGetaYqEECA3N8fbXl?= =?us-ascii?Q?SL74jz//5rjISrrYZXVCZOlqiYRirmQXyhiGR6xJdr/s9rWkI49Pk1ZDC4mA?= =?us-ascii?Q?0+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eDWzK7alR+DN2UK4u6vsMxPkK8qvpAnJCjYLQilGf4sPEQc78A+KpXlK6kLPZCR78Njlu; 24:1d4AgimS4nwhLoNr9ydlcDwaS3IejKukhs8x3k6/4le8JV7vlTbU1Ge/h43cFLWsUx6x2S4xPFuE3x+B3kLlCMdq062nnQ3VDh0peR+MhKQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR03MB276; 7:zy0GJCH73VlXQRjmrVRlhRJksbHy37hwPQcDFE5EFXRuBwDGLzfEtSmVmnIIUP/b/0wXR2nWO2xLQk0QWcKm1MHPmE91LPuWRP6BB/RwCrEKedkwmDn/F+BG8sVczEB/eEpmvpj+mz4t5kCVURbdoFcPfLS7mZD/5lMF8z30IrOkfcIkNdnqP66P0sg4Drr6vZrp0pPdFIJIOWd6t4cfv+dOp3qVTeB2nkJxW2RH89cQXflY9nBt6IWs/EZra+6DVg4KvpnDqqlLvYRqfZHS6O6stDHE/0Kt9NJ/M2uv5Ke+FIpTHtmGkHCO3Uw1ZN2DeYztRiQ11dxVoamzrTPQhA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2017 10:11:19.4413 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB276 Subject: [dpdk-dev] [RFC PATCH] test/test: support default mempool autotest 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: , X-List-Received-Date: Fri, 31 Mar 2017 10:11:22 -0000 Mempool test currently supports: * ring_mp_mc * stack In case a new mempool handler is added, there are multiple options for supporting that in the mempool autotest: 1. Like the patch below, adding a new default pool options So, ring* + stack + default (which can be 'stack' or 'ring') * This way, whatever the value of RTE_MBUF_DEFAULT_MEMPOOL_OPS is set, it would be verified. * even if that means duplicating some test (for example when "stack" is set as default and it already part of standard test) 2. Removing stack handler as standard, and moving only to one specified by RTE_MBUF_DEFAULT_MEMPOOL_OPS (+ existing ring*) * It still leaves space for duplication of ring_mp_mc in case that is set to default (as in case of master tree) 3. Iterating over the list of mempool handlers and performing a set or predefined tests * reqiures quite a lot of rewrite of mempool autotest * specially, allowing some special tests (cache/no-cache) cases when a set of variables in loop are being used, would be tricky 4. only checking the default pool set by RTE_* macro * In case a user has build DPDK using a configured value, probably it expected that application (or custom applications) would use that default handler. * would also mean that non-default (non RTE_* value) would not be tested even though they are being used. The decision above would impact how new mempool handlers are added and how their testing (API verification) can be done without impacting the mempool_autotest file everytime. Signed-off-by: Shreyansh Jain --- test/test/test_mempool.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c index b9880b3..aefbf80 100644 --- a/test/test/test_mempool.c +++ b/test/test/test_mempool.c @@ -509,9 +509,11 @@ walk_cb(struct rte_mempool *mp, void *userdata __rte_unused) static int test_mempool(void) { + int ret = -1; struct rte_mempool *mp_cache = NULL; struct rte_mempool *mp_nocache = NULL; struct rte_mempool *mp_stack = NULL; + struct rte_mempool *default_pool = NULL; rte_atomic32_init(&synchro); @@ -561,6 +563,30 @@ test_mempool(void) } rte_mempool_obj_iter(mp_stack, my_obj_init, NULL); + /* Create a mempool based on Default handler, if not "stack" */ + printf("Testing %s mempool handler\n", + RTE_MBUF_DEFAULT_MEMPOOL_OPS); + default_pool = rte_mempool_create_empty("default_pool", + MEMPOOL_SIZE, + MEMPOOL_ELT_SIZE, + RTE_MEMPOOL_CACHE_MAX_SIZE, 0, + SOCKET_ID_ANY, 0); + + if (default_pool == NULL) { + printf("cannot allocate default mempool\n"); + goto err; + } + if (rte_mempool_set_ops_byname(default_pool, + RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL) < 0) { + printf("cannot set default handler\n"); + goto err; + } + if (rte_mempool_populate_default(default_pool) < 0) { + printf("cannot populate default mempool\n"); + goto err; + } + rte_mempool_obj_iter(default_pool, my_obj_init, NULL); + /* retrieve the mempool from its name */ if (rte_mempool_lookup("test_nocache") != mp_nocache) { printf("Cannot lookup mempool from its name\n"); @@ -605,15 +631,20 @@ test_mempool(void) if (test_mempool_basic(mp_stack, 1) < 0) goto err; + if (test_mempool_basic(default_pool, 1) < 0) + goto err; + rte_mempool_list_dump(stdout); - return 0; + ret = 0; err: rte_mempool_free(mp_nocache); rte_mempool_free(mp_cache); rte_mempool_free(mp_stack); - return -1; + rte_mempool_free(default_pool); + + return ret; } REGISTER_TEST_COMMAND(mempool_autotest, test_mempool); -- 2.7.4