Search Linux Wireless

Re: [PATCH v4 3/6] mac80211: Add airtime accounting and scheduling to TXQs

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

 



Hi Toke,

I love your patch! Perhaps something to improve:

[auto build test WARNING on mac80211/master]
[also build test WARNING on v4.20-rc7]
[cannot apply to next-20181218]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Rajkumar-Manoharan/Move-TXQ-scheduling-and-airtime-fairness-into-mac80211/20181219-080126
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git master
config: i386-randconfig-x001-201850 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/linux/bitops.h:5:0,
                    from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/module.h:9,
                    from net/mac80211/sta_info.c:13:
   net/mac80211/sta_info.c: In function 'sta_set_sinfo':
   include/linux/bits.h:6:24: warning: left shift count >= width of type [-Wshift-count-overflow]
    #define BIT(nr)   (1UL << (nr))
                           ^
>> net/mac80211/sta_info.c:2215:20: note: in expansion of macro 'BIT'
      sinfo->filled |= BIT(NL80211_STA_INFO_RX_DURATION);
                       ^~~
   include/linux/bits.h:6:24: warning: left shift count >= width of type [-Wshift-count-overflow]
    #define BIT(nr)   (1UL << (nr))
                           ^
   net/mac80211/sta_info.c:2221:20: note: in expansion of macro 'BIT'
      sinfo->filled |= BIT(NL80211_STA_INFO_TX_DURATION);
                       ^~~
   include/linux/bits.h:6:24: warning: left shift count >= width of type [-Wshift-count-overflow]
    #define BIT(nr)   (1UL << (nr))
                           ^
   net/mac80211/sta_info.c:2226:20: note: in expansion of macro 'BIT'
      sinfo->filled |= BIT(NL80211_STA_INFO_AIRTIME_WEIGHT);
                       ^~~

vim +/BIT +2215 net/mac80211/sta_info.c

  2120	
  2121	void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
  2122			   bool tidstats)
  2123	{
  2124		struct ieee80211_sub_if_data *sdata = sta->sdata;
  2125		struct ieee80211_local *local = sdata->local;
  2126		u32 thr = 0;
  2127		int i, ac, cpu;
  2128		struct ieee80211_sta_rx_stats *last_rxstats;
  2129	
  2130		last_rxstats = sta_get_last_rx_stats(sta);
  2131	
  2132		sinfo->generation = sdata->local->sta_generation;
  2133	
  2134		/* do before driver, so beacon filtering drivers have a
  2135		 * chance to e.g. just add the number of filtered beacons
  2136		 * (or just modify the value entirely, of course)
  2137		 */
  2138		if (sdata->vif.type == NL80211_IFTYPE_STATION)
  2139			sinfo->rx_beacon = sdata->u.mgd.count_beacon_signal;
  2140	
  2141		drv_sta_statistics(local, sdata, &sta->sta, sinfo);
  2142	
  2143		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_INACTIVE_TIME) |
  2144				 BIT_ULL(NL80211_STA_INFO_STA_FLAGS) |
  2145				 BIT_ULL(NL80211_STA_INFO_BSS_PARAM) |
  2146				 BIT_ULL(NL80211_STA_INFO_CONNECTED_TIME) |
  2147				 BIT_ULL(NL80211_STA_INFO_RX_DROP_MISC);
  2148	
  2149		if (sdata->vif.type == NL80211_IFTYPE_STATION) {
  2150			sinfo->beacon_loss_count = sdata->u.mgd.beacon_loss_count;
  2151			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_BEACON_LOSS);
  2152		}
  2153	
  2154		sinfo->connected_time = ktime_get_seconds() - sta->last_connected;
  2155		sinfo->inactive_time =
  2156			jiffies_to_msecs(jiffies - ieee80211_sta_last_active(sta));
  2157	
  2158		if (!(sinfo->filled & (BIT_ULL(NL80211_STA_INFO_TX_BYTES64) |
  2159				       BIT_ULL(NL80211_STA_INFO_TX_BYTES)))) {
  2160			sinfo->tx_bytes = 0;
  2161			for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
  2162				sinfo->tx_bytes += sta->tx_stats.bytes[ac];
  2163			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BYTES64);
  2164		}
  2165	
  2166		if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_TX_PACKETS))) {
  2167			sinfo->tx_packets = 0;
  2168			for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
  2169				sinfo->tx_packets += sta->tx_stats.packets[ac];
  2170			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_PACKETS);
  2171		}
  2172	
  2173		if (!(sinfo->filled & (BIT_ULL(NL80211_STA_INFO_RX_BYTES64) |
  2174				       BIT_ULL(NL80211_STA_INFO_RX_BYTES)))) {
  2175			sinfo->rx_bytes += sta_get_stats_bytes(&sta->rx_stats);
  2176	
  2177			if (sta->pcpu_rx_stats) {
  2178				for_each_possible_cpu(cpu) {
  2179					struct ieee80211_sta_rx_stats *cpurxs;
  2180	
  2181					cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu);
  2182					sinfo->rx_bytes += sta_get_stats_bytes(cpurxs);
  2183				}
  2184			}
  2185	
  2186			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_BYTES64);
  2187		}
  2188	
  2189		if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_RX_PACKETS))) {
  2190			sinfo->rx_packets = sta->rx_stats.packets;
  2191			if (sta->pcpu_rx_stats) {
  2192				for_each_possible_cpu(cpu) {
  2193					struct ieee80211_sta_rx_stats *cpurxs;
  2194	
  2195					cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu);
  2196					sinfo->rx_packets += cpurxs->packets;
  2197				}
  2198			}
  2199			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_PACKETS);
  2200		}
  2201	
  2202		if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_TX_RETRIES))) {
  2203			sinfo->tx_retries = sta->status_stats.retry_count;
  2204			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_RETRIES);
  2205		}
  2206	
  2207		if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_TX_FAILED))) {
  2208			sinfo->tx_failed = sta->status_stats.retry_failed;
  2209			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_FAILED);
  2210		}
  2211	
  2212		if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_RX_DURATION))) {
  2213			for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
  2214				sinfo->rx_duration += sta->airtime[ac].rx_airtime;
> 2215			sinfo->filled |= BIT(NL80211_STA_INFO_RX_DURATION);
  2216		}
  2217	
  2218		if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_TX_DURATION))) {
  2219			for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
  2220				sinfo->tx_duration += sta->airtime[ac].tx_airtime;
  2221			sinfo->filled |= BIT(NL80211_STA_INFO_TX_DURATION);
  2222		}
  2223	
  2224		if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_AIRTIME_WEIGHT))) {
  2225			sinfo->airtime_weight = sta->airtime_weight;
  2226			sinfo->filled |= BIT(NL80211_STA_INFO_AIRTIME_WEIGHT);
  2227		}
  2228	
  2229		sinfo->rx_dropped_misc = sta->rx_stats.dropped;
  2230		if (sta->pcpu_rx_stats) {
  2231			for_each_possible_cpu(cpu) {
  2232				struct ieee80211_sta_rx_stats *cpurxs;
  2233	
  2234				cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu);
  2235				sinfo->rx_dropped_misc += cpurxs->dropped;
  2236			}
  2237		}
  2238	
  2239		if (sdata->vif.type == NL80211_IFTYPE_STATION &&
  2240		    !(sdata->vif.driver_flags & IEEE80211_VIF_BEACON_FILTER)) {
  2241			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_BEACON_RX) |
  2242					 BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG);
  2243			sinfo->rx_beacon_signal_avg = ieee80211_ave_rssi(&sdata->vif);
  2244		}
  2245	
  2246		if (ieee80211_hw_check(&sta->local->hw, SIGNAL_DBM) ||
  2247		    ieee80211_hw_check(&sta->local->hw, SIGNAL_UNSPEC)) {
  2248			if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_SIGNAL))) {
  2249				sinfo->signal = (s8)last_rxstats->last_signal;
  2250				sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL);
  2251			}
  2252	
  2253			if (!sta->pcpu_rx_stats &&
  2254			    !(sinfo->filled & BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG))) {
  2255				sinfo->signal_avg =
  2256					-ewma_signal_read(&sta->rx_stats_avg.signal);
  2257				sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG);
  2258			}
  2259		}
  2260	
  2261		/* for the average - if pcpu_rx_stats isn't set - rxstats must point to
  2262		 * the sta->rx_stats struct, so the check here is fine with and without
  2263		 * pcpu statistics
  2264		 */
  2265		if (last_rxstats->chains &&
  2266		    !(sinfo->filled & (BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL) |
  2267				       BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL_AVG)))) {
  2268			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL);
  2269			if (!sta->pcpu_rx_stats)
  2270				sinfo->filled |= BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL_AVG);
  2271	
  2272			sinfo->chains = last_rxstats->chains;
  2273	
  2274			for (i = 0; i < ARRAY_SIZE(sinfo->chain_signal); i++) {
  2275				sinfo->chain_signal[i] =
  2276					last_rxstats->chain_signal_last[i];
  2277				sinfo->chain_signal_avg[i] =
  2278					-ewma_signal_read(&sta->rx_stats_avg.chain_signal[i]);
  2279			}
  2280		}
  2281	
  2282		if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_TX_BITRATE))) {
  2283			sta_set_rate_info_tx(sta, &sta->tx_stats.last_rate,
  2284					     &sinfo->txrate);
  2285			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
  2286		}
  2287	
  2288		if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_RX_BITRATE))) {
  2289			if (sta_set_rate_info_rx(sta, &sinfo->rxrate) == 0)
  2290				sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_BITRATE);
  2291		}
  2292	
  2293		if (tidstats && !cfg80211_sinfo_alloc_tid_stats(sinfo, GFP_KERNEL)) {
  2294			for (i = 0; i < IEEE80211_NUM_TIDS + 1; i++) {
  2295				struct cfg80211_tid_stats *tidstats = &sinfo->pertid[i];
  2296	
  2297				sta_set_tidstats(sta, tidstats, i);
  2298			}
  2299		}
  2300	
  2301		if (ieee80211_vif_is_mesh(&sdata->vif)) {
  2302	#ifdef CONFIG_MAC80211_MESH
  2303			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_LLID) |
  2304					 BIT_ULL(NL80211_STA_INFO_PLID) |
  2305					 BIT_ULL(NL80211_STA_INFO_PLINK_STATE) |
  2306					 BIT_ULL(NL80211_STA_INFO_LOCAL_PM) |
  2307					 BIT_ULL(NL80211_STA_INFO_PEER_PM) |
  2308					 BIT_ULL(NL80211_STA_INFO_NONPEER_PM);
  2309	
  2310			sinfo->llid = sta->mesh->llid;
  2311			sinfo->plid = sta->mesh->plid;
  2312			sinfo->plink_state = sta->mesh->plink_state;
  2313			if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) {
  2314				sinfo->filled |= BIT_ULL(NL80211_STA_INFO_T_OFFSET);
  2315				sinfo->t_offset = sta->mesh->t_offset;
  2316			}
  2317			sinfo->local_pm = sta->mesh->local_pm;
  2318			sinfo->peer_pm = sta->mesh->peer_pm;
  2319			sinfo->nonpeer_pm = sta->mesh->nonpeer_pm;
  2320	#endif
  2321		}
  2322	
  2323		sinfo->bss_param.flags = 0;
  2324		if (sdata->vif.bss_conf.use_cts_prot)
  2325			sinfo->bss_param.flags |= BSS_PARAM_FLAGS_CTS_PROT;
  2326		if (sdata->vif.bss_conf.use_short_preamble)
  2327			sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE;
  2328		if (sdata->vif.bss_conf.use_short_slot)
  2329			sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME;
  2330		sinfo->bss_param.dtim_period = sdata->vif.bss_conf.dtim_period;
  2331		sinfo->bss_param.beacon_interval = sdata->vif.bss_conf.beacon_int;
  2332	
  2333		sinfo->sta_flags.set = 0;
  2334		sinfo->sta_flags.mask = BIT(NL80211_STA_FLAG_AUTHORIZED) |
  2335					BIT(NL80211_STA_FLAG_SHORT_PREAMBLE) |
  2336					BIT(NL80211_STA_FLAG_WME) |
  2337					BIT(NL80211_STA_FLAG_MFP) |
  2338					BIT(NL80211_STA_FLAG_AUTHENTICATED) |
  2339					BIT(NL80211_STA_FLAG_ASSOCIATED) |
  2340					BIT(NL80211_STA_FLAG_TDLS_PEER);
  2341		if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
  2342			sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHORIZED);
  2343		if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE))
  2344			sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_SHORT_PREAMBLE);
  2345		if (sta->sta.wme)
  2346			sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_WME);
  2347		if (test_sta_flag(sta, WLAN_STA_MFP))
  2348			sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_MFP);
  2349		if (test_sta_flag(sta, WLAN_STA_AUTH))
  2350			sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHENTICATED);
  2351		if (test_sta_flag(sta, WLAN_STA_ASSOC))
  2352			sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_ASSOCIATED);
  2353		if (test_sta_flag(sta, WLAN_STA_TDLS_PEER))
  2354			sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_TDLS_PEER);
  2355	
  2356		thr = sta_get_expected_throughput(sta);
  2357	
  2358		if (thr != 0) {
  2359			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_EXPECTED_THROUGHPUT);
  2360			sinfo->expected_throughput = thr;
  2361		}
  2362	
  2363		if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL)) &&
  2364		    sta->status_stats.ack_signal_filled) {
  2365			sinfo->ack_signal = sta->status_stats.last_ack_signal;
  2366			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL);
  2367		}
  2368	
  2369		if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL_AVG)) &&
  2370		    sta->status_stats.ack_signal_filled) {
  2371			sinfo->avg_ack_signal =
  2372				-(s8)ewma_avg_signal_read(
  2373					&sta->status_stats.avg_ack_signal);
  2374			sinfo->filled |=
  2375				BIT_ULL(NL80211_STA_INFO_ACK_SIGNAL_AVG);
  2376		}
  2377	}
  2378	

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

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