From patchwork Tue Feb 2 23:31:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 374986 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD5BDC433E0 for ; Tue, 2 Feb 2021 23:32:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6877664E56 for ; Tue, 2 Feb 2021 23:32:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236411AbhBBXcB (ORCPT ); Tue, 2 Feb 2021 18:32:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233149AbhBBXb5 (ORCPT ); Tue, 2 Feb 2021 18:31:57 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FDA8C061573 for ; Tue, 2 Feb 2021 15:31:17 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id z22so24844854edb.9 for ; Tue, 02 Feb 2021 15:31:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=khS4MnlKJJOb5IU5cgEdX1KQSRwh5T3JBvy3P2Yj38Q=; b=aT/Jnrjr4YxzHqqB040VIzwa0xM6F2u2+Tp6gykSLKSwHgAcFG54qAR0jkHxH2xUZ+ CKWoJwtWDCfcZULiN4jxpCXzkynD/5WpqHsYcklpfuKTDvfg3Rv+5vIk+qIIeJ8GOh0x TLVOYI8iur5wVq4PeF8G9sr1+LBbwY0L3a3pYfV8D1NMy427vgIOegIntXSaWWeUDz4m eyV0xV902+78geRdNpDLmaD4vcxLgVckS6O0vadDvszgYJadAJn/MoszTNaf09HT8QuI 86n9CD4wtOYBjKoKUTHJFojzudQBhQVxPzlDsg2kI8D2Mf6vwZPJeGynde2FlFBUjaff ENXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=khS4MnlKJJOb5IU5cgEdX1KQSRwh5T3JBvy3P2Yj38Q=; b=hZNO7hANql695sUkEoy8AOtfGKMgyQTEnRTmn38G5hdOf85P7pwtINCfZ7o2omrPuy of2trVI3lCKCQtDpd/GaNQ2DjXdw80XDpQCJ+fadRweSjPQUgxLDqBcBZhxi12hZGBbp mpgdsWlR4GfNxXBp3LphAMyq3SBTVu9KaEwHkSFbYV1/zU5USykVtMRYg3cVYlGtJ744 AvCiNMyEmIrRcnKwoRtCJglJYdFPc2c0SA7DPPT7lYLo2X9CBX+8yQtjTK5yRtXzBron W1shI4H7+Qi+R0+IrfA8Gv7bRheW/HgfnBIKxDGSC+Dm8UpHhOwoBvwZPL32zYqKlb2j FYLg== X-Gm-Message-State: AOAM532WjN87B0UhQ1S25cUGYD3r/MPexb6AWCOFEarkKbMZRJY8e7j9 bJ6jjfON5IQe5kKR4T8+8sc= X-Google-Smtp-Source: ABdhPJzYQLq6dFby/7+gnQlhTxhedLDJ2KW9C454H9F1nH2ucC2UuJhYuEJbC767ZfNHkAQxtJob4Q== X-Received: by 2002:aa7:cdd5:: with SMTP id h21mr459788edw.106.1612308675991; Tue, 02 Feb 2021 15:31:15 -0800 (PST) Received: from localhost.localdomain (5-12-227-87.residential.rdsnet.ro. [5.12.227.87]) by smtp.gmail.com with ESMTPSA id c18sm87763edu.20.2021.02.02.15.31.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 15:31:15 -0800 (PST) From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , Vivien Didelot , Tobias Waldekranz Subject: [PATCH net-next] net: dsa: fix SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING getting ignored Date: Wed, 3 Feb 2021 01:31:09 +0200 Message-Id: <20210202233109.1591466-1-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vladimir Oltean The bridge emits VLAN filtering events and quite a few others via switchdev with orig_dev = br->dev. After the blamed commit, these events started getting ignored. The point of the patch was to not offload switchdev objects for ports that didn't go through dsa_port_bridge_join, because the configuration is unsupported: - ports that offload a bonding/team interface go through dsa_port_bridge_join when that bonding/team interface is later bridged with another switch port or LAG - ports that don't offload LAG don't get notified of the bridge that is on top of that LAG. Sadly, a check is missing, which is that the orig_dev is equal to the bridge device. This check is compatible with the original intention, because ports that don't offload bridging because they use a software LAG don't have dp->bridge_dev set. On a semi-related note, we should not offload switchdev objects or populate dp->bridge_dev if the driver doesn't implement .port_bridge_join either. However there is no regression associated with that, so it can be done separately. Fixes: 5696c8aedfcc ("net: dsa: Don't offload port attributes on standalone ports") Signed-off-by: Vladimir Oltean Reviewed-by: Tobias Waldekranz Tested-by: Tobias Waldekranz --- net/dsa/dsa_priv.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h index 2ce46bb87703..1c4ee741b4b8 100644 --- a/net/dsa/dsa_priv.h +++ b/net/dsa/dsa_priv.h @@ -182,7 +182,15 @@ static inline bool dsa_port_offloads_netdev(struct dsa_port *dp, /* Switchdev offloading can be configured on: */ if (dev == dp->slave) - /* DSA ports directly connected to a bridge. */ + /* DSA ports directly connected to a bridge, and event + * was emitted for the ports themselves. + */ + return true; + + if (dp->bridge_dev == dev) + /* DSA ports connected to a bridge, and event was emitted + * for the bridge. + */ return true; if (dp->lag_dev == dev)