From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0045.outbound.protection.outlook.com [104.47.42.45]) by dpdk.org (Postfix) with ESMTP id AB5A9199B4 for ; Thu, 7 Sep 2017 17:31:30 +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=IW2faDJle+cHBSZnnuK7QhP4tPlQlzDT/1k+qqNfC5OPEsdDuCfkkCIyE2Q9yA4HlnedEDFjyoF66OktwJ+cm5Wh5v1pwzXiIr4pdvzeDlDR767u6ZxdHOoKS4lm1wrjjVvMQXI6laP0NiAmYaH6gJ6vYwLgzVUlcbMyFKwQFq8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (14.140.2.178) by MWHPR07MB3101.namprd07.prod.outlook.com (10.172.95.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Thu, 7 Sep 2017 15:31:26 +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: Thu, 7 Sep 2017 21:00:35 +0530 Message-Id: <20170907153042.30890-2-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170907153042.30890-1-santosh.shukla@caviumnetworks.com> References: <20170906112834.32378-1-santosh.shukla@caviumnetworks.com> <20170907153042.30890-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0072.INDPRD01.PROD.OUTLOOK.COM (10.174.208.140) To MWHPR07MB3101.namprd07.prod.outlook.com (10.172.95.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33ff1d5c-9451-4b34-2eca-08d4f605824d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR07MB3101; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3101; 3:XPhqWINZrD0OWHCOLsT0SXXfmkErvzvdjUtcX5TK3NxBn30A824uYVlc3LWegxxZNlpJM4KIvf6f89H9aZS269+M8rsGa4nRHbG9D36yisneAbHO3MY37/TJWN3+TbdRhO7JJFOggrJiD96iMf9m6qS4kQdZMZHpusEVA6128eT3xUn/qJRiFxcPbexif0eXaTQHRBgH0vr7KLMPtSg1KVNAp7Z00bwvZNnyEPzvWsPraGdAKum+3H/+vRoL5nH8; 25:qa+axWjBFqz26aZkAMRJTWH9lhQo7bvpDbhRfyQuxY85pDjb+/qaI3rJIN+66skcj/5madXhOb7xL0s22+ZWvMt3Wavp3ZjVBub5NHc+/DWJ2+9gjD40GENBoCNjsM61gt5bkFByAk8WHf9A5OMpeT8NMshTtjLD+irzOta/mgxWtBzw1fOIu5RPNJET0RlwQnS4Bsn+AEuvqBU4SR0AonBOHX+GbAvg7oSmyXxWLKKTGFOFuomOkqb42sJGoXXuBUT1FCdrbXKjhpsrfXXWC081H1Hn/bU6goJPjA/eGDBwg7tvp+6veKMl77y+OAvfY2a8h8gfb1Bpa69tOtjHYg==; 31:rOvkCJCquvXz/Qvp/2BUf2zmtVFy3gV2GK/JzsEykWxXt7p+RZt4uY1tM/f3PL9ntYmrV+nevYb+QNydHvSjU/Ytp1nKTGBfhY6D7U0oDAJbIJCUiIYoDZel05JhEzxdG1B3ydgz4h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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)(20161123555025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3101; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3101; X-Forefront-PRVS: 04238CD941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(189002)(199003)(25786009)(5660300001)(50986999)(76176999)(42186005)(106356001)(105586002)(4326008)(33646002)(8656003)(66066001)(53936002)(36756003)(107886003)(110136004)(8936002)(50226002)(305945005)(8676002)(7736002)(5003940100001)(1076002)(6512007)(47776003)(81156014)(3846002)(50466002)(6116002)(5009440100003)(101416001)(68736007)(48376002)(97736004)(81166006)(189998001)(2906002)(72206003)(6506006)(2950100002)(42882006)(6666003)(478600001)(6486002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3101; 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; MWHPR07MB3101; 23:URPoqa0V+PdHU5dCm7GCPXmNP918syRat8w3oOXoW?= =?us-ascii?Q?ub42Fuym6p4bqrc/LT9Y0/BvIigNuzVAZb5siMexmah9HyDXlez04UV9AKvx?= =?us-ascii?Q?KA3o4edvhUhEAr3AaRlqOTNdUk4MyRY7APz5u7hvrcFXzPBB9UgQiyl9FyTi?= =?us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SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2017 15:31:26.4947 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3101 Subject: [dpdk-dev] [PATCH v6 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: Thu, 07 Sep 2017 15:31:31 -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