Search Linux Wireless

Re: [PATCH] mac80211: keep non-zero sequence counter of injected frames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project a28d38a6bca1726d56c9b373f4c7dc5264fc7716)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> net/mac80211/tx.c:817:21: warning: & has lower precedence than !=; != will be evaluated first [-Wparentheses]
                        (info->flags & IEEE80211_TX_CTL_INJECTED != 0 &&
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/mac80211/tx.c:817:21: note: place parentheses around the '!=' expression to silence this warning
                        (info->flags & IEEE80211_TX_CTL_INJECTED != 0 &&
                                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   net/mac80211/tx.c:817:21: note: place parentheses around the & expression to evaluate it first
                        (info->flags & IEEE80211_TX_CTL_INJECTED != 0 &&
                         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   1 warning generated.

vim +817 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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux