cc4f270e79e92c14faf2173e32d237e8576ccc29
[openwrt/staging/yousong.git] / target / linux / octeon / patches-3.10 / 0006-MIPS-Octeon-ethernet-remove-debug-noise.patch
1 From patchwork Thu Sep 5 18:44:00 2013
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 Subject: [2/3] staging: octeon-ethernet: remove skb alloc failure warnings
6 From: Aaro Koskinen <aaro.koskinen@iki.fi>
7 X-Patchwork-Id: 5811
8 Message-Id: <1378406641-16530-3-git-send-email-aaro.koskinen@iki.fi>
9 To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
10 devel@driverdev.osuosl.org, linux-mips@linux-mips.org
11 Cc: David Daney <david.daney@cavium.com>,
12 "Jason A. Donenfeld" <Jason@zx2c4.com>, richard@nod.at,
13 Aaro Koskinen <aaro.koskinen@iki.fi>
14 Date: Thu, 5 Sep 2013 21:44:00 +0300
15
16 Remove skb allocation failure warnings. They will trigger a page
17 allocation warning already. Also, one of the warnings was not ratelimited,
18 causing the box to lock up under heavy traffic & low memory.
19
20 Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
21 Acked-by: David Daney <david.daney@cavium.com>
22
23 ---
24 drivers/staging/octeon/ethernet-mem.c | 7 +------
25 drivers/staging/octeon/ethernet-rx.c | 3 ---
26 2 files changed, 1 insertion(+), 9 deletions(-)
27
28 diff --git a/drivers/staging/octeon/ethernet-mem.c b/drivers/staging/octeon/ethernet-mem.c
29 index 78b6cb7..199059d 100644
30 --- a/drivers/staging/octeon/ethernet-mem.c
31 +++ b/drivers/staging/octeon/ethernet-mem.c
32 @@ -48,13 +48,8 @@ static int cvm_oct_fill_hw_skbuff(int pool, int size, int elements)
33 while (freed) {
34
35 struct sk_buff *skb = dev_alloc_skb(size + 256);
36 - if (unlikely(skb == NULL)) {
37 - pr_warning
38 - ("Failed to allocate skb for hardware pool %d\n",
39 - pool);
40 + if (unlikely(skb == NULL))
41 break;
42 - }
43 -
44 skb_reserve(skb, 256 - (((unsigned long)skb->data) & 0x7f));
45 *(struct sk_buff **)(skb->data - sizeof(void *)) = skb;
46 cvmx_fpa_free(skb->data, pool, DONT_WRITEBACK(size / 128));
47 diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
48 index 10e5416..e14a1bb 100644
49 --- a/drivers/staging/octeon/ethernet-rx.c
50 +++ b/drivers/staging/octeon/ethernet-rx.c
51 @@ -337,9 +337,6 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
52 */
53 skb = dev_alloc_skb(work->len);
54 if (!skb) {
55 - printk_ratelimited("Port %d failed to allocate "
56 - "skbuff, packet dropped\n",
57 - work->ipprt);
58 cvm_oct_free_work(work);
59 continue;
60 }