Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1271744iol; Fri, 10 Jun 2022 04:11:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3gIsiT/DHIggJFNUJcyHbL6zNYm4a2O5LNtksq3YtmLBoL0AbZZs+iQ8ofUV+fdPBxyz2 X-Received: by 2002:a05:6402:40d2:b0:42f:ac14:34a3 with SMTP id z18-20020a05640240d200b0042fac1434a3mr41358156edb.262.1654859475101; Fri, 10 Jun 2022 04:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654859475; cv=none; d=google.com; s=arc-20160816; b=MUyFXHMDR5uqdjfvCwsWSz+zewSZnvKU6UwkAvgwA5dqD8/osmtTMFNz97rZD3bh3n AuueMf7VJigrJDNidWeg651Jj4QD/Em+Og+8mT7TYArUwRtZvKlB/Ps7kUVHVjOxKP9Z tsLI/R1CDI96vNRFBioFqJ4bCNuB0TeCCXmJsZu1gD5rhUWMLnSHOVKqma8msFHluRgC 46RLDcwVFQgFTa2tT29hJ/DOTqiAijOF4+6UpdHXfkXyeJsuNb6UlvwNDtvUoKxEPrXo lLd4AdYzvEKhcJGUZwGk/ZVluiKiIxOSA5mg/HJCzZRFqjBo+icgZi6ozKIr88frSjvN qL+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GyK/HEB8Y6ske/BNNq6/G70klLzxtTJDCFXseTBmW2M=; b=kL3GFprNGDjZabvocPhcU8tKasbHfXBIG11F1haerOdGhuEwsdiVAYfXq/TWPltuwp YPAeqkN592XKO5bnQxYKD7Th/DEkjlODfWuWFjirN+NG+QM3zX9PGDb3jSeosSGHJS6+ ONHeyqNqdTcPu3zL6XedwhOg//APsqmldnx9mauSBom/OBl/c6t4OB2t2P9Dk0JKt251 VK5KU2BXBBKQ4UcmDNhq7YVcpoGbNMJu1AhlS+lkTZAh6lqg3S3aw0MZ1FXyMQCC825E 0l85ALlbzJxle+X5UjMKvHJkVBRsqESqJoH/KgVuJnVgjex6Oxp4Zm5ip2yLr/ZaaO2m XZTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RHJfg92F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020aa7c487000000b0042e0cfdab0fsi11447449edq.6.2022.06.10.04.10.48; Fri, 10 Jun 2022 04:11:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RHJfg92F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348703AbiFJKaX (ORCPT + 99 others); Fri, 10 Jun 2022 06:30:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241672AbiFJKaP (ORCPT ); Fri, 10 Jun 2022 06:30:15 -0400 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 726A0419B1; Fri, 10 Jun 2022 03:30:13 -0700 (PDT) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 3B6D3100002; Fri, 10 Jun 2022 10:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1654857011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GyK/HEB8Y6ske/BNNq6/G70klLzxtTJDCFXseTBmW2M=; b=RHJfg92FiznXmVedTTV7m6LhD73PN6mJA+U6/1CcRYHFtEUw/LQkuRCjIMh2kYGh56JZW0 h0FvGuPkIcJWIMAe7N90R1jd2nwlJY1IlfIzocbEAMABlCnSJizek72wao6zPSHqxLphdS 6ylhEQrpg/BHxYhIJA4301lqaWgzyGKIXnwCUzoTkaVwD7HImTHfOWEpQ8Elbb43Wfyo+p 1YZinXw9YtDrAY866RIAAKaa+YLSGnjQBbozxBT3JQgitA15efxqb1jGNhuMlXh+K7+uEL cCegJRqXq9IalgSGazZh+JBQSyMTLQkOjjwerb8b1lPP4/cS9CmjuebU3DapAA== From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Geert Uytterhoeven , Magnus Damm , Heiner Kallweit , Russell King , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu Cc: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Thomas Petazzoni , Herve Codina , =?UTF-8?q?Miqu=C3=A8l=20Raynal?= , Milan Stevanovic , Jimmy Lalande , Pascal Eberhard , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next v7 01/16] net: dsa: allow port_bridge_join() to override extack message Date: Fri, 10 Jun 2022 12:28:18 +0200 Message-Id: <20220610102833.541098-2-clement.leger@bootlin.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220610102833.541098-1-clement.leger@bootlin.com> References: <20220610102833.541098-1-clement.leger@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some drivers might report that they are unable to bridge ports by returning -EOPNOTSUPP, but still wants to override extack message. In order to do so, in dsa_slave_changeupper(), if port_bridge_join() returns -EOPNOTSUPP, check if extack message is set and if so, do not override it. Reviewed-by: Vladimir Oltean Signed-off-by: Clément Léger --- net/dsa/slave.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 2e1ac638d135..509b98dd9954 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -2460,8 +2460,9 @@ static int dsa_slave_changeupper(struct net_device *dev, if (!err) dsa_bridge_mtu_normalization(dp); if (err == -EOPNOTSUPP) { - NL_SET_ERR_MSG_MOD(extack, - "Offloading not supported"); + if (!extack->_msg) + NL_SET_ERR_MSG_MOD(extack, + "Offloading not supported"); err = 0; } err = notifier_from_errno(err); -- 2.36.1