From patchwork Wed Nov 14 11:48:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Radulescu X-Patchwork-Id: 997648 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="FzQi6lx9"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42w2nl3hpRz9s9G for ; Wed, 14 Nov 2018 22:48:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732312AbeKNVvf (ORCPT ); Wed, 14 Nov 2018 16:51:35 -0500 Received: from mail-eopbgr80048.outbound.protection.outlook.com ([40.107.8.48]:31137 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726823AbeKNVve (ORCPT ); Wed, 14 Nov 2018 16:51:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7+vlxiLTosaOSAJ3iG9Sbv0gJjYcNxvgGEv0KMcXDWw=; b=FzQi6lx99deYLLNMitRz0WrMU38L73Ldml5SRpbPSYK4PFsT++6Z/PuyxflvsPRTvQvuL2ddX7WRTIx/WTmuPI/nPexrbsvnXvh/Ngf2z5KFTV2Oj2br5vmuNx93lSKz4EM8j6Ibhozblfss0ynOOSY2+9dCjxC3dYpcVVljmZY= Received: from AM0PR04MB4994.eurprd04.prod.outlook.com (20.177.40.15) by AM0PR04MB4436.eurprd04.prod.outlook.com (52.135.148.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.22; Wed, 14 Nov 2018 11:48:36 +0000 Received: from AM0PR04MB4994.eurprd04.prod.outlook.com ([fe80::988d:7d6b:21f3:286b]) by AM0PR04MB4994.eurprd04.prod.outlook.com ([fe80::988d:7d6b:21f3:286b%2]) with mapi id 15.20.1294.045; Wed, 14 Nov 2018 11:48:36 +0000 From: Ioana Ciocoi Radulescu To: "netdev@vger.kernel.org" , "davem@davemloft.net" CC: Ioana Ciornei Subject: [PATCH net-next 2/3] dpaa2-eth: Don't use multiple queues per channel Thread-Topic: [PATCH net-next 2/3] dpaa2-eth: Don't use multiple queues per channel Thread-Index: AQHUfA/5BpxKEG1+jk2gxOlifTfKXA== Date: Wed, 14 Nov 2018 11:48:35 +0000 Message-ID: <1542196109-1127-3-git-send-email-ruxandra.radulescu@nxp.com> References: <1542196109-1127-1-git-send-email-ruxandra.radulescu@nxp.com> In-Reply-To: <1542196109-1127-1-git-send-email-ruxandra.radulescu@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR0501CA0033.eurprd05.prod.outlook.com (2603:10a6:800:60::19) To AM0PR04MB4994.eurprd04.prod.outlook.com (2603:10a6:208:c7::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ruxandra.radulescu@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [86.34.165.90] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR04MB4436; 6:GFqbaMZfD66Y6gRJs8tFUUCMYydRiGZNFt4iv2enAcHQQaQzNCZ7Xf/4JpxBMXzl05Yb1ujIVCJzgOONsE8P8B41tPKlOqfBqlj+Mhh2eNn62yCqRYRhWU0sSm8jQ5eHmXfH6WRddoXHUPg0trDDivdNOD5Z89RmTdYF+2vORdfzF2TDEKrNPrjVj2jcuAS5Mk+1drYsKWO9c6hhLIsjclvVYecVs3wezVszqn0nYLWxKrsJN7T9EeexIwIGxi8jY/By97IKxxRnNvZC+N1kz+WkQx2WWBiL9M8GfJPnIsfY++9uBPQkN/oaP69stTLcrqyQ0obFHg+Z8E/5V6w3bfQ9WvA5c4XNWkf9WGJTJ7Jn2Rd7o2hCrdYQsEOzG4Ov9YpkoJGxBDy1WsC6i55mOhGCGvvaGtnJ8RAUcaKtj5AKfVXwkEwhMko2513sBat0AtFOAa+8qPWIFxL6Iu2hTA==; 5:pu2GhVzkrVdwD3IvKBguodcrgHqtFWWoqfhfIybTEAbTJqCMD31/8pyQ0vZoXMjxnWryUor+2meC6K3NicqbBK6QJXC+1BrTv7Gb+PaJNLQGwQq/BvCNe2pvPvMnSnCf1ArRj1NN+d3zKMVk+oHZJHLV2r8ODqQ9o93F+mht0Us=; 7:ZbBF7u868zbX7mAzmkWny2lbEZPCTUgsDx5rcpOt0bakTSNT/zuYlStrHKX2/82iRH+CrYEVraqqK+babiDPv3v/+R+DtENqHXNyc8/49fLJ19G9i+Noes+mFAB8QB5m71RJVoXZqYd7UdraOulOKQ== x-ms-office365-filtering-correlation-id: e1e8d63e-f88a-4b15-a121-08d64a271c27 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4436; x-ms-traffictypediagnostic: AM0PR04MB4436: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231382)(944501410)(52105112)(93006095)(93001095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:AM0PR04MB4436; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4436; x-forefront-prvs: 085634EFF4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(346002)(376002)(366004)(396003)(39860400002)(189003)(199004)(36756003)(316002)(386003)(6506007)(110136005)(5660300001)(6436002)(2501003)(86362001)(97736004)(68736007)(6116002)(26005)(52116002)(3846002)(99286004)(6512007)(305945005)(6486002)(7736002)(25786009)(53936002)(66066001)(76176011)(2900100001)(478600001)(256004)(11346002)(446003)(81166006)(81156014)(486006)(2906002)(2616005)(105586002)(106356001)(14454004)(4326008)(186003)(476003)(71190400001)(71200400001)(102836004)(8936002)(8676002)(14444005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4436; H:AM0PR04MB4994.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ZTPI62IIkgwX4T1/4jIXKU3RtEN3Y5Bxtd0yHeSBGHiuU2mTJfxTNMpOtX56FCV2pvghXWVnFfSvjFBeR2c58OsxUOID0CSHlJoxJoMCDT3FNTSyPse1hNLGBsSSuvJHECrjgss+4zF1BEIMZ3YMpUvxj4dnLzvU1yiHeH7Mu3igE8rA6p9SqKQfo5gjlF4GddjU3zHOlpfmus9CZsJZAGfllHD2iQGqWqhiBng34yzsqsxmg0GDc5SKe+qDJuSVxmzISzQGA7jQITyn2zOcd6zwEPOqImt6judL394/tYzOLe9/5uKLodaEc+W95yDVQl6gNJGNBwWhHtwJ2DFbHm0m9y1ykOxkHzwNTtgTfSc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1e8d63e-f88a-4b15-a121-08d64a271c27 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Nov 2018 11:48:35.9005 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4436 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The DPNI object on which we build a network interface has a certain number of {Rx, Tx, Tx confirmation} frame queues as resources. The default hardware setup offers one queue of each type, as well as one DPCON channel, for each core available in the system. There are however cases where the number of queues is greater than the number of cores or channels. Until now, we configured and used all the frame queues associated with a DPNI, even if it meant assigning multiple queues of one type to the same channel. Update the driver to only use a number of queues equal to the number of channels, ensuring each channel will contain exactly one Rx and one Tx confirmation queue. From the user viewpoint, this change is completely transparent. Performance wise there is no impact in most scenarios. In case the number of queues is larger than and not a multiple of the number of channels, Rx hash distribution offers now better load balancing between cores, which can have a positive impact on overall system performance. Signed-off-by: Ioana Radulescu --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 +- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index 048414a..be31287 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -1601,7 +1601,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv) /* Stop if we already have enough channels to accommodate all * RX and TX conf queues */ - if (priv->num_channels == dpaa2_eth_queue_count(priv)) + if (priv->num_channels == priv->dpni_attrs.num_queues) break; } diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h index 287b6853..3af706a 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h @@ -433,9 +433,10 @@ static inline unsigned int dpaa2_eth_rx_head_room(struct dpaa2_eth_priv *priv) DPAA2_ETH_RX_HWA_SIZE; } +/* We have exactly one {Rx, Tx conf} queue per channel */ static int dpaa2_eth_queue_count(struct dpaa2_eth_priv *priv) { - return priv->dpni_attrs.num_queues; + return priv->num_channels; } int dpaa2_eth_set_hash(struct net_device *net_dev, u64 flags);