Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5637223rwb; Tue, 17 Jan 2023 16:53:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXtCXVETTzp06Pa9XBKo/DqpJW5VlhPzRbKok2xn/mDiwFHUDQ+0tCIcdukz4miy6lzxU69g X-Received: by 2002:a17:902:c10d:b0:189:d8fb:1523 with SMTP id 13-20020a170902c10d00b00189d8fb1523mr5476569pli.36.1674003200613; Tue, 17 Jan 2023 16:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674003200; cv=none; d=google.com; s=arc-20160816; b=NW+Ux/wBzM9k7c33tQpTNAR6Z5vflHENlrbQdYSrrNVCM4dD7PhG/UFLqkIiK3yGHL cUlFYb99zGufX4VzsmgjiSZmthgh6q1ap2BB8hfflrI1gqT0JCeJlCO5kLEn4QFNZJkC +mrQ0QW0/HET7gW65khUd4dHnuU3lZ3CzEmF18Hoj24vEcQIjsfyy2fLvDB06xFcQYis 4XWnP81fI9Qr/hTk24STw1EsEo98xQsSvIE8b7jpXzJdU+5CSMMaeImT8vGtz6zOMvHS /bbIJPa0/0z8JsqV+iYpmUY5/08/uaH/nQxVkfCahFxAs0SLYjoOB4b+serHRqSbSJ5O kY2g== 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=ZqG3eRlHUbK1Lyl7ksi3Aw/n8LhVJQ09Kf9OQGt9voM=; b=bH30S8xPSjhb2dEh9lKZhvzLUNgwAVPoIVR1BNADxA5NhfDT5dNL13CfWtkyjJbbdQ jfRGVTHkee7MWVN++ydnOjvNDTzHJVhsm3rIToCCspP3ZyssYPXjs5wJC9bZZ+aPAdh4 9tRmFB9+grsk6fleFSQOaiw8V2Spt3SEbd5sFTMuIueGqtTh67UfqSVJk8YsBUns8KDU +WqxIQCLSg/Vg6IGQTSMdRwwyPQ5pA0wwrA8Dc4cs1xokBgxObiuMt9Azh3xI1O47Acg 17GtOBLupmg5lcMbj6/GuGa2dtU+rArZC72ENhJ50EZTZnsgpOzCDwzwdBfZKFEni7bh qFDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZxbOGkUg; 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 ix4-20020a170902f80400b001926cc639ecsi23584317plb.487.2023.01.17.16.53.15; Tue, 17 Jan 2023 16:53:20 -0800 (PST) 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=ZxbOGkUg; 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 S229596AbjAQXzS (ORCPT + 46 others); Tue, 17 Jan 2023 18:55:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbjAQXyo (ORCPT ); Tue, 17 Jan 2023 18:54:44 -0500 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E3774ABCB; Tue, 17 Jan 2023 15:08:11 -0800 (PST) Received: by mail-ej1-x636.google.com with SMTP id az20so60013761ejc.1; Tue, 17 Jan 2023 15:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=ZqG3eRlHUbK1Lyl7ksi3Aw/n8LhVJQ09Kf9OQGt9voM=; b=ZxbOGkUgPd0sW7VsqQdDiiEezFqOj9G5epZuy25qVAeqJo4VqKuLhaIPdKMzhI4z49 p7zUZjGRsXHV8muavKDc+qsjH1FkBmWBjW+cqLq/8GvqNU/upQ1x+F5Jp0DS/UQubeEc Ac4pdDjxJ5+Rbs4rzkL6WHY3Tpy6HeGJAgAD5JIRBPG5U2Ky+kVUXKioILZsLd1X8STR 5WGXAL/RbSZkGtOsoqpI0S4xqkIrGul9Gr3ihrlJ5WzcxZx44Wqff26av8mbjq5i8SDN WP0YICTHvV0Ho573spiFUOC0blUJaCDC4sjx0e1IQk1UaOFuCmdvVJKufiUSoXFeYeaX FT7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ZqG3eRlHUbK1Lyl7ksi3Aw/n8LhVJQ09Kf9OQGt9voM=; b=XlRnDcmfCOwxwBDI6uBGYfnFrVFxeSl8BQgFJ4tsl692yp7Du/AGjvxokoaqTfqlKi Og/MQ2VuiubiHqHF7ifll38HN6OzJSegHkSh0vpA2tAVbdbiqcnuSqDNUt+Un/C7wIdU b2tRPsZ56SGCciV8f5EoAUcs440J/gRxcNjyfZZ6rtRyNUPUGsK02mSH5K5IcKggGsIF fGXs6bzVdPrU7w48JFHFJTz0BAP4SscrRIX+kPtgVa4Vmwb1V3cvwz4cH33tqcwgd51X 4unKQ6DDfVAoyAc9nu/lsYfO2E81R+Fr7setTLKK/gArq7P9bGjQiudfXY6V742Nj3Fv 9rPA== X-Gm-Message-State: AFqh2krFErSzLSruLZoczLo1LdsYDwlhvrggn5+hAkzPhXN79JzqI3fv lEBp4oqat2r92awHZ4ExQvU= X-Received: by 2002:a17:907:100c:b0:870:e329:5f3d with SMTP id ox12-20020a170907100c00b00870e3295f3dmr4810199ejb.19.1673996890349; Tue, 17 Jan 2023 15:08:10 -0800 (PST) Received: from skbuf ([188.27.184.249]) by smtp.gmail.com with ESMTPSA id g9-20020a17090604c900b0085ca279966esm8773118eja.119.2023.01.17.15.08.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jan 2023 15:08:10 -0800 (PST) Date: Wed, 18 Jan 2023 01:08:06 +0200 From: Vladimir Oltean To: "Hans J. 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 , Claudiu Manoil , Alexandre Belloni , =?utf-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Russell King , Christian Marangi , 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" Subject: Re: [RFC PATCH net-next 1/5] net: bridge: add dynamic flag to switchdev notifier Message-ID: <20230117230806.ipwcbnq4jcc4qs7z@skbuf> References: <20230117185714.3058453-1-netdev@kapio-technology.com> <20230117185714.3058453-2-netdev@kapio-technology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230117185714.3058453-2-netdev@kapio-technology.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On Tue, Jan 17, 2023 at 07:57:10PM +0100, Hans J. Schultz wrote: > To be able to add dynamic FDB entries to drivers from userspace, the > dynamic flag must be added when sending RTM_NEWNEIGH events down. > > Signed-off-by: Hans J. Schultz > --- > include/net/switchdev.h | 1 + > net/bridge/br_switchdev.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/include/net/switchdev.h b/include/net/switchdev.h > index ca0312b78294..aaf918d4ba67 100644 > --- a/include/net/switchdev.h > +++ b/include/net/switchdev.h > @@ -249,6 +249,7 @@ struct switchdev_notifier_fdb_info { > u8 added_by_user:1, > is_local:1, > locked:1, > + is_dyn:1, > offloaded:1; > }; > > diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c > index 7eb6fd5bb917..60c05a00a1df 100644 > --- a/net/bridge/br_switchdev.c > +++ b/net/bridge/br_switchdev.c > @@ -136,6 +136,7 @@ static void br_switchdev_fdb_populate(struct net_bridge *br, > item->added_by_user = test_bit(BR_FDB_ADDED_BY_USER, &fdb->flags); > item->offloaded = test_bit(BR_FDB_OFFLOADED, &fdb->flags); > item->is_local = test_bit(BR_FDB_LOCAL, &fdb->flags); > + item->is_dyn = !test_bit(BR_FDB_STATIC, &fdb->flags); Why reverse logic? Why not just name this "is_static" and leave any further interpretations up to the consumer? > item->locked = false; > item->info.dev = (!p || item->is_local) ? br->dev : p->dev; > item->info.ctx = ctx; > -- > 2.34.1 >