Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759925AbbLCMw0 (ORCPT ); Thu, 3 Dec 2015 07:52:26 -0500 Received: from mail-bl2on0117.outbound.protection.outlook.com ([65.55.169.117]:20833 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751479AbbLCMwW (ORCPT ); Thu, 3 Dec 2015 07:52:22 -0500 Authentication-Results: spf=permerror (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none;freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; From: Madalin Bucur To: CC: , , , , , , , , , , Madalin Bucur Subject: [net-next v5 4/8] dpaa_eth: add driver's Tx queue selection Date: Thu, 3 Dec 2015 15:49:45 +0200 Message-ID: <1449150589-26253-5-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1449150589-26253-1-git-send-email-madalin.bucur@freescale.com> References: <1449150589-26253-1-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD049;1:/1mreG6eILTqrPbFacPItpAStZh+d2n2tz3naQyoYluYf8oz2u0cSW5BQkz1wHwzzvBWij9UiXiN7w2OycTPxfijODuqYh5e4ACIc0SJKBnjP6VzL643Z1FBO9PvY+TGLiMHu1WDlp5TUF1em1mfxcxM6RncZOEsxobGAXblR0fvE/0JxlmhVgndnQAjoHSmnocJxL/Cw5AeD7kxtsmemTEzLitO/B+CR83PHCRQAqEZxFR7J1edqXk0qDRpZiWTD3XPQX1eifxdfdG5KnMzEYrc91/UKMw06JQBJxXCH6DJ/T6pEdTo8YZMXVA6m5dwoBMGznM19QT92gG1a422yv3vSY3rG+vjkXEU/eeh+epzNRwRzKYZ9jFn+mpZFLWCHid57FxbYUA0nPrFWtvTxM+Ze9ZmML1uJYixlbGAi5c= X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(448002)(199003)(189002)(229853001)(36756003)(48376002)(50466002)(2351001)(85326001)(33646002)(50226001)(49486002)(87936001)(76176999)(43066003)(6806005)(106466001)(5008740100001)(53806999)(86362001)(104016004)(4001430100002)(2950100001)(50986999)(11100500001)(107886002)(110136002)(97736004)(189998001)(81156007)(586003)(77096005)(5003940100001)(1220700001)(19580395003)(47776003)(19580405001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0301MB0762;H:tx30smr01.am.freescale.net;FPR:;SPF:PermError;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0762;2:cRiCFGVw6YENIa+KU+bZAjBpfMCX8aaJrOv009yYgMR1uzgMEiPhBQtg4djsqmtauMY18b5bTmoOLiX5mG6GdvM8LoltKt/d3uxs0NLFHCOssn+dnMyCHSrL4+VMHeCbMuHADw5Cdt4z23GVPsSZuA==;3:j0Or7C+c84aCpjHPxv2c5ayJnYt+qJnsGrmenufjPn22J4o+RLqoVo/NIm/x3Y03/tJF7uZnIUiLM83Oki9L327/fqH4/e6O6Y9WzRTdwAH5fVk2PkaiZKI++HEBLtXNNp+DwSMGnvEnnTnC5G3jgJmgbbrW7BcFlBUow27qGVhZgeJdJCR+9RHVagThK+bFzHvO2wEfFuODA1CkYlYpFEQZSXE2uFntESMjS+m2ToU=;25:0fg2ox0l6Q/AalgOsYGtcEhumDaWN7IPdcuA337YSJkp9M86iIFI2NTn5PERVcm0HlzaeEbsTKVvnbETi5z4iVJbWHAbEW83fPkGfOgZeFD19A6sQBnbM5Qre7+0hBvaA77hMILf1Cg79/lnUSp1NtEJJ9jns5rmiyif84a78FnLIwI3njIo1gs4jmr5whGEjFS9n+M2oSUPE87MK+GBPlnwTCUM4YsfVqMvP0DoTDU03hh0/gW8SXlntmrAA9V2rfvd+X8AXbBdvA/o3SOeNA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0762; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0762;20:FCvy9Ng+FJ5tbuqz1wAFX+/QZk/YV/mg+Dg70VY7j0MJlZXNCVw2bnqaztNqgvjL2Jpqesg8t55WDXz5HgQxMGI0PnA2ypQ8Ig5c1xxfmGCXkBdB8chHbym6MZEJsI+/k/JDsrJqJhQP0sMdN+qMK8H08ZdoP5tzFaB2kTz06TJE8zV2poq27P+5x/sWuZ1yKqvCV3Dhu3Arcu/CkmdKQ+Z5HW3hw6tHTrWO3VuuSozoLbLq0OaMX///cJR8h4k+RcOXfjYrnIgNOz/q98fEHxpDT7hoWfb+R29A7q6GBxJcFiS9GhT+tn7n8XqlzHb4DOzsAyGaSI7PcwLEfsZN0tx0PgXqRzmrHeRjeDtPBBE= X-Forefront-PRVS: 077929D941 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB0762;23:ksdA7ijNhdrq6yfrUsTZLEeMjjPnHgIi2mX2h3h?= =?us-ascii?Q?hVjVt4FWNRJ/zbVCDUJMxUxhbIMc+/jq4cSzelG/2Z4uXMyc1TW9R8qWOnRm?= =?us-ascii?Q?+1kAeSSaXeoZU9Wzb+56nmWJ6kcR12kABsIGGyl+0GXEuj1MkQNbEu+GYhIx?= =?us-ascii?Q?55aOOvJZrxwX2d38RPTEyRxShY5OfKsSvQ4UbkVui41wWJ2Bm0ZoZv1eb192?= =?us-ascii?Q?mZt47hmAXhQVs869rB9oTWBsvo8hYHVTs5xiJemw/EUzZnQL0PEgBTELk/4Y?= =?us-ascii?Q?AHRXUcM3O1fRAFSWlzPEgA1dsIA4yDefSDGOk8Lm2/ixw4Nisf3zC/PEJVTj?= =?us-ascii?Q?hF80zDbn7ILp3I+MXnxcFeS8LcQKVLXm2K5/U/60fmrlqSXHZ/4VyN5m1f8j?= =?us-ascii?Q?Ji9McHnHhsQiCGJQpowr8TPeBmn5HGigZ5Xd0FcGQvakV1/37tgrqe1FTltx?= =?us-ascii?Q?7h/HDnwpj3nrKcPNqDtvPx0fCAn0a3JCs68wDHXGB5xw5VqOvpdiGg4uw33v?= =?us-ascii?Q?lH1CsEEwttH3eD293ipYHHoQIvY5rgA1IQ6mfi9K6zFsv14pmjvsdK05FSdW?= =?us-ascii?Q?LIpZIL6FVku+IvOLZWPcTU8OStaiuuKt3LUVm2HdbHP2os6zVJixBn94tyCa?= =?us-ascii?Q?6stQEMvhAUjuY5qCvKNayxIMbH/FpjCJ3fAa4HI8rYJXe1+CzDyV8ZX9FvQT?= =?us-ascii?Q?Hic3dBxs+c2lqqxo7hJnEw8R/cZ7+Fl6kVrGiCWiMpgqLOk0qzzJHPfas8ne?= =?us-ascii?Q?vzVPsZlphcHoKUs0bZN2kCVnMhMribS49VsNAkUWKJuCErj51dak8Ww7ynEv?= =?us-ascii?Q?+SSXsYnT0wqpl3K1zpk+ykq9AvEPh5if/7b8I23Wtb6S2WyeNc0cqOHQxN76?= =?us-ascii?Q?gHZSfrsM/8PS0RI1k45Bo8LOE6ofX7uDcYrIjHr3ErsrA1VIE2Rtyk3ZmtMy?= =?us-ascii?Q?WUoUQ/y5P5lRC8cfUE20SPupl6FWeKqlP2PpbH+yrgZIwJGOLUxbz49OFtE+?= =?us-ascii?Q?WvwIWr3sQylxD0ymKheMQSbkN2Mf57UvEqsxyVqG214Ktlg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0762;24:ehPTVgxd/3+v0crTc1sbxFJ7AmU62Wmy1O/lEeT87vJiDNTTajPjlvSkXxN44Kx6tsl54YwtDZRiX9HFJkoUaq5uMi+ICaZnuM9auSPw4kU= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2015 12:52:18.3700 (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: CY1PR0301MB0762 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4740 Lines: 113 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/