All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tariq Toukan <tariqt@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: <netdev@vger.kernel.org>, Moshe Shemesh <moshe@nvidia.com>,
	Boris Pismenny <borisp@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Maxim Mikityanskiy <maximmi@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>
Subject: [RFC PATCH 1/6] net: Fix features skip in for_each_netdev_feature()
Date: Wed, 26 May 2021 12:57:42 +0300	[thread overview]
Message-ID: <20210526095747.22446-2-tariqt@nvidia.com> (raw)
In-Reply-To: <20210526095747.22446-1-tariqt@nvidia.com>

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 <tariqt@nvidia.com>
---
 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 3de38d6a0aea..1a5f0c51bc99 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.21.0


  reply	other threads:[~2021-05-26  9:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26  9:57 [RFC PATCH 0/6] BOND TLS flags fixes Tariq Toukan
2021-05-26  9:57 ` Tariq Toukan [this message]
2021-05-26  9:57 ` [RFC PATCH 2/6] net: Disable TX TLS device offload on lower devices if disabled on the upper Tariq Toukan
2021-05-26  9:57 ` [RFC PATCH 3/6] net: Disable RX " Tariq Toukan
2021-05-26  9:57 ` [RFC PATCH 4/6] net/bond: Enable RXCSUM feature for bond Tariq Toukan
2021-05-26  9:57 ` [RFC PATCH 5/6] net/bond: Allow explicit control of the TLS device offload features Tariq Toukan
2021-05-26  9:57 ` [RFC PATCH 6/6] net/bond: Do not turn on TLS features in bond_fix_features() Tariq Toukan
2021-05-27  0:47 ` [RFC PATCH 0/6] BOND TLS flags fixes Jakub Kicinski
2021-05-27 14:07   ` Tariq Toukan
2021-05-27 17:56     ` Jakub Kicinski
2021-05-30 10:49       ` Tariq Toukan
2021-06-06 14:02         ` Tariq Toukan
2021-06-07 19:37           ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210526095747.22446-2-tariqt@nvidia.com \
    --to=tariqt@nvidia.com \
    --cc=borisp@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=maximmi@nvidia.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.