[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20180907.082504.1277807183056339898.davem@davemloft.net>
Date: Fri, 07 Sep 2018 08:25:04 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: hauke.mehrtens@...el.com
Cc: netdev@...r.kernel.org, zahari.doychev@...el.com,
thomas.langer@...el.com
Subject: Re: for_each_netdev_feature() broken on big endian
From: "Mehrtens, Hauke" <hauke.mehrtens@...el.com>
Date: Fri, 7 Sep 2018 15:10:53 +0000
> On a MIPS 32 Big endian system the netdev_sync_upper_features() function does not work correctly.
> It does not disbale bit 15 (NETIF_F_LRO, 0x0000000000008000), but 47 (NETIF_F_HW_TC, 0x0000800000000000).
>
> The for_each_netdev_feature() macro is used to go over all netdev feature flags and calls for_each_set_bit() with a u64.
> This is the code:
> #define for_each_netdev_feature(mask_addr, bit) \
> for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT)
> https://elixir.bootlin.com/linux/v4.19-rc2/source/include/linux/netdev_features.h#L157
Good catch, yes we cannot use the the generic bit handling macros on the netdev
feature flags because the feature flags are a u64 operated on as a unit whereas
"long" may be 32-bit or 64-bit depending upon the architecture.
Powered by blists - more mailing lists