Hi Mathy, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on mac80211-next/master] [also build test WARNING on mac80211/master v5.8-rc3 next-20200629] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Mathy-Vanhoef/mac80211-keep-non-zero-sequence-counter-of-injected-frames/20200629-021517 base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master config: riscv-randconfig-r013-20200629 (attached as .config) compiler: riscv32-linux-gcc (GCC) 9.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> All warnings (new ones prefixed by >>): In file included from include/linux/kernel.h:11, from net/mac80211/tx.c:13: net/mac80211/tx.c: In function 'ieee80211_tx_h_sequence': net/mac80211/tx.c:817:21: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] 817 | (info->flags & IEEE80211_TX_CTL_INJECTED != 0 && | ^ include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var' 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | ^~~~ net/mac80211/tx.c:816:2: note: in expansion of macro 'if' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~ include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__' 48 | # define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x))) | ^~~~~~~~~~~~~~~~ >> net/mac80211/tx.c:816:6: note: in expansion of macro 'unlikely' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~~~~~~~ net/mac80211/tx.c:817:21: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] 817 | (info->flags & IEEE80211_TX_CTL_INJECTED != 0 && | ^ include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var' 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | ^~~~ net/mac80211/tx.c:816:2: note: in expansion of macro 'if' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~ include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__' 48 | # define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x))) | ^~~~~~~~~~~~~~~~ >> net/mac80211/tx.c:816:6: note: in expansion of macro 'unlikely' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~~~~~~~ net/mac80211/tx.c:817:21: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] 817 | (info->flags & IEEE80211_TX_CTL_INJECTED != 0 && | ^ include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var' 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | ^~~~ net/mac80211/tx.c:816:2: note: in expansion of macro 'if' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~ include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__' 48 | # define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x))) | ^~~~~~~~~~~~~~~~ >> net/mac80211/tx.c:816:6: note: in expansion of macro 'unlikely' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~~~~~~~ net/mac80211/tx.c:817:21: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] 817 | (info->flags & IEEE80211_TX_CTL_INJECTED != 0 && | ^ include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var' 58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond)) | ^~~~ net/mac80211/tx.c:816:2: note: in expansion of macro 'if' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~ include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__' 48 | # define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x))) | ^~~~~~~~~~~~~~~~ >> net/mac80211/tx.c:816:6: note: in expansion of macro 'unlikely' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~~~~~~~ net/mac80211/tx.c:817:21: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] 817 | (info->flags & IEEE80211_TX_CTL_INJECTED != 0 && | ^ include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value' 69 | (cond) ? \ | ^~~~ include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var' 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | ^~~~~~~~~~~~~~ net/mac80211/tx.c:816:2: note: in expansion of macro 'if' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~ include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__' 48 | # define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x))) | ^~~~~~~~~~~~~~~~ >> net/mac80211/tx.c:816:6: note: in expansion of macro 'unlikely' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~~~~~~~ net/mac80211/tx.c:817:21: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses] 817 | (info->flags & IEEE80211_TX_CTL_INJECTED != 0 && | ^ include/linux/compiler.h:69:3: note: in definition of macro '__trace_if_value' 69 | (cond) ? \ | ^~~~ include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var' 56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) ) | ^~~~~~~~~~~~~~ net/mac80211/tx.c:816:2: note: in expansion of macro 'if' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~ include/linux/compiler.h:48:24: note: in expansion of macro '__branch_check__' 48 | # define unlikely(x) (__branch_check__(x, 0, __builtin_constant_p(x))) | ^~~~~~~~~~~~~~~~ >> net/mac80211/tx.c:816:6: note: in expansion of macro 'unlikely' 816 | if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || | ^~~~~~~~ vim +/unlikely +816 net/mac80211/tx.c 802 803 static ieee80211_tx_result debug_noinline 804 ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) 805 { 806 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); 807 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; 808 int tid; 809 810 /* 811 * Packet injection may want to control the sequence number. 812 * Do not assign one ourselves, and do not ask the driver to, 813 * if there is no matching interface or if the injected frame 814 * was already assigned a non-zero sequence number. 815 */ > 816 if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR || 817 (info->flags & IEEE80211_TX_CTL_INJECTED != 0 && 818 hdr->seq_ctrl != 0))) 819 return TX_CONTINUE; 820 821 if (unlikely(ieee80211_is_ctl(hdr->frame_control))) 822 return TX_CONTINUE; 823 824 if (ieee80211_hdrlen(hdr->frame_control) < 24) 825 return TX_CONTINUE; 826 827 if (ieee80211_is_qos_nullfunc(hdr->frame_control)) 828 return TX_CONTINUE; 829 830 /* 831 * Anything but QoS data that has a sequence number field 832 * (is long enough) gets a sequence number from the global 833 * counter. QoS data frames with a multicast destination 834 * also use the global counter (802.11-2012 9.3.2.10). 835 */ 836 if (!ieee80211_is_data_qos(hdr->frame_control) || 837 is_multicast_ether_addr(hdr->addr1)) { 838 if (tx->flags & IEEE80211_TX_NO_SEQNO) 839 return TX_CONTINUE; 840 /* driver should assign sequence number */ 841 info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ; 842 /* for pure STA mode without beacons, we can do it */ 843 hdr->seq_ctrl = cpu_to_le16(tx->sdata->sequence_number); 844 tx->sdata->sequence_number += 0x10; 845 if (tx->sta) 846 tx->sta->tx_stats.msdu[IEEE80211_NUM_TIDS]++; 847 return TX_CONTINUE; 848 } 849 850 /* 851 * This should be true for injected/management frames only, for 852 * management frames we have set the IEEE80211_TX_CTL_ASSIGN_SEQ 853 * above since they are not QoS-data frames. 854 */ 855 if (!tx->sta) 856 return TX_CONTINUE; 857 858 /* include per-STA, per-TID sequence counter */ 859 tid = ieee80211_get_tid(hdr); 860 tx->sta->tx_stats.msdu[tid]++; 861 862 hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); 863 864 return TX_CONTINUE; 865 } 866 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip