From: Johannes Berg <johannes@sipsolutions.net>
To: kbuild test robot <lkp@intel.com>, Peng Xu <pxu@codeaurora.org>
Cc: kbuild-all@01.org, linux-wireless@vger.kernel.org,
Sara Sharon <sara.sharon@intel.com>,
Jouni Malinen <jouni@codeaurora.org>
Subject: Re: [mac80211-next:cfg80211-mac80211-multi-bssid 8/20] ERROR: "__umoddi3" [net/wireless/cfg80211.ko] undefined!
Date: Sat, 09 Feb 2019 09:08:20 +0100 [thread overview]
Message-ID: <9e586a147fa94995b06011d74ab6ee1a082f4b94.camel@sipsolutions.net> (raw)
In-Reply-To: <201902091559.zMnqaexs%fengguang.wu@intel.com> (sfid-20190209_084748_191360_57355899)
This should fix it, I think?
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b61b71f369c7..cb0c49b369c4 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5488,7 +5488,7 @@ static inline void cfg80211_gen_new_bssid(const u8 *bssid, u8 max_bssid,
lsb_n = bssid_tmp & ((1 << max_bssid) - 1);
new_bssid = bssid_tmp;
new_bssid &= ~((1 << max_bssid) - 1);
- new_bssid |= (lsb_n + mbssid_index) % (1 << max_bssid);
+ new_bssid |= (lsb_n + mbssid_index) & GENMASK_ULL(max_bssid - 1, 0);
u64_to_ether_addr(new_bssid, new_bssid_addr);
}
and we probably should write "(1 << max_bssid) - 1" the line above as
the same GENMASK_ULL():
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5482,13 +5482,14 @@ static inline void cfg80211_gen_new_bssid(const u8 *bssid, u8 max_bssid,
{
u64 bssid_tmp, new_bssid;
u64 lsb_n;
+ u64 mask = GENMASK_ULL(max_bssid - 1, 0);
bssid_tmp = ether_addr_to_u64(bssid);
- lsb_n = bssid_tmp & ((1 << max_bssid) - 1);
+ lsb_n = bssid_tmp & mask;
new_bssid = bssid_tmp;
- new_bssid &= ~((1 << max_bssid) - 1);
- new_bssid |= (lsb_n + mbssid_index) % (1 << max_bssid);
+ new_bssid &= ~mask;
+ new_bssid |= (lsb_n + mbssid_index) & mask;
u64_to_ether_addr(new_bssid, new_bssid_addr);
}
but maybe the whole thing is more readable as
static inline void cfg80211_gen_new_bssid(const u8 *bssid_addr, u8 max_bssid,
u8 mbssid_index, u8 *new_bssid_addr)
{
u64 bssid = ether_addr_to_u64(bssid_addr);
u64 mask = GENMASK_ULL(max_bssid - 1, 0);
u64 new_bssid;
new_bssid &= bssid & ~mask;
new_bssid |= ((bssid & mask) + mbssid_index) & mask;
u64_to_ether_addr(new_bssid, new_bssid_addr);
}
However, isn't it true that 0 <= mbssid_index < max_bssid? Then the
whole masking isn't really needed at all?
johannes
On Sat, 2019-02-09 at 15:47 +0800, kbuild test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git cfg80211-mac80211-multi-bssid
> head: 851ae31d34063deb1eae49f5d797a12a5557e832
> commit: 0b8fb8235be8be99a197e8d948fc0a2df8dc261a [8/20] cfg80211: Parsing of Multiple BSSID information in scanning
> config: i386-randconfig-x0-02091211 (attached as .config)
> compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
> reproduce:
> git checkout 0b8fb8235be8be99a197e8d948fc0a2df8dc261a
> # save the attached .config to linux build tree
> make ARCH=i386
>
> All errors (new ones prefixed by >>):
>
> > > ERROR: "__umoddi3" [net/wireless/cfg80211.ko] undefined!
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
next prev parent reply other threads:[~2019-02-09 8:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-09 7:47 [mac80211-next:cfg80211-mac80211-multi-bssid 8/20] ERROR: "__umoddi3" [net/wireless/cfg80211.ko] undefined! kbuild test robot
2019-02-09 8:08 ` Johannes Berg [this message]
2019-02-11 14:57 ` Jouni Malinen
2019-02-11 14:58 ` Johannes Berg
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=9e586a147fa94995b06011d74ab6ee1a082f4b94.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=jouni@codeaurora.org \
--cc=kbuild-all@01.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lkp@intel.com \
--cc=pxu@codeaurora.org \
--cc=sara.sharon@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;
as well as URLs for NNTP newsgroup(s).