From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6034FC004D4 for ; Thu, 19 Jan 2023 09:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RLXvyzWYHTb4e1ui5dPGuAhNVroft6L0HcbptI9xRw8=; b=Sxw6+1CCDyNH5B vfdP1048ZHJoeObfVophOZHWZP9VYUZSE6Va3F499V93TgYylFEr+Ap+TF63SskLBoA91uiigQqIL sLYv/dHfdvYgtfok2m8I2BebXt30POXbyXecpGWhpopxDzxSJ3ntrBlSAMSeTX4RvrsgclDNiKslw s7bcybKstNsQ56P7OpXnexfd2aZQSOi8/63OayETSZJhyUxW5FEQCjhkels5AO5KiSVpjuDUVzz1G 0T8Dbbgb9g9+HG2f1PBzpv+idQZHtR9RCM0GjRCD27bTJg/MbkYFce2OnlNoeO13zRHzvYUTO5LOX rc5VaQ7H/5EhGHnhBmSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIRJB-004GVD-5Y; Thu, 19 Jan 2023 09:34:09 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIRJ8-004GUD-4Y; Thu, 19 Jan 2023 09:34:07 +0000 Received: by mail-ed1-x52b.google.com with SMTP id v13so2078802eda.11; Thu, 19 Jan 2023 01:34:02 -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=Jo7SMqenJONZ4LZ3KCzbTSg4jmKmqM/jGRsEKtyzXZ5PYwNwJMlipOuYzXHamYy1HE LBa3pj3DJhhREfqK0MEGSiAMq70kn/wonRJtTxtFrHqlq8d9GFpMV8t9qrwAV8i2hBBU Bt0ctRAQu2B8nwYemR9TQHE8wj+07BPeEPd7G08k2i39bfLnjuJRdStdMVqWA5ZzgfXK ndfmu/wOh/jvVHgEjcLZzGsr7K22DJ7ckQaZbZl4+TmSdGcW/ErPNOWubmnqupFlA1aD i8qaPCXcHpcz8limQ7Hh4O9N+l/vE0EUe9bvwZv5ZfCVrnCCK3G5Ojk9kP/aMm+/JvYP L5lQ== X-Gm-Message-State: AFqh2krgRYVUuV9XNmP3I5i3CoBOFAIyn7QoBRBNlF8JtJmOD6ePo8m5 0JP9ISdP4M6jOfa4+ul5UUM= X-Google-Smtp-Source: AMrXdXv/p9J+0LyxznivegZqBjv5p2sBwAfu5EYNt9IzkrSAyvVgO9ZtOW6iKd8IcEA7ooqkwi9I1w== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_013406_195322_DB0E9EC6 X-CRM114-Status: GOOD ( 14.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel