Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2144146pxb; Fri, 25 Mar 2022 11:53:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUp1NGww9OSv4jvjO7kcRcP9rHDeEK98rvjOSlIlhLMbzJ2PSphOZ9SljYE0Jwbd700FMX X-Received: by 2002:a17:902:9889:b0:153:abee:fbc7 with SMTP id s9-20020a170902988900b00153abeefbc7mr13190391plp.117.1648234382108; Fri, 25 Mar 2022 11:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648234382; cv=none; d=google.com; s=arc-20160816; b=0PNAlCm+DCxThfLr+EqLfJ3gSC+zzA9j+Cw9wKXNOozJTuuTeOA6oXiuQC57rwiPOH YnxMn9QzQ8fbxd69iIlsw6s0Z5pOixFIgUPlIGBqQ+G0SuBtUdq7QwZfVmeoqcWg8QYj lvEQgCqnaOFX1n3/rbGL66cDOOTCbSAwlJ4Qpb4BN49sxqwYZibmOXWDRs+tJqMWh7c2 FuVsdZixBuwVJMbdbvHM8QXIqBs7ovV4C93aDzuwwmNoUDCgadmW/qc10jMnVk0y19mC PsneOlpNmeTYFZ0da7nXx5CwUfTT+4F/vEqvIchxZCSYn57S8nLu50Ja1MzASVEma24J sBsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=Mwi/PBVi4OPxhBhWV/Tktz9iiz8/C8WzSrL6VIgHGvk=; b=Tl3OHybmch+PTIHga+vwySAbhKc16e46BnWWaCTGjpEvXz0wJPAVOP9OIbj+mCXsVj VhZ8wCfHQQhz+Cvon1x6wAv18ej+TKVq1YE7g/CvrCmcr3E+MOh7IrhijMmEP2/UhUFv B3LL5rJR7/gRjF5Df4NDX5fWg2zcuqszi40dJzLbH2DspdHOPKtfKCCBWMhNI7JYdU/i KhEIaQogx8TZE2ZRMpvNr0mitULM3fOhyT3qDg49i4AXQnNELDl2STuxI3n2zWf7giiM FrW6JGzmMXiZxh58JaNcrf7J+++QPE9H59a3Tw/pJJaMB3DQudn3DDIghOwBW06yZCbc xzqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IQSd2x3y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r15-20020a63204f000000b003816043efdcsi2931666pgm.465.2022.03.25.11.53.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 11:53:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IQSd2x3y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3798213365C; Fri, 25 Mar 2022 11:05:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242392AbiCWMbg (ORCPT + 99 others); Wed, 23 Mar 2022 08:31:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231716AbiCWMbe (ORCPT ); Wed, 23 Mar 2022 08:31:34 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD4D15A0B1; Wed, 23 Mar 2022 05:30:02 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id bu29so2502188lfb.0; Wed, 23 Mar 2022 05:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Mwi/PBVi4OPxhBhWV/Tktz9iiz8/C8WzSrL6VIgHGvk=; b=IQSd2x3y8uw0/eXpM0aSg9biATDuOVDOwzqaV//6E3+npTpbbX5NiWYAnWjaXE5tYe r6tGwUuwJyuRGBkBt4/svYcLJVPh+sgTWfNnbv+YKsjuOGO/7JAVVDkoIuf4dFAsnou7 JSiUVi+Xhgz2j0OQwgS48G+blKrsgn6wVCszn7I+XAHYRtR9Yc4W2h+ZStLA/XGvSymq +E+fhmQCpTvGBucE7y7eIYQf8SqnQg28Yex1gci/rU603EA+XwHPDIX9lX50rble14t5 IkHHbmm+uAEPXmhlf8JOU8iITQT+b3SnCkrKY9goLYq/cO7DwyvLS1XFC8sQbVS8CELJ +72A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Mwi/PBVi4OPxhBhWV/Tktz9iiz8/C8WzSrL6VIgHGvk=; b=yJlAA6miztcvccoDEF7qpd9hbNAtElFFz/ArhFUargcTuJ9ur3rSn44mkTu4+nHHFt OvhzcYYjo2zRA7f1fY35PLDdaIsGXC5FZdAOwB4hvrz/7xvHmOGtdHywbyB4cNeCbRr6 4UBIWsOe/34DrQcBfmsZTJ+Sp3m/IBADb/c7wSzmT4C+9OG5Mn7nNUHm5H8U+C/vS174 Lla6fTgAd3sVO6erXoExiipwAP3xelVVIxGKMRCs4hZmsrx0ADNfvL75Jfx+S0qOOP4n tIYKo8KUXApapVKAs6FqSh9twUroDfSKtsLBvEK2KDmtdfMUItGtPlG1tqcQsOlC5gVO Vchw== X-Gm-Message-State: AOAM53283pT+xv+gZiQyO3j8kgSwUNI3x6ru1HeiOy+vNLuvpGQA23on /JcEu60qaDvaj1FliXMOSzkbpfL20+uLJA== X-Received: by 2002:a05:6512:3d1a:b0:44a:10f5:5670 with SMTP id d26-20020a0565123d1a00b0044a10f55670mr16395636lfv.198.1648038600680; Wed, 23 Mar 2022 05:30:00 -0700 (PDT) Received: from wse-c0127 ([208.127.141.29]) by smtp.gmail.com with ESMTPSA id b7-20020a05651c098700b00247ea2fa530sm2710621ljq.20.2022.03.23.05.29.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 05:30:00 -0700 (PDT) From: Hans Schultz X-Google-Original-From: Hans Schultz To: Hans Schultz , davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Daniel Borkmann , Ido Schimmel , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2 net-next 2/4] net: switchdev: add support for offloading of fdb locked flag In-Reply-To: <20220317093902.1305816-3-schultz.hans+netdev@gmail.com> References: <20220317093902.1305816-1-schultz.hans+netdev@gmail.com> <20220317093902.1305816-3-schultz.hans+netdev@gmail.com> Date: Wed, 23 Mar 2022 13:29:52 +0100 Message-ID: <86o81whmwv.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 tor, mar 17, 2022 at 10:39, Hans Schultz wrote: > Used for Mac-auth/MAB feature in the offloaded case. > > Signed-off-by: Hans Schultz > --- > include/net/switchdev.h | 3 ++- > net/bridge/br.c | 3 ++- > net/bridge/br_fdb.c | 7 +++++-- > net/bridge/br_private.h | 2 +- > 4 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/include/net/switchdev.h b/include/net/switchdev.h > index 3e424d40fae3..d5d923411f5e 100644 > --- a/include/net/switchdev.h > +++ b/include/net/switchdev.h > @@ -229,7 +229,8 @@ struct switchdev_notifier_fdb_info { > u16 vid; > u8 added_by_user:1, > is_local:1, > - offloaded:1; > + offloaded:1, > + locked:1; > }; > > struct switchdev_notifier_port_obj_info { > diff --git a/net/bridge/br.c b/net/bridge/br.c > index b1dea3febeea..adcdbecbc218 100644 > --- a/net/bridge/br.c > +++ b/net/bridge/br.c > @@ -166,7 +166,8 @@ static int br_switchdev_event(struct notifier_block *unused, > case SWITCHDEV_FDB_ADD_TO_BRIDGE: > fdb_info = ptr; > err = br_fdb_external_learn_add(br, p, fdb_info->addr, > - fdb_info->vid, false); > + fdb_info->vid, false, > + fdb_info->locked); > if (err) { > err = notifier_from_errno(err); > break; > diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c > index 57ec559a85a7..57aa1955d34d 100644 > --- a/net/bridge/br_fdb.c > +++ b/net/bridge/br_fdb.c > @@ -987,7 +987,7 @@ static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge *br, > "FDB entry towards bridge must be permanent"); > return -EINVAL; > } > - err = br_fdb_external_learn_add(br, p, addr, vid, true); > + err = br_fdb_external_learn_add(br, p, addr, vid, true, > false); Does someone have an idea why there at this point is no option to add a dynamic fdb entry? The fdb added entries here do not age out, while the ATU entries do (after 5 min), resulting in unsynced ATU vs fdb. > } else { > spin_lock_bh(&br->hash_lock); > err = fdb_add_entry(br, p, addr, ndm, nlh_flags, vid, nfea_tb); > @@ -1216,7 +1216,7 @@ void br_fdb_unsync_static(struct net_bridge *br, struct net_bridge_port *p) > > int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p, > const unsigned char *addr, u16 vid, > - bool swdev_notify) > + bool swdev_notify, bool locked) > { > struct net_bridge_fdb_entry *fdb; > bool modified = false; > @@ -1236,6 +1236,9 @@ int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p, > if (!p) > flags |= BIT(BR_FDB_LOCAL); > > + if (locked) > + flags |= BIT(BR_FDB_ENTRY_LOCKED); > + > fdb = fdb_create(br, p, addr, vid, flags); > if (!fdb) { > err = -ENOMEM; > diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h > index f5a0b68c4857..3275e33b112f 100644 > --- a/net/bridge/br_private.h > +++ b/net/bridge/br_private.h > @@ -790,7 +790,7 @@ int br_fdb_sync_static(struct net_bridge *br, struct net_bridge_port *p); > void br_fdb_unsync_static(struct net_bridge *br, struct net_bridge_port *p); > int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_port *p, > const unsigned char *addr, u16 vid, > - bool swdev_notify); > + bool swdev_notify, bool locked); > int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port *p, > const unsigned char *addr, u16 vid, > bool swdev_notify); > -- > 2.30.2