From patchwork Fri Dec 7 14:00:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 1009433 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=none (p=none dis=none) header.from=aquantia.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=AQUANTIA1COM.onmicrosoft.com header.i=@AQUANTIA1COM.onmicrosoft.com header.b="ZDdM6Ceu"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43BDd41tG9z9rxp for ; Sat, 8 Dec 2018 01:00:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726090AbeLGOAX (ORCPT ); Fri, 7 Dec 2018 09:00:23 -0500 Received: from mail-eopbgr780085.outbound.protection.outlook.com ([40.107.78.85]:28937 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726059AbeLGOAV (ORCPT ); Fri, 7 Dec 2018 09:00:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FuiNi/qt7wan/yxDKu1QI5PoZ6riIMnMmPjsZlJqQ+Q=; b=ZDdM6CeuC7hgjGtwpQgPF86M74Px/S6kWHRwwVpL7de0XhzrMmPMAzNsIqnNkSUMR5VipkHWpahQKLO1BHrwndZiU8CKo9YlDu7OvvDDx4NiXUYPaXGEDPQqGE2iA5e4lp2W0a5N3kGOG6EXVB4us9lNjPiMZmz4qU3obd0jcso= Received: from DM6PR07MB6220.namprd07.prod.outlook.com (20.179.55.97) by DM6PR07MB5787.namprd07.prod.outlook.com (20.178.3.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19; Fri, 7 Dec 2018 14:00:17 +0000 Received: from DM6PR07MB6220.namprd07.prod.outlook.com ([fe80::9d23:ba09:343:4aaa]) by DM6PR07MB6220.namprd07.prod.outlook.com ([fe80::9d23:ba09:343:4aaa%4]) with mapi id 15.20.1404.021; Fri, 7 Dec 2018 14:00:17 +0000 From: Igor Russkikh To: "David S . Miller" CC: Dmitry Bogdanov , "netdev@vger.kernel.org" , Igor Russkikh Subject: [PATCH v2 net-next 3/4] net: aquantia: fix initialization of RSS table Thread-Topic: [PATCH v2 net-next 3/4] net: aquantia: fix initialization of RSS table Thread-Index: AQHUjjUvrlBohAXmD0iKvxJLY4q5HQ== Date: Fri, 7 Dec 2018 14:00:17 +0000 Message-ID: <34f49bc5e9b591b727ac99bb6afe2e7a41848d04.1544190020.git.igor.russkikh@aquantia.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5PR06CA0006.eurprd06.prod.outlook.com (2603:10a6:206:2::19) To DM6PR07MB6220.namprd07.prod.outlook.com (2603:10b6:5:17d::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM6PR07MB5787; 6:L4wd7AbA3Co2uvI/J9brOTVvS3SSH+Agkxxu7fR0kdeQFfqR5nWS+IHK0Tipf92eTo6VGiUdir9n5QkPtx5+mQm+wWLE/Ew245tT1C4n+gF8vqYyrrOQOBTHi4IjdLo0XbzBRZ/K4Hqr7IZqd0xR1E+bDMTYIwZE1ljPeMPDRsa3raKtEm/2K6Wh2WKGPc9Zx6FZPUSlfYeYgyVAKGTxpRnGHVce0ao2MVN+9rijQodWBd5H6y2KBrh5m8xWQSP7qjXAB8JOER4sZZkHGFp1QIguNR6rSaWe3yuD7aPSKADYRxcdSkC+Lalq1WHhDm7KZK9dIaYfDsm1raPziKoAI5hp846auw1UXU8qfQgX8QEppsqCoWSOkPot6rD9MW/vELyhTWhLyPsPLhzaaNwehTIj2cp3LAPkFfVv9ZKyUaxyDaw/uhztaclty6Pj3UGc26uPuJRHPpFMxs4jRi97gw==; 5:PY62tNh+xBSl/+xY2Pb0WrcrwZ5Je9rQJqF/reWrKpc2PihH+qZowoy9SpL0o9kms0UQoijjYILZgZO7ncevDbPY0VqG/NHGqvUFUQglrM2fu55e5gIr0FI3oINoLyJ/AzwT+iPcne07pdDjSznRDWanqWlZbETlAdIK2AUShGM=; 7:PbDrvBHcnTV8laEqdyxSwDHTG29QhhDJfx0UTahgPLtWLlVyqdxFU1NRK6PWP8o349MCEY+HVokRloIwqhsn683Stj62W3J4CY7QQJnh4oA8eGlW2hYgtBvnmc1cfzEjMiSMiouCrZGso1FDw9FC7g== x-ms-office365-filtering-correlation-id: 4120c355-02af-4676-3115-08d65c4c5159 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB5787; x-ms-traffictypediagnostic: DM6PR07MB5787: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231455)(999002)(944501520)(52105112)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:DM6PR07MB5787; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB5787; x-forefront-prvs: 0879599414 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39850400004)(366004)(396003)(346002)(376002)(189003)(199004)(486006)(386003)(6506007)(102836004)(2616005)(476003)(44832011)(36756003)(446003)(11346002)(4326008)(52116002)(118296001)(76176011)(107886003)(186003)(71200400001)(7736002)(305945005)(256004)(71190400001)(106356001)(54906003)(316002)(66066001)(105586002)(86362001)(97736004)(6916009)(25786009)(6486002)(81166006)(81156014)(5660300001)(3846002)(72206003)(478600001)(2906002)(6436002)(8676002)(68736007)(8936002)(26005)(53936002)(6512007)(14454004)(99286004)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB5787; H:DM6PR07MB6220.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: W/F0YP3z/4bj50Kmdq9w0mVQCBw2mX0QSgUDVGsRYinu1Z+RfkPy/frGa2gIWb7fvDvdocvSz95yZ4O8OoYT60uFESeNM9bgb0XHuCLO7pZ6BkDO9pC+YVf+K23o9nA3PhKgVs74CbT3L0HW9Uy9VUODNtY+lOlof9Qf+RpnlUh+NRKrOG41ElfjRHyRgShB1IU6iQdSUGPriEeEHoWOhb+3F8KShVsKpTVw0oHzj8Z26imXFY3OvfGVBqIBQqYQYzjrPXnpedt0L/MNzoNwBiK+590s92FkiynfuE5NMbSWIAipRdjlP36XGPgwlzbk7JH6qfhCkSLlCOsjA6riPzM/0mFmqpyGBQS5/I8ME84= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4120c355-02af-4676-3115-08d65c4c5159 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2018 14:00:17.4725 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB5787 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Dmitry Bogdanov Now RSS indirection table is initialized before setting up the number of hw queues, consequently the table may be filled by non existing queues. This patch moves the initialization when the number of hw queues is known. Signed-off-by: Dmitry Bogdanov Signed-off-by: Igor Russkikh --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c index d617289d95f7..0147c037ca96 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c @@ -84,8 +84,6 @@ void aq_nic_cfg_start(struct aq_nic_s *self) cfg->is_lro = AQ_CFG_IS_LRO_DEF; - aq_nic_rss_init(self, cfg->num_rss_queues); - /*descriptors */ cfg->rxds = min(cfg->aq_hw_caps->rxds_max, AQ_CFG_RXDS_DEF); cfg->txds = min(cfg->aq_hw_caps->txds_max, AQ_CFG_TXDS_DEF); @@ -106,6 +104,8 @@ void aq_nic_cfg_start(struct aq_nic_s *self) cfg->num_rss_queues = min(cfg->vecs, AQ_CFG_NUM_RSS_QUEUES_DEF); + aq_nic_rss_init(self, cfg->num_rss_queues); + cfg->irq_type = aq_pci_func_get_irq_type(self); if ((cfg->irq_type == AQ_HW_IRQ_LEGACY) ||