Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964824AbbLCKC6 (ORCPT ); Thu, 3 Dec 2015 05:02:58 -0500 Received: from mail-by2on0134.outbound.protection.outlook.com ([207.46.100.134]:38981 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932655AbbLCKCz (ORCPT ); Thu, 3 Dec 2015 05:02:55 -0500 From: Madalin-Cristian Bucur To: Scott Wood , "netdev@vger.kernel.org" CC: "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , "davem@davemloft.net" , Liberman Igal , Roy Pledge , "ppc@mindchasers.com" , "joe@perches.com" , "pebolle@tiscali.nl" , "joakim.tjernlund@transmode.se" , "gregkh@linuxfoundation.org" Subject: RE: [net-next v4 4/8] dpaa_eth: add driver's Tx queue selection Thread-Topic: [net-next v4 4/8] dpaa_eth: add driver's Tx queue selection Thread-Index: AQHRFYxKBBo3tcczr06MGvM1GLFqMp64aQmAgADKV0A= Date: Thu, 3 Dec 2015 10:02:53 +0000 Message-ID: References: <1446485500-9782-1-git-send-email-madalin.bucur@freescale.com> <1446485500-9782-5-git-send-email-madalin.bucur@freescale.com> <1449092431.29246.156.camel@freescale.com> In-Reply-To: <1449092431.29246.156.camel@freescale.com> 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@freescale.com; x-originating-ip: [192.88.146.1] x-microsoft-exchange-diagnostics: 1;BY1PR03MB1482;5:AfO6a2xgdyBhB/V46cT9RANaX5MwsDqocRwfYP1fWEpGHVZ8f0SmJguFbS7vxdRG/wEW8QDCSdmtaeWsqQ47rJm7o3i4KfJwlG47R10uIvzp+QNqQ4yhkLMmRK3biLDi5DC3kCvNsJ3Chl+Uw8PwdQ==;24:BkMMHfO+gPSIdXlmbqkT+ocGJe0/l9twFQouguMVfNNwgr/+wCqNoyjEqd607ZWv+gsGTgFZdEslRH4qdc/pEHA1uU9wH2v1rZxY59MjBJY= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1482; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(101931422205132); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046);SRVR:BY1PR03MB1482;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1482; x-forefront-prvs: 077929D941 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(13464003)(24454002)(199003)(377454003)(189002)(377424004)(5002640100001)(33656002)(19580405001)(87936001)(19580395003)(105586002)(99286002)(86362001)(106116001)(74316001)(101416001)(54356999)(50986999)(10400500002)(76176999)(106356001)(5003600100002)(66066001)(40100003)(5004730100002)(189998001)(81156007)(586003)(11100500001)(92566002)(5008740100001)(2950100001)(97736004)(5001770100001)(5001960100002)(102836003)(6116002)(1220700001)(122556002)(3846002)(1096002)(2900100001)(76576001)(2501003)(77096005);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1482;H:DM2PR0301MB0768.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2015 10:02:53.2851 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1482 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 base64 to 8bit by mail.home.local id tB3A34Z2012974 Content-Length: 4095 Lines: 105 > -----Original Message----- > From: Wood Scott-B07421 > Sent: Wednesday, December 02, 2015 11:41 PM > > On Mon, 2015-11-02 at 19:31 +0200, Madalin Bucur wrote: > > Allow the selection of the transmission queue based on the CPU id. > > Explain why. I'll add more details in the commit log. This is a customer generated feature. Bypassing the standard XPS can increase performance by making use of the DPAA HW particularities. > > > > Signed-off-by: Madalin Bucur > > --- > > drivers/net/ethernet/freescale/dpaa/Kconfig | 10 ++++++++++ > > drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 3 +++ > > drivers/net/ethernet/freescale/dpaa/dpaa_eth.h | 6 ++++++ > > drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c | 8 ++++++++ > > drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h | 4 ++++ > > 5 files changed, 31 insertions(+) > > > > diff --git a/drivers/net/ethernet/freescale/dpaa/Kconfig > > b/drivers/net/ethernet/freescale/dpaa/Kconfig > > index 022d5aa..2577aac 100644 > > --- a/drivers/net/ethernet/freescale/dpaa/Kconfig > > +++ b/drivers/net/ethernet/freescale/dpaa/Kconfig > > @@ -11,6 +11,16 @@ menuconfig FSL_DPAA_ETH > > > > if FSL_DPAA_ETH > > > > +config FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE > > + bool "Use driver's Tx queue selection mechanism" > > + default y > > + ---help--- > > + The DPAA Ethernet driver defines a ndo_select_queue() callback > > for optimal selection > > + of the egress FQ. That will override the XPS support for this > > netdevice. > > + If for whatever reason you want to be in control of the egress FQ > > -to-CPU selection and mapping, > > + or simply don't want to use the driver's ndo_select_queue() > > callback, then unselect this > > + and use the standard XPS support instead. > > Is there a use case for needing this to be configurable? If the standard XPS is desired, the Kconfig option allows the driver user to select that. > > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > > b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > > index 31d55b4..894f1a7 100644 > > --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > > +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > > @@ -390,6 +390,9 @@ static const struct net_device_ops dpa_private_ops = > { > > .ndo_get_stats64 = dpa_get_stats64, > > .ndo_set_mac_address = dpa_set_mac_address, > > .ndo_validate_addr = eth_validate_addr, > > +#ifdef CONFIG_FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE > > + .ndo_select_queue = dpa_select_queue, > > +#endif > > .ndo_change_mtu = dpa_change_mtu, > > .ndo_set_rx_mode = dpa_set_rx_mode, > > .ndo_init = dpa_ndo_init, > > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h > > b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h > > index 1ba6617..87577cf 100644 > > --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h > > +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h > > @@ -420,9 +420,15 @@ static inline void _dpa_assign_wq(struct dpa_fq > *fq) > > } > > } > > > > +#ifdef CONFIG_FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE > > +/* Use in lieu of skb_get_queue_mapping() */ > > +#define dpa_get_queue_mapping(skb) \ > > + raw_smp_processor_id() > > +#else > > /* Use the queue selected by XPS */ > > #define dpa_get_queue_mapping(skb) \ > > skb_get_queue_mapping(skb) > > +#endif > > Why is this necessary? Shouldn't providing a custom .ndo_select_queue() > be > sufficient to ensure that skb_get_queue_mapping() returns the same thing? dpa_get_queue_mapping() is used in more than one place, the ndo function cannot be used directly in all places, the current setup is justified. > And if this goes away, it's just a matter of a function pointer, so if it > does > need to be configurable it could be a runtime option. > > -Scott It's used on the hot path, adding an extra indirection layer to make it selectable at runtime would defeat the purpose... Madalin ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?