diff options
author | Eric Dumazet <edumazet@google.com> | 2013-03-05 10:57:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-05 23:40:01 -0500 |
commit | 82dc3c63c692b1e1d59378ecee948ac88e034aad (patch) | |
tree | d324df2801b34974e8735ac79f28ca43298bea53 /net/core/dev.c | |
parent | dd9f319d94c99b96fc9b34ccde7389a91059fe31 (diff) |
net: introduce NAPI_POLL_WEIGHT
Some drivers use a too big NAPI poll weight.
This patch adds a NAPI_POLL_WEIGHT default value
and issues an error message if a driver attempts
to use a bigger weight.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index a06a7a58dd11..96103894ad69 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -4057,6 +4057,9 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi, | |||
4057 | napi->gro_list = NULL; | 4057 | napi->gro_list = NULL; |
4058 | napi->skb = NULL; | 4058 | napi->skb = NULL; |
4059 | napi->poll = poll; | 4059 | napi->poll = poll; |
4060 | if (weight > NAPI_POLL_WEIGHT) | ||
4061 | pr_err_once("netif_napi_add() called with weight %d on device %s\n", | ||
4062 | weight, dev->name); | ||
4060 | napi->weight = weight; | 4063 | napi->weight = weight; |
4061 | list_add(&napi->dev_list, &dev->napi_list); | 4064 | list_add(&napi->dev_list, &dev->napi_list); |
4062 | napi->dev = dev; | 4065 | napi->dev = dev; |