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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31493C433E0 for ; Wed, 6 Jan 2021 17:48:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E423F20657 for ; Wed, 6 Jan 2021 17:48:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726638AbhAFRsQ (ORCPT ); Wed, 6 Jan 2021 12:48:16 -0500 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:50903 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbhAFRsP (ORCPT ); Wed, 6 Jan 2021 12:48:15 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 55449580464; Wed, 6 Jan 2021 12:47:29 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 06 Jan 2021 12:47:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=GWGpFj W4wRt1rQT1v5tIhQyTh/KDGZjii9Tx6Q3/8Tc=; b=HsRCMgB84JEYOPEeiFFfyx bybGFpIEsbVWycOTqKcKg7a8/EgOj7PNd4sLMmvbVN9FwBJiF6iijQmkbOHA3/ky 8+6aixaHCfqt+Q+TMgc9Jl4nWWfw378T7xnv8kCynffo6Ossz+6luBM08awrQMzy mZQ9Cm+q4yLjEXXsmTEpq446TXTEOfisulN7M+YtlrkvG3rYaPE3ZKCbBv5IQRYR 91N4F8v+a9UoWLYhZuYjkHMeLyAkJXImmWpTFD/YJlPs/r8Q3l4SI6/aBuk6eaMW jHZi6veCXKlnkJ/08i/Y872aDIFnOfSU3fjvepSFD6G+7fEEubnLZhOYjqsknPoA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdegtddguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefkughoucfu tghhihhmmhgvlhcuoehiughoshgthhesihguohhstghhrdhorhhgqeenucggtffrrghtth gvrhhnpedtffekkeefudffveegueejffejhfetgfeuuefgvedtieehudeuueekhfduheel teenucfkphepkeegrddvvdelrdduheefrdeggeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehiughoshgthhesihguohhstghhrdhorhhg X-ME-Proxy: Received: from localhost (igld-84-229-153-44.inter.net.il [84.229.153.44]) by mail.messagingengine.com (Postfix) with ESMTPA id BE2A11080064; Wed, 6 Jan 2021 12:47:24 -0500 (EST) Date: Wed, 6 Jan 2021 19:47:23 +0200 From: Ido Schimmel To: Vladimir Oltean Cc: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, Florian Fainelli , Andrew Lunn , Vivien Didelot , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , Microchip Linux Driver Support , Sean Wang , Landen Chao , Claudiu Manoil , Alexandre Belloni , Linus Walleij , Vadym Kochan , Taras Chornyi , Jiri Pirko , Ido Schimmel , Grygorii Strashko , Ioana Ciornei , Ivan Vecera Subject: Re: [PATCH v2 net-next 04/10] net: switchdev: remove the transaction structure from port attributes Message-ID: <20210106174723.GC1082997@shredder.lan> References: <20210106131006.577312-1-olteanv@gmail.com> <20210106131006.577312-5-olteanv@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210106131006.577312-5-olteanv@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Jan 06, 2021 at 03:10:00PM +0200, Vladimir Oltean wrote: > From: Vladimir Oltean > > Since the introduction of the switchdev API, port attributes were > transmitted to drivers for offloading using a two-step transactional > model, with a prepare phase that was supposed to catch all errors, and a > commit phase that was supposed to never fail. > > Some classes of failures can never be avoided, like hardware access, or > memory allocation. In the latter case, merely attempting to move the > memory allocation to the preparation phase makes it impossible to avoid > memory leaks, since commit 91cf8eceffc1 ("switchdev: Remove unused > transaction item queue") which has removed the unused mechanism of > passing on the allocated memory between one phase and another. > > It is time we admit that separating the preparation from the commit > phase is something that is best left for the driver to decide, and not > something that should be baked into the API, especially since there are > no switchdev callers that depend on this. > > This patch removes the struct switchdev_trans member from switchdev port > attribute notifier structures, and converts drivers to not look at this > member. > > In part, this patch contains a revert of my previous commit 2e554a7a5d8a > ("net: dsa: propagate switchdev vlan_filtering prepare phase to > drivers"). > > For the most part, the conversion was trivial except for: > - Rocker's world implementation based on Broadcom OF-DPA had an odd > implementation of ofdpa_port_attr_bridge_flags_set. The conversion was > done mechanically, by pasting the implementation twice, then only > keeping the code that would get executed during prepare phase on top, > then only keeping the code that gets executed during the commit phase > on bottom, then simplifying the resulting code until this was obtained. > - DSA's offloading of STP state, bridge flags, VLAN filtering and > multicast router could be converted right away. But the ageing time > could not, so a shim was introduced and this was left for a further > commit. > > Signed-off-by: Vladimir Oltean > Acked-by: Linus Walleij > Acked-by: Jiri Pirko > Reviewed-by: Kurt Kanzenbach # hellcreek > Reviewed-by: Linus Walleij # RTL8366RB Reviewed-by: Ido Schimmel