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=-9.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 BAAC0C433DB for ; Sat, 9 Jan 2021 01:54:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76DF723A01 for ; Sat, 9 Jan 2021 01:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726254AbhAIByo (ORCPT ); Fri, 8 Jan 2021 20:54:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725916AbhAIByo (ORCPT ); Fri, 8 Jan 2021 20:54:44 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D78AC061573 for ; Fri, 8 Jan 2021 17:54:04 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id x126so7381499pfc.7 for ; Fri, 08 Jan 2021 17:54:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=dx4BOjBslD2NuvQxaY0KECGweFkuIWQqdcf7erqSIQs=; b=FHmgA0QuodbJHxF+qMiBE9hm9xvZKljqxblHdwf/0bC6mwqIqqozJUbhf472rFTgv1 epuYAk4OHx9YHMiSSwtxWzE5bTogy49kcZWwynWJrcBCRuVL5MOw+x/5ejgbUBciMOHC wPAGIWqPRg3vgczpikqU0YKqo5F7LSjiRi5esqYXvyXNjkpzkOqpeqW+Xh1n9BnxZE2Y ats1J+5tw4VS4w59OpuKo19kn/3uglMBUJUcWo6DOWYdWl+w6eg8ivI1M3ycpEaT5X9B Mbv7hf16YVkLNJjWji2zh9JfiHj3yHWrTgWcsy5Q/y4v4vSXAR+Zixum18aOK5swv++q ZfMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dx4BOjBslD2NuvQxaY0KECGweFkuIWQqdcf7erqSIQs=; b=dSTSDBDk57jaYh97h8h9A6/To4HBtKkNvhy3XtFNUSYpOxiHkM46uKjqMRgGVlR7MI ZmEY/vZgGGJQUVNpgdYC2H2gS8bFY7Y+2lP3wygxs6fRLJT5nMCbPCaaEjOeDufsgNOz DHiE3G8UdL4Lq+NUZ9COuHBS8okOJNkOuTPrAFmRz7db8Xc+3q42l/aWxtZOq4nyvVnk MzwIAoTKz7/kxndLUukj+K0Pyx8q6eoeqvUQRkb3r/irYZ96vvXOSQUMHKpyWr6TaH28 ewuF6h0H9uEoOqdA1Ohf0E5d2wyoIDwG78YgWSH975WzG4qx2VSL3rd3VIyBdIE0mqcm YaXQ== X-Gm-Message-State: AOAM532XmVefmoestcBKxsnJU77DQVgjqjunhrZhfVRMZx4GhrELya+z agEnfxsZ6PrTM5W20Ijvsew= X-Google-Smtp-Source: ABdhPJxjqE1vfvDPNRUOvktuU+L2yJ8SbB8kDvJmZf2d01v7dVWQLHE7CqbZ9Qbmj4Wn0gWjs00gzQ== X-Received: by 2002:aa7:93cf:0:b029:19d:e287:b02b with SMTP id y15-20020aa793cf0000b029019de287b02bmr6475362pff.66.1610157243597; Fri, 08 Jan 2021 17:54:03 -0800 (PST) Received: from [10.230.29.29] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id o193sm10507393pfg.27.2021.01.08.17.53.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Jan 2021 17:54:02 -0800 (PST) Subject: Re: [PATCH v4 net-next 05/11] net: switchdev: remove the transaction structure from port attributes To: Vladimir Oltean , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: 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 , Petr Machata References: <20210109000156.1246735-1-olteanv@gmail.com> <20210109000156.1246735-6-olteanv@gmail.com> From: Florian Fainelli Message-ID: Date: Fri, 8 Jan 2021 17:53:58 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210109000156.1246735-6-olteanv@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 1/8/2021 4:01 PM, 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 Reviewed-by: Florian Fainelli -- Florian