mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
net: Fix features skip in for_each_netdev_feature()
[ Upstream commit85db6352fc
] 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:3b89ea9c59
("net: Fix for_each_netdev_feature on Big endian") Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Gal Pressman <gal@nvidia.com> Link: https://lore.kernel.org/r/20220504080914.1918-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
5ed837a7e0
commit
39eb33b68f
1 changed files with 2 additions and 2 deletions
|
@ -145,7 +145,7 @@ enum {
|
|||
#define NETIF_F_HW_ESP_TX_CSUM __NETIF_F(HW_ESP_TX_CSUM)
|
||||
#define NETIF_F_RX_UDP_TUNNEL_PORT __NETIF_F(RX_UDP_TUNNEL_PORT)
|
||||
|
||||
/* 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)
|
||||
{
|
||||
|
@ -164,7 +164,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 */
|
||||
|
|
Loading…
Reference in a new issue