Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3780775iob; Tue, 17 May 2022 07:08:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgRp2yfXwDTOE0Rk+5iuks2WqNXDLkwAKv64lfpQI9DZnYyANPR6nj6hBjyPkOuUEDRAkS X-Received: by 2002:a17:907:7ea8:b0:6f5:941:cba9 with SMTP id qb40-20020a1709077ea800b006f50941cba9mr19453058ejc.213.1652796534098; Tue, 17 May 2022 07:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652796534; cv=none; d=google.com; s=arc-20160816; b=CtM7YB6oynlPNwcrwUONcu6c/+QJVnJYWy3SEWim0Ub7CUCPq1jvGn6wkatMPK38R+ zbvDk2JljLwNRLLEtZDFmU4O50glLasQw5x1/4mp+SNZddmgfOuw7Hk5i40HG6GwKVT9 zFNnDMY6OUgmykE/nU18Rxon2ktSZp6ATOgQW9bGiJr4pO3q5WPcRZEJLy8IF1xdnLws VR2NtpPF/OmIRe7Uk/NsDASLv1OsegyqsP+XQSbi5OcuSYkmeApIEndFSpvyxBhka+Cr FAWxG/IfXKRS0IsxXPUHZWIYznxDFYr7fIxaDqyE5vggHB6VZGWk4yzbfJI5QPsHuwP7 ol/g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WuziWX2tOA+I/c0eT5TMwX8bfNdzjstA413/0icM8yE=; b=oNdOISKfNtskPI3B9DeaetZBXiaBZC3LvWlUpPoQRi/GPn5Y2jkFlelLkkDqBIgl/r JSD7a2VVPcIwiitp4kheL/lCuSVr5S+3GMo/ixOr1/yPFZHuQXqFCL9OlFuG9ULeHipj CyHnIeRWfaiwcXQE/ik6OfuQCiAn9DiBTye7Cyl0Pda0VgcVEgybcxLQ3tFtJMy2qCGR k+eHpQjCfc0KbXxxY35LMoBIm/jo3X2aAwx903fvzMBmIiSnC+heSVSb+2CE+0BYfLHG eRGuLXIoYckDQN+cM3xs79VdQ5/jp+UTpXVB5ENgIkPotEaj7w708rOIf/mWne3LJRpM 75XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mYlZp30p; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv22-20020a17090760d600b006e8c13a7938si2649320ejc.108.2022.05.17.07.08.25; Tue, 17 May 2022 07:08:54 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=mYlZp30p; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245097AbiEPTow (ORCPT + 99 others); Mon, 16 May 2022 15:44:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346033AbiEPTms (ORCPT ); Mon, 16 May 2022 15:42:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00D163F322; Mon, 16 May 2022 12:41:10 -0700 (PDT) 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 91FD161548; Mon, 16 May 2022 19:41:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83CF5C385AA; Mon, 16 May 2022 19:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652730070; bh=Kt5dt3FlKV7eGa6zGiDS99m4kzuj0Lcok+UidDRxhSg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mYlZp30pplIMgRb7HrACecRuAGPNxdUK0mRJdDlWWgDpWDLDbhFaT4eeZJ5adcbqD G6mz4TmwJRFef8QyCYSRIdYN1k7KWdwOFKotT/NqsXrM02teBY3Wub9z6/UufRSe+8 h9IHhqlXQ3NO98LORAaxV0wpwp11V8Fj86x4pIsQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tariq Toukan , Gal Pressman , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.19 03/32] net: Fix features skip in for_each_netdev_feature() Date: Mon, 16 May 2022 21:36:17 +0200 Message-Id: <20220516193614.877806329@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220516193614.773450018@linuxfoundation.org> References: <20220516193614.773450018@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 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,T_SCC_BODY_TEXT_LINE 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 From: Tariq Toukan [ Upstream commit 85db6352fc8a158a893151baa1716463d34a20d0 ] The find_next_netdev_feature() macro gets the "remaining length", not bit index. Passing "bit - 1" for the following iteration is wrong as it skips the adjacent bit. Pass "bit" instead. Fixes: 3b89ea9c5902 ("net: Fix for_each_netdev_feature on Big endian") Signed-off-by: Tariq Toukan Reviewed-by: Gal Pressman Link: https://lore.kernel.org/r/20220504080914.1918-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- include/linux/netdev_features.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 2a8105d204a9..78411dc4a040 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -156,7 +156,7 @@ enum { #define NETIF_F_HW_TLS_TX __NETIF_F(HW_TLS_TX) #define NETIF_F_HW_TLS_RX __NETIF_F(HW_TLS_RX) -/* Finds the next feature with the highest number of the range of start till 0. +/* Finds the next feature with the highest number of the range of start-1 till 0. */ static inline int find_next_netdev_feature(u64 feature, unsigned long start) { @@ -175,7 +175,7 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start) for ((bit) = find_next_netdev_feature((mask_addr), \ NETDEV_FEATURE_COUNT); \ (bit) >= 0; \ - (bit) = find_next_netdev_feature((mask_addr), (bit) - 1)) + (bit) = find_next_netdev_feature((mask_addr), (bit))) /* Features valid for ethtool to change */ /* = all defined minus driver/device-class-related */ -- 2.35.1