Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp507760iog; Fri, 24 Jun 2022 08:15:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uYe5DWSy+8Wov658GZWYgXA2oBdYQItkZREqj6959yh1VA8CGVXQWUL3ooV/lpOyWIUMMA X-Received: by 2002:a05:6402:34ca:b0:435:7402:7faa with SMTP id w10-20020a05640234ca00b0043574027faamr18111081edc.274.1656083713535; Fri, 24 Jun 2022 08:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656083713; cv=none; d=google.com; s=arc-20160816; b=kj9sfu4YHYrYMdEif2oPnR0anRKspyvj+80FiJ7dNcPKkx0qrWx0HVG5miqROTCuM1 KXAS/7dIC2yyPRRfwGZ+8TrHhclYi8WshJBH9Cfc88sXHlsRNbQUbDC9SNyJaElM8o1q lPcthoUXueOW4gaVoDq9ZKaKVtGvlaiJH9uA6yjWLRsoDG2lpwZjiGtxUW1AWoIYx2i9 BxK7GmBVU71uLwjKUPofQiGAAi2NZCzoPpaa9Jr5MkEB5Kro3+qiGqNJ6wzaJ/jsEQoh LD+nkhYd/UOTmiF+ZE6vAqaOvcfUewYroC2JqjIPbm6xPNmHcAdrMCW9OF+dh8wy/bTB rTmw== 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=tExyiPeImu1Nxom9h3UVjRKBgN09NvUrwAIoO3Vi5fo=; b=Kt0MkYf61VqZYo+ZDw6pTpAVo3I5uXNR+NRItNzjCIF/K4v5jyoVeHwBxAhN4ACo5W rA8Gbd21qzO1fa3e9UHkhfmuFD0qUAueu7JXlaCk2nIlLGEi1Omc4hCFnBCyixQahjzE yWFKOuzEFhwVhp6bNgXQgIFCRbJ6pSNBqbHok4X5qHGP5QtnQLICFxklz7PI/70r0J8P 3FwH8R4KwXyrWWd7UIn28QAfUz15FldH0mSIscs5pBUZ2mf9IphZsV3ENcCDEHoVNqIO 24I9KxpGMUD0Bq8+uq2SamAT/dFDhZKQf+MIsNz+l1reigLK+Np65hb1sU/Cw7U5VZG5 Pukw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=VxzwWnkG; 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 y15-20020a056402440f00b0043578ded62esi3032263eda.352.2022.06.24.08.14.48; Fri, 24 Jun 2022 08:15:13 -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=VxzwWnkG; 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 S233145AbiFXOlh (ORCPT + 99 others); Fri, 24 Jun 2022 10:41:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233109AbiFXOlc (ORCPT ); Fri, 24 Jun 2022 10:41:32 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BC7267E58; Fri, 24 Jun 2022 07:41:30 -0700 (PDT) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id B01BDE0008; Fri, 24 Jun 2022 14:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1656081688; 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=tExyiPeImu1Nxom9h3UVjRKBgN09NvUrwAIoO3Vi5fo=; b=VxzwWnkGYQu3G0EXW2YPGX6Xazdzcq/dpoTKjXVUs0C0YH8PDI7i+lAps6g4Pk8V8ie0sQ r816HYswLeYRLG2OdpdjR8wn1kLgtjeL1MLMm5iK9r4LTebBUsYXFHSEvnw33V4Gbn0+CP lyDgzr032fmOlZI5m7S4QnFm8fqikDYiuXVFlJ2KEmgACAKcNgpTJZSHTCJGIcSPTyvgZo mb76CNLHsqm8l5vx10YYyHZODaePGSX+XPUvjm/IBwqXgh52Hi+1Gg1iuKQrPZUzsTtV29 FQSy0pcEEgJ9rPIL2gNwtDJDq2MqrM12qnz1Uhcygu+sn17HF+GmdxS1pBv30w== 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 v9 01/16] net: dsa: allow port_bridge_join() to override extack message Date: Fri, 24 Jun 2022 16:39:46 +0200 Message-Id: <20220624144001.95518-2-clement.leger@bootlin.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220624144001.95518-1-clement.leger@bootlin.com> References: <20220624144001.95518-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 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. Signed-off-by: Clément Léger Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli --- 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