From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>,
David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH] eql: dont rely on HZ=100
Date: Tue, 27 Mar 2012 01:52:00 -0700 [thread overview]
Message-ID: <1332838320.3248.6.camel@edumazet-laptop> (raw)
In-Reply-To: <1332836241.2058.35.camel@shinybook.infradead.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 <eric.dumazet@gmail.com>
---
drivers/net/eql.c | 7 ++++---
include/linux/if_eql.h | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
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 <linux/if.h>
#include <linux/if_arp.h>
#include <linux/if_eql.h>
+#include <linux/pkt_sched.h>
#include <asm/uaccess.h>
@@ -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)
next prev parent reply other threads:[~2012-03-27 8:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-25 10:01 [PATCH] Fix byte stats on eql David Woodhouse
2012-03-25 17:28 ` David Miller
2012-03-26 7:29 ` [PATCH] eql: Fix byte stats David Woodhouse
2012-03-27 8:12 ` Eric Dumazet
2012-03-27 8:17 ` David Woodhouse
2012-03-27 8:52 ` Eric Dumazet [this message]
2012-03-28 2:47 ` [PATCH] eql: dont rely on HZ=100 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1332838320.3248.6.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=dwmw2@infradead.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox