From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0087.outbound.protection.outlook.com [157.56.112.87]) by dpdk.org (Postfix) with ESMTP id 0D7EE2A5F for ; Fri, 10 Jun 2016 15:00:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4ZFRKEv5wXEpaczRAnCmPABKJfuIxZ26Z5fduZ9sAMg=; b=sg1XyXAz/EQ5bXIKWay8qZ2fetuX2Gn2A6VJOl9EDh/Aci4HEqYG2tO3pLd1qmeJl/9iEwQirLSp3gnzahzzouMDrdpHdp6Yr/7Oyd+5Qem80F+zEUKR84zq8Vp4Foiiv80whi7PfG/Y19hcfPGemJRYSAyWuW9C3C+0g0FV6tg= Received: from DB5PR0401MB2054.eurprd04.prod.outlook.com (10.166.11.137) by DB5PR0401MB2054.eurprd04.prod.outlook.com (10.166.11.137) with Microsoft SMTP Server (TLS) id 15.1.517.8; Fri, 10 Jun 2016 13:00:39 +0000 Received: from DB5PR0401MB2054.eurprd04.prod.outlook.com ([10.166.11.137]) by DB5PR0401MB2054.eurprd04.prod.outlook.com ([10.166.11.137]) with mapi id 15.01.0517.005; Fri, 10 Jun 2016 13:00:39 +0000 From: Shreyansh Jain To: "Wu, Xiaoban" CC: "users@dpdk.org" Thread-Topic: [dpdk-users] A question about the function __mempool_get_bulk() of dpdk-16.04 Thread-Index: AQHRwP31t+1kYC5IZEeQKPdLBGYLbJ/iq9wA Date: Fri, 10 Jun 2016 13:00:38 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; x-originating-ip: [192.88.169.1] x-ms-office365-filtering-correlation-id: 9bbe9d02-ba3a-4697-6e3c-08d3912f38b4 x-microsoft-exchange-diagnostics: 1; DB5PR0401MB2054; 6:ftA6AVe8k9EuiY9rXyM4BM1SffAzY00KWTaSMkeGqcMPa/PlgK+6ytobluJyoiuLpXXJBG/6w65bqiG9D845r3x2yPQe1v37WXqdE68a3b/4jMlZtNA4Q4U9BIlpzx7CR2tIB36rqItXTOfVy7iqicL51X6zI+oH5w2EKB3OnlngTyICHHtosUCPDL5rPOgAylE/gxkiurFm9nzhOZJb2M96nYoe51ks/gUvbozybYv/RgeHluEW6w9A2dnClenxk5dBzcqGs+Me9PF41QJ9c8R81FlcPB2bK2yOKqBDOirdltfH+It2oAiO0Zou3qv+hnnfHP/bRKko9BLyN2EApQ==; 5:UDtQIqiK9QthKxE+RpG7EJG12I98+eANoGl52onzxjDdyqVXxCE09fQtl2FYyO85cVsVjtCCJW5moyQ8bL1wKqNz6KtuShlqdEfyyrCh04DxnfqdCNri9F/BetB+Dm+MJ6vIY/3wlraVh4maUwMRzw==; 24:h5lVakUD4iOxMRKg37ojQ4WzdhCM5hocb8N2r4s9DmUW5l3aVqN5tYj+cMJi7Zhyh4rzcNiUjIoFoeIVQ4y/P/gMdw+Sal/hQRInRHWcr54=; 7:m8tzAFXAnLp+AQnJoXkeKw2L91T1FcHjMRbwtJOyoMhC7SBSXXmH/2uY5uluqGZM3HtHh8F4aRWMcHF5Ecaa+2eCLAz0VLsRnCRMwYHhjt1T7YlhziJCps69/v/0HuUZs1j271+agRx/qnGiOkJ/Iq+5A/7AEmgiSdeY8NVxcOKgBXx39ar0WZpDa1WZLia0RX2mZmpNGTO7jrGe8ZLLx2SQ+85HjGKtbGw/wrivJFg= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR0401MB2054; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:DB5PR0401MB2054; BCL:0; PCL:0; RULEID:; SRVR:DB5PR0401MB2054; x-forefront-prvs: 096943F07A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(13464003)(189002)(377454003)(199003)(76576001)(86362001)(74316001)(11100500001)(189998001)(33656002)(2171001)(97736004)(5004730100002)(4326007)(110136002)(122556002)(10400500002)(87936001)(2900100001)(2950100001)(2906002)(81166006)(81156014)(8666004)(66066001)(101416001)(586003)(3846002)(9686002)(8936002)(68736007)(77096005)(76176999)(5002640100001)(54356999)(92566002)(105586002)(106356001)(50986999)(3660700001)(3280700002)(102836003)(6116002)(106116001)(19580395003)(5008740100001)(5003600100002)(19580405001)(7059030)(48284002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR0401MB2054; H:DB5PR0401MB2054.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; CAT:NONE; LANG:en; CAT:NONE; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2016 13:00:38.9250 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR0401MB2054 Subject: Re: [dpdk-users] A question about the function __mempool_get_bulk() of dpdk-16.04 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 13:00:40 -0000 Hi, > -----Original Message----- > From: users [mailto:users-bounces@dpdk.org] On Behalf Of Wu, Xiaoban > Sent: Wednesday, June 08, 2016 2:22 AM > To: users@dpdk.org > Subject: [dpdk-users] A question about the function __mempool_get_bulk() = of > dpdk-16.04 >=20 > Dear DPDK Users, >=20 >=20 > I have been reading the pktgen-3.0.02 source codes with dpdk-16.04. >=20 >=20 > In the pktgen.c, function pktgen_send_pkts(), line 1098, it calls functio= n > wr_pktmbuf_alloc_bulk_noreset(). Then it calls the function > rte_mempool_get_bulk() which calls the function __mempool_get_bulk(). >=20 >=20 > Since in the function rte_pktmbuf_pool_create(), the "flags" is set to ze= ro > in default, this leads to that when calling __mempool_get_bulk(), the inp= ut > parameter"is_mc=3D=3D1". Hence the function __mempool_get_bulk() will exe= cute the > line 961-992 except that when "ret" is less that 0. I too observed this issue a few days back.=20 [I ended up changing DPDK code to get around it - some use-case I don't rec= all now]. >=20 >=20 > My question is why at line 992, this has to return 0? In the line 941, th= e > comment says that ">=3D0: Success; number of objects supplied." I am con= fused > by this comment, since in line 985-990, we can see that the input paramet= er > "obj_table" is supplied by new values and the number of the new values is > "n". Does this means that we need to "return n;" instead of "return 0;"? Probably, what is happening is that all calls to __mempool_get_bulk in DPDK= code base are not worrying about a return value stating number of objects/= buffers handled. They just require a positive number and are satisfied with= '0'. Reading through the API itself, I was not sure if it indeed should return t= he count or not. Given the pktgen use-case, 'count' looks more probable. An= d even if modified, it wouldn't break any call flow - AFAIK. Probably guys on devel@ can help us. >=20 >=20 > Am I missing something here? Thank you so much for your help. >=20 >=20 > All the best, >=20 > Xiaoban - Shreyansh