From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0106.outbound.protection.outlook.com [207.46.100.106]) by dpdk.org (Postfix) with ESMTP id 852859A87 for ; Sun, 10 May 2015 03:29:52 +0200 (CEST) Received: from CY1PR01MB1391.prod.exchangelabs.com (25.163.18.25) by CY1PR01MB1392.prod.exchangelabs.com (25.163.18.26) with Microsoft SMTP Server (TLS) id 15.1.154.19; Sun, 10 May 2015 01:29:49 +0000 Received: from CY1PR01MB1391.prod.exchangelabs.com ([25.163.18.25]) by CY1PR01MB1391.prod.exchangelabs.com ([25.163.18.25]) with mapi id 15.01.0154.018; Sun, 10 May 2015 01:29:49 +0000 From: "Clark, Gilbert" To: "Wiles, Keith" Thread-Topic: [dpdk-dev] Getting started - sanity check Thread-Index: AQHQinAxC3kaXoBYj06URka9hHWDrJ1z2QMAgABIYEw= Date: Sun, 10 May 2015 01:29:49 +0000 Message-ID: <1431221388952.74@ohio.edu> References: <1431188832058.4524@ohio.edu>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dpdk.org; dkim=none (message not signed) header.d=none; x-originating-ip: [24.160.185.15] x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR01MB1392; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(5005006)(3002001); SRVR:CY1PR01MB1392; BCL:0; PCL:0; RULEID:; SRVR:CY1PR01MB1392; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(164054003)(51704005)(377454003)(51914003)(24454002)(46102003)(102836002)(19580405001)(87936001)(54356999)(86362001)(15975445007)(88552001)(15395725005)(2656002)(122556002)(106116001)(90282001)(5001960100002)(117636001)(66066001)(40100003)(75432002)(110136002)(50986999)(76176999)(92566002)(89122001)(77156002)(62966003)(2900100001)(36756003)(19580395003)(2950100001)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR01MB1392; H:CY1PR01MB1391.prod.exchangelabs.com; FPR:; SPF:None; MLV:sfv; LANG:en; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: ohio.edu X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2015 01:29:49.0946 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f3308007-477c-4a70-8889-34611817c55a X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR01MB1392 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] Getting started - sanity check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2015 01:29:53 -0000 Thanks for the note! I'll take another look at it. Cheers, Gilbert ________________________________________ From: Wiles, Keith Sent: Saturday, May 9, 2015 12:41 PM To: Clark, Gilbert Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Getting started - sanity check Sent from my iPhone > On May 9, 2015, at 9:27 AM, Clark, Gilbert wrote: > > > Hi folks: > > I'm brand new to DPDK. Read about it off and on occasionally, but never = had the chance to sit down and play with things until now. It's been fun s= o far: just been working on a few toy applications to get myself started. > > I have run into a question, though: when calling rte_eth_tx_burst with a = ring-backed PMD I've set up, the mbufs I've sent never seem to be freed. T= his seems to make some degree of sense, but ... since I'm new, and because = the documentation says rte_eth_tx_burst should eventually free mbufs that a= re sent [1], I wanted to make sure I'm on track and not just misunderstandi= ng the way something works [2]. The mbufs are free as needed or when a watermark is hit in the driver. One = other thing I found is you need to send enough packets to hit the water mar= k for the tx mbufs start to get freed. Also you have to have enough mbufs a= llocated to hit these watermarks. I just pick two times the ring size just = to be safe. Hope that helps. > > Thanks, > Gilbert Clark > > [1] From http://dpdk.org/doc/api/rte__ethdev_8h.html : > > It is the responsibility of the rte_eth_tx_burst() function to transparen= tly free the memory buffers of packets previously sent > > [2] From lib/librte_pmd_ring.c: > > static uint16_t > eth_ring_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) > { > void **ptrs =3D (void *)&bufs[0]; > struct ring_queue *r =3D q; > const uint16_t nb_tx =3D (uint16_t)rte_ring_enqueue_burst(r->rng, > ptrs, nb_bufs); > if (r->rng->flags & RING_F_SP_ENQ) { > r->tx_pkts.cnt +=3D nb_tx; > r->err_pkts.cnt +=3D nb_bufs - nb_tx; > } else { > rte_atomic64_add(&(r->tx_pkts), nb_tx); > rte_atomic64_add(&(r->err_pkts), nb_bufs - nb_tx); > } > return nb_tx; > } > > This doesn't ever appear to free a transmitted mbuf ... unless there's co= de to do that somewhere else that I'm missing?