Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: hauke.mehrtens@intel.com
Cc: netdev@vger.kernel.org, zahari.doychev@intel.com,
	thomas.langer@intel.com
Subject: Re: for_each_netdev_feature() broken on big endian
Date: Fri, 07 Sep 2018 08:25:04 -0700 (PDT)	[thread overview]
Message-ID: <20180907.082504.1277807183056339898.davem@davemloft.net> (raw)
In-Reply-To: <9231D502B07C5E4A8B32D5115C9F19991EE57330@IRSMSX101.ger.corp.intel.com>

From: "Mehrtens, Hauke" <hauke.mehrtens@intel.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.

      reply	other threads:[~2018-09-07 20:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 15:10 for_each_netdev_feature() broken on big endian Mehrtens, Hauke
2018-09-07 15:25 ` David Miller [this message]

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=20180907.082504.1277807183056339898.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=hauke.mehrtens@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=thomas.langer@intel.com \
    --cc=zahari.doychev@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox