Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3769084iob; Tue, 17 May 2022 06:58:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwABjIPqSUV+WLzqb5hDS7VR7iKqzbXxaMuVcrG90Ny0Lmjs0aHjp/VpG+O0sRkM/DT/WB/ X-Received: by 2002:a62:6411:0:b0:50a:81df:bfa6 with SMTP id y17-20020a626411000000b0050a81dfbfa6mr23005478pfb.26.1652795895465; Tue, 17 May 2022 06:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652795895; cv=none; d=google.com; s=arc-20160816; b=l43DgKZM077Bzdwj26P6CLAF4f/5gIaJWDxmf5l7b4Lw28F1vuu0cLRXiyxADMqalc 81AGS3RFwkSPwaeMasV15zv8/7h6grn8gKLjqPdRxaOg6wUN1gZwOQryWn041QBJENMf 6EeC5vvn6y+xd4wJyi7Rq0HeyS7Rm85tKXrEF5ApOo5UIFeyNtuDxt3XCNLfy7FJJxiN j8QFdekLVxMCa2v6RyjaJPZmL0dFgCvhap5K/TlDS+/fFi6ImMKPqJETjGWqtUdSqHKD TQuUKBrDgyCLwY+4gQem6JMm9QoCtdZV3Hs9uzfn16LvlIKJDD3t77uxlk6k7X4WYb84 Todw== 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=+aQbjLdFTrXHlSmYmwN4gauFydYhTmDlYZQZkGIfPK4=; b=twXS3ebfGOPXwyYKKOVHBbY5Pcdka98Rqu210e1i31TALcWmb1HZ0QgvwJolmZyugu wJLVUmnSyYT6QSKJfPPA/SsKrtmlIh9souwr+GeBh0Y+8QOHGUwWTuLq1/BADgooepwd Bze38kvvam+IZddQDGsZlJxBhYBFt+aVuFfALGsYIfp1h0JKkmkbE5jg6TXrGE++Krnt pyI6IAiOef8EShTu3d2g/zLkE1LX5rP9Z424HcHd1mJU2QI22YfAYOoNgZGGhzSRAZIX QeGkVlwOmJ0hUgu7z+vsh3LD5PUC3s0hfDNwwz2kETAcWZv54TWnE5JkeiZVc7mJ+VeS iohA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fRIFfByv; 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 c7-20020a170902aa4700b00158bfb59d03si14771760plr.382.2022.05.17.06.58.01; Tue, 17 May 2022 06:58:15 -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=fRIFfByv; 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 S1351470AbiEPUDm (ORCPT + 99 others); Mon, 16 May 2022 16:03:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347886AbiEPTwY (ORCPT ); Mon, 16 May 2022 15:52:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43FB944A32; Mon, 16 May 2022 12:48:03 -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 ams.source.kernel.org (Postfix) with ESMTPS id 7DE66B81612; Mon, 16 May 2022 19:48:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC93AC385AA; Mon, 16 May 2022 19:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652730480; bh=GpidXhbU/zbRFsK1qawMMu/jSEVVxylItU3g7Z71e2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fRIFfByvqG5ZUVPMayXfPixTL265RsmA7hIW+V1IzWOmBWN+qEi8aI24EXVkYLZrE gEFrjCBKu742faWK0hJtXp4PTEpuU5toCEYtergOT+tp0p+AAw4MfR1XBzp0J9LB0F PnsfH9mIEQsR6kfz9ZZ6gPpiPWcn8TScmgIVH+f4= 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 5.15 005/102] net: Fix features skip in for_each_netdev_feature() Date: Mon, 16 May 2022 21:35:39 +0200 Message-Id: <20220516193624.148696722@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220516193623.989270214@linuxfoundation.org> References: <20220516193623.989270214@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 2c6b9e416225..7c2d77d75a88 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -169,7 +169,7 @@ enum { #define NETIF_F_HW_HSR_FWD __NETIF_F(HW_HSR_FWD) #define NETIF_F_HW_HSR_DUP __NETIF_F(HW_HSR_DUP) -/* 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) { @@ -188,7 +188,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