Historic archive of defunct list bloat-devel@lists.bufferbloat.net
 help / color / mirror / Atom feed
* Get hardware queue length for wireless interface in linux kernel
@ 2017-05-15 15:40 Mohan, Nitinder
  2017-05-15 17:55 ` [Make-wifi-fast] " Toke Høiland-Jørgensen
  0 siblings, 1 reply; 5+ messages in thread
From: Mohan, Nitinder @ 2017-05-15 15:40 UTC (permalink / raw)
  To: make-wifi-fast, bloat-devel

[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]

Hi,


I am a Ph.D. student working on a bufferbloat resistant scheduler for Multi-Path TCP. I was unsure of which list my question would be more suitable in so I am sending this in both make-wifi-fast and bloat-dev list.


While implementing the scheduler in linux kernel, I was unable to get the current number of bytes in hardware queue for wlan interface. As currently, linux does not employ BQL for wifi devices, I could not get this value from dql->num_queued defined in dynamic_queue_limits.h. I also tried to get queue length from Queueing discipline structure i.e. qdisc->qstats.qlen defined in sch_generic.h yet it still gives me a zero value (I am getting zero values for other parameters in qstat as well so I am sure it is not because the queue length never becomes more than 0).


If you have any idea for getting queue length for wireless interfaces, please do reply. Any help would be highly appreciated.


Best Regards


Nitinder Mohan

Ph.D. student

Department of Computer Science

University of Helsinki

www.cs.helsinki.fi/~nmohan/<http://www.cs.helsinki.fi/u/nmohan/>

[-- Attachment #2: Type: text/html, Size: 2126 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Make-wifi-fast] Get hardware queue length for wireless interface in linux kernel
  2017-05-15 15:40 Get hardware queue length for wireless interface in linux kernel Mohan, Nitinder
@ 2017-05-15 17:55 ` Toke Høiland-Jørgensen
  2017-05-16  9:33   ` Mohan, Nitinder
  0 siblings, 1 reply; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2017-05-15 17:55 UTC (permalink / raw)
  To: Mohan, Nitinder; +Cc: make-wifi-fast, bloat-devel

"Mohan, Nitinder" <nitinder.mohan@helsinki.fi> writes:

> Hi,
>
> I am a Ph.D. student working on a bufferbloat resistant scheduler for
> Multi-Path TCP. I was unsure of which list my question would be more
> suitable in so I am sending this in both make-wifi-fast and bloat-dev
> list.

Sounds interesting! What, exactly, is such a scheduler going to be
doing? :)

> While implementing the scheduler in linux kernel, I was unable to get
> the current number of bytes in hardware queue for wlan interface. As
> currently, linux does not employ BQL for wifi devices, I could not get
> this value from dql->num_queued defined in dynamic_queue_limits.h. I
> also tried to get queue length from Queueing discipline structure i.e.
> qdisc->qstats.qlen defined in sch_generic.h yet it still gives me a
> zero value (I am getting zero values for other parameters in qstat as
> well so I am sure it is not because the queue length never becomes
> more than 0).
>
> If you have any idea for getting queue length for wireless interfaces,
> please do reply. Any help would be highly appreciated.

There's no general interface to get the queue length for WiFi
interfaces. If you're using a driver that is using the mac80211
intermediate queues (i.e., ath9k, ath10k or mt76), there are
fq->backlock and fq->memory_usage which live inside the struct fq in
struct ieee80211_local. However, these are private state vars inside
mac80211, so not immediately accessible from other parts of the kernel.
You could add an access function to mac80211, though.

Other drivers will have their own queueing implementations, that you
probably can't get at. Some devices will even have most of their
queueing in firmware.

-Toke

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Make-wifi-fast] Get hardware queue length for wireless interface in linux kernel
  2017-05-15 17:55 ` [Make-wifi-fast] " Toke Høiland-Jørgensen
@ 2017-05-16  9:33   ` Mohan, Nitinder
  2017-05-16 10:17     ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 5+ messages in thread
From: Mohan, Nitinder @ 2017-05-16  9:33 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen; +Cc: make-wifi-fast, bloat-devel

[-- Attachment #1: Type: text/plain, Size: 2485 bytes --]

Hi Toke,


Thank you for your quick reply.


"Mohan, Nitinder" <nitinder.mohan@helsinki.fi> writes:

> Hi,
>
> I am a Ph.D. student working on a bufferbloat resistant scheduler for
> Multi-Path TCP. I was unsure of which list my question would be more
> suitable in so I am sending this in both make-wifi-fast and bloat-dev
> list.

Sounds interesting! What, exactly, is such a scheduler going to be
doing? :)

The MPTCP scheduler takes into account lower layer buffer levels and schedules traffic over the interface to avoid HW bufferbloat. The simulation testing gave us quite good results. Now we wanted to implement the algorithm on linux kernel to evaluate our approach. As I am not very well-versed with linux kernel, I was having some problems implementing this.

> While implementing the scheduler in linux kernel, I was unable to get
> the current number of bytes in hardware queue for wlan interface. As
> currently, linux does not employ BQL for wifi devices, I could not get
> this value from dql->num_queued defined in dynamic_queue_limits.h. I
> also tried to get queue length from Queueing discipline structure i.e.
> qdisc->qstats.qlen defined in sch_generic.h yet it still gives me a
> zero value (I am getting zero values for other parameters in qstat as
> well so I am sure it is not because the queue length never becomes
> more than 0).
>
> If you have any idea for getting queue length for wireless interfaces,
> please do reply. Any help would be highly appreciated.

There's no general interface to get the queue length for WiFi
interfaces. If you're using a driver that is using the mac80211
intermediate queues (i.e., ath9k, ath10k or mt76), there are
fq->backlock and fq->memory_usage which live inside the struct fq in
struct ieee80211_local. However, these are private state vars inside
mac80211, so not immediately accessible from other parts of the kernel.
You could add an access function to mac80211, though.

I am using ath9k drivers so fq->backlog would work well for me. I was giving the mac80211 structure a look but cant seem to figure out an access point to it (say from netdevice.h). Do you have an idea of how to retrieve a struct in mac80211 that could point me to struct fq?

Other drivers will have their own queueing implementations, that you
probably can't get at. Some devices will even have most of their
queueing in firmware.

-Toke

Thank you for your help.

Best,

Nitinder Mohan

[-- Attachment #2: Type: text/html, Size: 7874 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Make-wifi-fast] Get hardware queue length for wireless interface in linux kernel
  2017-05-16  9:33   ` Mohan, Nitinder
@ 2017-05-16 10:17     ` Toke Høiland-Jørgensen
  2017-05-16 10:45       ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2017-05-16 10:17 UTC (permalink / raw)
  To: Mohan, Nitinder; +Cc: make-wifi-fast, bloat-devel

"Mohan, Nitinder" <nitinder.mohan@helsinki.fi> writes:

> Hi Toke,
>
> Thank you for your quick reply.
>
> "Mohan, Nitinder" <nitinder.mohan@helsinki.fi> writes:
>
>>> Hi,
>>>
>>> I am a Ph.D. student working on a bufferbloat resistant scheduler for
>>> Multi-Path TCP. I was unsure of which list my question would be more
>>> suitable in so I am sending this in both make-wifi-fast and bloat-dev
>>> list.
>>
>> Sounds interesting! What, exactly, is such a scheduler going to be
>> doing? :)
>>
> The MPTCP scheduler takes into account lower layer buffer levels and
> schedules traffic over the interface to avoid HW bufferbloat.

Right. So how does this differ from using a low-prio CC (like LEDBAT) on
each of the MPTCP subflows? (If that makes sense; my knowledge of MPTCP
is somewhat limited).

>>> While implementing the scheduler in linux kernel, I was unable to get
>>> the current number of bytes in hardware queue for wlan interface. As
>>> currently, linux does not employ BQL for wifi devices, I could not get
>>> this value from dql->num_queued defined in dynamic_queue_limits.h. I
>>> also tried to get queue length from Queueing discipline structure i.e.
>>> qdisc->qstats.qlen defined in sch_generic.h yet it still gives me a
>>> zero value (I am getting zero values for other parameters in qstat as
>>> well so I am sure it is not because the queue length never becomes
>>> more than 0).
>>>
>>> If you have any idea for getting queue length for wireless interfaces,
>>> please do reply. Any help would be highly appreciated.
>>
>> There's no general interface to get the queue length for WiFi
>> interfaces. If you're using a driver that is using the mac80211
>> intermediate queues (i.e., ath9k, ath10k or mt76), there are
>> fq->backlock and fq->memory_usage which live inside the struct fq in
>> struct ieee80211_local. However, these are private state vars inside
>> mac80211, so not immediately accessible from other parts of the kernel.
>> You could add an access function to mac80211, though.
>
> I am using ath9k drivers so fq->backlog would work well for me. I was
> giving the mac80211 structure a look but cant seem to figure out an
> access point to it (say from netdevice.h). Do you have an idea of how
> to retrieve a struct in mac80211 that could point me to struct fq?

Yeah, that's what I meant with it being a private variable. What you can
do is add an accessor function somewhere in mac80211, which would take a
struct net_device and return the queue backlog.

Something like

u32 mac80211_get_backlog(struct net_device *dev)
{
	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        return local->fq->backlog;
}

> Thank you for your help.

You're welcome :)

-Toke

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Make-wifi-fast] Get hardware queue length for wireless interface in linux kernel
  2017-05-16 10:17     ` Toke Høiland-Jørgensen
@ 2017-05-16 10:45       ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2017-05-16 10:45 UTC (permalink / raw)
  To: Mohan, Nitinder; +Cc: make-wifi-fast, bloat-devel

Toke Høiland-Jørgensen <toke@toke.dk> writes:

> Something like
>
> u32 mac80211_get_backlog(struct net_device *dev)
> {
> 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
>         return local->fq->backlog;
> }

Oh, except that you'll probably need to lock the fq struct while you're
accessing the backlog value... :)

-Toke

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-05-16 10:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15 15:40 Get hardware queue length for wireless interface in linux kernel Mohan, Nitinder
2017-05-15 17:55 ` [Make-wifi-fast] " Toke Høiland-Jørgensen
2017-05-16  9:33   ` Mohan, Nitinder
2017-05-16 10:17     ` Toke Høiland-Jørgensen
2017-05-16 10:45       ` Toke Høiland-Jørgensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox