From patchwork Sun Feb 14 15:53:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 382829 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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, 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 837E0C433DB for ; Sun, 14 Feb 2021 15:55:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F02E64DD8 for ; Sun, 14 Feb 2021 15:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229848AbhBNPzM (ORCPT ); Sun, 14 Feb 2021 10:55:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhBNPzK (ORCPT ); Sun, 14 Feb 2021 10:55:10 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4955EC061574 for ; Sun, 14 Feb 2021 07:54:29 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id l12so5357802edt.3 for ; Sun, 14 Feb 2021 07:54:29 -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=AwMk/kalLyDokHCM5RI1avVwvdbNcsILetiSswflN14=; b=ti+bdeKunPn9c3RUZan4rFyK9YMueMFshAd+uKUToLkudlJvy3W7dKREE2Y+GyX9cD CG9KxfAA26R3qqxj66EVY4m3OZyHq4cPLz0/QLfMGvGJWNgnlCnQLMahNWyTWGobAuTa cRfhql9001+7k7+UqSjdU8sR5KYk4A+CmR5yQbdSvnDxFlO0sMfkM+8oCv3VG6n7m5uF /KoYhuQfeN9dHKROIMcbkNb6JjhhGnlezIFnjqjrIWE0+iI3B1L9htq8uPl+s4fMFWFR 9bg74KbPsDZJMPrd6L5OcwWZ90B0OPm4aa3i/P+5tEpR2Um7QEUE8x47g5rTsaZoSZG/ smGA== 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=AwMk/kalLyDokHCM5RI1avVwvdbNcsILetiSswflN14=; b=d50P6mBekdssTqU8SVKN9rDTchZO+Xq4EqoZGhf8m3abOOtQj+7fzg0YNwjxV4W5xQ 6E6XwY0+apAa7rQNWuAGcs29PBfxD+NGfmj5b47VHQ8hV8gypzxWkwyJjelUJOYL+TfW Ct314HYSFEZ4A4bhMTNHXAdyiJp72wgJc6vG1MQWWzvn/OOqR5Qj4D+js7l44D4BPA4w 8Q4qbFd+4wPnX0p0Hfo+KlQZX7WMfoitkhQzOJJLXZmYv5XVPD1ENBzYSxYgjbj8wcef z93T/9YxCl6pOyngqXCTuzQ/OzDoTCHzihW3qww+5NJ41JPkK+3BY6JwQxsIX6VtSXzv HVFw== X-Gm-Message-State: AOAM533UIb9L4KpifFhcT3F8AXU6j+uOUmG9+9lxHE3zhFGVsUQqSQCu IjVVcmpeqcqjm/xFwBvfEKQ= X-Google-Smtp-Source: ABdhPJxt59Mmt5arXEyJ737vvEOoJTYxt9UhYS824bqQfrsnvLj48Ty23g5CMsoA1ad/dIpFciN73A== X-Received: by 2002:a05:6402:270d:: with SMTP id y13mr11939483edd.149.1613318067849; Sun, 14 Feb 2021 07:54:27 -0800 (PST) Received: from localhost.localdomain (5-12-227-87.residential.rdsnet.ro. [5.12.227.87]) by smtp.gmail.com with ESMTPSA id cn18sm8576003edb.66.2021.02.14.07.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 07:54:27 -0800 (PST) From: Vladimir Oltean To: "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: Florian Fainelli , Andrew Lunn , Vivien Didelot , Kurt Kanzenbach , Woojung Huh , UNGLinuxDriver@microchip.com, Sean Wang , Landen Chao , Claudiu Manoil , Alexandre Belloni , George McCollister , Tobias Waldekranz , DENG Qingfang , Linus Walleij , Hauke Mehrtens , Rasmus Villemoes , Oleksij Rempel Subject: [PATCH net-next 0/4] Software fallback for bridging in DSA Date: Sun, 14 Feb 2021 17:53:22 +0200 Message-Id: <20210214155326.1783266-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 As was discussed here: https://patchwork.kernel.org/project/netdevbpf/patch/20201202091356.24075-3-tobias@waldekranz.com/ it is desirable to not reject a LAG interface (bonding, team) even if the switch isn't able to offload bridging towards that link aggregation group. At least the DSA setups I have are not that unbalanced between the horsepower of the CPU and the horsepower of the switch such that software forwarding to be completely impractical. This series makes all switch drivers theoretically able to do the right thing when they are configured in a way similar to this (credits to Tobias Waldekranz for the drawing): br0 / \ team0 \ / \ \ swp0 swp1 swp2 although in practice there is one more prerequisite: for software fallback mode, they need to disable address learning. It is preferable that they do this by implementing the .port_pre_bridge_join and .port_bridge_join methods. Vladimir Oltean (4): net: dsa: don't offload switchdev objects on ports that don't offload the bridge net: dsa: reject switchdev objects centrally from dsa_slave_port_obj_{add,del} net: dsa: return -EOPNOTSUPP if .port_lag_join is not implemented net: dsa: don't set skb->offload_fwd_mark when not offloading the bridge net/dsa/dsa_priv.h | 16 ++++++++++++++++ net/dsa/slave.c | 21 +++++++++++---------- net/dsa/switch.c | 13 ++++++++++--- net/dsa/tag_brcm.c | 2 +- net/dsa/tag_dsa.c | 9 +++++---- net/dsa/tag_hellcreek.c | 2 +- net/dsa/tag_ksz.c | 2 +- net/dsa/tag_lan9303.c | 4 +++- net/dsa/tag_mtk.c | 2 +- net/dsa/tag_ocelot.c | 2 +- net/dsa/tag_ocelot_8021q.c | 2 +- net/dsa/tag_rtl4_a.c | 2 +- net/dsa/tag_sja1105.c | 4 ++-- net/dsa/tag_xrs700x.c | 3 +-- 14 files changed, 55 insertions(+), 29 deletions(-) Reviewed-by: Tobias Waldekranz Reviewed-by: Tobias Waldekranz Reviewed-by: Tobias Waldekranz