From patchwork Fri Dec 1 00:05:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13475188 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="zACbQk7X" Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2062.outbound.protection.outlook.com [40.107.101.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA846133 for ; Thu, 30 Nov 2023 16:05:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dvtrv52gbTDX9nzWyl1PpP5+PKyagCEkayCodHEoqvVVQfHONiuKGFpKLZ1vZ7jM+oTnaOeaE+LuCSpQwgyKqD5YhGO6aowbA/69ZrrSPdsPSEZ/u6S9GDWgGIyZpA3GUJJTJ15JT4ODXJn/AYH0w/bSe7fKDPKG6psnQ/A36Ypa+XHfkhAe693OSLHu6ST9ty9QJOFjysezJERlmGd0HXzZQPn73MRgid3Wfm3zA4Dc0Sfn/oYm+uwZIxK71jL7vU3OjjBVc4HTb8MzV8Ssvsr77S9194153LqmXey0YhpZrZc4seLgI7MNN2jaRw7qbs/rKJ65X/KaSKlRbMifVw== 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=PcEGX9cVzMQMuUQaPBX8V1PnAG2GUhPynu8O2zJvzC0=; b=UYdL8qQ4pSJjm4RSbvdJA4uiW7qczx+7gNALY1LyvSS8SdBaRPbDRPj2W9xBnhOxQBck/+lKCO40rBZ1czv5UWQk7GdF8jxdkZXf4HfzS7TYSL/Qa7VIiC7KQYpKPWCdfrBY/ZWUIVixCBHbygmoT1TJo+ZJlqCD9g953QnIEt2wBAJ/PDjHYLcYi7EJlW8Ze3alfQdqnRYQVDQDb7UUnqdgK9xEGrTWjVUYtDoiB9NYImPLYm6Rcr2yi58EtbAelb2iBnCBIPn+L31vQ6fIVwHjHN/xfEuOrB/bwBTl1j+8ghrCMgl/3mu0pM1OW8ANlxAeXx5Fw/k+/YXtGOonfw== 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 (0) 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=PcEGX9cVzMQMuUQaPBX8V1PnAG2GUhPynu8O2zJvzC0=; b=zACbQk7XIa+3UW7ToH3bmyHjWfIth04YgMaKmpnEmuAbWzQjVSb06OnC62Q8dj9kq1pPlH7BuePTSMJOQMOwy+Kgjnob2n+lNAwLmg9I4mfA5cZr+j53zzzJbOjHWEsslLov3V0VQrDB9POULp2TPD/QTRD/WdoOuGFCtaoCBtk= Received: from DS7PR03CA0268.namprd03.prod.outlook.com (2603:10b6:5:3b3::33) by DM6PR12MB5008.namprd12.prod.outlook.com (2603:10b6:5:1b7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24; Fri, 1 Dec 2023 00:05:40 +0000 Received: from CY4PEPF0000EE32.namprd05.prod.outlook.com (2603:10b6:5:3b3:cafe::96) by DS7PR03CA0268.outlook.office365.com (2603:10b6:5:3b3::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.23 via Frontend Transport; Fri, 1 Dec 2023 00:05:40 +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 CY4PEPF0000EE32.mail.protection.outlook.com (10.167.242.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Fri, 1 Dec 2023 00:05:39 +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.2507.34; Thu, 30 Nov 2023 18:05:38 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net 1/7] ionic: fix snprintf format length warning Date: Thu, 30 Nov 2023 16:05:13 -0800 Message-ID: <20231201000519.13363-2-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231201000519.13363-1-shannon.nelson@amd.com> References: <20231201000519.13363-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE32:EE_|DM6PR12MB5008:EE_ X-MS-Office365-Filtering-Correlation-Id: da27a89b-b4a6-42bd-9774-08dbf20140dc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 17yb1g3keiz84qwxgPPZk1ps876sYJMxA7MlVhpYEGmABGKfUUBsT1DYfoEaqZFFp8DFrs6tHNmva6bL9QW9VPqLMXcr0Od1qd69SuUUgijYS9rxyMRNp2OJGr9aCI9uaMUuMWl4wpnnH74Ue5w2cildFh1iNBW/ZaxU2L2iRzVpO4GJqEDJ8sqyprpN9bkoxZFYNJjYQVZG6lIQDMqmRi/GvYO78QKsseXgDZO3XI91wbdedH6iXlccLu+zuh53IQGBujwMGs7N7X6Ui89dik0lF+1RSF/53MsgW1ZAiUBUSBk5E/ldjc/ivum1w/lfL7Qur+qNazImt4iTUvHIb2edyTS+WeSxaoi+AfY6gJDZ1FZ4C5BqofvMOF313GYhKk97zAlpjsAkOLSan+NQd4xrQUBDzJf6289gCqcYYV23QfhSAb8CWeZ0vCPfgMraa6/2hhlQHqLAluHRJKAMiuqiRupkwzVLYCu7cKWthbVwFaesKadSrcd30q6SnjQfnQSg+SYGINIdAvRUR7Uf/G5a1jFC6rAnxATkzaxs8N9Qcigx8rnIZgcA67bPdwe9aLoIub9noz87IIQ8DMJwCpjW8AOlLyjXGekjdUEU4bMDoJGVveDX/ysfDianGdgiQaXt490HWYjif4ZQqBtK7XrUk3koGcR243WajlcdM7NrHx3gexzz2YqDArYGMDGQlUcBd9DxheZ3S8jjZKK/91/AbfS3PB8VFgJWNLJ/LwD92F7cY2zqwcJjJtipU5JbOS+jrVBmEldlt6HxFQkeWU1n/kSZiRwtVayg0DGX1so6TfNNSTYoZ4fc6j3l1fN6 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:(13230031)(4636009)(396003)(39860400002)(346002)(376002)(136003)(230173577357003)(230922051799003)(230273577357003)(64100799003)(451199024)(1800799012)(82310400011)(186009)(46966006)(40470700004)(36840700001)(40480700001)(40460700003)(36860700001)(356005)(81166007)(47076005)(2906002)(5660300002)(82740400003)(83380400001)(6666004)(16526019)(336012)(426003)(1076003)(2616005)(26005)(70586007)(70206006)(966005)(41300700001)(36756003)(110136005)(8936002)(478600001)(54906003)(4326008)(44832011)(86362001)(316002)(8676002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2023 00:05:39.9051 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da27a89b-b4a6-42bd-9774-08dbf20140dc 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: CY4PEPF0000EE32.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5008 X-Patchwork-Delegate: kuba@kernel.org Our friendly kernel test robot has reminded us that with a new check we have a warning about a potential string truncation. In this case it really doesn't hurt anything, but it is worth addressing especially since there really is no reason to reserve so many bytes for our queue names. It seems that cutting the queue name buffer length in half stops the complaint. Fixes: c06107cabea3 ("ionic: more ionic name tweaks") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311300201.lO8v7mKU-lkp@intel.com/ Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/pensando/ionic/ionic_dev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h index 1dbc3cb50b1d..9b5463040075 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h @@ -223,7 +223,7 @@ struct ionic_desc_info { void *cb_arg; }; -#define IONIC_QUEUE_NAME_MAX_SZ 32 +#define IONIC_QUEUE_NAME_MAX_SZ 16 struct ionic_queue { struct device *dev; From patchwork Fri Dec 1 00:05:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13475187 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Aywsc5gn" Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2054.outbound.protection.outlook.com [40.107.223.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8B2B10F3 for ; Thu, 30 Nov 2023 16:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TvxFg99ZGYvF/WM58t7u+j0PfZRu+g90DEPkdm2idy8BnPgGvQJn30levWMuNaq0w/jp2qwAqOtQdT6kzeFAQwp9asXcJ0C3neFClGZcru+FM6UHJCdhFtuUJWymlQUZk6kGU90G9vYSaxPpjycUdXUOIQEQIIi/zEa8L9YtA86WzrERUeq6ZTZU9Ibs/pJHPFXz3Z9ktttOARi6RupZKSIoyJTukMiFyrbRuLESdrPsXSxvWFHqZOPoLNRvTWp/432vPJfPuF9yHcBshx1Nadx2BfEbyx07GdWLu0ihOqfzQEmJwk0an/Z2CB3/NtD9O0heCM/6ZA6PKSq4QzEWtA== 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=GbMYeAo1/R+rqEvx/QWVhubdE0Qp5Z30vspGWRI9FQQ=; b=BHK8Ebjyxf6Lnjc1UQXwMdxP8paV7RN8GvMpMRxlzOolteY+lLUmFrCOt9PUAHZZL96ng1bQzklFQYq4PHjuw4Hdyn0IkZY4J0G1vSyR/XWdKeY12UEiyKsXDm1jQPklcuN9w4FJZv3dKidBq1X58VE7IVRq7f9W2l04OsJDJwLyPTzr22Gq9DJjHt9V80lrWat+tgyrVC+HOdhQ5hxFeCkPaSTtVVUwHD9f3qlTXU9biglp2unLgjndAPbC56Wz/T9y4BUTQzMiUQC6xonACRc3btxxCUbQ/V3EowucCswWlNNd6Pc/CUZiKRU0d7KcccVjwW4iXA+dUll+8Fx8BQ== 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 (0) 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=GbMYeAo1/R+rqEvx/QWVhubdE0Qp5Z30vspGWRI9FQQ=; b=Aywsc5gnTfZZoCRlXoOsElTOaDgaUxUA7TPNHL1TsbG1ktqMEf8Sus+wvRvTyWU6XJ1AY8fmPiJQu6hCz3y5zynYIeBtrBXn7XR06yKER6LK8gFPJrZ6bPNjcNTHuoCN/mf7qN2PELTAdVs5n20fN/Y43g+kJNa9h0zYoMzb3nw= Received: from CY5PR18CA0037.namprd18.prod.outlook.com (2603:10b6:930:13::20) by LV8PR12MB9406.namprd12.prod.outlook.com (2603:10b6:408:20b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.23; Fri, 1 Dec 2023 00:05:41 +0000 Received: from CY4PEPF0000EE34.namprd05.prod.outlook.com (2603:10b6:930:13:cafe::7f) by CY5PR18CA0037.outlook.office365.com (2603:10b6:930:13::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24 via Frontend Transport; Fri, 1 Dec 2023 00:05:41 +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 CY4PEPF0000EE34.mail.protection.outlook.com (10.167.242.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Fri, 1 Dec 2023 00:05:41 +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.2507.34; Thu, 30 Nov 2023 18:05:39 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net 2/7] ionic: Use cached VF attributes Date: Thu, 30 Nov 2023 16:05:14 -0800 Message-ID: <20231201000519.13363-3-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231201000519.13363-1-shannon.nelson@amd.com> References: <20231201000519.13363-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE34:EE_|LV8PR12MB9406:EE_ X-MS-Office365-Filtering-Correlation-Id: d75636a1-e4e6-44e0-ec16-08dbf201419a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IUe2xUBzi4w6m3CPk/yVGDe5IDMx4Zw/p+/V5Rwpp6wXfTxoXfitHRBRdWKpmPtFcfGNsk+PsyJ3/NhoY3cOjnAY+J6YOiKHfxFuKzQEovIxnIoKeHFQGVQfuuQp29z3r4+nLNAf3PxjYWJ7/X+qngAceRV/ELZBMnNBmwTRlZlgy3L1QbZNhEhvUkAIccem+WeQBoXgDAkJbGl21dTjVnNtNt0g+w5Ll/k8M9PEzA6sL46gBEo0Wt7bLYJBXeBMrCbqiux8kR5GIF+o5c2kiMcA8EcLBtyfcagsSYMX/ktf/Rl9ejIrzqm75q4QP5dlznXOfmHo/VgDmOC1ISqnELjgR+6l57Sz8cbm/tggc8uZhwuh+EUdBoWn3NkvtWx7vEilq1mijz//EsvzVlRyi4vqzSttNtJCQX3USchTAf5NLND/8AMKNv4tFdhsczAvgO2MqDkNEkSXhWIT2MAL9emzCW9gleao1FmtCbehODhvOxg5SCHGjJPpsjuXjYYsLSTmBsKai8ZnVhEQLAWZT/5UQllshsbvKyN+LKTl5mwwv9zai2tAp1+wRdboQge5seh1hBICw22NzMpxGPBjIqihYL2rC/c4QgruqiTeFzXKnsdD1arjgiI4J0kn7ufj4+aJ6RDbe98QFBhfF8Q/8dxi7MB2W0v14smDjCyy7nZTTaesLOGooKfnctH8Prwtji4xlzHpeYuwrg537BwJntM4JXfZZju0A1NcypIosngbea+YeG0oOL3PfBnQIk0J5ZlAC7F/EpN+13a/EDU0Mg== 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:(13230031)(4636009)(39860400002)(376002)(136003)(346002)(396003)(230922051799003)(451199024)(1800799012)(186009)(82310400011)(64100799003)(36840700001)(40470700004)(46966006)(5660300002)(40460700003)(478600001)(26005)(36756003)(1076003)(426003)(16526019)(36860700001)(81166007)(41300700001)(356005)(336012)(2616005)(83380400001)(86362001)(47076005)(82740400003)(2906002)(6666004)(40480700001)(44832011)(110136005)(70586007)(70206006)(316002)(54906003)(4326008)(8936002)(8676002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2023 00:05:41.1680 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d75636a1-e4e6-44e0-ec16-08dbf201419a 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: CY4PEPF0000EE34.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9406 X-Patchwork-Delegate: kuba@kernel.org From: Brett Creeley Each time a VF attribute is set via iproute a call to get the VF configuration is also made. This is currently problematic because for each VF configuration call there are multiple commands sent to the device. Unfortunately, this doesn't scale well. Fix this by reporting the cached VF attributes. The original change to query the device for getting the VF attributes was made to remain consistent with device set VF attributes. However, after further investigation there is no need to query the device. Fixes: f16f5be31009 ("ionic: Query FW when getting VF info via ndo_get_vf_config") Signed-off-by: Brett Creeley Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic.h | 2 - .../net/ethernet/pensando/ionic/ionic_dev.c | 40 -------- .../net/ethernet/pensando/ionic/ionic_dev.h | 3 +- .../net/ethernet/pensando/ionic/ionic_lif.c | 93 ++----------------- .../net/ethernet/pensando/ionic/ionic_main.c | 22 ----- 5 files changed, 11 insertions(+), 149 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic.h b/drivers/net/ethernet/pensando/ionic/ionic.h index 2453a40f6ee8..9ffef2e06885 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic.h +++ b/drivers/net/ethernet/pensando/ionic/ionic.h @@ -91,6 +91,4 @@ int ionic_port_identify(struct ionic *ionic); int ionic_port_init(struct ionic *ionic); int ionic_port_reset(struct ionic *ionic); -const char *ionic_vf_attr_to_str(enum ionic_vf_attr attr); - #endif /* _IONIC_H_ */ diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.c b/drivers/net/ethernet/pensando/ionic/ionic_dev.c index c06576f43916..bb9245d933e4 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.c @@ -469,46 +469,6 @@ int ionic_set_vf_config(struct ionic *ionic, int vf, return err; } -int ionic_dev_cmd_vf_getattr(struct ionic *ionic, int vf, u8 attr, - struct ionic_vf_getattr_comp *comp) -{ - union ionic_dev_cmd cmd = { - .vf_getattr.opcode = IONIC_CMD_VF_GETATTR, - .vf_getattr.attr = attr, - .vf_getattr.vf_index = cpu_to_le16(vf), - }; - int err; - - if (vf >= ionic->num_vfs) - return -EINVAL; - - switch (attr) { - case IONIC_VF_ATTR_SPOOFCHK: - case IONIC_VF_ATTR_TRUST: - case IONIC_VF_ATTR_LINKSTATE: - case IONIC_VF_ATTR_MAC: - case IONIC_VF_ATTR_VLAN: - case IONIC_VF_ATTR_RATE: - break; - case IONIC_VF_ATTR_STATSADDR: - default: - return -EINVAL; - } - - mutex_lock(&ionic->dev_cmd_lock); - ionic_dev_cmd_go(&ionic->idev, &cmd); - err = ionic_dev_cmd_wait_nomsg(ionic, DEVCMD_TIMEOUT); - memcpy_fromio(comp, &ionic->idev.dev_cmd_regs->comp.vf_getattr, - sizeof(*comp)); - mutex_unlock(&ionic->dev_cmd_lock); - - if (err && comp->status != IONIC_RC_ENOSUPP) - ionic_dev_cmd_dev_err_print(ionic, cmd.vf_getattr.opcode, - comp->status, err); - - return err; -} - void ionic_vf_start(struct ionic *ionic) { union ionic_dev_cmd cmd = { diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h index 9b5463040075..745a3292be92 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h @@ -341,8 +341,7 @@ void ionic_dev_cmd_port_pause(struct ionic_dev *idev, u8 pause_type); int ionic_set_vf_config(struct ionic *ionic, int vf, struct ionic_vf_setattr_cmd *vfc); -int ionic_dev_cmd_vf_getattr(struct ionic *ionic, int vf, u8 attr, - struct ionic_vf_getattr_comp *comp); + void ionic_dev_cmd_queue_identify(struct ionic_dev *idev, u16 lif_type, u8 qtype, u8 qver); void ionic_vf_start(struct ionic *ionic); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index edc14730ce88..afb77e2d04c5 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2332,82 +2332,11 @@ static int ionic_eth_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd } } -static int ionic_get_fw_vf_config(struct ionic *ionic, int vf, struct ionic_vf *vfdata) -{ - struct ionic_vf_getattr_comp comp = { 0 }; - int err; - u8 attr; - - attr = IONIC_VF_ATTR_VLAN; - err = ionic_dev_cmd_vf_getattr(ionic, vf, attr, &comp); - if (err && comp.status != IONIC_RC_ENOSUPP) - goto err_out; - if (!err) - vfdata->vlanid = comp.vlanid; - - attr = IONIC_VF_ATTR_SPOOFCHK; - err = ionic_dev_cmd_vf_getattr(ionic, vf, attr, &comp); - if (err && comp.status != IONIC_RC_ENOSUPP) - goto err_out; - if (!err) - vfdata->spoofchk = comp.spoofchk; - - attr = IONIC_VF_ATTR_LINKSTATE; - err = ionic_dev_cmd_vf_getattr(ionic, vf, attr, &comp); - if (err && comp.status != IONIC_RC_ENOSUPP) - goto err_out; - if (!err) { - switch (comp.linkstate) { - case IONIC_VF_LINK_STATUS_UP: - vfdata->linkstate = IFLA_VF_LINK_STATE_ENABLE; - break; - case IONIC_VF_LINK_STATUS_DOWN: - vfdata->linkstate = IFLA_VF_LINK_STATE_DISABLE; - break; - case IONIC_VF_LINK_STATUS_AUTO: - vfdata->linkstate = IFLA_VF_LINK_STATE_AUTO; - break; - default: - dev_warn(ionic->dev, "Unexpected link state %u\n", comp.linkstate); - break; - } - } - - attr = IONIC_VF_ATTR_RATE; - err = ionic_dev_cmd_vf_getattr(ionic, vf, attr, &comp); - if (err && comp.status != IONIC_RC_ENOSUPP) - goto err_out; - if (!err) - vfdata->maxrate = comp.maxrate; - - attr = IONIC_VF_ATTR_TRUST; - err = ionic_dev_cmd_vf_getattr(ionic, vf, attr, &comp); - if (err && comp.status != IONIC_RC_ENOSUPP) - goto err_out; - if (!err) - vfdata->trusted = comp.trust; - - attr = IONIC_VF_ATTR_MAC; - err = ionic_dev_cmd_vf_getattr(ionic, vf, attr, &comp); - if (err && comp.status != IONIC_RC_ENOSUPP) - goto err_out; - if (!err) - ether_addr_copy(vfdata->macaddr, comp.macaddr); - -err_out: - if (err) - dev_err(ionic->dev, "Failed to get %s for VF %d\n", - ionic_vf_attr_to_str(attr), vf); - - return err; -} - static int ionic_get_vf_config(struct net_device *netdev, int vf, struct ifla_vf_info *ivf) { struct ionic_lif *lif = netdev_priv(netdev); struct ionic *ionic = lif->ionic; - struct ionic_vf vfdata = { 0 }; int ret = 0; if (!netif_device_present(netdev)) @@ -2418,18 +2347,16 @@ static int ionic_get_vf_config(struct net_device *netdev, if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) { ret = -EINVAL; } else { - ivf->vf = vf; - ivf->qos = 0; - - ret = ionic_get_fw_vf_config(ionic, vf, &vfdata); - if (!ret) { - ivf->vlan = le16_to_cpu(vfdata.vlanid); - ivf->spoofchk = vfdata.spoofchk; - ivf->linkstate = vfdata.linkstate; - ivf->max_tx_rate = le32_to_cpu(vfdata.maxrate); - ivf->trusted = vfdata.trusted; - ether_addr_copy(ivf->mac, vfdata.macaddr); - } + struct ionic_vf *vfdata = &ionic->vfs[vf]; + + ivf->vf = vf; + ivf->qos = 0; + ivf->vlan = le16_to_cpu(vfdata->vlanid); + ivf->spoofchk = vfdata->spoofchk; + ivf->linkstate = vfdata->linkstate; + ivf->max_tx_rate = le32_to_cpu(vfdata->maxrate); + ivf->trusted = vfdata->trusted; + ether_addr_copy(ivf->mac, vfdata->macaddr); } up_read(&ionic->vf_op_lock); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 835577392178..8d15f9203bd5 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -188,28 +188,6 @@ static const char *ionic_opcode_to_str(enum ionic_cmd_opcode opcode) } } -const char *ionic_vf_attr_to_str(enum ionic_vf_attr attr) -{ - switch (attr) { - case IONIC_VF_ATTR_SPOOFCHK: - return "IONIC_VF_ATTR_SPOOFCHK"; - case IONIC_VF_ATTR_TRUST: - return "IONIC_VF_ATTR_TRUST"; - case IONIC_VF_ATTR_LINKSTATE: - return "IONIC_VF_ATTR_LINKSTATE"; - case IONIC_VF_ATTR_MAC: - return "IONIC_VF_ATTR_MAC"; - case IONIC_VF_ATTR_VLAN: - return "IONIC_VF_ATTR_VLAN"; - case IONIC_VF_ATTR_RATE: - return "IONIC_VF_ATTR_RATE"; - case IONIC_VF_ATTR_STATSADDR: - return "IONIC_VF_ATTR_STATSADDR"; - default: - return "IONIC_VF_ATTR_UNKNOWN"; - } -} - static void ionic_adminq_flush(struct ionic_lif *lif) { struct ionic_desc_info *desc_info; From patchwork Fri Dec 1 00:05:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13475186 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="TWpWCpKs" Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2071.outbound.protection.outlook.com [40.107.220.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55D30139 for ; Thu, 30 Nov 2023 16:05:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IRd1Ztozjfl/XGDjEAYla8No8cXLgY2HKnPHbmiyqZ7NffBj8UstVvG+9Q9XEAC2JfDXAlpooPYDN6sGgkhomU9IenjerPRTf/0N/Pu1q4vvE+eN2pYTbT6worSYU2zplRqk63d4ZkF6ltc3m9sKFhKamOK9/hiMUHqQA5vO9WEY1X29L2NczEdjTzA3s9K9kanUwosVMWPTyAI8+YYMCau39Pw0cx8LenH9jAe19S1oYQM77wWL3aJEUu/PcTejBDqsHlKe9yqalhKYBzSDGn8oAlsohzCr2V4+vPBPtERKat/rjCasxzm6cnhIclXpvWEKBEBKD1LCMDxJnyziUQ== 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=lMzruAiRrDPpybeoTmb9CKTfXeMZ5d5ZGX9yrstYDVM=; b=kZZ4yhqn77Xr+fdU11VPnWBO8hzRdjFVKChDHTPRefEeDovKkm+PGHUmPhXp49EN2d8WRmyv0NLB2PTi9IyAuhZUoCERimOyAkjE33dNVctRUi2yfA6qRVBPsm9g5vFuWj5t58vFbOBKRKHz8zoOJGSYB29BPGO/fKPsuiG0nLAIptBZGx84NCPE+N+Fx/JAc7ernVFwnMEFSuCMDXAqUXoEn2enGR34IzExfEgNnahtXq9e3cf1aH+/iAF5XNaXqbNC8nIp0BuHYT7TjSllK/CKzmTiCNLNv3Qij56z7Bpc7QTqa1FWCxYfWh0ol8NERiiy0T1d6EOYAlfziE1vfw== 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 (0) 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=lMzruAiRrDPpybeoTmb9CKTfXeMZ5d5ZGX9yrstYDVM=; b=TWpWCpKsyTiUCs6+o3k3G10WubeC9mXoniKmuaCLxptQ09JiqbYDIR7i2FxZP4b7URpBsFjiL0vda/mcuWg49ioSLT5AHMEt1weszFQLKbaqPq2aurERXVUvIoXiPiggNH4L+h2KO1bFkAva/hlZqB0GtK4fJZpjgwHScmzeC1o= Received: from CY5PR18CA0045.namprd18.prod.outlook.com (2603:10b6:930:13::26) by CH2PR12MB5002.namprd12.prod.outlook.com (2603:10b6:610:6d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.23; Fri, 1 Dec 2023 00:05:42 +0000 Received: from CY4PEPF0000EE34.namprd05.prod.outlook.com (2603:10b6:930:13:cafe::b7) by CY5PR18CA0045.outlook.office365.com (2603:10b6:930:13::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.23 via Frontend Transport; Fri, 1 Dec 2023 00:05:41 +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 CY4PEPF0000EE34.mail.protection.outlook.com (10.167.242.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Fri, 1 Dec 2023 00:05:41 +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.2507.34; Thu, 30 Nov 2023 18:05:40 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net 3/7] ionic: set ionic ptr before setting up ethtool ops Date: Thu, 30 Nov 2023 16:05:15 -0800 Message-ID: <20231201000519.13363-4-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231201000519.13363-1-shannon.nelson@amd.com> References: <20231201000519.13363-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE34:EE_|CH2PR12MB5002:EE_ X-MS-Office365-Filtering-Correlation-Id: e54e7671-b12a-4560-d3a0-08dbf2014203 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z6230Hy7jgxNlq7Wo52h27BXGdxoqBP2QVYST/WcCnoN+zlSf7jJBlcA0IRDJR20CBrxt5UM/dYCJVI7wtDWfGu6peGFEHeuz5fxCSRzuRku0+4p92nogRCmA7/axayXArhwZvto6uI1nnYmIcwCUGfpV4MxE/hhQ+aNXLjEYf9ngKvJ5n4VdL0RKiY2DyCpTKo/r6c9a4dcJH67VLpmD7KXM1vEmCd1Kc/90H6NkkmYHf0x0zHtStN4FmkKM6nsuUZloELXyOO7mcKSGTYnZHI1zrg4kHohQpnETckiKEge4sVHrvWz6x0R7W5ktDxJZdwARX72Tj6jnxPf/P4M7u6Gu/W5y/H4EtwHEeTWKDKfw3OjaBnFAOL+UyQdI1NOogx6y10DH1PvrjG7B8q/28+qGv1iui+KcpvWI+IWJyT3T1GyuGOlXl1eEMzI9LLJfShZDn8ZJ1nCI7PFQ1roWOVVqkamicVApF+PPQCSlS2/NoIswQzm5tBjaQyWzg7ohA4CKrqR3ZxX/58TXj7q93MLtOilakub4TMmf7T2MhDgWhbci6MEX4Qz0G4vRT4uX4VxeHnQsMYrBCOTXhFH4laJ/UL4IDR+YEWGi9H2AhwBf4wRVqLoATGKQgOADwwt4hm+ys+iOrKAibvBoAI3ksvDqoAomFNAn/8I36GsyBRPHBaNqJhiaiAD6vqO1k4Zy8xM7Toig3xccUF1tKdh3sEsnZsNMkAy1WealEe7xGPC0Z5AEzUeppbpxAOuEloGG30DHOliDLz/tletGECChQ== 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:(13230031)(4636009)(136003)(39860400002)(376002)(396003)(346002)(230922051799003)(186009)(64100799003)(451199024)(82310400011)(1800799012)(46966006)(36840700001)(40470700004)(86362001)(316002)(26005)(16526019)(54906003)(1076003)(110136005)(70206006)(2616005)(70586007)(40460700003)(426003)(336012)(2906002)(83380400001)(44832011)(40480700001)(36860700001)(6666004)(8936002)(41300700001)(82740400003)(8676002)(47076005)(356005)(478600001)(36756003)(4326008)(5660300002)(81166007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2023 00:05:41.8399 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e54e7671-b12a-4560-d3a0-08dbf2014203 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: CY4PEPF0000EE34.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB5002 X-Patchwork-Delegate: kuba@kernel.org To be sure there are no race conditions in startup, make sure that the lif->ionic value used in some ethtool callbacks is defined before setting ethtool ops. Fixes: 1a58e196467f ("ionic: Add basic lif support") Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index afb77e2d04c5..a5e6b1e2f5ee 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -3054,6 +3054,7 @@ int ionic_lif_alloc(struct ionic *ionic) lif = netdev_priv(netdev); lif->netdev = netdev; ionic->lif = lif; + lif->ionic = ionic; netdev->netdev_ops = &ionic_netdev_ops; ionic_ethtool_set_ops(netdev); @@ -3076,7 +3077,6 @@ int ionic_lif_alloc(struct ionic *ionic) lif->neqs = ionic->neqs_per_lif; lif->nxqs = ionic->ntxqs_per_lif; - lif->ionic = ionic; lif->index = 0; if (is_kdump_kernel()) { From patchwork Fri Dec 1 00:05:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13475189 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="BE/zW+pb" Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2044.outbound.protection.outlook.com [40.107.94.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E3BF10E4 for ; Thu, 30 Nov 2023 16:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GkIBjTV9SWfIR7sFWJfNCF7r0XWhiil7O26WHBu4PIKQEAFF2bTsH3BYaNcJaMIWhnm2ntJL0wDc8poALzq5ZswkjgaMM3douU87eRayhqixfKfhuTXydW8Xn6TggNUOnqdWfyYDqSSKjYRyBkGDrtnz6uq2XygUMoaCv/9c+d3PTj4KWoYbAzWgvegtF8nnRY5xnzSvfmA4VpHt7oRLRc17dSMYDXL11XYrlCJarABrSFftXQtNoSUbOrBnEUeJMc1+Pgl1ixjEf2jA2AzcVUZWFRQrpWmJsarCuUi2jMVNV2UmWynD5lNLzDn9PypdltCGhCQEaVaxgNFgMT6uEA== 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=QNS9njptn7+eQjqYAl1nQVRKVYDNSQGSkf+AAWDA6uk=; b=R6noYs7N3lmOaoPUpL1jvc1mqR7HzbGB1prV7iN1X2kScSS22nIF4dOhwgPB4Dz1T7vjQdb5ONuQvTA3VugqjfAaMfXFCYm0hecvtz6/5pUIklaiY3hQTkiheHN4syVEqA35EtJtf4CuVAnFRYcM1No4v3Tu1hX2R6d3EHUk+tlM5r22jGh15ZpY5yw7fg01pWFUbD1WWiLhxRNLgTNzq1AqkmpfaudTJes9Jr2JamogemRM5w6LB+2QmWvqvYvZpANS3QFbLh1tnKG6W3t8DF7i9ddqmUyIqiZTh6d54w2ZS4sHKAYElu7q+DsYZFGGMM3LsFvQ04S8l6auVYkK9w== 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 (0) 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=QNS9njptn7+eQjqYAl1nQVRKVYDNSQGSkf+AAWDA6uk=; b=BE/zW+pbeR27PjVcpQRCL+jKcUbQKfxIHwkQaHkD7zxPw95ngqWdOBM0rO6diwLCw0sYTpoFpc+zc4cnqt/tSzfeI4db/Jvxy+smPEn/VNgUTuUNLhC2B/+4sAtUlpdbhhQiSwdpOW685ZDaf3zJC/WNPREB24hW4WJlG8VcgAE= Received: from CY5P221CA0086.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:9::23) by PH0PR12MB8150.namprd12.prod.outlook.com (2603:10b6:510:293::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.23; Fri, 1 Dec 2023 00:05:44 +0000 Received: from CY4PEPF0000EE33.namprd05.prod.outlook.com (2603:10b6:930:9:cafe::84) by CY5P221CA0086.outlook.office365.com (2603:10b6:930:9::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.23 via Frontend Transport; Fri, 1 Dec 2023 00:05:44 +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 CY4PEPF0000EE33.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Fri, 1 Dec 2023 00:05:43 +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.2507.34; Thu, 30 Nov 2023 18:05:41 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net 4/7] ionic: Don't check null when calling vfree() Date: Thu, 30 Nov 2023 16:05:16 -0800 Message-ID: <20231201000519.13363-5-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231201000519.13363-1-shannon.nelson@amd.com> References: <20231201000519.13363-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE33:EE_|PH0PR12MB8150:EE_ X-MS-Office365-Filtering-Correlation-Id: 055fe152-4457-43c2-6519-08dbf2014347 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VoYFBxgOzw1oEYEMK5hZNwzY3xCv5qyXAKBZU7Ipj8zCxGFm/w2WCsQzzdO/D+HBiCrAyw1zQyAT5TbCY8CU5KDm2wBvTfbHtXC8qB9+NCUO3F1UfsCl8YSiyHEZNaulVa3v5KytM61Mr6GZqO5D3Ky6LC2v3nJ5uEjGWEsqFjli1v/SIRHUMyJsZATta0ZvUNKxVTUT+v2gxkzWra43d4KOkLVf2kaDPeZnl0w34YZ6bdKpsTjN1Zr9aWWfH9MboLRwg6z7lEUult7hN/pkVOGsQrKHoIqAlMspV9y2KoryKMaEA+PFEwf/we/W+lMdxPRo8gS5eKXm8fqud/3mq7sJ3dwobUG+lXxerraNzPbz+e054iaW2Q+dZMosmiC1FBi7KFHhj1JYXiG+q2ZCMzX9BMhcJ36eYeaVPzOQM+spcg/m1GCXoCDWJSQ4utZH7/4fwvYcm+qbX20Ea+jQ4LYmoupLGD0UtU4s4vL3XafrYuhk1MNFleCc0TtIMFDUdeYMmlqK5h8LjCez0EntfMamEXQXbKB9J6ItshZNGqhXfafVrRj+Nb0PsnTWUbPyNzaAjaJjVLE/H0aOx9f0aGQxitxaDjd7NNM3UFZWCrn1qw46l2jspQ6CY1lRDravPH+LM2ilV8TwZrscfKtG7oFMIT28G7/W9RsQ8nPePAJCUgXKQBeZL2H066zPx0SBBck8Jddjgcx8A5nXJ1cPXmREAxwUxO6ESEco45GasFzkvPNJ+XN4UFbAhiG27M1WlI1QY2kSesl7GivX55fg6g== 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:(13230031)(4636009)(396003)(39860400002)(376002)(136003)(346002)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(82310400011)(36840700001)(46966006)(40470700004)(83380400001)(47076005)(81166007)(40460700003)(356005)(16526019)(26005)(2616005)(1076003)(316002)(70586007)(54906003)(70206006)(41300700001)(86362001)(110136005)(44832011)(2906002)(8936002)(8676002)(4326008)(5660300002)(478600001)(6666004)(82740400003)(336012)(426003)(36756003)(40480700001)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2023 00:05:43.9604 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 055fe152-4457-43c2-6519-08dbf2014347 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: CY4PEPF0000EE33.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8150 X-Patchwork-Delegate: kuba@kernel.org From: Brett Creeley vfree() checks for null internally, so there's no need to check in the caller. So, always vfree() on variables allocated with valloc(). If the variables are never alloc'd vfree() is still safe. Fixes: 116dce0ff047 ("ionic: Use vzalloc for large per-queue related buffers") Signed-off-by: Brett Creeley Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index a5e6b1e2f5ee..6842a31fc04b 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -424,14 +424,10 @@ static void ionic_qcq_free(struct ionic_lif *lif, struct ionic_qcq *qcq) ionic_qcq_intr_free(lif, qcq); - if (qcq->cq.info) { - vfree(qcq->cq.info); - qcq->cq.info = NULL; - } - if (qcq->q.info) { - vfree(qcq->q.info); - qcq->q.info = NULL; - } + vfree(qcq->cq.info); + qcq->cq.info = NULL; + vfree(qcq->q.info); + qcq->q.info = NULL; } void ionic_qcqs_free(struct ionic_lif *lif) From patchwork Fri Dec 1 00:05:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13475191 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="L1iEmMIt" Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2048.outbound.protection.outlook.com [40.107.237.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF63F10F8 for ; Thu, 30 Nov 2023 16:05:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bjq58pyWlFobiSjw6W49U2V0tvrV1/7HZ0gkMqfvgdekyB7brvPytoM4YBaSjmhMEftARfMfIAoqNr5p2i2uGHKxwgYTGOg4JRIl8UTx3w0FquwOLlobn2Uosn/w1nkcStk+eVr+nTm8S7Tvmno7wSorqHzIKPM4Tss6dNO13opYmu7NlABuxWLhrKX57+mhpkCc37yViKAEwhl1Ts9FneVQiUnL4TcEAZoYQRQ3WU/YG8px/QglI2vuOvHKvheXIm9c42e/utBAmvwjSocWXRjHjaxk11uAguXCFAvs9EMPNK77Hk4cvdm2msCdBc03jJb8DpUTltYvoIRSFyeSKA== 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=v5CwC7SUwbf3k4l3QzZewxoJfptXNqbvcp+M3Anj4H0=; b=kNkDYs0bymWgDdH4+ryEjcM2bp5iTvHQIJmRTLi/Yt5Hb2jImmLxPdmiISHDZUdWaZAewiPg6FogMsH0QqvpkzD7ChJW771wYFWaw6hNXA2ll3BizudKb3+r5MacR31YZlq6Ct99z+hf14MDYUqhFndfvIllc/4sHph8m3bE7eJwJdyeVF+w0ivdzQvJCCAHcqGHQB2eXgrDvWXExCi+jNi75pKmlrB96wNibKf7XDKST6p0gpf8kZJPLK5seY1X48BfiAsBtm6bR1dfBXsnv5U/ByXqPoYvez08EjVFmHDyiSXttSg+SBk5ocAaxH0umthJlb7e1LvzavNTdSt6yQ== 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 (0) 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=v5CwC7SUwbf3k4l3QzZewxoJfptXNqbvcp+M3Anj4H0=; b=L1iEmMItHx/ST3ZS8tA7clf4540YgIb5tHkagIo6tarZlH1FtIvwkJUTrzyvN3MzFGaF6jeoHqxvoxp6JA3Ido8xgRAqf90Tmu6qlo/98AiXqRFVUCOGbNLHw91FrM0rzeBOccjjPZcI5GMmAId0godCO/IeIQ+ZN0oG3V26/xo= Received: from CY5P221CA0108.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:9::39) by DM6PR12MB4332.namprd12.prod.outlook.com (2603:10b6:5:21e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24; Fri, 1 Dec 2023 00:05:45 +0000 Received: from CY4PEPF0000EE33.namprd05.prod.outlook.com (2603:10b6:930:9:cafe::82) by CY5P221CA0108.outlook.office365.com (2603:10b6:930:9::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24 via Frontend Transport; Fri, 1 Dec 2023 00:05:44 +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 CY4PEPF0000EE33.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Fri, 1 Dec 2023 00:05:44 +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.2507.34; Thu, 30 Nov 2023 18:05:42 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net 5/7] ionic: Make the check for Tx HW timestamping more obvious Date: Thu, 30 Nov 2023 16:05:17 -0800 Message-ID: <20231201000519.13363-6-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231201000519.13363-1-shannon.nelson@amd.com> References: <20231201000519.13363-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE33:EE_|DM6PR12MB4332:EE_ X-MS-Office365-Filtering-Correlation-Id: 889c2dcf-94fa-47ee-8678-08dbf20143ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RtJVtIfPDhUreH96NUZTlazb5v96ZMUtwgHivgcfpp2HLBRm3h9IEoaHCMcbU+rhUttO8iWzMbNqJj0C+miPE9Cbtrz5x7oVYRjmpcStXXy8m5B7oeScQsJbpS8x8xPoMqiAq9EZZc/bnZx7v+exJUnLMD5h8FdFYFYCM3tN43vmPzQ5ZdDC1fS59aw3jsONVod53RqP59hmg5TYDY/LihiMykUkiW1lHNt1eV3vKDmdyJUE22ByGNWYupkgGNDxFR4imkD6ON1f5oZ/W3pMIyh9YsWs1L2ix75p1iMQTSK6hY04Yy9kYoqk0j+BTobmmn6N1orKSqwoCiBVo6bJWbuRIqxLyciuQMAb4kOtnALD+ynla3GZxgBbRdf1EDQIDTpOwA5lFSkaxOUW3Lkbjhocfz1nwA5e7EVk/Nii5RoHoQGw+9+yOf/+YG+W4ruBcIVrqmHph2QH1n2iAL0xSQ7u3/8j6MZ1f7FCEch9kV0sfE+7Z1pdYBKFE9KOhq0cNMdmsrA6tnBaZXOEZzQ1ZRzMEuwSJR9Y7ImjgKyjvp+gdB1TwBP4X1k6ofW2k9SEIvvuuc9h7pfkBTy5x3tA9bSjUjvk/K2BAKqkuzzyajaNuwWFLQWUacwSKZzPfhAm6Nd/qszjW7/uGUX1zMV2RMRW6kNiJbHVEgXstMpgYV6hCSkjJGHtdkUSoq6AqtFIw9tC++LKyCjwH8GPv5IQg1vQli6sQXQcTduRyaTcDl81KXewwOrF62pF8J+PeWmdhaXjhsv4i9c4Dy9L9dGBYg== 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:(13230031)(4636009)(39860400002)(376002)(396003)(346002)(136003)(230922051799003)(82310400011)(64100799003)(186009)(451199024)(1800799012)(40470700004)(46966006)(36840700001)(70586007)(4326008)(70206006)(54906003)(110136005)(8936002)(8676002)(40460700003)(316002)(2616005)(478600001)(6666004)(41300700001)(2906002)(36756003)(44832011)(5660300002)(36860700001)(40480700001)(86362001)(47076005)(81166007)(82740400003)(356005)(336012)(83380400001)(426003)(16526019)(26005)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2023 00:05:44.8042 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 889c2dcf-94fa-47ee-8678-08dbf20143ca 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: CY4PEPF0000EE33.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4332 X-Patchwork-Delegate: kuba@kernel.org From: Brett Creeley Currently the checks are: [1] unlikely(q->features & IONIC_TXQ_F_HWSTAMP) [2] !unlikely(q->features & IONIC_TXQ_F_HWSTAMP) [1] is clear enough, but [2] isn't exactly obvious to the reader because !unlikely reads as likely. However, that's not what this means. [2] means that it's unlikely that the q has IONIC_TXQ_F_HWSTAMP enabled. Write an inline helper function to hide the unlikely optimization to make these checks more readable. Fixes: a8771bfe0554 ("ionic: add and enable tx and rx timestamp handling") Signed-off-by: Brett Creeley Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.h | 5 +++++ drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index 457c24195ca6..61548b3eea93 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -312,6 +312,11 @@ static inline u32 ionic_coal_usec_to_hw(struct ionic *ionic, u32 usecs) return (usecs * mult) / div; } +static inline bool ionic_txq_hwstamp_enabled(struct ionic_queue *q) +{ + return unlikely(q->features & IONIC_TXQ_F_HWSTAMP); +} + void ionic_link_status_check_request(struct ionic_lif *lif, bool can_sleep); void ionic_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *ns); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c index ccc1b1d407e4..54cd96b035d6 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -803,7 +803,7 @@ static void ionic_tx_clean(struct ionic_queue *q, qi = skb_get_queue_mapping(skb); - if (unlikely(q->features & IONIC_TXQ_F_HWSTAMP)) { + if (ionic_txq_hwstamp_enabled(q)) { if (cq_info) { struct skb_shared_hwtstamps hwts = {}; __le64 *cq_desc_hwstamp; @@ -870,7 +870,7 @@ bool ionic_tx_service(struct ionic_cq *cq, struct ionic_cq_info *cq_info) desc_info->cb_arg = NULL; } while (index != le16_to_cpu(comp->comp_index)); - if (pkts && bytes && !unlikely(q->features & IONIC_TXQ_F_HWSTAMP)) + if (pkts && bytes && !ionic_txq_hwstamp_enabled(q)) netdev_tx_completed_queue(q_to_ndq(q), pkts, bytes); return true; @@ -908,7 +908,7 @@ void ionic_tx_empty(struct ionic_queue *q) desc_info->cb_arg = NULL; } - if (pkts && bytes && !unlikely(q->features & IONIC_TXQ_F_HWSTAMP)) + if (pkts && bytes && !ionic_txq_hwstamp_enabled(q)) netdev_tx_completed_queue(q_to_ndq(q), pkts, bytes); } @@ -986,7 +986,7 @@ static void ionic_tx_tso_post(struct ionic_queue *q, if (start) { skb_tx_timestamp(skb); - if (!unlikely(q->features & IONIC_TXQ_F_HWSTAMP)) + if (!ionic_txq_hwstamp_enabled(q)) netdev_tx_sent_queue(q_to_ndq(q), skb->len); ionic_txq_post(q, false, ionic_tx_clean, skb); } else { @@ -1233,7 +1233,7 @@ static int ionic_tx(struct ionic_queue *q, struct sk_buff *skb) stats->pkts++; stats->bytes += skb->len; - if (!unlikely(q->features & IONIC_TXQ_F_HWSTAMP)) + if (!ionic_txq_hwstamp_enabled(q)) netdev_tx_sent_queue(q_to_ndq(q), skb->len); ionic_txq_post(q, !netdev_xmit_more(), ionic_tx_clean, skb); From patchwork Fri Dec 1 00:05:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13475190 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="gM0v/e3p" Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2065.outbound.protection.outlook.com [40.107.92.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75F52139 for ; Thu, 30 Nov 2023 16:05:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gLQV9SVwfIjeUe66iFFpC1H8Gn1fTiPiiZnqmZLhQookN59j4F1sF0FXe2yGaUz5CJhEQmjv4gIx0tTyEAv+/UWYh3qHZeN6T476tAHW41EIYzf+INCunMNfmQXS3HCe3IlsTfu1JNSwNF/hrP52XAwSUgxh4ABkxocSkUiRajzGsvD3sbZQRyPPMoiwMyhzkwxi4DgTFo1COFmKk0ZTbvK2tgN2NfJSoJHXeBzzIftX5wn/SpJb+zVvqu5WxgWq3YB+LN8S08aNh0Z3LAyFI8gLQ8ORv9oEwfjf7mswd5KcOwDgZvVxmfk1zhKTpPMmhHvuVmO8Wtd9XxppJ4XbrA== 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=Y6cse56ROhVyA5nkJIO6k0iEB18tWmvlVLhsqMTQpDE=; b=Aj/R47/orViOVG5vjQLPzNbuwp9jN3UiYxFnl1cWVJ1M3XpLgIVG4Nd0K0IRXLHGZf0bcmiRxmtlLmiZu4xWwfXd7MV5npia2eWN4hULqJwS2t3trGhzJoviHltrwNHhxGhX07QdgnrIGifWSZZwiF1YrLBavQhzt2xS3NLc8Ugl5o0r6D92ysM3Q4EbVogX6HBPKO5aMONwat35sskFk/6xQBDs7VCII/dmW37QnmVNO5uOJsI/iHkBQq/VnkxTXPw8e/AiWuJ+O2Ns0ZMYOeShOx9BkwmzUIQw8mQ4brfRiUJLP7POvdpBJuCMCzKLm/mBrxsUxDe+nu+6YbqHiw== 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 (0) 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=Y6cse56ROhVyA5nkJIO6k0iEB18tWmvlVLhsqMTQpDE=; b=gM0v/e3px8LADPRifFcHDOgDM5/bLJkH3xlgh80v3/BMYwLiEHQnShoSIfGtjOXM2eYvFZaomhM0e+qIP9LdEGxW+iR1PcIRMhYHKRS+MG/ckyDKgqSenQVD/ZTBSs43ngxs4h6AvzYpZcbnJ6c80p25MNAGrkd8mhHZ/Zt2zFY= Received: from CY5P221CA0098.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:9::35) by LV8PR12MB9135.namprd12.prod.outlook.com (2603:10b6:408:18c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24; Fri, 1 Dec 2023 00:05:45 +0000 Received: from CY4PEPF0000EE33.namprd05.prod.outlook.com (2603:10b6:930:9:cafe::21) by CY5P221CA0098.outlook.office365.com (2603:10b6:930:9::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24 via Frontend Transport; Fri, 1 Dec 2023 00:05:45 +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 CY4PEPF0000EE33.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Fri, 1 Dec 2023 00:05:45 +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.2507.34; Thu, 30 Nov 2023 18:05:43 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net 6/7] ionic: Fix dim work handling in split interrupt mode Date: Thu, 30 Nov 2023 16:05:18 -0800 Message-ID: <20231201000519.13363-7-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231201000519.13363-1-shannon.nelson@amd.com> References: <20231201000519.13363-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE33:EE_|LV8PR12MB9135:EE_ X-MS-Office365-Filtering-Correlation-Id: a3c67335-0e19-4162-e5f3-08dbf201440a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f66Q82Axkc/Lx/Z8obk9k0Z6u8tlSGM7NxgPyxlvXkk800+FUY3BAMC9v15iCb9+f7aedwpSFks4MyVfIeYbU4AEEgVc5LOjlgAHA9v0wwbJdav2XYHjFwYX9rJJ1rCGD0ruqaUThfcrM7LR76DVrrPLKkAtBOpqXlcrqDoUuET8/9WRMznkAZ7jgZuAjqWkY+nGTyqy4sNB2bXYvM7DQj6aELUDXq1yVRVG+CckZzSSknE9PmEvSxqvoiNyDZoBkQciKbQazP4NkRP//Cbug1/iRfpvH1lVinHwmdZ62XOFWWdFMqftGZtL/K9xTP8TBLpeLR1vJ2rkMwPnoVX4qbVrVTr8ajMF8XvFOCSuLOZbadDNURdSRo1/v3BVQ3WnzdxrVuRE8asFXTZB4D/jWPt3+Pl9tsmg71mCx9neZG3/HtDZO/l/T4UabeN4JGglCwDCn6AO6teKCmzZ/sl8Rj1xpKK97ThXeFZpwMPGvvYv3JqpKmVNagxXLWaDIxOEVAf8RlajslefPhq7RGUGQDM8RUInp/Lzlcx00qodA2PnGsPusaRi6awBhisrNZwom0ObEVMeMzAYvpVCRIwgm6G3RE+0XSPew+q1y6gA81o463BUIbeuZ2+ut/WICMV0yu3w2ZZWVSorxhnoEMoJpiZ/xTe1vAqaNRVK3IKcNhtH3c74bbJSo985rgeJ2CRos2Xj27adEnphhhLTBSh0t+jA7woiuAjtCmYVYGzm33Ew99wtAskWp/LIaDiawfI+kectEnUshTV90qTRrABYXw== 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:(13230031)(4636009)(39860400002)(136003)(396003)(346002)(376002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(82310400011)(46966006)(40470700004)(36840700001)(86362001)(40460700003)(83380400001)(26005)(1076003)(6666004)(2616005)(47076005)(426003)(36860700001)(478600001)(44832011)(8936002)(5660300002)(8676002)(41300700001)(336012)(2906002)(110136005)(16526019)(4326008)(316002)(81166007)(70206006)(70586007)(54906003)(36756003)(356005)(82740400003)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2023 00:05:45.2417 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a3c67335-0e19-4162-e5f3-08dbf201440a 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: CY4PEPF0000EE33.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9135 X-Patchwork-Delegate: kuba@kernel.org From: Brett Creeley Currently ionic_dim_work() is incorrect when in split interrupt mode. This is because the interrupt rate is only being changed for the Rx side even for dim running on Tx. Fix this by using the qcq from the container_of macro. Also, introduce some local variables for a bit of cleanup. Fixes: a6ff85e0a2d9 ("ionic: remove intr coalesce update from napi") Signed-off-by: Brett Creeley Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 6842a31fc04b..3bb0cfc40576 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -49,24 +49,24 @@ static void ionic_lif_queue_identify(struct ionic_lif *lif); static void ionic_dim_work(struct work_struct *work) { struct dim *dim = container_of(work, struct dim, work); + struct ionic_intr_info *intr; struct dim_cq_moder cur_moder; struct ionic_qcq *qcq; + struct ionic_lif *lif; u32 new_coal; cur_moder = net_dim_get_rx_moderation(dim->mode, dim->profile_ix); qcq = container_of(dim, struct ionic_qcq, dim); - new_coal = ionic_coal_usec_to_hw(qcq->q.lif->ionic, cur_moder.usec); + lif = qcq->q.lif; + new_coal = ionic_coal_usec_to_hw(lif->ionic, cur_moder.usec); new_coal = new_coal ? new_coal : 1; - if (qcq->intr.dim_coal_hw != new_coal) { - unsigned int qi = qcq->cq.bound_q->index; - struct ionic_lif *lif = qcq->q.lif; - - qcq->intr.dim_coal_hw = new_coal; + intr = &qcq->intr; + if (intr->dim_coal_hw != new_coal) { + intr->dim_coal_hw = new_coal; ionic_intr_coal_init(lif->ionic->idev.intr_ctrl, - lif->rxqcqs[qi]->intr.index, - qcq->intr.dim_coal_hw); + intr->index, intr->dim_coal_hw); } dim->state = DIM_START_MEASURE; From patchwork Fri Dec 1 00:05:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nelson, Shannon" X-Patchwork-Id: 13475192 X-Patchwork-Delegate: kuba@kernel.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="lS1dUFIk" Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2043.outbound.protection.outlook.com [40.107.220.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CCA610E2 for ; Thu, 30 Nov 2023 16:05:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ftvSq0AzGmLbz55kCXa0+EyOgtEKpTQL7xzUefjPx4DmGgnEfpC60qDL4n+XB2Ocjkqu4Xnw1b98f35c0x3ZcnO9T2PaDPg+P+Y+ii4HrQU3iWfoFEfHNaVpTnckGmepbdNOYYQk1wz+6RMrc6oS2EOmzjaPFgaBkZHGvyTkLMumdMUGAykJVc8F05d0I87QHsiCyxhtox1TrVVNYZV8e0dip67k/mNHbPTEGvZH/d2Jeo8YNenowMt/jCnNzgZLqlMQF+viArQet2WlDgHC06lAHiBldsxBcRKD1d/knSnLTR7ZdQ+0vfDURdHnQztD+OtOvIrH68gAZjbEDIgzpQ== 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=jkcKsxCc0JTPWqNGg0LnFu79R1SJy4BhB5sjASXe8vw=; b=N5UaTlLdVJYoc51HLE7XlzbuyzMJoxU288FbLSRaRGEgAwVO15vEdGUiTlw8J9bJjn6hucDXpnYvvAUheKn5yLRvfSRi50qBSsdwsxik51vHlhEky77h3H2/qhVugm0aCOtFUg6DAue0l9mCfqv9jQDgtEHM9qLD3XFSYrHmR+rknG8eJTQeXI8bC0s5q/B94bFlUG+Zjo9OJgA+GBcjNPY2KoKNyleLz1LCfRLKDngw4Pyh+1Q3m1u+uOvVQZEfzznPpeS6G+WcuWCzqBouaa45SCb/OgcJINGbmMvN9lXXWqat372NianSSVy0ARhGA+74hlmhzYMstj9GZmNfmw== 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 (0) 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=jkcKsxCc0JTPWqNGg0LnFu79R1SJy4BhB5sjASXe8vw=; b=lS1dUFIkXZVc7rGE3iR2Wb14yWncoR3rETk0Y+QrBg1gjx28yf03ZQLR0OUgk+J6KZUsX6cqf2FhlMaVl6Z4++NE4rUkIfZzSyS7/yKPIwrZdqTwCC2u2DnwtLiHgtwvgl0cI1cwRdeYiW7ZWFXO38bo1GILWUw908XFhKADtnQ= Received: from CY5P221CA0094.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:9::19) by MN2PR12MB4173.namprd12.prod.outlook.com (2603:10b6:208:1d8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.26; Fri, 1 Dec 2023 00:05:46 +0000 Received: from CY4PEPF0000EE33.namprd05.prod.outlook.com (2603:10b6:930:9:cafe::4) by CY5P221CA0094.outlook.office365.com (2603:10b6:930:9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.24 via Frontend Transport; Fri, 1 Dec 2023 00:05:46 +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 CY4PEPF0000EE33.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Fri, 1 Dec 2023 00:05:45 +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.2507.34; Thu, 30 Nov 2023 18:05:44 -0600 From: Shannon Nelson To: , , , , CC: , , Shannon Nelson Subject: [PATCH net 7/7] ionic: Re-arrange ionic_intr_info struct for cache perf Date: Thu, 30 Nov 2023 16:05:19 -0800 Message-ID: <20231201000519.13363-8-shannon.nelson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231201000519.13363-1-shannon.nelson@amd.com> References: <20231201000519.13363-1-shannon.nelson@amd.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE33:EE_|MN2PR12MB4173:EE_ X-MS-Office365-Filtering-Correlation-Id: e46adb45-75ce-4123-300a-08dbf2014476 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kqWsHKMP4469wQ3nnryrjcZ2ReqGcne3JxI7l/POf38KfFN3/kU4DAybGqiFApQ7oEDNcKGflrXpLk2tQ/n2cYR9omelVXrs6BhbPoz/78zGI7W37Z+mlSJTEh4rtNYHGOP2iEaVASMXR23g3GDDQO3nBxGMD3uCKsGszzUb35l9aXsjLQiQmna2Sr8DIfJmxox5Fb2g0dnjtqpXf4/IO5e7VMkoRoktTRHX21oV4izIFV/ejYLXtq1rTvKj+LdNhjO/gj8XEwtTv7Rl0gJtstZm1sCUoKmsYWoU7Zvi+htDHE9tJ6Mt0aGIvT6PGPDiFjwMKsU8S+bxxo6sm7Pw/Uuy1jQAXzkV36RdggO1WUaWAodVM2G/3UOBUi/k3FyIUZIP3u4Zvm/x7/ERKwtzAONo2jaugQ7Qxu/gelmHYa2mjMrEPtKhsgrOmWDPd/tWS3qM9eRt6w99fYGj3FvIXkDAkajT+j/kqaYXj3cnE6DOu+mDKsiOy+FEw3HSt/tbnocy6n3oU2HegAD4VpZqkQU6+sTF/POhKVr0y6Dpe+DhoPCuNn4UnFX7/QDDPxwdPbnODUw4eSRNGzVLIG/nONFDiIUUSzmZpmIQUo9Na2CpuHKRIYobxKQ+bA1nxuFcrUL2bSoALLyMhdPhrsFl9qHaRA1oBnACSmnO+oz2gVXEhXVIokZPqEcmKCfH6SVr3ggXTfh0a77VvIpsbGLCBcsIN1LCj9YG0QHl6FxN6/9xl5vwZKsmOracNbUeroTMcm014QslRbN0Wj02pntg2Y5KDa1xjYgLZBqlAXYfZHQ= 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:(13230031)(4636009)(39860400002)(136003)(346002)(376002)(396003)(230922051799003)(1800799012)(186009)(64100799003)(82310400011)(451199024)(40470700004)(36840700001)(46966006)(40460700003)(26005)(336012)(83380400001)(6666004)(36860700001)(2616005)(47076005)(426003)(16526019)(4326008)(44832011)(8676002)(8936002)(41300700001)(2906002)(5660300002)(110136005)(478600001)(316002)(70206006)(70586007)(86362001)(54906003)(36756003)(81166007)(82740400003)(356005)(1076003)(40480700001)(21314003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2023 00:05:45.9448 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e46adb45-75ce-4123-300a-08dbf2014476 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: CY4PEPF0000EE33.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4173 X-Patchwork-Delegate: kuba@kernel.org From: Brett Creeley dim_coal_hw is accessed in the hotpath along with other values from the first cacheline of ionic_intr_info. So, re-arrange the structure so the hot path variables are on the first cacheline. Before: struct ionic_intr_info { char name[32]; /* 0 32 */ unsigned int index; /* 32 4 */ unsigned int vector; /* 36 4 */ u64 rearm_count; /* 40 8 */ unsigned int cpu; /* 48 4 */ /* XXX 4 bytes hole, try to pack */ cpumask_t affinity_mask; /* 56 1024 */ /* --- cacheline 16 boundary (1024 bytes) was 56 bytes ago --- */ u32 dim_coal_hw; /* 1080 4 */ /* size: 1088, cachelines: 17, members: 7 */ /* sum members: 1080, holes: 1, sum holes: 4 */ /* padding: 4 */ }; After: struct ionic_intr_info { char name[32]; /* 0 32 */ u64 rearm_count; /* 32 8 */ unsigned int index; /* 40 4 */ unsigned int vector; /* 44 4 */ unsigned int cpu; /* 48 4 */ u32 dim_coal_hw; /* 52 4 */ cpumask_t affinity_mask; /* 56 1024 */ /* size: 1080, cachelines: 17, members: 7 */ /* last cacheline: 56 bytes */ }; Fixes: 04a834592bf5 ("ionic: dynamic interrupt moderation") Signed-off-by: Brett Creeley Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_dev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h index 745a3292be92..c47c059465ae 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h @@ -269,12 +269,12 @@ struct ionic_queue { struct ionic_intr_info { char name[IONIC_INTR_NAME_MAX_SZ]; + u64 rearm_count; unsigned int index; unsigned int vector; - u64 rearm_count; unsigned int cpu; - cpumask_t affinity_mask; u32 dim_coal_hw; + cpumask_t affinity_mask; }; struct ionic_cq {