Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp730891rwb; Thu, 19 Jan 2023 01:46:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXtKoAXerXw0Y6Aj+AvV8vPDD6JAdi07GlJZ/98p0RFoO/TukMj5AW4UnR/Rz3yyuA5lJNK5 X-Received: by 2002:aa7:c603:0:b0:46b:203:f388 with SMTP id h3-20020aa7c603000000b0046b0203f388mr20791478edq.39.1674121605342; Thu, 19 Jan 2023 01:46:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674121605; cv=none; d=google.com; s=arc-20160816; b=gE2HqTDvosLAAGNEUVl1L1zKnV+MaP9q9+AsOKfw8Ry3M1GmkUk6+AfX8hoebXkzSM xDl+c1oxsGOzrDu8r5JYh3KoBh6vR+yjN/0N3P8zLkL6hF29ctabqPutwjgoSCn1BGzq rewIPfiy4FbVGYUncusUycl+2QQjAoPCwlVgHCkaoFCBCqzl2iQWJ/L9TjXSpSz4NfLA iEu3zjcXYNFbDRklV6euTtUzOSBHH0bWTqPCMwO4gENdWUlNDh7o2I6erHsi/Y56fmqx Z6pvYxGGVbRUIVw7ZX68kB0JfqePxHzWRQFva4R4QhU2Lg1cE7N0XnfUZ0e2M4jO+o4/ Q3wA== 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=s5Ge8uyMAXwH1kNbVoLVJMz5md/YXC3qDG0uqYv7JLg=; b=w7HgkA8d/pMA9pZaIDyyyMhAAz/ifnI5o+IfEIkbbWCG5F4NMDsK8LTB0G9MLtKU4p rDUlDSP+1GQ8vy5AyaIQEvSXR8BfW5+mqeWgqC12NkSRiPHnlhWnoAyG7pQ854kI86SB SG+9HTDyN47VTvKxeDA3IeeRR6c3kDBuhvTUm8OjtJbSidA3MTgYqaFCngjonn3urF6D F/gV/YN4KwUTOuYZNd96z8V0TLQK2utVJNChJVvPTiJiAWVRYykpjA5cHOal4aZ7DYzg IW7Oh+AXUqnhtzXBhvSQvvjHldTk7sOhVJhNNZfJDstALCbG64eDyE4l088o8CMsSeCs clNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pY+ceUT5; 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 s24-20020a056402037800b00499c63cd389si24955637edw.442.2023.01.19.01.46.33; Thu, 19 Jan 2023 01:46:45 -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=pY+ceUT5; 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 S230079AbjASJeI (ORCPT + 44 others); Thu, 19 Jan 2023 04:34:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230042AbjASJeE (ORCPT ); Thu, 19 Jan 2023 04:34:04 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30EB15B84; Thu, 19 Jan 2023 01:34:03 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id s21so2070203edi.12; Thu, 19 Jan 2023 01:34:03 -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=s5Ge8uyMAXwH1kNbVoLVJMz5md/YXC3qDG0uqYv7JLg=; b=pY+ceUT5z37uTU7Y1gqA8WAVoJkOmuKK/1C6ouoZ6getUO4DtNM6wxQRLx5HwaCGMt acn3C1Co/vL2ciJLZY5ai84WZ4tmqecAFLJ1NBFpeDPE7MKbG129/AA+YIwvFAJAyDhU RdCAKmEb1uZvhlsDXlDbaDESg9tc0nTWVNi+ab5tYEITZrWBpqXAK6aP58qNNuWDYD+t OXeZalhSPmSHmVQSiRt2lLOoIRyvnlKMyGHl3NE0wF8O0EEPsMCp4vipxaHaFMxW78fz fdsOQ/t9jZ5sjLj881ECBUdsuF3BuGoU71VZOvxst6tRH0wSRVCbbukt9r/PGqLna/KP xXgg== 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=s5Ge8uyMAXwH1kNbVoLVJMz5md/YXC3qDG0uqYv7JLg=; b=U+24cGaDPw4V+PIfihkgF4tb4gaoyGTXV7vK2W0VbXHyegN6m7da39VGXmrfqr9uM0 WRtafYALphpX9pqYT32mDwNJ8/+c9aGsV7x1Vz8rmJtDOJwl8+6Wgp/TS+ZzWh43hqro paTJjOKfeWiEHG7bUBp2PTR1WOwWjVmFhZabgt5mOBWCOw8dSU+9ltFKplK4fF2WtrqD OE1xIBE8zuDyhdc/AumkzJHbZ4mr+kVkZk16duVs5Gpm3CD/YnOf9g6+ZZzJDMZ35yhd zb0Kk8S7yaTNRr21Q9bdxCniPFpSNFy8lskM7iFmhOm4YKSYfcXal//TvlNTERiVYMD+ +erA== X-Gm-Message-State: AFqh2kpXDghKAjwIVIJVVSFQhItM7n3hhKekgZOGqLGhEZ8Ai+o5cTzx lAFTP1+izgrCApkXPEZ41uQ= X-Received: by 2002:a50:fa8f:0:b0:49e:31d5:6769 with SMTP id w15-20020a50fa8f000000b0049e31d56769mr9558722edr.41.1674120841563; Thu, 19 Jan 2023 01:34:01 -0800 (PST) Received: from skbuf ([188.27.185.85]) by smtp.gmail.com with ESMTPSA id fd7-20020a056402388700b00483dd234ac6sm15055718edb.96.2023.01.19.01.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 01:34:01 -0800 (PST) Date: Thu, 19 Jan 2023 11:33:58 +0200 From: Vladimir Oltean To: netdev@kapio-technology.com 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: <20230119093358.gbyka2x4qbxxr43b@skbuf> References: <20230117185714.3058453-1-netdev@kapio-technology.com> <20230117185714.3058453-2-netdev@kapio-technology.com> <20230117230806.ipwcbnq4jcc4qs7z@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed, Jan 18, 2023 at 11:14:00PM +0100, netdev@kapio-technology.com wrote: > > > + 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? > > My reasoning for this is that the common case is to have static entries, > thus is_dyn=false, so whenever someone uses a switchdev_notifier_fdb_info > struct the common case does not need to be entered. > Otherwise it might also break something when someone uses this struct and if > it was 'is_static' and they forget to code is_static=true they will get > dynamic entries without wanting it and it can be hard to find such an error. I'll leave it up to bridge maintainers if this is preferable to patching all callers of SWITCHDEV_FDB_ADD_TO_BRIDGE such that they set is_static=true.