From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0059.outbound.protection.outlook.com [157.56.110.59]) by dpdk.org (Postfix) with ESMTP id 8F8002A07 for ; Fri, 10 Jun 2016 21:09:04 +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=QQ7dIMkTp84KQbhTK4bFpyKyrNwVLgmC/1ejGp7YhTw=; b=DY3IJeOtGyx9+ohrXk2/ykledUAR4CSaX7VC1OFjrrnPdlG5mPWnStk4qSE6YKYjJJxy+dV93Fbsetz3uA3850xTW3Y7pq7mt53hiZLeNgSC4pMXEOVCBoLpmKxLFPNGW15H66E+zWu8iLEcTL7cMDYETAYLgrCrLCw2HOCF2cQ= Received: from DM2PR0201MB0832.namprd02.prod.outlook.com (10.160.95.153) by DM2PR0201MB0830.namprd02.prod.outlook.com (10.160.95.151) with Microsoft SMTP Server (TLS) id 15.1.511.8; Fri, 10 Jun 2016 19:09:03 +0000 Received: from DM2PR0201MB0832.namprd02.prod.outlook.com ([10.160.95.153]) by DM2PR0201MB0832.namprd02.prod.outlook.com ([10.160.95.153]) with mapi id 15.01.0511.010; Fri, 10 Jun 2016 19:09:03 +0000 From: "Wu, Xiaoban" To: "users@dpdk.org" Thread-Topic: A minor suggestion to the comment of the rte_eth_tx_burst() of dpdk-16.04 Thread-Index: AQHRw0L3qVAEuVInOUauhAuJZjnD7A== Date: Fri, 10 Jun 2016 19:09:03 +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: 9b091cc1-a710-4ef3-94bf-08d39162b002 x-microsoft-exchange-diagnostics: 1; DM2PR0201MB0830; 5:0/VeXZ4NLplfhV9Ns1qhq22CUFJFMrIWn+DvRCcoznlV7rX0dSM3rDDiSu+db0sPAoA+jUETSCCyVeRpPOn1QdjtfP7e9QtaDSx8iY7KHYrOPV9GtSX/LpJuStzAy5SPlZI0wgL0km5/pgRyYGgC9w==; 24:+iqujjl/JHQRUx3XHQNavhMLBDoEZjvO6ikK5mff9ElT55fGDDwMjl8QYP8i4tQ36Qax2/6A8ZK4mftI52/YUCpOzTYWxV2+9sbKv5Lvsq0=; 7:Az2dFliOvB1/zligM/ea1hc0/+onAGb2qdFIj+UbrI/FJifTsoGrtRe8u0TkbH6fMEyMTOqAPNxgL6kiuvaCK9XUR8lA64ZF/guSIWkYqAl9qqPQliYQ76f0zXKqlnKac+s4dCIOktjizPwKatYsAu7ij20B83xbQeqN/b+ue6gnkVI+HO3sIMON/EmhrGn5cwW9lLLzLG1cWeAaRPmpyPLbd4zXkoXqcBewVOBJQVU= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0201MB0830; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:DM2PR0201MB0830; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0201MB0830; x-forefront-prvs: 096943F07A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(189002)(199003)(5003600100002)(106116001)(586003)(102836003)(6116002)(66066001)(3846002)(99286002)(68736007)(74316001)(77096005)(189998001)(10400500002)(16236675004)(105586002)(2906002)(2501003)(5002640100001)(88552002)(87936001)(3660700001)(54356999)(2351001)(229853001)(33656002)(9686002)(110136002)(106356001)(2900100001)(3280700002)(5004730100002)(122556002)(5640700001)(19625215002)(101416001)(8676002)(89122001)(86362001)(450100001)(19627405001)(97736004)(8936002)(50986999)(1730700003)(81166006)(11100500001)(81156014)(107886002)(5008740100001)(92566002)(76576001)(75432002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0201MB0830; H:DM2PR0201MB0832.namprd02.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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: 10 Jun 2016 19:09:03.2653 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4c25b8a6-17f7-46f9-83f0-54734ab81fb1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0201MB0830 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 minor suggestion to the comment of the rte_eth_tx_burst() 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 19:09:05 -0000 Dear DPDK Users, I have a very small suggestion to the comment of the rte_eth_tx_burst(). It= is not a big deal to the experienced users, but I think this will make the= new users know how to use this function more clearly and see the big pictu= re easily. The comment of "tx_pkts" says: * @param tx_pkts * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures * which contain the output packets. I am a beginner of DPDK. If I see this comment I would probably naively use= rte_zmalloc() to construct such pointer array, for each pointer I use rte_= malloc() to allocate memory, and finally fill the memory starting from the = position (pointed by the macro rte_pktmbuf_mtod()) with real packet content= (header and payload). But I just find that the rte_eth_tx_burst() will call the rte_pktmbuf_free(= ) to free the struct rte_mbuf. In default, "CONFIG_RTE_LIBRTE_MBUF_DEBUG=3D= n", this means it will skip the __rte_mbuf_sanity_check(), and will finally= get into rte_mempool_put(). Since above construction process skip the cons= truction of the field "struct rte_mempool", it means the "struct rte_mempoo= l" field is null in each packet "struct rte_mbuf"(of course, all the fields= are zero). Hence it will finally cause segmentation fault. Thus, I have a very small suggestion, please add something like "It is reco= mmended that the tx_pkts is constructed by rte_pktmbuf_pool_create() combin= ed with rte_mempool_get_bulk(), if not please make sure the fields of the s= truct rte_mbuf are correctly configured." Thank you, Xiaoban