From patchwork Tue Oct 18 14:37:27 2022 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: 13010702 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 300AAC4332F for ; Tue, 18 Oct 2022 14:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbiJROir (ORCPT ); Tue, 18 Oct 2022 10:38:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbiJROiq (ORCPT ); Tue, 18 Oct 2022 10:38:46 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12D2FCA8A5 for ; Tue, 18 Oct 2022 07:38:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g2mWJrk9+fSJEJQcsySVH99C3ZCYdlpzQP+A75tkqX6+ANkCk/0t4WEtpjDx5lgu9z8eaAItOc3M99W4CEKr2TYJLGMpjRZidMUFDw5izQGTA/EU971TGNPHBfQcaFoD0+W1rxb5L3IWdK+rQrEFddMfn2CkQ3zlI4/wFzg3hs/LHIP1WKuBCSibfxjn3xwqwgtfK41OAk0aaLn6aUTGxDt4oeX60icpFQNqOyKtJAmQdPC0XV6fQmA9q0ehwTUXRPBvwpS3yz88gNjf8/L/kWa84iYlYRfVysV6er7FANdx7iC/aJca8yYLwWLjyfdk9xZlQcv7eEPM3Wqk27WPMw== 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=LSFAanyg4JjEyRGA6BhJr3WHkgUyPhdiTBX4c+A869g=; b=ekmCIS+nNLUiGbQ1WA1nAoFc+uUOFf+ONyD7xUzSl7sYOiv6xbpfQ38C0t8dbIDbfR9W26WpUBmDq4T1/dqVImZKjB26IFxPz35SRmmLJRCc6PLxht8MHiRbDuQUSws5WA0NPgVZkqquJzQZIbw5v0CwE2OqOWnn1I4kfaJGmLeIJP7mPjFHVq8JDusphIP895gjeXHsQcEC9O89QVPRjO8abr4sv69oq73pDoLnlDNcikN/ohxx9ufBmSO9uFcglg6o3i8nH7dHtNjMgDM6bcfnPqtsLnHnQZid+DR/OVd3ShLpYsKZdB5U5BV1cUVYKG2P4QC3wgrekpoYXxExdg== 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=LSFAanyg4JjEyRGA6BhJr3WHkgUyPhdiTBX4c+A869g=; b=TsBlH5D4BU8hBQ6l+5t4wrZySsPGJLfSU+JOZeZp8iU4uZqqZGiYE3PGHgECCpit6i1DWcjmXdKqmUcwFlmPXwRt4sMciiu00IIccMkMqu/KHb1dfNSOif9Iu3HZ6coCdLodoRJtI3M+sHzcPp+F88qNpE/3iSBxOg3Q+SsYof8= Received: from DM6PR01CA0019.prod.exchangelabs.com (2603:10b6:5:296::24) by DM4PR12MB5198.namprd12.prod.outlook.com (2603:10b6:5:395::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.33; Tue, 18 Oct 2022 14:38:42 +0000 Received: from DM6NAM11FT077.eop-nam11.prod.protection.outlook.com (2603:10b6:5:296:cafe::48) by DM6PR01CA0019.outlook.office365.com (2603:10b6:5:296::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.22 via Frontend Transport; Tue, 18 Oct 2022 14:38:42 +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 DM6NAM11FT077.mail.protection.outlook.com (10.13.173.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5723.20 via Frontend Transport; Tue, 18 Oct 2022 14:38:42 +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.2375.31; Tue, 18 Oct 2022 09:38:15 -0500 Received: from xcbecree41x.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.2375.31 via Frontend Transport; Tue, 18 Oct 2022 09:38:13 -0500 From: To: , CC: , , , , , , , , Edward Cree Subject: [PATCH v3 net-next 1/3] netlink: add support for formatted extack messages Date: Tue, 18 Oct 2022 15:37:27 +0100 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT077:EE_|DM4PR12MB5198:EE_ X-MS-Office365-Filtering-Correlation-Id: fb62d30c-0c61-4142-b5f7-08dab1167493 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pm1Tn0qGrrYUL7vHXrmTovhW4tFReU6fe77jwNaHwToOhOPWgDs5JAMu54f9ZwJwV2tTCfycDcYM8zQp995aWdrbIaNq45NwTxwsNboHm9Te36+WN7AFbZD0i5ysXF7AgZqSDSuB8wECcBtxWanXH7NXBkZ7XkyM29UpiKSOGr3ea7t+Wyu1Jz0xzQYr566yk/LN//1Bp6Wx3hF80+otZMxsaUm/1CYjCIWw/Egg0X4RfietCtZo0G0RYVaUtVbN6PdXwBTIxW3AZf1UCfmk61mgktkYeDqiWTlPCcF1poG9RgtYk/Hnp4sar0APpX1R8BgO/0vDsKJOti0/PUgT4lKRE+siRB50D94bRoy+v9qXnnQ5gC14AHGvkXI0BIKdjSw+AoY5Y15SY47DJtY0kYaIDT2OEoymyd8iFaufaKvjcqvUPRLkUbGz99hHwByOpmn+p3Cp/nYBkAJei+kqqsNzrgXHb6kFeURhUJsgq/qGODz+cl+sgWjpPKHa9gL7X1SXXXxKckcbfF6u6Iww8xk7l/j10d9elUzY+wJQcuWkbrbSfDUzK/AGnsMDgSXCNAuv9rGxgIsJtz0kiQ2zDM+pNdcWCfDNYkqIa886KlhTyZpJkM6JY/KlcrtWN+rLy+dq4SRFRD7mFNpcq5pnPyVxW/UgCXtTrk9fwzKxwWIQE4WfTcJGRDyJ1rFbKVRPnL3eDz/WprgWlc7xE1KeaOkS1QbCmuvAOgsM3qLq43kc3KHYc81gG44SknP2/EYtTeHxvcQR8ipzFkPaMdS3KaCM79GbNZ3sb2mvIfa0PtCbi5ff5+jhv1JmFRskGxPL 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:(13230022)(4636009)(346002)(39860400002)(136003)(396003)(376002)(451199015)(40470700004)(36840700001)(46966006)(2906002)(9686003)(478600001)(2876002)(41300700001)(336012)(47076005)(36756003)(426003)(83380400001)(26005)(8936002)(5660300002)(15650500001)(7416002)(81166007)(356005)(186003)(82310400005)(55446002)(86362001)(40460700003)(40480700001)(82740400003)(36860700001)(6636002)(316002)(110136005)(6666004)(54906003)(8676002)(4326008)(70586007)(70206006)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2022 14:38:42.8799 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fb62d30c-0c61-4142-b5f7-08dab1167493 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: DM6NAM11FT077.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5198 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree Include an 80-byte buffer in struct netlink_ext_ack that can be used for scnprintf()ed messages. This does mean that the resulting string can't be enumerated, translated etc. in the way NL_SET_ERR_MSG() was designed to allow. Signed-off-by: Edward Cree Reviewed-by: Jakub Kicinski --- include/linux/netlink.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/include/linux/netlink.h b/include/linux/netlink.h index d51e041d2242..d81bde5a5844 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -64,6 +64,7 @@ netlink_kernel_create(struct net *net, int unit, struct netlink_kernel_cfg *cfg) /* this can be increased when necessary - don't expose to userland */ #define NETLINK_MAX_COOKIE_LEN 20 +#define NETLINK_MAX_FMTMSG_LEN 80 /** * struct netlink_ext_ack - netlink extended ACK report struct @@ -75,6 +76,8 @@ netlink_kernel_create(struct net *net, int unit, struct netlink_kernel_cfg *cfg) * @miss_nest: nest missing an attribute (%NULL if missing top level attr) * @cookie: cookie data to return to userspace (for success) * @cookie_len: actual cookie data length + * @_msg_buf: output buffer for formatted message strings - don't access + * directly, use %NL_SET_ERR_MSG_FMT */ struct netlink_ext_ack { const char *_msg; @@ -84,13 +87,13 @@ struct netlink_ext_ack { u16 miss_type; u8 cookie[NETLINK_MAX_COOKIE_LEN]; u8 cookie_len; + char _msg_buf[NETLINK_MAX_FMTMSG_LEN]; }; /* Always use this macro, this allows later putting the * message into a separate section or such for things * like translation or listing all possible messages. - * Currently string formatting is not supported (due - * to the lack of an output buffer.) + * If string formatting is needed use NL_SET_ERR_MSG_FMT. */ #define NL_SET_ERR_MSG(extack, msg) do { \ static const char __msg[] = msg; \ @@ -102,9 +105,31 @@ struct netlink_ext_ack { __extack->_msg = __msg; \ } while (0) +/* We splice fmt with %s at each end even in the snprintf so that both calls + * can use the same string constant, avoiding its duplication in .ro + */ +#define NL_SET_ERR_MSG_FMT(extack, fmt, args...) do { \ + struct netlink_ext_ack *__extack = (extack); \ + \ + if (!__extack) \ + break; \ + if (snprintf(__extack->_msg_buf, NETLINK_MAX_FMTMSG_LEN, \ + "%s" fmt "%s", "", ##args, "") >= \ + NETLINK_MAX_FMTMSG_LEN) \ + net_warn_ratelimited("%s" fmt "%s", "truncated extack: ", \ + ##args, "\n"); \ + \ + do_trace_netlink_extack(__extack->_msg_buf); \ + \ + __extack->_msg = __extack->_msg_buf; \ +} while (0) + #define NL_SET_ERR_MSG_MOD(extack, msg) \ NL_SET_ERR_MSG((extack), KBUILD_MODNAME ": " msg) +#define NL_SET_ERR_MSG_FMT_MOD(extack, fmt, args...) \ + NL_SET_ERR_MSG_FMT((extack), KBUILD_MODNAME ": " fmt, ##args) + #define NL_SET_BAD_ATTR_POLICY(extack, attr, pol) do { \ if ((extack)) { \ (extack)->bad_attr = (attr); \ From patchwork Tue Oct 18 14:37:28 2022 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: 13010704 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 35579C433FE for ; Tue, 18 Oct 2022 14:38:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbiJROit (ORCPT ); Tue, 18 Oct 2022 10:38:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230388AbiJROir (ORCPT ); Tue, 18 Oct 2022 10:38:47 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2072.outbound.protection.outlook.com [40.107.244.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFCBBD77E4 for ; Tue, 18 Oct 2022 07:38:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hQen2enV9dwiyXM3JNz/P8YR4anmIGzQWia4X0yLXfIAfjAYSHzczxeWgCbNkuWKH0N/szmJeC1auEWE6xHj+oEW8F+lkJxSPlQTAPja3vRXk2vTlDj6FjNvx7hk6xFxWkaXUNcMQwO1+026wyszWNmKX1v6x4VknUCiucvMhmm9rQF5e+Hgz7e7FhegyRZNmsy3PlvP/SrlD95+nxD45o0A0dh5ac/fnQIofqhABEc+wwHMUlJGkcJuFYY/p6UjrZvXRb+y53tEzM7vpzhNFIgkJBV8vYSvZ10Xxo+84EN7LEE+yT83zEHYI6gjlEUVLOkymSazOAyObJNzfImg4Q== 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=IN1+DzckYapOyI+NPaAyLDe9yRI66HV6A853PYDkZU4=; b=GHuI7XPqn+dsiT5pB/rQ86l7zLTDVku5Cjtax/vL/tiOhIbIOHcP6Hb6jiG356cuAu1xgQtpFZtcYIBw4IHVSnq8FX46skmbAyTq6MAljBCoa999ed4bHN+a0wTc++QJxsqQgvTn3FH509rF11A48nk8BLFI3Iayr+iUrrOw7f75YG6Gmqvticx8xlSQTuartuqsFFb+puXwrXTDo90MW140mkj4gxpwSY6qn29JhQF6yxsAy/AAFfZDP5wvDWY4jos8mYTpPiBHl76FxqlXHpWykMQZIreXJoc5xsNWiPmrhHmKt0uMtF9HkCJ2I6jpdQkoJBESIg/9U5fkqWlTUA== 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=IN1+DzckYapOyI+NPaAyLDe9yRI66HV6A853PYDkZU4=; b=EIwFsC8afAySLkDCfNPJRX7HNOmds8YUWhpeWlVdgyTArDR3FwuFAy6CIISf5bdvSKncOEruSjcV0SnqOII5tzQ7IbxPhpD2Zca23/+g6uYiu1JdoohiFs+C7lPpTsQsUbWxEL5+CEKNtfIQr8LfqSegtn+2tJ7OMUfArrLHFFw= Received: from DM6PR01CA0007.prod.exchangelabs.com (2603:10b6:5:296::12) by MN2PR12MB4287.namprd12.prod.outlook.com (2603:10b6:208:1dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Tue, 18 Oct 2022 14:38:43 +0000 Received: from DM6NAM11FT077.eop-nam11.prod.protection.outlook.com (2603:10b6:5:296:cafe::17) by DM6PR01CA0007.outlook.office365.com (2603:10b6:5:296::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.22 via Frontend Transport; Tue, 18 Oct 2022 14:38:43 +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 DM6NAM11FT077.mail.protection.outlook.com (10.13.173.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5723.20 via Frontend Transport; Tue, 18 Oct 2022 14:38:43 +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.2375.31; Tue, 18 Oct 2022 09:38:17 -0500 Received: from xcbecree41x.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.2375.31 via Frontend Transport; Tue, 18 Oct 2022 09:38:15 -0500 From: To: , CC: , , , , , , , , Edward Cree Subject: [PATCH v3 net-next 2/3] sfc: use formatted extacks instead of efx_tc_err() Date: Tue, 18 Oct 2022 15:37:28 +0100 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT077:EE_|MN2PR12MB4287:EE_ X-MS-Office365-Filtering-Correlation-Id: 520034c8-373d-4da4-4c12-08dab116750d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oELTIHozZm9Xb+Bye+7V1YrJYSy0i2T+ISnbWHWu/O4Sv3CIaHBNcOkjFgaYc+owMVrUmCiGh8E7JXIB+F6nM0g5HnJhYztBZOUDm/0zPqB2fZTh2mnHTTkVU1zrx0pxbtNmKKhE3kXOdaDTjWeYQDkq0ArQVT6eY56A/6cSGmKDD7/osBlj9J+cf7KRA2O+XMnQCYJgC8Ay93vjyI3L2h9LTuNOLGy4jGjpktv/EcWLdIL7Qy39JsbYAHuUp/QwPO+k4uv4sJy2vL62+4txS2rj51L/5umh+M0wluDpafZUEcJfVxaubxNI57m8HxE3YcXxeJLeYrnK5dPx7DQv8creEviXCC7xVHdiDX3wQfFYCPpGh3nPadhhFQkRV6OkXBq1yCS18pMkSOXZoDVRY8hm50gO4UuzJaj86H8YM7SsQXgoRNQbJLXX5FB+D44TmMV7lPdo9e0zshmfYQkaMKJ5r49Q1xcMpY/G14LnIsgcnJte2kF31YHfU9YuR8QdsFAQYAS0wXoRFpmrD+8LG9jIgkkDGWae/RLRKJzd3FHjbkgk9sy19R+H8DkhohmjGpBfafFSN++fgUiSfPZl6/MRikjXJHrRrA2NBT/VKiPlL5IY6NZF6BqEqNanR7YsaoaHU58I8jJ3L7DwIP7ji2MHx3ba5P0GI7ZaAMNU5a0hhHUlLzGZcU3VRwQoVuIMEzgNFFpzPwUGgUPV3Z2Z2hVdukr9pdQI9eT7PUxKfJg77fvfQt1XT4zCzjR+5fnP9dhbh5wXcxiBCchYtF+yYtAMavR75tVrYdzxrh6jrCI= 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:(13230022)(4636009)(39860400002)(376002)(396003)(136003)(346002)(451199015)(46966006)(40470700004)(36840700001)(36860700001)(82310400005)(81166007)(478600001)(356005)(82740400003)(9686003)(40460700003)(6636002)(36756003)(4326008)(110136005)(54906003)(316002)(186003)(6666004)(70586007)(70206006)(2876002)(47076005)(336012)(8676002)(40480700001)(426003)(5660300002)(2906002)(26005)(8936002)(86362001)(55446002)(7416002)(83380400001)(41300700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2022 14:38:43.6299 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 520034c8-373d-4da4-4c12-08dab116750d 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: DM6NAM11FT077.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4287 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree Since we can now get a formatted message back to the user with NL_SET_ERR_MSG_FMT_MOD(), there's no need for our special logging. Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/mae.c | 5 ++-- drivers/net/ethernet/sfc/tc.c | 47 +++++++++++++++------------------- drivers/net/ethernet/sfc/tc.h | 18 ------------- 3 files changed, 23 insertions(+), 47 deletions(-) diff --git a/drivers/net/ethernet/sfc/mae.c b/drivers/net/ethernet/sfc/mae.c index 874c765b2465..6f472ea0638a 100644 --- a/drivers/net/ethernet/sfc/mae.c +++ b/drivers/net/ethernet/sfc/mae.c @@ -265,9 +265,8 @@ int efx_mae_match_check_caps(struct efx_nic *efx, rc = efx_mae_match_check_cap_typ(supported_fields[MAE_FIELD_INGRESS_PORT], ingress_port_mask_type); if (rc) { - efx_tc_err(efx, "No support for %s mask in field ingress_port\n", - mask_type_name(ingress_port_mask_type)); - NL_SET_ERR_MSG_MOD(extack, "Unsupported mask type for ingress_port"); + NL_SET_ERR_MSG_FMT_MOD(extack, "No support for %s mask in field ingress_port", + mask_type_name(ingress_port_mask_type)); return rc; } return 0; diff --git a/drivers/net/ethernet/sfc/tc.c b/drivers/net/ethernet/sfc/tc.c index 3478860d4023..b21a961eabb1 100644 --- a/drivers/net/ethernet/sfc/tc.c +++ b/drivers/net/ethernet/sfc/tc.c @@ -137,17 +137,16 @@ static int efx_tc_flower_parse_match(struct efx_nic *efx, flow_rule_match_control(rule, &fm); if (fm.mask->flags) { - efx_tc_err(efx, "Unsupported match on control.flags %#x\n", - fm.mask->flags); - NL_SET_ERR_MSG_MOD(extack, "Unsupported match on control.flags"); + NL_SET_ERR_MSG_FMT_MOD(extack, "Unsupported match on control.flags %#x", + fm.mask->flags); return -EOPNOTSUPP; } } if (dissector->used_keys & ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) | BIT(FLOW_DISSECTOR_KEY_BASIC))) { - efx_tc_err(efx, "Unsupported flower keys %#x\n", dissector->used_keys); - NL_SET_ERR_MSG_MOD(extack, "Unsupported flower keys encountered"); + NL_SET_ERR_MSG_FMT_MOD(extack, "Unsupported flower keys %#x", + dissector->used_keys); return -EOPNOTSUPP; } @@ -156,11 +155,11 @@ static int efx_tc_flower_parse_match(struct efx_nic *efx, flow_rule_match_basic(rule, &fm); if (fm.mask->n_proto) { - EFX_TC_ERR_MSG(efx, extack, "Unsupported eth_proto match\n"); + NL_SET_ERR_MSG_MOD(extack, "Unsupported eth_proto match"); return -EOPNOTSUPP; } if (fm.mask->ip_proto) { - EFX_TC_ERR_MSG(efx, extack, "Unsupported ip_proto match\n"); + NL_SET_ERR_MSG_MOD(extack, "Unsupported ip_proto match"); return -EOPNOTSUPP; } } @@ -200,13 +199,9 @@ static int efx_tc_flower_replace(struct efx_nic *efx, if (efv != from_efv) { /* can't happen */ - efx_tc_err(efx, "for %s efv is %snull but from_efv is %snull\n", - netdev_name(net_dev), efv ? "non-" : "", - from_efv ? "non-" : ""); - if (efv) - NL_SET_ERR_MSG_MOD(extack, "vfrep filter has PF net_dev (can't happen)"); - else - NL_SET_ERR_MSG_MOD(extack, "PF filter has vfrep net_dev (can't happen)"); + NL_SET_ERR_MSG_FMT_MOD(extack, "for %s efv is %snull but from_efv is %snull (can't happen)", + netdev_name(net_dev), efv ? "non-" : "", + from_efv ? "non-" : ""); return -EINVAL; } @@ -214,7 +209,7 @@ static int efx_tc_flower_replace(struct efx_nic *efx, memset(&match, 0, sizeof(match)); rc = efx_tc_flower_external_mport(efx, from_efv); if (rc < 0) { - EFX_TC_ERR_MSG(efx, extack, "Failed to identify ingress m-port"); + NL_SET_ERR_MSG_MOD(extack, "Failed to identify ingress m-port"); return rc; } match.value.ingress_port = rc; @@ -224,7 +219,7 @@ static int efx_tc_flower_replace(struct efx_nic *efx, return rc; if (tc->common.chain_index) { - EFX_TC_ERR_MSG(efx, extack, "No support for nonzero chain_index"); + NL_SET_ERR_MSG_MOD(extack, "No support for nonzero chain_index"); return -EOPNOTSUPP; } match.mask.recirc_id = 0xff; @@ -261,7 +256,7 @@ static int efx_tc_flower_replace(struct efx_nic *efx, if (!act) { /* more actions after a non-pipe action */ - EFX_TC_ERR_MSG(efx, extack, "Action follows non-pipe action"); + NL_SET_ERR_MSG_MOD(extack, "Action follows non-pipe action"); rc = -EINVAL; goto release; } @@ -270,7 +265,7 @@ static int efx_tc_flower_replace(struct efx_nic *efx, case FLOW_ACTION_DROP: rc = efx_mae_alloc_action_set(efx, act); if (rc) { - EFX_TC_ERR_MSG(efx, extack, "Failed to write action set to hw (drop)"); + NL_SET_ERR_MSG_MOD(extack, "Failed to write action set to hw (drop)"); goto release; } list_add_tail(&act->list, &rule->acts.list); @@ -281,20 +276,20 @@ static int efx_tc_flower_replace(struct efx_nic *efx, save = *act; to_efv = efx_tc_flower_lookup_efv(efx, fa->dev); if (IS_ERR(to_efv)) { - EFX_TC_ERR_MSG(efx, extack, "Mirred egress device not on switch"); + NL_SET_ERR_MSG_MOD(extack, "Mirred egress device not on switch"); rc = PTR_ERR(to_efv); goto release; } rc = efx_tc_flower_external_mport(efx, to_efv); if (rc < 0) { - EFX_TC_ERR_MSG(efx, extack, "Failed to identify egress m-port"); + NL_SET_ERR_MSG_MOD(extack, "Failed to identify egress m-port"); goto release; } act->dest_mport = rc; act->deliver = 1; rc = efx_mae_alloc_action_set(efx, act); if (rc) { - EFX_TC_ERR_MSG(efx, extack, "Failed to write action set to hw (mirred)"); + NL_SET_ERR_MSG_MOD(extack, "Failed to write action set to hw (mirred)"); goto release; } list_add_tail(&act->list, &rule->acts.list); @@ -310,9 +305,9 @@ static int efx_tc_flower_replace(struct efx_nic *efx, *act = save; break; default: - efx_tc_err(efx, "Unhandled action %u\n", fa->id); + NL_SET_ERR_MSG_FMT_MOD(extack, "Unhandled action %u", + fa->id); rc = -EOPNOTSUPP; - NL_SET_ERR_MSG_MOD(extack, "Unsupported action"); goto release; } } @@ -334,7 +329,7 @@ static int efx_tc_flower_replace(struct efx_nic *efx, act->deliver = 1; rc = efx_mae_alloc_action_set(efx, act); if (rc) { - EFX_TC_ERR_MSG(efx, extack, "Failed to write action set to hw (deliver)"); + NL_SET_ERR_MSG_MOD(extack, "Failed to write action set to hw (deliver)"); goto release; } list_add_tail(&act->list, &rule->acts.list); @@ -349,13 +344,13 @@ static int efx_tc_flower_replace(struct efx_nic *efx, rc = efx_mae_alloc_action_set_list(efx, &rule->acts); if (rc) { - EFX_TC_ERR_MSG(efx, extack, "Failed to write action set list to hw"); + NL_SET_ERR_MSG_MOD(extack, "Failed to write action set list to hw"); goto release; } rc = efx_mae_insert_rule(efx, &rule->match, EFX_TC_PRIO_TC, rule->acts.fw_id, &rule->fw_id); if (rc) { - EFX_TC_ERR_MSG(efx, extack, "Failed to insert rule in hw"); + NL_SET_ERR_MSG_MOD(extack, "Failed to insert rule in hw"); goto release_acts; } return 0; diff --git a/drivers/net/ethernet/sfc/tc.h b/drivers/net/ethernet/sfc/tc.h index 196fd74ed973..4373c3243e3c 100644 --- a/drivers/net/ethernet/sfc/tc.h +++ b/drivers/net/ethernet/sfc/tc.h @@ -15,24 +15,6 @@ #include #include "net_driver.h" -/* Error reporting: convenience macros. For indicating why a given filter - * insertion is not supported; errors in internal operation or in the - * hardware should be netif_err()s instead. - */ -/* Used when error message is constant. */ -#define EFX_TC_ERR_MSG(efx, extack, message) do { \ - NL_SET_ERR_MSG_MOD(extack, message); \ - if (efx->log_tc_errs) \ - netif_info(efx, drv, efx->net_dev, "%s\n", message); \ -} while (0) -/* Used when error message is not constant; caller should also supply a - * constant extack message with NL_SET_ERR_MSG_MOD(). - */ -#define efx_tc_err(efx, fmt, args...) do { \ -if (efx->log_tc_errs) \ - netif_info(efx, drv, efx->net_dev, fmt, ##args);\ -} while (0) - struct efx_tc_action_set { u16 deliver:1; u32 dest_mport; From patchwork Tue Oct 18 14:37:29 2022 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: 13010703 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 DF3FDC43217 for ; Tue, 18 Oct 2022 14:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229971AbiJROis (ORCPT ); Tue, 18 Oct 2022 10:38:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230048AbiJROiq (ORCPT ); Tue, 18 Oct 2022 10:38:46 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2084.outbound.protection.outlook.com [40.107.244.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94150CD5F9 for ; Tue, 18 Oct 2022 07:38:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oT+w1EYas6WWa8KP8yFv/sBVHvFFfhwks+Q9AUO1XtBsB39dvTvRXB0Cq2kvv6nv2XuTZV3gmohR86CfNcqKb6xKSCymP4MmEHWBV4NDYNglzIzGZge+VfPD1Yg4ms4/65K8UmeoV0giGzCTjTcv7a7Tr8O0AsTxP6wsJz5Z98X2P+6Sbw3WJmQij/UZFvYRfLV2vLGO2nCWFXzFin2lbPhzqQR7OCdcN94b7e3kxgbTrXiHdl9jm+eVYFU1Kt1oC2vvvrhxTkE11LJ2kvr7fAuPtLWxH0FsGaNOL8UfGkmO1azXwi+bGdhtv1bLSzQHA7k/kHRwyG9n/wykRomreA== 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=KzrYube0RKL32HMfYnsHerQ8HH37t16kSQHaSnXZxpA=; b=f/etTqhz/MPP2JvsIqnToBeetfkPS8Ylu4m80tlS/w0AWSXwIAdrDtYzhzw8An94+lhv3g0IlH8SikABA+5O6JA6azpUOmPiJwiR//XQntPc0ZntDmas/hIara64trm5eaBBD2k0+MQpoCXdS3xtXQvMW8PYyTrmG+tLZAT0+zd6B9Eb6NLSJC/vU00KZiE9WsP1Aoj1PCE3xmlJUGO3o8nYcMk1vRrv850nyRwSA+E8A/LoAFWaWe51dT8CmOYaO+NFTAxVWY6cT+27UaCqDAApBtvlKYMK5fmvK3zECTlF0idQpTLoHLVhxgP0OhbsCiUnnVxG+3NynGkEXgmptA== 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=KzrYube0RKL32HMfYnsHerQ8HH37t16kSQHaSnXZxpA=; b=LyCG9b673kYRrIxhmWro5LMYKRjSHYkAvn1XskVA4piyiAQP8T91a7fPuemBAIdESIIv7LNL4rt0e1PKg/86P4BcyDxyAgNK4a3PLFFFpPHJnKQynLCMP6tkzEqVluhKX5MXxVl/7JabmUevYm3Hml//8ZwO0wBudNsUVXfY5Kc= Received: from DM6PR11CA0025.namprd11.prod.outlook.com (2603:10b6:5:190::38) by CY5PR12MB6622.namprd12.prod.outlook.com (2603:10b6:930:42::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.33; Tue, 18 Oct 2022 14:38:43 +0000 Received: from DM6NAM11FT111.eop-nam11.prod.protection.outlook.com (2603:10b6:5:190:cafe::b8) by DM6PR11CA0025.outlook.office365.com (2603:10b6:5:190::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.31 via Frontend Transport; Tue, 18 Oct 2022 14:38:43 +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 DM6NAM11FT111.mail.protection.outlook.com (10.13.173.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5723.20 via Frontend Transport; Tue, 18 Oct 2022 14:38:43 +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.2375.31; Tue, 18 Oct 2022 09:38:19 -0500 Received: from xcbecree41x.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.2375.31 via Frontend Transport; Tue, 18 Oct 2022 09:38:17 -0500 From: To: , CC: , , , , , , , , Edward Cree Subject: [PATCH v3 net-next 3/3] sfc: remove 'log-tc-errors' ethtool private flag Date: Tue, 18 Oct 2022 15:37:29 +0100 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT111:EE_|CY5PR12MB6622:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ccf6399-dd6d-4ec7-9048-08dab1167509 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9PVyoD2EIadTaIQXhcrKXt+CmPWJEUJ9vmw9W7+oI4EqkbL09mMSgU47gU8xPneKmrh6dxpRewLPJC1xXOgISdifcVpOufgh1yk3Q/Zzy7NI87ihb1tdtabsQk50WFv9wdF6y3tl/Sc3GUFfXYo4MvcR3kgS0c+avK5bSxdGVCnFNUV/tAfWzeYiWsMD4N9fCvEWwtTH3fV/se1A8JjwJ3nNmNo0mNVSxgO1BOBOx6KEg/yH+d2VksA8m5o/q9qMvBwwZT322FX3Edxl4e0jwLhgH7ukxu/GBqnyOUpNEVHZmuabR7r6cMfsZA9oOlSt2v4JcP5tKxKGLieF0hL76GE2xXaTHYqnr1ShNiaRFFyvPyFgsDgZiRphhcpKD4IlS0HrJr7nrl3Csq/CcTy5JrJqF5rgPLlTWW1bnIRKUy7fqONUqntKe/f5+vzaJ+n5TSlxgtlqsHRCH1MUQIGB25HChAUAIHMp48v5pXGx/f5hoUIhtCRDnR3nXLUpXtaEkZrJ7PcGfmQRpwJMxZjOuAzwZFcBLK0xsXIZ0bsz74nBexGwYI80nkat89zhuYYhQc7sFkt124Nu24Q3agxPetKZgj3rd00I0I+33EqGaTB9ZSbeAxSnj86QCc7G7JkVT04F3e2kSXScdUlf4hqXuElLAjwejd/0Z7eak1ySIpgGs6sp7RygGbsVpY8JznuyeEwLt7+y+qXWoDkPNdCwtJqGT7JSOVD39eg8MXsSNjCy6EHC8hu0yF2Rmo7q1AgrpvixcfoBRWQ3BN16ItV8m5k5wVWM4MqqFNlBJVzRM4g= 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:(13230022)(4636009)(39860400002)(376002)(396003)(136003)(346002)(451199015)(36840700001)(46966006)(40470700004)(2876002)(2906002)(4326008)(8676002)(7416002)(8936002)(5660300002)(41300700001)(55446002)(86362001)(36756003)(356005)(82740400003)(81166007)(40460700003)(9686003)(26005)(110136005)(6636002)(336012)(186003)(54906003)(82310400005)(6666004)(478600001)(36860700001)(70586007)(70206006)(40480700001)(426003)(47076005)(316002)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2022 14:38:43.6679 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ccf6399-dd6d-4ec7-9048-08dab1167509 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: DM6NAM11FT111.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6622 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Edward Cree It no longer does anything now that we're using formatted extacks instead. So we can remove the driver's whole get/set priv_flags implementation. Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/ef100_ethtool.c | 2 -- drivers/net/ethernet/sfc/ethtool_common.c | 37 ----------------------- drivers/net/ethernet/sfc/ethtool_common.h | 2 -- drivers/net/ethernet/sfc/net_driver.h | 2 -- 4 files changed, 43 deletions(-) diff --git a/drivers/net/ethernet/sfc/ef100_ethtool.c b/drivers/net/ethernet/sfc/ef100_ethtool.c index 135ece2f1375..702abbe59b76 100644 --- a/drivers/net/ethernet/sfc/ef100_ethtool.c +++ b/drivers/net/ethernet/sfc/ef100_ethtool.c @@ -43,8 +43,6 @@ const struct ethtool_ops ef100_ethtool_ops = { .get_pauseparam = efx_ethtool_get_pauseparam, .set_pauseparam = efx_ethtool_set_pauseparam, .get_sset_count = efx_ethtool_get_sset_count, - .get_priv_flags = efx_ethtool_get_priv_flags, - .set_priv_flags = efx_ethtool_set_priv_flags, .self_test = efx_ethtool_self_test, .get_strings = efx_ethtool_get_strings, .get_link_ksettings = efx_ethtool_get_link_ksettings, diff --git a/drivers/net/ethernet/sfc/ethtool_common.c b/drivers/net/ethernet/sfc/ethtool_common.c index 6649a2327d03..a8cbceeb301b 100644 --- a/drivers/net/ethernet/sfc/ethtool_common.c +++ b/drivers/net/ethernet/sfc/ethtool_common.c @@ -101,14 +101,6 @@ static const struct efx_sw_stat_desc efx_sw_stat_desc[] = { #define EFX_ETHTOOL_SW_STAT_COUNT ARRAY_SIZE(efx_sw_stat_desc) -static const char efx_ethtool_priv_flags_strings[][ETH_GSTRING_LEN] = { - "log-tc-errors", -}; - -#define EFX_ETHTOOL_PRIV_FLAGS_LOG_TC_ERRS BIT(0) - -#define EFX_ETHTOOL_PRIV_FLAGS_COUNT ARRAY_SIZE(efx_ethtool_priv_flags_strings) - void efx_ethtool_get_drvinfo(struct net_device *net_dev, struct ethtool_drvinfo *info) { @@ -460,8 +452,6 @@ int efx_ethtool_get_sset_count(struct net_device *net_dev, int string_set) efx_ptp_describe_stats(efx, NULL); case ETH_SS_TEST: return efx_ethtool_fill_self_tests(efx, NULL, NULL, NULL); - case ETH_SS_PRIV_FLAGS: - return EFX_ETHTOOL_PRIV_FLAGS_COUNT; default: return -EINVAL; } @@ -488,39 +478,12 @@ void efx_ethtool_get_strings(struct net_device *net_dev, case ETH_SS_TEST: efx_ethtool_fill_self_tests(efx, NULL, strings, NULL); break; - case ETH_SS_PRIV_FLAGS: - for (i = 0; i < EFX_ETHTOOL_PRIV_FLAGS_COUNT; i++) - strscpy(strings + i * ETH_GSTRING_LEN, - efx_ethtool_priv_flags_strings[i], - ETH_GSTRING_LEN); - break; default: /* No other string sets */ break; } } -u32 efx_ethtool_get_priv_flags(struct net_device *net_dev) -{ - struct efx_nic *efx = efx_netdev_priv(net_dev); - u32 ret_flags = 0; - - if (efx->log_tc_errs) - ret_flags |= EFX_ETHTOOL_PRIV_FLAGS_LOG_TC_ERRS; - - return ret_flags; -} - -int efx_ethtool_set_priv_flags(struct net_device *net_dev, u32 flags) -{ - struct efx_nic *efx = efx_netdev_priv(net_dev); - - efx->log_tc_errs = - !!(flags & EFX_ETHTOOL_PRIV_FLAGS_LOG_TC_ERRS); - - return 0; -} - void efx_ethtool_get_stats(struct net_device *net_dev, struct ethtool_stats *stats, u64 *data) diff --git a/drivers/net/ethernet/sfc/ethtool_common.h b/drivers/net/ethernet/sfc/ethtool_common.h index 0afc74021a5e..659491932101 100644 --- a/drivers/net/ethernet/sfc/ethtool_common.h +++ b/drivers/net/ethernet/sfc/ethtool_common.h @@ -27,8 +27,6 @@ int efx_ethtool_fill_self_tests(struct efx_nic *efx, int efx_ethtool_get_sset_count(struct net_device *net_dev, int string_set); void efx_ethtool_get_strings(struct net_device *net_dev, u32 string_set, u8 *strings); -u32 efx_ethtool_get_priv_flags(struct net_device *net_dev); -int efx_ethtool_set_priv_flags(struct net_device *net_dev, u32 flags); void efx_ethtool_get_stats(struct net_device *net_dev, struct ethtool_stats *stats __attribute__ ((unused)), u64 *data); diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 2e9ba0cfe848..7ef823d7a89a 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -855,7 +855,6 @@ enum efx_xdp_tx_queues_mode { * @timer_max_ns: Interrupt timer maximum value, in nanoseconds * @irq_rx_adaptive: Adaptive IRQ moderation enabled for RX event queues * @irqs_hooked: Channel interrupts are hooked - * @log_tc_errs: Error logging for TC filter insertion is enabled * @irq_rx_mod_step_us: Step size for IRQ moderation for RX event queues * @irq_rx_moderation_us: IRQ moderation time for RX event queues * @msg_enable: Log message enable flags @@ -1018,7 +1017,6 @@ struct efx_nic { unsigned int timer_max_ns; bool irq_rx_adaptive; bool irqs_hooked; - bool log_tc_errs; unsigned int irq_mod_step_us; unsigned int irq_rx_moderation_us; u32 msg_enable;