Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp215188rdg; Tue, 10 Oct 2023 08:19:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExxZWD27lipbZJznG2ApnPZLWUY3Gz4hlWB1LVDY5BntQ3GmMnB7/c2OC8fq1izbnjd8/K X-Received: by 2002:a17:902:f546:b0:1c5:b622:6fcd with SMTP id h6-20020a170902f54600b001c5b6226fcdmr23281446plf.22.1696951162666; Tue, 10 Oct 2023 08:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696951162; cv=none; d=google.com; s=arc-20160816; b=KSvQMZm6XWNBul25ZJZgNQbRj3F86lqbzWIOk0mb9Szn0IDmblCqSh0YJl/JKSQpjE hU6iCJ/FNRwM5p8VBzN5LqFonla6ZqQeYVkWc2GQR8fVlgc2hiJiNIfq5CwqnwS7eRYu K0Njv0yHKsURjrmtn9rSEdyGgDBmmvS2Z0Jwaa6qTjnEWRomKjV85G79Z1AlpBoz20Ve iMQwwql7Cc/dVSC/B+PpOeJRKnEtzagS3c4U+SIIRdzyEEZOHq96Cfn3rj7MgWvIgNej zUCLEcbX2IM17oTkRJ5fZiJWNWpNH7XvRh/6QnIeWPx818nr8EfkdxXfJVKbmr2+xdiF yibQ== 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=qdQsYBCOR9VeofOcL2N0hDMbH4qWm06mbYTui9+DIwQ=; fh=ESVF7YO8ukpvRa5ShZ6euhXcCKPTLqDio0YyAydSxus=; b=t4ngalh4/BvntmPix2Jap4OPP6BBcmvUOKkUIfCwWWsOLQrEXXMyVniump+wG0buha xfochTqz8pWFx3vH6qEfcYaWmkZjy8UvG2HU3ZQS/CltjMfBKX1blcf/ote18VvMdrHa BdlilJ65hiCjfHJfmSJx1l2rwVDAdDJcow70R2IZ0uoDyE7QZfCjMhfXx765atPLDZ7A qEjCtdtFlvudw7Duz/ZLJySpfeJ0dfii2rht6RVEOFnnPn023jG70s2r/VylDT3pJu0v j5ZOlynevPuU7CmnYVNtEBQc+TQrreQFb6PR1SySpJLrP/8FWpSUAoNofYdU2XUjdHb3 ahKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fRSgeZic; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id ij7-20020a170902ab4700b001c9bdaa81e3si972884plb.633.2023.10.10.08.19.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 08:19:22 -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=@kernel.org header.s=k20201202 header.b=fRSgeZic; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 91C7A80D7553; Tue, 10 Oct 2023 08:19:20 -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 S233320AbjJJPTO (ORCPT + 99 others); Tue, 10 Oct 2023 11:19:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233026AbjJJPTM (ORCPT ); Tue, 10 Oct 2023 11:19:12 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD3BDC6 for ; Tue, 10 Oct 2023 08:19:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DC52C433C8; Tue, 10 Oct 2023 15:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696951148; bh=q5zpB8Ae5EwUX+krsgcAEDQQxTiFxoZyHrCg5TuPpm4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fRSgeZicmUkwBUqTTVEkR2oFBRPB7uH2+ITFqHwgtoTc5q2FbaeEAe1Ce5BXEPqpP QwzT13xhObh+q5M3efgctZ+RKZPnui+bEzR9pVMCjIJI+fy6e8dvQrCTsYdkZtsrXM MZfJhckFbDfe1gQSXHliI1dzbbxkp1XE0snIMFE7zE55B+UFoU2Zkwcsqiu36cQ4qI GdL4B7hPIFvnln7FyvPe5grLN81/OFmxPBIi5oSkG9EF7L5pJF2t3VoCEjrQ3zsz2d e8jQuXPWmP773MoBiOuy+0imw335Mp2djDq5NITji7sn8iRkVz40DBV1AcjjX4JVD2 D+8vbhSx3+Pvg== Date: Tue, 10 Oct 2023 17:19:03 +0200 From: Simon Horman To: =?utf-8?B?S8O2cnk=?= Maincent Cc: Michal Kubecek , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Maxime Chevallier , thomas.petazzoni@bootlin.com, Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: Re: [PATCH net v3 1/1] ethtool: Fix mod state of verbose no_mask bitset Message-ID: References: <20231009133645.44503-1-kory.maincent@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231009133645.44503-1-kory.maincent@bootlin.com> X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Tue, 10 Oct 2023 08:19:20 -0700 (PDT) X-Spam-Level: ** On Mon, Oct 09, 2023 at 03:36:45PM +0200, Köry Maincent wrote: > From: Kory Maincent > > A bitset without mask in a _SET request means we want exactly the bits in > the bitset to be set. This works correctly for compact format but when > verbose format is parsed, ethnl_update_bitset32_verbose() only sets the > bits present in the request bitset but does not clear the rest. The commit > 6699170376ab fixes this issue by clearing the whole target bitmap before we > start iterating. The solution proposed brought an issue with the behavior > of the mod variable. As the bitset is always cleared the old val will > always differ to the new val. > > Fix it by adding a new temporary variable which save the state of the old > bitmap. > > Fixes: 6699170376ab ("ethtool: fix application of verbose no_mask bitset") > Signed-off-by: Kory Maincent > --- > > Changes in v2: > - Fix the allocated size. > > Changes in v3: > - Add comment. > - Updated variable naming. > - Add orig_bitmap variable to avoid n_mask condition in the > nla_for_each_nested() loop. Hi Köry, thanks for the updates. This one looks good to me. Reviewed-by: Simon Horman