netdev: ethernet dev_alloc_skb to netdev_alloc_skb
authorPradeep A. Dalvi <netdev@pradeepdalvi.com>
Mon, 6 Feb 2012 11:16:13 +0000 (11:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Feb 2012 23:46:38 +0000 (18:46 -0500)
Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet
  - Removed extra skb->dev = dev after netdev_alloc_skb

Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
33 files changed:
drivers/net/ethernet/netx-eth.c
drivers/net/ethernet/nuvoton/w90p910_ether.c
drivers/net/ethernet/nvidia/forcedeth.c
drivers/net/ethernet/packetengines/hamachi.c
drivers/net/ethernet/packetengines/yellowfin.c
drivers/net/ethernet/pasemi/pasemi_mac.c
drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
drivers/net/ethernet/racal/ni5010.c
drivers/net/ethernet/realtek/atp.c
drivers/net/ethernet/renesas/sh_eth.c
drivers/net/ethernet/seeq/ether3.c
drivers/net/ethernet/seeq/seeq8005.c
drivers/net/ethernet/sis/sis900.c
drivers/net/ethernet/smsc/epic100.c
drivers/net/ethernet/smsc/smc911x.c
drivers/net/ethernet/smsc/smc9194.c
drivers/net/ethernet/smsc/smc91c92_cs.c
drivers/net/ethernet/smsc/smc91x.c
drivers/net/ethernet/smsc/smsc9420.c
drivers/net/ethernet/sun/cassini.c
drivers/net/ethernet/sun/sunbmac.c
drivers/net/ethernet/sun/sunhme.c
drivers/net/ethernet/sun/sunqe.c
drivers/net/ethernet/tehuti/tehuti.c
drivers/net/ethernet/ti/davinci_emac.c
drivers/net/ethernet/tile/tilepro.c
drivers/net/ethernet/toshiba/tc35815.c
drivers/net/ethernet/via/via-rhine.c
drivers/net/ethernet/via/via-velocity.c
drivers/net/ethernet/xilinx/xilinx_emaclite.c
drivers/net/ethernet/xircom/xirc2ps_cs.c

index 5a12276f810df9f1390e3a6eddc883f5fd702aee..9d11ab7521bca71b64dd0a849a9e895281869369 100644 (file)
@@ -150,7 +150,7 @@ static void netx_eth_receive(struct net_device *ndev)
        seg = (val & FIFO_PTR_SEGMENT_MASK) >> FIFO_PTR_SEGMENT_SHIFT;
        len = (val & FIFO_PTR_FRAMELEN_MASK) >> FIFO_PTR_FRAMELEN_SHIFT;
 
-       skb = dev_alloc_skb(len);
+       skb = netdev_alloc_skb(ndev, len);
        if (unlikely(skb == NULL)) {
                printk(KERN_NOTICE "%s: Low memory, packet dropped.\n",
                        ndev->name);
index b75a0497d58dbdbdb362d8e857ce8f75bf7e22f9..6893a65ae55f179104381d70dbb6021842e3498a 100644 (file)
@@ -735,7 +735,7 @@ static void netdev_rx(struct net_device *dev)
 
                if (status & RXDS_RXGD) {
                        data = ether->rdesc->recv_buf[ether->cur_rx];
-                       skb = dev_alloc_skb(length+2);
+                       skb = netdev_alloc_skb(dev, length + 2);
                        if (!skb) {
                                dev_err(&pdev->dev, "get skb buffer error\n");
                                ether->stats.rx_dropped++;
index 4c4e7f4583830ce9231bd1ebef8ab3a1fed99fa2..5eeb92f8738046624995522aa1bf739569d44423 100644 (file)
@@ -1815,7 +1815,7 @@ static int nv_alloc_rx(struct net_device *dev)
                less_rx = np->last_rx.orig;
 
        while (np->put_rx.orig != less_rx) {
-               struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + NV_RX_ALLOC_PAD);
+               struct sk_buff *skb = netdev_alloc_skb(dev, np->rx_buf_sz + NV_RX_ALLOC_PAD);
                if (skb) {
                        np->put_rx_ctx->skb = skb;
                        np->put_rx_ctx->dma = pci_map_single(np->pci_dev,
@@ -1850,7 +1850,7 @@ static int nv_alloc_rx_optimized(struct net_device *dev)
                less_rx = np->last_rx.ex;
 
        while (np->put_rx.ex != less_rx) {
-               struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + NV_RX_ALLOC_PAD);
+               struct sk_buff *skb = netdev_alloc_skb(dev, np->rx_buf_sz + NV_RX_ALLOC_PAD);
                if (skb) {
                        np->put_rx_ctx->skb = skb;
                        np->put_rx_ctx->dma = pci_map_single(np->pci_dev,
@@ -4993,9 +4993,9 @@ static int nv_loopback_test(struct net_device *dev)
 
        /* setup packet for tx */
        pkt_len = ETH_DATA_LEN;
-       tx_skb = dev_alloc_skb(pkt_len);
+       tx_skb = netdev_alloc_skb(dev, pkt_len);
        if (!tx_skb) {
-               netdev_err(dev, "dev_alloc_skb() failed during loopback test\n");
+               netdev_err(dev, "netdev_alloc_skb() failed during loopback test\n");
                ret = 0;
                goto out;
        }
index 3458df3780b8fa381ace2a80a1c2ff1c9f7de140..0d29f5f4b8e41083a9114d5b2e43b7274bc1d04d 100644 (file)
@@ -1188,11 +1188,10 @@ static void hamachi_init_ring(struct net_device *dev)
        }
        /* Fill in the Rx buffers.  Handle allocation failure gracefully. */
        for (i = 0; i < RX_RING_SIZE; i++) {
-               struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz + 2);
+               struct sk_buff *skb = netdev_alloc_skb(dev, hmp->rx_buf_sz + 2);
                hmp->rx_skbuff[i] = skb;
                if (skb == NULL)
                        break;
-               skb->dev = dev;         /* Mark as being used by this device. */
                skb_reserve(skb, 2); /* 16 byte align the IP header. */
                 hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
                        skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE));
@@ -1488,7 +1487,7 @@ static int hamachi_rx(struct net_device *dev)
                        /* Check if the packet is long enough to accept without copying
                           to a minimally-sized skbuff. */
                        if (pkt_len < rx_copybreak &&
-                           (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                           (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
 #ifdef RX_CHECKSUM
                                printk(KERN_ERR "%s: rx_copybreak non-zero "
                                  "not good with RX_CHECKSUM\n", dev->name);
@@ -1591,12 +1590,11 @@ static int hamachi_rx(struct net_device *dev)
                entry = hmp->dirty_rx % RX_RING_SIZE;
                desc = &(hmp->rx_ring[entry]);
                if (hmp->rx_skbuff[entry] == NULL) {
-                       struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz + 2);
+                       struct sk_buff *skb = netdev_alloc_skb(dev, hmp->rx_buf_sz + 2);
 
                        hmp->rx_skbuff[entry] = skb;
                        if (skb == NULL)
                                break;          /* Better luck next round. */
-                       skb->dev = dev;         /* Mark as being used by this device. */
                        skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
                        desc->addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
                                skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE));
index 4a5774271bd43be3a91406519fc4edd0de911789..7757b80ef924b8000c2b7e13066c0961566a38ee 100644 (file)
@@ -743,11 +743,10 @@ static int yellowfin_init_ring(struct net_device *dev)
        }
 
        for (i = 0; i < RX_RING_SIZE; i++) {
-               struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2);
+               struct sk_buff *skb = netdev_alloc_skb(dev, yp->rx_buf_sz + 2);
                yp->rx_skbuff[i] = skb;
                if (skb == NULL)
                        break;
-               skb->dev = dev;         /* Mark as being used by this device. */
                skb_reserve(skb, 2);    /* 16 byte align the IP header. */
                yp->rx_ring[i].addr = cpu_to_le32(pci_map_single(yp->pci_dev,
                        skb->data, yp->rx_buf_sz, PCI_DMA_FROMDEVICE));
@@ -1133,7 +1132,7 @@ static int yellowfin_rx(struct net_device *dev)
                                        PCI_DMA_FROMDEVICE);
                                yp->rx_skbuff[entry] = NULL;
                        } else {
-                               skb = dev_alloc_skb(pkt_len + 2);
+                               skb = netdev_alloc_skb(dev, pkt_len + 2);
                                if (skb == NULL)
                                        break;
                                skb_reserve(skb, 2);    /* 16 byte align the IP header */
@@ -1156,11 +1155,10 @@ static int yellowfin_rx(struct net_device *dev)
        for (; yp->cur_rx - yp->dirty_rx > 0; yp->dirty_rx++) {
                entry = yp->dirty_rx % RX_RING_SIZE;
                if (yp->rx_skbuff[entry] == NULL) {
-                       struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2);
+                       struct sk_buff *skb = netdev_alloc_skb(dev, yp->rx_buf_sz + 2);
                        if (skb == NULL)
                                break;                          /* Better luck next round. */
                        yp->rx_skbuff[entry] = skb;
-                       skb->dev = dev; /* Mark as being used by this device. */
                        skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
                        yp->rx_ring[entry].addr = cpu_to_le32(pci_map_single(yp->pci_dev,
                                skb->data, yp->rx_buf_sz, PCI_DMA_FROMDEVICE));
index 3bb725ed270381353fd7ecb618d9bd940327c9bc..667498ea46039adf9f921311183161a233cd099c 100644 (file)
@@ -643,7 +643,7 @@ static void pasemi_mac_replenish_rx_ring(const struct net_device *dev,
                /* Entry in use? */
                WARN_ON(*buff);
 
-               skb = dev_alloc_skb(mac->bufsz);
+               skb = netdev_alloc_skb(dev, mac->bufsz);
                skb_reserve(skb, LOCAL_SKB_ALIGN);
 
                if (unlikely(!skb))
index f69ac442c6a18208af6f5d416648e5e18851f773..718b274403511c600fb43aae956c9adf46a274e9 100644 (file)
@@ -1487,7 +1487,7 @@ netxen_alloc_rx_skb(struct netxen_adapter *adapter,
        dma_addr_t dma;
        struct pci_dev *pdev = adapter->pdev;
 
-       buffer->skb = dev_alloc_skb(rds_ring->skb_size);
+       buffer->skb = netdev_alloc_skb(adapter->netdev, rds_ring->skb_size);
        if (!buffer->skb)
                return 1;
 
index 30dcbfba8f2474e3f8bc0f9184fa9f517c63f8de..89ddf7f7d7df40b93e7a27431be82eb98cec8c4a 100644 (file)
@@ -719,7 +719,7 @@ static int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode)
        int i, loop, cnt = 0;
 
        for (i = 0; i < QLCNIC_NUM_ILB_PKT; i++) {
-               skb = dev_alloc_skb(QLCNIC_ILB_PKT_SIZE);
+               skb = netdev_alloc_skb(adapter->netdev, QLCNIC_ILB_PKT_SIZE);
                qlcnic_create_loopback_buff(skb->data, adapter->mac_addr);
                skb_put(skb, QLCNIC_ILB_PKT_SIZE);
 
index 41d85efee422c79c620d7c5cca5d36006c88617b..d32cf0ddf1b9f37dd098690f59b5888cd569e5ec 100644 (file)
@@ -1440,7 +1440,7 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter,
        dma_addr_t dma;
        struct pci_dev *pdev = adapter->pdev;
 
-       skb = dev_alloc_skb(rds_ring->skb_size);
+       skb = netdev_alloc_skb(adapter->netdev, rds_ring->skb_size);
        if (!skb) {
                adapter->stats.skb_alloc_failure++;
                return -ENOMEM;
index 072810da9a373dfb6b61db9b48f2dd988475f1a5..8079822200503e49098a4533b373b495cd1f7b32 100644 (file)
@@ -552,7 +552,7 @@ static void ni5010_rx(struct net_device *dev)
        }
 
        /* Malloc up new buffer. */
-       skb = dev_alloc_skb(i_pkt_size + 3);
+       skb = netdev_alloc_skb(dev, i_pkt_size + 3);
        if (skb == NULL) {
                printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name);
                dev->stats.rx_dropped++;
index e3f57fdbf0eaee7cadf90265b51a1102f3142658..46c1932048cbb459cc0f02547c78307caf73eacc 100644 (file)
@@ -783,7 +783,7 @@ static void net_rx(struct net_device *dev)
                int pkt_len = (rx_head.rx_count & 0x7ff) - 4;
                struct sk_buff *skb;
 
-               skb = dev_alloc_skb(pkt_len + 2);
+               skb = netdev_alloc_skb(dev, pkt_len + 2);
                if (skb == NULL) {
                        printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n",
                                   dev->name);
index dacd13150b6c99d6aa0eebbd349a8d0bc7f70b60..1a69504ed9c5df7863e9be2befbd65d32aa7397b 100644 (file)
@@ -653,13 +653,12 @@ static void sh_eth_ring_format(struct net_device *ndev)
        for (i = 0; i < RX_RING_SIZE; i++) {
                /* skb */
                mdp->rx_skbuff[i] = NULL;
-               skb = dev_alloc_skb(mdp->rx_buf_sz);
+               skb = netdev_alloc_skb(ndev, mdp->rx_buf_sz);
                mdp->rx_skbuff[i] = skb;
                if (skb == NULL)
                        break;
                dma_map_single(&ndev->dev, skb->data, mdp->rx_buf_sz,
                                DMA_FROM_DEVICE);
-               skb->dev = ndev; /* Mark as being used by this device. */
                sh_eth_set_receive_align(skb);
 
                /* RX descriptor */
@@ -953,13 +952,12 @@ static int sh_eth_rx(struct net_device *ndev)
                rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 16);
 
                if (mdp->rx_skbuff[entry] == NULL) {
-                       skb = dev_alloc_skb(mdp->rx_buf_sz);
+                       skb = netdev_alloc_skb(ndev, mdp->rx_buf_sz);
                        mdp->rx_skbuff[entry] = skb;
                        if (skb == NULL)
                                break;  /* Better luck next round. */
                        dma_map_single(&ndev->dev, skb->data, mdp->rx_buf_sz,
                                        DMA_FROM_DEVICE);
-                       skb->dev = ndev;
                        sh_eth_set_receive_align(skb);
 
                        skb_checksum_none_assert(skb);
index 893c880dadf0f021f05b84d6f9f24b2f36b6b13b..7b819bd8c416e2bd618624dc30ccb53c68722acf 100644 (file)
@@ -643,7 +643,7 @@ if (next_ptr < RX_START || next_ptr >= RX_END) {
                        if (next_ptr <= this_ptr)
                                length += RX_END - RX_START;
 
-                       skb = dev_alloc_skb(length + 2);
+                       skb = netdev_alloc_skb(dev, length + 2);
                        if (skb) {
                                unsigned char *buf;
 
index 60561451789b0ff491ccbfe6a14fd2e5d5295a9a..79899077444620aebe0a04a152f073893b0bde87 100644 (file)
@@ -548,7 +548,7 @@ static void seeq8005_rx(struct net_device *dev)
                        struct sk_buff *skb;
                        unsigned char *buf;
 
-                       skb = dev_alloc_skb(pkt_len);
+                       skb = netdev_alloc_skb(dev, pkt_len);
                        if (skb == NULL) {
                                printk("%s: Memory squeeze, dropping packet.\n", dev->name);
                                dev->stats.rx_dropped++;
index 91c44688bc3e84200de847de4518a1fa97db4869..f968898c86db949688dc980943d6fae06db58e2f 100644 (file)
@@ -1166,7 +1166,7 @@ sis900_init_rx_ring(struct net_device *net_dev)
        for (i = 0; i < NUM_RX_DESC; i++) {
                struct sk_buff *skb;
 
-               if ((skb = dev_alloc_skb(RX_BUF_SIZE)) == NULL) {
+               if ((skb = netdev_alloc_skb(net_dev, RX_BUF_SIZE)) == 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
@@ -1769,7 +1769,7 @@ static int sis900_rx(struct net_device *net_dev)
 
                        /* refill the Rx buffer, what if there is not enough
                         * memory for new socket buffer ?? */
-                       if ((skb = dev_alloc_skb(RX_BUF_SIZE)) == NULL) {
+                       if ((skb = netdev_alloc_skb(net_dev, RX_BUF_SIZE)) == NULL) {
                                /*
                                 * Not enough memory to refill the buffer
                                 * so we need to recycle the old one so
@@ -1827,7 +1827,7 @@ refill_rx_ring:
                entry = sis_priv->dirty_rx % NUM_RX_DESC;
 
                if (sis_priv->rx_skbuff[entry] == NULL) {
-                       if ((skb = dev_alloc_skb(RX_BUF_SIZE)) == NULL) {
+                       if ((skb = netdev_alloc_skb(net_dev, RX_BUF_SIZE)) == 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
index 11dcb38b99f7e403757dac9b1e3ea7ed46f9edd6..2a662e6112e9b15cbb8dcda6e30bfc9f9c70fb44 100644 (file)
@@ -934,7 +934,7 @@ static void epic_init_ring(struct net_device *dev)
 
        /* Fill in the Rx buffers.  Handle allocation failure gracefully. */
        for (i = 0; i < RX_RING_SIZE; i++) {
-               struct sk_buff *skb = dev_alloc_skb(ep->rx_buf_sz + 2);
+               struct sk_buff *skb = netdev_alloc_skb(dev, ep->rx_buf_sz + 2);
                ep->rx_skbuff[i] = skb;
                if (skb == NULL)
                        break;
@@ -1199,7 +1199,7 @@ static int epic_rx(struct net_device *dev, int budget)
                        /* Check if the packet is long enough to accept without copying
                           to a minimally-sized skbuff. */
                        if (pkt_len < rx_copybreak &&
-                           (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                           (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
                                skb_reserve(skb, 2);    /* 16 byte align the IP header */
                                pci_dma_sync_single_for_cpu(ep->pci_dev,
                                                            ep->rx_ring[entry].bufaddr,
@@ -1232,7 +1232,7 @@ static int epic_rx(struct net_device *dev, int budget)
                entry = ep->dirty_rx % RX_RING_SIZE;
                if (ep->rx_skbuff[entry] == NULL) {
                        struct sk_buff *skb;
-                       skb = ep->rx_skbuff[entry] = dev_alloc_skb(ep->rx_buf_sz + 2);
+                       skb = ep->rx_skbuff[entry] = netdev_alloc_skb(dev, ep->rx_buf_sz + 2);
                        if (skb == NULL)
                                break;
                        skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
index c28230148efd5385fb1f95b488fa5eac20c6ac34..8814b2f5d46f4c702b75c010f5a4507c5d4feb63 100644 (file)
@@ -401,7 +401,7 @@ static inline void   smc911x_rcv(struct net_device *dev)
        } else {
                /* Receive a valid packet */
                /* Alloc a buffer with extra room for DMA alignment */
-               skb=dev_alloc_skb(pkt_len+32);
+               skb = netdev_alloc_skb(dev, pkt_len+32);
                if (unlikely(skb == NULL)) {
                        PRINTK( "%s: Low memory, rcvd packet dropped.\n",
                                dev->name);
index 4e45094efb18966c9d879bdd3d3989cc31bb6b77..50823da9dc1ed8d22abcb9fde6026514df076e56 100644 (file)
@@ -1222,7 +1222,7 @@ static void smc_rcv(struct net_device *dev)
                if ( status & RS_MULTICAST )
                        dev->stats.multicast++;
 
-               skb = dev_alloc_skb( packet_length + 5);
+               skb = netdev_alloc_skb(dev, packet_length + 5);
 
                if ( skb == NULL ) {
                        printk(KERN_NOTICE CARDNAME ": Low memory, packet dropped.\n");
index ada927aba7a517f64804b06852e33f1f4c2ede39..d12e48a7861d4f966bcf9713c2d82d518a96c2bf 100644 (file)
@@ -1500,7 +1500,7 @@ static void smc_rx(struct net_device *dev)
        struct sk_buff *skb;
        
        /* Note: packet_length adds 5 or 6 extra bytes here! */
-       skb = dev_alloc_skb(packet_length+2);
+       skb = netdev_alloc_skb(dev, packet_length+2);
        
        if (skb == NULL) {
            pr_debug("%s: Low memory, packet dropped.\n", dev->name);
index 24104a1ee6a50ecbc4d31af4aefd005df4827cdb..1dc4fad593e7ebd50a35f50a477e8bcd0a4f8481 100644 (file)
@@ -463,7 +463,7 @@ static inline void  smc_rcv(struct net_device *dev)
                 * multiple of 4 bytes on 32 bit buses.
                 * Hence packet_len - 6 + 2 + 2 + 2.
                 */
-               skb = dev_alloc_skb(packet_len);
+               skb = netdev_alloc_skb(dev, packet_len);
                if (unlikely(skb == NULL)) {
                        printk(KERN_NOTICE "%s: Low memory, packet dropped.\n",
                                dev->name);
index 595f9881e096bcfd63c69d46d911378027489a0a..ee1a1680b7a844f687f7ed191ce404a9dc5f54c4 100644 (file)
@@ -850,8 +850,6 @@ static int smsc9420_alloc_rx_buffer(struct smsc9420_pdata *pd, int index)
                return -ENOMEM;
        }
 
-       skb->dev = pd->dev;
-
        mapping = pci_map_single(pd->pdev, skb_tail_pointer(skb),
                                 PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
        if (pci_dma_mapping_error(pd->pdev, mapping)) {
index 45292760fce4db650fe6c74849dc0a99f880c351..b36edbd625dd4f6a352eee4d3112457eb8d8894f 100644 (file)
@@ -1974,7 +1974,7 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
        else
                alloclen = max(hlen, RX_COPY_MIN);
 
-       skb = dev_alloc_skb(alloclen + swivel + cp->crc_size);
+       skb = netdev_alloc_skb(cp->dev, alloclen + swivel + cp->crc_size);
        if (skb == NULL)
                return -1;
 
index 220f724c3377dcfb8a152174100f80e1395674d7..f359863b5340e203255c32c8cda04f7e13bc3711 100644 (file)
@@ -853,7 +853,7 @@ static void bigmac_rx(struct bigmac *bp)
                        /* Trim the original skb for the netif. */
                        skb_trim(skb, len);
                } else {
-                       struct sk_buff *copy_skb = dev_alloc_skb(len + 2);
+                       struct sk_buff *copy_skb = netdev_alloc_skb(bp->dev, len + 2);
 
                        if (copy_skb == NULL) {
                                drops++;
index 09c518655db2bcc36ffca85518325a6af3358ecf..8b627e2f798d42e3ce6c4953ace642d1ee2f6c7e 100644 (file)
@@ -2043,7 +2043,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
                        /* Trim the original skb for the netif. */
                        skb_trim(skb, len);
                } else {
-                       struct sk_buff *copy_skb = dev_alloc_skb(len + 2);
+                       struct sk_buff *copy_skb = netdev_alloc_skb(dev, len + 2);
 
                        if (copy_skb == NULL) {
                                drops++;
index b28f74367ebee8333c2fe6abea3bf8823b788ec0..b42d1c5a6ca143b7ee172077041c56cd9c14aee7 100644 (file)
@@ -435,7 +435,7 @@ static void qe_rx(struct sunqe *qep)
                        dev->stats.rx_length_errors++;
                        dev->stats.rx_dropped++;
                } else {
-                       skb = dev_alloc_skb(len + 2);
+                       skb = netdev_alloc_skb(dev, len + 2);
                        if (skb == NULL) {
                                drops++;
                                dev->stats.rx_dropped++;
index df7febba9ea64fb0e61bfce05532a60503e09050..ad973ffc9ff363acb4ecd923bcd3d93a3b78dc18 100644 (file)
@@ -1089,12 +1089,11 @@ static void bdx_rx_alloc_skbs(struct bdx_priv *priv, struct rxf_fifo *f)
        ENTER;
        dno = bdx_rxdb_available(db) - 1;
        while (dno > 0) {
-               skb = dev_alloc_skb(f->m.pktsz + NET_IP_ALIGN);
+               skb = netdev_alloc_skb(priv->ndev, f->m.pktsz + NET_IP_ALIGN);
                if (!skb) {
-                       pr_err("NO MEM: dev_alloc_skb failed\n");
+                       pr_err("NO MEM: netdev_alloc_skb failed\n");
                        break;
                }
-               skb->dev = priv->ndev;
                skb_reserve(skb, NET_IP_ALIGN);
 
                idx = bdx_rxdb_alloc_elem(db);
@@ -1258,7 +1257,7 @@ static int bdx_rx_receive(struct bdx_priv *priv, struct rxd_fifo *f, int budget)
                skb = dm->skb;
 
                if (len < BDX_COPYBREAK &&
-                   (skb2 = dev_alloc_skb(len + NET_IP_ALIGN))) {
+                   (skb2 = netdev_alloc_skb(priv->ndev, len + NET_IP_ALIGN))) {
                        skb_reserve(skb2, NET_IP_ALIGN);
                        /*skb_put(skb2, len); */
                        pci_dma_sync_single_for_cpu(priv->pdev,
index 922a937e05cf454ff83baea5f7870283fbc98aea..6b0659c59ddd909eecf83507db9e16ca17e8869d 100644 (file)
@@ -992,10 +992,9 @@ static irqreturn_t emac_irq(int irq, void *dev_id)
 
 static struct sk_buff *emac_rx_alloc(struct emac_priv *priv)
 {
-       struct sk_buff *skb = dev_alloc_skb(priv->rx_buf_size);
+       struct sk_buff *skb = netdev_alloc_skb(priv->ndev, priv->rx_buf_size);
        if (WARN_ON(!skb))
                return NULL;
-       skb->dev = priv->ndev;
        skb_reserve(skb, NET_IP_ALIGN);
        return skb;
 }
index d9951afb9269ff130310dc912293f39d3808c666..a8e5daaef6fab40553c561a9018b8a8b6fbc6fca 100644 (file)
@@ -419,7 +419,7 @@ static bool tile_net_provide_needed_buffer(struct tile_net_cpu *info,
 #endif
 
        /* Avoid "false sharing" with last cache line. */
-       /* ISSUE: This is already done by "dev_alloc_skb()". */
+       /* ISSUE: This is already done by "netdev_alloc_skb()". */
        unsigned int len =
                 (((small ? LIPP_SMALL_PACKET_SIZE : large_size) +
                   CHIP_L2_LINE_SIZE() - 1) & -CHIP_L2_LINE_SIZE());
@@ -433,7 +433,7 @@ static bool tile_net_provide_needed_buffer(struct tile_net_cpu *info,
        struct sk_buff **skb_ptr;
 
        /* Request 96 extra bytes for alignment purposes. */
-       skb = dev_alloc_skb(len + padding);
+       skb = netdev_alloc_skb(info->napi->dev, len + padding);
        if (skb == NULL)
                return false;
 
index f5ac603d5608199e15c7a60a18b20642fbdf9a64..d117ad475c3e95db4a021ade490bd345cfba16ad 100644 (file)
@@ -453,7 +453,7 @@ static struct sk_buff *alloc_rxbuf_skb(struct net_device *dev,
                                       dma_addr_t *dma_handle)
 {
        struct sk_buff *skb;
-       skb = dev_alloc_skb(RX_BUF_SIZE);
+       skb = netdev_alloc_skb(dev, RX_BUF_SIZE);
        if (!skb)
                return NULL;
        *dma_handle = pci_map_single(hwdev, skb->data, RX_BUF_SIZE,
index 1b95daa372c4d8679b2d49769d796cb740ced4d3..cb2ff28a060281badbf833ee34f2167bcb714d63 100644 (file)
@@ -1155,7 +1155,6 @@ static void alloc_rbufs(struct net_device *dev)
                rp->rx_skbuff[i] = skb;
                if (skb == NULL)
                        break;
-               skb->dev = dev;                 /* Mark as being used by this device. */
 
                rp->rx_skbuff_dma[i] =
                        pci_map_single(rp->pdev, skb->data, rp->rx_buf_sz,
@@ -1940,7 +1939,6 @@ static int rhine_rx(struct net_device *dev, int limit)
                        rp->rx_skbuff[entry] = skb;
                        if (skb == NULL)
                                break;  /* Better luck next round. */
-                       skb->dev = dev; /* Mark as being used by this device. */
                        rp->rx_skbuff_dma[entry] =
                                pci_map_single(rp->pdev, skb->data,
                                               rp->rx_buf_sz,
index 2776bbc67936059d8afae1c37f75099294e16dea..cf69cbf6fec3c286b6cf2880740a4df6653066bd 100644 (file)
@@ -1509,7 +1509,7 @@ static int velocity_alloc_rx_buf(struct velocity_info *vptr, int idx)
        struct rx_desc *rd = &(vptr->rx.ring[idx]);
        struct velocity_rd_info *rd_info = &(vptr->rx.info[idx]);
 
-       rd_info->skb = dev_alloc_skb(vptr->rx.buf_sz + 64);
+       rd_info->skb = netdev_alloc_skb(vptr->dev, vptr->rx.buf_sz + 64);
        if (rd_info->skb == NULL)
                return -ENOMEM;
 
index 90e611a6f6c61fbeb94817dc3c8b062cae331fad..77cfe5110318ab7c1dd40bac9c0dd18ad37c8610 100644 (file)
@@ -613,7 +613,7 @@ static void xemaclite_rx_handler(struct net_device *dev)
        u32 len;
 
        len = ETH_FRAME_LEN + ETH_FCS_LEN;
-       skb = dev_alloc_skb(len + ALIGNMENT);
+       skb = netdev_alloc_skb(dev, len + ALIGNMENT);
        if (!skb) {
                /* Couldn't get memory. */
                dev->stats.rx_dropped++;
index 33979c3ac943ebff6c106cb1fb787aca07ea57d4..5c69c6f93fb80ec79b1ed7801b970f49b7c282b7 100644 (file)
@@ -1039,7 +1039,8 @@ xirc2ps_interrupt(int irq, void *dev_id)
 
            pr_debug("rsr=%#02x packet_length=%u\n", rsr, pktlen);
 
-           skb = dev_alloc_skb(pktlen+3); /* 1 extra so we can use insw */
+           /* 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++;