Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754960AbbLBVzX (ORCPT ); Wed, 2 Dec 2015 16:55:23 -0500 Received: from mail-by2on0122.outbound.protection.outlook.com ([207.46.100.122]:53856 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750798AbbLBVzV (ORCPT ); Wed, 2 Dec 2015 16:55:21 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=scottwood@freescale.com; Message-ID: <1449092431.29246.156.camel@freescale.com> Subject: Re: [net-next v4 4/8] dpaa_eth: add driver's Tx queue selection From: Scott Wood To: , CC: , , , , , , , , , Date: Wed, 2 Dec 2015 15:40:31 -0600 In-Reply-To: <1446485500-9782-5-git-send-email-madalin.bucur@freescale.com> References: <1446485500-9782-1-git-send-email-madalin.bucur@freescale.com> <1446485500-9782-5-git-send-email-madalin.bucur@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: BY2PR05CA041.namprd05.prod.outlook.com (10.141.250.31) To BN3PR03MB1479.namprd03.prod.outlook.com (25.163.35.142) X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1479;2:uFlutoHIuQiaU/buruL9DO9n2gkDEdmxw2dXc8OJnFgEqrBEIhlftvQ9SHYgs9z83GavfgrVGFchwe2npqsO2oAkKauA+WSb4gBSYpUIWAKJ+a3rd4TgyIAGJvReGJzSw0BVRVc51WCQNvkKYKDsvg==;3:8BGpxAqOhKUEdbTe+sy9M1rCXxwFyYJjeDIPDEftmNpzQy4v59NlFkjlxmqwNl+a0Ur0nXpYVxJiubPNAste90Gt97xB9UKMAwFfOHaqMegNZs0L4416vwArhD7KpnGO;25:B+GDw6BUo2R5x9cP1YI/W9PdrfiIxuCKICNHJvnBjXO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LdaYzTCZZqFTjkJLh0KMxlw+6jIowWQZWOZsu4Q5/pvEx5LaM/RJNl2NvNRcCuJz3FFhaO76F1Qo3F7wuVFeHfQGa2UfAwExz3rHvjHJko8gS3c4Ohzb14pwsL9kRqcQRVEqLo2fAx388syC98WtGWm21NocHAYWXjASk+2ximZ7/oZmiwZfNDbY1763lRAu7MziQfh657HiKGGjwxebU7HFU 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)(3002001)(10201501046);SRVR:BN3PR03MB1479;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1479; X-Forefront-PRVS: 077884B8B5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(979002)(6009001)(189002)(199003)(24454002)(377424004)(105586002)(106356001)(101416001)(19580405001)(81156007)(23676002)(19580395003)(122386002)(42186005)(87976001)(50226001)(47776003)(103116003)(33646002)(86362001)(2950100001)(77096005)(92566002)(586003)(5820100001)(5004730100002)(189998001)(76176999)(1706002)(1096002)(230700001)(97736004)(36756003)(5001960100002)(5001770100001)(40100003)(50466002)(50986999)(5008740100001)(6116002)(99106002)(3826002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3PR03MB1479;H:[IPv6:2601:448:8180:cfa:12bf:48ff:fe84:c9a0];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjNQUjAzTUIxNDc5OzIzOmd3T2J5cG5DcEtoYjN6ZXNxb0UyUXhGRFcv?= =?utf-8?B?Z2d5VnRhc05kTGxGeStybURjaG42STlBZk1KKzZBM3VFTlFMY0RxYU1LbGFt?= =?utf-8?B?Q05mZGxadzBMZW1aMFNxYmlvQmdsNkNlVzlCT1BlY0VHVDdXNVlwckJWSGNu?= =?utf-8?B?azRF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?B?MXFxUEE5SWlwUXVDL0FybUhQWFhYcmNLS2NrTnpaRzAyRE1lZDJKM0JncnRa?= =?utf-8?B?QkptWFhlYTJqNm1PckVTR3p1S0hyNzBFSGk1SjB4bDNweTE4a21KbTBQVmhF?= =?utf-8?B?b09PV0tDQVo1UUNrbFk4TFBEYVNJRWhKNEJRYjVRUDlNbUsvZ3hockFMZHF6?= =?utf-8?B?MHZmQkFrYWFUeWVzSFpLd3ZaTkhRSmtEcVdwclRHTlc5U2Q3RTRKVFBsR1Mv?= =?utf-8?B?cEZLYjI5ZTVEVjVYaWY5djFXR0dUazJSc0Flbk1aZXN5bDVQdkhBRExITzdM?= =?utf-8?B?eG9HTWtDQ3YxeldEOUN3Z1FoeDc0S2ptOFhjWG1QeCtXUWdvcTQ0eGN6Vlcw?= =?utf-8?B?Q3VvOGwrMjE3MkhlT0hzTWhwTGQrdjhETGszRlZ2ZENMS1pzZVVHMkJ4VVhB?= =?utf-8?B?U29NT2lhT3F2VHYxVlExSTZRMk12SXpHcnZWMXp2OC9pNlYwY3pHL2gyMkVM?= =?utf-8?B?K0VHbkN3VEZhaURuR0hWR0hicEpFUVVESHNuSlhxM0dxVGhub1BqaE1xRmlD?= =?utf-8?Q?WDjNRZKIqzOawWMjcbol?= X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1479;5:KaQfnt6Qr9UrhS+iJQxCimLjXLyHvvQs383IcH3bqQiexgYj4zEytlh1rsUfRBGaeT4l1GujWKV9R5ERdUzWrIyk8LcpVjB9KubBOQK8gmDbD5MJ5wLtUQurvRgDX7sZEheGIT944irA+7Ai1bh54g==;24:qLMhJ8q1brT2xU5NS02oqziwC+MJSxFVbrNfjteClQE7y7N50tMDUbXYd4Os+L6hhQc7TY2awZVsTso4mhJqucyAKo5T4jPLw2xd3JlDeMA= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2015 21:40:39.0559 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1479 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3375 Lines: 87 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. > > 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? > 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? 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 -- 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/