From patchwork Thu Apr 14 12:18:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 8835571 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C5548C0553 for ; Thu, 14 Apr 2016 12:16:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2EB4620204 for ; Thu, 14 Apr 2016 12:16:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 49035201C7 for ; Thu, 14 Apr 2016 12:16:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755273AbcDNMQi (ORCPT ); Thu, 14 Apr 2016 08:16:38 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:36005 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754564AbcDNMQf (ORCPT ); Thu, 14 Apr 2016 08:16:35 -0400 Received: by mail-lf0-f45.google.com with SMTP id g184so106240480lfb.3 for ; Thu, 14 Apr 2016 05:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wYoGpH2/bmYhFMR0zXKR60YKCws/0fZCkzXIjUVLWKk=; b=CF9uyPbl4rRigHh3rdYupJkODdCVu5L9wAVukkwwMCVfxnIJvOUzqEBLn+1E730ttR rXrzyZI9O+PDb9poIgu6677ZpmilIcqGYuw7sZHAkyvY2lGwRRlasVMkHVfF2QbZcwYq h+tp4E1d64YHXgkBM2QpiZzZ7bSvbf4ew7130= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wYoGpH2/bmYhFMR0zXKR60YKCws/0fZCkzXIjUVLWKk=; b=V4eqSORR4syWxi1WD0NquQWIbwGQ5wFQNRUFA6jEoSE/P/Owf9PqYDDF7u9kJo1VC/ uSxIVDCxrhLo0y2n72pBQOWYF9EFuSHZ3QiAbvVZhqwGscKaTwmms6xDaNBpnOKR+73M 3c+gvwQjUq+/WmnEKTzBeaoxUL6nQ+3xsYoLNuIHgqdvE+9xsKKBqGjIlpq15gPSTYbH jF5ZvIlhW9CMUJaZBB5PlxR+5f/vwmc4m2wiiEA2IxEFrZbJYgRhu31N2WntBIUSwibp 7ozFW491KwdY6UpzD3WagdPxtuGIhhUs37Lg2VyHO09o0rEdu4dzZhQNF3qs25nRIBri Fiqw== X-Gm-Message-State: AOPr4FU+SLbpUkSITjzMVv1DhueXadU/zFhJ95cR+PcCefUBy+7eQYBWcbBCUanxwj/Y9QdUsHAecAyWY8dLhvAesDaaNIwQH60Mm+Y4y1Y06IKSKC9SvgjPv1BzYNeBOfihIqqAVV9K+mN8xJUWx4MsvXJTcovmTQA/2RMqulpT1NGKf2lTnELhXFWlnrVZhWuAPmk= X-Received: by 10.25.167.19 with SMTP id q19mr6457614lfe.24.1460636193338; Thu, 14 Apr 2016 05:16:33 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.10]) by smtp.gmail.com with ESMTPSA id b195sm6940112lfb.5.2016.04.14.05.16.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Apr 2016 05:16:32 -0700 (PDT) From: Michal Kazior To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, dave.taht@gmail.com, make-wifi-fast@lists.bufferbloat.net, codel@lists.bufferbloat.net, apenwarr@gmail.com, Michal Kazior Subject: [PATCHv3 5/5] mac80211: add debug knobs for codel Date: Thu, 14 Apr 2016 14:18:22 +0200 Message-Id: <1460636302-31161-6-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1460636302-31161-1-git-send-email-michal.kazior@tieto.com> References: <1459420104-31554-1-git-send-email-michal.kazior@tieto.com> <1460636302-31161-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds a few debugfs entries to make it easier to test, debug and experiment. Signed-off-by: Michal Kazior --- net/mac80211/debugfs.c | 14 ++++++++++++++ net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/tx.c | 21 ++++++++++++++------- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index 5cbaa5872e6b..9088e505fa85 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c @@ -132,6 +132,10 @@ DEBUGFS_READONLY_FILE(fq_overlimit, "%u", local->fq.overlimit); DEBUGFS_READONLY_FILE(fq_collisions, "%u", local->fq.collisions); +DEBUGFS_READONLY_FILE(codel_drop_count, "%u", + local->cdrop_count); +DEBUGFS_READONLY_FILE(codel_ecn_mark, "%u", + local->cecn_mark); DEBUGFS_RW_FILE(fq_limit, DEBUGFS_RW_EXPR_FQ("%u", &local->fq.limit), @@ -139,6 +143,12 @@ DEBUGFS_RW_FILE(fq_limit, DEBUGFS_RW_FILE(fq_quantum, DEBUGFS_RW_EXPR_FQ("%u", &local->fq.quantum), "%u", local->fq.quantum); +DEBUGFS_RW_FILE(codel_interval, + DEBUGFS_RW_EXPR_FQ("%llu", &local->cparams.interval), + "%llu", local->cparams.interval); +DEBUGFS_RW_FILE(codel_target, + DEBUGFS_RW_EXPR_FQ("%llu", &local->cparams.target), + "%llu", local->cparams.target); #ifdef CONFIG_PM static ssize_t reset_write(struct file *file, const char __user *user_buf, @@ -330,6 +340,10 @@ void debugfs_hw_add(struct ieee80211_local *local) DEBUGFS_ADD(fq_collisions); DEBUGFS_ADD(fq_limit); DEBUGFS_ADD(fq_quantum); + DEBUGFS_ADD(codel_interval); + DEBUGFS_ADD(codel_target); + DEBUGFS_ADD(codel_drop_count); + DEBUGFS_ADD(codel_ecn_mark); statsd = debugfs_create_dir("statistics", phyd); diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 78953b495a25..7aecb7b6528c 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1111,6 +1111,8 @@ struct ieee80211_local { struct fq fq; struct codel_vars *cvars; struct codel_params cparams; + unsigned int cdrop_count; + unsigned int cecn_mark; const struct ieee80211_ops *ops; diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 238cb8e979fd..b5506411b8e6 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1314,6 +1314,7 @@ static void codel_drop_fn(void *ctx, local = vif_to_sdata(txqi->txq.vif)->local; hw = &local->hw; + local->cdrop_count++; ieee80211_free_txskb(hw, skb); } @@ -1325,6 +1326,8 @@ static struct sk_buff *fq_tin_dequeue_fn(struct fq *fq, struct txq_info *txqi; struct codel_vars *cvars; struct codel_params *cparams; + struct sk_buff *skb; + u16 ecn_mark; bool overloaded; local = container_of(fq, struct ieee80211_local, fq); @@ -1339,13 +1342,17 @@ static struct sk_buff *fq_tin_dequeue_fn(struct fq *fq, /* TODO */ overloaded = false; - return codel_dequeue(txqi, - &flow->backlog, - 0, - cvars, - cparams, - codel_get_time(), - overloaded); + ecn_mark = cvars->ecn_mark; + skb = codel_dequeue(txqi, + &flow->backlog, + 0, + cvars, + cparams, + codel_get_time(), + overloaded); + local->cecn_mark += cvars->ecn_mark - ecn_mark; + + return skb; } static void fq_skb_free_fn(struct fq *fq,