From patchwork Thu Feb 2 01:29:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13125185 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DA2CC05027 for ; Thu, 2 Feb 2023 01:30:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbjBBBaZ (ORCPT ); Wed, 1 Feb 2023 20:30:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjBBBaY (ORCPT ); Wed, 1 Feb 2023 20:30:24 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2087.outbound.protection.outlook.com [40.107.244.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D480A6ACA3 for ; Wed, 1 Feb 2023 17:30:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KIgo/0XG9fauGXnJL9mENiX2fCQkO8BtdkcmdY0Z5I3UzqR3RdB84gUMp8FsA3clPO83tJp9hPkH98xzTAmjwfmNqpuXrii4VXcpbvhQdnDdC3i50Tk29JYosVWG+Pm5wGja2aa+P5HMPA0jog9bo43ZRSzxNqYmZ7qzlrOXCzqwYwJ5iUGsqqgB57n/5TZJH7W852ucZgYCbNMHLe8U/jLM4SUnnrf0p7jsROBsXALobOUfBm28vKk4oX8SNvo6q01toguh+5MsZDCVUAeyCMXN7pVNVR7a7y5RzBKzJvUbrqJrMaK7bXovlobqmlRicEkMwLEfcw2Ylou135Yxkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gecqanyhNRfzJlbBQN8X569SoerkenoN73qNymGkL2s=; b=l/uLRGITdY7goAwquMadq/sKzZQrdPdQGjZybPdHCLkO6GkIkLdKXt7odY65W9KWxYKDzPrS1UT8XWX4mpKL72LnxPS1E3AijNXjUXSpo1LX78ZBG+Dv8HfB5LJ89HMwgPZK5jvX7W7rcXDa852K1ZJ7hxeKfjXg2jNIgTgDyL0kbs+TwGRcOg8QBFk9kthijWAWu9sBB7dDB2xBYbgCBG+LH3OFZ743Im5f6poO761HOavyQu1io6TT9ctdgRj1K+5RWMbQmfE9G9TVg2e82RbnvAQuhpo6s8uc50tNkFPw5ecyzUakgKOFVyAIa/YkT5KygCQUBES5bwpvzXFvWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gecqanyhNRfzJlbBQN8X569SoerkenoN73qNymGkL2s=; b=M49KaM0QJ7TzcK4GslH7v1OKfNcRMKqpWA8Yu1rnDtp/j6chMZPscfC9gfyF966Jsyb+W5nBp15sykjrG8DHqt7LIViQ28d0TqQ4sDpecFTemk1yPHz6F41XlarvwibDYiG/76+WRsIBpkfeNCWVhdaDUXYKHynrv5EpgVbTIo8= Received: from CY5PR15CA0100.namprd15.prod.outlook.com (2603:10b6:930:7::20) by SJ0PR12MB6736.namprd12.prod.outlook.com (2603:10b6:a03:47a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 01:30:22 +0000 Received: from CY4PEPF0000C96A.namprd02.prod.outlook.com (2603:10b6:930:7:cafe::be) by CY5PR15CA0100.outlook.office365.com (2603:10b6:930:7::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25 via Frontend Transport; Thu, 2 Feb 2023 01:30:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000C96A.mail.protection.outlook.com (10.167.241.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Thu, 2 Feb 2023 01:30:21 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 1 Feb 2023 19:30:19 -0600 From: Shannon Nelson To: , , CC: , Shannon Nelson Subject: [PATCH net 1/6] ionic: remove unnecessary indirection Date: Wed, 1 Feb 2023 17:29:57 -0800 Message-ID: <20230202013002.34358-2-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230202013002.34358-1-shannon.nelson@amd.com> References: <20230202013002.34358-1-shannon.nelson@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C96A:EE_|SJ0PR12MB6736:EE_ X-MS-Office365-Filtering-Correlation-Id: be2df3b0-0de5-402e-294c-08db04bd0d19 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WdOWOCHmU5dB8gxheU4SPXl6WXuFB3bkq3iBF56BpqKaehFOXNG0OYCp5v0ad/w2NOeIb6O62agGDa7fuLkOlDmSUqA4mSW9xO3Kgr7KJgrLjs2zdS8jCkgpv62/cnL9W/jGeQsAZO2XHqYkN/xY/onI27XCrlqASmbVJhh/9eQBfkV39djGtyhlwCJuCs8kWnlYOXmGJooK3F9Wxntia5aL5mq76hIGSEnYW4UNYNbnkQGtUHnjLAvpSPllU4kFxQWRloN70TtbeQ7BoXoIhfJx40WF7FN+hHVnGu0atlFUAgvfuafD55m3eLTESA1ihUPsGpw4wpiG8h16rfXkjNiud1WcS540qmseoGmNSbR6etduoh2jFz/InxuWVBMKbAvJIYlRHq7qhD6RSRIDJ6xL95rSovEiNvRC/EJ10cmJgdXtVt0tYxqcSGv14GL3QmJOR2AIpor3n28Dk04Vw5iARj9juJP5qxzc+1DOSc4H7lbONjQ1re1LgUymLSRqzpQSFknkNSF7drOu+LThokU+wReQcoxcqF1Yjnwe4ouNftSnsHZRf0MLuLcXvt2tqp51vODIIvr8Sa8GVa2VFAxzW0u8XGzpYsH2WZkk32V3H/b0ovzNz9lKiLwQSqLyRJ3xzHw1OfUAwVz3euJBeVIKfFX82y+fQRzjV79AlYuSZciyg3PKWh6JIJDLRHxkdQrBptUporMIVP0O1gVJP8XEQrcoqP5l5z3Qu7qQunA= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(346002)(136003)(376002)(396003)(451199018)(40470700004)(36840700001)(46966006)(36756003)(110136005)(6666004)(47076005)(54906003)(83380400001)(82310400005)(426003)(2906002)(44832011)(1076003)(82740400003)(2616005)(81166007)(316002)(478600001)(70206006)(8676002)(70586007)(40460700003)(336012)(186003)(16526019)(36860700001)(26005)(356005)(41300700001)(86362001)(8936002)(40480700001)(5660300002)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 01:30:21.7046 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be2df3b0-0de5-402e-294c-08db04bd0d19 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000C96A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6736 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org We have the pointer already, don't need to go through the lif struct for it. Signed-off-by: Shannon Nelson Reviewed-by: Leon Romanovsky --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 4dd16c487f2b..8499165b1563 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -148,7 +148,7 @@ static void ionic_link_status_check(struct ionic_lif *lif) mutex_lock(&lif->queue_lock); err = ionic_start_queues(lif); if (err && err != -EBUSY) { - netdev_err(lif->netdev, + netdev_err(netdev, "Failed to start queues: %d\n", err); set_bit(IONIC_LIF_F_BROKEN, lif->state); netif_carrier_off(lif->netdev); @@ -2463,7 +2463,7 @@ static int ionic_set_vf_rate(struct net_device *netdev, int vf, ret = ionic_set_vf_config(ionic, vf, &vfc); if (!ret) - lif->ionic->vfs[vf].maxrate = cpu_to_le32(tx_max); + ionic->vfs[vf].maxrate = cpu_to_le32(tx_max); } up_write(&ionic->vf_op_lock); From patchwork Thu Feb 2 01:29:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13125187 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9622DC05027 for ; Thu, 2 Feb 2023 01:30:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbjBBBa1 (ORCPT ); Wed, 1 Feb 2023 20:30:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjBBBaZ (ORCPT ); Wed, 1 Feb 2023 20:30:25 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2055.outbound.protection.outlook.com [40.107.93.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D99F6ACAF for ; Wed, 1 Feb 2023 17:30:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AqxYtcuZaQkW1k5ZXGTQ/4EjdW/2y1Ftv89GC2M3uMAxEjNOg4G8ZcG9hz0s9aG5mV+8iW9tNs2plN/vdToSEgbnvP6iY3M19SLxVDzqGseUYKI2zQhqH8+7BDrJKo7wKzIdh/wt344Jffxt0eK8uxFJSGEODKn0f7kt6oWyWazkRUVP363p3itEU95y5G+TZ39Gj8sIdiunupTVk/HKIgcEv6xlPFHnwcknI0BpK3xLDhdo9ZGeoTqD3XE2kPdBe4t4FnIBKSg1sAONGs+RjzV8J190+4wUVmzvkL8gkdY7OHMrTbmjT+WXFu8aeEH0hVzloLfdHnZ79R6jzEmn4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8+mo/ckDnjpynCqXPL9Rg/ZfnfY2+raX25HxATYMQjU=; b=lY6Ht4HNxbIQVKRZBrSFiCJng+/oZ7T+hSZq7McKz9bStEK5h7KByw1uFEEpbrzk6HurnrTTJdDQRWUBEV/Y/ct9fTMdYXOT7MqNXcq2T+nJ/rIVwal0qnIJ73vkNTxTztCFVzFgeNnPpjh0fjZyflWc7VjJjMpXyS9T9oe6MGYoD2uQEwAU5UIeG91a8RlKaFOXQk22AhvQa7A2Ig66/OzfaEJ6ESmC1jnX5SMWTu0faMTMS2V6d5w9GPyyxtuzZmlJ2bS6jU4QLLwIqRmPQeoPqdxFCGXZnumUU85k7GAhZE42XQx2FjmL6iIesKc2qMyeC9wFmMDN/dHDHCPvNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8+mo/ckDnjpynCqXPL9Rg/ZfnfY2+raX25HxATYMQjU=; b=xKkkAtPDmIujqyM1nO88gkpC2I1BDIa3yhdFAB8CyABHIrd5ZDCThn2d7R6g6XZ6DxkqyVXchiy0KTElM5aWQUBObNjKy6IYFzD96+yD5L32hl/jk/aSnTdkMHu3UXkLLIcCnjYezI04jQpjXPXsr2JhKKgFFcX07mjzH4lL5iQ= Received: from CY5PR15CA0101.namprd15.prod.outlook.com (2603:10b6:930:7::22) by CH0PR12MB8577.namprd12.prod.outlook.com (2603:10b6:610:18b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 01:30:22 +0000 Received: from CY4PEPF0000C966.namprd02.prod.outlook.com (2603:10b6:930:7:cafe::f0) by CY5PR15CA0101.outlook.office365.com (2603:10b6:930:7::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25 via Frontend Transport; Thu, 2 Feb 2023 01:30:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000C966.mail.protection.outlook.com (10.167.241.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Thu, 2 Feb 2023 01:30:22 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 1 Feb 2023 19:30:20 -0600 From: Shannon Nelson To: , , CC: , Shannon Nelson Subject: [PATCH net 2/6] ionic: remove unnecessary void casts Date: Wed, 1 Feb 2023 17:29:58 -0800 Message-ID: <20230202013002.34358-3-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230202013002.34358-1-shannon.nelson@amd.com> References: <20230202013002.34358-1-shannon.nelson@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C966:EE_|CH0PR12MB8577:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f89d71d-0067-45b1-7f3f-08db04bd0d59 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VlUalsHutN/vovNHwkTGmWPri9BlG4D7YBwHovc5IWg8k0W9MVjwiQ3SZFWJaUWGX+lBFob7MEmLSChzGWA6QhRifWWBG3dCV1GUMVFbKiqexEt13JBdB22amw7xVyWgpx6UDIgcdBv7SsPOqgRBClDSYKnCQFUzIKHbyA46XzuL6MvFS/itz9ahM5wclBxzSVY02AB8UsCqI4fa6mSLDKC4YDGHDq3yMvCOqeFSkcfi3Ew2NwTCZXWnLQJrkeeU5OlIwLJ6GY+wVT/lJfXCn3I85g6z2AW9ZMgolyJ322DhbGOPkhtGVAXMdZDdu7DSggCcEsicridEezl0xicSQyy1kf8uzF3k8g0ySBz9a+8EFftwpYoQCuFqPzI5Eg95qTuGsmNr/VAHn++JxP1LYHF8uUSlpZN+U1DkxEjF0SUmhHYTE3SRs15RrJtmH4GHnZJLNJ2lbtA4PTPCShLfzGZsh0LcqfcbwSibnE3ch6P+9O2spOR6E9hecwKNGO47T9hg5Umx5DpO0Mzmk35sDV34+3LDOHfSIcUJ6AfAaArQH8BSTDi3/3uoZKeSvxkdmngS7V5eeVaIR3gHDes8osOlj0QQYmv3Vq9Bjc4/z3ymVS7U+dbEA8kDVm48NA5WJjRfkndvYfsXd35dhY1DL7Ff66r67yByFMB7zFsmoLWv+Pvws3dzjbrGel1l12DNj86Uh0F1J7u1zY9p4jvP0UReuOfZPx3DwKYkHIMtrG8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(346002)(376002)(396003)(39860400002)(136003)(451199018)(40470700004)(36840700001)(46966006)(83380400001)(41300700001)(86362001)(2616005)(40480700001)(82310400005)(356005)(426003)(47076005)(336012)(81166007)(36860700001)(82740400003)(316002)(4326008)(54906003)(110136005)(40460700003)(6666004)(478600001)(8676002)(70206006)(36756003)(186003)(16526019)(26005)(70586007)(44832011)(66899018)(1076003)(8936002)(2906002)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 01:30:22.1418 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f89d71d-0067-45b1-7f3f-08db04bd0d59 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000C966.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8577 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Minor Code cleanup details. Signed-off-by: Shannon Nelson Reviewed-by: Leon Romanovsky --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 4 ++-- drivers/net/ethernet/pensando/ionic/ionic_main.c | 4 ++-- drivers/net/ethernet/pensando/ionic/ionic_phc.c | 2 +- drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index ce436e97324a..0eff78fa0565 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -121,7 +121,7 @@ static void ionic_vf_dealloc_locked(struct ionic *ionic) if (v->stats_pa) { vfc.stats_pa = 0; - (void)ionic_set_vf_config(ionic, i, &vfc); + ionic_set_vf_config(ionic, i, &vfc); dma_unmap_single(ionic->dev, v->stats_pa, sizeof(v->stats), DMA_FROM_DEVICE); v->stats_pa = 0; @@ -169,7 +169,7 @@ static int ionic_vf_alloc(struct ionic *ionic, int num_vfs) /* ignore failures from older FW, we just won't get stats */ vfc.stats_pa = cpu_to_le64(v->stats_pa); - (void)ionic_set_vf_config(ionic, i, &vfc); + ionic_set_vf_config(ionic, i, &vfc); } out: diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index a13530ec4dd8..79d4dfa9e07e 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -359,7 +359,7 @@ int ionic_adminq_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx, break; /* force a check of FW status and break out if FW reset */ - (void)ionic_heartbeat_check(lif->ionic); + ionic_heartbeat_check(lif->ionic); if ((test_bit(IONIC_LIF_F_FW_RESET, lif->state) && !lif->ionic->idev.fw_status_ready) || test_bit(IONIC_LIF_F_FW_STOPPING, lif->state)) { @@ -647,7 +647,7 @@ int ionic_port_init(struct ionic *ionic) err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); ionic_dev_cmd_port_state(&ionic->idev, IONIC_PORT_ADMIN_STATE_UP); - (void)ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); + ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); mutex_unlock(&ionic->dev_cmd_lock); if (err) { diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c index 887046838b3b..eac2f0e3576e 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_phc.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c @@ -268,7 +268,7 @@ static u64 ionic_hwstamp_read(struct ionic *ionic, u32 tick_high_before, tick_high, tick_low; /* read and discard low part to defeat hw staging of high part */ - (void)ioread32(&ionic->idev.hwstamp_regs->tick_low); + ioread32(&ionic->idev.hwstamp_regs->tick_low); tick_high_before = ioread32(&ionic->idev.hwstamp_regs->tick_high); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c index b7363376dfc8..1ee2f285cb42 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c @@ -604,14 +604,14 @@ void ionic_rx_filter_sync(struct ionic_lif *lif) * they can clear room for some new filters */ list_for_each_entry_safe(sync_item, spos, &sync_del_list, list) { - (void)ionic_lif_filter_del(lif, &sync_item->f.cmd); + ionic_lif_filter_del(lif, &sync_item->f.cmd); list_del(&sync_item->list); devm_kfree(dev, sync_item); } list_for_each_entry_safe(sync_item, spos, &sync_add_list, list) { - (void)ionic_lif_filter_add(lif, &sync_item->f.cmd); + ionic_lif_filter_add(lif, &sync_item->f.cmd); list_del(&sync_item->list); devm_kfree(dev, sync_item); From patchwork Thu Feb 2 01:29:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13125188 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95028C636CD for ; Thu, 2 Feb 2023 01:30:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230432AbjBBBaa (ORCPT ); Wed, 1 Feb 2023 20:30:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbjBBBa1 (ORCPT ); Wed, 1 Feb 2023 20:30:27 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2042.outbound.protection.outlook.com [40.107.93.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7D566ACAE for ; Wed, 1 Feb 2023 17:30:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Owfz8If1XQ6euVj9UvXj7LNoU6fxQuGZY1uW0/3wEtYb/QCtCTHzV2qjoz0eF9NP/5BZsqE/dBhOeE43jVNY6bxSnT8Tn/jaAmy8HBtw3ktcBkC+eVsAwcHO22HkdaqO90H+Xlyn5hFUYmvLzRSMeZ9F6ucvNmIA2HY8tHil7v98XGCec79S7bQCjheioN4USy0brfdfp2JRX/7v1mCMuARNSSHwDqizss2NZwPNzGwCqH0wplPYoj39aOIUDw8v2eetjOcvMasAoWCfoJHsCA29KaH27E4WajER+uwQhENq5JoJNlVofoLZf4BJGYqq+ITHCCaRBukiKyzyz2JVqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oz7KpnDRvh9sz9L7xeaHan/m4pj8kmqduS0ipSxuEQ4=; b=Fspsmhzc65GiQXi4JIvKS8EhDwDBqxOJWSSWAzJAK4vqn1xH+BbN+c2XUYwRuEs7+Eg4BDrNrVyj2m+ldUMdOX5+4gMkKl5t5bkME04i70BRlhrgiJHFBKFs5Idm21U33FysTht5lbBMPikemcnQGiuO3cOfvDT92lVfLe9c2uFgVIygNQJ5wkW98AtuNZQutm7+QMEw0wEnw9f58sq4CYiIU4RBgU5N8Wnquk63GId46u5yhw00FE0+AfGkCAWV/cRVdp8LqtkraPjrUo/GmxG58dnDgslPKhcLvBoMpcdSVfMp12b6UsrMG46M0nMJSSn/6DHZhx1XCrnpVHuLzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oz7KpnDRvh9sz9L7xeaHan/m4pj8kmqduS0ipSxuEQ4=; b=QT3AM6AJT1F1nyoNqFzq87ZeHt7rzYkm3eti4PsptQOME73U40JHla95DkUPbdDDcBZjNE0rbtucVMbueMl9yu+fDohAyH6qlxKhvHQZEIf00qXZLDN1cOOytJB9VTFzMzF9jph8awelewoL3jYEoj70ekZ76ffOzlo06FwPYHk= Received: from CY5PR15CA0102.namprd15.prod.outlook.com (2603:10b6:930:7::12) by DM4PR12MB5246.namprd12.prod.outlook.com (2603:10b6:5:399::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22; Thu, 2 Feb 2023 01:30:23 +0000 Received: from CY4PEPF0000C966.namprd02.prod.outlook.com (2603:10b6:930:7:cafe::7a) by CY5PR15CA0102.outlook.office365.com (2603:10b6:930:7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.24 via Frontend Transport; Thu, 2 Feb 2023 01:30:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000C966.mail.protection.outlook.com (10.167.241.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Thu, 2 Feb 2023 01:30:23 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 1 Feb 2023 19:30:20 -0600 From: Shannon Nelson To: , , CC: , Shannon Nelson Subject: [PATCH net 3/6] ionic: add check for NULL t/rxqcqs in reconfig Date: Wed, 1 Feb 2023 17:29:59 -0800 Message-ID: <20230202013002.34358-4-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230202013002.34358-1-shannon.nelson@amd.com> References: <20230202013002.34358-1-shannon.nelson@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C966:EE_|DM4PR12MB5246:EE_ X-MS-Office365-Filtering-Correlation-Id: c43015a6-72db-45c2-dae3-08db04bd0df6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x89J84RBcIjkl3pD8HBSB+29DzV/c6IQyiERd0+Xt5WGQ5fc0DnOg5t2iNNxcWi+HaI2CUk33tPlGC21nxYjo0/7zZoddN3vvf9X8qfvol16+oyfUdGLIlosYW00AB2YVayLMotASguszLQVmXzqaPWBVa3gwtb/KS7tr6f5gT2lqvvp+2z5mC18wdjHhlNgVl4nCP5mXZwSfgnyn0HzD76RwiZa7m8sAKRz6VnGL3jfKo/W416OnFclKJvfNYf3hrKEEzMweL1VYi4owMdcLPWelidEhB9pfzjxLzuQITH4LtRWMlLFy/4oCV11OcHnuvqpxMHPbeIYCrVcEjzLVUciSlG/BMxOMURWYZkB5loUozyawjwoYrk2RUe5D+In8zJkXo7N7JooMe+PibmMFDuuUFq5+gHBHMJ2jruDIyogHhyzor8AC3QMyJeyFUEpcR0tHKLEGRst4u85Y0PHHnvEjRgXmdzgNI720Mf+dDdl9VZVlg7P/TUiayazpyWUeHFhWoRLN3hcd6tHJ8u35bZHzE3Nx3WpQtinx/nypGQQ28dA8HOrptm7s5wShN/Z6jU+xk2TJub3ZlC47s7Y/26lxSr+TzmhLTT41S3tFPJdQo2PKji6RHp8iidk+yLBWEu5wIIZme57RNR2SIrxQPZX3e6HG52FflG+v8cLhbO2PNhH4muFjEphInbSw0qsjfCUsdqEG+noiXljwGzV3CgXv3RWczh+7GjXudvMmww= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(136003)(396003)(376002)(39860400002)(346002)(451199018)(46966006)(36840700001)(40470700004)(356005)(86362001)(186003)(1076003)(2616005)(81166007)(36860700001)(26005)(36756003)(16526019)(336012)(426003)(83380400001)(316002)(47076005)(478600001)(6666004)(5660300002)(54906003)(4326008)(8676002)(70586007)(82740400003)(41300700001)(2906002)(110136005)(70206006)(44832011)(8936002)(82310400005)(40480700001)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 01:30:23.1575 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c43015a6-72db-45c2-dae3-08db04bd0df6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000C966.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5246 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Make sure there are qcqs to clean before trying to swap resources or clean their interrupt assignments. Fixes: 101b40a0171f ("ionic: change queue count with no reset") Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 8499165b1563..c08d0762212c 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2741,6 +2741,14 @@ int ionic_reconfigure_queues(struct ionic_lif *lif, sg_desc_sz = sizeof(struct ionic_txq_sg_desc); for (i = 0; i < qparam->nxqs; i++) { + /* If missing, short placeholder qcq needed for swap */ + if (!lif->txqcqs[i]) { + flags = IONIC_QCQ_F_TX_STATS | IONIC_QCQ_F_SG; + err = ionic_qcq_alloc(lif, IONIC_QTYPE_TXQ, i, "tx", flags, + 4, desc_sz, comp_sz, sg_desc_sz, + lif->kern_pid, &lif->txqcqs[i]); + } + flags = lif->txqcqs[i]->flags & ~IONIC_QCQ_F_INTR; err = ionic_qcq_alloc(lif, IONIC_QTYPE_TXQ, i, "tx", flags, num_desc, desc_sz, comp_sz, sg_desc_sz, @@ -2760,6 +2768,14 @@ int ionic_reconfigure_queues(struct ionic_lif *lif, comp_sz *= 2; for (i = 0; i < qparam->nxqs; i++) { + /* If missing, short placeholder qcq needed for swap */ + if (!lif->rxqcqs[i]) { + flags = IONIC_QCQ_F_RX_STATS | IONIC_QCQ_F_SG; + err = ionic_qcq_alloc(lif, IONIC_QTYPE_RXQ, i, "rx", flags, + 4, desc_sz, comp_sz, sg_desc_sz, + lif->kern_pid, &lif->rxqcqs[i]); + } + flags = lif->rxqcqs[i]->flags & ~IONIC_QCQ_F_INTR; err = ionic_qcq_alloc(lif, IONIC_QTYPE_RXQ, i, "rx", flags, num_desc, desc_sz, comp_sz, sg_desc_sz, @@ -2809,10 +2825,15 @@ int ionic_reconfigure_queues(struct ionic_lif *lif, lif->tx_coalesce_hw = lif->rx_coalesce_hw; } - /* clear existing interrupt assignments */ + /* Clear existing interrupt assignments. We check for NULL here + * because we're checking the whole array for potential qcqs, not + * just those qcqs that have just been set up. + */ for (i = 0; i < lif->ionic->ntxqs_per_lif; i++) { - ionic_qcq_intr_free(lif, lif->txqcqs[i]); - ionic_qcq_intr_free(lif, lif->rxqcqs[i]); + if (lif->txqcqs[i]) + ionic_qcq_intr_free(lif, lif->txqcqs[i]); + if (lif->rxqcqs[i]) + ionic_qcq_intr_free(lif, lif->rxqcqs[i]); } /* re-assign the interrupts */ From patchwork Thu Feb 2 01:30:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13125189 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45851C05027 for ; Thu, 2 Feb 2023 01:30:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231575AbjBBBai (ORCPT ); Wed, 1 Feb 2023 20:30:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbjBBBa2 (ORCPT ); Wed, 1 Feb 2023 20:30:28 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2043.outbound.protection.outlook.com [40.107.92.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA486C12E for ; Wed, 1 Feb 2023 17:30:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=axXiigIDRsWqa9Z0NQYiPxr0Ng1srvJfKRmSkfNkmgLGaZNbl0A9KSKlu7AFaoHCUet0TkoAiHXKDOGW/jpZflMBJ8RSA5uQ1RL4UHu2+d7LzXVjX3ojGF8aadLF0FCDP6agskS2ihGdy+g4TvFDugTI66WDFkiatEVHIzPisQrpukOgTv2jSEpqfLLEy38dfG5xhAft2lc9SaGgE2ZKZ1U2taSQDCQX55WR8w5BNoGZAoWlVFcVT2UWgO4T++IPnKxTovqdcHxuWpbGsBSCn4W4irYA2sLWxRR11/nJuyiMiZ5LKQQfHJv9kxxHDSSmAE/mQXyUj7fd7ku/QefilQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7iOgK0xifN66Bqda3t98g47TV9jvi0vuGu6ha5TKx3o=; b=eXZJaCV7PU0gqVHoTBwhl3yMVhli74aM5k6MGoqBhqH/DDEYCnZWINWC0m3+3ELLlcWpKucrBRi+Gvu1Vn6XZkwBXfuz23m/uFNeNQ1v7p51uF5sSm3gWBKpM+Yw/tHEFHsjyJH5U5b+e11QeUb47rzqOtyCRVbaNpHODqVrsk5T44++dbUlv8vFr3tlUVWDY3tBp1FaSK2p3dXF+45brMOflU2TLyXXAKgY7K/kE4U3uBYgXhRwsvGDbCTyvDyaled3/KlQL+fLNfDcvKR68AQV03jxKmE07tPxxGj/aClRLSBJFYtim175F2d02LyOVKAF1dZtXGJhN+ldCWtp3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7iOgK0xifN66Bqda3t98g47TV9jvi0vuGu6ha5TKx3o=; b=ift1BX0akOFvONYH9gzcmjMu4QI5wWkYS5w/g7o2VGybImPV9oPXJ/yOOntgP+uaXVIbzW42VsTY3/6d3tHU9MWod32tAY55Ujf+fZqgYi+rF1gmxUxVxqEZr9+EZWLwR9IaDs55FKGumbbU6EGZgcgQmfVGTr4trnSjF1BdnAE= Received: from DS7PR05CA0058.namprd05.prod.outlook.com (2603:10b6:8:2f::11) by BL1PR12MB5032.namprd12.prod.outlook.com (2603:10b6:208:30a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25; Thu, 2 Feb 2023 01:30:24 +0000 Received: from DS1PEPF0000E632.namprd02.prod.outlook.com (2603:10b6:8:2f:cafe::6c) by DS7PR05CA0058.outlook.office365.com (2603:10b6:8:2f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25 via Frontend Transport; Thu, 2 Feb 2023 01:30:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0000E632.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.21 via Frontend Transport; Thu, 2 Feb 2023 01:30:23 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 1 Feb 2023 19:30:21 -0600 From: Shannon Nelson To: , , CC: , Neel Patel , Shannon Nelson Subject: [PATCH net 4/6] ionic: clean interrupt before enabling queue to avoid credit race Date: Wed, 1 Feb 2023 17:30:00 -0800 Message-ID: <20230202013002.34358-5-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230202013002.34358-1-shannon.nelson@amd.com> References: <20230202013002.34358-1-shannon.nelson@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E632:EE_|BL1PR12MB5032:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b75c1ee-dad4-407a-e7f2-08db04bd0e48 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ea174H8JZTebE2lyoX309sFyMR5ozRWmKcAcpKC+op77Rf2Q2iwaD3PkJceuVyLBe974AU/CBLxleZbvEyv6EP0yaldWn4q9DTjVjjhHeRuhwo9tmYzhtaOrySxbjiIn4xcDPVmeKD4m4HLeYTF1qYyJBbYkxgTJ1WHPILL+FwgHJk3bhgsFiQxmX8LMiKDg8fYoL4gAn8TUzC01jHv8oj432T9YpKZY6MjXlbGZRoWR4ZbpnNQ0Ze23qPqBVavYbKFodSI9roXZBqlyWWN3npo7mF2N3WGEfmzy9o5YpYB/6v8JSZJb6R9ThPPEG3gdlEe6f8Fs/CSfmbi5/+h1RNExaY0DOwxnjrUjtXRcnHikBWHYfA2sDfWfISTtlGgHWaVitBMpC6nu24gmCoVqiWOVQSxUjNmuIUY3lrwi+u5rY6e4d1QYQ38G1fgXPcN06Q2vY6qTXcTUlPOuN8RfE2T6dpe52mJ9Rn993EoL+iyBo+9MjiuTl5kn/5LPGNJstAmX4lwMNrACtuyTRrcOQAH88SqMGI1RwOIPSWuvwpDUpZEgiTwtg61Np0nsWUZDTtQT/vpd03Z3SHEtTKQk4Ny0X167vAB3uXF42V0ducelAFLzDeFlDl84WNCs4h8vCOmpcm94sm22MzrBPzTBJbQGwm9eCZAR5W70Dppny5SWv0xYKOreU7AsXOICSQV5yoDhrLVZXgLgnqQJtlqIsxRks7vUut76x1Q6sr/F0mYceHRG709NQV1ucNiJdBCg2grdDGdby/YGKpOPUMjAqw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(396003)(376002)(39860400002)(451199018)(40470700004)(46966006)(36840700001)(5660300002)(44832011)(41300700001)(8936002)(478600001)(36860700001)(4326008)(47076005)(70206006)(70586007)(8676002)(6666004)(26005)(36756003)(1076003)(16526019)(186003)(83380400001)(336012)(110136005)(2616005)(2906002)(82740400003)(40480700001)(40460700003)(86362001)(81166007)(356005)(54906003)(316002)(426003)(82310400005)(210963003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 01:30:23.7264 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b75c1ee-dad4-407a-e7f2-08db04bd0e48 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000E632.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5032 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Neel Patel Clear the interrupt credits before enabling the queue rather than after to be sure that the enabled queue starts at 0 and that we don't wipe away possible credits after enabling the queue. Fixes: 0f3154e6bcb3 ("ionic: Add Tx and Rx handling") Signed-off-by: Neel Patel Signed-off-by: Shannon Nelson Reviewed-by: Leon Romanovsky --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index c08d0762212c..90a3ad4a6ea0 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -269,6 +269,7 @@ static int ionic_qcq_enable(struct ionic_qcq *qcq) .oper = IONIC_Q_ENABLE, }, }; + int ret; idev = &lif->ionic->idev; dev = lif->ionic->dev; @@ -276,16 +277,24 @@ static int ionic_qcq_enable(struct ionic_qcq *qcq) dev_dbg(dev, "q_enable.index %d q_enable.qtype %d\n", ctx.cmd.q_control.index, ctx.cmd.q_control.type); + if (qcq->flags & IONIC_QCQ_F_INTR) + ionic_intr_clean(idev->intr_ctrl, qcq->intr.index); + + ret = ionic_adminq_post_wait(lif, &ctx); + if (ret) + return ret; + + if (qcq->napi.poll) + napi_enable(&qcq->napi); + if (qcq->flags & IONIC_QCQ_F_INTR) { irq_set_affinity_hint(qcq->intr.vector, &qcq->intr.affinity_mask); - napi_enable(&qcq->napi); - ionic_intr_clean(idev->intr_ctrl, qcq->intr.index); ionic_intr_mask(idev->intr_ctrl, qcq->intr.index, IONIC_INTR_MASK_CLEAR); } - return ionic_adminq_post_wait(lif, &ctx); + return 0; } static int ionic_qcq_disable(struct ionic_lif *lif, struct ionic_qcq *qcq, int fw_err) From patchwork Thu Feb 2 01:30:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13125190 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1226C636D3 for ; Thu, 2 Feb 2023 01:30:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231607AbjBBBaj (ORCPT ); Wed, 1 Feb 2023 20:30:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjBBBa3 (ORCPT ); Wed, 1 Feb 2023 20:30:29 -0500 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2059.outbound.protection.outlook.com [40.107.100.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 648AD76412 for ; Wed, 1 Feb 2023 17:30:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pe1OwsiuGNHli1z+Bm7fSdq7YIvWUVrmzeKGldO/t6wFnKtktZS/d415iIt4YP4hbFwM5fhZod5R3xEwftW/tCj8b3HQelSrtRLJfUT1YAFbiZshomuD8z58G4talfAL/dcyK+SKk0riUPPwIX3y4a07yWWwyAiAe/TxZjBdV/8nb2F1dckf0Cj7vElkKS1SKSVVtSByOLhf0q7Ey6a2/VH9HCaDbF9bjUIJh7cBBFn/VIToapuL/7ROxZ5EHD7xxGgADTWLDPTTfraZ26aIyT5MSCRo2Y6+I0aKjSuNNaEC7VSttGKSQnbVthToQO1haoKr29JO1/7vqJvbBxjd9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GembllYsddk+fTseI2KVlvidrWiegJe8XZ0wzvhZLWw=; b=d9uihZGtwIeHvzQXGossi9/+o+o27u3gxcwZcTzXTgYK2PM8X7I7kAqaQA2kCOCbP01Ga2WUzj5BcrpWB9A4gLeBhQMHvWsyuad/reMJ0wYGBrjfdSAuESdzHdNSGLtqgQzPzVqSRt+0AauejLpw3F5CikNmo+VefnF3Pf2SPXceYaF2YOH+qzAZyqvwG1+PltA4iHu1PXlqE+D4lEYqJNT36soqzlqD1zZHU90+vx9/xZZGkPROHCJT6Tw8jd4mKcqt2Sg5X5f7WRBqunimIjxyhsSjZSBwuWp3tOH4hExZmb/w93JrkYHUNsBqEfl+B6hQmQjcx6RzP8Ri4dqBQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GembllYsddk+fTseI2KVlvidrWiegJe8XZ0wzvhZLWw=; b=NRmiHRN+vUH31/8PnZnnMBN+jSpF6So62MxZe5VJ1jqRMz19tZIad7OPqMuy9aIjMK8a+wjzaDMB/jVFKiaptkstAFOAFhFySer/eZaZ4F+XYCs+wPyUu0FvBuin2SZD0zn9ol/EX59DeZS9eFj4dwfJduMNOqEkR28vKD88sB4= Received: from DS7PR05CA0046.namprd05.prod.outlook.com (2603:10b6:8:2f::14) by DM4PR12MB6010.namprd12.prod.outlook.com (2603:10b6:8:6a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Thu, 2 Feb 2023 01:30:24 +0000 Received: from DS1PEPF0000E632.namprd02.prod.outlook.com (2603:10b6:8:2f:cafe::af) by DS7PR05CA0046.outlook.office365.com (2603:10b6:8:2f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22 via Frontend Transport; Thu, 2 Feb 2023 01:30:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0000E632.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.21 via Frontend Transport; Thu, 2 Feb 2023 01:30:24 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 1 Feb 2023 19:30:22 -0600 From: Shannon Nelson To: , , CC: , Shannon Nelson Subject: [PATCH net 5/6] ionic: clear up notifyq alloc commentary Date: Wed, 1 Feb 2023 17:30:01 -0800 Message-ID: <20230202013002.34358-6-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230202013002.34358-1-shannon.nelson@amd.com> References: <20230202013002.34358-1-shannon.nelson@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E632:EE_|DM4PR12MB6010:EE_ X-MS-Office365-Filtering-Correlation-Id: 83691cb8-ae13-4935-93be-08db04bd0eb6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IgHG5x6SNsJcprafHlJAOBQrO0lKzLsRXRSy54GuVu2xnGrIG6SPaIzcFn6n3UuXMnzKrAMI26B4/L6qIsUZNDg0paMToRVQIQNm4Awr501cPjT/16IdkKv2hRcG/HjXahbRWJqOZ3L/VEDhC46ZqSv92qRGchxGsEiCgo0NsTHW7FH88OQvwpAlk35JzEucyN/Qhx7L/qx4uKB6rX7eCF+rWU8a9rabqefFasfKNQOMaJK+Zs7h8NWhLCTRP22X+XP1hvezjUbcK2vyJoMDFc4ohz0H4E6sgfNlUBsy0WTjvEUH95vYeAzsRFfYAB6lhOu4BwGuGQ3tRFP+NprcFLdfXloGJmR0rGRL/HvC0WFaTWUY+vKiEljIcYWXhvNaXor/UR9mL0OpxZKMm7Sg+gBP/DlZM5rXYPwpjjIa3SNX+ixQOy2dgaSl75CcBtJx3bdDLBzv1E3APPMwdCwtoddCwz4lj7vDYTvgB8Yb6kUV9tAc8LAeCQWHmIz1+NJFxEr1op91cjgtCAKI0RK9J9Wd0u6YfhlZmlaHf/79UtnhYyITOoMy3SymR36MiDuJISH+DWfHc8mUvxdZL1MOUcrY0ytwr1/CEDAV5WLQAtS+IBnIqzG0wSWKkKBxab/VA5ymyrak8nnqrOqcoMYvluZa7z2ibBYNdelwKdsZNnJOxa6QAdjbbelG3qARCStcnV7Sbdrom/rUicQXMmtLuudsYotgNRVSmP+cr6OUX3A= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(346002)(376002)(39860400002)(136003)(396003)(451199018)(36840700001)(46966006)(40470700004)(6666004)(47076005)(426003)(44832011)(336012)(41300700001)(26005)(186003)(16526019)(2616005)(36756003)(40460700003)(1076003)(54906003)(110136005)(81166007)(8936002)(2906002)(316002)(82310400005)(356005)(70206006)(70586007)(40480700001)(83380400001)(86362001)(82740400003)(5660300002)(8676002)(36860700001)(478600001)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 01:30:24.4608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83691cb8-ae13-4935-93be-08db04bd0eb6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0000E632.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6010 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Make sure the q+cq alloc for NotifyQ is clearly documented and don't bother with unnecessary local variables. Signed-off-by: Shannon Nelson Reviewed-by: Leon Romanovsky --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 90a3ad4a6ea0..486fc0bcc0ad 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -573,13 +573,15 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, } if (flags & IONIC_QCQ_F_NOTIFYQ) { - int q_size, cq_size; + int q_size; - /* q & cq need to be contiguous in case of notifyq */ + /* q & cq need to be contiguous in NotifyQ, so alloc it all in q + * and don't alloc qc. We leave new->qc_size and new->qc_base + * as 0 to be sure we don't try to free it later. + */ q_size = ALIGN(num_descs * desc_size, PAGE_SIZE); - cq_size = ALIGN(num_descs * cq_desc_size, PAGE_SIZE); - - new->q_size = PAGE_SIZE + q_size + cq_size; + new->q_size = PAGE_SIZE + q_size + + ALIGN(num_descs * cq_desc_size, PAGE_SIZE); new->q_base = dma_alloc_coherent(dev, new->q_size, &new->q_base_pa, GFP_KERNEL); if (!new->q_base) { From patchwork Thu Feb 2 01:30:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13125191 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16A13C636CD for ; Thu, 2 Feb 2023 01:31:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbjBBBbR (ORCPT ); Wed, 1 Feb 2023 20:31:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbjBBBbP (ORCPT ); Wed, 1 Feb 2023 20:31:15 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2044.outbound.protection.outlook.com [40.107.244.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43F426BBEC for ; Wed, 1 Feb 2023 17:30:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MPhuEQ7nFBR26abbGioKmBXea/Kcd+Ros07PnwfAHUOdj7D61NgUfSE68D1YKbgUoCjRLHxn9/QJhgS9XHQ/uK20BRDh1P/dIBFbEoEs2OOtY7qOxQh7oXERF5rBkSneLsTCWOJ8os7AkDLW9sHOuzC7flBR6tFMdqfK7y19Yx86mDtOX5DgGBSwgadklw2sccBfDEn1M/B9a2VuIvy4zUqvOY0Pd2tfUj806y/oGOSfOLf0GUiwBjk9Wh3QNCiF40QcM+0VSEnmbc38E5VlCH8iy2HQIctKqPl8wJxUfKdPc85u5lVvjAqvmT4OXyNY6glnbDmkafB+77Vn7Np8Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uoXwI07mFmRcCeL/Sm84PC4zHN1hCvJeKCmaaMtGSbk=; b=EUUKeNTFYibsH5JdwtO34htNZflmO2Amkus09NS2sY0eSrrv9T/SNGj7e4URuiKKFQ6lEKeNsUAAVIHLAXh1tmCC0GLaV/wwBcDGMJF0alYaKKxkesYVHpKvpqSFbnUCtyx4CMSf86Sgh1F7+YWWwFzErm7HpC81kxLjmWh3qSmiAXLvidQBVtztBW5XIQXDfaYhB5d/+pvdjnarb/ov02+En3e4/H9/KboErfHBl7eoAvu6TTbtq4NeHyPnr+YWJ2LTfFzV55IrWcXk6guOqPpHdn/ZsdI0y/oK3PSLdr2u7GxhHS//WkI5vX3jRq21uuE6nq/psO3B4imPrhp0Jw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uoXwI07mFmRcCeL/Sm84PC4zHN1hCvJeKCmaaMtGSbk=; b=r59bViV6K7vMbNXa5Cngi45vcxbsN1UPXs2obCeFRydD+iRmwbQkRfH9Vfiy9BQuJxspyBx6d0KEUozyWARE0dvpX/o+B/Xe6ujGoH6etVUlSsyjm/c2B8AI0JX72j7PuOeDKmL9tql+dFrzSQvEQ1sTMtiDTPKH5a764XMSebg= Received: from CY5PR15CA0095.namprd15.prod.outlook.com (2603:10b6:930:7::17) by BL0PR12MB4851.namprd12.prod.outlook.com (2603:10b6:208:1c1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Thu, 2 Feb 2023 01:30:52 +0000 Received: from CY4PEPF0000C966.namprd02.prod.outlook.com (2603:10b6:930:7:cafe::82) by CY5PR15CA0095.outlook.office365.com (2603:10b6:930:7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.24 via Frontend Transport; Thu, 2 Feb 2023 01:30:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000C966.mail.protection.outlook.com (10.167.241.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.17 via Frontend Transport; Thu, 2 Feb 2023 01:30:25 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 1 Feb 2023 19:30:23 -0600 From: Shannon Nelson To: , , CC: , Allen Hubbe , Shannon Nelson Subject: [PATCH net 6/6] ionic: missed doorbell workaround Date: Wed, 1 Feb 2023 17:30:02 -0800 Message-ID: <20230202013002.34358-7-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230202013002.34358-1-shannon.nelson@amd.com> References: <20230202013002.34358-1-shannon.nelson@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C966:EE_|BL0PR12MB4851:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d842aca-6689-4cd8-7711-08db04bd1f04 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AJLFZfXU4S932TehjMqovQhYnFV3G2IJtm5fh4pt5lemIpG57VZaWz7vFhoDluAROL3f8BI6RZKn18rtNsCmCUoVduhDOWG4pV0+w9Er9FHUSLFSPiAd/RqkxD65T4RGgPNrQIzyWIsTCLHs1cBEDYSVEys15E59gTAA1wz5i2WWBosMysql5Taoa738FNqccKcblcLpW8txtuobLg0NSYwNuv8SLyXSwmZ60sr1IsDGVTa5W/c17Cbioe1EuruH+lM9JHnRpZHc9mbYI5TuKNcVi45FkVVZrSbxKx/UuFtx0QYS4Xjh+ALWbeGdqn+KlB0+xsNWmYa8E4YOBaH9uZWNRkIbf4LaSM87g0F0kKpB3PtyrLxnZVSjW39AYbcVujnR0djPSA8CPMOTXzY9uvQnpU9K9DXkKIFLZWHBXUJUQTpHFZOar78DeQZPBSqEikkzirzI/VmU7fWGeYzI08G7GJk2IZ3NWODaNqHc2l4cm+QNnNhOLWfQxy83fs5vEVYOlXkHuL9ULQJ5FW/SMpBkfRmNxOQTlUuYH8FsLDN3Gkzy75qymblXfyF6G8FGgLgyR+BR/pZXS0Yga90ta5m9OKaQjfIN0lIxvdE6cnGTc9idTa4+0+owtDsCcjVIUkbMc6qMVhqLdV95K928cV74mDtMU0fTRfTv3XVVi/NFf4N4PjC9HnoLKBM5bExyP4Ni/XOtYYUDmxkiuvdDUs1ms79hhbWt57dJjolY9WI= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199018)(36840700001)(46966006)(40470700004)(40460700003)(16526019)(1076003)(2906002)(4326008)(8676002)(186003)(6666004)(70586007)(82740400003)(44832011)(30864003)(8936002)(41300700001)(478600001)(70206006)(26005)(54906003)(5660300002)(336012)(316002)(110136005)(426003)(47076005)(36756003)(83380400001)(356005)(82310400005)(40480700001)(86362001)(81166007)(2616005)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 01:30:25.3450 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d842aca-6689-4cd8-7711-08db04bd1f04 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000C966.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4851 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Allen Hubbe In one version of the HW there is a remote possibility that it will miss the doorbell ring. This adds a bit of protection to be sure we don't stall a queue from a missed doorbell. Fixes: 0f3154e6bcb3 ("ionic: Add Tx and Rx handling") Signed-off-by: Allen Hubbe Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_dev.c | 9 +- .../net/ethernet/pensando/ionic/ionic_dev.h | 12 +++ .../net/ethernet/pensando/ionic/ionic_lif.c | 41 ++++++++- .../net/ethernet/pensando/ionic/ionic_lif.h | 2 + .../net/ethernet/pensando/ionic/ionic_main.c | 29 +++++++ .../net/ethernet/pensando/ionic/ionic_txrx.c | 87 ++++++++++++++++++- 6 files changed, 176 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.c b/drivers/net/ethernet/pensando/ionic/ionic_dev.c index 626b9113e7c4..d911f4fd9af6 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.c @@ -708,9 +708,16 @@ void ionic_q_post(struct ionic_queue *q, bool ring_doorbell, ionic_desc_cb cb, q->lif->index, q->name, q->hw_type, q->hw_index, q->head_idx, ring_doorbell); - if (ring_doorbell) + if (ring_doorbell) { ionic_dbell_ring(lif->kern_dbpage, q->hw_type, q->dbval | q->head_idx); + + q->dbell_jiffies = jiffies; + + if (q_to_qcq(q)->napi_qcq) + mod_timer(&q_to_qcq(q)->napi_qcq->napi_deadline, + jiffies + IONIC_NAPI_DEADLINE); + } } static bool ionic_q_is_posted(struct ionic_queue *q, unsigned int pos) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h index 2a1d7b9c07e7..bce3ca38669b 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h @@ -25,6 +25,12 @@ #define IONIC_DEV_INFO_REG_COUNT 32 #define IONIC_DEV_CMD_REG_COUNT 32 +#define IONIC_NAPI_DEADLINE (HZ / 200) /* 5ms */ +#define IONIC_ADMIN_DOORBELL_DEADLINE (HZ / 2) /* 500ms */ +#define IONIC_TX_DOORBELL_DEADLINE (HZ / 100) /* 10ms */ +#define IONIC_RX_MIN_DOORBELL_DEADLINE (HZ / 100) /* 10ms */ +#define IONIC_RX_MAX_DOORBELL_DEADLINE (HZ * 5) /* 5s */ + struct ionic_dev_bar { void __iomem *vaddr; phys_addr_t bus_addr; @@ -216,6 +222,8 @@ struct ionic_queue { struct ionic_lif *lif; struct ionic_desc_info *info; u64 dbval; + unsigned long dbell_deadline; + unsigned long dbell_jiffies; u16 head_idx; u16 tail_idx; unsigned int index; @@ -361,4 +369,8 @@ void ionic_q_service(struct ionic_queue *q, struct ionic_cq_info *cq_info, int ionic_heartbeat_check(struct ionic *ionic); bool ionic_is_fw_running(struct ionic_dev *idev); +bool ionic_adminq_poke_doorbell(struct ionic_queue *q); +bool ionic_txq_poke_doorbell(struct ionic_queue *q); +bool ionic_rxq_poke_doorbell(struct ionic_queue *q); + #endif /* _IONIC_DEV_H_ */ diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 486fc0bcc0ad..5ccb32005765 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -16,6 +16,7 @@ #include "ionic.h" #include "ionic_bus.h" +#include "ionic_dev.h" #include "ionic_lif.h" #include "ionic_txrx.h" #include "ionic_ethtool.h" @@ -200,6 +201,13 @@ void ionic_link_status_check_request(struct ionic_lif *lif, bool can_sleep) } } +static void ionic_napi_deadline(struct timer_list *timer) +{ + struct ionic_qcq *qcq = container_of(timer, struct ionic_qcq, napi_deadline); + + napi_schedule(&qcq->napi); +} + static irqreturn_t ionic_isr(int irq, void *data) { struct napi_struct *napi = data; @@ -325,6 +333,7 @@ static int ionic_qcq_disable(struct ionic_lif *lif, struct ionic_qcq *qcq, int f synchronize_irq(qcq->intr.vector); irq_set_affinity_hint(qcq->intr.vector, NULL); napi_disable(&qcq->napi); + del_timer_sync(&qcq->napi_deadline); } /* If there was a previous fw communcation error, don't bother with @@ -460,6 +469,7 @@ static void ionic_link_qcq_interrupts(struct ionic_qcq *src_qcq, n_qcq->intr.vector = src_qcq->intr.vector; n_qcq->intr.index = src_qcq->intr.index; + n_qcq->napi_qcq = src_qcq->napi_qcq; } static int ionic_alloc_qcq_interrupt(struct ionic_lif *lif, struct ionic_qcq *qcq) @@ -784,8 +794,14 @@ static int ionic_lif_txq_init(struct ionic_lif *lif, struct ionic_qcq *qcq) dev_dbg(dev, "txq->hw_type %d\n", q->hw_type); dev_dbg(dev, "txq->hw_index %d\n", q->hw_index); - if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) + q->dbell_deadline = IONIC_TX_DOORBELL_DEADLINE; + q->dbell_jiffies = jiffies; + + if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) { netif_napi_add(lif->netdev, &qcq->napi, ionic_tx_napi); + qcq->napi_qcq = qcq; + timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0); + } qcq->flags |= IONIC_QCQ_F_INITED; @@ -839,11 +855,17 @@ static int ionic_lif_rxq_init(struct ionic_lif *lif, struct ionic_qcq *qcq) dev_dbg(dev, "rxq->hw_type %d\n", q->hw_type); dev_dbg(dev, "rxq->hw_index %d\n", q->hw_index); + q->dbell_deadline = IONIC_RX_MIN_DOORBELL_DEADLINE; + q->dbell_jiffies = jiffies; + if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) netif_napi_add(lif->netdev, &qcq->napi, ionic_rx_napi); else netif_napi_add(lif->netdev, &qcq->napi, ionic_txrx_napi); + qcq->napi_qcq = qcq; + timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0); + qcq->flags |= IONIC_QCQ_F_INITED; return 0; @@ -1161,6 +1183,7 @@ static int ionic_adminq_napi(struct napi_struct *napi, int budget) struct ionic_dev *idev = &lif->ionic->idev; unsigned long irqflags; unsigned int flags = 0; + bool resched = false; int rx_work = 0; int tx_work = 0; int n_work = 0; @@ -1198,6 +1221,16 @@ static int ionic_adminq_napi(struct napi_struct *napi, int budget) ionic_intr_credits(idev->intr_ctrl, intr->index, credits, flags); } + if (!a_work && ionic_adminq_poke_doorbell(&lif->adminqcq->q)) + resched = true; + if (lif->hwstamp_rxq && !rx_work && ionic_rxq_poke_doorbell(&lif->hwstamp_rxq->q)) + resched = true; + if (lif->hwstamp_txq && !tx_work && ionic_txq_poke_doorbell(&lif->hwstamp_txq->q)) + resched = true; + if (resched) + mod_timer(&lif->adminqcq->napi_deadline, + jiffies + IONIC_NAPI_DEADLINE); + return work_done; } @@ -3277,8 +3310,14 @@ static int ionic_lif_adminq_init(struct ionic_lif *lif) dev_dbg(dev, "adminq->hw_type %d\n", q->hw_type); dev_dbg(dev, "adminq->hw_index %d\n", q->hw_index); + q->dbell_deadline = IONIC_ADMIN_DOORBELL_DEADLINE; + q->dbell_jiffies = jiffies; + netif_napi_add(lif->netdev, &qcq->napi, ionic_adminq_napi); + qcq->napi_qcq = qcq; + timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0); + napi_enable(&qcq->napi); if (qcq->flags & IONIC_QCQ_F_INTR) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index a53984bf3544..734519895614 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -74,8 +74,10 @@ struct ionic_qcq { struct ionic_queue q; struct ionic_cq cq; struct ionic_intr_info intr; + struct timer_list napi_deadline; struct napi_struct napi; unsigned int flags; + struct ionic_qcq *napi_qcq; struct dentry *dentry; }; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 79d4dfa9e07e..1dc79cecc5cc 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -289,6 +289,35 @@ static void ionic_adminq_cb(struct ionic_queue *q, complete_all(&ctx->work); } +bool ionic_adminq_poke_doorbell(struct ionic_queue *q) +{ + struct ionic_lif *lif = q->lif; + unsigned long now, then, dif; + unsigned long irqflags; + + spin_lock_irqsave(&lif->adminq_lock, irqflags); + + if (q->tail_idx == q->head_idx) { + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); + return false; + } + + now = READ_ONCE(jiffies); + then = q->dbell_jiffies; + dif = now - then; + + if (dif > q->dbell_deadline) { + ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, + q->dbval | q->head_idx); + + q->dbell_jiffies = now; + } + + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); + + return true; +} + int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) { struct ionic_desc_info *desc_info; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c index 0c3977416cd1..f761780f0162 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -22,6 +22,67 @@ static inline void ionic_rxq_post(struct ionic_queue *q, bool ring_dbell, ionic_q_post(q, ring_dbell, cb_func, cb_arg); } +bool ionic_txq_poke_doorbell(struct ionic_queue *q) +{ + unsigned long now, then, dif; + struct netdev_queue *netdev_txq; + struct net_device *netdev; + + netdev = q->lif->netdev; + netdev_txq = netdev_get_tx_queue(netdev, q->index); + + HARD_TX_LOCK(netdev, netdev_txq, smp_processor_id()); + + if (q->tail_idx == q->head_idx) { + HARD_TX_UNLOCK(netdev, netdev_txq); + return false; + } + + now = READ_ONCE(jiffies); + then = q->dbell_jiffies; + dif = now - then; + + if (dif > q->dbell_deadline) { + ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, + q->dbval | q->head_idx); + + q->dbell_jiffies = now; + } + + HARD_TX_UNLOCK(netdev, netdev_txq); + + return true; +} + +bool ionic_rxq_poke_doorbell(struct ionic_queue *q) +{ + unsigned long now, then, dif; + + /* no lock, called from rx napi or txrx napi, nothing else can fill */ + + if (q->tail_idx == q->head_idx) + return false; + + now = READ_ONCE(jiffies); + then = q->dbell_jiffies; + dif = now - then; + + if (dif > q->dbell_deadline) { + ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, + q->dbval | q->head_idx); + + q->dbell_jiffies = now; + + dif = 2 * q->dbell_deadline; + if (dif > IONIC_RX_MAX_DOORBELL_DEADLINE) + dif = IONIC_RX_MAX_DOORBELL_DEADLINE; + + q->dbell_deadline = dif; + } + + return true; +} + static inline struct netdev_queue *q_to_ndq(struct ionic_queue *q) { return netdev_get_tx_queue(q->lif->netdev, q->index); @@ -424,6 +485,12 @@ void ionic_rx_fill(struct ionic_queue *q) ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, q->dbval | q->head_idx); + + q->dbell_deadline = IONIC_RX_MIN_DOORBELL_DEADLINE; + q->dbell_jiffies = jiffies; + + mod_timer(&q_to_qcq(q)->napi_qcq->napi_deadline, + jiffies + IONIC_NAPI_DEADLINE); } void ionic_rx_empty(struct ionic_queue *q) @@ -511,6 +578,9 @@ int ionic_tx_napi(struct napi_struct *napi, int budget) work_done, flags); } + if (!work_done && ionic_txq_poke_doorbell(&qcq->q)) + mod_timer(&qcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE); + return work_done; } @@ -544,23 +614,29 @@ int ionic_rx_napi(struct napi_struct *napi, int budget) work_done, flags); } + if (!work_done && ionic_rxq_poke_doorbell(&qcq->q)) + mod_timer(&qcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE); + return work_done; } int ionic_txrx_napi(struct napi_struct *napi, int budget) { - struct ionic_qcq *qcq = napi_to_qcq(napi); + struct ionic_qcq *rxqcq = napi_to_qcq(napi); struct ionic_cq *rxcq = napi_to_cq(napi); unsigned int qi = rxcq->bound_q->index; + struct ionic_qcq *txqcq; struct ionic_dev *idev; struct ionic_lif *lif; struct ionic_cq *txcq; + bool resched = false; u32 rx_work_done = 0; u32 tx_work_done = 0; u32 flags = 0; lif = rxcq->bound_q->lif; idev = &lif->ionic->idev; + txqcq = lif->txqcqs[qi]; txcq = &lif->txqcqs[qi]->cq; tx_work_done = ionic_cq_service(txcq, IONIC_TX_BUDGET_DEFAULT, @@ -572,7 +648,7 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget) ionic_rx_fill(rxcq->bound_q); if (rx_work_done < budget && napi_complete_done(napi, rx_work_done)) { - ionic_dim_update(qcq, 0); + ionic_dim_update(rxqcq, 0); flags |= IONIC_INTR_CRED_UNMASK; rxcq->bound_intr->rearm_count++; } @@ -583,6 +659,13 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget) tx_work_done + rx_work_done, flags); } + if (!rx_work_done && ionic_rxq_poke_doorbell(&rxqcq->q)) + resched = true; + if (!tx_work_done && ionic_txq_poke_doorbell(&txqcq->q)) + resched = true; + if (resched) + mod_timer(&rxqcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE); + return rx_work_done; }