Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753133AbcKGXeV (ORCPT ); Mon, 7 Nov 2016 18:34:21 -0500 Received: from mail-db5eur01on0063.outbound.protection.outlook.com ([104.47.2.63]:50656 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752165AbcKGXeT (ORCPT ); Mon, 7 Nov 2016 18:34:19 -0500 From: Madalin-Cristian Bucur To: David Miller CC: "netdev@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , "oss@buserror.net" , "ppc@mindchasers.com" , "joe@perches.com" , "pebolle@tiscali.nl" Subject: RE: [PATCH net-next v6 02/10] dpaa_eth: add support for DPAA Ethernet Thread-Topic: [PATCH net-next v6 02/10] dpaa_eth: add support for DPAA Ethernet Thread-Index: AQHSNUiNwT1IEjDDuEKEIZQjO6RoxqDHrqoAgAXcWyCAACkAAIAAB8RggAAEuICAAAFjIA== Date: Mon, 7 Nov 2016 16:59:14 +0000 Message-ID: References: <20161107.105500.43380129278294700.davem@davemloft.net> <20161107.113941.669208733868640796.davem@davemloft.net> In-Reply-To: <20161107.113941.669208733868640796.davem@davemloft.net> 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=madalin.bucur@nxp.com; x-originating-ip: [192.88.146.1] x-ms-office365-filtering-correlation-id: 11989698-0674-4adf-715b-08d4072f6743 x-microsoft-exchange-diagnostics: 1;AM4PR04MB1602;7:vBBjRVmHMbPmtBB+8iiT1jAmGWv3yrAkcScnw4bLjai68UtSYiUJ6fuqlju3diseZcCN+6cicL1ItPcKR+K5oHLblrlVDXGL/rM4V9n51tNDIgwWrDhj7kc1QqaovbVI15ucMgMAGUL5K2DHSZW07HSxZ2k6HmRwu+0yD9JRTbhpwemQPFAoL/dCXpGF75u+vZpl3Ujx677i5j+MBu9whsVA66sg7WT04MBsvofN7FHtFK7Jbr3VaQWbDTcSfICvVkNi+WLGoyw9GXV6Kx6lrrVkql4hFFiaGX2I11ZxAD6wczqjOVPZKpLDDNokPHIVFtLFarpduycxWSIVf+ejeNcJuCgYbK5C1F7urZVsQ2U= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM4PR04MB1602; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6045074)(6060229)(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6061226)(6046074);SRVR:AM4PR04MB1602;BCL:0;PCL:0;RULEID:;SRVR:AM4PR04MB1602; x-forefront-prvs: 0119DC3B5E x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(377454003)(199003)(105586002)(97736004)(305945005)(7736002)(8676002)(8936002)(74316002)(86362001)(66066001)(50986999)(76176999)(81166006)(54356999)(81156014)(2906002)(101416001)(11100500001)(9686002)(3660700001)(6116002)(93886004)(2900100001)(3280700002)(102836003)(189998001)(76576001)(6916009)(7696004)(19580405001)(2950100002)(110136003)(68736007)(106116001)(5660300001)(19580395003)(92566002)(7846002)(3846002)(33656002)(122556002)(4326007)(77096005)(5002640100001)(586003)(10400500002)(87936001)(106356001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR04MB1602;H:AM4PR04MB1604.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2016 16:59:14.2252 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR04MB1602 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uA7NYOFF003508 Content-Length: 2072 Lines: 49 > From: David Miller [mailto:davem@davemloft.net] > Sent: Monday, November 07, 2016 6:40 PM > > From: Madalin-Cristian Bucur > Date: Mon, 7 Nov 2016 16:32:16 +0000 > > >> From: David Miller [mailto:davem@davemloft.net] > >> Sent: Monday, November 07, 2016 5:55 PM > >> > >> From: Madalin-Cristian Bucur > >> Date: Mon, 7 Nov 2016 15:43:26 +0000 > >> > >> >> From: David Miller [mailto:davem@davemloft.net] > >> >> Sent: Thursday, November 03, 2016 9:58 PM > >> >> > >> >> Why? By clearing this, you disallow an important fundamental way to > >> >> do performane testing, via pktgen. > >> > > >> > The Tx path in DPAA requires one to insert a back-pointer to the skb > >> > into > >> > the Tx buffer. On the Tx confirmation path the back-pointer in the > >> > buffer > >> > is used to release the skb. If Tx buffer is shared we'd alter the > >> > back-pointer > >> > and leak/double free skbs. See also > >> > >> Then have your software state store an array of SKB pointers, one for > each > >> TX ring entry, just like every other driver does. > > > > There is no Tx ring in DPAA. Frames are send out on QMan HW queues > > towards the FMan for Tx and then received back on Tx confirmation queues > > for cleanup. > > Array traversal would for sure cost more than using the back-pointer. > > Also, we can now process confirmations on a different core than the one > > doing Tx, > > we'd have to keep the arrays percpu and force the Tx conf on the same > > core. Or add locks. > > Report back an integer index, like every scsi driver out there which > completes tagged queued block I/O operations asynchronously. You can > associate the array with a specific TX confirmation queue. >From HW? It only gives you back the buffer start address (plus length, etc). "buff_2_skb()" needs to be solved in SW, expensively using array (lists? As the number of frames in flight can be large/variable) or cheaply with the back pointer. The back-pointer approach has its tradeoffs: no shared skbs, imposed non-zero needed_headroom.