From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40091.outbound.protection.outlook.com [40.107.4.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 454933B2A4; Tue, 16 May 2017 05:33:15 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=HelsinkiFI.onmicrosoft.com; s=selector1-helsinki-fi; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7AI5YZ8MPFyxDeqe6hoFJ5pY9uWUEBoTgyuFRsh2EXg=; b=YZCVtHeAn6EIrvYZm2jl003+YqMo0Mq4vtBZQoWjIH0lBFxNv3YWlShFEzKT37kKezsW5QsUvwzqPvlyCXtDuyiURKIIKSQSA0MihdXbCDbj7k1ZdrQLrEXvPzzeHwzAF6AygRYCak6vNT/ZDiWkqCnvG+hH7p3ABbyh0PyWMCo= Received: from AM3PR07MB0661.eurprd07.prod.outlook.com (10.160.4.23) by AM3PR07MB0664.eurprd07.prod.outlook.com (10.160.4.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.8; Tue, 16 May 2017 09:33:13 +0000 Received: from AM3PR07MB0661.eurprd07.prod.outlook.com ([fe80::a972:4988:e471:1cbe]) by AM3PR07MB0661.eurprd07.prod.outlook.com ([fe80::a972:4988:e471:1cbe%15]) with mapi id 15.01.1101.011; Tue, 16 May 2017 09:33:13 +0000 From: "Mohan, Nitinder" To: =?iso-8859-1?Q?Toke_H=F8iland-J=F8rgensen?= CC: "make-wifi-fast@lists.bufferbloat.net" , "bloat-devel@lists.bufferbloat.net" Thread-Topic: [Make-wifi-fast] Get hardware queue length for wireless interface in linux kernel Thread-Index: AQHSzY/TGsFMYT7GD0y1ncDCMEgZzKH1rcA7gAEBTHs= Date: Tue, 16 May 2017 09:33:13 +0000 Message-ID: References: , <87r2zq3szr.fsf@alrua-x1> In-Reply-To: <87r2zq3szr.fsf@alrua-x1> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: lists.bufferbloat.net; dkim=none (message not signed) header.d=none; lists.bufferbloat.net; dmarc=none action=none header.from=helsinki.fi; x-originating-ip: [25.161.122.132] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM3PR07MB0664; 7:y1awEHaYYsZaR7lXJ74dh8LIWEUobVs2X/ZIwUFfGjFggiXSxez53gMSQF1Ptc3iRXm8/W+reFz18aqwObQ19P/TVifSKMCDYGrhMtSc0A/LqP6jB2P0VEe+jCwTvr+N8yks0q3l5HAiK9rpMq75k4aVibnpHPWWYMY0RPxNbByrDApEnrTKem1CRizXC0bnh7tymdu8TjW3SlnxCQ2F6F7+QUQciU/KqsT6EcWA5B7f4SRiJb8OG+6IjucjSbPwN5j94amiDeKIdbCQT0VBkX+GccN33EinWkHORBCHs8UR3MJEMaWZHZEO6aJP0/wCu3ddSb3xhj0nRPnRgTd/Lw== x-ms-traffictypediagnostic: AM3PR07MB0664: x-ms-office365-filtering-correlation-id: 2c8b8c00-6ab3-490c-d132-08d49c3e92ef x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:AM3PR07MB0664; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(157537322789937)(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700036)(100105000095)(100000701036)(100105300095)(100000702036)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703036)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6041248)(20161123555025)(20161123558100)(20161123564025)(20161123562025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(100000704036)(100105200095)(100000705036)(100105500095); SRVR:AM3PR07MB0664; BCL:0; PCL:0; RULEID:(100000800036)(100110000095)(100000801036)(100110300095)(100000802036)(100110100095)(100000803036)(100110400095)(100000804036)(100110200095)(100000805036)(100110500095); SRVR:AM3PR07MB0664; x-forefront-prvs: 03094A4065 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39850400002)(39400400002)(39450400003)(40764003)(25786009)(5660300001)(53936002)(8676002)(230783001)(81166006)(55016002)(54906002)(478600001)(74316002)(189998001)(8936002)(99286003)(6246003)(2906002)(66066001)(6506006)(110136004)(5250100002)(6436002)(9686003)(3280700002)(3660700001)(54896002)(54356999)(7736002)(229853002)(2900100001)(76176999)(3846002)(2950100002)(102836003)(6916009)(6116002)(38730400002)(7696004)(74482002)(86362001)(19627405001)(33656002)(4326008)(6606003)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:AM3PR07MB0664; H:AM3PR07MB0661.eurprd07.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_AM3PR07MB0661600959D3732708BF063E80E60AM3PR07MB0661eurp_" MIME-Version: 1.0 X-OriginatorOrg: helsinki.fi X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2017 09:33:13.0686 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 98ae7559-10dc-4288-8e2e-4593e62fe3ee X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR07MB0664 Subject: Re: [Make-wifi-fast] Get hardware queue length for wireless interface in linux kernel X-BeenThere: make-wifi-fast@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 May 2017 09:33:15 -0000 --_000_AM3PR07MB0661600959D3732708BF063E80E60AM3PR07MB0661eurp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Toke, Thank you for your quick reply. "Mohan, Nitinder" 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 schedu= les traffic over the interface to avoid HW bufferbloat. The simulation test= ing 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 l= inux 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 givin= g 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 str= uct 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 --_000_AM3PR07MB0661600959D3732708BF063E80E60AM3PR07MB0661eurp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

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 questi= on would be more
> suitable in so I am sending this in both make-wifi-fast and b= loat-dev
> list.

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

The M= PTCP scheduler takes into account lower layer buffer levels and schedules t= raffic over the interface to avoid HW bufferbloat. The simulation test= ing 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 sched= uler 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 leng= th from Queueing discipline structure i.e.
> qdisc->qstats.qlen define= d in sch_generic.h yet it still gives me a
> zero value (I am getting zer= o 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 get= ting queue length for wireless interfaces,
> please do reply. Any help wo= uld be highly appreciated.

There's no general interface to g= et the queue length for WiFi
interfaces. If you're using a dri= ver 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 va= rs inside
mac80211, so not immediately acce= ssible 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 struct= ure 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 wi= ll have their own queueing implementations, that you
probably can't g= et at. Some devices will even have most of their
queueing in firm= ware.

-Toke

Thank you for your help.

Best,

Nitinder Mohan
--_000_AM3PR07MB0661600959D3732708BF063E80E60AM3PR07MB0661eurp_--