drivers:net: Remove unnecessary OOM messages after netdev_alloc_skb
authorJoe Perches <joe@perches.com>
Fri, 8 Mar 2013 15:03:25 +0000 (15:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Mar 2013 21:09:19 +0000 (16:09 -0500)
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>
47 files changed:
drivers/net/caif/caif_shmcore.c
drivers/net/ethernet/adi/bfin_mac.c
drivers/net/ethernet/amd/7990.c
drivers/net/ethernet/amd/a2065.c
drivers/net/ethernet/amd/am79c961a.c
drivers/net/ethernet/amd/ariadne.c
drivers/net/ethernet/amd/atarilance.c
drivers/net/ethernet/amd/au1000_eth.c
drivers/net/ethernet/amd/declance.c
drivers/net/ethernet/amd/pcnet32.c
drivers/net/ethernet/amd/sun3lance.c
drivers/net/ethernet/amd/sunlance.c
drivers/net/ethernet/atheros/atl1e/atl1e_main.c
drivers/net/ethernet/atheros/atlx/atl2.c
drivers/net/ethernet/broadcom/bgmac.c
drivers/net/ethernet/broadcom/sb1250-mac.c
drivers/net/ethernet/cadence/at91_ether.c
drivers/net/ethernet/cirrus/cs89x0.c
drivers/net/ethernet/dlink/dl2k.c
drivers/net/ethernet/freescale/fec.c
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
drivers/net/ethernet/fujitsu/fmvj18x_cs.c
drivers/net/ethernet/i825xx/82596.c
drivers/net/ethernet/i825xx/lib82596.c
drivers/net/ethernet/ibm/ehea/ehea_main.c
drivers/net/ethernet/mellanox/mlx4/en_selftest.c
drivers/net/ethernet/natsemi/sonic.c
drivers/net/ethernet/netx-eth.c
drivers/net/ethernet/nuvoton/w90p910_ether.c
drivers/net/ethernet/nvidia/forcedeth.c
drivers/net/ethernet/qlogic/qla3xxx.c
drivers/net/ethernet/qlogic/qlge/qlge_main.c
drivers/net/ethernet/rdc/r6040.c
drivers/net/ethernet/realtek/8139too.c
drivers/net/ethernet/realtek/atp.c
drivers/net/ethernet/seeq/ether3.c
drivers/net/ethernet/seeq/sgiseeq.c
drivers/net/ethernet/sis/sis900.c
drivers/net/ethernet/smsc/smc9194.c
drivers/net/ethernet/smsc/smc91x.c
drivers/net/ethernet/smsc/smsc9420.c
drivers/net/ethernet/sun/sunqe.c
drivers/net/ethernet/tehuti/tehuti.c
drivers/net/ethernet/ti/tlan.c
drivers/net/ethernet/xilinx/ll_temac_main.c
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
drivers/net/ethernet/xircom/xirc2ps_cs.c

index bce8bac311c99d0d1d9a2f3a07dc6c0a71fee836..cca2afc945af14b6963840dec43e5886b3f112da 100644 (file)
@@ -338,11 +338,8 @@ static void shm_rx_work_func(struct work_struct *rx_work)
                        /* Get a suitable CAIF packet and copy in data. */
                        skb = netdev_alloc_skb(pshm_drv->pshm_dev->pshm_netdev,
                                                        frm_pck_len + 1);
-
-                       if (skb == NULL) {
-                               pr_info("OOM: Try next frame in descriptor\n");
+                       if (skb == NULL)
                                break;
-                       }
 
                        p = skb_put(skb, frm_pck_len);
                        memcpy(p, pbuf->desc_vptr + frm_pck_ofs, frm_pck_len);
index a175d0be1ae1a23e1c2f0fc920efd039a65b02ba..ee705771bd2cb43658fd55edffa5811a179b6c80 100644 (file)
@@ -188,10 +188,9 @@ static int desc_list_init(struct net_device *dev)
 
                /* allocate a new skb for next time receive */
                new_skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN);
-               if (!new_skb) {
-                       pr_notice("init: low on mem - packet dropped\n");
+               if (!new_skb)
                        goto init_error;
-               }
+
                skb_reserve(new_skb, NET_IP_ALIGN);
                /* Invidate the data cache of skb->data range when it is write back
                 * cache. It will prevent overwritting the new data from DMA
@@ -1236,7 +1235,6 @@ static void bfin_mac_rx(struct net_device *dev)
 
        new_skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN);
        if (!new_skb) {
-               netdev_notice(dev, "rx: low on mem - packet dropped\n");
                dev->stats.rx_dropped++;
                goto out;
        }
index 6e722dc37db7aa69ec639f47540ae5a9d0e1572d..65926a956575acfc42a49428a9653c539199ec20 100644 (file)
@@ -318,8 +318,6 @@ static int lance_rx (struct net_device *dev)
                        struct sk_buff *skb = netdev_alloc_skb(dev, len + 2);
 
                         if (!skb) {
-                                printk ("%s: Memory squeeze, deferring packet.\n",
-                                        dev->name);
                                 dev->stats.rx_dropped++;
                                 rd->mblength = 0;
                                 rd->rmd1_bits = LE_R1_OWN;
index 3789affbc0e5cbff032f5cf225725fd4a80a013d..0866e7627433c1148037b9ade8064351c2819722 100644 (file)
@@ -293,7 +293,6 @@ static int lance_rx(struct net_device *dev)
                        struct sk_buff *skb = netdev_alloc_skb(dev, len + 2);
 
                        if (!skb) {
-                               netdev_warn(dev, "Memory squeeze, deferring packet\n");
                                dev->stats.rx_dropped++;
                                rd->mblength = 0;
                                rd->rmd1_bits = LE_R1_OWN;
index 60e2b701afe726f05b041f0694ed6b454ddd05bd..9793767996a2a8e836259adde6fa0a342cd0f4d0 100644 (file)
@@ -528,7 +528,6 @@ am79c961_rx(struct net_device *dev, struct dev_priv *priv)
                        dev->stats.rx_packets++;
                } else {
                        am_writeword (dev, hdraddr + 2, RMD_OWN);
-                       printk (KERN_WARNING "%s: memory squeeze, dropping packet.\n", dev->name);
                        dev->stats.rx_dropped++;
                        break;
                }
index 98f4522fd17b7e69d3c524568d4b8c991ca80533..c178eb4c81668ad3a1b033f11c9070b9e63c934d 100644 (file)
@@ -193,7 +193,6 @@ static int ariadne_rx(struct net_device *dev)
 
                        skb = netdev_alloc_skb(dev, pkt_len + 2);
                        if (skb == NULL) {
-                               netdev_warn(dev, "Memory squeeze, deferring packet\n");
                                for (i = 0; i < RX_RING_SIZE; i++)
                                        if (lowb(priv->rx_ring[(entry + i) % RX_RING_SIZE]->RMD1) & RF_OWN)
                                                break;
index 84219df72f5122bf9bcd3d4ce103bca6d197fbe4..ab9bedb8d2760be2739df30001aca7517f5dca88 100644 (file)
@@ -996,8 +996,6 @@ static int lance_rx( struct net_device *dev )
                        else {
                                skb = netdev_alloc_skb(dev, pkt_len + 2);
                                if (skb == NULL) {
-                                       DPRINTK( 1, ( "%s: Memory squeeze, deferring packet.\n",
-                                                                 dev->name ));
                                        for( i = 0; i < RX_RING_SIZE; i++ )
                                                if (MEM->rx_head[(entry+i) & RX_RING_MOD_MASK].flag &
                                                        RMD1_OWN_CHIP)
index de774d419144c1fb86ea558b087a627f9f04a6dc..688aede742c7d0068d061f377582253f52280d12 100644 (file)
@@ -727,7 +727,6 @@ static int au1000_rx(struct net_device *dev)
                        frmlen -= 4; /* Remove FCS */
                        skb = netdev_alloc_skb(dev, frmlen + 2);
                        if (skb == NULL) {
-                               netdev_err(dev, "Memory squeeze, dropping packet.\n");
                                dev->stats.rx_dropped++;
                                continue;
                        }
index baca0bd1b39361b7d5ce7ff90a82cc43064fce7f..3d86ffeb4e15919b0b3efb21205b4195127ba79d 100644 (file)
@@ -607,8 +607,6 @@ static int lance_rx(struct net_device *dev)
                        skb = netdev_alloc_skb(dev, len + 2);
 
                        if (skb == 0) {
-                               printk("%s: Memory squeeze, deferring packet.\n",
-                                      dev->name);
                                dev->stats.rx_dropped++;
                                *rds_ptr(rd, mblength, lp->type) = 0;
                                *rds_ptr(rd, rmd1, lp->type) =
index 797f847edf13fd4dffc3349e8d4615a10dea3b97..ed21307276430895fadc736b16f8539afe1713cf 100644 (file)
@@ -1166,7 +1166,6 @@ static void pcnet32_rx_entry(struct net_device *dev,
                skb = netdev_alloc_skb(dev, pkt_len + NET_IP_ALIGN);
 
        if (skb == NULL) {
-               netif_err(lp, drv, dev, "Memory squeeze, dropping packet\n");
                dev->stats.rx_dropped++;
                return;
        }
index 74b3891b64836485143db3dca11948f29f95b683..de412d331a72b895a9842b9f6618032e73943325 100644 (file)
@@ -812,9 +812,6 @@ static int lance_rx( struct net_device *dev )
                        else {
                                skb = netdev_alloc_skb(dev, pkt_len + 2);
                                if (skb == NULL) {
-                                       DPRINTK( 1, ( "%s: Memory squeeze, deferring packet.\n",
-                                                     dev->name ));
-
                                        dev->stats.rx_dropped++;
                                        head->msg_length = 0;
                                        head->flag |= RMD1_OWN_CHIP;
index 6a40290d3727579f2a3fd0b1009e5ef3d2323e06..70d543063993091e1fa23d1ffec4b8436d05d2a0 100644 (file)
@@ -536,8 +536,6 @@ static void lance_rx_dvma(struct net_device *dev)
                        skb = netdev_alloc_skb(dev, len + 2);
 
                        if (skb == NULL) {
-                               printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n",
-                                      dev->name);
                                dev->stats.rx_dropped++;
                                rd->mblength = 0;
                                rd->rmd1_bits = LE_R1_OWN;
@@ -708,8 +706,6 @@ static void lance_rx_pio(struct net_device *dev)
                        skb = netdev_alloc_skb(dev, len + 2);
 
                        if (skb == NULL) {
-                               printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n",
-                                      dev->name);
                                dev->stats.rx_dropped++;
                                sbus_writew(0, &rd->mblength);
                                sbus_writeb(LE_R1_OWN, &rd->rmd1_bits);
index 92f4734f860d3f18ece977946b4562c028df35e6..e1f1b2a0673ab6c5cb84cbd57456711bd9f8ca41 100644 (file)
@@ -1420,11 +1420,9 @@ static void atl1e_clean_rx_irq(struct atl1e_adapter *adapter, u8 que,
                        packet_size = ((prrs->word1 >> RRS_PKT_SIZE_SHIFT) &
                                        RRS_PKT_SIZE_MASK) - 4; /* CRC */
                        skb = netdev_alloc_skb_ip_align(netdev, packet_size);
-                       if (skb == NULL) {
-                               netdev_warn(netdev,
-                                           "Memory squeeze, deferring packet\n");
+                       if (skb == NULL)
                                goto skip_pkt;
-                       }
+
                        memcpy(skb->data, (u8 *)(prrs + 1), packet_size);
                        skb_put(skb, packet_size);
                        skb->protocol = eth_type_trans(skb, netdev);
index 1278b47022e0d2cf2b406e7adbefa7168c25274b..a046b6ff847c8ca9b26c7ea51cd41918180d2072 100644 (file)
@@ -437,9 +437,6 @@ static void atl2_intr_rx(struct atl2_adapter *adapter)
                        /* alloc new buffer */
                        skb = netdev_alloc_skb_ip_align(netdev, rx_size);
                        if (NULL == skb) {
-                               printk(KERN_WARNING
-                                       "%s: Mem squeeze, deferring packet.\n",
-                                       netdev->name);
                                /*
                                 * Check that some rx space is free. If not,
                                 * free one and mark stats->rx_dropped++.
index d6cb376b71e602275bab67c70b03957ffaffbd6f..eec0af45b85996b2cdb02a2509563e944f93a742 100644 (file)
@@ -245,10 +245,8 @@ static int bgmac_dma_rx_skb_for_slot(struct bgmac *bgmac,
 
        /* Alloc skb */
        slot->skb = netdev_alloc_skb(bgmac->net_dev, BGMAC_RX_BUF_SIZE);
-       if (!slot->skb) {
-               bgmac_err(bgmac, "Allocation of skb failed!\n");
+       if (!slot->skb)
                return -ENOMEM;
-       }
 
        /* Poison - if everything goes fine, hardware will overwrite it */
        rx = (struct bgmac_rx_header *)slot->skb->data;
index e9b35da375cb4c3b7bf5c31a1b03d18097ad44c1..e80bfb60c3efb922a76149ce81b9a120c60fe9ce 100644 (file)
@@ -831,11 +831,8 @@ static int sbdma_add_rcvbuffer(struct sbmac_softc *sc, struct sbmacdma *d,
                sb_new = netdev_alloc_skb(dev, ENET_PACKET_SIZE +
                                               SMP_CACHE_BYTES * 2 +
                                               NET_IP_ALIGN);
-               if (sb_new == NULL) {
-                       pr_info("%s: sk_buff allocation failed\n",
-                              d->sbdma_eth->sbm_dev->name);
+               if (sb_new == NULL)
                        return -ENOBUFS;
-               }
 
                sbdma_align_skb(sb_new, SMP_CACHE_BYTES, NET_IP_ALIGN);
        }
index 1a57e16ada7c5fce42e2b2e9ba4cf272431a1f5f..5bd7786e8413c091e6f1cd9ea13b183b2e093ef5 100644 (file)
@@ -209,7 +209,6 @@ static void at91ether_rx(struct net_device *dev)
                        netif_rx(skb);
                } else {
                        lp->stats.rx_dropped++;
-                       netdev_notice(dev, "Memory squeeze, dropping packet.\n");
                }
 
                if (lp->rx_ring[lp->rx_tail].ctrl & MACB_BIT(RX_MHASH_MATCH))
index 73c1c8c33dd1bdb42c90552f232d6dc4354cd163..aaa0499aa19c8d6795bbd2436507a7f89b887153 100644 (file)
@@ -478,9 +478,6 @@ dma_rx(struct net_device *dev)
        /* Malloc up new buffer. */
        skb = netdev_alloc_skb(dev, length + 2);
        if (skb == NULL) {
-               /* I don't think we want to do this to a stressed system */
-               cs89_dbg(0, err, "%s: Memory squeeze, dropping packet\n",
-                        dev->name);
                dev->stats.rx_dropped++;
 
                /* AKPM: advance bp to the next frame */
@@ -731,9 +728,6 @@ net_rx(struct net_device *dev)
        /* Malloc up new buffer. */
        skb = netdev_alloc_skb(dev, length + 2);
        if (skb == NULL) {
-#if 0          /* Again, this seems a cruel thing to do */
-               pr_warn("%s: Memory squeeze, dropping packet\n", dev->name);
-#endif
                dev->stats.rx_dropped++;
                return;
        }
index 110d26f4c6028f37d773576d4dd3a5a2d13fd5b3..afa8e3af2c4d6840a9eee8c9c46d0e3f6df22a02 100644 (file)
@@ -580,12 +580,9 @@ alloc_list (struct net_device *dev)
 
                skb = netdev_alloc_skb_ip_align(dev, np->rx_buf_sz);
                np->rx_skbuff[i] = skb;
-               if (skb == NULL) {
-                       printk (KERN_ERR
-                               "%s: alloc_list: allocate Rx buffer error! ",
-                               dev->name);
+               if (skb == NULL)
                        break;
-               }
+
                /* Rubicon now supports 40 bits of addressing space. */
                np->rx_ring[i].fraginfo =
                    cpu_to_le64 ( pci_map_single (
index 069a155d16ed40c57da5e70a8088eef767d0690b..f97c60f78089559d7bd9b107eea2c6089e6d74be 100644 (file)
@@ -743,8 +743,6 @@ fec_enet_rx(struct net_device *ndev, int budget)
                skb = netdev_alloc_skb(ndev, pkt_len - 4 + NET_IP_ALIGN);
 
                if (unlikely(!skb)) {
-                       printk("%s: Memory squeeze, dropping packet.\n",
-                                       ndev->name);
                        ndev->stats.rx_dropped++;
                } else {
                        skb_reserve(skb, NET_IP_ALIGN);
index 46df28893c10649e0de42354671559b37bfef0c2..edc120094c340bbe61dbd33f4a3cbbf9b9a3e8d8 100644 (file)
@@ -177,8 +177,6 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
                                received++;
                                netif_receive_skb(skb);
                        } else {
-                               dev_warn(fep->dev,
-                                        "Memory squeeze, dropping packet.\n");
                                fep->stats.rx_dropped++;
                                skbn = skb;
                        }
@@ -309,8 +307,6 @@ static int fs_enet_rx_non_napi(struct net_device *dev)
                                received++;
                                netif_rx(skb);
                        } else {
-                               dev_warn(fep->dev,
-                                        "Memory squeeze, dropping packet.\n");
                                fep->stats.rx_dropped++;
                                skbn = skb;
                        }
@@ -505,11 +501,9 @@ void fs_init_bds(struct net_device *dev)
         */
        for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) {
                skb = netdev_alloc_skb(dev, ENET_RX_FRSIZE);
-               if (skb == NULL) {
-                       dev_warn(fep->dev,
-                                "Memory squeeze, unable to allocate skb\n");
+               if (skb == NULL)
                        break;
-               }
+
                skb_align(skb, ENET_RX_ALIGN);
                fep->rx_skbuff[i] = skb;
                CBDW_BUFADDR(bdp,
@@ -593,13 +587,8 @@ static struct sk_buff *tx_skb_align_workaround(struct net_device *dev,
 
        /* Alloc new skb */
        new_skb = netdev_alloc_skb(dev, skb->len + 4);
-       if (!new_skb) {
-               if (net_ratelimit()) {
-                       dev_warn(fep->dev,
-                                "Memory squeeze, dropping tx packet.\n");
-               }
+       if (!new_skb)
                return NULL;
-       }
 
        /* Make sure new skb is properly aligned */
        skb_align(new_skb, 4);
index 2418faf2251aacc2e91877859ee185c95c251516..84125707f321335f3c3038988a41e37b10c01b0b 100644 (file)
@@ -1003,8 +1003,6 @@ static void fjn_rx(struct net_device *dev)
            }
            skb = netdev_alloc_skb(dev, pkt_len + 2);
            if (skb == NULL) {
-               netdev_notice(dev, "Memory squeeze, dropping packet (len %d)\n",
-                             pkt_len);
                outb(F_SKP_PKT, ioaddr + RX_SKIP);
                dev->stats.rx_dropped++;
                break;
index 1c54e229e3cc94ed8ff0eb630bd9acc70cb20a8d..e38816145395c9e2b08416934e0b10b6352b4507 100644 (file)
@@ -798,16 +798,14 @@ static inline int i596_rx(struct net_device *dev)
 #ifdef __mc68000__
                                cache_clear(virt_to_phys(newskb->data), PKT_BUF_SZ);
 #endif
-                       }
-                       else
+                       } else {
                                skb = netdev_alloc_skb(dev, pkt_len + 2);
+                       }
 memory_squeeze:
                        if (skb == NULL) {
                                /* XXX tulip.c can defer packets here!! */
-                               printk(KERN_WARNING "%s: i596_rx Memory squeeze, dropping packet.\n", dev->name);
                                dev->stats.rx_dropped++;
-                       }
-                       else {
+                       } else {
                                if (!rx_in_place) {
                                        /* 16 byte align the data fields */
                                        skb_reserve(skb, 2);
index f045ea4dc5144e60be6fd25b730e8fabc65f2871..d653bac4cfc4e2be49d1ab1ff9a1247eae5460aa 100644 (file)
@@ -715,14 +715,12 @@ static inline int i596_rx(struct net_device *dev)
                                rbd->v_data = newskb->data;
                                rbd->b_data = SWAP32(dma_addr);
                                DMA_WBACK_INV(dev, rbd, sizeof(struct i596_rbd));
-                       } else
+                       } else {
                                skb = netdev_alloc_skb_ip_align(dev, pkt_len);
+                       }
 memory_squeeze:
                        if (skb == NULL) {
                                /* XXX tulip.c can defer packets here!! */
-                               printk(KERN_ERR
-                                      "%s: i596_rx Memory squeeze, dropping packet.\n",
-                                      dev->name);
                                dev->stats.rx_dropped++;
                        } else {
                                if (!rx_in_place) {
index 328f47c92e26e2df74e9008f73127b5cd0cbc337..02963343447497f1ab9d728a0a9fe7971872549b 100644 (file)
@@ -402,7 +402,6 @@ static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes)
                        skb_arr_rq1[index] = netdev_alloc_skb(dev,
                                                              EHEA_L_PKT_SIZE);
                        if (!skb_arr_rq1[index]) {
-                               netdev_info(dev, "Unable to allocate enough skb in the array\n");
                                pr->rq1_skba.os_skbs = fill_wqes - i;
                                break;
                        }
@@ -432,10 +431,8 @@ static void ehea_init_fill_rq1(struct ehea_port_res *pr, int nr_rq1a)
 
        for (i = 0; i < nr_rq1a; i++) {
                skb_arr_rq1[i] = netdev_alloc_skb(dev, EHEA_L_PKT_SIZE);
-               if (!skb_arr_rq1[i]) {
-                       netdev_info(dev, "Not enough memory to allocate skb array\n");
+               if (!skb_arr_rq1[i])
                        break;
-               }
        }
        /* Ring doorbell */
        ehea_update_rq1a(pr->qp, i - 1);
@@ -695,10 +692,8 @@ static int ehea_proc_rwqes(struct net_device *dev,
 
                                        skb = netdev_alloc_skb(dev,
                                                               EHEA_L_PKT_SIZE);
-                                       if (!skb) {
-                                               netdev_err(dev, "Not enough memory to allocate skb\n");
+                                       if (!skb)
                                                break;
-                                       }
                                }
                                skb_copy_to_linear_data(skb, ((char *)cqe) + 64,
                                                 cqe->num_bytes_transfered - 4);
index 3488c6d9e6b53cb496f43d84d224342802c2e45f..2448f0d669e6cadd19ca06b5d820097ca6cf80fe 100644 (file)
@@ -58,10 +58,9 @@ static int mlx4_en_test_loopback_xmit(struct mlx4_en_priv *priv)
 
        /* build the pkt before xmit */
        skb = netdev_alloc_skb(priv->dev, MLX4_LOOPBACK_TEST_PAYLOAD + ETH_HLEN + NET_IP_ALIGN);
-       if (!skb) {
-               en_err(priv, "-LOOPBACK_TEST_XMIT- failed to create skb for xmit\n");
+       if (!skb)
                return -ENOMEM;
-       }
+
        skb_reserve(skb, NET_IP_ALIGN);
 
        ethh = (struct ethhdr *)skb_put(skb, sizeof(struct ethhdr));
index 46795e4034675c381bef7de9b6b01249a1514e50..1bd419dbda6dc34d39f1a4fe38ec30a9ca85cf16 100644 (file)
@@ -424,7 +424,6 @@ static void sonic_rx(struct net_device *dev)
                        /* Malloc up new buffer. */
                        new_skb = netdev_alloc_skb(dev, SONIC_RBSIZE + 2);
                        if (new_skb == NULL) {
-                               printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name);
                                lp->stats.rx_dropped++;
                                break;
                        }
index 63e7af44366f4dc20841edf2d9a35d2212e36c8a..cb9e6383150043e3186bfc1c51ee8f334fb090c0 100644 (file)
@@ -152,8 +152,6 @@ static void netx_eth_receive(struct net_device *ndev)
 
        skb = netdev_alloc_skb(ndev, len);
        if (unlikely(skb == NULL)) {
-               printk(KERN_NOTICE "%s: Low memory, packet dropped.\n",
-                       ndev->name);
                ndev->stats.rx_dropped++;
                return;
        }
index 162da8975b059a3ef42ec9e2469660e02d3b01de..539d2028e45658287c599f35fca7e3ede8871384 100644 (file)
@@ -737,7 +737,6 @@ static void netdev_rx(struct net_device *dev)
                        data = ether->rdesc->recv_buf[ether->cur_rx];
                        skb = netdev_alloc_skb(dev, length + 2);
                        if (!skb) {
-                               dev_err(&pdev->dev, "get skb buffer error\n");
                                ether->stats.rx_dropped++;
                                return;
                        }
index 0b8de12bcbca998410f2097d27e239eb31607f83..b62262cfe4d92c3d44f530a161ce6f1bcae6fb23 100644 (file)
@@ -5025,7 +5025,6 @@ static int nv_loopback_test(struct net_device *dev)
        pkt_len = ETH_DATA_LEN;
        tx_skb = netdev_alloc_skb(dev, pkt_len);
        if (!tx_skb) {
-               netdev_err(dev, "netdev_alloc_skb() failed during loopback test\n");
                ret = 0;
                goto out;
        }
index 8fd38cb6d26a54c502ab10d3250c781859a30801..91a8fcd6c24654e52d94aa6a96f68bf02e32a4ee 100644 (file)
@@ -312,7 +312,6 @@ static void ql_release_to_lrg_buf_free_list(struct ql3_adapter *qdev,
                lrg_buf_cb->skb = netdev_alloc_skb(qdev->ndev,
                                                   qdev->lrg_buffer_len);
                if (unlikely(!lrg_buf_cb->skb)) {
-                       netdev_err(qdev->ndev, "failed netdev_alloc_skb()\n");
                        qdev->lrg_buf_skb_check++;
                } else {
                        /*
index b13ab544a7eb56760063474b598163227f27942f..1dd778a6f01e8b9f61d6df2078a48c6ec4b73672 100644 (file)
@@ -1211,8 +1211,6 @@ static void ql_update_sbq(struct ql_adapter *qdev, struct rx_ring *rx_ring)
                                    netdev_alloc_skb(qdev->ndev,
                                                     SMALL_BUFFER_SIZE);
                                if (sbq_desc->p.skb == NULL) {
-                                       netif_err(qdev, probe, qdev->ndev,
-                                                 "Couldn't get an skb.\n");
                                        rx_ring->sbq_clean_idx = clean_idx;
                                        return;
                                }
@@ -1519,8 +1517,6 @@ static void ql_process_mac_rx_page(struct ql_adapter *qdev,
 
        skb = netdev_alloc_skb(ndev, length);
        if (!skb) {
-               netif_err(qdev, drv, qdev->ndev,
-                         "Couldn't get an skb, need to unwind!.\n");
                rx_ring->rx_dropped++;
                put_page(lbq_desc->p.pg_chunk.page);
                return;
@@ -1605,8 +1601,6 @@ static void ql_process_mac_rx_skb(struct ql_adapter *qdev,
        /* Allocate new_skb and copy */
        new_skb = netdev_alloc_skb(qdev->ndev, length + NET_IP_ALIGN);
        if (new_skb == NULL) {
-               netif_err(qdev, probe, qdev->ndev,
-                         "No skb available, drop the packet.\n");
                rx_ring->rx_dropped++;
                return;
        }
index d5622ab5a1daa8293cb5442a7cbe0080dd413a26..e9dc84943cfcb5fa39a8031e5a28051f5963da90 100644 (file)
@@ -350,7 +350,6 @@ static int r6040_alloc_rxbufs(struct net_device *dev)
        do {
                skb = netdev_alloc_skb(dev, MAX_BUF_SIZE);
                if (!skb) {
-                       netdev_err(dev, "failed to alloc skb for rx\n");
                        rc = -ENOMEM;
                        goto err_exit;
                }
index 1276ac71353ae1c85d74da90ef83e2f2c31b9d8b..3ccedeb8aba03703bcdff318dff2ff888eec4bfa 100644 (file)
@@ -2041,8 +2041,6 @@ keep_pkt:
 
                        netif_receive_skb (skb);
                } else {
-                       if (net_ratelimit())
-                               netdev_warn(dev, "Memory squeeze, dropping packet\n");
                        dev->stats.rx_dropped++;
                }
                received++;
index 9f2d416de750882485ec5b4c5a60f59c2a55e98d..d77d60ea820255cd41bc6d37606dfdcd7c4f0395 100644 (file)
@@ -782,8 +782,6 @@ static void net_rx(struct net_device *dev)
 
                skb = netdev_alloc_skb(dev, pkt_len + 2);
                if (skb == NULL) {
-                       printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n",
-                                  dev->name);
                        dev->stats.rx_dropped++;
                        goto done;
                }
index 3aca57853ed470034d46e9eb01a848b761fbec28..bdac936a68bc2b12d0baf302551337c79702b265 100644 (file)
@@ -651,8 +651,11 @@ if (next_ptr < RX_START || next_ptr >= RX_END) {
                                skb->protocol = eth_type_trans(skb, dev);
                                netif_rx(skb);
                                received ++;
-                       } else
-                               goto dropping;
+                       } else {
+                               ether3_outw(next_ptr >> 8, REG_RECVEND);
+                               dev->stats.rx_dropped++;
+                               goto done;
+                       }
                } else {
                        struct net_device_stats *stats = &dev->stats;
                        ether3_outw(next_ptr >> 8, REG_RECVEND);
@@ -679,21 +682,6 @@ done:
        }
 
        return maxcnt;
-
-dropping:{
-       static unsigned long last_warned;
-
-       ether3_outw(next_ptr >> 8, REG_RECVEND);
-       /*
-        * Don't print this message too many times...
-        */
-       if (time_after(jiffies, last_warned + 10 * HZ)) {
-               last_warned = jiffies;
-               printk("%s: memory squeeze, dropping packet.\n", dev->name);
-       }
-       dev->stats.rx_dropped++;
-       goto done;
-       }
 }
 
 /*
index 0fde9ca282696f53af4f32b8df32fed0cc0398e9..0ad5694b41f8eb12d43d2e518b89607ef373bbea 100644 (file)
@@ -381,8 +381,6 @@ memory_squeeze:
                                        dev->stats.rx_packets++;
                                        dev->stats.rx_bytes += len;
                                } else {
-                                       printk(KERN_NOTICE "%s: Memory squeeze, deferring packet.\n",
-                                               dev->name);
                                        dev->stats.rx_dropped++;
                                }
                        } else {
index efca14eaefa9324487e3a0aa496730145920795d..e45829628d5fd964d982e5aaa3828ea653f3ee56 100644 (file)
@@ -1841,15 +1841,12 @@ refill_rx_ring:
                entry = sis_priv->dirty_rx % NUM_RX_DESC;
 
                if (sis_priv->rx_skbuff[entry] == NULL) {
-                       if ((skb = netdev_alloc_skb(net_dev, RX_BUF_SIZE)) == NULL) {
+                       skb = netdev_alloc_skb(net_dev, RX_BUF_SIZE);
+                       if (skb == NULL) {
                                /* not enough memory for skbuff, this makes a
                                 * "hole" on the buffer ring, it is not clear
                                 * how the hardware will react to this kind
                                 * of degenerated buffer */
-                               if (netif_msg_rx_err(sis_priv))
-                                       printk(KERN_INFO "%s: Memory squeeze, "
-                                               "deferring packet.\n",
-                                               net_dev->name);
                                net_dev->stats.rx_dropped++;
                                break;
                        }
index 50823da9dc1ed8d22abcb9fde6026514df076e56..e85c2e7e82468e8d53d4e5a14f692d9ac6a34c5c 100644 (file)
@@ -1223,9 +1223,7 @@ static void smc_rcv(struct net_device *dev)
                        dev->stats.multicast++;
 
                skb = netdev_alloc_skb(dev, packet_length + 5);
-
                if ( skb == NULL ) {
-                       printk(KERN_NOTICE CARDNAME ": Low memory, packet dropped.\n");
                        dev->stats.rx_dropped++;
                        goto done;
                }
index 591650a8de3887942b4efeb78faa3e5ae3324039..dfbf978315dfb31a8cbbd01ce5beae06abc5f398 100644 (file)
@@ -465,8 +465,6 @@ static inline void  smc_rcv(struct net_device *dev)
                 */
                skb = netdev_alloc_skb(dev, packet_len);
                if (unlikely(skb == NULL)) {
-                       printk(KERN_NOTICE "%s: Low memory, packet dropped.\n",
-                               dev->name);
                        SMC_WAIT_MMU_BUSY(lp);
                        SMC_SET_MMU_CMD(lp, MC_RELEASE);
                        dev->stats.rx_dropped++;
index d457fa2d7509e70273b111fce6d8cff68663dd4b..ffa5c4ad12105a2050d264d4deac90080f7e4c9d 100644 (file)
@@ -848,10 +848,8 @@ static int smsc9420_alloc_rx_buffer(struct smsc9420_pdata *pd, int index)
        BUG_ON(pd->rx_buffers[index].skb);
        BUG_ON(pd->rx_buffers[index].mapping);
 
-       if (unlikely(!skb)) {
-               smsc_warn(RX_ERR, "Failed to allocate new skb!");
+       if (unlikely(!skb))
                return -ENOMEM;
-       }
 
        mapping = pci_map_single(pd->pdev, skb_tail_pointer(skb),
                                 PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
index 49bf3e2eb652316757e2781ef7e703171c868414..8182591bc1876c77ddae935d6da64d9200a2dbcc 100644 (file)
@@ -414,7 +414,7 @@ static void qe_rx(struct sunqe *qep)
        struct qe_rxd *this;
        struct sunqe_buffers *qbufs = qep->buffers;
        __u32 qbufs_dvma = qep->buffers_dvma;
-       int elem = qep->rx_new, drops = 0;
+       int elem = qep->rx_new;
        u32 flags;
 
        this = &rxbase[elem];
@@ -436,7 +436,6 @@ static void qe_rx(struct sunqe *qep)
                } else {
                        skb = netdev_alloc_skb(dev, len + 2);
                        if (skb == NULL) {
-                               drops++;
                                dev->stats.rx_dropped++;
                        } else {
                                skb_reserve(skb, 2);
@@ -456,8 +455,6 @@ static void qe_rx(struct sunqe *qep)
                this = &rxbase[elem];
        }
        qep->rx_new = elem;
-       if (drops)
-               printk(KERN_NOTICE "%s: Memory squeeze, deferring packet.\n", qep->dev->name);
 }
 
 static void qe_tx_reclaim(struct sunqe *qep);
index e15cc71b826de613ad6e304480306f903e9e6e2c..e8824cea093be2045a9e939a62c1c1cc81a7f545 100644 (file)
@@ -1102,10 +1102,9 @@ static void bdx_rx_alloc_skbs(struct bdx_priv *priv, struct rxf_fifo *f)
        dno = bdx_rxdb_available(db) - 1;
        while (dno > 0) {
                skb = netdev_alloc_skb(priv->ndev, f->m.pktsz + NET_IP_ALIGN);
-               if (!skb) {
-                       pr_err("NO MEM: netdev_alloc_skb failed\n");
+               if (!skb)
                        break;
-               }
+
                skb_reserve(skb, NET_IP_ALIGN);
 
                idx = bdx_rxdb_alloc_elem(db);
index 22725386c5de78fd94afb6715f30ed0bf24821b0..bdda36f8e54167d9c50633555a517658842af4e3 100644 (file)
@@ -1911,10 +1911,8 @@ static void tlan_reset_lists(struct net_device *dev)
                list->frame_size = TLAN_MAX_FRAME_SIZE;
                list->buffer[0].count = TLAN_MAX_FRAME_SIZE | TLAN_LAST_BUFFER;
                skb = netdev_alloc_skb_ip_align(dev, TLAN_MAX_FRAME_SIZE + 5);
-               if (!skb) {
-                       netdev_err(dev, "Out of memory for received data\n");
+               if (!skb)
                        break;
-               }
 
                list->buffer[0].address = pci_map_single(priv->pci_dev,
                                                         skb->data,
index 9fc2ada4c3c2f22b001021264564ceca323f62ea..5ac43e4ace25cd223c445bdba41a5b12161691b2 100644 (file)
@@ -273,11 +273,9 @@ static int temac_dma_bd_init(struct net_device *ndev)
 
                skb = netdev_alloc_skb_ip_align(ndev,
                                                XTE_MAX_JUMBO_FRAME_SIZE);
-
-               if (skb == 0) {
-                       dev_err(&ndev->dev, "alloc_skb error %d\n", i);
+               if (!skb)
                        goto out;
-               }
+
                lp->rx_skb[i] = skb;
                /* returns physical address of skb->data */
                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)
 
                new_skb = netdev_alloc_skb_ip_align(ndev,
                                                XTE_MAX_JUMBO_FRAME_SIZE);
-
-               if (new_skb == 0) {
-                       dev_err(&ndev->dev, "no memory for new sk_buff\n");
+               if (!new_skb) {
                        spin_unlock_irqrestore(&lp->rx_lock, flags);
                        return;
                }
index 278c9db3b5b853e4cb41caf83a6990db517a899d..397d4a6a1f30a89223d9543893c9eb5e99218d74 100644 (file)
@@ -235,10 +235,8 @@ static int axienet_dma_bd_init(struct net_device *ndev)
                                      ((i + 1) % RX_BD_NUM);
 
                skb = netdev_alloc_skb_ip_align(ndev, lp->max_frm_size);
-               if (!skb) {
-                       dev_err(&ndev->dev, "alloc_skb error %d\n", i);
+               if (!skb)
                        goto out;
-               }
 
                lp->rx_bd_v[i].sw_id_offset = (u32) skb;
                lp->rx_bd_v[i].phys = dma_map_single(ndev->dev.parent,
@@ -777,10 +775,9 @@ static void axienet_recv(struct net_device *ndev)
                packets++;
 
                new_skb = netdev_alloc_skb_ip_align(ndev, lp->max_frm_size);
-               if (!new_skb) {
-                       dev_err(&ndev->dev, "no memory for new sk_buff\n");
+               if (!new_skb)
                        return;
-               }
+
                cur_p->phys = dma_map_single(ndev->dev.parent, new_skb->data,
                                             lp->max_frm_size,
                                             DMA_FROM_DEVICE);
index 98e09d0d3ce22e153603efc37f486dfdf55174ac..76210abf2e9b5b7d62ec2effc884c1fce979fe03 100644 (file)
@@ -1041,7 +1041,6 @@ xirc2ps_interrupt(int irq, void *dev_id)
            /* 1 extra so we can use insw */
            skb = netdev_alloc_skb(dev, pktlen + 3);
            if (!skb) {
-               pr_notice("low memory, packet dropped (size=%u)\n", pktlen);
                dev->stats.rx_dropped++;
            } else { /* okay get the packet */
                skb_reserve(skb, 2);