From patchwork Thu May 19 15:30:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 12855322 X-Patchwork-Delegate: geert@linux-m68k.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 48D61C433EF for ; Thu, 19 May 2022 15:32:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240550AbiESPcg (ORCPT ); Thu, 19 May 2022 11:32:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233902AbiESPcf (ORCPT ); Thu, 19 May 2022 11:32:35 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC7795D5D1; Thu, 19 May 2022 08:32:33 -0700 (PDT) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id BA994FF806; Thu, 19 May 2022 15:32:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1652974352; 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=c4V1uXX41ZnZQAb1eTaJsSm2ERttNLSUtAfNccyflg8=; b=igjUleMM2n2rK8XQiJxv2a4cisd7PykBdg1whhtx5+AtUAl6tL7PRPiYlgZF9ZK/3xBtO0 8Vh38gwNiGPlvX00rB8sMC4/3shf9edxEGmHibzA84gznwM+j9S5FvW/K2176n6/pzxEmF LdenHjHDMIvygp5kUtacQ9aHYO10CdMcTZjxq9NUSDMUX1ZqAeLe+FpLk6kM9hQJ+9/G6d KJ2fxCqE5vs7qvj3V7A3xL8s6YPDLNPEbeMssgU/Ymku8hVEQDPhyHn1BnoPH2ikYftyeN JdZeFgnLC7/kuWc2tu/ZbGlD1kkuCMnow1hXd+vYY3I7zdfWS1QrT1enJYu7vg== From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= 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 Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Thomas Petazzoni , Herve Codina , =?utf-8?q?Miqu=C3=A8l_Raynal?= , 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 v5 01/13] net: dsa: allow port_bridge_join() to override extack message Date: Thu, 19 May 2022 17:30:55 +0200 Message-Id: <20220519153107.696864-2-clement.leger@bootlin.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220519153107.696864-1-clement.leger@bootlin.com> References: <20220519153107.696864-1-clement.leger@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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. Signed-off-by: Clément Léger Reviewed-by: Vladimir Oltean --- 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 801a5d445833..291197859cea 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);