From patchwork Tue Mar 27 08:52:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 148895 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C9A16B6EE6 for ; Tue, 27 Mar 2012 19:52:11 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757429Ab2C0IwI (ORCPT ); Tue, 27 Mar 2012 04:52:08 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:56541 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757269Ab2C0IwG (ORCPT ); Tue, 27 Mar 2012 04:52:06 -0400 Received: by wgbdr13 with SMTP id dr13so4647460wgb.1 for ; Tue, 27 Mar 2012 01:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:x-mailer:content-transfer-encoding:mime-version; bh=gNj7babXauw+4tPiSg6asAi02COn7s3zyJvsqPHydhQ=; b=ej0dPa8IyYwK7xknYcv/voqU2XOln4ZqK+PRdprOt+wvgZ3+9mc4AqGMv4GIVyGuYR MGezGu45IdIvqbVGb/iHM3QpGGSaTRiTHb30zMeNvE2lnCOtW7zJc/XvHqzAHcsYWdEu oXXfQg+rIc2Ee2Tr44oxlmcC2WFD1d5f17cjyS9Sbet7XMENie/IiLt8R29bZtho741u SOfKcMN46spFU5GJxFLg72mYeIIfyNT8vXIrQdQxJ1CfSk9udb9aO/vH93LXNYABJt0I w/6t6Ku6RAZ9XQq6QeDpJJ32IS5kmCkm4MX2NCVt0dJpcZiq+V6F9d93YkwR/VSmA8XU ApfQ== Received: by 10.216.132.229 with SMTP id o79mr8939886wei.64.1332838324393; Tue, 27 Mar 2012 01:52:04 -0700 (PDT) Received: from [192.168.1.97] (122.237.66.86.rev.sfr.net. [86.66.237.122]) by mx.google.com with ESMTPS id ff9sm47855828wib.2.2012.03.27.01.52.02 (version=SSLv3 cipher=OTHER); Tue, 27 Mar 2012 01:52:03 -0700 (PDT) Message-ID: <1332838320.3248.6.camel@edumazet-laptop> Subject: [PATCH] eql: dont rely on HZ=100 From: Eric Dumazet To: David Woodhouse , David Miller Cc: netdev@vger.kernel.org Date: Tue, 27 Mar 2012 01:52:00 -0700 In-Reply-To: <1332836241.2058.35.camel@shinybook.infradead.org> References: <1332669700.32446.142.camel@shinybook.infradead.org> <1332746975.2379.5.camel@shinybook.infradead.org> <1332835965.3248.2.camel@edumazet-laptop> <1332836241.2058.35.camel@shinybook.infradead.org> X-Mailer: Evolution 3.2.3-0ubuntu3 Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Le mardi 27 mars 2012 à 09:17 +0100, David Woodhouse a écrit : > Thanks. I blame the baby for that one too. Once she's been taken > swimming and dropped off at nursery and I've had at least two more cups > of tea, I'll have another go :) > Looking at this driver, it seems it depends on HZ=100 ? [PATCH] eql: dont rely on HZ=100 HZ is more likely to be 1000 these days. timer handlers are run from softirq, no need to disable bh skb priority 1 is TC_PRIO_FILLER Signed-off-by: Eric Dumazet --- drivers/net/eql.c | 7 ++++--- include/linux/if_eql.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/eql.c b/drivers/net/eql.c index a59cf96..f219d38 100644 --- a/drivers/net/eql.c +++ b/drivers/net/eql.c @@ -125,6 +125,7 @@ #include #include #include +#include #include @@ -143,7 +144,7 @@ static void eql_timer(unsigned long param) equalizer_t *eql = (equalizer_t *) param; struct list_head *this, *tmp, *head; - spin_lock_bh(&eql->queue.lock); + spin_lock(&eql->queue.lock); head = &eql->queue.all_slaves; list_for_each_safe(this, tmp, head) { slave_t *slave = list_entry(this, slave_t, list); @@ -157,7 +158,7 @@ static void eql_timer(unsigned long param) } } - spin_unlock_bh(&eql->queue.lock); + spin_unlock(&eql->queue.lock); eql->timer.expires = jiffies + EQL_DEFAULT_RESCHED_IVAL; add_timer(&eql->timer); @@ -341,7 +342,7 @@ static netdev_tx_t eql_slave_xmit(struct sk_buff *skb, struct net_device *dev) struct net_device *slave_dev = slave->dev; skb->dev = slave_dev; - skb->priority = 1; + skb->priority = TC_PRIO_FILLER; slave->bytes_queued += skb->len; dev_queue_xmit(skb); dev->stats.tx_packets++; diff --git a/include/linux/if_eql.h b/include/linux/if_eql.h index 79c4f26..18a5d02 100644 --- a/include/linux/if_eql.h +++ b/include/linux/if_eql.h @@ -22,7 +22,7 @@ #define EQL_DEFAULT_SLAVE_PRIORITY 28800 #define EQL_DEFAULT_MAX_SLAVES 4 #define EQL_DEFAULT_MTU 576 -#define EQL_DEFAULT_RESCHED_IVAL 100 +#define EQL_DEFAULT_RESCHED_IVAL HZ #define EQL_ENSLAVE (SIOCDEVPRIVATE) #define EQL_EMANCIPATE (SIOCDEVPRIVATE + 1)