Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754335AbbKBQeM (ORCPT ); Mon, 2 Nov 2015 11:34:12 -0500 Received: from mail-bn1on0113.outbound.protection.outlook.com ([157.56.110.113]:64336 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754120AbbKBQeH (ORCPT ); Mon, 2 Nov 2015 11:34:07 -0500 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;freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; From: Madalin Bucur To: CC: , , , , , , , , , , , Madalin Bucur Subject: [net-next v4 4/8] dpaa_eth: add driver's Tx queue selection Date: Mon, 2 Nov 2015 19:31:36 +0200 Message-ID: <1446485500-9782-5-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1446485500-9782-1-git-send-email-madalin.bucur@freescale.com> References: <1446485500-9782-1-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD001;1:6WLlmA/L7wVGpJECCDDOElymk1vpIVACtNfMT504IgvxRydQwVyEjO8cg4wKtI+5kUEbVVoadIFpQC4+mnSI1Oyw1aKDV7DtC2Cw7DuZyPfWR998iCU7WYOmlsN9Dx22AD4Wn4LziRC8gthckVYdy2gBNDupWIixmHiwt/dLKM6HIEsv62tbesWJ8RI4rcG2d9l5vqM3KK5rLIIk09XKHeQvw5QJwvTUiF/oWe8IMzH9i6MtHkXaYFgIjr+oZVPQ4cs5HisWaYlIvFCPcFCAYFxa+P6essRfYEReWAVmkRFX+sgTVtQjEQDkEfVGk118O4M+p7opyaflpRdr41CHSdPc7zxK8AKjA3MKNBHEunJQb7h7yhrJq2ZYcYqdfyWLUvcZnt6FuzPi7Q2r4v8K9w== X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(106466001)(5007970100001)(5003940100001)(6806005)(77096005)(11100500001)(5008740100001)(19580395003)(104016004)(2351001)(19580405001)(4001430100002)(2950100001)(50466002)(105606002)(36756003)(48376002)(189998001)(47776003)(5001920100001)(86362001)(53806999)(49486002)(97736004)(50226001)(110136002)(76176999)(107886002)(50986999)(5001960100002)(43066003)(81156007)(33646002)(87936001)(229853001)(85426001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB1280;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;DM2PR0301MB1280;2:sPf24uS1ER0TPd4+HXnwPqM6zWJsijmEFJLGh2IQ5pYc5tyGjmBUpPHNSvRFnqDgDQePQ5tr8XWTAVXA7E/cm+EPXqlNGA9Itl6tkn/JFC+FBNjNPdQ8Jr/+SHf4wyi86cgIiNafxNBIYpFjEl8kqg5vLLlreaxjOJTLJG7HOx4=;3:jOBwx/9BPuDovUe4IoCKQD5cu+0WrWffAnqR08akR/j867nvEWQQd8uBDP2KyZsH/bhg3zQLSFmM6t2TWgwUO4xMi/FsE8vA/v8xkxPcnYLrsl4AxiQivaZVjvqMJJfBAxJExwxfq50erYq7iRKVY3/1ta6fhHMMQN0v1LTxFMBNoUKDsgfyWRfARas2Vju24JXRUbhImSSK21spef1RGW55PGT0+sxu/8D402cOQQA=;25:CHrbp1987ugIXXxYzqiLjv0OIurI2jFbcqs6Hh5sWVeWTR0PMO/fwz5XQUvInZjegZz8Nl61Mbpz9ZjbeqSdiMrRlglbov1yUNNNFk9Dau3uYWD5M+N5kg8FD7/vvjH5tYiCQU0p76UMmiJuW9dZVuQ6RpwDxGeAL20/U//mDdKkIcTMNXHXeIApwvyE0YwPBJPEdVWhRw9g3/4P2+MW4GEi1wqOIEUT452pvh6Oq32kz35bYfbOhpqCVRJi1tVd3HstT+PPvtwmzkxTwzTJrQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1280; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB1280;20:8BucdURH3C0ZJP8HyPwfz5n5+GPh+R9Ton3XS+SfIfrpZf0jF8U9tGFChfRfBqyQDM3emjPO0zgi85mq41NklfYM0Pm3OQljwWwgccAQjkXnFW6jmEb0Y0hx3st0HKIzhu01GyNGwJ56lVNLxM3knFQzcw8UOyPsv5VqNcA0Ff9YRTgK6Iz6e4ivrxznmnSWhC5mQe2HONN1N3NuzmmKYZKP/Gaim4Ug5dN1pd1+3ySmEAMPJUU4232g+7TiujDFYSlV9S772dN2b/S9hmOhzZatFt5Qc8ERWSYTku5ZWhn81wWPGX64AEkJDGKPByawWTnPzkZ06q1+mEOFL2cTNrmAmLQhb6YOhbnNK6yfRJU=;4:Jp+O8QySxH+LAENfHL/Om0GJRssjCMvNH7w6Fz9vWqqyH7fY7Y2iDb8leHIMWYODeH4dGVyrSM5PLqk/81Uz8kY/CO4cm7XdCtP/hMktMwBWVkpnkiSY/xEZCxo+BcpeS0L5/+vx02ZyYzfCTQyJOsMvdJRHSAT8Rfa3Ndzsz/Xps/hWD88ILmmmaCWnZ8wYPLga/Ppv0RdVK95V9Ha0Ah/rjNNVOvVWzYQdACrVcXUoJfeiNJlrBvi/uieDr6KSFHpIH4nl3G3UGGge7Hy+6e4fFueCkUq1kX51n4puuYYsGP54OqYzMsGQjNnmI77xxtPAreG98R+Pu4n84byS6VboGFkE03Q5drNYWDd7lzHMy5F9iBJxHKxBE08aSaSm 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:DM2PR0301MB1280;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1280; X-Forefront-PRVS: 0748FF9A04 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB1280;23:YKSIYiB831toqHwSqMPayiJzmqeK3cV2N0FKyWJ?= =?us-ascii?Q?4QFNejJnMvz0us47BaXlC/URfO4cpjaZqOyvPRTWTLTqPhM97Mpda9xRUtxV?= =?us-ascii?Q?YfaBoq/bx3foKimNlHqu3Qsu+YT09tSsShmr9tYB1kMlcwBcIWBqPtXqRQWZ?= =?us-ascii?Q?RJnrs93c5oZUHwuj0xTVadwjVHsTQDouo0XGX5iudd6NcVESoNB7JPC3y6bd?= =?us-ascii?Q?fqRMSWzX/x931kus++tdF1Ij0JrWQ7kro4SZmkq6upS2aiSdjjNDqahl8gxW?= =?us-ascii?Q?9xIFDdJcGeYDK/rxblktzOuyGE9XkoEQE9DXEOTRb9LdMrmuyKNwb2wMnIBd?= =?us-ascii?Q?Q4qOWf+TFLrJUSge5RRdw9ulPg5NLDmdSquB/sinOZU6ugGRGYzNfqJML/07?= =?us-ascii?Q?Oq+MOBwkvuXQOAyvh0B1tTKhG/wpEuKhOkq+F4eRu/v6sYjVFBmzeOT9wdey?= =?us-ascii?Q?4QIGLhK7E+uJC3ZL3dJnQTiP5yYpEPBAEj46epxmv0HbwJIpHXpjbv23ilk0?= =?us-ascii?Q?A9Vfki3fv5+FeLXDaF/CN6Y8jzUuIOPKgtgcmDUVr9xXdoaEXp84xuyOxyEB?= =?us-ascii?Q?1KkioZPu3ybdVfNRkTRfV+Ay76VD4vY+rFDUE8VT5jInQh9LfwRxV81wNvAj?= =?us-ascii?Q?M9jJHy99M8Zlt/p4JuanBhpYGTn/Dke24DAkEwANTqTg4plYn+saOdOw3x/A?= =?us-ascii?Q?eq1MLJyCwnhPCtgu6CyMTB5lNXbSgNSXX9d90lCSohKncHkUFYrbjecoZf8E?= =?us-ascii?Q?sC3khDeeqA+9BOUpP8DJ9Kmtt2Q6qDcizh4rlB3ngznw+zTpTUXpr9B8w778?= =?us-ascii?Q?hNNqSJmln9A+wNAHkiBtIlkLmbmUfpNUgdgtdSROLrGDWKhOzqmu8hBkBLjj?= =?us-ascii?Q?5SABRAoqaxD3raEySzZ/BehI/FyMIpESxFYNBn89XXKnTzEmsffDjNkYT0GP?= =?us-ascii?Q?NcowYxC1VzCGZY4ZwsjyrMCO2KKrvVGNAInmcr8pji+eS3hCLLJnYlaCtjnd?= =?us-ascii?Q?IIJZ7UytBYbm/nMvmgIL2nPpqHZ/KDcMQ60FVkJpk7i8joUrvsEAd6SAdaqX?= =?us-ascii?Q?/n47FUoX0nY/8vP8Dxy5ufejifQ1MDhVSc5S1wSWJfyWpkE3dRdzZDPRmIJN?= =?us-ascii?Q?vRSEXKqq+35IyMHtkx5NSaXjwugJkB2Gcn2JqDKSR5MdTxMcGEkciMQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB1280;5:3XCGNXG2/vf4bpvg8/axbblf+xPWMJH5/gtDzKebwSAEGt6DCgdvlncLkjOvl/zWBStw18gLM4wcYhltCDvY+Ivk7W/clfESadUGeYtB7QRb09VR5iAbig6dlJ24/vbfDYqFgJTEjNDUoC/l3GDkEQ==;24:JYanG+LWiipPJxX6d6DKNGwvp52VHFPzfW/Qh5tziEV+SLcqKIM7N6IHmTqojGeTtqkVLB0umK/13RM3qlnqCgx79HaoE/yElN/VSLAGpwQ=;20:frkQYgKGKBv9dCyCLGAuCJLbnPAkpm3F5KDnqeBy3a9ebH9QjFuBeIo3yUuUpJsTSK0Js+hJtCfLbKzVey22gQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2015 16:34:04.4890 (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: DM2PR0301MB1280 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 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 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 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 b36cbca..89f3b1f 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 9df8f14..2e9471d 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h @@ -70,6 +70,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/