Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp1334476rwj; Fri, 23 Dec 2022 17:24:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXtAf3n2Ahb1BNEzQPjNbTMe9Xzl6gjm9kjfXp5wSYIaZqUDHtq3u503wdJyFhkJzH+VUiQR X-Received: by 2002:a17:906:c44:b0:7c1:700:9c4b with SMTP id t4-20020a1709060c4400b007c107009c4bmr8406690ejf.75.1671845066116; Fri, 23 Dec 2022 17:24:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671845066; cv=none; d=google.com; s=arc-20160816; b=EOwocuUZBWOx3pqLpNCtHyr8pDtpT2sAXQQcw71z6FY1OAWJoC61gdXVVPbTinISs4 BMyVLixFCbW4JOi3VrbABxo0UFhTsXvH0ztf+2ChsPUZyDxR0f04la1QL++e+lq4a37q 31WSDb5M786uRUjkZi6kiSFdNE96YOBWqJPT6hFB5nx+6wF/4xq443qdRlzj5VQ6c7dm j6LibuDUZ4XxvRounnOL1TB4UI8UuRANdXbdN79ltXMmnZKpewsAyXDNwNE4XI9sa4u0 b8VsZwhtF7SvDmJFXJBEy2QwZaG5A1T3/wKO1Ej5Me/E83opdiQXUfbX38mfnIHyizEj pPww== 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=+LvGW5NwYEV+jOnnvVzHjHa0O6qazmAtVlJMyNVOP7U=; b=vPnk7mLtIby4XpZudE1JjAt256XlaLydybcIcNCodf3E1AFX6lHCYx98tup7SpUPwU DT8gKCYqkq37svGjW7hmebnoEF2niMpFAKohk3AsInRJTipSXjh2Kpxiz8oQ0EsV2x29 ELTu92UJpkNWK0NKW8DlMk11vL4PjD9Snk6yp+rTUlGuCSBeARQU0pVT5yvFijVMqyym LJBxXRoUc8bhE6WfAvk/LV20XwF3ZtzCs5qzl06XFnWK26270h1FlIaq3cPEDLUIx1TS poW+xMRX++kxtbaEqbn0f3RdXWExkf/UzCqkX21toj8EJdgzQss8A0tQVc9+5o8GR0VP 3esA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kNN9dy/d"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a056402519100b0047b5ecde3d7si4404511edd.257.2022.12.23.17.24.05; Fri, 23 Dec 2022 17:24:26 -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=@kernel.org header.s=k20201202 header.b="kNN9dy/d"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232626AbiLXA30 (ORCPT + 65 others); Fri, 23 Dec 2022 19:29:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230312AbiLXA3Y (ORCPT ); Fri, 23 Dec 2022 19:29:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E0FA1A39D; Fri, 23 Dec 2022 16:29:23 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7DA6161FA3; Sat, 24 Dec 2022 00:29:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DBA3C433EF; Sat, 24 Dec 2022 00:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671841762; bh=D8/RRmXxBlCJ2dVDP24Osx4Ge5pXkhUGS6I0xtbmJAk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kNN9dy/dfj7FTGUzLGg1SoUiugSuLsPVjUWqAixbaBX1u6JyoukzydQA/PdNV6oN0 rOZRD65ZuHZFS1UzhiJa3iHgJV3Za1/xQyw0u28069NFlgomZFpMOI7DNOguECforX J63jA1GEB9qzpowrMJYpA1SMVHmrDthJiavxffL4j/7yK+nZsLgOSeSWOh2jWb7K6q 8jFhYFW+ANVqEGPmXdecOG82dLwqpV7jZdkFXgQygfBuSnmCUYn0CQHrsFGN23bF3b DFMPCT34BiC8AEFlZzVfxgw6EB/+ICogP51r/rnM8gBakBYpEBPRQAHB8eAihCLaXF Z4sRcJ3SxZtzQ== Date: Fri, 23 Dec 2022 19:29:21 -0500 From: Sasha Levin To: Vladimir Oltean Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Andrew Lunn , Ioana Ciornei , Paolo Abeni , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH AUTOSEL 5.15 41/46] net: dpaa2: publish MAC stringset to ethtool -S even if MAC is missing Message-ID: References: <20221218161244.930785-1-sashal@kernel.org> <20221218161244.930785-41-sashal@kernel.org> <20221219115402.evv5x2dzrb7tlwmn@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20221219115402.evv5x2dzrb7tlwmn@skbuf> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Mon, Dec 19, 2022 at 01:54:02PM +0200, Vladimir Oltean wrote: >Hi Sasha, > >On Sun, Dec 18, 2022 at 11:12:39AM -0500, Sasha Levin wrote: >> From: Vladimir Oltean >> >> [ Upstream commit 29811d6e19d795efcf26644b66c4152abbac35a6 ] >> >> DPNIs and DPSW objects can connect and disconnect at runtime from DPMAC >> objects on the same fsl-mc bus. The DPMAC object also holds "ethtool -S" >> unstructured counters. Those counters are only shown for the entity >> owning the netdev (DPNI, DPSW) if it's connected to a DPMAC. >> >> The ethtool stringset code path is split into multiple callbacks, but >> currently, connecting and disconnecting the DPMAC takes the rtnl_lock(). >> This blocks the entire ethtool code path from running, see >> ethnl_default_doit() -> rtnl_lock() -> ops->prepare_data() -> >> strset_prepare_data(). >> >> This is going to be a problem if we are going to no longer require >> rtnl_lock() when connecting/disconnecting the DPMAC, because the DPMAC >> could appear between ops->get_sset_count() and ops->get_strings(). >> If it appears out of the blue, we will provide a stringset into an array >> that was dimensioned thinking the DPMAC wouldn't be there => array >> accessed out of bounds. >> >> There isn't really a good way to work around that, and I don't want to >> put too much pressure on the ethtool framework by playing locking games. >> Just make the DPMAC counters be always available. They'll be zeroes if >> the DPNI or DPSW isn't connected to a DPMAC. >> >> Signed-off-by: Vladimir Oltean >> Reviewed-by: Andrew Lunn >> Reviewed-by: Ioana Ciornei >> Tested-by: Ioana Ciornei >> Signed-off-by: Paolo Abeni >> Signed-off-by: Sasha Levin >> --- > >I think the algorithm has a problem in that it has a tendency to >auto-pick preparatory patches which eliminate limitations that are >preventing future development from taking place, rather than patches >which fix present issues in the given code base. Yeah, I'd agree. I think that the tricky part is that preperatory patches usually resolve an issue, but it's not clear whether it's something that affects users, or is just a theoretical limitation needed by future patches. >In this case, the patch is part of a larger series which was at the >boundary between "next" work and "stable" work (patch 07/12 of this) >https://patchwork.kernel.org/project/netdevbpf/cover/20221129141221.872653-1-vladimir.oltean@nxp.com/ > >Due to the volume of that rework, I intended it to go to "next", even >though backporting the entire series to "stable" could have its own >merits. But picking just patch 07/12 out of that series is pointless, >so please drop this patch from the queue for 5.15, 6.0 and 6.1, please. Now dropped, thanks! -- Thanks, Sasha