Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp244967rdb; Thu, 19 Oct 2023 03:21:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKAagb6SfjXi5mQokfkIrCKPejw3nipavMbsvEIFBDXoon5RyKYuPOpRBGEo/37X6s2/Va X-Received: by 2002:a17:902:fa83:b0:1c9:ccbd:6867 with SMTP id lc3-20020a170902fa8300b001c9ccbd6867mr1777570plb.38.1697710893286; Thu, 19 Oct 2023 03:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697710893; cv=none; d=google.com; s=arc-20160816; b=cwWFNgKQYAPpBC7Vr9FhAq+GqSQJlYRCO0QVZLcyE26HSSd9uIK97QreU+l2GT1pNt HZ7yK2Zt3nW9k/qlE3Qdiei/sMZP4fl+1gTnj5JSWqMyO4DzAuiDue18b8zi+YOsnKW6 hHs7cToNYu3ng0ViqkbxKjfjEAd/wC2L7pA2Zvb7It8IhPcsH/7wBlf1Tzp44+j+mbea hcOFz1efSYKrKkDkVITvsiY5lI3pUMtTmqMFIpGkMggsI9+C4DPull2ssRGQ2w2bX4DT dSSbeHXymKB2n8FpSnFHNaaxSYaCwoydXvQ2s+t3z68Xjpsp3siOY7ZYGHG64l6XhFpQ ZN+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=Z2ydsXXBaNBGMFpju1QSEdkFSa9tXDTzQRBfxsG6otY=; fh=HfW9fpLsKpTR0r0u7sabvCob5xuauP44uzSJdEgLjIM=; b=oQA8qUrIVtIw95z4RbqCfE9D7jRGPU070aTO/Bk2NcyeffPovbpWP6v+2lrTIrFJID OyoS1USfCNw4wU5TVyBJ21QeTeODKGuRiR4WGbCXt47XDY6jxlvEvxOsMC/26dcMyyJG mPz/IbgZNV3omkmbQrQZ+zsKHo44L5alJoj4BX44VXsk8YrufZaUTOukUiBQlJuAhzyW kbw8u21anMmXLzlIdXCcF9XkhJIIi5S7Oco/LO3qc58Oi1/cDQ/ER5w477zBbdFnqEsh 0ZyQzQBEhgCX9KL7251ip3eJh6RLFx2eUOtv2+A70gP0N2yw9FnhR86/hCno22U0vxVp 22Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=i7n7Db79; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id h12-20020a170902eecc00b001ca7308e42fsi1737381plb.631.2023.10.19.03.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 03:21:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=i7n7Db79; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7297A8177124; Thu, 19 Oct 2023 03:21:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345271AbjJSKVW (ORCPT + 99 others); Thu, 19 Oct 2023 06:21:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345273AbjJSKVV (ORCPT ); Thu, 19 Oct 2023 06:21:21 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8798F11F; Thu, 19 Oct 2023 03:21:18 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 71BA56000B; Thu, 19 Oct 2023 10:21:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697710877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z2ydsXXBaNBGMFpju1QSEdkFSa9tXDTzQRBfxsG6otY=; b=i7n7Db79nY/VWXnDbI9SYtt/qtDyAdtROrcJASSglaQq0S4kA0BCkd9sH+O7h8PCbPWgRZ BpXnW+ddcdjoh8XF0Jfvl+SSKd8up7VDJ33nVsqTqeyOPogF8KIE627ydCwtKPpHU+RoBv KEi8ACvEKF0qNEIXM7RYM2UDSL5qcQIoLZ+yoDDivxUHAAF13DeItCECs0Og7eLXlxPt1M nmzbaaPynO6UmIY5CrH86Swy4LVOalHZaHWCJQA6lAPi1ILMRTfJuBZTTIeedopl1nQIIL 7YZtXtrsK7P+/y0jfv43LjGtkmThadBK6WfQviqnJzZs4wLIqhnPfW5JF+Z6yQ== Date: Thu, 19 Oct 2023 12:21:14 +0200 From: =?UTF-8?B?S8O2cnk=?= Maincent To: Michal Kubecek Cc: Oleksij Rempel , "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net v1 1/1] ethtool: fix clearing of WoL flags Message-ID: <20231019122114.5b4a13a9@kmaincent-XPS-13-7390> In-Reply-To: <20231019095140.l6fffnszraeb6iiw@lion.mk-sys.cz> References: <20231019070904.521718-1-o.rempel@pengutronix.de> <20231019090510.bbcmh7stzqqgchdd@lion.mk-sys.cz> <20231019095140.l6fffnszraeb6iiw@lion.mk-sys.cz> Organization: bootlin X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 03:21:30 -0700 (PDT) On Thu, 19 Oct 2023 11:51:40 +0200 Michal Kubecek wrote: > On Thu, Oct 19, 2023 at 11:05:10AM +0200, Michal Kubecek wrote: > > On Thu, Oct 19, 2023 at 09:09:04AM +0200, Oleksij Rempel wrote: > > > With current kernel it is possible to set flags, but not possible to > > > remove existing WoL flags. For example: > > > ~$ ethtool lan2 > > > ... > > > Supports Wake-on: pg > > > Wake-on: d > > > ... > > > ~$ ethtool -s lan2 wol gp > > > ~$ ethtool lan2 > > > ... > > > Wake-on: pg > > > ... > > > ~$ ethtool -s lan2 wol d > > > ~$ ethtool lan2 > > > ... > > > Wake-on: pg > > > ... > > > > > > > How recent was the kernel where you encountered the issue? I suspect the > > issue might be related to recent 108a36d07c01 ("ethtool: Fix mod state > > of verbose no_mask bitset"), I'll look into it closer. > > The issue was indeed introduced by commit 108a36d07c01 ("ethtool: Fix > mod state of verbose no_mask bitset"). The problem is that a "no mask" > verbose bitset only contains bit attributes for bits to be set. This > worked correctly before this commit because we were always updating > a zero bitmap (since commit 6699170376ab ("ethtool: fix application of > verbose no_mask bitset"), that is) so that the rest was left zero > naturally. But now the 1->0 change (old_val is true, bit not present in > netlink nest) no longer works. Doh I had not seen this issue! Thanks you for reporting it. I will send the revert then and will update the fix for next merge-window. > To fix the issue while keeping more precise modification tracking > introduced by commit 108a36d07c01 ("ethtool: Fix mod state of verbose > no_mask bitset"), we would have to either iterate through all possible > bits in "no mask" case or update a temporary zero bitmap and then set > mod by comparing it to the original (and rewrite the target if they > differ). This is exactly what I was trying to avoid from the start but > it wouldn't be more complicated than current code. > > As we are rather late in the 6.6 cycle (rc6 out), the safest solution > seems to be reverting commit 108a36d07c01 ("ethtool: Fix mod state of > verbose no_mask bitset") in net tree as sending a notification even on > a request which turns out to be no-op is not a serious problem (after > all, this is what happens for ioctl requests most of the time and IIRC > there are more cases where it happens for netlink requests). Then we can > fix the change detection properly in net-next in the way proposed in > previous paragraph (I would prefer not risking more intrusive changes at > this stage).