2015-11-06 10:59:58

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] mac80211: remove string from unaligned packet warning

From: Johannes Berg <[email protected]>

This really should never happen except very early in the process
of bringing up a new driver, at which point you'll have to add
more debugging in the driver and this string isn't useful. Remove
it and save some size (when it's even compiled in.)

Signed-off-by: Johannes Berg <[email protected]>
---
net/mac80211/rx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 8bae5de0dc44..78346e89e997 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -661,8 +661,7 @@ static void ieee80211_parse_qos(struct ieee80211_rx_data *rx)
static void ieee80211_verify_alignment(struct ieee80211_rx_data *rx)
{
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
- WARN_ONCE((unsigned long)rx->skb->data & 1,
- "unaligned packet at 0x%p\n", rx->skb->data);
+ WARN_ONCE((unsigned long)rx->skb->data & 1);
#endif
}

--
2.6.2



2015-11-06 11:14:32

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] mac80211: remove string from unaligned packet warning

Hi Johannes,

[auto build test ERROR on mac80211/master]
[also build test ERROR on v4.3 next-20151106]

url: https://github.com/0day-ci/linux/commits/Johannes-Berg/mac80211-remove-string-from-unaligned-packet-warning/20151106-190240
base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git master
config: parisc-allyesconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=parisc

All errors (new ones prefixed by >>):

In file included from arch/parisc/include/asm/bug.h:92:0,
from include/linux/bug.h:4,
from include/linux/thread_info.h:11,
from include/asm-generic/preempt.h:4,
from arch/parisc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:59,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/linux/jiffies.h:7,
from net/mac80211/rx.c:13:
net/mac80211/rx.c: In function 'ieee80211_verify_alignment':
>> include/asm-generic/bug.h:79:36: error: too few arguments to function 'printk'
#define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0)
^
include/asm-generic/bug.h:97:3: note: in expansion of macro '__WARN_printf'
__WARN_printf(format); \
^
include/asm-generic/bug.h:124:7: note: in expansion of macro 'WARN'
if (WARN(!__warned, format)) \
^
net/mac80211/rx.c:664:2: note: in expansion of macro 'WARN_ONCE'
WARN_ONCE((unsigned long)rx->skb->data & 1);
^
In file included from include/linux/kernel.h:13:0,
from include/linux/jiffies.h:5,
from net/mac80211/rx.c:13:
include/linux/printk.h:142:5: note: declared here
int printk(const char *fmt, ...);
^

vim +/printk +79 include/asm-generic/bug.h

af9379c71 David Brownell 2009-01-06 63 */
b2be05273 Ben Hutchings 2010-04-03 64 #ifndef __WARN_TAINT
b9075fa96 Joe Perches 2011-10-31 65 extern __printf(3, 4)
b9075fa96 Joe Perches 2011-10-31 66 void warn_slowpath_fmt(const char *file, const int line,
b9075fa96 Joe Perches 2011-10-31 67 const char *fmt, ...);
b9075fa96 Joe Perches 2011-10-31 68 extern __printf(4, 5)
b9075fa96 Joe Perches 2011-10-31 69 void warn_slowpath_fmt_taint(const char *file, const int line, unsigned taint,
b9075fa96 Joe Perches 2011-10-31 70 const char *fmt, ...);
57adc4d2d Andi Kleen 2009-05-06 71 extern void warn_slowpath_null(const char *file, const int line);
79b4cc5ee Arjan van de Ven 2008-01-30 72 #define WANT_WARN_ON_SLOWPATH
57adc4d2d Andi Kleen 2009-05-06 73 #define __WARN() warn_slowpath_null(__FILE__, __LINE__)
57adc4d2d Andi Kleen 2009-05-06 74 #define __WARN_printf(arg...) warn_slowpath_fmt(__FILE__, __LINE__, arg)
b2be05273 Ben Hutchings 2010-04-03 75 #define __WARN_printf_taint(taint, arg...) \
b2be05273 Ben Hutchings 2010-04-03 76 warn_slowpath_fmt_taint(__FILE__, __LINE__, taint, arg)
a8f18b909 Arjan van de Ven 2008-07-25 77 #else
b2be05273 Ben Hutchings 2010-04-03 78 #define __WARN() __WARN_TAINT(TAINT_WARN)
f6f286f33 Arjan van de Ven 2008-10-20 @79 #define __WARN_printf(arg...) do { printk(arg); __WARN(); } while (0)
b2be05273 Ben Hutchings 2010-04-03 80 #define __WARN_printf_taint(taint, arg...) \
b2be05273 Ben Hutchings 2010-04-03 81 do { printk(arg); __WARN_TAINT(taint); } while (0)
3a6a62f96 Olof Johansson 2008-01-30 82 #endif
3a6a62f96 Olof Johansson 2008-01-30 83
3a6a62f96 Olof Johansson 2008-01-30 84 #ifndef WARN_ON
3a6a62f96 Olof Johansson 2008-01-30 85 #define WARN_ON(condition) ({ \
3a6a62f96 Olof Johansson 2008-01-30 86 int __ret_warn_on = !!(condition); \
3a6a62f96 Olof Johansson 2008-01-30 87 if (unlikely(__ret_warn_on)) \

:::::: The code at line 79 was first introduced by commit
:::::: f6f286f33e843862c559bfea9281318c4cdec6b0 fix WARN() for PPC

:::::: TO: Arjan van de Ven <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (4.51 kB)
.config.gz (41.52 kB)
Download all attachments

2015-11-06 11:11:01

by Felix Fietkau

[permalink] [raw]
Subject: Re: [PATCH] mac80211: remove string from unaligned packet warning

On 2015-11-06 11:59, Johannes Berg wrote:
> From: Johannes Berg <[email protected]>
>
> This really should never happen except very early in the process
> of bringing up a new driver, at which point you'll have to add
> more debugging in the driver and this string isn't useful. Remove
> it and save some size (when it's even compiled in.)
>
> Signed-off-by: Johannes Berg <[email protected]>
> ---
> net/mac80211/rx.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index 8bae5de0dc44..78346e89e997 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -661,8 +661,7 @@ static void ieee80211_parse_qos(struct ieee80211_rx_data *rx)
> static void ieee80211_verify_alignment(struct ieee80211_rx_data *rx)
> {
> #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
> - WARN_ONCE((unsigned long)rx->skb->data & 1,
> - "unaligned packet at 0x%p\n", rx->skb->data);
> + WARN_ONCE((unsigned long)rx->skb->data & 1);
Shouldn't this be WARN_ON_ONCE?

- Felix

2015-11-06 11:11:37

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] mac80211: remove string from unaligned packet warning

Hi Johannes,

[auto build test ERROR on mac80211/master]
[also build test ERROR on v4.3 next-20151106]

url: https://github.com/0day-ci/linux/commits/Johannes-Berg/mac80211-remove-string-from-unaligned-packet-warning/20151106-190240
base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git master
config: xtensa-allyesconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa

All error/warnings (new ones prefixed by >>):

In file included from arch/xtensa/include/generated/asm/bug.h:1:0,
from include/linux/bug.h:4,
from include/linux/thread_info.h:11,
from include/asm-generic/preempt.h:4,
from arch/xtensa/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:59,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/linux/jiffies.h:7,
from net/mac80211/rx.c:13:
net/mac80211/rx.c: In function 'ieee80211_verify_alignment':
>> include/asm-generic/bug.h:74:72: error: expected expression before ')' token
#define __WARN_printf(arg...) warn_slowpath_fmt(__FILE__, __LINE__, arg)
^
>> include/asm-generic/bug.h:97:3: note: in expansion of macro '__WARN_printf'
__WARN_printf(format); \
^
>> include/asm-generic/bug.h:124:7: note: in expansion of macro 'WARN'
if (WARN(!__warned, format)) \
^
>> net/mac80211/rx.c:664:2: note: in expansion of macro 'WARN_ONCE'
WARN_ONCE((unsigned long)rx->skb->data & 1);
^

vim +/WARN_ONCE +664 net/mac80211/rx.c

648 * architecture doesn't support efficient unaligned operations, mac80211
649 * will align the data.
650 *
651 * With A-MSDU frames, however, the payload data address must yield two modulo
652 * four because there are 14-byte 802.3 headers within the A-MSDU frames that
653 * push the IP header further back to a multiple of four again. Thankfully, the
654 * specs were sane enough this time around to require padding each A-MSDU
655 * subframe to a length that is a multiple of four.
656 *
657 * Padding like Atheros hardware adds which is between the 802.11 header and
658 * the payload is not supported, the driver is required to move the 802.11
659 * header to be directly in front of the payload in that case.
660 */
661 static void ieee80211_verify_alignment(struct ieee80211_rx_data *rx)
662 {
663 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
> 664 WARN_ONCE((unsigned long)rx->skb->data & 1);
665 #endif
666 }
667
668
669 /* rx handlers */
670
671 static int ieee80211_is_unicast_robust_mgmt_frame(struct sk_buff *skb)
672 {

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (3.19 kB)
.config.gz (41.55 kB)
Download all attachments

2015-11-06 11:12:47

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] mac80211: remove string from unaligned packet warning

Hi Johannes,

[auto build test ERROR on mac80211/master]
[also build test ERROR on v4.3 next-20151106]

url: https://github.com/0day-ci/linux/commits/Johannes-Berg/mac80211-remove-string-from-unaligned-packet-warning/20151106-190240
base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git master
config: tile-allyesconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=tile

All errors (new ones prefixed by >>):

net/mac80211/rx.c: In function 'ieee80211_verify_alignment':
>> net/mac80211/rx.c:664:2: error: expected expression before ')' token

vim +664 net/mac80211/rx.c

658 * the payload is not supported, the driver is required to move the 802.11
659 * header to be directly in front of the payload in that case.
660 */
661 static void ieee80211_verify_alignment(struct ieee80211_rx_data *rx)
662 {
663 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
> 664 WARN_ONCE((unsigned long)rx->skb->data & 1);
665 #endif
666 }
667

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (1.33 kB)
.config.gz (40.79 kB)
Download all attachments