Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5253585rdb; Sat, 16 Sep 2023 08:48:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZeZgzLSBwGVcMPtZnU6V1fjQw4kmqalO9qNWU6Yug5uxTzaNa0vqnLmM7Ilt9aaNd+8z+ X-Received: by 2002:a05:6a00:1a4f:b0:68b:a137:3739 with SMTP id h15-20020a056a001a4f00b0068ba1373739mr4867515pfv.4.1694879338597; Sat, 16 Sep 2023 08:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694879338; cv=none; d=google.com; s=arc-20160816; b=XhW8VnwbD2NvHHMSimcPMTx8JAWUhYf8aCOLpNG+lGo+IzpQ6RNf5zLvWz9Luh9blZ sNXMXBBWLf+mEDPnhpl2FnkjP4kOpyxvIAUVZySRIkeJ2hPQcSl4vqJ4P4CBJDS+PNjR SOLTyXEPNpA9lw074Fm1RmESWjtLxrs6bY2mdcDX/La6D889lf0dV98mkJ3FjeHygGaw ZJ2142knJmq9hpN3uI7W+m/qag+VbqzgwbqNOjEPTiny8U5MOgjFEv5skGX6NhRup5tK e1TClDHEkdbLqSBpuaUIKXzQRDYTCizzDfyAwJ9r49+RU3FuPGBZjwG4rM2gZ4ot06L9 3E+w== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FS7jAZ/cyYym1Lo3/sP4SVgGzyYG2rPWdirmRmYjamo=; fh=qDNs7QxMmpqdQf+hWYNgGMWSFK/hLZnxEPHj6vWWLlk=; b=gNpQuiAJgthutrpnQCYXmcW9RjdwBxvnByMMg7OwCCvE/ALSPYHQadOh2OqkCPUpt/ cNXi/wFrWLA2Qx5bI8QcMVx7gEG1D7I8R+y/3hszTiopTUyb6bzWlnthj5mwDu2U8y1V 0pIjUDSVaxA6s7a9ZzsTeDd6xgIFx6ezUCcuUnAA49wOs1sQGqTQXtb7zq1ei/zf/g36 5e5nXbQmp0OblhfZtc2Z4dom6yXNQwIeA3jmqbbNF3/Jr8Sgl0wZqiGp5mK6RVqhVdXq eMHm3ijGSZXlduRqL1N+nOPh7HdqX9MhqvKNZIYTXDD5miokJS6T5gOZ8guBTCWLPTZk Exbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qe8Sc6HL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id y34-20020a056a00182200b0068e30105663si5129887pfa.402.2023.09.16.08.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 08:48:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qe8Sc6HL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B07BC802159B; Sat, 16 Sep 2023 08:48:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235832AbjIPPsF (ORCPT + 99 others); Sat, 16 Sep 2023 11:48:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229905AbjIPPrs (ORCPT ); Sat, 16 Sep 2023 11:47:48 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2FDCCE3 for ; Sat, 16 Sep 2023 08:47:43 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6142C433C8; Sat, 16 Sep 2023 15:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694879263; bh=9yoeSuSu4c9avKuB9jsu8jsIQJYt6cBB3MWv0m0Z7y0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qe8Sc6HLO2iQZ9PjqYe1yCCRQ1tpnCuR3MCfNQEU9aSMLnwJM9Hhl0/bONQXIPfd5 WmLJsJ/tiCNRjsOKIFJrc2i9jLeX7G5SS1WMXuDoyRed0jMGkLFprFwDmwk4uSNBo5 z6ceK18Ahw1+EMw+kgrsL+y+BNFk92hEn94HOTDhhQuHSpCT7W4z6fjg14rH6BVQ86 yY2MiMDmDCOpc183NEO2j4DrbMiLlKzbh1njf4KTt+Ghvfo1kClALhuvrvFFubX7Gy 8BQRvSt3QIWMEg4BoyZh+DRbmRrMUX95NQa6vByR7Blu7bKb6cIEV6V/g44xjWsCfk WKOnp3JIalObg== Date: Sat, 16 Sep 2023 17:47:37 +0200 From: Simon Horman To: Jisheng Zhang Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, johannes@sipsolutions.net, Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Subject: Re: [PATCH] net: stmmac: fix incorrect rxq|txq_stats reference Message-ID: <20230916154737.GG1125562@kernel.org> References: <20230915005316.592-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230915005316.592-1-jszhang@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 16 Sep 2023 08:48:42 -0700 (PDT) On Fri, Sep 15, 2023 at 08:53:16AM +0800, Jisheng Zhang wrote: > commit 133466c3bbe1 ("net: stmmac: use per-queue 64 bit statistics > where necessary") caused one regression as found by Uwe, the backtrace > looks like: > > INFO: trying to register non-static key. > The code is fine but needs lockdep annotation, or maybe > you didn't initialize this object before use? > turning off the locking correctness validator. > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.5.0-rc1-00449-g133466c3bbe1-dirty #21 > Hardware name: STM32 (Device Tree Support) > unwind_backtrace from show_stack+0x18/0x1c > show_stack from dump_stack_lvl+0x60/0x90 > dump_stack_lvl from register_lock_class+0x98c/0x99c > register_lock_class from __lock_acquire+0x74/0x293c > __lock_acquire from lock_acquire+0x134/0x398 > lock_acquire from stmmac_get_stats64+0x2ac/0x2fc > stmmac_get_stats64 from dev_get_stats+0x44/0x130 > dev_get_stats from rtnl_fill_stats+0x38/0x120 > rtnl_fill_stats from rtnl_fill_ifinfo+0x834/0x17f4 > rtnl_fill_ifinfo from rtmsg_ifinfo_build_skb+0xc0/0x144 > rtmsg_ifinfo_build_skb from rtmsg_ifinfo+0x50/0x88 > rtmsg_ifinfo from __dev_notify_flags+0xc0/0xec > __dev_notify_flags from dev_change_flags+0x50/0x5c > dev_change_flags from ip_auto_config+0x2f4/0x1260 > ip_auto_config from do_one_initcall+0x70/0x35c > do_one_initcall from kernel_init_freeable+0x2ac/0x308 > kernel_init_freeable from kernel_init+0x1c/0x138 > kernel_init from ret_from_fork+0x14/0x2c > > The reason is the rxq|txq_stats structures are not what expected > because stmmac_open() -> __stmmac_open() the structure is overwritten > by "memcpy(&priv->dma_conf, dma_conf, sizeof(*dma_conf));" > This causes the well initialized syncp member of rxq|txq_stats is > overwritten unexpectedly as pointed out by Johannes and Uwe. > > Fix this issue by moving rxq|txq_stats back to stmmac_extra_stats. For > SMP cache friendly, we also mark stmmac_txq_stats and stmmac_rxq_stats > as ____cacheline_aligned_in_smp. > > Fixes: 133466c3bbe1 ("net: stmmac: use per-queue 64 bit statistics where necessary") > Signed-off-by: Jisheng Zhang > Reported-by: Uwe Kleine-König Hi Jisheng Zhang, as a fix for Networking code this should be based targeted at the net tree. Subject: [PATCH net] ... Unfortunately it doesn't apply cleanly against net. Please consider rebasing and reposting. -- pw-bot: changes-requested