Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753024AbbHEPrX (ORCPT ); Wed, 5 Aug 2015 11:47:23 -0400 Received: from mail-by2on0115.outbound.protection.outlook.com ([207.46.100.115]:27157 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752826AbbHEPnq (ORCPT ); Wed, 5 Aug 2015 11:43:46 -0400 X-Greylist: delayed 3578 seconds by postgrey-1.27 at vger.kernel.org; Wed, 05 Aug 2015 11:43:45 EDT Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; From: Madalin Bucur To: CC: , , , , , , , , , Madalin Bucur Subject: [v2 4/9] dpaa_eth: add driver's Tx queue selection mechanism Date: Wed, 5 Aug 2015 18:41:24 +0300 Message-ID: <1438789289-16304-5-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1438789289-16304-1-git-send-email-madalin.bucur@freescale.com> References: <1438789289-16304-1-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD044;1:+PjxQOYwab7BljZWLywLpyVjML0b9rbsgCYKiOXRMAFxSbBYlpjOoAY2zfVvTimjeq1e59Agkk8vX5/1xOxIscTttJsBI81/ZCH3lKJBF1kDW5UYLabLBRpK7mU6tzrY38v5d4zBnzCoV09toE5VFVvDuqPWJ1cix4/lo/xL6cpRJljMl0V8KtQ851l52qYorqKR5Yy1uraNwD/R45nzhq3Shgy51aXRMw67YFGCoqS2trd4y/U3/olYiL7OtN07u0GDKLxFDBI+U+jLIh08XIK/0pfMUB8i+z2ZcDfyOBYvler8qbzru/fQgbtfxR8HVOOJ927k0pjS0hBm1mwsFA== X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(81156007)(48376002)(50226001)(19580405001)(68736005)(19580395003)(6806004)(107886002)(5001830100001)(2950100001)(97736004)(4001540100001)(77096005)(50466002)(47776003)(62966003)(105606002)(77156002)(106466001)(64706001)(5001960100002)(5003940100001)(229853001)(110136002)(87936001)(46102003)(85426001)(189998001)(5001920100001)(5001860100001)(86362001)(2351001)(33646002)(76176999)(53806999)(50986999)(104016003)(36756003)(43066003)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR03MB548;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB548;2:RsesurKY+lCVxkR5HbTtj8VOLfGA1ij7j4TUuXb4Glsnq3HaFkjtPZfHyfmPkQg5R2lwA4C19bTFL4vn4OJhuBG5jI9x9p1uYNcBL8gq0miEbBGPvrymcNkQX0Deo2j120lThosaL5GWGsAGy/q11pGt7VzREGx0mDNACDp58ls=;3:TzTRwXi+Cmhh9pgYoDCWS9BO5F7KB199Hk5G74tj6lr3Q4eh+BPN0fZPDkMV2aaW+I9U8YUCXQuD39lH/ElaCPnOUxp5gkXs48QX3sPiKcJd2OrDmO2VWqcGpLBBYeONqcs5MVEhaNi87EIotPMJIHBLukcxGY6UYvbv896FQ6UPj2MYdpGkwNk/9qUYrbPLtASn3CS3/we5wUOC6y69wfbrGik5NkNede28J3iH5B8=;25:jMjwrHwHgcpHCOFLkwJ1bwlCWE98hGV4dOmzzGEH+ecXkU51VjxhDF7sTo4aR2ZGy0Jznid1YNsoNuMRSI/A1ipGFHuutIpTblZ9NCiIqUVLns3myAHf7bVrr7ZAzcFU3xq8UJsRLOpM31Nb43hykSzakobtROiRoNLBr3U8JSCCLide7enw01U4NK5/lJzCCo0RnLIhUHS4g2lCz3dlPUJSuLvibP1xFYA8FXVUwYgXDIwe8FO8XlAAkzztFCy6eedRoDROQQoGddIxFvIsEg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB548; X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB548;20:Xh5LRmM7UwFpmlZL/zf+A4V/19JroNL2/IjxGmRxAWUo/8Fr4hIcgg6pcn5shzwA4phViX2DLeey1aNOYjskL2cV/VWw6l2RqfbCbQ7C/S+c/kDUyp7HJZ2aLseSYfJzMNRdoyZx6Q7p7JKniDz4LgrdLCG2UiU/MF3h3JbHYB5mKJFD0DRwPH3mECJsVn2AVovvJ3Kzz7+QBdltFx6JHIuxuX9DhI98/J7kj+2HW+9fnRv2ic5Ekl7lHMndrX37t17cNk00G+U9nf2ywP505u/ZyqbLTDC/dItoJVK13BQRC7tDYKFGY8DRGuvku6JBC2FgL5OP3NConKLPkHqFwmGb1lGTyEhnKnWrjJD+bRc=;4:hXkMXivAsONppBM40406IXtUXOzrbWzCB2GTco8GFQnIpX3tJig2ifwdz/5YbKOhIY+KJuADAn7OZ1hRj0/ZgAVVmfE9GD5sJ7Mx8+lVmT/XCWOC/xt8aYrxNX/CqcWksqT/lM+wXXjHFSTnTKFNVACgilmxYnePwOQtN1qZalAC0NQMua6pyZA31JoNjEwVk/iICTBGe91spyCSKSggMLQfo1lMYOJOy/RNwOwWJrm7jW6NDOWDTtUiNG2ygPEij5bZrC6O4teG0Ki4x5/MPgCS7hMQiNAgRY0Uot0tLcM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BL2PR03MB548;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB548; X-Forefront-PRVS: 06592CCE58 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR03MB548;23:RcQGjBx7028SqynAp4AvVegRzkux3OkSBUXT5irIj2?= =?us-ascii?Q?rt+eWkl49xqOeF5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-ascii?Q?H4oO33xLzMuXUbigtCMFPbZUDiWqk3FQlbIdiJAG9sAKlK2MvpQm2+MDyisH?= =?us-ascii?Q?Gv47BO2fNZH/AlZYiKPO54/3iT/7UHxABdwbMJPHSfmWGKUdaARQKHccnjFN?= =?us-ascii?Q?EhE6runnZ2XnM0wWsN1lESnWIfQD1LloUmNkDPr066YJfxpP/XAT5UpZ4LT2?= =?us-ascii?Q?Qnm03Xk5m+Xdaa5mAbWFSYKx+srFUDTxQrlg+2INgyOB6Z5qX/9rEqdqU93M?= =?us-ascii?Q?BZ3v4r6KgNUhnmQfzgrVMwA+VKqZLVQ+7o?= X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB548;5:WoSlJVJUIakH4XqJ7i6woFSaIr5tevFFy2hZa3NiucC/ioMQvfEGhkZ8ii8JgXaeNJqjAE7eucGYwjF8/oAnNXTT/9KsOpfogd3IQtG/kw7m1ZpdYHzCJc6n8McYajUaG2tq3ALPkR9eSAASINkXnQ==;24:HL7JQX9a3FC8vGuEHRkGAagJ7OPkoKiIOE2+IV69GRWYS3pP6K/hIO6bE+5D/lrolHzxOlEVikoAGdVFp3gpvfAHi3+aa3IMHAY5njL9h8g=;20:ECiIh2+glr5XpK4aSasWzBt53BwPAfakwIVT1iP36/qc1WxnHzOhRzueVgPCA1lcSupgK5VHo48cmlzZ8fLLDw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2015 15:43:42.2486 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB548 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4468 Lines: 108 Allow the selection of the transmission queue based on the CPU id. 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 1f3a203..6147403 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. + config FSL_DPAA_CS_THRESHOLD_1G hex "Egress congestion threshold on 1G ports" range 0x1000 0x10000000 diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 53c37cd..264945c 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -387,6 +387,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 d337dcc..55c1106 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h @@ -430,9 +430,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 static inline void _dpa_bp_free_pf(void *addr) { diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c index 7e4b9bd..1258683 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c @@ -586,6 +586,14 @@ bool dpa_bpid2pool_use(int bpid) return false; } +#ifdef CONFIG_FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE +u16 dpa_select_queue(struct net_device *net_dev, struct sk_buff *skb, + void *accel_priv, select_queue_fallback_t fallback) +{ + return dpa_get_queue_mapping(skb); +} +#endif + struct dpa_fq *dpa_fq_alloc(struct device *dev, const struct fqid_cell *fqids, struct list_head *list, diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h index bd88dda..4581bfc 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h @@ -88,6 +88,10 @@ struct dpa_bp *dpa_bpid2pool(int bpid); void dpa_bpid2pool_map(int bpid, struct dpa_bp *dpa_bp); bool dpa_bpid2pool_use(int bpid); void dpa_bp_drain(struct dpa_bp *bp); +#ifdef CONFIG_FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE +u16 dpa_select_queue(struct net_device *net_dev, struct sk_buff *skb, + void *accel_priv, select_queue_fallback_t fallback); +#endif struct dpa_fq *dpa_fq_alloc(struct device *dev, const struct fqid_cell *fqids, struct list_head *list, -- 1.7.11.7 -- 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/