From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0085.outbound.protection.outlook.com [157.56.111.85]) by dpdk.org (Postfix) with ESMTP id 29218ADB4 for ; Tue, 7 Jun 2016 22:52:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=studentuml.onmicrosoft.com; s=selector1-student-uml-edu; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=DxGtasHE3ba2Z6v4M7wjd5EebG8uIehZXPY7VjdaAxk=; b=X265G2eVdOzPsNrvJEIwpxjA9oNWpui9SIFBb/gfjvEc9Z272xfyDz30BFcm/wlQf08jq0PONbcnu42HEp7j08bG7k/6jqj7fLI2Ufv6GhNdUdrXzHMDpSF+wbL0KhF3YwTtuRR779ZLtnNarOoPozjdkgyvaK2i4P75Gu75SRk= Received: from CY1PR0201MB0827.namprd02.prod.outlook.com (10.160.141.28) by CY1PR0201MB0825.namprd02.prod.outlook.com (10.160.141.26) with Microsoft SMTP Server (TLS) id 15.1.506.9; Tue, 7 Jun 2016 20:52:26 +0000 Received: from CY1PR0201MB0827.namprd02.prod.outlook.com ([10.160.141.28]) by CY1PR0201MB0827.namprd02.prod.outlook.com ([10.160.141.28]) with mapi id 15.01.0506.014; Tue, 7 Jun 2016 20:52:26 +0000 From: "Wu, Xiaoban" To: "users@dpdk.org" Thread-Topic: A question about the function __mempool_get_bulk() of dpdk-16.04 Thread-Index: AQHRwP31t+1kYC5IZEeQKPdLBGYLbA== Date: Tue, 7 Jun 2016 20:52:25 +0000 Message-ID: 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=Xiaoban_Wu@student.uml.edu; x-originating-ip: [25.164.65.132] x-ms-office365-filtering-correlation-id: f90f5539-a55e-4d8d-3ca3-08d38f15a1d6 x-microsoft-exchange-diagnostics: 1; CY1PR0201MB0825; 5:A33Aek7VmeXTD4OzN1+/gQ6SCPtBqt5FZ4QDJGpEXZblRsQWBMhyIDPJYf+RZYpqPEC0MrFeYpza+0P9gzZDwuF38k/A5uESmUE9svwDlvRH4qFoDdHdxHvWtfiRVZiQwKx6hzB87DUzWwSI3f0nQA==; 24:/0rfFHMrdvbvFdZauBVIOGSNmrfnZUk2REG4viTbZSdER7lJrdf+2XNqPV3lOHqvJ53NT1wGn3L1EQ6dPNwxgTTRn8hiYKnskTZm7emk9Ac=; 7:pnLGdYzlyjFGK6UDmMN9i5PymcqlTGaXRf46wlyG0mNnP49yuYSN1UIEGsRCXa6xQLrZwG5IrFyS2zDb1/y0cKvM5oKuyXYYuESufnpByB29xS+bOOTYnFbXNsHtSgbtM1+cvYXZoQ636vsMAfw6HCIWyFkd6othxiIOnWbvOyZnbRfCyPd05ReaoPZbRM0C4AwkndE/C1Px5ZlbHj7+K6gp98WjZ+vtzszkADsezeE= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB0825; 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)(3002001)(10201501046); SRVR:CY1PR0201MB0825; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB0825; x-forefront-prvs: 09669DB681 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(50986999)(5004730100002)(2906002)(189998001)(11100500001)(9686002)(101416001)(8676002)(5008740100001)(87936001)(86362001)(5003600100002)(102836003)(75432002)(81166006)(6116002)(19625215002)(81156014)(1730700003)(5002640100001)(54356999)(586003)(97736004)(89122001)(92566002)(16236675004)(19627405001)(3846002)(99286002)(33656002)(68736007)(122556002)(110136002)(2900100001)(77096005)(107886002)(5640700001)(106116001)(106356001)(74316001)(3280700002)(8936002)(2351001)(10400500002)(88552002)(76576001)(229853001)(2501003)(105586002)(450100001)(3660700001)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0825; H:CY1PR0201MB0827.namprd02.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: student.uml.edu does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: student.uml.edu X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jun 2016 20:52:25.9597 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4c25b8a6-17f7-46f9-83f0-54734ab81fb1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB0825 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [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: Tue, 07 Jun 2016 20:52:27 -0000 Dear DPDK Users, I have been reading the pktgen-3.0.02 source codes with dpdk-16.04. In the pktgen.c, function pktgen_send_pkts(), line 1098, it calls function = wr_pktmbuf_alloc_bulk_noreset(). Then it calls the function rte_mempool_ge= t_bulk() which calls the function __mempool_get_bulk(). Since in the function rte_pktmbuf_pool_create(), the "flags" is set to zero= in default, this leads to that when calling __mempool_get_bulk(), the inpu= t 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. My question is why at line 992, this has to return 0? In the line 941, the = comment says that ">=3D0: Success; number of objects supplied." I am confu= sed by this comment, since in line 985-990, we can see that the input param= eter "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;"= ? Am I missing something here? Thank you so much for your help. All the best, Xiaoban