Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760028AbbLCLLr (ORCPT ); Thu, 3 Dec 2015 06:11:47 -0500 Received: from mail-bn1on0093.outbound.protection.outlook.com ([157.56.110.93]:21344 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1760002AbbLCLLg (ORCPT ); Thu, 3 Dec 2015 06:11:36 -0500 Authentication-Results: spf=none (sender IP is 192.88.168.50) smtp.helo=tx30smr01.am.freescale.net; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none;freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=; From: <> To: CC: , , , , , , , , , , Madalin Bucur Subject: [net-next v5 4/8] dpaa_eth: add driver's Tx queue selection Date: Thu, 3 Dec 2015 14:09:02 +0200 Message-ID: <1449144546-25438-5-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1449144546-25438-1-git-send-email-madalin.bucur@freescale.com> References: <1449144546-25438-1-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Matching-Connectors: 130936146941390891;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD027;1:AwOAszZxv+IOzFHHYDHXLxp/MHA7SP/uDr+dUZ66KrjWK/44RzFhF66mxTX/UHTxva1NeqTtO6w9K7Kwe3Fp/jpaPN6E2/65sTQ+kKMIqfHdpXkhgVgyEkMYJBJhXwcZocaTaLxpI3YQez4UTajCc7oeyO5FqyGhsiNlMqFqJ+UEmfzw75091hOZwDBeSZdfTNoep+qwF5SqBY4/0iUP/7/NDmOSMv6ei0pOi3SBKMohKRJfo/SzDyz1iPchAYg6rU97hnB2cJrUEX2MXq2nW+Jai3sWahkNRpJqpMVdn9N9W39VYCtR3SlMj69vsqfE3EZAiOvM+is234xOlRDu5z1ABQpOvH+CSxhu2vkBfH8fqUpXFSuUVacbjxDw5afFRxBN3X+JcnvIbBKa3lHjhCW1c+pGdc9o+MZKuS+tosZiUS5kQMkEqtxMEcyQzKJe5jVMe8WlhdRGHH/SPzTwBADHHWWiHMIEUnIJMlC5bhI= X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2970300002)(428002)(199003)(189002)(50226001)(960300001)(36756003)(6806005)(97736004)(19580395003)(48376002)(19580405001)(50466002)(5003940100001)(5008740100001)(104016004)(586003)(189998001)(50986999)(107886002)(5001960100002)(81156007)(110136002)(78992003)(1096002)(49486002)(1220700001)(2351001)(229853001)(33646002)(101416001)(87936001)(53806999)(76176999)(11100500001)(43066003)(5005630100001)(4001430100002)(105586002)(47776003)(77096005)(106466001)(2950100001)(60522002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0301MB0911;H:tx30smr01.am.freescale.net;FPR:;SPF:None;PTR:InfoDomainNonexistent;A:0;MX:0;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0911;2:/Dgc/txyUT/yFZHzrYHQLOSHsHpsJWFKOpLpRyIooObk68Iy81DFzwpRRgJj/VcPTjoRt55KnH+vICJdaTwmVX9B8Go5rJ8qiAN8+BReV74UJF1WyCsD4l42Z/61V89pDelrTJ1Pg7WJgvYum4FUog==;3:5NkMZuUdAnZOReK9haj+HVwfxIrTF092e5tolHj9rhNeOF2b3ycO6Pf64meh9Lz7vnRceQaFzDTgwpLG3kdQ6yvdbtzJe0sQULtaUaywf1glKPIT0WVxJ/vvV52HEkrgEvUCOt34BdUwNpzNgXRt8wVhN7XuZGwUCAYHiLYa/bHZUqQoVfJm6FZ9uMtrO6wIu/JVHXWqzJ4MX7hgn3Q+dvRolc69EaEBkCV9CIndszk=;25:rQ+w4U6hMbeMjUCVhmdu3icvpBU2K3TvnBzUG+fu5rqR6l3B5cI4We6+QtZZgGdCHi8DeBoxezETQwQ7aARLzsxPlGLrLngIt8xBgBljgUa1gGo7jDOckNXrugxWpr6wi/aB82euMDtlLeN9ic7ovvKzJD68RtLMERpBIfOgXMY2/z90o2ajIY6IipLYegxyf5udbxGLKsqCkDau6S2H42helfs4uQBPdPE4nhQqOkpFsb0C3c+2tgMsHh9VTnzZ9OfJ4j17m4Qs81NbuMCziA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0911; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(10201501046)(3002001);SRVR:DM2PR0301MB0911;BCL:0;PCL:0;RULEID:(400006);SRVR:DM2PR0301MB0911; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0911;4:8hf3fj2ZtmbnVpxoMfNBGBAJijnN81CbfXNlJSSwUfkL5ZImvaVQpsSBd17CATuS/hTtxgC0eJ/giC2ajo3X21vym8aAyXc0obvlCu0WegvimAMIS5bjsjFFAWls7BEKUBemj5aW0lp88zNTJWVDMdegTzV03gygZqxFXoePno+fyvDvG8PQ2pnwr88Oqsk0tLAScSbknhMPjxLhtCTq48x/YsA3AEzxN1Z98Ig7KPBgO9n1G/aTlp0mLLHuNycqC8CYF9FngdVC7V7RHkFJ4b50+u8G+WPhmo9SvXg0Uw/6O+b2qXhIS8/jRGQE6R2EBtDGJDpg+eDttbK4uBGO8POQf+kmNe1PM3FVHRnGklUe/w+OnwUohpbBXunxqFtU8FpJAuLf4+QG9gzePDAw2vIXYnIBvUV9eAH/T7/jFOLM21E8/LOja2/uoo2rfLbJ X-Forefront-PRVS: 077929D941 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB0911;23:JiULf/pEwB6vd7vHPI9guMNObax0tNDQO+pKwH1?= =?us-ascii?Q?1XHgICSmTHKp8WkX4Cr8U7akFpxSW0Je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?Q?+y7FohQH7Y8fiey23kS55BH8JR+g8TJ+UPB/LFq3z0kpUlGwJKcKwnyRxYX1?= =?us-ascii?Q?SZHu4b9vBUnIG8O7cVZskV9OTb4coRTL5oelpgZP+4z2H9fT4t5mkAk/IkDi?= =?us-ascii?Q?iwyBRpIKOufc6Gh/NxNLcPKRVfZ/YZ6MgZM3s52qhKgm42kryWhAhv8wxa7C?= =?us-ascii?Q?8H7TPumF8rgp9OFD6hE8Ta1X8DAuH7x6LFdhbMWLGv1WZm8w7LTV2d+HVXFr?= =?us-ascii?Q?6z/pm+lrSNhP9wK4=3D?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0911;5:XqRdylK51ei46Wi7/U7grNir/60CATF+tlW4MRpR2+d3gy+3heu97pivxLwmG3LQkIcSVGoSMmhDUn2YVv/5aqaAJ24R9km/y3/205IVNHbuKT02hPOgFyPs+cg2GZPC9tKLf1xodhPG7FCTF/12aQaSNouwFPibG0z1abtgcPs=;24:vyQdD6u8w1vtsC4awuwo7bZG5WXAxgpL3g0tKjV8+vXpdaj0VjA/jU4vLumJKvuVMy9rqzf4bFwv772MZoLk19VF0yxMjSAzai8Rxi5clDU= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2015 11:11:33.2498 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0911 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4791 Lines: 115 From: Madalin Bucur Allow the selection of the transmission queue based on the CPU id. 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 and should provide a certain increase in performance. Standard XPS support is available by deselecting the introduced kconfig option. 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. + config FSL_DPAA_ETH_FRIENDLY_IF_NAME bool "Use fmX-macY names for the DPAA interfaces" default y diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 67f89ab..6c16ddd 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -375,6 +375,9 @@ static struct net_device_ops dpaa_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 45dc62d..a990c7b 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h @@ -405,9 +405,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 1c82338..59a1920 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c @@ -619,6 +619,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 c3443e6..20facd1 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h @@ -69,6 +69,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/