From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0073.outbound.protection.outlook.com [104.47.41.73]) by dpdk.org (Postfix) with ESMTP id 6BC861B19F for ; Sun, 1 Oct 2017 11:29:40 +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=H/Og0hb39WrFwXZo9xB/Phcg5vZ2Ct5vN9F6HfumB5k=; b=j7420LuL81TH6jKfCcCQl0FR8R/QKq1uBDK7w9yenMuHY3vE388la4OuPRixHpCIBUjB3Iu0Oy0OQSQEUDsaWCxJAAqKDESKTrdcYFyhSLgF8NK2xCTbYHQxK9jHpPZFjrmJjKALt2vnEU5Av+rzw4PdWzfsFgiut3/Y8GTM+f4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3098.namprd07.prod.outlook.com (10.172.85.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sun, 1 Oct 2017 09:29:36 +0000 From: Santosh Shukla To: olivier.matz@6wind.com, dev@dpdk.org Cc: thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, Santosh Shukla Date: Sun, 1 Oct 2017 14:58:55 +0530 Message-Id: <20171001092902.10842-2-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171001092902.10842-1-santosh.shukla@caviumnetworks.com> References: <20170907153042.30890-1-santosh.shukla@caviumnetworks.com> <20171001092902.10842-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0077.INDPRD01.PROD.OUTLOOK.COM (10.174.208.145) To DM5PR07MB3098.namprd07.prod.outlook.com (10.172.85.8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67df716e-a662-408e-0aee-08d508aef048 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR07MB3098; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3098; 3:WIb3cTL7BFuer1PQsJcj2CUPZbFhSsBpTQBQnk3CpTFet0NuKi98dPgLossDmbqm/owHXk+dPUQjH1FpmviIhBSvGuxBMq0EfLBEF4TiA44wwrKCPaaGbGRmJ5bMWNNK7P8Yew8wKlppTk+xQgQYSfUlyQfB3UNy6CCpD1fE8MN85pETuSJkJ99BVnbT+u9uyCfRmJRXeWBysqTptgma1jCjEkC9PMBDnf9ZTmWsCjzu1lhmhbcIh73jcu9h7yeX; 25:Ev3eEjebc/9bU3sL0S9tU61ide0WbA8hyrPGsQobJxEUY6+EGsoXzJknnpwD7P0fju9FU2eb73XJk0CamntjjkdBob0SpjhbxMAqfo9S6p+fZ/1LyOBYSp0w8lOISBK4bd9Ng+U52eoc6BMFecSu+IJjegvWimzcqf+zByy1d13Mta7ZaB/MiiD0BQOq52q7uDhUxwJGOaQHHGFjT0v/qKgd61eW0o7/3U7FRw1KYg5hpJofvWkmguAAfcxENU63U5uqZho5GxRy/uTEWfFfqDo1NGUouzsEclW4xJRVIO7WxLJXxf0jXTDSl2JnR//kuHxFFBcUtCOZQWb7kPbkUA==; 31:XtRXxi1ms6nnYvnJx1ANKqfUdmKLIKW9AimEWLYhLk3KOJJFhi8G1N/rHPf2fCSnMsDcybjcXKjvTPwnxQe0Jr5nVO1XHVxNA8tjv9t5DYh0cDsyVjpWOnAZsK7HCCqe2qZR/CLxiYGnrhv8r4p+NNmfnCS83wSnEkbF4UpqeeyJYCzOt9TQRNaV2tA/W8cCQ50lXKgUVVtm5Kwv8NmdrgHCZqQBA76wozBBCkawwa4= X-MS-TrafficTypeDiagnostic: DM5PR07MB3098: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3098; 20:COrLgvm/P6r/ikFXlPE3i+V1v4/CCwH0KQGtVHAdj+UuKl1YDJ61rMnpvBXlBSO2VUxXn+NFaC3lVbHuO1AQP/PexI0jdENRhr49+U9b9H9WIfG8qDm3n93lIGXyX+SZdcq70H2PLc/rTtiIrzv9Vpzj1W+XaNNAI0zz+YwDc6iW+DxPvSSkfaI+eOozKHxfZQy7sMAKHAVEsQmfqdVVCXOPshA2RrcOLM9LZkgZ7zGu7FMJBPxVeJa62lSuhuM0ej3djp5aKULTa5maTZoJjuan6JAUsPGGrIl+Iow851fSrlWwzmEkSZRAvARrjOZg+xMlsIV0nbJuK0NXlW4vGU11ojUvYM//VnvmY0ua0QuRoUyw5yeBAC8H0XlhsJRKGZDKGY7AQWRaXyxTVtk+DKrWGoG9l60oqg//f1l4PQF7q7tktHH0K65L71kxotgnaF+j31mHFCbvFWLAXWgeCvuU4huUm3gcTI9DFK8UuduTrzviG9zTWg+xLAlN6J4LbzYWHpRJw1RC5yhCpzG9AvibwQuWHH7wrmzzUBsc+vm5XoOK7slWGQMMgo8vFqhBNhSGeWyC1elrEciDivmxIGVQPWigdQl3QAU7W1TL0Y0=; 4:61CT8Gp38qZ8y/iOXz8DOQXl75JumkIPfnJln4TpTJQw/4Z2jl9zmjmYaRSUQXZ8xdIZvpn/wsSkXaF+pP99vd2VnVlP9ZJIHGhaZKYilsaTW13O1rmP8+G2aoXGgb5JA3u+wg4DBd2TOymTbx486DyQ/u30Appth0oR0021tWY8tiyVGh++cWY3ie9MyyDJ9oh4doG76a9v5AovJvMpv8DT02ufwbmu+w3Eiac+C5F3LUK8walGlFkIyT3wRxIU X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(3002001)(10201501046)(6041248)(20161123558100)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3098; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3098; X-Forefront-PRVS: 0447DB1C71 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(376002)(346002)(189002)(199003)(101416001)(478600001)(189998001)(106356001)(50986999)(81166006)(16586007)(81156014)(8676002)(72206003)(68736007)(42882006)(50466002)(8936002)(5660300001)(16526017)(48376002)(8656003)(2950100002)(2906002)(105586002)(66066001)(3846002)(6512007)(1076002)(36756003)(47776003)(316002)(76176999)(6116002)(4326008)(97736004)(53936002)(5009440100003)(25786009)(50226002)(6486002)(107886003)(6666003)(5003940100001)(33646002)(6506006)(305945005)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3098; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; DM5PR07MB3098; 23:lglXwfah/I2/vs1S2bSmr1uhJnT1B37iIA8bwauDk?= =?us-ascii?Q?/3SfbELzzB1pekCK5sBnrL59/VR+duiCq3VgzeT1o1EmdNspDFkiiDX26kgK?= =?us-ascii?Q?Ybi2i87MkxNrwSkzp4kPGeAjCnzRbH7HN2jY8ZDX5TTBp1gQmzUc/qfmlUCq?= =?us-ascii?Q?aZ5q90dfdFjXYj22Wd3IbgUTpiNOWX3oOx8kIfdRTTFGzUGl3LRPvjmicYTk?= =?us-ascii?Q?4x0+uy1cr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com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2017 09:29:36.4655 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3098 Subject: [dpdk-dev] [PATCH v7 1/8] mempool: remove unused flags argument 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: Sun, 01 Oct 2017 09:29:40 -0000 * Remove redundant 'flags' API description from - __mempool_generic_put - __mempool_generic_get - rte_mempool_generic_put - rte_mempool_generic_get * Remove unused 'flags' argument from - rte_mempool_generic_put - rte_mempool_generic_get Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob Acked-by: Olivier Matz --- lib/librte_mempool/rte_mempool.h | 31 +++++++++---------------------- test/test/test_mempool.c | 18 +++++++++--------- test/test/test_mempool_perf.c | 4 ++-- 3 files changed, 20 insertions(+), 33 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index 76b5b3b15..ec3884473 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -1034,13 +1034,10 @@ rte_mempool_default_cache(struct rte_mempool *mp, unsigned lcore_id) * positive. * @param cache * A pointer to a mempool cache structure. May be NULL if not needed. - * @param flags - * The flags used for the mempool creation. - * Single-producer (MEMPOOL_F_SP_PUT flag) or multi-producers. */ static __rte_always_inline void __mempool_generic_put(struct rte_mempool *mp, void * const *obj_table, - unsigned n, struct rte_mempool_cache *cache) + unsigned int n, struct rte_mempool_cache *cache) { void **cache_objs; @@ -1096,14 +1093,10 @@ __mempool_generic_put(struct rte_mempool *mp, void * const *obj_table, * The number of objects to add in the mempool from the obj_table. * @param cache * A pointer to a mempool cache structure. May be NULL if not needed. - * @param flags - * The flags used for the mempool creation. - * Single-producer (MEMPOOL_F_SP_PUT flag) or multi-producers. */ static __rte_always_inline void rte_mempool_generic_put(struct rte_mempool *mp, void * const *obj_table, - unsigned n, struct rte_mempool_cache *cache, - __rte_unused int flags) + unsigned int n, struct rte_mempool_cache *cache) { __mempool_check_cookies(mp, obj_table, n, 0); __mempool_generic_put(mp, obj_table, n, cache); @@ -1125,11 +1118,11 @@ rte_mempool_generic_put(struct rte_mempool *mp, void * const *obj_table, */ static __rte_always_inline void rte_mempool_put_bulk(struct rte_mempool *mp, void * const *obj_table, - unsigned n) + unsigned int n) { struct rte_mempool_cache *cache; cache = rte_mempool_default_cache(mp, rte_lcore_id()); - rte_mempool_generic_put(mp, obj_table, n, cache, mp->flags); + rte_mempool_generic_put(mp, obj_table, n, cache); } /** @@ -1160,16 +1153,13 @@ rte_mempool_put(struct rte_mempool *mp, void *obj) * The number of objects to get, must be strictly positive. * @param cache * A pointer to a mempool cache structure. May be NULL if not needed. - * @param flags - * The flags used for the mempool creation. - * Single-consumer (MEMPOOL_F_SC_GET flag) or multi-consumers. * @return * - >=0: Success; number of objects supplied. * - <0: Error; code of ring dequeue function. */ static __rte_always_inline int __mempool_generic_get(struct rte_mempool *mp, void **obj_table, - unsigned n, struct rte_mempool_cache *cache) + unsigned int n, struct rte_mempool_cache *cache) { int ret; uint32_t index, len; @@ -1241,16 +1231,13 @@ __mempool_generic_get(struct rte_mempool *mp, void **obj_table, * The number of objects to get from mempool to obj_table. * @param cache * A pointer to a mempool cache structure. May be NULL if not needed. - * @param flags - * The flags used for the mempool creation. - * Single-consumer (MEMPOOL_F_SC_GET flag) or multi-consumers. * @return * - 0: Success; objects taken. * - -ENOENT: Not enough entries in the mempool; no object is retrieved. */ static __rte_always_inline int -rte_mempool_generic_get(struct rte_mempool *mp, void **obj_table, unsigned n, - struct rte_mempool_cache *cache, __rte_unused int flags) +rte_mempool_generic_get(struct rte_mempool *mp, void **obj_table, + unsigned int n, struct rte_mempool_cache *cache) { int ret; ret = __mempool_generic_get(mp, obj_table, n, cache); @@ -1282,11 +1269,11 @@ rte_mempool_generic_get(struct rte_mempool *mp, void **obj_table, unsigned n, * - -ENOENT: Not enough entries in the mempool; no object is retrieved. */ static __rte_always_inline int -rte_mempool_get_bulk(struct rte_mempool *mp, void **obj_table, unsigned n) +rte_mempool_get_bulk(struct rte_mempool *mp, void **obj_table, unsigned int n) { struct rte_mempool_cache *cache; cache = rte_mempool_default_cache(mp, rte_lcore_id()); - return rte_mempool_generic_get(mp, obj_table, n, cache, mp->flags); + return rte_mempool_generic_get(mp, obj_table, n, cache); } /** diff --git a/test/test/test_mempool.c b/test/test/test_mempool.c index 0a4423954..47dc3ac5f 100644 --- a/test/test/test_mempool.c +++ b/test/test/test_mempool.c @@ -129,7 +129,7 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache) rte_mempool_dump(stdout, mp); printf("get an object\n"); - if (rte_mempool_generic_get(mp, &obj, 1, cache, 0) < 0) + if (rte_mempool_generic_get(mp, &obj, 1, cache) < 0) GOTO_ERR(ret, out); rte_mempool_dump(stdout, mp); @@ -152,21 +152,21 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache) #endif printf("put the object back\n"); - rte_mempool_generic_put(mp, &obj, 1, cache, 0); + rte_mempool_generic_put(mp, &obj, 1, cache); rte_mempool_dump(stdout, mp); printf("get 2 objects\n"); - if (rte_mempool_generic_get(mp, &obj, 1, cache, 0) < 0) + if (rte_mempool_generic_get(mp, &obj, 1, cache) < 0) GOTO_ERR(ret, out); - if (rte_mempool_generic_get(mp, &obj2, 1, cache, 0) < 0) { - rte_mempool_generic_put(mp, &obj, 1, cache, 0); + if (rte_mempool_generic_get(mp, &obj2, 1, cache) < 0) { + rte_mempool_generic_put(mp, &obj, 1, cache); GOTO_ERR(ret, out); } rte_mempool_dump(stdout, mp); printf("put the objects back\n"); - rte_mempool_generic_put(mp, &obj, 1, cache, 0); - rte_mempool_generic_put(mp, &obj2, 1, cache, 0); + rte_mempool_generic_put(mp, &obj, 1, cache); + rte_mempool_generic_put(mp, &obj2, 1, cache); rte_mempool_dump(stdout, mp); /* @@ -178,7 +178,7 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache) GOTO_ERR(ret, out); for (i = 0; i < MEMPOOL_SIZE; i++) { - if (rte_mempool_generic_get(mp, &objtable[i], 1, cache, 0) < 0) + if (rte_mempool_generic_get(mp, &objtable[i], 1, cache) < 0) break; } @@ -200,7 +200,7 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache) ret = -1; } - rte_mempool_generic_put(mp, &objtable[i], 1, cache, 0); + rte_mempool_generic_put(mp, &objtable[i], 1, cache); } free(objtable); diff --git a/test/test/test_mempool_perf.c b/test/test/test_mempool_perf.c index 07b28c066..3b8f7de7c 100644 --- a/test/test/test_mempool_perf.c +++ b/test/test/test_mempool_perf.c @@ -186,7 +186,7 @@ per_lcore_mempool_test(void *arg) ret = rte_mempool_generic_get(mp, &obj_table[idx], n_get_bulk, - cache, 0); + cache); if (unlikely(ret < 0)) { rte_mempool_dump(stdout, mp); /* in this case, objects are lost... */ @@ -200,7 +200,7 @@ per_lcore_mempool_test(void *arg) while (idx < n_keep) { rte_mempool_generic_put(mp, &obj_table[idx], n_put_bulk, - cache, 0); + cache); idx += n_put_bulk; } } -- 2.14.1