Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1254597iol; Fri, 10 Jun 2022 03:47:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNCj/qWDT+Xb80ISYNpbE7kHeSMvuN1T0Qak/0wgipelkS/xoEeOFYsi3irZVuAcY8P9Ix X-Received: by 2002:a05:6402:280b:b0:42d:d562:9b0e with SMTP id h11-20020a056402280b00b0042dd5629b0emr50217100ede.176.1654858048954; Fri, 10 Jun 2022 03:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654858048; cv=none; d=google.com; s=arc-20160816; b=j6sxun1dh+Pizj0ebzqlQl6+ONekE5tt1lXILTjuVwOokCk6D4532QgCPCZOacyTaz AK5fjk87hXtGffKlVIn4KQTNzTnfpx+cdHPL4fL3nIJzeD9er9LQePUAnx2laz5SE3oh AQgvc9yVm1lNt5bNgH7wIdq3LXzLTwyFz/lg6g7rhwOUFCHKypfyb4655vSe++inFA1U Wf0U0y5sSG6OCv8N2wEQDekHTjhqWsJyFwca6/SoEc97lVIV95EbCQQsoqtkl2Bf/GNm wU4jqVXnJFAKyaHo12KDS05w4AL3R3XU+GzZ+ik12G48XvXE6WY3xFwxJOxUP4FZHbs1 RtUA== 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=jgQ4Pj8+yGBql+EUXNC4IL2Tb/83HAbOfq24qrxoorcQLC3ZdLWEuX5O+sQH6ZuQ1O S1CrHTMsGb4lOuHRrOgZ+bdP8z9nh7yXDqZpy+rUqZB6FFUh2N/G1FUnyCjLh9DRqGQN jYQFpHJVcr0V6Iq5mWblqHCh6JFeDWw6A6qafVxhoj46qGfYHsTTFiYg27o6Y7bk7d1f NlgrOPMrmVKzFHq/WlL6lizam96brq6+Y0cJCG/PvZmrbPJaW+f44FBtvBgbyYDMxOhf d/iOzzFtmmAgxfASAjtrM7nnfsmroxyQ1ppozR0/61hEPPtF0YZPpgb0olC6tWCrDDhc 3MAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ly5+6ExL; 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 y64-20020a50bb46000000b00425d8c9efd2si2973054ede.152.2022.06.10.03.47.04; Fri, 10 Jun 2022 03:47:28 -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=ly5+6ExL; 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 S244779AbiFJKnv (ORCPT + 99 others); Fri, 10 Jun 2022 06:43:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347003AbiFJKnT (ORCPT ); Fri, 10 Jun 2022 06:43:19 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 657DE2298F6; Fri, 10 Jun 2022 03:38:58 -0700 (PDT) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 69E80240009; Fri, 10 Jun 2022 10:38:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1654857536; 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=ly5+6ExLfQyVXUHf0PL0iDl7TqD6rhT+XwRGad0A3263oFOKOmF25FGuVLbMPMrVxKt2bK o+yQGoPurBLyjNZieTktRHtsDn7+77baRoWHyqzSe7CCRqMr2wGXjJbAEypLv4QogKymN3 Y6UWVCYfBbjESpW4rxTcUevoetBuB5NhcS02qb3ynCoixV9FCfxM6YLO3K8c7PZu1wFy+Y oOPm3ojvAyNKMLwWeJHRz8pMeNfYpox7FFbugZ8ngyfIC6eQMiMnEc/GWnmyKvH7i4Waad IPE1VZotrTc7Sb4r2dFtg9m6fYJ4J9TAZiFWJC5EXsmazy+ZOW+sDGhG9ujEYg== 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 RESEND net-next v7 01/16] net: dsa: allow port_bridge_join() to override extack message Date: Fri, 10 Jun 2022 12:36:57 +0200 Message-Id: <20220610103712.550644-2-clement.leger@bootlin.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220610103712.550644-1-clement.leger@bootlin.com> References: <20220610103712.550644-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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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