From patchwork Tue Jun 18 22:44:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: edward.cree@amd.com X-Patchwork-Id: 13703121 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2052.outbound.protection.outlook.com [40.107.243.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8420C1849E7 for ; Tue, 18 Jun 2024 22:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718750732; cv=fail; b=GhuP1kHpyz/cqT8HpfXlobfOTTuQA/IVl9gI2LNVO5qN6pUtzv26rWvw5r/xvHDMiAQ5kXIT8dn4Y/4razRIzWzJHUZayv6+BaWDh/cyyD/umRO7YJN6yu/HPlMyHXCewY2iVWH1NyruX7f3NVmI0Qsdn683rUsketDlV/8eaHw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718750732; c=relaxed/simple; bh=fW28nZcN2ZKZHTidXdoeycNG0iwO0O/Un/z85wwJucY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rFlvkOOS6t3b0nFxoI4Tkwv6YNnI5+wTlOmm28vG3dFSPLf87NcGXGDuiIr346eVRJq8aGt+AJidYrBmhvRFqRx3SleisllAZEcQ+RKPeL4BRPsQm8Le6O/kn64hEOugHtV9tmXk3JKkGvFVhvdW9d3FYQOdloEhcknXUrln1CU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ubFHkoQH; arc=fail smtp.client-ip=40.107.243.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ubFHkoQH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bdfzAoz6EEVR1ZqIi4WVXocBWG8BFMn5f5UPiTrnoruUg3YmArf9tr2XpucwvmAWIyzItuUmb0mberrCuLZUXQhUDA+2vQMGtwhfjhI8e/PPqNUiUVwEK+YZXe9LHFDQzh6D48jr0MzuwryJS3S7RIKdo8N1yTl7x8JjAQCtCCLwG8WHN/P1rlqIowH4cAAazkHw9+/9w256QG4qwxAqOhYMRdZg28TISaWjMeG3w+jhcFPkwCM36melXQsFYW3P3Q2z7I7ZgjqjSpmOQ3sB/MPKiHMU9Ch5bgvIPsOFMhG1APROA5+Jf1/0lpPFcYytOVphFSCAkCcOMhvYkZQU4g== 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=PMuRKWMlXWF8UnYtFZnKBN0HFTtOKPGEKnk5Ryx7Nx0=; b=gVVlWBCmPOtHf7a8hAYklBFIJ6EJuyYq7xw5ughZP+ZQU+HDlCFq7+NlYc6LWNj4y3T1GIqeXQXvJcLs5+8EKIr2Ud2NxhH+6K+zCV6F/qdysloi3kVWR4KSTJv2/+ZcvWEMnzmQxm6LcgVXmrM8qzBCQ6SyNrFAjkYHUc1lcghFA/LnIC7IfsUPRzjqwBOx31eXItOpWIHRTCIQcNHsHIkCyGeIuv5mxEVNGxCXapgvUpj3RqBG0YdkRC5krPbbqrQD6MkFNqj1VvkqI/gnsAGX9b5wkMd5m5KtDQGhVU0TGrZG96zkI6Py2x4Dg6yfZds1OoQYwPCJuaCMc8qaAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com 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=PMuRKWMlXWF8UnYtFZnKBN0HFTtOKPGEKnk5Ryx7Nx0=; b=ubFHkoQHytcHCMFYvsj42pIrUxl+RPiRksaqQIH8t5Q22rsKG63pq3wSvGZtMPkGn+VTjpVgJGXlv8qri0zXehRIy7pH9EwHSe9ldK/NuxMLVlEqCAK5ubd6s3g49YN/IT2QOyh9tmbpzpzXQ3ngsQMToxuBJqn/xvDNkMJSRNc= Received: from BL1PR13CA0172.namprd13.prod.outlook.com (2603:10b6:208:2bd::27) by SJ0PR12MB7008.namprd12.prod.outlook.com (2603:10b6:a03:486::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 22:45:27 +0000 Received: from BL6PEPF0001AB50.namprd04.prod.outlook.com (2603:10b6:208:2bd:cafe::2e) by BL1PR13CA0172.outlook.office365.com (2603:10b6:208:2bd::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.32 via Frontend Transport; Tue, 18 Jun 2024 22:45:27 +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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BL6PEPF0001AB50.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 18 Jun 2024 22:45:27 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 18 Jun 2024 17:45:26 -0500 Received: from xcbecree42x.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 18 Jun 2024 17:45:24 -0500 From: To: , , , , CC: Edward Cree , , , , , , , , , , , , , , , Subject: [PATCH v5 net-next 5/7] net: ethtool: add an extack parameter to new rxfh_context APIs Date: Tue, 18 Jun 2024 23:44:25 +0100 Message-ID: <7cebfb7668baa16d559fc891d1fe149e6a79a51f.1718750587.git.ecree.xilinx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: edward.cree@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB50:EE_|SJ0PR12MB7008:EE_ X-MS-Office365-Filtering-Correlation-Id: 24382901-4d03-4713-a815-08dc8fe85961 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|36860700010|7416011|376011|1800799021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FfT685xyEDv6QykHw+Pq8SWpFcyTm3p6rWlkbGFLowSPtKNRLA27/MXRQQR1jnN4kZRHGnsUxAscGe+Q3jurXoxGrvfXNPDI8UEpIh5FwQCDY/gQjeJedjkxmipGbBvrDUuwXFNp05j1V8OFxAVAmpyN9i652jwhErT3xQAbChZjk2A6mSOJmYvTyjrrQaDxclPbxOCDnKQLZH+Z7/IDIWkURqCEHJsPaX/vnBDbqLOoQmlpIgG+g57aZqRDOkb+OthcLbG/4VJ6+G2vfZdyBebgY+tuHpAffmIZgJqjShaovVOznzx+2zfjD/ioPMxny0LmxRC9Clyb80tVp/xW5cxIpzMI0eUXyHyywqCUKjxyzalkyo0Wvl5HmA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230037)(36860700010)(7416011)(376011)(1800799021)(82310400023);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 22:45:27.3743 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 24382901-4d03-4713-a815-08dc8fe85961 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB50.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7008 X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree Currently passed as NULL, but will allow drivers to report back errors when ethnl support for these ops is added. Signed-off-by: Edward Cree --- include/linux/ethtool.h | 9 ++++++--- net/core/dev.c | 2 +- net/ethtool/ioctl.c | 9 ++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 4fec3c2876aa..f781894a7cb2 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -998,13 +998,16 @@ struct ethtool_ops { struct netlink_ext_ack *extack); int (*create_rxfh_context)(struct net_device *, struct ethtool_rxfh_context *ctx, - const struct ethtool_rxfh_param *rxfh); + const struct ethtool_rxfh_param *rxfh, + struct netlink_ext_ack *extack); int (*modify_rxfh_context)(struct net_device *, struct ethtool_rxfh_context *ctx, - const struct ethtool_rxfh_param *rxfh); + const struct ethtool_rxfh_param *rxfh, + struct netlink_ext_ack *extack); int (*remove_rxfh_context)(struct net_device *, struct ethtool_rxfh_context *ctx, - u32 rss_context); + u32 rss_context, + struct netlink_ext_ack *extack); void (*get_channels)(struct net_device *, struct ethtool_channels *); int (*set_channels)(struct net_device *, struct ethtool_channels *); int (*get_dump_flag)(struct net_device *, struct ethtool_dump *); diff --git a/net/core/dev.c b/net/core/dev.c index c4e880397c07..09d01b49a414 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -11205,7 +11205,7 @@ static void netdev_rss_contexts_free(struct net_device *dev) xa_erase(&dev->ethtool->rss_ctx, context); if (dev->ethtool_ops->create_rxfh_context) dev->ethtool_ops->remove_rxfh_context(dev, ctx, - context); + context, NULL); else if (dev->ethtool_ops->cap_rss_ctx_supported) dev->ethtool_ops->set_rxfh(dev, &rxfh, NULL); else /* can't happen */ diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index 2b75d84c3078..244e565e1365 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -1423,12 +1423,15 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev, if (rxfh.rss_context && ops->create_rxfh_context) { if (create) - ret = ops->create_rxfh_context(dev, ctx, &rxfh_dev); + ret = ops->create_rxfh_context(dev, ctx, &rxfh_dev, + extack); else if (rxfh_dev.rss_delete) ret = ops->remove_rxfh_context(dev, ctx, - rxfh.rss_context); + rxfh.rss_context, + extack); else - ret = ops->modify_rxfh_context(dev, ctx, &rxfh_dev); + ret = ops->modify_rxfh_context(dev, ctx, &rxfh_dev, + extack); } else { ret = ops->set_rxfh(dev, &rxfh_dev, extack); }