aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-03-08 10:03:25 -0500
committerDavid S. Miller <davem@davemloft.net>2013-03-09 16:09:19 -0500
commit720a43efd30f04a0a492c85fb997361c44fbae05 (patch)
tree430e9488e00413655b7947f67e82c4fd2c07e951 /drivers/net
parente8f83e5ec7450b85b101a774e165e70a18e9c3ab (diff)
drivers:net: Remove unnecessary OOM messages after netdev_alloc_skb
Emitting netdev_alloc_skb and netdev_alloc_skb_ip_align OOM messages is unnecessary as there is already a dump_stack after allocation failures. Other trivial changes around these removals: Convert a few comparisons of pointer to 0 to !pointer. Change flow to remove unnecessary label. Remove now unused variable. Hoist assignment from if. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/caif/caif_shmcore.c5
-rw-r--r--drivers/net/ethernet/adi/bfin_mac.c6
-rw-r--r--drivers/net/ethernet/amd/7990.c2
-rw-r--r--drivers/net/ethernet/amd/a2065.c1
-rw-r--r--drivers/net/ethernet/amd/am79c961a.c1
-rw-r--r--drivers/net/ethernet/amd/ariadne.c1
-rw-r--r--drivers/net/ethernet/amd/atarilance.c2
-rw-r--r--drivers/net/ethernet/amd/au1000_eth.c1
-rw-r--r--drivers/net/ethernet/amd/declance.c2
-rw-r--r--drivers/net/ethernet/amd/pcnet32.c1
-rw-r--r--drivers/net/ethernet/amd/sun3lance.c3
-rw-r--r--drivers/net/ethernet/amd/sunlance.c4
-rw-r--r--drivers/net/ethernet/atheros/atl1e/atl1e_main.c6
-rw-r--r--drivers/net/ethernet/atheros/atlx/atl2.c3
-rw-r--r--drivers/net/ethernet/broadcom/bgmac.c4
-rw-r--r--drivers/net/ethernet/broadcom/sb1250-mac.c5
-rw-r--r--drivers/net/ethernet/cadence/at91_ether.c1
-rw-r--r--drivers/net/ethernet/cirrus/cs89x0.c6
-rw-r--r--drivers/net/ethernet/dlink/dl2k.c7
-rw-r--r--drivers/net/ethernet/freescale/fec.c2
-rw-r--r--drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c17
-rw-r--r--drivers/net/ethernet/fujitsu/fmvj18x_cs.c2
-rw-r--r--drivers/net/ethernet/i825xx/82596.c8
-rw-r--r--drivers/net/ethernet/i825xx/lib82596.c6
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_main.c9
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_selftest.c5
-rw-r--r--drivers/net/ethernet/natsemi/sonic.c1
-rw-r--r--drivers/net/ethernet/netx-eth.c2
-rw-r--r--drivers/net/ethernet/nuvoton/w90p910_ether.c1
-rw-r--r--drivers/net/ethernet/nvidia/forcedeth.c1
-rw-r--r--drivers/net/ethernet/qlogic/qla3xxx.c1
-rw-r--r--drivers/net/ethernet/qlogic/qlge/qlge_main.c6
-rw-r--r--drivers/net/ethernet/rdc/r6040.c1
-rw-r--r--drivers/net/ethernet/realtek/8139too.c2
-rw-r--r--drivers/net/ethernet/realtek/atp.c2
-rw-r--r--drivers/net/ethernet/seeq/ether3.c22
-rw-r--r--drivers/net/ethernet/seeq/sgiseeq.c2
-rw-r--r--drivers/net/ethernet/sis/sis900.c7
-rw-r--r--drivers/net/ethernet/smsc/smc9194.c2
-rw-r--r--drivers/net/ethernet/smsc/smc91x.c2
-rw-r--r--drivers/net/ethernet/smsc/smsc9420.c4
-rw-r--r--drivers/net/ethernet/sun/sunqe.c5
-rw-r--r--drivers/net/ethernet/tehuti/tehuti.c5
-rw-r--r--drivers/net/ethernet/ti/tlan.c4
-rw-r--r--drivers/net/ethernet/xilinx/ll_temac_main.c10
-rw-r--r--drivers/net/ethernet/xilinx/xilinx_axienet_main.c9
-rw-r--r--drivers/net/ethernet/xircom/xirc2ps_cs.c1
47 files changed, 39 insertions, 161 deletions
diff --git a/drivers/net/caif/caif_shmcore.c b/drivers/net/caif/caif_shmcore.c
index bce8bac311c9..cca2afc945af 100644
--- a/drivers/net/caif/caif_shmcore.c
+++ b/drivers/net/caif/caif_shmcore.c
@@ -338,11 +338,8 @@ static void shm_rx_work_func(struct work_struct *rx_work)
338 /* Get a suitable CAIF packet and copy in data. */ 338 /* Get a suitable CAIF packet and copy in data. */
339 skb = netdev_alloc_skb(pshm_drv->pshm_dev->pshm_netdev, 339 skb = netdev_alloc_skb(pshm_drv->pshm_dev->pshm_netdev,
340 frm_pck_len + 1); 340 frm_pck_len + 1);
341 341 if (skb == NULL)
342 if (skb == NULL) {
343 pr_info("OOM: Try next frame in descriptor\n");
344 break; 342 break;
345 }
346 343
347 p = skb_put(skb, frm_pck_len); 344 p = skb_put(skb, frm_pck_len);
348 memcpy(p, pbuf->desc_vptr + frm_pck_ofs, frm_pck_len); 345 memcpy(p, pbuf->desc_vptr + frm_pck_ofs, frm_pck_len);
diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c
index a175d0be1ae1..ee705771bd2c 100644
--- a/drivers/net/ethernet/adi/bfin_mac.c
+++ b/drivers/net/ethernet/adi/bfin_mac.c
@@ -188,10 +188,9 @@ static int desc_list_init(struct net_device *dev)
188 188
189 /* allocate a new skb for next time receive */ 189 /* allocate a new skb for next time receive */
190 new_skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN); 190 new_skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN);
191 if (!new_skb) { 191 if (!new_skb)
192 pr_notice("init: low on mem - packet dropped\n");
193 goto init_error; 192 goto init_error;
194 } 193
195 skb_reserve(new_skb, NET_IP_ALIGN); 194 skb_reserve(new_skb, NET_IP_ALIGN);
196 /* Invidate the data cache of skb->data range when it is write back 195 /* Invidate the data cache of skb->data range when it is write back
197 * cache. It will prevent overwritting the new data from DMA 196 * cache. It will prevent overwritting the new data from DMA
@@ -1236,7 +1235,6 @@ static void bfin_mac_rx(struct net_device *dev)
1236 1235
1237 new_skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN); 1236 new_skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN);
1238 if (!new_skb) { 1237 if (!new_skb) {
1239 netdev_notice(dev, "rx: low on mem - packet dropped\n");
1240 dev->stats.rx_dropped++; 1238 dev->stats.rx_dropped++;
1241 goto out; 1239 goto out;
1242 } 1240 }
diff --git a/drivers/net/ethernet/amd/7990.c b/drivers/net/ethernet/amd/7990.c
index 6e722dc37db7..65926a956575 100644
--- a/drivers/net/ethernet/amd/7990.c
+++ b/drivers/net/ethernet/amd/7990.c
@@ -318,8 +318,6 @@ static int lance_rx (struct net_device *dev)
318 struct sk_buff *skb = netdev_alloc_skb(dev, len + 2); 318 struct sk_buff *skb = netdev_alloc_skb(dev, len + 2);
319 319
320 if (!skb) { 320 if (!skb) {
321 printk ("%s: Memory squeeze, deferring packet.\n",
322 dev->name);
323 dev->stats.rx_dropped++; 321 dev->stats.rx_dropped++;
324 rd->mblength = 0; 322 rd->mblength = 0;
325 rd->rmd1_bits = LE_R1_OWN; 323 rd->rmd1_bits = LE_R1_OWN;
diff --git a/drivers/net/ethernet/amd/a2065.c b/drivers/net/ethernet/amd/a2065.c
index 3789affbc0e5..0866e7627433 100644
--- a/drivers/net/ethernet/amd/a2065.c
+++ b/drivers/net/ethernet/amd/a2065.c
@@ -293,7 +293,6 @@ static int lance_rx(struct net_device *dev)
293 struct sk_buff *skb = netdev_alloc_skb(dev, len + 2); 293 struct sk_buff *skb = netdev_alloc_skb(dev, len + 2);
294 294
295 if (!skb) { 295 if (!skb) {
296 netdev_warn(dev, "Memory squeeze, deferring packet\n");
297 dev->stats.rx_dropped++; 296 dev->stats.rx_dropped++;
298 rd->mblength = 0; 297 rd->mblength = 0;
299 rd->rmd1_bits = LE_R1_OWN; 298 rd->rmd1_bits = LE_R1_OWN;
diff --git a/drivers/net/ethernet/amd/am79c961a.c b/drivers/net/ethernet/amd/am79c961a.c
index 60e2b701afe7..9793767996a2 100644
--- a/drivers/net/ethernet/amd/am79c961a.c
+++ b/drivers/net/ethernet/amd/am79c961a.c
@@ -528,7 +528,6 @@ am79c961_rx(struct net_device *dev, struct dev_priv *priv)
528 dev->stats.rx_packets++; 528 dev->stats.rx_packets++;
529 } else { 529 } else {
530 am_writeword (dev, hdraddr + 2, RMD_OWN); 530 am_writeword (dev, hdraddr + 2, RMD_OWN);
531 printk (KERN_WARNING "%s: memory squeeze, dropping packet.\n", dev->name);
532 dev->stats.rx_dropped++; 531 dev->stats.rx_dropped++;
533 break; 532 break;
534 } 533 }
diff --git a/drivers/net/ethernet/amd/ariadne.c b/drivers/net/ethernet/amd/ariadne.c
index 98f4522fd17b..c178eb4c8166 100644
--- a/drivers/net/ethernet/amd/ariadne.c
+++ b/drivers/net/ethernet/amd/ariadne.c
@@ -193,7 +193,6 @@ static int ariadne_rx(struct net_device *dev)
193 193
194 skb = netdev_alloc_skb(dev, pkt_len + 2); 194 skb = netdev_alloc_skb(dev, pkt_len + 2);
195 if (skb == NULL) { 195 if (skb == NULL) {
196 netdev_warn(dev, "Memory squeeze, deferring packet\n");
197 for (i = 0; i < RX_RING_SIZE; i++) 196 for (i = 0; i < RX_RING_SIZE; i++)
198 if (lowb(priv->rx_ring[(entry + i) % RX_RING_SIZE]->RMD1) & RF_OWN) 197 if (lowb(priv->rx_ring[(entry + i) % RX_RING_SIZE]->RMD1) & RF_OWN)
199 break; 198 break;
diff --git a/drivers/net/ethernet/amd/atarilance.c b/drivers/net/ethernet/amd/atarilance.c
index 84219df72f51..ab9bedb8d276 100644
--- a/drivers/net/ethernet/amd/atarilance.c
+++ b/drivers/net/ethernet/amd/atarilance.c
@@ -996,8 +996,6 @@ static int lance_rx( struct net_device *dev )
996 else { 996 else {
997 skb = netdev_alloc_skb(dev, pkt_len + 2); 997 skb = netdev_alloc_skb(dev, pkt_len + 2);
998 if (skb == NULL) { 998 if (skb == NULL) {
999 DPRINTK( 1, ( "%s: Memory squeeze, deferring packet.\n",
1000 dev->name ));
1001 for( i = 0; i < RX_RING_SIZE; i++ ) 999 for( i = 0; i < RX_RING_SIZE; i++ )
1002 if (MEM->rx_head[(entry+i) & RX_RING_MOD_MASK].flag & 1000 if (MEM->rx_head[(entry+i) & RX_RING_MOD_MASK].flag &
1003 RMD1_OWN_CHIP) 1001 RMD1_OWN_CHIP)
diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
index de774d419144..688aede742c7 100644
--- a/drivers/net/ethernet/amd/au1000_eth.c
+++ b/drivers/net/ethernet/amd/au1000_eth.c
@@ -727,7 +727,6 @@ static int au1000_rx(struct net_device *dev)
727 frmlen -= 4; /* Remove FCS */ 727 frmlen -= 4; /* Remove FCS */
728 skb = netdev_alloc_skb(dev, frmlen + 2); 728 skb = netdev_alloc_skb(dev, frmlen + 2);
729 if (skb == NULL) { 729 if (skb == NULL) {
730 netdev_err(dev, "Memory squeeze, dropping packet.\n");
731 dev->stats.rx_dropped++; 730 dev->stats.rx_dropped++;
732 continue; 731 continue;
733 } 732 }
diff --git a/drivers/net/ethernet/amd/declance.c b/drivers/net/ethernet/amd/declance.c
index baca0bd1b393..3d86ffeb4e15 100644
--- a/drivers/net/ethernet/amd/declance.c
+++ b/drivers/net/ethernet/amd/declance.c
@@ -607,8 +607,6 @@ static int lance_rx(struct net_device *dev)
607 skb = netdev_alloc_skb(dev, len + 2); 607 skb = netdev_alloc_skb(dev, len + 2);
608 608
609 if (skb == 0) { 609 if (skb == 0) {
610 printk("%s: Memory squeeze, deferring packet.\n",
611 dev->name);
612 dev->stats.rx_dropped++; 610 dev->stats.rx_dropped++;
613 *rds_ptr(rd, mblength, lp->type) = 0; 611 *rds_ptr(rd, mblength, lp->type) = 0;
614 *rds_ptr(rd, rmd1, lp->type) = 612 *rds_ptr(rd, rmd1, lp->type) =
diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index 797f847edf13..ed2130727643 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -1166,7 +1166,6 @@ static void pcnet32_rx_entry(struct net_device *dev,
1166 skb = netdev_alloc_skb(dev, pkt_len + NET_IP_ALIGN); 1166 skb = netdev_alloc_skb(dev, pkt_len + NET_IP_ALIGN);
1167 1167
1168 if (skb == NULL) { 1168 if (skb == NULL) {
1169 netif_err(lp, drv, dev, "Memory squeeze, dropping packet\n");
1170 dev->stats.rx_dropped++; 1169 dev->stats.rx_dropped++;
1171 return; 1170 return;
1172 } 1171 }
diff --git a/drivers/net/ethernet/amd/sun3lance.c b/drivers/net/ethernet/amd/sun3lance.c
index 74b3891b6483..de412d331a72 100644
--- a/drivers/net/ethernet/amd/sun3lance.c
+++ b/drivers/net/ethernet/amd/sun3lance.c
@@ -812,9 +812,6 @@ static int lance_rx( struct net_device *dev )
812 else { 812 else {
813 skb = netdev_alloc_skb(dev, pkt_len + 2); 813 skb = netdev_alloc_skb(dev, pkt_len + 2);
814 if (skb == NULL) { 814 if (skb == NULL) {
815 DPRINTK( 1, ( "%s: Memory squeeze, deferring packet.\n",
816 dev->name ));
817
818 dev->stats.rx_dropped++; 815 dev->stats.rx_dropped++;
819 head->msg_length = 0; 816 head->msg_length = 0;
820 head->flag |= RMD1_OWN_CHIP; 817 head->flag |= RMD1_OWN_CHIP;
diff --git a/drivers/net/ethernet/amd/sunlance.c b/drivers/net/ethernet/amd/sunlance.c
index 6a40290d3727..70d543063993 100644
--- a/drivers/net/ethernet/amd/sunlance.c
+++ b/drivers/net/ethernet/amd/sunlance.c
@@ -536,8 +536,6 @@ static void lance_rx_dvma(struct net_device *dev)
536 skb = netdev_alloc_skb(dev, len + 2); 536 skb = netdev_alloc_skb(dev, len + 2);
537 537
538 if (skb == NULL) { 538 if (skb == NULL) {
539 printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n",
540 dev->name);
541 dev->stats.rx_dropped++; 539 dev->stats.rx_dropped++;
542 rd->mblength = 0; 540 rd->mblength = 0;
543 rd->rmd1_bits = LE_R1_OWN; 541 rd->rmd1_bits = LE_R1_OWN;
@@ -708,8 +706,6 @@ static void lance_rx_pio(struct net_device *dev)
708 skb = netdev_alloc_skb(dev, len + 2); 706 skb = netdev_alloc_skb(dev, len + 2);
709 707
710 if (skb == NULL) { 708 if (skb == NULL) {
711 printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n",
712 dev->name);
713 dev->stats.rx_dropped++; 709 dev->stats.rx_dropped++;
714 sbus_writew(0, &rd->mblength); 710 sbus_writew(0, &rd->mblength);
715 sbus_writeb(LE_R1_OWN, &rd->rmd1_bits); 711 sbus_writeb(LE_R1_OWN, &rd->rmd1_bits);
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index 92f4734f860d..e1f1b2a0673a 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -1420,11 +1420,9 @@ static void atl1e_clean_rx_irq(struct atl1e_adapter *adapter, u8 que,
1420 packet_size = ((prrs->word1 >> RRS_PKT_SIZE_SHIFT) & 1420 packet_size = ((prrs->word1 >> RRS_PKT_SIZE_SHIFT) &
1421 RRS_PKT_SIZE_MASK) - 4; /* CRC */ 1421 RRS_PKT_SIZE_MASK) - 4; /* CRC */
1422 skb = netdev_alloc_skb_ip_align(netdev, packet_size); 1422 skb = netdev_alloc_skb_ip_align(netdev, packet_size);
1423 if (skb == NULL) { 1423 if (skb == NULL)
1424 netdev_warn(netdev,
1425 "Memory squeeze, deferring packet\n");
1426 goto skip_pkt; 1424 goto skip_pkt;
1427 } 1425
1428 memcpy(skb->data, (u8 *)(prrs + 1), packet_size); 1426 memcpy(skb->data, (u8 *)(prrs + 1), packet_size);
1429 skb_put(skb, packet_size); 1427 skb_put(skb, packet_size);
1430 skb->protocol = eth_type_trans(skb, netdev); 1428 skb->protocol = eth_type_trans(skb, netdev);
diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c
index 1278b47022e0..a046b6ff847c 100644
--- a/drivers/net/ethernet/atheros/atlx/atl2.c
+++ b/drivers/net/ethernet/atheros/atlx/atl2.c
@@ -437,9 +437,6 @@ static void atl2_intr_rx(struct atl2_adapter *adapter)
437 /* alloc new buffer */ 437 /* alloc new buffer */
438 skb = netdev_alloc_skb_ip_align(netdev, rx_size); 438 skb = netdev_alloc_skb_ip_align(netdev, rx_size);
439 if (NULL == skb) { 439 if (NULL == skb) {
440 printk(KERN_WARNING
441 "%s: Mem squeeze, deferring packet.\n",
442 netdev->name);
443 /* 440 /*
444 * Check that some rx space is free. If not, 441 * Check that some rx space is free. If not,
445 * free one and mark stats->rx_dropped++. 442 * free one and mark stats->rx_dropped++.
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index d6cb376b71e6..eec0af45b859 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -245,10 +245,8 @@ static int bgmac_dma_rx_skb_for_slot(struct bgmac *bgmac,
245 245
246 /* Alloc skb */ 246 /* Alloc skb */
247 slot->skb = netdev_alloc_skb(bgmac->net_dev, BGMAC_RX_BUF_SIZE); 247 slot->skb = netdev_alloc_skb(bgmac->net_dev, BGMAC_RX_BUF_SIZE);
248 if (!slot->skb) { 248 if (!slot->skb)
249 bgmac_err(bgmac, "Allocation of skb failed!\n");
250 return -ENOMEM; 249 return -ENOMEM;
251 }
252 250
253 /* Poison - if everything goes fine, hardware will overwrite it */ 251 /* Poison - if everything goes fine, hardware will overwrite it */
254 rx = (struct bgmac_rx_header *)slot->skb->data; 252 rx = (struct bgmac_rx_header *)slot->skb->data;
diff --git a/drivers/net/ethernet/broadcom/sb1250-mac.c b/drivers/net/ethernet/broadcom/sb1250-mac.c
index e9b35da375cb..e80bfb60c3ef 100644
--- a/drivers/net/ethernet/broadcom/sb1250-mac.c
+++ b/drivers/net/ethernet/broadcom/sb1250-mac.c
@@ -831,11 +831,8 @@ static int sbdma_add_rcvbuffer(struct sbmac_softc *sc, struct sbmacdma *d,
831 sb_new = netdev_alloc_skb(dev, ENET_PACKET_SIZE + 831 sb_new = netdev_alloc_skb(dev, ENET_PACKET_SIZE +
832 SMP_CACHE_BYTES * 2 + 832 SMP_CACHE_BYTES * 2 +
833 NET_IP_ALIGN); 833 NET_IP_ALIGN);
834 if (sb_new == NULL) { 834 if (sb_new == NULL)
835 pr_info("%s: sk_buff allocation failed\n",
836 d->sbdma_eth->sbm_dev->name);
837 return -ENOBUFS; 835 return -ENOBUFS;
838 }
839 836
840 sbdma_align_skb(sb_new, SMP_CACHE_BYTES, NET_IP_ALIGN); 837 sbdma_align_skb(sb_new, SMP_CACHE_BYTES, NET_IP_ALIGN);
841 } 838 }
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 1a57e16ada7c..5bd7786e8413 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -209,7 +209,6 @@ static void at91ether_rx(struct net_device *dev)
209 netif_rx(skb); 209 netif_rx(skb);
210 } else { 210 } else {
211 lp->stats.rx_dropped++; 211 lp->stats.rx_dropped++;
212 netdev_notice(dev, "Memory squeeze, dropping packet.\n");
213 } 212 }
214 213
215 if (lp->rx_ring[lp->rx_tail].ctrl & MACB_BIT(RX_MHASH_MATCH)) 214 if (lp->rx_ring[lp->rx_tail].ctrl & MACB_BIT(RX_MHASH_MATCH))
diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index 73c1c8c33dd1..aaa0499aa19c 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -478,9 +478,6 @@ dma_rx(struct net_device *dev)
478 /* Malloc up new buffer. */ 478 /* Malloc up new buffer. */
479 skb = netdev_alloc_skb(dev, length + 2); 479 skb = netdev_alloc_skb(dev, length + 2);
480 if (skb == NULL) { 480 if (skb == NULL) {
481 /* I don't think we want to do this to a stressed system */
482 cs89_dbg(0, err, "%s: Memory squeeze, dropping packet\n",
483 dev->name);
484 dev->stats.rx_dropped++; 481 dev->stats.rx_dropped++;
485 482
486 /* AKPM: advance bp to the next frame */ 483 /* AKPM: advance bp to the next frame */
@@ -731,9 +728,6 @@ net_rx(struct net_device *dev)
731 /* Malloc up new buffer. */ 728 /* Malloc up new buffer. */
732 skb = netdev_alloc_skb(dev, length + 2); 729 skb = netdev_alloc_skb(dev, length + 2);
733 if (skb == NULL) { 730 if (skb == NULL) {
734#if 0 /* Again, this seems a cruel thing to do */
735 pr_warn("%s: Memory squeeze, dropping packet\n", dev->name);
736#endif
737 dev->stats.rx_dropped++; 731 dev->stats.rx_dropped++;
738 return; 732 return;
739 } 733 }
diff --git a/drivers/net/ethernet/dlink/dl2k.c b/drivers/net/ethernet/dlink/dl2k.c
index 110d26f4c602..afa8e3af2c4d 100644
--- a/drivers/net/ethernet/dlink/dl2k.c
+++ b/drivers/net/ethernet/dlink/dl2k.c
@@ -580,12 +580,9 @@ alloc_list (struct net_device *dev)
580 580
581 skb = netdev_alloc_skb_ip_align(dev, np->rx_buf_sz); 581 skb = netdev_alloc_skb_ip_align(dev, np->rx_buf_sz);
582 np->rx_skbuff[i] = skb; 582 np->rx_skbuff[i] = skb;
583 if (skb == NULL) { 583 if (skb == NULL)
584 printk (KERN_ERR
585 "%s: alloc_list: allocate Rx buffer error! ",
586 dev->name);
587 break; 584 break;
588 } 585
589 /* Rubicon now supports 40 bits of addressing space. */ 586 /* Rubicon now supports 40 bits of addressing space. */
590 np->rx_ring[i].fraginfo = 587 np->rx_ring[i].fraginfo =
591 cpu_to_le64 ( pci_map_single ( 588 cpu_to_le64 ( pci_map_single (
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 069a155d16ed..f97c60f78089 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -743,8 +743,6 @@ fec_enet_rx(struct net_device *ndev, int budget)
743 skb = netdev_alloc_skb(ndev, pkt_len - 4 + NET_IP_ALIGN); 743 skb = netdev_alloc_skb(ndev, pkt_len - 4 + NET_IP_ALIGN);
744 744
745 if (unlikely(!skb)) { 745 if (unlikely(!skb)) {
746 printk("%s: Memory squeeze, dropping packet.\n",
747 ndev->name);
748 ndev->stats.rx_dropped++; 746 ndev->stats.rx_dropped++;
749 } else { 747 } else {
750 skb_reserve(skb, NET_IP_ALIGN); 748 skb_reserve(skb, NET_IP_ALIGN);
diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
index 46df28893c10..edc120094c34 100644
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
+++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -177,8 +177,6 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
177 received++; 177 received++;
178 netif_receive_skb(skb); 178 netif_receive_skb(skb);
179 } else { 179 } else {
180 dev_warn(fep->dev,
181 "Memory squeeze, dropping packet.\n");
182 fep->stats.rx_dropped++; 180 fep->stats.rx_dropped++;
183 skbn = skb; 181 skbn = skb;
184 } 182 }
@@ -309,8 +307,6 @@ static int fs_enet_rx_non_napi(struct net_device *dev)
309 received++; 307 received++;
310 netif_rx(skb); 308 netif_rx(skb);
311 } else { 309 } else {
312 dev_warn(fep->dev,
313 "Memory squeeze, dropping packet.\n");
314 fep->stats.rx_dropped++; 310 fep->stats.rx_dropped++;
315 skbn = skb; 311 skbn = skb;
316 } 312 }
@@ -505,11 +501,9 @@ void fs_init_bds(struct net_device *dev)
505 */ 501 */
506 for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) { 502 for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) {
507 skb = netdev_alloc_skb(dev, ENET_RX_FRSIZE); 503 skb = netdev_alloc_skb(dev, ENET_RX_FRSIZE);
508 if (skb == NULL) { 504 if (skb == NULL)
509 dev_warn(fep->dev,
510 "Memory squeeze, unable to allocate skb\n");
511 break; 505 break;
512 } 506
513 skb_align(skb, ENET_RX_ALIGN); 507 skb_align(skb, ENET_RX_ALIGN);
514 fep->rx_skbuff[i] = skb; 508 fep->rx_skbuff[i] = skb;
515 CBDW_BUFADDR(bdp, 509 CBDW_BUFADDR(bdp,
@@ -593,13 +587,8 @@ static struct sk_buff *tx_skb_align_workaround(struct net_device *dev,
593 587
594 /* Alloc new skb */ 588 /* Alloc new skb */
595 new_skb = netdev_alloc_skb(dev, skb->len + 4); 589 new_skb = netdev_alloc_skb(dev, skb->len + 4);
596 if (!new_skb) { 590 if (!new_skb)
597 if (net_ratelimit()) {
598 dev_warn(fep->dev,
599 "Memory squeeze, dropping tx packet.\n");
600 }
601 return NULL; 591 return NULL;
602 }
603 592
604 /* Make sure new skb is properly aligned */ 593 /* Make sure new skb is properly aligned */
605 skb_align(new_skb, 4); 594 skb_align(new_skb, 4);
diff --git a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
index 2418faf2251a..84125707f321 100644
--- a/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
+++ b/drivers/net/ethernet/fujitsu/fmvj18x_cs.c
@@ -1003,8 +1003,6 @@ static void fjn_rx(struct net_device *dev)
1003 } 1003 }
1004 skb = netdev_alloc_skb(dev, pkt_len + 2); 1004 skb = netdev_alloc_skb(dev, pkt_len + 2);
1005 if (skb == NULL) { 1005 if (skb == NULL) {
1006 netdev_notice(dev, "Memory squeeze, dropping packet (len %d)\n",
1007 pkt_len);
1008 outb(F_SKP_PKT, ioaddr + RX_SKIP); 1006 outb(F_SKP_PKT, ioaddr + RX_SKIP);
1009 dev->stats.rx_dropped++; 1007 dev->stats.rx_dropped++;
1010 break; 1008 break;
diff --git a/drivers/net/ethernet/i825xx/82596.c b/drivers/net/ethernet/i825xx/82596.c
index 1c54e229e3cc..e38816145395 100644
--- a/drivers/net/ethernet/i825xx/82596.c
+++ b/drivers/net/ethernet/i825xx/82596.c
@@ -798,16 +798,14 @@ static inline int i596_rx(struct net_device *dev)
798#ifdef __mc68000__ 798#ifdef __mc68000__
799 cache_clear(virt_to_phys(newskb->data), PKT_BUF_SZ); 799 cache_clear(virt_to_phys(newskb->data), PKT_BUF_SZ);
800#endif 800#endif
801 } 801 } else {
802 else
803 skb = netdev_alloc_skb(dev, pkt_len + 2); 802 skb = netdev_alloc_skb(dev, pkt_len + 2);
803 }
804memory_squeeze: 804memory_squeeze:
805 if (skb == NULL) { 805 if (skb == NULL) {
806 /* XXX tulip.c can defer packets here!! */ 806 /* XXX tulip.c can defer packets here!! */
807 printk(KERN_WARNING "%s: i596_rx Memory squeeze, dropping packet.\n", dev->name);
808 dev->stats.rx_dropped++; 807 dev->stats.rx_dropped++;
809 } 808 } else {
810 else {
811 if (!rx_in_place) { 809 if (!rx_in_place) {
812 /* 16 byte align the data fields */ 810 /* 16 byte align the data fields */
813 skb_reserve(skb, 2); 811 skb_reserve(skb, 2);
diff --git a/drivers/net/ethernet/i825xx/lib82596.c b/drivers/net/ethernet/i825xx/lib82596.c
index f045ea4dc514..d653bac4cfc4 100644
--- a/drivers/net/ethernet/i825xx/lib82596.c
+++ b/drivers/net/ethernet/i825xx/lib82596.c
@@ -715,14 +715,12 @@ static inline int i596_rx(struct net_device *dev)
715 rbd->v_data = newskb->data; 715 rbd->v_data = newskb->data;
716 rbd->b_data = SWAP32(dma_addr); 716 rbd->b_data = SWAP32(dma_addr);
717 DMA_WBACK_INV(dev, rbd, sizeof(struct i596_rbd)); 717 DMA_WBACK_INV(dev, rbd, sizeof(struct i596_rbd));
718 } else 718 } else {
719 skb = netdev_alloc_skb_ip_align(dev, pkt_len); 719 skb = netdev_alloc_skb_ip_align(dev, pkt_len);
720 }
720memory_squeeze: 721memory_squeeze:
721 if (skb == NULL) { 722 if (skb == NULL) {
722 /* XXX tulip.c can defer packets here!! */ 723 /* XXX tulip.c can defer packets here!! */
723 printk(KERN_ERR
724 "%s: i596_rx Memory squeeze, dropping packet.\n",
725 dev->name);
726 dev->stats.rx_dropped++; 724 dev->stats.rx_dropped++;
727 } else { 725 } else {
728 if (!rx_in_place) { 726 if (!rx_in_place) {
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 328f47c92e26..029633434474 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -402,7 +402,6 @@ static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes)
402 skb_arr_rq1[index] = netdev_alloc_skb(dev, 402 skb_arr_rq1[index] = netdev_alloc_skb(dev,
403 EHEA_L_PKT_SIZE); 403 EHEA_L_PKT_SIZE);
404 if (!skb_arr_rq1[index]) { 404 if (!skb_arr_rq1[index]) {
405 netdev_info(dev, "Unable to allocate enough skb in the array\n");
406 pr->rq1_skba.os_skbs = fill_wqes - i; 405 pr->rq1_skba.os_skbs = fill_wqes - i;
407 break; 406 break;
408 } 407 }
@@ -432,10 +431,8 @@ static void ehea_init_fill_rq1(struct ehea_port_res *pr, int nr_rq1a)
432 431
433 for (i = 0; i < nr_rq1a; i++) { 432 for (i = 0; i < nr_rq1a; i++) {
434 skb_arr_rq1[i] = netdev_alloc_skb(dev, EHEA_L_PKT_SIZE); 433 skb_arr_rq1[i] = netdev_alloc_skb(dev, EHEA_L_PKT_SIZE);
435 if (!skb_arr_rq1[i]) { 434 if (!skb_arr_rq1[i])
436 netdev_info(dev, "Not enough memory to allocate skb array\n");
437 break; 435 break;
438 }
439 } 436 }
440 /* Ring doorbell */ 437 /* Ring doorbell */
441 ehea_update_rq1a(pr->qp, i - 1); 438 ehea_update_rq1a(pr->qp, i - 1);
@@ -695,10 +692,8 @@ static int ehea_proc_rwqes(struct net_device *dev,
695 692
696 skb = netdev_alloc_skb(dev, 693 skb = netdev_alloc_skb(dev,
697 EHEA_L_PKT_SIZE); 694 EHEA_L_PKT_SIZE);
698 if (!skb) { 695 if (!skb)
699 netdev_err(dev, "Not enough memory to allocate skb\n");
700 break; 696 break;
701 }
702 } 697 }
703 skb_copy_to_linear_data(skb, ((char *)cqe) + 64, 698 skb_copy_to_linear_data(skb, ((char *)cqe) + 64,
704 cqe->num_bytes_transfered - 4); 699 cqe->num_bytes_transfered - 4);
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
index 3488c6d9e6b5..2448f0d669e6 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_selftest.c
@@ -58,10 +58,9 @@ static int mlx4_en_test_loopback_xmit(struct mlx4_en_priv *priv)
58 58
59 /* build the pkt before xmit */ 59 /* build the pkt before xmit */
60 skb = netdev_alloc_skb(priv->dev, MLX4_LOOPBACK_TEST_PAYLOAD + ETH_HLEN + NET_IP_ALIGN); 60 skb = netdev_alloc_skb(priv->dev, MLX4_LOOPBACK_TEST_PAYLOAD + ETH_HLEN + NET_IP_ALIGN);
61 if (!skb) { 61 if (!skb)
62 en_err(priv, "-LOOPBACK_TEST_XMIT- failed to create skb for xmit\n");
63 return -ENOMEM; 62 return -ENOMEM;
64 } 63
65 skb_reserve(skb, NET_IP_ALIGN); 64 skb_reserve(skb, NET_IP_ALIGN);
66 65
67 ethh = (struct ethhdr *)skb_put(skb, sizeof(struct ethhdr)); 66 ethh = (struct ethhdr *)skb_put(skb, sizeof(struct ethhdr));
diff --git a/drivers/net/ethernet/natsemi/sonic.c b/drivers/net/ethernet/natsemi/sonic.c
index 46795e403467..1bd419dbda6d 100644
--- a/drivers/net/ethernet/natsemi/sonic.c
+++ b/drivers/net/ethernet/natsemi/sonic.c
@@ -424,7 +424,6 @@ static void sonic_rx(struct net_device *dev)
424 /* Malloc up new buffer. */ 424 /* Malloc up new buffer. */
425 new_skb = netdev_alloc_skb(dev, SONIC_RBSIZE + 2); 425 new_skb = netdev_alloc_skb(dev, SONIC_RBSIZE + 2);
426 if (new_skb == NULL) { 426 if (new_skb == NULL) {
427 printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name);
428 lp->stats.rx_dropped++; 427 lp->stats.rx_dropped++;
429 break; 428 break;
430 } 429 }
diff --git a/drivers/net/ethernet/netx-eth.c b/drivers/net/ethernet/netx-eth.c
index 63e7af44366f..cb9e63831500 100644
--- a/drivers/net/ethernet/netx-eth.c
+++ b/drivers/net/ethernet/netx-eth.c
@@ -152,8 +152,6 @@ static void netx_eth_receive(struct net_device *ndev)
152 152
153 skb = netdev_alloc_skb(ndev, len); 153 skb = netdev_alloc_skb(ndev, len);
154 if (unlikely(skb == NULL)) { 154 if (unlikely(skb == NULL)) {
155 printk(KERN_NOTICE "%s: Low memory, packet dropped.\n",
156 ndev->name);
157 ndev->stats.rx_dropped++; 155 ndev->stats.rx_dropped++;
158 return; 156 return;
159 } 157 }
diff --git a/drivers/net/ethernet/nuvoton/w90p910_ether.c b/drivers/net/ethernet/nuvoton/w90p910_ether.c
index 162da8975b05..539d2028e456 100644
--- a/drivers/net/ethernet/nuvoton/w90p910_ether.c
+++ b/drivers/net/ethernet/nuvoton/w90p910_ether.c
@@ -737,7 +737,6 @@ static void netdev_rx(struct net_device *dev)
737 data = ether->rdesc->recv_buf[ether->cur_rx]; 737 data = ether->rdesc->recv_buf[ether->cur_rx];
738 skb = netdev_alloc_skb(dev, length + 2); 738 skb = netdev_alloc_skb(dev, length + 2);
739 if (!skb) { 739 if (!skb) {
740 dev_err(&pdev->dev, "get skb buffer error\n");
741 ether->stats.rx_dropped++; 740 ether->stats.rx_dropped++;
742 return; 741 return;
743 } 742 }
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 0b8de12bcbca..b62262cfe4d9 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -5025,7 +5025,6 @@ static int nv_loopback_test(struct net_device *dev)
5025 pkt_len = ETH_DATA_LEN; 5025 pkt_len = ETH_DATA_LEN;
5026 tx_skb = netdev_alloc_skb(dev, pkt_len); 5026 tx_skb = netdev_alloc_skb(dev, pkt_len);
5027 if (!tx_skb) { 5027 if (!tx_skb) {
5028 netdev_err(dev, "netdev_alloc_skb() failed during loopback test\n");
5029 ret = 0; 5028 ret = 0;
5030 goto out; 5029 goto out;
5031 } 5030 }
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
index 8fd38cb6d26a..91a8fcd6c246 100644
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -312,7 +312,6 @@ static void ql_release_to_lrg_buf_free_list(struct ql3_adapter *qdev,
312 lrg_buf_cb->skb = netdev_alloc_skb(qdev->ndev, 312 lrg_buf_cb->skb = netdev_alloc_skb(qdev->ndev,
313 qdev->lrg_buffer_len); 313 qdev->lrg_buffer_len);
314 if (unlikely(!lrg_buf_cb->skb)) { 314 if (unlikely(!lrg_buf_cb->skb)) {
315 netdev_err(qdev->ndev, "failed netdev_alloc_skb()\n");
316 qdev->lrg_buf_skb_check++; 315 qdev->lrg_buf_skb_check++;
317 } else { 316 } else {
318 /* 317 /*
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index b13ab544a7eb..1dd778a6f01e 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -1211,8 +1211,6 @@ static void ql_update_sbq(struct ql_adapter *qdev, struct rx_ring *rx_ring)
1211 netdev_alloc_skb(qdev->ndev, 1211 netdev_alloc_skb(qdev->ndev,
1212 SMALL_BUFFER_SIZE); 1212 SMALL_BUFFER_SIZE);
1213 if (sbq_desc->p.skb == NULL) { 1213 if (sbq_desc->p.skb == NULL) {
1214 netif_err(qdev, probe, qdev->ndev,
1215 "Couldn't get an skb.\n");
1216 rx_ring->sbq_clean_idx = clean_idx; 1214 rx_ring->sbq_clean_idx = clean_idx;
1217 return; 1215 return;
1218 } 1216 }
@@ -1519,8 +1517,6 @@ static void ql_process_mac_rx_page(struct ql_adapter *qdev,
1519 1517
1520 skb = netdev_alloc_skb(ndev, length); 1518 skb = netdev_alloc_skb(ndev, length);
1521 if (!skb) { 1519 if (!skb) {
1522 netif_err(qdev, drv, qdev->ndev,
1523 "Couldn't get an skb, need to unwind!.\n");
1524 rx_ring->rx_dropped++; 1520 rx_ring->rx_dropped++;
1525 put_page(lbq_desc->p.pg_chunk.page); 1521 put_page(lbq_desc->p.pg_chunk.page);
1526 return; 1522 return;
@@ -1605,8 +1601,6 @@ static void ql_process_mac_rx_skb(struct ql_adapter *qdev,
1605 /* Allocate new_skb and copy */ 1601 /* Allocate new_skb and copy */
1606 new_skb = netdev_alloc_skb(qdev->ndev, length + NET_IP_ALIGN); 1602 new_skb = netdev_alloc_skb(qdev->ndev, length + NET_IP_ALIGN);
1607 if (new_skb == NULL) { 1603 if (new_skb == NULL) {
1608 netif_err(qdev, probe, qdev->ndev,
1609 "No skb available, drop the packet.\n");
1610 rx_ring->rx_dropped++; 1604 rx_ring->rx_dropped++;
1611 return; 1605 return;
1612 } 1606 }
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index d5622ab5a1da..e9dc84943cfc 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -350,7 +350,6 @@ static int r6040_alloc_rxbufs(struct net_device *dev)
350 do { 350 do {
351 skb = netdev_alloc_skb(dev, MAX_BUF_SIZE); 351 skb = netdev_alloc_skb(dev, MAX_BUF_SIZE);
352 if (!skb) { 352 if (!skb) {
353 netdev_err(dev, "failed to alloc skb for rx\n");
354 rc = -ENOMEM; 353 rc = -ENOMEM;
355 goto err_exit; 354 goto err_exit;
356 } 355 }
diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c
index 1276ac71353a..3ccedeb8aba0 100644
--- a/drivers/net/ethernet/realtek/8139too.c
+++ b/drivers/net/ethernet/realtek/8139too.c
@@ -2041,8 +2041,6 @@ keep_pkt:
2041 2041
2042 netif_receive_skb (skb); 2042 netif_receive_skb (skb);
2043 } else { 2043 } else {
2044 if (net_ratelimit())
2045 netdev_warn(dev, "Memory squeeze, dropping packet\n");
2046 dev->stats.rx_dropped++; 2044 dev->stats.rx_dropped++;
2047 } 2045 }
2048 received++; 2046 received++;
diff --git a/drivers/net/ethernet/realtek/atp.c b/drivers/net/ethernet/realtek/atp.c
index 9f2d416de750..d77d60ea8202 100644
--- a/drivers/net/ethernet/realtek/atp.c
+++ b/drivers/net/ethernet/realtek/atp.c
@@ -782,8 +782,6 @@ static void net_rx(struct net_device *dev)
782 782
783 skb = netdev_alloc_skb(dev, pkt_len + 2); 783 skb = netdev_alloc_skb(dev, pkt_len + 2);
784 if (skb == NULL) { 784 if (skb == NULL) {
785 printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n",
786 dev->name);
787 dev->stats.rx_dropped++; 785 dev->stats.rx_dropped++;
788 goto done; 786 goto done;
789 } 787 }
diff --git a/drivers/net/ethernet/seeq/ether3.c b/drivers/net/ethernet/seeq/ether3.c
index 3aca57853ed4..bdac936a68bc 100644
--- a/drivers/net/ethernet/seeq/ether3.c
+++ b/drivers/net/ethernet/seeq/ether3.c
@@ -651,8 +651,11 @@ if (next_ptr < RX_START || next_ptr >= RX_END) {
651 skb->protocol = eth_type_trans(skb, dev); 651 skb->protocol = eth_type_trans(skb, dev);
652 netif_rx(skb); 652 netif_rx(skb);
653 received ++; 653 received ++;
654 } else 654 } else {
655 goto dropping; 655 ether3_outw(next_ptr >> 8, REG_RECVEND);
656 dev->stats.rx_dropped++;
657 goto done;
658 }
656 } else { 659 } else {
657 struct net_device_stats *stats = &dev->stats; 660 struct net_device_stats *stats = &dev->stats;
658 ether3_outw(next_ptr >> 8, REG_RECVEND); 661 ether3_outw(next_ptr >> 8, REG_RECVEND);
@@ -679,21 +682,6 @@ done:
679 } 682 }
680 683
681 return maxcnt; 684 return maxcnt;
682
683dropping:{
684 static unsigned long last_warned;
685
686 ether3_outw(next_ptr >> 8, REG_RECVEND);
687 /*
688 * Don't print this message too many times...
689 */
690 if (time_after(jiffies, last_warned + 10 * HZ)) {
691 last_warned = jiffies;
692 printk("%s: memory squeeze, dropping packet.\n", dev->name);
693 }
694 dev->stats.rx_dropped++;
695 goto done;
696 }
697} 685}
698 686
699/* 687/*
diff --git a/drivers/net/ethernet/seeq/sgiseeq.c b/drivers/net/ethernet/seeq/sgiseeq.c
index 0fde9ca28269..0ad5694b41f8 100644
--- a/drivers/net/ethernet/seeq/sgiseeq.c
+++ b/drivers/net/ethernet/seeq/sgiseeq.c
@@ -381,8 +381,6 @@ memory_squeeze:
381 dev->stats.rx_packets++; 381 dev->stats.rx_packets++;
382 dev->stats.rx_bytes += len; 382 dev->stats.rx_bytes += len;
383 } else { 383 } else {
384 printk(KERN_NOTICE "%s: Memory squeeze, deferring packet.\n",
385 dev->name);
386 dev->stats.rx_dropped++; 384 dev->stats.rx_dropped++;
387 } 385 }
388 } else { 386 } else {
diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c
index efca14eaefa9..e45829628d5f 100644
--- a/drivers/net/ethernet/sis/sis900.c
+++ b/drivers/net/ethernet/sis/sis900.c
@@ -1841,15 +1841,12 @@ refill_rx_ring:
1841 entry = sis_priv->dirty_rx % NUM_RX_DESC; 1841 entry = sis_priv->dirty_rx % NUM_RX_DESC;
1842 1842
1843 if (sis_priv->rx_skbuff[entry] == NULL) { 1843 if (sis_priv->rx_skbuff[entry] == NULL) {
1844 if ((skb = netdev_alloc_skb(net_dev, RX_BUF_SIZE)) == NULL) { 1844 skb = netdev_alloc_skb(net_dev, RX_BUF_SIZE);
1845 if (skb == NULL) {
1845 /* not enough memory for skbuff, this makes a 1846 /* not enough memory for skbuff, this makes a
1846 * "hole" on the buffer ring, it is not clear 1847 * "hole" on the buffer ring, it is not clear
1847 * how the hardware will react to this kind 1848 * how the hardware will react to this kind
1848 * of degenerated buffer */ 1849 * of degenerated buffer */
1849 if (netif_msg_rx_err(sis_priv))
1850 printk(KERN_INFO "%s: Memory squeeze, "
1851 "deferring packet.\n",
1852 net_dev->name);
1853 net_dev->stats.rx_dropped++; 1850 net_dev->stats.rx_dropped++;
1854 break; 1851 break;
1855 } 1852 }
diff --git a/drivers/net/ethernet/smsc/smc9194.c b/drivers/net/ethernet/smsc/smc9194.c
index 50823da9dc1e..e85c2e7e8246 100644
--- a/drivers/net/ethernet/smsc/smc9194.c
+++ b/drivers/net/ethernet/smsc/smc9194.c
@@ -1223,9 +1223,7 @@ static void smc_rcv(struct net_device *dev)
1223 dev->stats.multicast++; 1223 dev->stats.multicast++;
1224 1224
1225 skb = netdev_alloc_skb(dev, packet_length + 5); 1225 skb = netdev_alloc_skb(dev, packet_length + 5);
1226
1227 if ( skb == NULL ) { 1226 if ( skb == NULL ) {
1228 printk(KERN_NOTICE CARDNAME ": Low memory, packet dropped.\n");
1229 dev->stats.rx_dropped++; 1227 dev->stats.rx_dropped++;
1230 goto done; 1228 goto done;
1231 } 1229 }
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 591650a8de38..dfbf978315df 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -465,8 +465,6 @@ static inline void smc_rcv(struct net_device *dev)
465 */ 465 */
466 skb = netdev_alloc_skb(dev, packet_len); 466 skb = netdev_alloc_skb(dev, packet_len);
467 if (unlikely(skb == NULL)) { 467 if (unlikely(skb == NULL)) {
468 printk(KERN_NOTICE "%s: Low memory, packet dropped.\n",
469 dev->name);
470 SMC_WAIT_MMU_BUSY(lp); 468 SMC_WAIT_MMU_BUSY(lp);
471 SMC_SET_MMU_CMD(lp, MC_RELEASE); 469 SMC_SET_MMU_CMD(lp, MC_RELEASE);
472 dev->stats.rx_dropped++; 470 dev->stats.rx_dropped++;
diff --git a/drivers/net/ethernet/smsc/smsc9420.c b/drivers/net/ethernet/smsc/smsc9420.c
index d457fa2d7509..ffa5c4ad1210 100644
--- a/drivers/net/ethernet/smsc/smsc9420.c
+++ b/drivers/net/ethernet/smsc/smsc9420.c
@@ -848,10 +848,8 @@ static int smsc9420_alloc_rx_buffer(struct smsc9420_pdata *pd, int index)
848 BUG_ON(pd->rx_buffers[index].skb); 848 BUG_ON(pd->rx_buffers[index].skb);
849 BUG_ON(pd->rx_buffers[index].mapping); 849 BUG_ON(pd->rx_buffers[index].mapping);
850 850
851 if (unlikely(!skb)) { 851 if (unlikely(!skb))
852 smsc_warn(RX_ERR, "Failed to allocate new skb!");
853 return -ENOMEM; 852 return -ENOMEM;
854 }
855 853
856 mapping = pci_map_single(pd->pdev, skb_tail_pointer(skb), 854 mapping = pci_map_single(pd->pdev, skb_tail_pointer(skb),
857 PKT_BUF_SZ, PCI_DMA_FROMDEVICE); 855 PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
diff --git a/drivers/net/ethernet/sun/sunqe.c b/drivers/net/ethernet/sun/sunqe.c
index 49bf3e2eb652..8182591bc187 100644
--- a/drivers/net/ethernet/sun/sunqe.c
+++ b/drivers/net/ethernet/sun/sunqe.c
@@ -414,7 +414,7 @@ static void qe_rx(struct sunqe *qep)
414 struct qe_rxd *this; 414 struct qe_rxd *this;
415 struct sunqe_buffers *qbufs = qep->buffers; 415 struct sunqe_buffers *qbufs = qep->buffers;
416 __u32 qbufs_dvma = qep->buffers_dvma; 416 __u32 qbufs_dvma = qep->buffers_dvma;
417 int elem = qep->rx_new, drops = 0; 417 int elem = qep->rx_new;
418 u32 flags; 418 u32 flags;
419 419
420 this = &rxbase[elem]; 420 this = &rxbase[elem];
@@ -436,7 +436,6 @@ static void qe_rx(struct sunqe *qep)
436 } else { 436 } else {
437 skb = netdev_alloc_skb(dev, len + 2); 437 skb = netdev_alloc_skb(dev, len + 2);
438 if (skb == NULL) { 438 if (skb == NULL) {
439 drops++;
440 dev->stats.rx_dropped++; 439 dev->stats.rx_dropped++;
441 } else { 440 } else {
442 skb_reserve(skb, 2); 441 skb_reserve(skb, 2);
@@ -456,8 +455,6 @@ static void qe_rx(struct sunqe *qep)
456 this = &rxbase[elem]; 455 this = &rxbase[elem];
457 } 456 }
458 qep->rx_new = elem; 457 qep->rx_new = elem;
459 if (drops)
460 printk(KERN_NOTICE "%s: Memory squeeze, deferring packet.\n", qep->dev->name);
461} 458}
462 459
463static void qe_tx_reclaim(struct sunqe *qep); 460static void qe_tx_reclaim(struct sunqe *qep);
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
index e15cc71b826d..e8824cea093b 100644
--- a/drivers/net/ethernet/tehuti/tehuti.c
+++ b/drivers/net/ethernet/tehuti/tehuti.c
@@ -1102,10 +1102,9 @@ static void bdx_rx_alloc_skbs(struct bdx_priv *priv, struct rxf_fifo *f)
1102 dno = bdx_rxdb_available(db) - 1; 1102 dno = bdx_rxdb_available(db) - 1;
1103 while (dno > 0) { 1103 while (dno > 0) {
1104 skb = netdev_alloc_skb(priv->ndev, f->m.pktsz + NET_IP_ALIGN); 1104 skb = netdev_alloc_skb(priv->ndev, f->m.pktsz + NET_IP_ALIGN);
1105 if (!skb) { 1105 if (!skb)
1106 pr_err("NO MEM: netdev_alloc_skb failed\n");
1107 break; 1106 break;
1108 } 1107
1109 skb_reserve(skb, NET_IP_ALIGN); 1108 skb_reserve(skb, NET_IP_ALIGN);
1110 1109
1111 idx = bdx_rxdb_alloc_elem(db); 1110 idx = bdx_rxdb_alloc_elem(db);
diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c
index 22725386c5de..bdda36f8e541 100644
--- a/drivers/net/ethernet/ti/tlan.c
+++ b/drivers/net/ethernet/ti/tlan.c
@@ -1911,10 +1911,8 @@ static void tlan_reset_lists(struct net_device *dev)
1911 list->frame_size = TLAN_MAX_FRAME_SIZE; 1911 list->frame_size = TLAN_MAX_FRAME_SIZE;
1912 list->buffer[0].count = TLAN_MAX_FRAME_SIZE | TLAN_LAST_BUFFER; 1912 list->buffer[0].count = TLAN_MAX_FRAME_SIZE | TLAN_LAST_BUFFER;
1913 skb = netdev_alloc_skb_ip_align(dev, TLAN_MAX_FRAME_SIZE + 5); 1913 skb = netdev_alloc_skb_ip_align(dev, TLAN_MAX_FRAME_SIZE + 5);
1914 if (!skb) { 1914 if (!skb)
1915 netdev_err(dev, "Out of memory for received data\n");
1916 break; 1915 break;
1917 }
1918 1916
1919 list->buffer[0].address = pci_map_single(priv->pci_dev, 1917 list->buffer[0].address = pci_map_single(priv->pci_dev,
1920 skb->data, 1918 skb->data,
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 9fc2ada4c3c2..5ac43e4ace25 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -273,11 +273,9 @@ static int temac_dma_bd_init(struct net_device *ndev)
273 273
274 skb = netdev_alloc_skb_ip_align(ndev, 274 skb = netdev_alloc_skb_ip_align(ndev,
275 XTE_MAX_JUMBO_FRAME_SIZE); 275 XTE_MAX_JUMBO_FRAME_SIZE);
276 276 if (!skb)
277 if (skb == 0) {
278 dev_err(&ndev->dev, "alloc_skb error %d\n", i);
279 goto out; 277 goto out;
280 } 278
281 lp->rx_skb[i] = skb; 279 lp->rx_skb[i] = skb;
282 /* returns physical address of skb->data */ 280 /* returns physical address of skb->data */
283 lp->rx_bd_v[i].phys = dma_map_single(ndev->dev.parent, 281 lp->rx_bd_v[i].phys = dma_map_single(ndev->dev.parent,
@@ -789,9 +787,7 @@ static void ll_temac_recv(struct net_device *ndev)
789 787
790 new_skb = netdev_alloc_skb_ip_align(ndev, 788 new_skb = netdev_alloc_skb_ip_align(ndev,
791 XTE_MAX_JUMBO_FRAME_SIZE); 789 XTE_MAX_JUMBO_FRAME_SIZE);
792 790 if (!new_skb) {
793 if (new_skb == 0) {
794 dev_err(&ndev->dev, "no memory for new sk_buff\n");
795 spin_unlock_irqrestore(&lp->rx_lock, flags); 791 spin_unlock_irqrestore(&lp->rx_lock, flags);
796 return; 792 return;
797 } 793 }
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 278c9db3b5b8..397d4a6a1f30 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -235,10 +235,8 @@ static int axienet_dma_bd_init(struct net_device *ndev)
235 ((i + 1) % RX_BD_NUM); 235 ((i + 1) % RX_BD_NUM);
236 236
237 skb = netdev_alloc_skb_ip_align(ndev, lp->max_frm_size); 237 skb = netdev_alloc_skb_ip_align(ndev, lp->max_frm_size);
238 if (!skb) { 238 if (!skb)
239 dev_err(&ndev->dev, "alloc_skb error %d\n", i);
240 goto out; 239 goto out;
241 }
242 240
243 lp->rx_bd_v[i].sw_id_offset = (u32) skb; 241 lp->rx_bd_v[i].sw_id_offset = (u32) skb;
244 lp->rx_bd_v[i].phys = dma_map_single(ndev->dev.parent, 242 lp->rx_bd_v[i].phys = dma_map_single(ndev->dev.parent,
@@ -777,10 +775,9 @@ static void axienet_recv(struct net_device *ndev)
777 packets++; 775 packets++;
778 776
779 new_skb = netdev_alloc_skb_ip_align(ndev, lp->max_frm_size); 777 new_skb = netdev_alloc_skb_ip_align(ndev, lp->max_frm_size);
780 if (!new_skb) { 778 if (!new_skb)
781 dev_err(&ndev->dev, "no memory for new sk_buff\n");
782 return; 779 return;
783 } 780
784 cur_p->phys = dma_map_single(ndev->dev.parent, new_skb->data, 781 cur_p->phys = dma_map_single(ndev->dev.parent, new_skb->data,
785 lp->max_frm_size, 782 lp->max_frm_size,
786 DMA_FROM_DEVICE); 783 DMA_FROM_DEVICE);
diff --git a/drivers/net/ethernet/xircom/xirc2ps_cs.c b/drivers/net/ethernet/xircom/xirc2ps_cs.c
index 98e09d0d3ce2..76210abf2e9b 100644
--- a/drivers/net/ethernet/xircom/xirc2ps_cs.c
+++ b/drivers/net/ethernet/xircom/xirc2ps_cs.c
@@ -1041,7 +1041,6 @@ xirc2ps_interrupt(int irq, void *dev_id)
1041 /* 1 extra so we can use insw */ 1041 /* 1 extra so we can use insw */
1042 skb = netdev_alloc_skb(dev, pktlen + 3); 1042 skb = netdev_alloc_skb(dev, pktlen + 3);
1043 if (!skb) { 1043 if (!skb) {
1044 pr_notice("low memory, packet dropped (size=%u)\n", pktlen);
1045 dev->stats.rx_dropped++; 1044 dev->stats.rx_dropped++;
1046 } else { /* okay get the packet */ 1045 } else { /* okay get the packet */
1047 skb_reserve(skb, 2); 1046 skb_reserve(skb, 2);