Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753301AbbLCThU (ORCPT ); Thu, 3 Dec 2015 14:37:20 -0500 Received: from mail-bl2on0105.outbound.protection.outlook.com ([65.55.169.105]:22286 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753194AbbLCThQ (ORCPT ); Thu, 3 Dec 2015 14:37:16 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=scottwood@freescale.com; Message-ID: <1449171424.15946.17.camel@freescale.com> Subject: Re: [net-next v4 4/8] dpaa_eth: add driver's Tx queue selection From: Scott Wood To: Bucur Madalin-Cristian-B32716 , "netdev@vger.kernel.org" CC: "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , "davem@davemloft.net" , Liberman Igal-B31950 , Pledge Roy-R01356 , "ppc@mindchasers.com" , "joe@perches.com" , "pebolle@tiscali.nl" , "joakim.tjernlund@transmode.se" , "gregkh@linuxfoundation.org" Date: Thu, 3 Dec 2015 13:37:04 -0600 In-Reply-To: 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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5-1ubuntu3 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Originating-IP: [2601:448:8180:cfa:12bf:48ff:fe84:c9a0] X-ClientProxiedBy: DM2PR0801CA0008.namprd08.prod.outlook.com (25.162.18.18) To BY1PR03MB1481.namprd03.prod.outlook.com (25.162.210.14) X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1481;2:Oixc8AJmwqTDnNKgAzDn4Wu0D70k3EGoc8XHyDstEhAqbWqfbCogmL/wbcLCI7JsfbBzU6VCGDcDsjMW+dkmW1tqF6fJpAqq0i1d8nYLVKWl38XClX7S/SWhoyc/NXf1BGhdvLyObLGHdGt4GCx3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GjrEMlzFBxz/28B5IGpFkkSDcafle+k/6QPgVo2z7WXhhkZq0j8vwrGQI+mDOeVw2uGlddqCJXP7RHbIIR7QBILzBEdiAhgpCiMa6nWfyV1gMifoq14zq+wBkjTUH/p3EL1ID1/3zBtEzDBOE1v6/gI9tWaXnH2MWZ8wdBvhTGqcPmsNQxj4c5YZTnhEfBeuZxji6vq3ZT36RASNDkR90YyUpWTOpraHGmeQE4L8Z1mHaTX5p9mxadfF1OmZ15XJ6+XkL90Cc3DsSmxJAjY6GkW9H+VUgIGB8uhgXYTERxyfhfPep2kumvIKby9H5vr6HJB6xcu+MuKuC4ZavOYYUWA8JV4rS9sPPmnDm8b6FPW654l/OwBZMWTOH4x4P7XQtuyOu0U51Uj9M65 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(10201501046)(3002001);SRVR:BY1PR03MB1481;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1481; X-Forefront-PRVS: 077929D941 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(199003)(377424004)(189002)(13464003)(24454002)(40100003)(586003)(101416001)(93886004)(122386002)(42186005)(105586002)(106356001)(33646002)(5001960100002)(86362001)(97736004)(5001770100001)(81156007)(189998001)(87976001)(47776003)(50466002)(23676002)(230700001)(50986999)(1096002)(1706002)(36756003)(103116003)(2501003)(76176999)(77096005)(5820100001)(50226001)(92566002)(6116002)(19580405001)(5008740100001)(2950100001)(19580395003)(5004730100002)(99106002)(3826002)(19627235001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1481;H:[IPv6:2601:448:8180:cfa:12bf:48ff:fe84:c9a0];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTFQUjAzTUIxNDgxOzIzOnFTbj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kS44INM058GZvhgHuBfv6uprYcfr79Xv3zv7c+9g==;24:8lmbBZ0X5Nt9tv456hNi+oA1T6WMQYQFupXyfuWv8zNuUP7ljGeerrYgFpg/IT5OOSxJ2dKQY2Osv2/jfYOsrxsWkbZ6KKud+m+qgxuFu1I= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2015 19:37:11.8787 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1481 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4908 Lines: 127 On Thu, 2015-12-03 at 04:02 -0600, Bucur Madalin-Cristian-B32716 wrote: > > -----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. Under what circumstances does it make sense to desire this? Could you put the answer to that in the help text? > > > 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. It's called in two places that I see. For the call in dpa_tx(), when will skb_get_queue_mapping() not return the correct answer? For the call in dpa_select_queue(), that's already called via function pointer so it would not be a new indirection layer. > > 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... "if this goes away" I wasn't asking for a new indirection layer. -Scott -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/