Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2277254rwl; Thu, 30 Mar 2023 08:14:52 -0700 (PDT) X-Google-Smtp-Source: AKy350bDcDqhTvCWaEqoCv1k13+S0CXh2NTe3GPEvUfFpZPnGa/6YJgsPTMT8BIQl+aJgr2lPcdQ X-Received: by 2002:a17:906:519d:b0:939:5398:768e with SMTP id y29-20020a170906519d00b009395398768emr21342614ejk.7.1680189292568; Thu, 30 Mar 2023 08:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680189292; cv=none; d=google.com; s=arc-20160816; b=Mw1USuftxlVQIr+IK/yTZpKIR9vXkY/aXeycMNDwTpfrI1LYM4RIMcx9YX72vim2ES PP+snpWOdD9FTtczTZ+k4RIaj647SQZelSo0RiQGcQi37BZyyXFTQgyGUbcbPugJM75i ONh+AJVNC/tl4Rs7Y/sU9OTrqpCRCinrT1cvR2MUQEbszY1YdQIEhS+oZuNJkQxaysBH XUnPmfaMrueOlI3FVxaqFdLu+tsTjz+AbkWCA+DmbQiJOV79Pyr28ZmHEA8nt5fLOx13 oJsvlYTsr7EkVKJCa9QL2N9Hi8iEdLm0Bmwfceu4fkoX/2iJ2tQj9OBDQ1tSI2drzz2I AK0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=z0Z7V7Ss/AtXBRghpZkg8HPKEk/gIK+rbrkFIOnWykw=; b=vdgpEB/xauau8XE3I2JPB8OyxcahO6xG1zi/1sBm9F/TtNEq5m2xBeDyAOw7jb4ljl WrLMyJzDlXOBnJqe0nsWCPakMfYqdK9APKBvpthhKug5nska2+a+yYOScFLBF6LQM5XH nB/MhaHCvndRTCq2KRvYv8bM7Egyv6uQhuL8OlvZ/XYjQVToOVxjIDqEv3az0qP81A0+ YTtiQ71fIbpxIuQmlHPlk6C9EcC98J1as2iugbOolHLdKlYiH/2vcK4J47Y80cSWockA LEaYwZPUqUH3zwp29C5lQtEHPxORgosaQsKJAFyG0d+bxPzKuUZNE9mr/KNaklhfSNGP G3vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hrKdvXgm; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sy17-20020a1709076f1100b0093defbd627bsi16824011ejc.1026.2023.03.30.08.13.51; Thu, 30 Mar 2023 08:14:52 -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=@gmail.com header.s=20210112 header.b=hrKdvXgm; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232786AbjC3PJK (ORCPT + 99 others); Thu, 30 Mar 2023 11:09:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232768AbjC3PJF (ORCPT ); Thu, 30 Mar 2023 11:09:05 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B2BBCDE9; Thu, 30 Mar 2023 08:08:13 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id le6so18328458plb.12; Thu, 30 Mar 2023 08:08:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680188893; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=z0Z7V7Ss/AtXBRghpZkg8HPKEk/gIK+rbrkFIOnWykw=; b=hrKdvXgmz+intqH6k/82qhZO+TXJRFUbWkit5YyihN3zsu13/kSZ0hpW0LVa5b7XVy h+KE9JOb8fFAzZYG60AOgY5RNeZjapZ/L4Q/l8g7HQ/PudZPn7BQcfZPJUOnIezdbY4C WSW3uXVaJ72O2Q73JC17f1rYt+NLA0tgOfwHgId0U4xbayGoLw4zd3TjSMl1QDWNgoay yTwQK2Gz1n74v92l4Hst8OFJ8LVY/EVXYX0JhaQjQyWBDAUqOmPaaYMrR+yRmkM0qv9w Gx2josZg2bXesXPWbGOJJSnHTl4S9C2rpx+jZ2yk/jHkgPBwBiMzTH317fUL6yDpgkZ4 ScyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680188893; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=z0Z7V7Ss/AtXBRghpZkg8HPKEk/gIK+rbrkFIOnWykw=; b=uZgpifKQADUHARRsbAmYQAtEWMv3BBbV4oq92E+XEE/XRFUXVk3rsgByioUc5P9tGf 62Qrc0iduTXECZXY53cEfHM3OZCNEdSRQUhH1ytaDJ3b66295cEuKQzooq3BymYG5FtQ U8tIR1WDR1jSjOWCZCOFT7TsWddsDrpqSjcpEZ3jzuRB2xSV5SsusiuhuDyCmu9Lowl/ E57xNE3crvjh3FhCJ4DYpTAA4u99MJxQ7zPpBFH1erEP8fexd3LStXpNIyDLedfDRml/ oFa4UAzjOdTvVQplWZrmbl+nxWi/kqVfNXwcVJOemInnb5YtxywcV+tTx6pcEDEvqZlv 92Qg== X-Gm-Message-State: AO0yUKXN7dNK6rWOhA2+pZ3qW9ELXIQFyE5bFJCX4aCbUgDA5jjhVcXM lBLF5ykqAV//SQlHQ7ngd40= X-Received: by 2002:a05:6a20:6ca6:b0:db:cfb5:33aa with SMTP id em38-20020a056a206ca600b000dbcfb533aamr20045536pzb.56.1680188893105; Thu, 30 Mar 2023 08:08:13 -0700 (PDT) Received: from skbuf ([188.27.184.189]) by smtp.gmail.com with ESMTPSA id w25-20020aa78599000000b00625037cf695sm24868986pfn.86.2023.03.30.08.07.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 08:08:12 -0700 (PDT) Date: Thu, 30 Mar 2023 18:07:52 +0300 From: Vladimir Oltean To: Hans Schultz Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Florian Fainelli , Andrew Lunn , Eric Dumazet , Paolo Abeni , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , "maintainer:MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER" , Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , AngeloGioacchino Del Regno , Claudiu Manoil , Alexandre Belloni , =?utf-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Christian Marangi , Ido Schimmel , open list , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , "open list:RENESAS RZ/N1 A5PSW SWITCH DRIVER" , "moderated list:ETHERNET BRIDGE" , "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [PATCH v2 net-next 2/6] net: dsa: propagate flags down towards drivers Message-ID: <20230330150752.gdquw5kudtrqgzyz@skbuf> References: <20230327160009.bdswnalizdv2u77z@skbuf> <87pm8tooe1.fsf@kapio-technology.com> <20230327225933.plm5raegywbe7g2a@skbuf> <87ileljfwo.fsf@kapio-technology.com> <20230328114943.4mibmn2icutcio4m@skbuf> <87cz4slkx5.fsf@kapio-technology.com> <20230330124326.v5mqg7do25tz6izk@skbuf> <87wn2yxunb.fsf@kapio-technology.com> <20230330130936.hxme34qrqwolvpsh@skbuf> <875yaimgro.fsf@kapio-technology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <875yaimgro.fsf@kapio-technology.com> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Thu, Mar 30, 2023 at 04:54:19PM +0200, Hans Schultz wrote: > I don't know if you have a solution in mind wrt the behaviour of the > offloaded flag if it is not to do as it does now and let the bridge age > out dynamic entries. That led me to conclude that this patch-set cannot > use the offloaded flag, but you seem to suggest otherwise. > > If you have a suggestion, feel free. Didn't I explain what I would do from the first reply on this thread? https://patchwork.kernel.org/project/netdevbpf/patch/20230318141010.513424-3-netdev@kapio-technology.com/#25270613 As a bug fix, stop reporting to switchdev those FDB entries with BR_FDB_ADDED_BY_USER && !BR_FDB_STATIC. Then, after "net" is merged into "net-next" next Thursday (the ship has sailed for today), add "bool static" to the switchdev notifier info, and make all switchdev drivers (everywhere where a SWITCHDEV_FDB_ADD_TO_DEVICE handler appears) ignore the "added_by_user && !is_static" combination, but by their own choice and not by switchdev's choice. Then, make DSA decide whether to handle the "added_by_user && !is_static" combination or not, based on the presence of the DSA_FDB_FLAG_DYNAMIC flag, which will be set in ds->supported_fdb_flags only for the mv88e6xxx driver. When DSA_FDB_FLAG_DYNAMIC is not supported, DSA will not offload the FDB entry: neither will it call port_fdb_add(), nor will it emit SWITCHDEV_FDB_OFFLOADED. Ideally, it would also inform user space that it can't offload this flag by returning an error, but the lack of an error propagation mechanism from switchdev to the bridge FDB is a known limitation which is hard to overcome, and is outside the scope of your patchset I believe. To see whether DSA has acted upon the "master dynamic" flag or not, it would be good enough for the user to see something adequate in "bridge fdb show | grep offloaded", I believe.