Search Linux Wireless

Re: [RFC] mac80211: budget outstanding airtime for transmission

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

 



Rajkumar Manoharan <rmanohar@xxxxxxxxxxxxxx> writes:

>>> diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
>>> index b1b0fd6a2e21..ddc2c882c91c 100644
>>> --- a/net/mac80211/sta_info.h
>>> +++ b/net/mac80211/sta_info.h
>>> @@ -135,6 +135,7 @@ struct airtime_info {
>>>  	u64 rx_airtime;
>>>  	u64 tx_airtime;
>>>  	s64 deficit;
>>> +	s32 budget;
>>
>> Why signed? This should never become negative unless something is wrong
>> with the accounting somewhere?
>>
>> Related, are we sure there are no "leaks", i.e., packets that increase
>> the budget on dequeue, but are never tx_completed?
>
> Just to avoid wraparound issue. Yeah... Irrespective of signedness if
> there is mismatch in tx and tx-compl, it may stall tx. no? I was
> worrying what if the driver is freeing skb silently instead of
> free_txskb().
>
> Will change it to unsigned and add WARN_ON statement upon adjustment.
> is it OK?

Just note that WARN_ON() is pretty dangerous, especially on data path,
as it can kill the host with excessive spamming. WARN_ON_ONCE() or a
ratelimited printk() variant are much safer choises.

-- 
Kalle Valo



[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