From patchwork Thu Jun 27 15:33:50 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: 13714688 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2085.outbound.protection.outlook.com [40.107.243.85]) (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 7F91B199234 for ; Thu, 27 Jun 2024 15:34:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719502481; cv=fail; b=bElpe3ek+VBQCNZVT136QSyyCF0iesJR1WtGSTnYAJiQUYJ6g48E7/3K+XHiK+y/FfzQdOH3ZB4YsMg3ISH+DjOAFrrJ4Z740si6a4KSzHkydGtVpwLTX18Z8ZrTGJNS007TJ0pgb2E3uCubhkj39azxCTX7bFTOFa1yBFogBQM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719502481; c=relaxed/simple; bh=/aMrFBD4uwAYoNum9IzftDuAtmbujuLXY1rIZWtrfOA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rQy4vrS4qLZCVfUHQjtX14KtQtgiewrQ1CuiDX3lhepBDSHZ2cHpdjLEOtIKDxp+uVOZYHLXU1HFdAaSy4iSk7Op99hlFgQuA3SfO9meYHy3uAXqdkD8Sjw8L1rGLiegLhB/48GWo2tP8OV1bw2ma2Wyaqhkvcz4PiAkPIivBBU= 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=rmMpqjGn; arc=fail smtp.client-ip=40.107.243.85 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="rmMpqjGn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MiARGHp6F0NP2eDssNDuoJnNAf8DBlFztYqM0G0YBvgqbUgiDo8X7GaprexfOE9FyUb/Q7+NplgZvwBItyoPqCyBUyFzpIoNeVU3nH3jmpLgHkH8zW4X+egCshfhCq56k6ZMd2QDqSYcTHx+Ij/6CtZRXACPCD9PKdagikDR55rSV5Wi9JA8Th271gngQBSv+ujtsoDqMsQDc3r9RtfW6JrHLYXN/BJ0dX3sSord2qQX//bUbLQ+j5ZLNGhgNLyX9N4rnXP3+3WFSYYIF/yt6dguvxbPa23zr9NiEWp4bKkbTwPX5sEQxpO55xqAsLnC9IgM7zeIMAO1qsKaUVuq8A== 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=WAA3M9GOaET8ef7FrvcFdTFVc4ffA2Pt31f6u1tv8xs=; b=hrtvKcZCPWOggNpSBdgAj2LRz2KIQEFowBjDRzEnE7r1ta7/cJmwD4Zd6WFKcjKtLYu3VKc67YXuKOrgx0/of5REnIaqfaHRjrev+2WuniqOzMro7UhtrmLn1Bl2YIC76I2KhX2V2tadNItpEMc0DCyTX32bc6puE43ziu1qrrYrHZ7VOhu3cr8YfP17ysRbrwsam0LaHl8D7bOcbnW9vlKy4+oNdP8WYf4yslcmk04HGDgRfAY2he2MKOLeAtvLS3H5JzmV9T8sxlPUS7ir9lsCRbbx80Tq70j6spaRLZLT4sN74vqEcaFfbsuAM0Q/po+WXpvIPgYhUVJki/lGVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=WAA3M9GOaET8ef7FrvcFdTFVc4ffA2Pt31f6u1tv8xs=; b=rmMpqjGnxaQg3dDHejTD3mX9Ufm6qDPFedfVRqYE3jSKk9brAc9mD3OpErXnPYJHWkykCt9M8Er6j1OTM7rSB83R1jwEQVqPDCew3rz4b4mIRWsxz8WVcKzLFatYJUBsCwPgB5LHVC1kghrGFWD/8udJ39vfgiZPeEjGDnCWLJ4= Received: from MW4PR03CA0024.namprd03.prod.outlook.com (2603:10b6:303:8f::29) by IA1PR12MB8540.namprd12.prod.outlook.com (2603:10b6:208:454::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.34; Thu, 27 Jun 2024 15:34:30 +0000 Received: from CO1PEPF000044FB.namprd21.prod.outlook.com (2603:10b6:303:8f:cafe::1f) by MW4PR03CA0024.outlook.office365.com (2603:10b6:303:8f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.25 via Frontend Transport; Thu, 27 Jun 2024 15:34:30 +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 CO1PEPF000044FB.mail.protection.outlook.com (10.167.241.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7741.0 via Frontend Transport; Thu, 27 Jun 2024 15:34:30 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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.39; Thu, 27 Jun 2024 10:34: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; Thu, 27 Jun 2024 10:34:24 -0500 From: To: , , , , CC: Edward Cree , , , , , , , , , , , , , , , , Subject: [PATCH v8 net-next 5/9] net: ethtool: add an extack parameter to new rxfh_context APIs Date: Thu, 27 Jun 2024 16:33:50 +0100 Message-ID: <6e0012347d175fdd1280363d7bfa76a2f2777e17.1719502240.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 (SATLEXMB04.amd.com: edward.cree@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044FB:EE_|IA1PR12MB8540:EE_ X-MS-Office365-Filtering-Correlation-Id: 33548dde-424f-4d62-1b5c-08dc96bea34a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|7416014|1800799024|82310400026; X-Microsoft-Antispam-Message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ZwVjFXpxe+xDkF4BI0SMUbzL1KJEPiLm9fPquQ/F3b3muXt+5Wo9/OH0ZPwGkB+/N4QwbrGdn1qusyz8dttRwpv1D+hI4aOd0IHAq0RiJOR5ncEm3XSQnH6hr4dbbhLRvK9oirY0i5Q+jLjza/oaPiFnzdoalM63RPkJIzI+/qfLQzL+E1L+E+Fn2aLTtQPhsOXM6si/obuQP0nA4pgmrJL82WPeGzXWdtAdTie+bCqk2BJU4A4Rkz4W7qhEj+zKPF298JojnazrDZq07RtCsJlP0AwryFDm7/6QmkaQe8yBvK2f9V78z2jkFZmMi4uV/akh78W9sHdO5jkGYMcvN5DFjK/rV/FGCBc16e+ov/+JKm1xBGLCP+Xk4sDMq3OU7U1uhK/0 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:(13230040)(36860700013)(376014)(7416014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 15:34:30.5544 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33548dde-424f-4d62-1b5c-08dc96bea34a 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: CO1PEPF000044FB.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8540 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 197511c91836..533912386070 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -1001,13 +1001,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 be4342bd3603..16f1fc9e2438 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 dev->ethtool_ops->set_rxfh(dev, &rxfh, NULL); kfree(ctx); 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); }