Search Linux Wireless

Re: [PATCH mac80211-next v6] mac80211: Switch to a virtual time-based airtime scheduler

[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-next/master]

url:    https://github.com/0day-ci/linux/commits/Toke-H-iland-J-rgensen/mac80211-Switch-to-a-virtual-time-based-airtime-scheduler/20210319-053617
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-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
        # https://github.com/0day-ci/linux/commit/23d429aa540736e04237eb11c63c03d929653774
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Toke-H-iland-J-rgensen/mac80211-Switch-to-a-virtual-time-based-airtime-scheduler/20210319-053617
        git checkout 23d429aa540736e04237eb11c63c03d929653774
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa 

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/cfg.c: In function 'sta_apply_parameters':
>> net/mac80211/cfg.c:1452:26: warning: variable 'old_weight' set but not used [-Wunused-but-set-variable]
    1452 |  u32 mask, set, tid, ac, old_weight;
         |                          ^~~~~~~~~~


vim +/old_weight +1452 net/mac80211/cfg.c

  1444	
  1445	static int sta_apply_parameters(struct ieee80211_local *local,
  1446					struct sta_info *sta,
  1447					struct station_parameters *params)
  1448	{
  1449		int ret = 0;
  1450		struct ieee80211_supported_band *sband;
  1451		struct ieee80211_sub_if_data *sdata = sta->sdata;
> 1452		u32 mask, set, tid, ac, old_weight;
  1453		struct txq_info *txqi;
  1454	
  1455		sband = ieee80211_get_sband(sdata);
  1456		if (!sband)
  1457			return -EINVAL;
  1458	
  1459		mask = params->sta_flags_mask;
  1460		set = params->sta_flags_set;
  1461	
  1462		if (ieee80211_vif_is_mesh(&sdata->vif)) {
  1463			/*
  1464			 * In mesh mode, ASSOCIATED isn't part of the nl80211
  1465			 * API but must follow AUTHENTICATED for driver state.
  1466			 */
  1467			if (mask & BIT(NL80211_STA_FLAG_AUTHENTICATED))
  1468				mask |= BIT(NL80211_STA_FLAG_ASSOCIATED);
  1469			if (set & BIT(NL80211_STA_FLAG_AUTHENTICATED))
  1470				set |= BIT(NL80211_STA_FLAG_ASSOCIATED);
  1471		} else if (test_sta_flag(sta, WLAN_STA_TDLS_PEER)) {
  1472			/*
  1473			 * TDLS -- everything follows authorized, but
  1474			 * only becoming authorized is possible, not
  1475			 * going back
  1476			 */
  1477			if (set & BIT(NL80211_STA_FLAG_AUTHORIZED)) {
  1478				set |= BIT(NL80211_STA_FLAG_AUTHENTICATED) |
  1479				       BIT(NL80211_STA_FLAG_ASSOCIATED);
  1480				mask |= BIT(NL80211_STA_FLAG_AUTHENTICATED) |
  1481					BIT(NL80211_STA_FLAG_ASSOCIATED);
  1482			}
  1483		}
  1484	
  1485		if (mask & BIT(NL80211_STA_FLAG_WME) &&
  1486		    local->hw.queues >= IEEE80211_NUM_ACS)
  1487			sta->sta.wme = set & BIT(NL80211_STA_FLAG_WME);
  1488	
  1489		/* auth flags will be set later for TDLS,
  1490		 * and for unassociated stations that move to assocaited */
  1491		if (!test_sta_flag(sta, WLAN_STA_TDLS_PEER) &&
  1492		    !((mask & BIT(NL80211_STA_FLAG_ASSOCIATED)) &&
  1493		      (set & BIT(NL80211_STA_FLAG_ASSOCIATED)))) {
  1494			ret = sta_apply_auth_flags(local, sta, mask, set);
  1495			if (ret)
  1496				return ret;
  1497		}
  1498	
  1499		if (mask & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE)) {
  1500			if (set & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE))
  1501				set_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE);
  1502			else
  1503				clear_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE);
  1504		}
  1505	
  1506		if (mask & BIT(NL80211_STA_FLAG_MFP)) {
  1507			sta->sta.mfp = !!(set & BIT(NL80211_STA_FLAG_MFP));
  1508			if (set & BIT(NL80211_STA_FLAG_MFP))
  1509				set_sta_flag(sta, WLAN_STA_MFP);
  1510			else
  1511				clear_sta_flag(sta, WLAN_STA_MFP);
  1512		}
  1513	
  1514		if (mask & BIT(NL80211_STA_FLAG_TDLS_PEER)) {
  1515			if (set & BIT(NL80211_STA_FLAG_TDLS_PEER))
  1516				set_sta_flag(sta, WLAN_STA_TDLS_PEER);
  1517			else
  1518				clear_sta_flag(sta, WLAN_STA_TDLS_PEER);
  1519		}
  1520	
  1521		/* mark TDLS channel switch support, if the AP allows it */
  1522		if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) &&
  1523		    !sdata->u.mgd.tdls_chan_switch_prohibited &&
  1524		    params->ext_capab_len >= 4 &&
  1525		    params->ext_capab[3] & WLAN_EXT_CAPA4_TDLS_CHAN_SWITCH)
  1526			set_sta_flag(sta, WLAN_STA_TDLS_CHAN_SWITCH);
  1527	
  1528		if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) &&
  1529		    !sdata->u.mgd.tdls_wider_bw_prohibited &&
  1530		    ieee80211_hw_check(&local->hw, TDLS_WIDER_BW) &&
  1531		    params->ext_capab_len >= 8 &&
  1532		    params->ext_capab[7] & WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED)
  1533			set_sta_flag(sta, WLAN_STA_TDLS_WIDER_BW);
  1534	
  1535		if (params->sta_modify_mask & STATION_PARAM_APPLY_UAPSD) {
  1536			sta->sta.uapsd_queues = params->uapsd_queues;
  1537			sta->sta.max_sp = params->max_sp;
  1538		}
  1539	
  1540		/* The sender might not have sent the last bit, consider it to be 0 */
  1541		if (params->ext_capab_len >= 8) {
  1542			u8 val = (params->ext_capab[7] &
  1543				  WLAN_EXT_CAPA8_MAX_MSDU_IN_AMSDU_LSB) >> 7;
  1544	
  1545			/* we did get all the bits, take the MSB as well */
  1546			if (params->ext_capab_len >= 9) {
  1547				u8 val_msb = params->ext_capab[8] &
  1548					WLAN_EXT_CAPA9_MAX_MSDU_IN_AMSDU_MSB;
  1549				val_msb <<= 1;
  1550				val |= val_msb;
  1551			}
  1552	
  1553			switch (val) {
  1554			case 1:
  1555				sta->sta.max_amsdu_subframes = 32;
  1556				break;
  1557			case 2:
  1558				sta->sta.max_amsdu_subframes = 16;
  1559				break;
  1560			case 3:
  1561				sta->sta.max_amsdu_subframes = 8;
  1562				break;
  1563			default:
  1564				sta->sta.max_amsdu_subframes = 0;
  1565			}
  1566		}
  1567	
  1568		/*
  1569		 * cfg80211 validates this (1-2007) and allows setting the AID
  1570		 * only when creating a new station entry
  1571		 */
  1572		if (params->aid)
  1573			sta->sta.aid = params->aid;
  1574	
  1575		/*
  1576		 * Some of the following updates would be racy if called on an
  1577		 * existing station, via ieee80211_change_station(). However,
  1578		 * all such changes are rejected by cfg80211 except for updates
  1579		 * changing the supported rates on an existing but not yet used
  1580		 * TDLS peer.
  1581		 */
  1582	
  1583		if (params->listen_interval >= 0)
  1584			sta->listen_interval = params->listen_interval;
  1585	
  1586		if (params->sta_modify_mask & STATION_PARAM_APPLY_STA_TXPOWER) {
  1587			sta->sta.txpwr.type = params->txpwr.type;
  1588			if (params->txpwr.type == NL80211_TX_POWER_LIMITED)
  1589				sta->sta.txpwr.power = params->txpwr.power;
  1590			ret = drv_sta_set_txpwr(local, sdata, sta);
  1591			if (ret)
  1592				return ret;
  1593		}
  1594	
  1595		if (params->supported_rates && params->supported_rates_len) {
  1596			ieee80211_parse_bitrates(&sdata->vif.bss_conf.chandef,
  1597						 sband, params->supported_rates,
  1598						 params->supported_rates_len,
  1599						 &sta->sta.supp_rates[sband->band]);
  1600		}
  1601	
  1602		if (params->ht_capa)
  1603			ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
  1604							  params->ht_capa, sta);
  1605	
  1606		/* VHT can override some HT caps such as the A-MSDU max length */
  1607		if (params->vht_capa)
  1608			ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband,
  1609							    params->vht_capa, sta);
  1610	
  1611		if (params->he_capa)
  1612			ieee80211_he_cap_ie_to_sta_he_cap(sdata, sband,
  1613							  (void *)params->he_capa,
  1614							  params->he_capa_len,
  1615							  (void *)params->he_6ghz_capa,
  1616							  sta);
  1617	
  1618		if (params->opmode_notif_used) {
  1619			/* returned value is only needed for rc update, but the
  1620			 * rc isn't initialized here yet, so ignore it
  1621			 */
  1622			__ieee80211_vht_handle_opmode(sdata, sta, params->opmode_notif,
  1623						      sband->band);
  1624		}
  1625	
  1626		if (params->support_p2p_ps >= 0)
  1627			sta->sta.support_p2p_ps = params->support_p2p_ps;
  1628	
  1629		if (ieee80211_vif_is_mesh(&sdata->vif))
  1630			sta_apply_mesh_params(local, sta, params);
  1631	
  1632		if (params->airtime_weight) {
  1633			for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
  1634				struct airtime_sched_info *air_sched = &local->airtime[ac];
  1635				struct airtime_info *air_info = &sta->airtime[ac];
  1636	
  1637				spin_lock_bh(&air_sched->lock);
  1638				for (tid = 0; tid < IEEE80211_NUM_TIDS + 1; tid++) {
  1639					if (air_info->weight == params->airtime_weight ||
  1640					    !sta->sta.txq[tid] ||
  1641					    ac != ieee80211_ac_from_tid(tid))
  1642						continue;
  1643	
  1644					old_weight = air_info->weight;
  1645					airtime_weight_set(air_info, params->airtime_weight);
  1646	
  1647					txqi = to_txq_info(sta->sta.txq[tid]);
  1648					if (RB_EMPTY_NODE(&txqi->schedule_order))
  1649						continue;
  1650	
  1651					ieee80211_update_airtime_weight(local, air_sched, 0, true);
  1652				}
  1653				spin_unlock_bh(&air_sched->lock);
  1654			}
  1655		}
  1656	
  1657		/* set the STA state after all sta info from usermode has been set */
  1658		if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) ||
  1659		    set & BIT(NL80211_STA_FLAG_ASSOCIATED)) {
  1660			ret = sta_apply_auth_flags(local, sta, mask, set);
  1661			if (ret)
  1662				return ret;
  1663		}
  1664	
  1665		return 0;
  1666	}
  1667	

---
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