* [RESEND PATCH] virtio-net: init link state correctly
From: Jason Wang @ 2010-11-05 9:47 UTC (permalink / raw)
To: netdev, rusty, linux-kernel, davem; +Cc: markmc, kvm, mst
For device that supports VIRTIO_NET_F_STATUS, there's no need to
assume the link is up and we need to call nerif_carrier_off() before
querying device status, otherwise we may get wrong operstate after
diver was loaded because the link watch event was not fired as
expected.
For device that does not support VIRITO_NET_F_STATUS, we could not get
its status through virtnet_update_status() and what we can only do is
always assuming the link is up.
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/virtio_net.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index bb6b67f..b6d4028 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -986,9 +986,15 @@ static int virtnet_probe(struct virtio_device *vdev)
goto unregister;
}
- vi->status = VIRTIO_NET_S_LINK_UP;
- virtnet_update_status(vi);
- netif_carrier_on(dev);
+ /* Assume link up if device can't report link status,
+ otherwise get link status from config. */
+ if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
+ netif_carrier_off(dev);
+ virtnet_update_status(vi);
+ } else {
+ vi->status = VIRTIO_NET_S_LINK_UP;
+ netif_carrier_on(dev);
+ }
pr_debug("virtnet: registered device %s\n", dev->name);
return 0;
^ permalink raw reply related
* Re: [V2 PATCH] virtio-net: init link state correctly
From: Michael S. Tsirkin @ 2010-11-05 8:47 UTC (permalink / raw)
To: Jason Wang; +Cc: rusty, davem, markmc, linux-kernel, kvm, netdev
In-Reply-To: <19667.29541.897732.941476@gargle.gargle.HOWL>
On Fri, Nov 05, 2010 at 11:00:53AM +0800, Jason Wang wrote:
> Jason Wang writes:
>
> CC netdev missed in the original patch.
You'll have to repost it properly. Patches with a >
at start can't be applied :)
You can add my ack when you do.
> > For device that supports VIRTIO_NET_F_STATUS, there's no need to
> > assume the link is up and we need to call nerif_carrier_off() before
> > querying device status, otherwise we may get wrong operstate after
> > diver was loaded because the link watch event was not fired as
> > expected.
> >
> > For device that does not support VIRITO_NET_F_STATUS, we could not get
> > its status through virtnet_update_status() and what we can only do is
> > always assuming the link is up.
> >
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
> > ---
> > drivers/net/virtio_net.c | 12 +++++++++---
> > 1 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index bb6b67f..b6d4028 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
> > @@ -986,9 +986,15 @@ static int virtnet_probe(struct virtio_device *vdev)
> > goto unregister;
> > }
> >
> > - vi->status = VIRTIO_NET_S_LINK_UP;
> > - virtnet_update_status(vi);
> > - netif_carrier_on(dev);
> > + /* Assume link up if device can't report link status,
> > + otherwise get link status from config. */
> > + if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
> > + netif_carrier_off(dev);
> > + virtnet_update_status(vi);
> > + } else {
> > + vi->status = VIRTIO_NET_S_LINK_UP;
> > + netif_carrier_on(dev);
> > + }
> >
> > pr_debug("virtnet: registered device %s\n", dev->name);
> > return 0;
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe kvm" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
From: Eric Dumazet @ 2010-11-05 7:16 UTC (permalink / raw)
To: Joe Perches
Cc: Jesper Juhl, Jiri Kosina, Patrick McHardy, David S. Miller,
netfilter-devel, netfilter, coreteam, netdev, linux-kernel
In-Reply-To: <1288940146.18440.55.camel@Joe-Laptop>
Le jeudi 04 novembre 2010 à 23:55 -0700, Joe Perches a écrit :
> On Fri, 2010-11-05 at 07:30 +0100, Eric Dumazet wrote:
> > I had _one_ patch, waiting that David actually had vzalloc() in its tree
> > before sending it.
>
> Fine by me, use yours.
I dont care at all, only to say that David tree was not ready yet.
>
> > Given Jesper Juhl was doing this work, could you please take another
> > one, please ?
> > For example, explaining him how to use other tools than "bash+egrep
> > +manual inspection" as he mentioned in a previous mail.
>
> Jesper Juhl was both pointed at the cocci docs and
> given a cocci script. He said he'd investigate it
> when he could. I trust he will get to it.
>
Yes, yet you posted patches, knowing he was working on the _same_
subject.
I remember other occurrences of such behavior.
I find this behavior very unfriendly, time consuming, and not useful.
We try to work together, to increase our common knowledge, not to throw
a bunch of patches "just because I know better than you"
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
From: Joe Perches @ 2010-11-05 6:55 UTC (permalink / raw)
To: Eric Dumazet
Cc: Jesper Juhl, Jiri Kosina, Patrick McHardy, David S. Miller,
netfilter-devel, netfilter, coreteam, netdev, linux-kernel
In-Reply-To: <1288938640.3234.12.camel@edumazet-laptop>
On Fri, 2010-11-05 at 07:30 +0100, Eric Dumazet wrote:
> I had _one_ patch, waiting that David actually had vzalloc() in its tree
> before sending it.
Fine by me, use yours.
> Given Jesper Juhl was doing this work, could you please take another
> one, please ?
> For example, explaining him how to use other tools than "bash+egrep
> +manual inspection" as he mentioned in a previous mail.
Jesper Juhl was both pointed at the cocci docs and
given a cocci script. He said he'd investigate it
when he could. I trust he will get to it.
I think that for this sort of patchset, grep and
manual inspection works just as well as spatch
and likely better because a simple cocci script
doesn't transform code like:
if (size > PAGE_SIZE)
ptr = vmalloc(size);
else
ptr = kmalloc(size, GFP);
if (ptr)
memset(ptr, 0, size);
I did say in the 00 cover that this was broken up
just to cc the maintainers of each block.
I also think a single rolled-up single patch is good.
I believe Jiri Kosina can easily apply all these
individual patches as a single patch if he chooses.
^ permalink raw reply
* Re: [PATCH] ipv6: addrconf: don't remove address state on ifdown if the address is being kept
From: Lorenzo Colitti @ 2010-11-05 6:45 UTC (permalink / raw)
To: David Miller; +Cc: Maciej Żenczykowski, Brian Haley, netdev
In-Reply-To: <AANLkTimLicmgC3BptZvXGoA0aN6-cFJtRG3DpqJ3NTpJ@mail.gmail.com>
On Thu, Oct 28, 2010 at 2:45 PM, Lorenzo Colitti <lorenzo@google.com> wrote:
>> Fix it so that none of this state is updated if the address is being kept on the interface.
David, any feedback on this? The existing code clearly has the
intention of keeping the addresses around, except they don't actually
work, and this just fixes the bug.
Thanks,
Lorenzo
^ permalink raw reply
* Re: [PATCH] ipv6: addrconf: clear IPv6 addresses and routes when losing link
From: Lorenzo Colitti @ 2010-11-05 6:40 UTC (permalink / raw)
To: Dan Williams; +Cc: Stephen Hemminger, netdev
In-Reply-To: <1288666459.4003.47.camel@dcbw.foobar.com>
On Tue, Nov 2, 2010 at 10:54 AM, Dan Williams <dcbw@redhat.com> wrote:
> For this sort of thing, I tend to think that only higher-level network
> management daemons like NM have the *possibility* to get this sort of
> thing right, because only they have overall knowledge of the networking
> situation, like whether you've actually connected to a different network
> or not. Specifically in the case of wifi, only the connection manager
> (or wpa_supplicant) knows whether you're on a different network or not,
> anything else is a layering violation.
Maybe you're right and everything should be done in userspace. But for
now, the kernel is still processing RAs itself and adding IPv6
addresses to interfaces itself. If we don't intend to rip that all out
and replace it with a userspace implementation, then we should fix the
kernel to be a little smarter and not keep addresses around when they
are not useful any more.
This can be done relatively in a hitless fashion by putting old
addresses into the deprecated state until they are refreshed by an RA,
etc.
I don't think it's reasonable to say that we need a network management
daemon because we need to delete addresses that the kernel created and
the kernel can't be bothered to clean up after itself.
Cheers,
Lorenzo
^ permalink raw reply
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
From: Eric Dumazet @ 2010-11-05 6:30 UTC (permalink / raw)
To: Joe Perches, Jesper Juhl
Cc: Jiri Kosina, Patrick McHardy, David S. Miller, netfilter-devel,
netfilter, coreteam, netdev, linux-kernel
In-Reply-To: <7d6da34b7e84955795717b0241000a0701cd5b34.1288925425.git.joe@perches.com>
Le jeudi 04 novembre 2010 à 20:08 -0700, Joe Perches a écrit :
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> net/netfilter/x_tables.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
So many 'vzalloc' patches for net tree...
I had _one_ patch, waiting that David actually had vzalloc() in its tree
before sending it.
Given Jesper Juhl was doing this work, could you please take another
one, please ?
For example, explaining him how to use other tools than "bash+egrep
+manual inspection" as he mentioned in a previous mail.
Really Joe, your behavior should be smarter than that.
Thanks
^ permalink raw reply
* RE: [PATCH 27/49] drivers/net/netxen: Use vzalloc
From: Amit Salecha @ 2010-11-05 5:18 UTC (permalink / raw)
To: Joe Perches, Jiri Kosina
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <61bf7e82bb35693aebdb3a56b30b1c38836bf502.1288925425.git.joe@perches.com>
> From: Joe Perches [joe@perches.com]
> Sent: Friday, November 05, 2010 8:37 AM
> To: Jiri Kosina
> Cc: Amit Salecha; netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 27/49] drivers/net/netxen: Use vzalloc
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/netxen/netxen_nic_init.c | 7 ++-----
> files changed, 2 insertions(+), 5 deletions(-)
Thanks.
^ permalink raw reply
* [PATCH 30/49] drivers/net/sfc: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Solarflare linux maintainers, Steve Hodgson, Ben Hutchings,
netdev, linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/sfc/filter.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/sfc/filter.c b/drivers/net/sfc/filter.c
index 52cb608..44500b5 100644
--- a/drivers/net/sfc/filter.c
+++ b/drivers/net/sfc/filter.c
@@ -428,10 +428,9 @@ int efx_probe_filters(struct efx_nic *efx)
GFP_KERNEL);
if (!table->used_bitmap)
goto fail;
- table->spec = vmalloc(table->size * sizeof(*table->spec));
+ table->spec = vzalloc(table->size * sizeof(*table->spec));
if (!table->spec)
goto fail;
- memset(table->spec, 0, table->size * sizeof(*table->spec));
}
return 0;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 29/49] drivers/net/qlcnic: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Amit Kumar Salecha, Anirban Chakraborty, linux-driver, netdev,
linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/qlcnic/qlcnic_init.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index 0d180c6..c5ea2f4 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -236,12 +236,11 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
tx_ring->num_desc = adapter->num_txd;
tx_ring->txq = netdev_get_tx_queue(netdev, 0);
- cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(tx_ring));
+ cmd_buf_arr = vzalloc(TX_BUFF_RINGSIZE(tx_ring));
if (cmd_buf_arr == NULL) {
dev_err(&netdev->dev, "failed to allocate cmd buffer ring\n");
goto err_out;
}
- memset(cmd_buf_arr, 0, TX_BUFF_RINGSIZE(tx_ring));
tx_ring->cmd_buf_arr = cmd_buf_arr;
recv_ctx = &adapter->recv_ctx;
@@ -275,14 +274,12 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
rds_ring->dma_size + NET_IP_ALIGN;
break;
}
- rds_ring->rx_buf_arr = (struct qlcnic_rx_buffer *)
- vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
+ rds_ring->rx_buf_arr = vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
if (rds_ring->rx_buf_arr == NULL) {
dev_err(&netdev->dev, "Failed to allocate "
"rx buffer ring %d\n", ring);
goto err_out;
}
- memset(rds_ring->rx_buf_arr, 0, RCV_BUFF_RINGSIZE(rds_ring));
INIT_LIST_HEAD(&rds_ring->free_list);
/*
* Now go through all of them, set reference handles
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 47/49] net/rds: Use vzalloc
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Andy Grover, David S. Miller, rds-devel, netdev, linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
net/rds/ib_cm.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index ee369d2..cc6b073 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -374,23 +374,21 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
goto out;
}
- ic->i_sends = vmalloc_node(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work),
+ ic->i_sends = vzalloc_node(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work),
ibdev_to_node(dev));
if (!ic->i_sends) {
ret = -ENOMEM;
rdsdebug("send allocation failed\n");
goto out;
}
- memset(ic->i_sends, 0, ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work));
- ic->i_recvs = vmalloc_node(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work),
+ ic->i_recvs = vzalloc_node(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work),
ibdev_to_node(dev));
if (!ic->i_recvs) {
ret = -ENOMEM;
rdsdebug("recv allocation failed\n");
goto out;
}
- memset(ic->i_recvs, 0, ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work));
rds_ib_recv_init_ack(ic);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 46/49] net/netfilter: Use vzalloc
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina
Cc: Patrick McHardy, David S. Miller, netfilter-devel, netfilter,
coreteam, netdev, linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
net/netfilter/x_tables.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 8046350..89e8895 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -753,12 +753,11 @@ static int xt_jumpstack_alloc(struct xt_table_info *i)
size = sizeof(void **) * nr_cpu_ids;
if (size > PAGE_SIZE)
- i->jumpstack = vmalloc(size);
+ i->jumpstack = vzalloc(size);
else
- i->jumpstack = kmalloc(size, GFP_KERNEL);
+ i->jumpstack = kzalloc(size, GFP_KERNEL);
if (i->jumpstack == NULL)
return -ENOMEM;
- memset(i->jumpstack, 0, size);
i->stacksize *= xt_jumpstack_multiplier;
size = sizeof(void *) * i->stacksize;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 45/49] net/core/pktgen.c: Use vzalloc
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: David S. Miller, netdev, linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
net/core/pktgen.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index fbce4b0..ccca6cd 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3706,13 +3706,12 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
return -ENOMEM;
strcpy(pkt_dev->odevname, ifname);
- pkt_dev->flows = vmalloc_node(MAX_CFLOWS * sizeof(struct flow_state),
+ pkt_dev->flows = vzalloc_node(MAX_CFLOWS * sizeof(struct flow_state),
node);
if (pkt_dev->flows == NULL) {
kfree(pkt_dev);
return -ENOMEM;
}
- memset(pkt_dev->flows, 0, MAX_CFLOWS * sizeof(struct flow_state));
pkt_dev->removal_mark = 0;
pkt_dev->min_pkt_size = ETH_ZLEN;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 32/49] drivers/net/bnx2.c: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Michael Chan, netdev, linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/bnx2.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 062600b..aba4d0f 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -766,13 +766,10 @@ bnx2_alloc_rx_mem(struct bnx2 *bp)
int j;
rxr->rx_buf_ring =
- vmalloc(SW_RXBD_RING_SIZE * bp->rx_max_ring);
+ vzalloc(SW_RXBD_RING_SIZE * bp->rx_max_ring);
if (rxr->rx_buf_ring == NULL)
return -ENOMEM;
- memset(rxr->rx_buf_ring, 0,
- SW_RXBD_RING_SIZE * bp->rx_max_ring);
-
for (j = 0; j < bp->rx_max_ring; j++) {
rxr->rx_desc_ring[j] =
dma_alloc_coherent(&bp->pdev->dev,
@@ -785,13 +782,10 @@ bnx2_alloc_rx_mem(struct bnx2 *bp)
}
if (bp->rx_pg_ring_size) {
- rxr->rx_pg_ring = vmalloc(SW_RXPG_RING_SIZE *
+ rxr->rx_pg_ring = vzalloc(SW_RXPG_RING_SIZE *
bp->rx_max_pg_ring);
if (rxr->rx_pg_ring == NULL)
return -ENOMEM;
-
- memset(rxr->rx_pg_ring, 0, SW_RXPG_RING_SIZE *
- bp->rx_max_pg_ring);
}
for (j = 0; j < bp->rx_max_pg_ring; j++) {
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 31/49] drivers/net/vxge: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Ramkrishna Vepa, Sivakumar Subramani, Sreenivasa Honnur,
Jon Mason, netdev, linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/vxge/vxge-config.c | 37 +++++++++----------------------------
1 files changed, 9 insertions(+), 28 deletions(-)
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c
index 906a3ca3..0c0a4e4 100644
--- a/drivers/net/vxge/vxge-config.c
+++ b/drivers/net/vxge/vxge-config.c
@@ -776,14 +776,12 @@ vxge_hw_device_initialize(
if (status != VXGE_HW_OK)
goto exit;
- hldev = (struct __vxge_hw_device *)
- vmalloc(sizeof(struct __vxge_hw_device));
+ hldev = vzalloc(sizeof(struct __vxge_hw_device));
if (hldev == NULL) {
status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto exit;
}
- memset(hldev, 0, sizeof(struct __vxge_hw_device));
hldev->magic = VXGE_HW_DEVICE_MAGIC;
vxge_hw_device_debug_set(hldev, VXGE_ERR, VXGE_COMPONENT_ALL);
@@ -1627,15 +1625,12 @@ __vxge_hw_mempool_grow(struct vxge_hw_mempool *mempool, u32 num_allocate,
* allocate new memblock and its private part at once.
* This helps to minimize memory usage a lot. */
mempool->memblocks_priv_arr[i] =
- vmalloc(mempool->items_priv_size * n_items);
+ vzalloc(mempool->items_priv_size * n_items);
if (mempool->memblocks_priv_arr[i] == NULL) {
status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto exit;
}
- memset(mempool->memblocks_priv_arr[i], 0,
- mempool->items_priv_size * n_items);
-
/* allocate DMA-capable memblock */
mempool->memblocks_arr[i] =
__vxge_hw_blockpool_malloc(mempool->devh,
@@ -1707,13 +1702,11 @@ __vxge_hw_mempool_create(
goto exit;
}
- mempool = (struct vxge_hw_mempool *)
- vmalloc(sizeof(struct vxge_hw_mempool));
+ mempool = vzalloc(sizeof(struct vxge_hw_mempool));
if (mempool == NULL) {
status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto exit;
}
- memset(mempool, 0, sizeof(struct vxge_hw_mempool));
mempool->devh = devh;
mempool->memblock_size = memblock_size;
@@ -1733,31 +1726,27 @@ __vxge_hw_mempool_create(
/* allocate array of memblocks */
mempool->memblocks_arr =
- (void **) vmalloc(sizeof(void *) * mempool->memblocks_max);
+ vzalloc(sizeof(void *) * mempool->memblocks_max);
if (mempool->memblocks_arr == NULL) {
__vxge_hw_mempool_destroy(mempool);
status = VXGE_HW_ERR_OUT_OF_MEMORY;
mempool = NULL;
goto exit;
}
- memset(mempool->memblocks_arr, 0,
- sizeof(void *) * mempool->memblocks_max);
/* allocate array of private parts of items per memblocks */
mempool->memblocks_priv_arr =
- (void **) vmalloc(sizeof(void *) * mempool->memblocks_max);
+ vzalloc(sizeof(void *) * mempool->memblocks_max);
if (mempool->memblocks_priv_arr == NULL) {
__vxge_hw_mempool_destroy(mempool);
status = VXGE_HW_ERR_OUT_OF_MEMORY;
mempool = NULL;
goto exit;
}
- memset(mempool->memblocks_priv_arr, 0,
- sizeof(void *) * mempool->memblocks_max);
/* allocate array of memblocks DMA objects */
- mempool->memblocks_dma_arr = (struct vxge_hw_mempool_dma *)
- vmalloc(sizeof(struct vxge_hw_mempool_dma) *
+ mempool->memblocks_dma_arr =
+ vzalloc(sizeof(struct vxge_hw_mempool_dma) *
mempool->memblocks_max);
if (mempool->memblocks_dma_arr == NULL) {
@@ -1766,20 +1755,15 @@ __vxge_hw_mempool_create(
mempool = NULL;
goto exit;
}
- memset(mempool->memblocks_dma_arr, 0,
- sizeof(struct vxge_hw_mempool_dma) *
- mempool->memblocks_max);
/* allocate hash array of items */
- mempool->items_arr =
- (void **) vmalloc(sizeof(void *) * mempool->items_max);
+ mempool->items_arr = vzalloc(sizeof(void *) * mempool->items_max);
if (mempool->items_arr == NULL) {
__vxge_hw_mempool_destroy(mempool);
status = VXGE_HW_ERR_OUT_OF_MEMORY;
mempool = NULL;
goto exit;
}
- memset(mempool->items_arr, 0, sizeof(void *) * mempool->items_max);
/* calculate initial number of memblocks */
memblocks_to_allocate = (mempool->items_initial +
@@ -4242,15 +4226,12 @@ vxge_hw_vpath_open(struct __vxge_hw_device *hldev,
if (status != VXGE_HW_OK)
goto vpath_open_exit1;
- vp = (struct __vxge_hw_vpath_handle *)
- vmalloc(sizeof(struct __vxge_hw_vpath_handle));
+ vp = vzalloc(sizeof(struct __vxge_hw_vpath_handle));
if (vp == NULL) {
status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto vpath_open_exit2;
}
- memset(vp, 0, sizeof(struct __vxge_hw_vpath_handle));
-
vp->vpath = vpath;
if (vpath->vp_config->fifo.enable == VXGE_HW_FIFO_ENABLE) {
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 28/49] drivers/net/pch_gbe: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/pch_gbe/pch_gbe_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c
index 472056b..afb7506 100644
--- a/drivers/net/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/pch_gbe/pch_gbe_main.c
@@ -1523,12 +1523,11 @@ int pch_gbe_setup_tx_resources(struct pch_gbe_adapter *adapter,
int desNo;
size = (int)sizeof(struct pch_gbe_buffer) * tx_ring->count;
- tx_ring->buffer_info = vmalloc(size);
+ tx_ring->buffer_info = vzalloc(size);
if (!tx_ring->buffer_info) {
pr_err("Unable to allocate memory for the buffer infomation\n");
return -ENOMEM;
}
- memset(tx_ring->buffer_info, 0, size);
tx_ring->size = tx_ring->count * (int)sizeof(struct pch_gbe_tx_desc);
@@ -1573,12 +1572,11 @@ int pch_gbe_setup_rx_resources(struct pch_gbe_adapter *adapter,
int desNo;
size = (int)sizeof(struct pch_gbe_buffer) * rx_ring->count;
- rx_ring->buffer_info = vmalloc(size);
+ rx_ring->buffer_info = vzalloc(size);
if (!rx_ring->buffer_info) {
pr_err("Unable to allocate memory for the receive descriptor ring\n");
return -ENOMEM;
}
- memset(rx_ring->buffer_info, 0, size);
rx_ring->size = rx_ring->count * (int)sizeof(struct pch_gbe_rx_desc);
rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size,
&rx_ring->dma, GFP_KERNEL);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 27/49] drivers/net/netxen: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Amit Kumar Salecha, netdev, linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/netxen/netxen_nic_init.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 95fe552..731077d 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -214,13 +214,12 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
tx_ring->num_desc = adapter->num_txd;
tx_ring->txq = netdev_get_tx_queue(netdev, 0);
- cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(tx_ring));
+ cmd_buf_arr = vzalloc(TX_BUFF_RINGSIZE(tx_ring));
if (cmd_buf_arr == NULL) {
dev_err(&pdev->dev, "%s: failed to allocate cmd buffer ring\n",
netdev->name);
goto err_out;
}
- memset(cmd_buf_arr, 0, TX_BUFF_RINGSIZE(tx_ring));
tx_ring->cmd_buf_arr = cmd_buf_arr;
recv_ctx = &adapter->recv_ctx;
@@ -279,8 +278,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
break;
}
- rds_ring->rx_buf_arr = (struct netxen_rx_buffer *)
- vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
+ rds_ring->rx_buf_arr = vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
if (rds_ring->rx_buf_arr == NULL) {
printk(KERN_ERR "%s: Failed to allocate "
"rx buffer ring %d\n",
@@ -288,7 +286,6 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
/* free whatever was already allocated */
goto err_out;
}
- memset(rds_ring->rx_buf_arr, 0, RCV_BUFF_RINGSIZE(rds_ring));
INIT_LIST_HEAD(&rds_ring->free_list);
/*
* Now go through all of them, set reference handles
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 26/49] drivers/net/ixgbevf: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ixgbevf/ixgbevf_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index dc03c96..6aeaf54 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -2488,10 +2488,9 @@ int ixgbevf_setup_tx_resources(struct ixgbevf_adapter *adapter,
int size;
size = sizeof(struct ixgbevf_tx_buffer) * tx_ring->count;
- tx_ring->tx_buffer_info = vmalloc(size);
+ tx_ring->tx_buffer_info = vzalloc(size);
if (!tx_ring->tx_buffer_info)
goto err;
- memset(tx_ring->tx_buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
@@ -2555,14 +2554,13 @@ int ixgbevf_setup_rx_resources(struct ixgbevf_adapter *adapter,
int size;
size = sizeof(struct ixgbevf_rx_buffer) * rx_ring->count;
- rx_ring->rx_buffer_info = vmalloc(size);
+ rx_ring->rx_buffer_info = vzalloc(size);
if (!rx_ring->rx_buffer_info) {
hw_dbg(&adapter->hw,
"Unable to vmalloc buffer memory for "
"the receive descriptor ring\n");
goto alloc_failed;
}
- memset(rx_ring->rx_buffer_info, 0, size);
/* Round up to nearest 4K */
rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH 25/49] drivers/net/ixgbe: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ixgbe/ixgbe_main.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 2bd3eb4..c10d179 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4970,12 +4970,11 @@ int ixgbe_setup_tx_resources(struct ixgbe_adapter *adapter,
int size;
size = sizeof(struct ixgbe_tx_buffer) * tx_ring->count;
- tx_ring->tx_buffer_info = vmalloc_node(size, tx_ring->numa_node);
+ tx_ring->tx_buffer_info = vzalloc_node(size, tx_ring->numa_node);
if (!tx_ring->tx_buffer_info)
- tx_ring->tx_buffer_info = vmalloc(size);
+ tx_ring->tx_buffer_info = vzalloc(size);
if (!tx_ring->tx_buffer_info)
goto err;
- memset(tx_ring->tx_buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
@@ -5037,15 +5036,14 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter,
int size;
size = sizeof(struct ixgbe_rx_buffer) * rx_ring->count;
- rx_ring->rx_buffer_info = vmalloc_node(size, adapter->node);
+ rx_ring->rx_buffer_info = vzalloc_node(size, adapter->node);
if (!rx_ring->rx_buffer_info)
- rx_ring->rx_buffer_info = vmalloc(size);
+ rx_ring->rx_buffer_info = vzalloc(size);
if (!rx_ring->rx_buffer_info) {
e_err(probe, "vmalloc allocation failed for the Rx "
"descriptor ring\n");
goto alloc_failed;
}
- memset(rx_ring->rx_buffer_info, 0, size);
/* Round up to nearest 4K */
rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH 24/49] drivers/net/ixgb: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ixgb/ixgb_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index caa8192..211a169 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -669,13 +669,12 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
int size;
size = sizeof(struct ixgb_buffer) * txdr->count;
- txdr->buffer_info = vmalloc(size);
+ txdr->buffer_info = vzalloc(size);
if (!txdr->buffer_info) {
netif_err(adapter, probe, adapter->netdev,
"Unable to allocate transmit descriptor ring memory\n");
return -ENOMEM;
}
- memset(txdr->buffer_info, 0, size);
/* round up to nearest 4K */
@@ -759,13 +758,12 @@ ixgb_setup_rx_resources(struct ixgb_adapter *adapter)
int size;
size = sizeof(struct ixgb_buffer) * rxdr->count;
- rxdr->buffer_info = vmalloc(size);
+ rxdr->buffer_info = vzalloc(size);
if (!rxdr->buffer_info) {
netif_err(adapter, probe, adapter->netdev,
"Unable to allocate receive descriptor ring\n");
return -ENOMEM;
}
- memset(rxdr->buffer_info, 0, size);
/* Round up to nearest 4K */
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH 23/49] drivers/net/igbvf: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/igbvf/netdev.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 28af019..08e7459 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -429,10 +429,9 @@ int igbvf_setup_tx_resources(struct igbvf_adapter *adapter,
int size;
size = sizeof(struct igbvf_buffer) * tx_ring->count;
- tx_ring->buffer_info = vmalloc(size);
+ tx_ring->buffer_info = vzalloc(size);
if (!tx_ring->buffer_info)
goto err;
- memset(tx_ring->buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
@@ -469,10 +468,9 @@ int igbvf_setup_rx_resources(struct igbvf_adapter *adapter,
int size, desc_len;
size = sizeof(struct igbvf_buffer) * rx_ring->count;
- rx_ring->buffer_info = vmalloc(size);
+ rx_ring->buffer_info = vzalloc(size);
if (!rx_ring->buffer_info)
goto err;
- memset(rx_ring->buffer_info, 0, size);
desc_len = sizeof(union e1000_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH 22/49] drivers/net/igb: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/igb/igb_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 892d196..67ea262 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -2436,10 +2436,9 @@ int igb_setup_tx_resources(struct igb_ring *tx_ring)
int size;
size = sizeof(struct igb_buffer) * tx_ring->count;
- tx_ring->buffer_info = vmalloc(size);
+ tx_ring->buffer_info = vzalloc(size);
if (!tx_ring->buffer_info)
goto err;
- memset(tx_ring->buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
@@ -2587,10 +2586,9 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)
int size, desc_len;
size = sizeof(struct igb_buffer) * rx_ring->count;
- rx_ring->buffer_info = vmalloc(size);
+ rx_ring->buffer_info = vzalloc(size);
if (!rx_ring->buffer_info)
goto err;
- memset(rx_ring->buffer_info, 0, size);
desc_len = sizeof(union e1000_adv_rx_desc);
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH 21/49] drivers/net/ehea: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Breno Leitao, netdev, linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ehea/ehea_main.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 182b2a7..a84c389 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -1496,12 +1496,10 @@ static int ehea_init_q_skba(struct ehea_q_skb_arr *q_skba, int max_q_entries)
{
int arr_size = sizeof(void *) * max_q_entries;
- q_skba->arr = vmalloc(arr_size);
+ q_skba->arr = vzalloc(arr_size);
if (!q_skba->arr)
return -ENOMEM;
- memset(q_skba->arr, 0, arr_size);
-
q_skba->len = max_q_entries;
q_skba->index = 0;
q_skba->os_skbs = 0;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 20/49] drivers/net/e1000e: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/e1000e/netdev.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index c4ca162..9922edb 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2059,10 +2059,9 @@ int e1000e_setup_tx_resources(struct e1000_adapter *adapter)
int err = -ENOMEM, size;
size = sizeof(struct e1000_buffer) * tx_ring->count;
- tx_ring->buffer_info = vmalloc(size);
+ tx_ring->buffer_info = vzalloc(size);
if (!tx_ring->buffer_info)
goto err;
- memset(tx_ring->buffer_info, 0, size);
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(struct e1000_tx_desc);
@@ -2095,10 +2094,9 @@ int e1000e_setup_rx_resources(struct e1000_adapter *adapter)
int i, size, desc_len, err = -ENOMEM;
size = sizeof(struct e1000_buffer) * rx_ring->count;
- rx_ring->buffer_info = vmalloc(size);
+ rx_ring->buffer_info = vzalloc(size);
if (!rx_ring->buffer_info)
goto err;
- memset(rx_ring->buffer_info, 0, size);
for (i = 0; i < rx_ring->count; i++) {
buffer_info = &rx_ring->buffer_info[i];
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH 19/49] drivers/net/e1000: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: e1000-devel, Bruce Allan, Jesse Brandeburg, linux-kernel,
Greg Rose, John Ronciak, Jeff Kirsher, netdev
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/e1000/e1000_main.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4686c39..dcb7f82 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1425,13 +1425,12 @@ static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
int size;
size = sizeof(struct e1000_buffer) * txdr->count;
- txdr->buffer_info = vmalloc(size);
+ txdr->buffer_info = vzalloc(size);
if (!txdr->buffer_info) {
e_err(probe, "Unable to allocate memory for the Tx descriptor "
"ring\n");
return -ENOMEM;
}
- memset(txdr->buffer_info, 0, size);
/* round up to nearest 4K */
@@ -1621,13 +1620,12 @@ static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
int size, desc_len;
size = sizeof(struct e1000_buffer) * rxdr->count;
- rxdr->buffer_info = vmalloc(size);
+ rxdr->buffer_info = vzalloc(size);
if (!rxdr->buffer_info) {
e_err(probe, "Unable to allocate memory for the Rx descriptor "
"ring\n");
return -ENOMEM;
}
- memset(rxdr->buffer_info, 0, size);
desc_len = sizeof(struct e1000_rx_desc);
--
1.7.3.1.g432b3.dirty
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox