Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965417AbbGVQSS (ORCPT ); Wed, 22 Jul 2015 12:18:18 -0400 Received: from mail-bn1bn0108.outbound.protection.outlook.com ([157.56.110.108]:28599 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965286AbbGVQSP (ORCPT ); Wed, 22 Jul 2015 12:18:15 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; From: Madalin Bucur To: CC: , , , , , , , , Madalin Bucur Subject: [PATCH 05/10] dpaa_eth: add driver's Tx queue selection mechanism Date: Wed, 22 Jul 2015 19:16:41 +0300 Message-ID: <1437581806-17420-5-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1437581806-17420-4-git-send-email-madalin.bucur@freescale.com> References: <1437581806-17420-1-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-2-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-3-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-4-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD039;1:7kSxTcqZ1e3bvUrVKR52/AzpWON0rY5rd9CLlAg9t7bOHioJEBw8tmpAeVEn+XTXD0Mpaux1LDqVT8lyF9aD3RVkSzvlPKAnh25lCydtqaVklVvOuS8H7WlgTCZmK7BhgOsJ0F6WwjN38gRqkaLkG75XscCDN18fQEdprWobt0aYWTh0OdFEtK9elwFnUnK+6/QrLItqBzLHGHpOjZLk2mUkgOEpJ+R8wV7Ft9/EoP5hKCICT7W0cvKkghAoUxrA9rUaWNKH1JUlRS6AOnbnLmc0hOgrpl6iTfasGlj49m/ixMA9bGbuanwdgYqiZSVVwCqFJ4KmiGQhuPNZjRIWEqYnTFJV72vITf/W5bNZYN9CJSItw3ibGppcn1xYhh8lEdQV8GYR9BDPViYgQ6vvnmflFwOyUMbiKbO+Y65/YlVjkVrQlf04+TdDrofOqiSC X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(19580405001)(229853001)(86362001)(575784001)(2351001)(48376002)(46102003)(19580395003)(87936001)(5003940100001)(104016003)(2950100001)(33646002)(105606002)(50226001)(43066003)(85426001)(5001960100002)(106466001)(93886004)(6806004)(36756003)(50466002)(47776003)(77096005)(189998001)(110136002)(107886002)(50986999)(53806999)(49486002)(62966003)(76176999)(77156002)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR03MB545;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB545;2:vlSFoDEwcTnqpvkBomILAtu+Od12Be6J3KzNfI/7JCiobvf7GJ162avNG7wrQlHp;3:l5hOJl346sejAbMRhiq8DVtleneD+RQgRO4p7Ov0v9zZk3WCmRqEqHgx2m+dlcy14uSEpQIPShwI/SOQ32Su2n6gnwo56ntzjX/6lMdCOb1Yrf5XfJnbddK+kzfy2FASg2lINExxPMH1a5DnLlEA73015UUUcz1SXoR9DBAY8fZAxgjKrWiP3UhwUpGaVrE4p2nXaSrDmNWGOyC5o4R9MO7srOOTaxA8J27f6mtLSRM=;25:MH/HOkI/wenr5qNtLorZ9JxEpHyKwvrXmks4un4+VZPGDi+ylQ57AUv594F0cWG3v/HIylLvAA5WuY6Lxkkon5FvB0DkE1LasDBKHfv+0Vgqcwp/j9Emi3XmYA22JV9NYNz6fIfMMJHXbXaNdCg1M8cYJhgr0K7TqVgjnYIiWT6HK+17E54FBcDlkhh3Giyi1SJXhyxX7HaE8EuuaqePI3uOLjVHFc1A1upirX5LXA/YwpTM9PWv8Rm81dc26WvQVv2EWZA2WWbl05FBa6+gMg==;20:KqlJNvmR7oVZ8lcLyzKbXcbfdDyPsU+Z6z8EO7ebflg0pdyMCkHbJhoXvRVLWCwr9SiP+DQQumOG1aXq/Rh4eG49KMTE3LHz9qEVrty9DbzqvXcIXzF5EnZU2vMKElYORp9mPn+ikEhTz2JlBRPGE/rdhrnLKd71SrsqPk4tp7H9KZWUPdFgkSusRBFLvCUWo7OLXREQjXyD3NQLuGZfzG5xUuuHzLcJ4c/jQ5eNphOePFk8wJR9Eua43R7bbK4nGK6Zhr4O5CXy2YqxUj78AJQVP+fU+d5mRWmj9VrprML7eWZ+V9459FQe1275etR3kM7XMqeDLoQFZdOm7lKyrDIBjXviadgDgPQn9bEmgHM= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB545; BL2PR03MB545: X-MS-Exchange-Organization-RulesExecuted 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:BL2PR03MB545;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB545; X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB545;4:te96YsuX77OAdephDmvsYugzEby0QfgtJ+bPsca0DNNZVOTjZWvBJLNw3h025p0qamb34vcIabeRUbkvKGwEl3jmOixNZrAGBAdECBJLTBvKxEUzWbYZQM/xtFF8e5+X3D3n9C5NX+uOI1DQWgO6EH5Pf4pl7wTPA2HB0ox31weM+KQDXnk95W219L4LnSwbnm8gDbLwjLbnLDy0QnoSs5fgtHvB5cJVZUo7Jy0oB9zmdaEBGVqvJH92P/ivTJ3RMfu2neQ2E53cKo6KT9CyzkWbG5Nlio/xNT/AFrzlFPE= X-Forefront-PRVS: 0645BEB7AA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR03MB545;23:HCOsESM08sfxBowvqh6hqO0s8AhU/dGQA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6vPiNVx6xR9DrZ/qXrTt6rdBuvOGGf?= =?us-ascii?Q?o0YrmQrjlFaqibVkfAWl3VBdurSEfW26zENrhjg0HaNcXCBlU0SoS5imJS3h?= =?us-ascii?Q?9wAciiTndgfoLTjmREPr90v+PFGSOpxe3axYWCLg1Q7r6luH4o7JicRu5q3O?= =?us-ascii?Q?k4NAU=3D?= X-Microsoft-Exchange-Diagnostics: 1;BL2PR03MB545;5:M+UJOeCbE1kX7fI2KgMGr4I+4IepG0iXF7UVtPxqwmYfBpjQAa/y57AdVbqIKcYxHl5qW+hfbIHeMoJFke71NeO7miGz5M84TUhk5FtmxE/kVJMvPL3tCRhHABMICGOqMAJbmVz864n0yPa/42vlVQ==;24:QWKAprmRgxp+VHffof5TyydPQmPE8TJPvl2tYbxy7Bd/2RDWlic6MjLiGoV1YXzBO9a/LUR6GghjIvuLJzed9+Bjdj3FUEfGXIEhv9rH6x4=;20:z05sbGiUH8CEfZyjbFvzP2c+Fxr0f8i1NsV2OTP3ec020SGtI/rOQO2wUDznuJbTASfO7VFf/VY2INNQ3RwCtg== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2015 16:18:11.4328 (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.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB545 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4463 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 9e6a39f..3fa7925 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_ETH_MAX_BUF_COUNT int "Maximum number of buffers in private bpool" range 64 2048 diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index edf468b..3fbd114 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 fc6c5dc..cbe9626 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h @@ -432,9 +432,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 da146f0..b571635 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c @@ -593,6 +593,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 1090045..75d0ac9 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h @@ -89,6 +89,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/