* Re: Problem with non aligned DMA in usbnet on ARM
From: Martin Fuzzey @ 2010-08-11 16:08 UTC (permalink / raw)
To: Greg KH; +Cc: Russell King - ARM Linux, linux-usb, netdev, linux-arm-kernel
In-Reply-To: <20100811150443.GB8867@kroah.com>
On Wed, Aug 11, 2010 at 5:04 PM, Greg KH <greg@kroah.com> wrote:
>> Here is a pointer to the thread where it was stated that HCD's don't
>> have to handle this.
>>
>> http://kerneltrap.org/mailarchive/linux-usb/2009/4/20/5528164
>
> No, that thread is about stack vs. heap allocations, not about alignment
> issues.
>
Well although the issue discussed in that thread was caused by a stack
allocation isn't the issue here the same?
My understanding is that a heap allocation as returned by kmalloc() will be:
1) correctly aligned for DMA
and
2) in a memory zone accessible to DMA
whereas a stack allocation is not guaranteed to have either of these properties.
The problem I described in that thread was due to case 1
(misalignment) rather than the stack memory zone not being accessible
at all to DMA.
To which was the reply was basically "use a heap allocation".
So the question is are hcds expected to accept arbitarilly aligned but
heap allocated pointers (such as the result of kmalloc() + 1)?
regards,
Martin
> thanks,
>
> greg k-h
>
^ permalink raw reply
* Re: [PATCH] Fix deadlock between boomerang_interrupt and boomerang_start_tx in 3c59x
From: Stephen Hemminger @ 2010-08-11 16:09 UTC (permalink / raw)
To: Neil Horman; +Cc: netdev
In-Reply-To: <20100811151257.GB23317@hmsreliant.think-freely.org>
On Wed, 11 Aug 2010 11:12:57 -0400
Neil Horman <nhorman@tuxdriver.com> wrote:
> If netconsole is in use, there is a possibility for deadlock in 3c59x between
> boomerang_interrupt and boomerang_start_xmit. Both routines take the vp->lock,
> and if netconsole is in use, a pr_* call from the boomerang_interrupt routine
> will result in the netconsole code attempting to trnasmit an skb, which can try
> to take the same spin lock, resulting in de
I thought we agreed that any device supporting netconsole agrees
to not call printk in the transmit path. Just kill the pr_* call.
^ permalink raw reply
* iproute2 question on flushing addresses
From: Ben Greear @ 2010-08-11 17:01 UTC (permalink / raw)
To: NetDev
I am trying to flush all secondary IPs before flushing primaries, because
otherwise it creates a flood of netlink messages as each primary is deleted
and a secondary takes over as primary (changing all routes for all other
secondaries).
I was thinking this command could work, but it does not appear to do
anything:
./local/sbin/ip addr flush dev rddVR17 secondary
While poking at the code..I saw this. It seems to me that the check for IFA_F_SECONDARY
is reversed?
int print_addrinfo_primary(const struct sockaddr_nl *who, struct nlmsghdr *n,
void *arg)
{
struct ifaddrmsg *ifa = NLMSG_DATA(n);
if (!ifa->ifa_flags & IFA_F_SECONDARY)
return 0;
return print_addrinfo(who, n, arg);
}
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* [PATCH (for some future time)] drivers/net: Convert unbounded kzalloc calls to kcalloc
From: Joe Perches @ 2010-08-11 17:02 UTC (permalink / raw)
To: netdev, linux-wireless; +Cc: linux-kernel
These changes may be slightly safer in some instances.
There are other kzalloc calls with a multiply, but those
calls are typically "small fixed #" * sizeof(some pointer)"
and those are not converted.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/cnic.c | 2 +-
drivers/net/ehea/ehea_main.c | 4 ++--
drivers/net/mlx4/alloc.c | 2 +-
drivers/net/mlx4/en_rx.c | 2 +-
drivers/net/mlx4/profile.c | 2 +-
drivers/net/myri10ge/myri10ge.c | 4 ++--
drivers/net/niu.c | 4 ++--
drivers/net/vxge/vxge-main.c | 10 +++++-----
drivers/net/wireless/airo.c | 5 ++---
drivers/net/wireless/b43/phy_n.c | 2 +-
drivers/net/wireless/ipw2x00/ipw2100.c | 6 +++---
drivers/net/wireless/ipw2x00/ipw2200.c | 12 ++++++------
drivers/net/wireless/rt2x00/rt2400pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500usb.c | 2 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 2 +-
drivers/net/wireless/rt2x00/rt2x00debug.c | 2 +-
drivers/net/wireless/rt2x00/rt2x00queue.c | 4 ++--
drivers/net/wireless/rt2x00/rt61pci.c | 2 +-
drivers/net/wireless/rt2x00/rt73usb.c | 2 +-
drivers/net/wireless/wl12xx/wl1271_scan.c | 2 +-
21 files changed, 37 insertions(+), 38 deletions(-)
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 0961032..2ab6a7c 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -1022,7 +1022,7 @@ static int cnic_alloc_bnx2x_context(struct cnic_dev *dev)
if (blks > cp->ethdev->ctx_tbl_len)
return -ENOMEM;
- cp->ctx_arr = kzalloc(blks * sizeof(struct cnic_ctx), GFP_KERNEL);
+ cp->ctx_arr = kcalloc(blks, sizeof(struct cnic_ctx), GFP_KERNEL);
if (cp->ctx_arr == NULL)
return -ENOMEM;
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 3beba70..455d101 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -180,7 +180,7 @@ static void ehea_update_firmware_handles(void)
num_portres * EHEA_NUM_PORTRES_FW_HANDLES;
if (num_fw_handles) {
- arr = kzalloc(num_fw_handles * sizeof(*arr), GFP_KERNEL);
+ arr = kcalloc(num_fw_handles, sizeof(*arr), GFP_KERNEL);
if (!arr)
goto out; /* Keep the existing array */
} else
@@ -265,7 +265,7 @@ static void ehea_update_bcmc_registrations(void)
}
if (num_registrations) {
- arr = kzalloc(num_registrations * sizeof(*arr), GFP_ATOMIC);
+ arr = kcalloc(num_registrations, sizeof(*arr), GFP_ATOMIC);
if (!arr)
goto out; /* Keep the existing array */
} else
diff --git a/drivers/net/mlx4/alloc.c b/drivers/net/mlx4/alloc.c
index 8c85156..537997f 100644
--- a/drivers/net/mlx4/alloc.c
+++ b/drivers/net/mlx4/alloc.c
@@ -188,7 +188,7 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE;
buf->npages = buf->nbufs;
buf->page_shift = PAGE_SHIFT;
- buf->page_list = kzalloc(buf->nbufs * sizeof *buf->page_list,
+ buf->page_list = kcalloc(buf->nbufs, sizeof(*buf->page_list),
GFP_KERNEL);
if (!buf->page_list)
return -ENOMEM;
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index 8e2fcb7..efc3fad 100644
--- a/drivers/net/mlx4/en_rx.c
+++ b/drivers/net/mlx4/en_rx.c
@@ -322,7 +322,7 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
ring->lro.ip_summed_aggr = CHECKSUM_UNNECESSARY;
ring->lro.max_desc = mdev->profile.num_lro;
ring->lro.max_aggr = MAX_SKB_FRAGS;
- ring->lro.lro_arr = kzalloc(mdev->profile.num_lro *
+ ring->lro.lro_arr = kcalloc(mdev->profile.num_lro,
sizeof(struct net_lro_desc),
GFP_KERNEL);
if (!ring->lro.lro_arr) {
diff --git a/drivers/net/mlx4/profile.c b/drivers/net/mlx4/profile.c
index 5caf011..e749f82 100644
--- a/drivers/net/mlx4/profile.c
+++ b/drivers/net/mlx4/profile.c
@@ -85,7 +85,7 @@ u64 mlx4_make_profile(struct mlx4_dev *dev,
struct mlx4_resource tmp;
int i, j;
- profile = kzalloc(MLX4_RES_NUM * sizeof *profile, GFP_KERNEL);
+ profile = kcalloc(MLX4_RES_NUM, sizeof(*profile), GFP_KERNEL);
if (!profile)
return -ENOMEM;
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index d771d16..323fbc1 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -3729,8 +3729,8 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
* slices. We give up on MSI-X if we can only get a single
* vector. */
- mgp->msix_vectors = kzalloc(mgp->num_slices *
- sizeof(*mgp->msix_vectors), GFP_KERNEL);
+ mgp->msix_vectors = kcalloc(mgp->num_slices, sizeof(*mgp->msix_vectors),
+ GFP_KERNEL);
if (mgp->msix_vectors == NULL)
goto disable_msix;
for (i = 0; i < mgp->num_slices; i++) {
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index b9b9508..fc58f9c 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -4507,7 +4507,7 @@ static int niu_alloc_channels(struct niu *np)
np->dev->real_num_tx_queues = np->num_tx_rings;
- np->rx_rings = kzalloc(np->num_rx_rings * sizeof(struct rx_ring_info),
+ np->rx_rings = kcalloc(np->num_rx_rings, sizeof(struct rx_ring_info),
GFP_KERNEL);
err = -ENOMEM;
if (!np->rx_rings)
@@ -4541,7 +4541,7 @@ static int niu_alloc_channels(struct niu *np)
return err;
}
- np->tx_rings = kzalloc(np->num_tx_rings * sizeof(struct tx_ring_info),
+ np->tx_rings = kcalloc(np->num_tx_rings, sizeof(struct tx_ring_info),
GFP_KERNEL);
err = -ENOMEM;
if (!np->tx_rings)
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index c7c5605..f5334b2 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -2159,8 +2159,8 @@ start:
/* Alarm MSIX Vectors count */
vdev->intr_cnt++;
- vdev->entries = kzalloc(vdev->intr_cnt * sizeof(struct msix_entry),
- GFP_KERNEL);
+ vdev->entries = kcalloc(vdev->intr_cnt, sizeof(struct msix_entry),
+ GFP_KERNEL);
if (!vdev->entries) {
vxge_debug_init(VXGE_ERR,
"%s: memory allocation failed",
@@ -2169,9 +2169,9 @@ start:
goto alloc_entries_failed;
}
- vdev->vxge_entries =
- kzalloc(vdev->intr_cnt * sizeof(struct vxge_msix_entry),
- GFP_KERNEL);
+ vdev->vxge_entries = kcalloc(vdev->intr_cnt,
+ sizeof(struct vxge_msix_entry),
+ GFP_KERNEL);
if (!vdev->vxge_entries) {
vxge_debug_init(VXGE_ERR, "%s: memory allocation failed",
VXGE_DRIVER_NAME);
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 1d05445..7d26506 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2723,9 +2723,8 @@ static int airo_networks_allocate(struct airo_info *ai)
if (ai->networks)
return 0;
- ai->networks =
- kzalloc(AIRO_MAX_NETWORK_COUNT * sizeof(BSSListElement),
- GFP_KERNEL);
+ ai->networks = kcalloc(AIRO_MAX_NETWORK_COUNT, sizeof(BSSListElement),
+ GFP_KERNEL);
if (!ai->networks) {
airo_print_warn("", "Out of memory allocating beacons");
return -ENOMEM;
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 5a72570..e288c55 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1182,7 +1182,7 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max,
len = bw << 1;
}
- samples = kzalloc(len * sizeof(struct b43_c32), GFP_KERNEL);
+ samples = kcalloc(len, sizeof(struct b43_c32), GFP_KERNEL);
if (!samples) {
b43err(dev->wl, "allocation for samples generation failed\n");
return 0;
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index c24c5ef..2e07f1e 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -1921,9 +1921,9 @@ static int ipw2100_net_init(struct net_device *dev)
bg_band->band = IEEE80211_BAND_2GHZ;
bg_band->n_channels = geo->bg_channels;
- bg_band->channels =
- kzalloc(geo->bg_channels *
- sizeof(struct ieee80211_channel), GFP_KERNEL);
+ bg_band->channels = kcalloc(geo->bg_channels,
+ sizeof(struct ieee80211_channel),
+ GFP_KERNEL);
/* translate geo->bg to bg_band.channels */
for (i = 0; i < geo->bg_channels; i++) {
bg_band->channels[i].band = IEEE80211_BAND_2GHZ;
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index cb2552a..0f25083 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -11467,9 +11467,9 @@ static int ipw_net_init(struct net_device *dev)
bg_band->band = IEEE80211_BAND_2GHZ;
bg_band->n_channels = geo->bg_channels;
- bg_band->channels =
- kzalloc(geo->bg_channels *
- sizeof(struct ieee80211_channel), GFP_KERNEL);
+ bg_band->channels = kcalloc(geo->bg_channels,
+ sizeof(struct ieee80211_channel),
+ GFP_KERNEL);
/* translate geo->bg to bg_band.channels */
for (i = 0; i < geo->bg_channels; i++) {
bg_band->channels[i].band = IEEE80211_BAND_2GHZ;
@@ -11502,9 +11502,9 @@ static int ipw_net_init(struct net_device *dev)
a_band->band = IEEE80211_BAND_5GHZ;
a_band->n_channels = geo->a_channels;
- a_band->channels =
- kzalloc(geo->a_channels *
- sizeof(struct ieee80211_channel), GFP_KERNEL);
+ a_band->channels = kcalloc(geo->a_channels,
+ sizeof(struct ieee80211_channel),
+ GFP_KERNEL);
/* translate geo->bg to a_band.channels */
for (i = 0; i < geo->a_channels; i++) {
a_band->channels[i].band = IEEE80211_BAND_2GHZ;
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 5063e01..8e3fbdf 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1481,7 +1481,7 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index c2a555d..1d174e4 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1795,7 +1795,7 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index cdaf93f..8ddaae4 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1698,7 +1698,7 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index b66e0fd..8c00fbd 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2865,7 +2865,7 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index b0498e7..2d018ce 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -333,7 +333,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file,
if (*offset)
return 0;
- data = kzalloc(lines * MAX_LINE_LENGTH, GFP_KERNEL);
+ data = kcalloc(lines, MAX_LINE_LENGTH, GFP_KERNEL);
if (!data)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index a3401d3..9c609be 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -755,7 +755,7 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue,
* Allocate all queue entries.
*/
entry_size = sizeof(*entries) + qdesc->priv_size;
- entries = kzalloc(queue->limit * entry_size, GFP_KERNEL);
+ entries = kcalloc(queue->limit, entry_size, GFP_KERNEL);
if (!entries)
return -ENOMEM;
@@ -891,7 +891,7 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)
*/
rt2x00dev->data_queues = 2 + rt2x00dev->ops->tx_queues + req_atim;
- queue = kzalloc(rt2x00dev->data_queues * sizeof(*queue), GFP_KERNEL);
+ queue = kcalloc(rt2x00dev->data_queues, sizeof(*queue), GFP_KERNEL);
if (!queue) {
ERROR(rt2x00dev, "Queue allocation failed.\n");
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index e539c6c..f226582 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2654,7 +2654,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index aa9de18..99985a2 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2084,7 +2084,7 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
/*
* Create channel information array
*/
- info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
+ info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
diff --git a/drivers/net/wireless/wl12xx/wl1271_scan.c b/drivers/net/wireless/wl12xx/wl1271_scan.c
index fec43ee..30dc100 100644
--- a/drivers/net/wireless/wl12xx/wl1271_scan.c
+++ b/drivers/net/wireless/wl12xx/wl1271_scan.c
@@ -248,7 +248,7 @@ int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
wl->scan.req = req;
- wl->scan.scanned_ch = kzalloc(req->n_channels *
+ wl->scan.scanned_ch = kcalloc(req->n_channels,
sizeof(*wl->scan.scanned_ch),
GFP_KERNEL);
wl1271_scan_stm(wl);
^ permalink raw reply related
* Re: [PATCH] pcnet_cs: Use proper netdev_*-printouts
From: Dominik Brodowski @ 2010-08-09 15:34 UTC (permalink / raw)
To: Wolfram Sang, Joe Perches; +Cc: netdev, linux-pcmcia, David Miller
In-Reply-To: <1281270725-25282-1-git-send-email-w.sang@pengutronix.de>
On Sun, Aug 08, 2010 at 02:32:05PM +0200, Wolfram Sang wrote:
> To prevent broken messages like:
>
> [ 204.024291] eth%d: pcnet_reset_8390() did not complete.
>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Dominik Brodowski <linux@dominikbrodowski.net>
> Cc: Joe Perches <joe@perches.com>
> Cc: David Miller <davem@davemloft.net>
and
On Sun, Aug 08, 2010 at 07:50:36AM -0700, Joe Perches wrote:
> It looks as if the printks in get_ax88190 are
> incorrect and were duplicated and superceded by a
> test in pcnet_config, so I removed them.
>
> Changed the level of the ax88190 test to KERN_NOTICE
> to match the other message styles in pcnet_config.
>
> Compiled but untested.
>
> Signed-off-by: Joe Perches <joe@perches.com>
look good from a PCMCIA point of view, therefore:
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Thanks,
Dominik
^ permalink raw reply
* [iproute2] iproute2: Fix 'addr flush secondary' logic.
From: Ben Greear @ 2010-08-11 17:19 UTC (permalink / raw)
To: netdev; +Cc: Ben Greear
It appears that the check for secondary v/s primary was reversed
when flushing addresses. This caused:
ip addr flush dev eth0 secondary
to not actually flush anything.
This patch makes the check for IFA_F_SECONDARY match the
function names.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 5f0789c... 77b400d... M ip/ipaddress.c
ip/ipaddress.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 5f0789c..77b400d 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -637,7 +637,7 @@ int print_addrinfo_primary(const struct sockaddr_nl *who, struct nlmsghdr *n,
{
struct ifaddrmsg *ifa = NLMSG_DATA(n);
- if (!ifa->ifa_flags & IFA_F_SECONDARY)
+ if (ifa->ifa_flags & IFA_F_SECONDARY)
return 0;
return print_addrinfo(who, n, arg);
@@ -648,7 +648,7 @@ int print_addrinfo_secondary(const struct sockaddr_nl *who, struct nlmsghdr *n,
{
struct ifaddrmsg *ifa = NLMSG_DATA(n);
- if (ifa->ifa_flags & IFA_F_SECONDARY)
+ if (!ifa->ifa_flags & IFA_F_SECONDARY)
return 0;
return print_addrinfo(who, n, arg);
--
1.6.2.5
^ permalink raw reply related
* Re: Problem with non aligned DMA in usbnet on ARM
From: Greg KH @ 2010-08-11 17:42 UTC (permalink / raw)
To: Martin Fuzzey
Cc: Russell King - ARM Linux, linux-usb,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <AANLkTimmJDKbh3_pRY_ASKvjsf4YuuUMh3edh5LvDv-p-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Wed, Aug 11, 2010 at 06:08:43PM +0200, Martin Fuzzey wrote:
> On Wed, Aug 11, 2010 at 5:04 PM, Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org> wrote:
> >> Here is a pointer to the thread where it was stated that HCD's don't
> >> have to handle this.
> >>
> >> http://kerneltrap.org/mailarchive/linux-usb/2009/4/20/5528164
> >
> > No, that thread is about stack vs. heap allocations, not about alignment
> > issues.
> >
>
> Well although the issue discussed in that thread was caused by a stack
> allocation isn't the issue here the same?
>
> My understanding is that a heap allocation as returned by kmalloc() will be:
> 1) correctly aligned for DMA
> and
> 2) in a memory zone accessible to DMA
>
> whereas a stack allocation is not guaranteed to have either of these properties.
>
> The problem I described in that thread was due to case 1
> (misalignment) rather than the stack memory zone not being accessible
> at all to DMA.
> To which was the reply was basically "use a heap allocation".
>
> So the question is are hcds expected to accept arbitarilly aligned but
> heap allocated pointers (such as the result of kmalloc() + 1)?
It sounds like your HCD doesn't like this, so perhaps we should make
that rule :)
If you allocate the urb with a kmalloc() call with no offset, does it
all work properly? The driver should be calling usb_alloc_urb() which
does this automatically for them, right? Or is it trying to allocate
things on its own somehow?
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] Fix deadlock between boomerang_interrupt and boomerang_start_tx in 3c59x
From: Neil Horman @ 2010-08-11 17:51 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20100811120900.3629706c@s6510>
On Wed, Aug 11, 2010 at 12:09:00PM -0400, Stephen Hemminger wrote:
> On Wed, 11 Aug 2010 11:12:57 -0400
> Neil Horman <nhorman@tuxdriver.com> wrote:
>
> > If netconsole is in use, there is a possibility for deadlock in 3c59x between
> > boomerang_interrupt and boomerang_start_xmit. Both routines take the vp->lock,
> > and if netconsole is in use, a pr_* call from the boomerang_interrupt routine
> > will result in the netconsole code attempting to trnasmit an skb, which can try
> > to take the same spin lock, resulting in de
>
> I thought we agreed that any device supporting netconsole agrees
> to not call printk in the transmit path. Just kill the pr_* call.
>
3c59x isn't calling pr_* in the transmit path, its calling it in the interrupt
handler, but since the interrupt handler and the transmit path share a spinlock,
you get a deadlock in that case. We could kill the several pr_debug calls in
the interrupt path, but I don't think thats really needed in this case.
Neil
^ permalink raw reply
* Re: QoS weirdness : HTB accuracy
From: Andrew Beverley @ 2010-08-11 17:59 UTC (permalink / raw)
To: Jussi Kivilinna
Cc: Jesper Dangaard Brouer, Julien Vehent, Philip A. Prindeville,
Netdev, netfilter, hawk
In-Reply-To: <20100707180753.104124gv6yvtou9s@hayate.sektori.org>
On Wed, 2010-07-07 at 18:07 +0300, Jussi Kivilinna wrote:
> >>>> I was, in fact, an error in my ruleset. I had put the 'linklayer atm' at
> >>>> both the branch and leaf levels, so the overhead was computed twice,
> >>>> creating those holes in the bandwidth.
> >>>
> >>> I am seeing similar behaviour with my setup. Am I making the same
> >>> mistake? A subset of my rules is as follows:
> >>>
> >>> tc qdisc add dev ppp0 root handle 1: htb r2q 1
> >>>
> >>> tc class add dev ppp0 parent 1: classid 1:1 htb \
> >>> rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit \
> >>> overhead $overhead linklayer atm <------- Here
> >>>
> >>> tc class add dev ppp0 parent 1:1 classid 1:10 htb \
> >>> rate 612kbit ceil 612kbit prio 0 \
> >>> overhead $overhead linklayer atm <------- And here
> >>>
> >>> tc qdisc add dev ppp0 parent 1:10 handle 4210: \
> >>> sfq perturb 10 limit 50
> >>>
> >>> tc filter add dev ppp0 parent 1:0 protocol ip \
> >>> prio 10 handle 10 fw flowid 1:10
> >>
> >> I removed the overhead option on the first leaf, and the speeds change
> >> to what I expect. However, the rules above are taken straight from the
> >> ADSL Optimizer project, which was the source of the original overhead
> >> patch for tc. So is the ADSL Optimizer project wrong?
> >
> > After looking at the HTB kernel code I believe that the ADSL
> > Optimizer project is NOT wrong. You should/must set the linklayer
> > option on both the root class and leaf (else you would be charging
> > the root/parent node too little).
> >
>
> It's been while I looked at the linklayer/size-table code, but if I
> remember right overhead is calculated with first linklayer packet sees
> in qdisc. So when packet goes to leaf with 'linklayer atm', packet get
> packet size with overhead for ATM and root linklayer is not used for
> that packet. Because of this you can have leafs with different
> overheads (pppoe, ipv6-tunnel, etc, with ) and all get right
> overhead... ..
>
> ..
>
> ...Uh oh...
>
> HTB still has linklayer/overhead of its own, I was talking about the
> generic linklayer code that can be used with all qdiscs. Never mind,
> sorry.
Ah, I hadn't come across the tc-stab functionality until now. So that
does exactly the same for all qdiscs as the original ATM patch does for
HTB? But they work slightly differently as you have alluded to above?
Andy
^ permalink raw reply
* Re: [PATCH (for some future time)] drivers/net: Convert unbounded kzalloc calls to kcalloc
From: Gertjan van Wingerde @ 2010-08-11 18:40 UTC (permalink / raw)
To: Joe Perches; +Cc: netdev, linux-wireless, linux-kernel
In-Reply-To: <1281546168.3976.39.camel@Joe-Laptop.home>
On 08/11/10 19:02, Joe Perches wrote:
> These changes may be slightly safer in some instances.
>
> There are other kzalloc calls with a multiply, but those
> calls are typically "small fixed #" * sizeof(some pointer)"
> and those are not converted.
>
> Signed-off-by: Joe Perches <joe@perches.com>
For the rt2x00 parts:
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
> ---
> drivers/net/cnic.c | 2 +-
> drivers/net/ehea/ehea_main.c | 4 ++--
> drivers/net/mlx4/alloc.c | 2 +-
> drivers/net/mlx4/en_rx.c | 2 +-
> drivers/net/mlx4/profile.c | 2 +-
> drivers/net/myri10ge/myri10ge.c | 4 ++--
> drivers/net/niu.c | 4 ++--
> drivers/net/vxge/vxge-main.c | 10 +++++-----
> drivers/net/wireless/airo.c | 5 ++---
> drivers/net/wireless/b43/phy_n.c | 2 +-
> drivers/net/wireless/ipw2x00/ipw2100.c | 6 +++---
> drivers/net/wireless/ipw2x00/ipw2200.c | 12 ++++++------
> drivers/net/wireless/rt2x00/rt2400pci.c | 2 +-
> drivers/net/wireless/rt2x00/rt2500pci.c | 2 +-
> drivers/net/wireless/rt2x00/rt2500usb.c | 2 +-
> drivers/net/wireless/rt2x00/rt2800lib.c | 2 +-
> drivers/net/wireless/rt2x00/rt2x00debug.c | 2 +-
> drivers/net/wireless/rt2x00/rt2x00queue.c | 4 ++--
> drivers/net/wireless/rt2x00/rt61pci.c | 2 +-
> drivers/net/wireless/rt2x00/rt73usb.c | 2 +-
> drivers/net/wireless/wl12xx/wl1271_scan.c | 2 +-
> 21 files changed, 37 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
> index 0961032..2ab6a7c 100644
> --- a/drivers/net/cnic.c
> +++ b/drivers/net/cnic.c
> @@ -1022,7 +1022,7 @@ static int cnic_alloc_bnx2x_context(struct cnic_dev *dev)
> if (blks > cp->ethdev->ctx_tbl_len)
> return -ENOMEM;
>
> - cp->ctx_arr = kzalloc(blks * sizeof(struct cnic_ctx), GFP_KERNEL);
> + cp->ctx_arr = kcalloc(blks, sizeof(struct cnic_ctx), GFP_KERNEL);
> if (cp->ctx_arr == NULL)
> return -ENOMEM;
>
> diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
> index 3beba70..455d101 100644
> --- a/drivers/net/ehea/ehea_main.c
> +++ b/drivers/net/ehea/ehea_main.c
> @@ -180,7 +180,7 @@ static void ehea_update_firmware_handles(void)
> num_portres * EHEA_NUM_PORTRES_FW_HANDLES;
>
> if (num_fw_handles) {
> - arr = kzalloc(num_fw_handles * sizeof(*arr), GFP_KERNEL);
> + arr = kcalloc(num_fw_handles, sizeof(*arr), GFP_KERNEL);
> if (!arr)
> goto out; /* Keep the existing array */
> } else
> @@ -265,7 +265,7 @@ static void ehea_update_bcmc_registrations(void)
> }
>
> if (num_registrations) {
> - arr = kzalloc(num_registrations * sizeof(*arr), GFP_ATOMIC);
> + arr = kcalloc(num_registrations, sizeof(*arr), GFP_ATOMIC);
> if (!arr)
> goto out; /* Keep the existing array */
> } else
> diff --git a/drivers/net/mlx4/alloc.c b/drivers/net/mlx4/alloc.c
> index 8c85156..537997f 100644
> --- a/drivers/net/mlx4/alloc.c
> +++ b/drivers/net/mlx4/alloc.c
> @@ -188,7 +188,7 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
> buf->nbufs = (size + PAGE_SIZE - 1) / PAGE_SIZE;
> buf->npages = buf->nbufs;
> buf->page_shift = PAGE_SHIFT;
> - buf->page_list = kzalloc(buf->nbufs * sizeof *buf->page_list,
> + buf->page_list = kcalloc(buf->nbufs, sizeof(*buf->page_list),
> GFP_KERNEL);
> if (!buf->page_list)
> return -ENOMEM;
> diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
> index 8e2fcb7..efc3fad 100644
> --- a/drivers/net/mlx4/en_rx.c
> +++ b/drivers/net/mlx4/en_rx.c
> @@ -322,7 +322,7 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
> ring->lro.ip_summed_aggr = CHECKSUM_UNNECESSARY;
> ring->lro.max_desc = mdev->profile.num_lro;
> ring->lro.max_aggr = MAX_SKB_FRAGS;
> - ring->lro.lro_arr = kzalloc(mdev->profile.num_lro *
> + ring->lro.lro_arr = kcalloc(mdev->profile.num_lro,
> sizeof(struct net_lro_desc),
> GFP_KERNEL);
> if (!ring->lro.lro_arr) {
> diff --git a/drivers/net/mlx4/profile.c b/drivers/net/mlx4/profile.c
> index 5caf011..e749f82 100644
> --- a/drivers/net/mlx4/profile.c
> +++ b/drivers/net/mlx4/profile.c
> @@ -85,7 +85,7 @@ u64 mlx4_make_profile(struct mlx4_dev *dev,
> struct mlx4_resource tmp;
> int i, j;
>
> - profile = kzalloc(MLX4_RES_NUM * sizeof *profile, GFP_KERNEL);
> + profile = kcalloc(MLX4_RES_NUM, sizeof(*profile), GFP_KERNEL);
> if (!profile)
> return -ENOMEM;
>
> diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
> index d771d16..323fbc1 100644
> --- a/drivers/net/myri10ge/myri10ge.c
> +++ b/drivers/net/myri10ge/myri10ge.c
> @@ -3729,8 +3729,8 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
> * slices. We give up on MSI-X if we can only get a single
> * vector. */
>
> - mgp->msix_vectors = kzalloc(mgp->num_slices *
> - sizeof(*mgp->msix_vectors), GFP_KERNEL);
> + mgp->msix_vectors = kcalloc(mgp->num_slices, sizeof(*mgp->msix_vectors),
> + GFP_KERNEL);
> if (mgp->msix_vectors == NULL)
> goto disable_msix;
> for (i = 0; i < mgp->num_slices; i++) {
> diff --git a/drivers/net/niu.c b/drivers/net/niu.c
> index b9b9508..fc58f9c 100644
> --- a/drivers/net/niu.c
> +++ b/drivers/net/niu.c
> @@ -4507,7 +4507,7 @@ static int niu_alloc_channels(struct niu *np)
>
> np->dev->real_num_tx_queues = np->num_tx_rings;
>
> - np->rx_rings = kzalloc(np->num_rx_rings * sizeof(struct rx_ring_info),
> + np->rx_rings = kcalloc(np->num_rx_rings, sizeof(struct rx_ring_info),
> GFP_KERNEL);
> err = -ENOMEM;
> if (!np->rx_rings)
> @@ -4541,7 +4541,7 @@ static int niu_alloc_channels(struct niu *np)
> return err;
> }
>
> - np->tx_rings = kzalloc(np->num_tx_rings * sizeof(struct tx_ring_info),
> + np->tx_rings = kcalloc(np->num_tx_rings, sizeof(struct tx_ring_info),
> GFP_KERNEL);
> err = -ENOMEM;
> if (!np->tx_rings)
> diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
> index c7c5605..f5334b2 100644
> --- a/drivers/net/vxge/vxge-main.c
> +++ b/drivers/net/vxge/vxge-main.c
> @@ -2159,8 +2159,8 @@ start:
> /* Alarm MSIX Vectors count */
> vdev->intr_cnt++;
>
> - vdev->entries = kzalloc(vdev->intr_cnt * sizeof(struct msix_entry),
> - GFP_KERNEL);
> + vdev->entries = kcalloc(vdev->intr_cnt, sizeof(struct msix_entry),
> + GFP_KERNEL);
> if (!vdev->entries) {
> vxge_debug_init(VXGE_ERR,
> "%s: memory allocation failed",
> @@ -2169,9 +2169,9 @@ start:
> goto alloc_entries_failed;
> }
>
> - vdev->vxge_entries =
> - kzalloc(vdev->intr_cnt * sizeof(struct vxge_msix_entry),
> - GFP_KERNEL);
> + vdev->vxge_entries = kcalloc(vdev->intr_cnt,
> + sizeof(struct vxge_msix_entry),
> + GFP_KERNEL);
> if (!vdev->vxge_entries) {
> vxge_debug_init(VXGE_ERR, "%s: memory allocation failed",
> VXGE_DRIVER_NAME);
> diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
> index 1d05445..7d26506 100644
> --- a/drivers/net/wireless/airo.c
> +++ b/drivers/net/wireless/airo.c
> @@ -2723,9 +2723,8 @@ static int airo_networks_allocate(struct airo_info *ai)
> if (ai->networks)
> return 0;
>
> - ai->networks =
> - kzalloc(AIRO_MAX_NETWORK_COUNT * sizeof(BSSListElement),
> - GFP_KERNEL);
> + ai->networks = kcalloc(AIRO_MAX_NETWORK_COUNT, sizeof(BSSListElement),
> + GFP_KERNEL);
> if (!ai->networks) {
> airo_print_warn("", "Out of memory allocating beacons");
> return -ENOMEM;
> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
> index 5a72570..e288c55 100644
> --- a/drivers/net/wireless/b43/phy_n.c
> +++ b/drivers/net/wireless/b43/phy_n.c
> @@ -1182,7 +1182,7 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max,
> len = bw << 1;
> }
>
> - samples = kzalloc(len * sizeof(struct b43_c32), GFP_KERNEL);
> + samples = kcalloc(len, sizeof(struct b43_c32), GFP_KERNEL);
> if (!samples) {
> b43err(dev->wl, "allocation for samples generation failed\n");
> return 0;
> diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
> index c24c5ef..2e07f1e 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2100.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
> @@ -1921,9 +1921,9 @@ static int ipw2100_net_init(struct net_device *dev)
>
> bg_band->band = IEEE80211_BAND_2GHZ;
> bg_band->n_channels = geo->bg_channels;
> - bg_band->channels =
> - kzalloc(geo->bg_channels *
> - sizeof(struct ieee80211_channel), GFP_KERNEL);
> + bg_band->channels = kcalloc(geo->bg_channels,
> + sizeof(struct ieee80211_channel),
> + GFP_KERNEL);
> /* translate geo->bg to bg_band.channels */
> for (i = 0; i < geo->bg_channels; i++) {
> bg_band->channels[i].band = IEEE80211_BAND_2GHZ;
> diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
> index cb2552a..0f25083 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
> @@ -11467,9 +11467,9 @@ static int ipw_net_init(struct net_device *dev)
>
> bg_band->band = IEEE80211_BAND_2GHZ;
> bg_band->n_channels = geo->bg_channels;
> - bg_band->channels =
> - kzalloc(geo->bg_channels *
> - sizeof(struct ieee80211_channel), GFP_KERNEL);
> + bg_band->channels = kcalloc(geo->bg_channels,
> + sizeof(struct ieee80211_channel),
> + GFP_KERNEL);
> /* translate geo->bg to bg_band.channels */
> for (i = 0; i < geo->bg_channels; i++) {
> bg_band->channels[i].band = IEEE80211_BAND_2GHZ;
> @@ -11502,9 +11502,9 @@ static int ipw_net_init(struct net_device *dev)
>
> a_band->band = IEEE80211_BAND_5GHZ;
> a_band->n_channels = geo->a_channels;
> - a_band->channels =
> - kzalloc(geo->a_channels *
> - sizeof(struct ieee80211_channel), GFP_KERNEL);
> + a_band->channels = kcalloc(geo->a_channels,
> + sizeof(struct ieee80211_channel),
> + GFP_KERNEL);
> /* translate geo->bg to a_band.channels */
> for (i = 0; i < geo->a_channels; i++) {
> a_band->channels[i].band = IEEE80211_BAND_2GHZ;
> diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
> index 5063e01..8e3fbdf 100644
> --- a/drivers/net/wireless/rt2x00/rt2400pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2400pci.c
> @@ -1481,7 +1481,7 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
> index c2a555d..1d174e4 100644
> --- a/drivers/net/wireless/rt2x00/rt2500pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2500pci.c
> @@ -1795,7 +1795,7 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
> index cdaf93f..8ddaae4 100644
> --- a/drivers/net/wireless/rt2x00/rt2500usb.c
> +++ b/drivers/net/wireless/rt2x00/rt2500usb.c
> @@ -1698,7 +1698,7 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index b66e0fd..8c00fbd 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -2865,7 +2865,7 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
> index b0498e7..2d018ce 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00debug.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
> @@ -333,7 +333,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file,
> if (*offset)
> return 0;
>
> - data = kzalloc(lines * MAX_LINE_LENGTH, GFP_KERNEL);
> + data = kcalloc(lines, MAX_LINE_LENGTH, GFP_KERNEL);
> if (!data)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
> index a3401d3..9c609be 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00queue.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
> @@ -755,7 +755,7 @@ static int rt2x00queue_alloc_entries(struct data_queue *queue,
> * Allocate all queue entries.
> */
> entry_size = sizeof(*entries) + qdesc->priv_size;
> - entries = kzalloc(queue->limit * entry_size, GFP_KERNEL);
> + entries = kcalloc(queue->limit, entry_size, GFP_KERNEL);
> if (!entries)
> return -ENOMEM;
>
> @@ -891,7 +891,7 @@ int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev)
> */
> rt2x00dev->data_queues = 2 + rt2x00dev->ops->tx_queues + req_atim;
>
> - queue = kzalloc(rt2x00dev->data_queues * sizeof(*queue), GFP_KERNEL);
> + queue = kcalloc(rt2x00dev->data_queues, sizeof(*queue), GFP_KERNEL);
> if (!queue) {
> ERROR(rt2x00dev, "Queue allocation failed.\n");
> return -ENOMEM;
> diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
> index e539c6c..f226582 100644
> --- a/drivers/net/wireless/rt2x00/rt61pci.c
> +++ b/drivers/net/wireless/rt2x00/rt61pci.c
> @@ -2654,7 +2654,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
> index aa9de18..99985a2 100644
> --- a/drivers/net/wireless/rt2x00/rt73usb.c
> +++ b/drivers/net/wireless/rt2x00/rt73usb.c
> @@ -2084,7 +2084,7 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
> /*
> * Create channel information array
> */
> - info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL);
> + info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> diff --git a/drivers/net/wireless/wl12xx/wl1271_scan.c b/drivers/net/wireless/wl12xx/wl1271_scan.c
> index fec43ee..30dc100 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_scan.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_scan.c
> @@ -248,7 +248,7 @@ int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
>
> wl->scan.req = req;
>
> - wl->scan.scanned_ch = kzalloc(req->n_channels *
> + wl->scan.scanned_ch = kcalloc(req->n_channels,
> sizeof(*wl->scan.scanned_ch),
> GFP_KERNEL);
> wl1271_scan_stm(wl);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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: Problem with non aligned DMA in usbnet on ARM
From: Martin Fuzzey @ 2010-08-11 19:07 UTC (permalink / raw)
To: Greg KH
Cc: Russell King - ARM Linux, linux-usb,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <20100811174238.GA12382-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
Greg KH wrote:
>> So the question is are hcds expected to accept arbitarilly aligned but
>> heap allocated pointers (such as the result of kmalloc() + 1)?
>>
>
> It sounds like your HCD doesn't like this, so perhaps we should make
> that rule :)
>
> If you allocate the urb with a kmalloc() call with no offset, does it
> all work properly?
Yes
> The driver should be calling usb_alloc_urb() which
> does this automatically for them, right? Or is it trying to allocate
> things on its own somehow?
>
>
It's not the URB itself (which is allocated by usb_alloc_urb) but rather
the buffer pointer within the URB that causes the problem.
It's the asix driver (or more exactly the usbnet core used by that driver).
It does (rx_submit() in drivers/net/usb/usbnet.c):
urb = usb_alloc_urb();
skb = alloc_skb (...);
skb_reserve (skb, NET_IP_ALIGN);
usb_fill_bulk_urb (urb,... skb->data);
usb_submit_urb(urb)
skb->data as returned by alloc_skb() is aligned
but skb_reserve adds 2.
Thus removing the skb_reserve() call makes it work.
BUT if I do that the IP header is no longer aligned so accesses further
up the network stack have to be fixed up by exception handlers which is
expensive (even with hcds which don't require this)
cheers,
Martin
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Problem with non aligned DMA in usbnet on ARM
From: Oliver Neukum @ 2010-08-11 19:10 UTC (permalink / raw)
To: Greg KH
Cc: Martin Fuzzey, Russell King - ARM Linux, linux-usb,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <20100811174238.GA12382-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
Am Mittwoch 11 August 2010 19:42:38 schrieb Greg KH:
> > So the question is are hcds expected to accept arbitarilly aligned but
> > heap allocated pointers (such as the result of kmalloc() + 1)?
>
> It sounds like your HCD doesn't like this, so perhaps we should make
> that rule :)
>
> If you allocate the urb with a kmalloc() call with no offset, does it
> all work properly? The driver should be calling usb_alloc_urb() which
> does this automatically for them, right? Or is it trying to allocate
> things on its own somehow?
The buffer is the problem not the URB. And up to now the alignment
was not specified, but drivers are generally written assuming byte
granularity.
Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 1/2] ipw2100: register pm_qos request on hardware activation
From: Christoph Fritz @ 2010-08-11 19:31 UTC (permalink / raw)
To: John W. Linville
Cc: James Bottomley, Zhu Yi, David S. Miller, Joe Perches,
Rafael J. Wysocki, linux-wireless, netdev,
linux-kernel@vger.kernel.org
Function pm_qos_add_request() has to be called before first
pm_qos_update_request(). This was found out due to a change in pm_qos
(commit 82f682514a5df89ffb3890627eebf0897b7a84ec "pm_qos: Get rid of
the allocation in pm_qos_add_request()"). The warning call trace is below.
This patch is similar to c128ec29208d410568469bd8bb373b4cdc10912a "e1000e:
register pm_qos request on hardware activation".
WARNING: at kernel/pm_qos_params.c:264 pm_qos_update_request+0x5e/0x70()
pm_qos_update_request() called for unknown object
Call Trace:
[<c1024088>] ? warn_slowpath_common+0x78/0xb0
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<c1024153>] ? warn_slowpath_fmt+0x33/0x40
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<f89fe15f>] ? ipw2100_up+0x3f/0xf10 [ipw2100]
[<c11961c9>] ? vsnprintf+0xc9/0x530
[<f89ff36c>] ? ipw2100_net_init+0x2c/0x1c0 [ipw2100]
[<c12f542d>] ? register_netdevice+0x7d/0x3c0
[<f89f9b00>] ? ipw2100_irq_tasklet+0x910/0x9a0 [ipw2100]
[<c12f579f>] ? register_netdev+0x2f/0x40
[<f89fd471>] ? ipw2100_pci_init_one+0xd21/0x1060 [ipw2100]
[<c11a5ebb>] ? local_pci_probe+0xb/0x10
[<c11a6d49>] ? pci_device_probe+0x69/0x90
[<c1224704>] ? driver_probe_device+0x74/0x180
[<c10dd15a>] ? sysfs_create_dir+0x6a/0xb0
[<c1224889>] ? __driver_attach+0x79/0x80
[<c1224810>] ? __driver_attach+0x0/0x80
[<c1223fa2>] ? bus_for_each_dev+0x52/0x80
[<c1224586>] ? driver_attach+0x16/0x20
[<c1224810>] ? __driver_attach+0x0/0x80
[<c122395f>] ? bus_add_driver+0x17f/0x250
[<c11a5ec0>] ? pci_device_shutdown+0x0/0x20
[<c11a6c80>] ? pci_device_remove+0x0/0x40
[<c1224b13>] ? driver_register+0x63/0x120
[<c11a6f96>] ? __pci_register_driver+0x36/0xa0
[<f84f9048>] ? ipw2100_init+0x48/0x67 [ipw2100]
[<c1001122>] ? do_one_initcall+0x32/0x170
[<c1087078>] ? __vunmap+0xb8/0xf0
[<f84f9000>] ? ipw2100_init+0x0/0x67 [ipw2100]
[<c10510c1>] ? sys_init_module+0x161/0x1000
[<c108f847>] ? sys_close+0x67/0xe0
[<c13647c1>] ? syscall_call+0x7/0xb
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
---
drivers/net/wireless/ipw2x00/ipw2100.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 16bbfa3..df8e535 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -1909,6 +1909,9 @@ static int ipw2100_net_init(struct net_device *dev)
int ret;
int i;
+ pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
+ PM_QOS_DEFAULT_VALUE);
+
ret = ipw2100_up(priv, 1);
if (ret)
return ret;
@@ -1962,6 +1965,12 @@ static int ipw2100_net_init(struct net_device *dev)
return 0;
}
+/* Called by unregister_netdev() */
+static void ipw2100_net_uninit(struct net_device *dev)
+{
+ pm_qos_remove_request(&ipw2100_pm_qos_req);
+}
+
static void ipw2100_reset_adapter(struct work_struct *work)
{
struct ipw2100_priv *priv =
@@ -6092,11 +6101,12 @@ static void ipw2100_rf_kill(struct work_struct *work)
static void ipw2100_irq_tasklet(struct ipw2100_priv *priv);
static const struct net_device_ops ipw2100_netdev_ops = {
+ .ndo_init = ipw2100_net_init,
+ .ndo_uninit = ipw2100_net_uninit,
.ndo_open = ipw2100_open,
.ndo_stop = ipw2100_close,
.ndo_start_xmit = libipw_xmit,
.ndo_change_mtu = libipw_change_mtu,
- .ndo_init = ipw2100_net_init,
.ndo_tx_timeout = ipw2100_tx_timeout,
.ndo_set_mac_address = ipw2100_set_address,
.ndo_validate_addr = eth_validate_addr,
@@ -6669,8 +6679,6 @@ static int __init ipw2100_init(void)
if (ret)
goto out;
- pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
- PM_QOS_DEFAULT_VALUE);
#ifdef CONFIG_IPW2100_DEBUG
ipw2100_debug_level = debug;
ret = driver_create_file(&ipw2100_pci_driver.driver,
@@ -6692,7 +6700,6 @@ static void __exit ipw2100_exit(void)
&driver_attr_debug_level);
#endif
pci_unregister_driver(&ipw2100_pci_driver);
- pm_qos_remove_request(&ipw2100_pm_qos_req);
}
module_init(ipw2100_init);
--
1.7.1
^ permalink raw reply related
* [PATCH 2/2] ipw2100: add WEXT scan capabilities
From: Christoph Fritz @ 2010-08-11 19:33 UTC (permalink / raw)
To: John W. Linville
Cc: Zhu Yi, David S. Miller, Joe Perches, Rafael J. Wysocki,
linux-wireless, netdev, linux-kernel@vger.kernel.org
In-Reply-To: <1281555063.4367.1.camel@lovely.krouter>
NetworkManager claims: "driver does not support SSID scans (scan_capa
0x00)". This patch adds scan capabilities.
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
---
drivers/net/wireless/ipw2x00/ipw2100.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index df8e535..c330da4 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6982,12 +6982,15 @@ static int ipw2100_wx_get_range(struct net_device *dev,
/* Event capability (kernel + driver) */
range->event_capa[0] = (IW_EVENT_CAPA_K_0 |
- IW_EVENT_CAPA_MASK(SIOCGIWAP));
+ IW_EVENT_CAPA_MASK(SIOCGIWAP) |
+ IW_EVENT_CAPA_MASK(SIOCGIWSCAN));
range->event_capa[1] = IW_EVENT_CAPA_K_1;
range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
+ range->scan_capa = IW_SCAN_CAPA_ESSID | IW_SCAN_CAPA_TYPE;
+
IPW_DEBUG_WX("GET Range\n");
return 0;
--
1.7.1
^ permalink raw reply related
* Re: arp_notify: allow drivers to explicitly request a notification event.
From: Greg KH @ 2010-08-11 19:39 UTC (permalink / raw)
To: Ian Campbell
Cc: Stephen Hemminger, Jeremy Fitzhardinge, David S. Miller, netdev
Wait, Ian, are you sure this patch is correct? Look below in
notifier.h:
On Wed, May 26, 2010 at 12:09:42AM +0000, Ian Campbell wrote:
> From: Ian Campbell <Ian.Campbell@citrix.com>
>
> commit 06c4648d46d1b757d6b9591a86810be79818b60c upstream.
>
> Currently such notifications are only generated when the device comes up or the
> address changes. However one use case for these notifications is to enable
> faster network recovery after a virtual machine migration (by causing switches
> to relearn their MAC tables). A migration appears to the network stack as a
> temporary loss of carrier and therefore does not trigger either of the current
> conditions. Rather than adding carrier up as a trigger (which can cause issues
> when interfaces a flapping) simply add an interface which the driver can use
> to explicitly trigger the notification.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Stephen Hemminger <shemminger@linux-foundation.org>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1772,6 +1772,8 @@ extern void netif_carrier_on(struct net_device *dev);
>
> extern void netif_carrier_off(struct net_device *dev);
>
> +extern void netif_notify_peers(struct net_device *dev);
> +
> /**
> * netif_dormant_on - mark device as dormant.
> * @dev: network device
> diff --git a/include/linux/notifier.h b/include/linux/notifier.h
> index 540703b..22c2abb 100644
> --- a/include/linux/notifier.h
> +++ b/include/linux/notifier.h
> @@ -210,6 +210,7 @@ static inline int notifier_to_errno(int ret)
> #define NETDEV_POST_INIT 0x0010
> #define NETDEV_UNREGISTER_BATCH 0x0011
> #define NETDEV_BONDING_DESLAVE 0x0012
> +#define NETDEV_NOTIFY_PEERS 0x0012
Are you sure that you can duplicate this value?
curious,
greg k-h
^ permalink raw reply
* Re: arp_notify: allow drivers to explicitly request a notification event.
From: Greg KH @ 2010-08-11 19:39 UTC (permalink / raw)
To: Ian Campbell
Cc: Stephen Hemminger, Jeremy Fitzhardinge, David S. Miller, netdev
In-Reply-To: <20100811193925.GA9452@kroah.com>
On Wed, Aug 11, 2010 at 12:39:25PM -0700, Greg KH wrote:
> Wait, Ian, are you sure this patch is correct? Look below in
> notifier.h:
>
> On Wed, May 26, 2010 at 12:09:42AM +0000, Ian Campbell wrote:
> > From: Ian Campbell <Ian.Campbell@citrix.com>
> >
> > commit 06c4648d46d1b757d6b9591a86810be79818b60c upstream.
> >
> > Currently such notifications are only generated when the device comes up or the
> > address changes. However one use case for these notifications is to enable
> > faster network recovery after a virtual machine migration (by causing switches
> > to relearn their MAC tables). A migration appears to the network stack as a
> > temporary loss of carrier and therefore does not trigger either of the current
> > conditions. Rather than adding carrier up as a trigger (which can cause issues
> > when interfaces a flapping) simply add an interface which the driver can use
> > to explicitly trigger the notification.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Stephen Hemminger <shemminger@linux-foundation.org>
> > Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> > Cc: David S. Miller <davem@davemloft.net>
> > Cc: netdev@vger.kernel.org
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> >
> > --- a/include/linux/netdevice.h
> > +++ b/include/linux/netdevice.h
> > @@ -1772,6 +1772,8 @@ extern void netif_carrier_on(struct net_device *dev);
> >
> > extern void netif_carrier_off(struct net_device *dev);
> >
> > +extern void netif_notify_peers(struct net_device *dev);
> > +
> > /**
> > * netif_dormant_on - mark device as dormant.
> > * @dev: network device
> > diff --git a/include/linux/notifier.h b/include/linux/notifier.h
> > index 540703b..22c2abb 100644
> > --- a/include/linux/notifier.h
> > +++ b/include/linux/notifier.h
> > @@ -210,6 +210,7 @@ static inline int notifier_to_errno(int ret)
> > #define NETDEV_POST_INIT 0x0010
> > #define NETDEV_UNREGISTER_BATCH 0x0011
> > #define NETDEV_BONDING_DESLAVE 0x0012
> > +#define NETDEV_NOTIFY_PEERS 0x0012
>
> Are you sure that you can duplicate this value?
Oh nevermind, David already fixed this up with commit
38117d1495e587fbb10d6e55733139a27893cef5
I'll go queue that up for -stable as well :)
thanks,
greg k-h
^ permalink raw reply
* Re: [09/38] xen: netfront: explicitly generate arp_notify event after migration.
From: Greg KH @ 2010-08-11 19:43 UTC (permalink / raw)
To: Ian Campbell
Cc: Greg KH, linux-kernel@vger.kernel.org, stable@kernel.org,
stable-review@kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
Stephen Hemminger, Jeremy Fitzhardinge, David S. Miller,
netdev@vger.kernel.org, xen-devel@lists.xensource.com
In-Reply-To: <1281445647.24292.3897.camel@zakaz.uk.xensource.com>
On Tue, Aug 10, 2010 at 02:07:27PM +0100, Ian Campbell wrote:
> Hi Greg,
>
> Looks like I forgot to request this for 2.6.32 too, could you queue it
> up there as well?
>
> It depends on the previous patch in this series (arp_notify: allow
> drivers to explicitly request a notification event.).
Now queued up for .32 and .34-stable kernels.
thanks,
greg k-h
^ permalink raw reply
* RE: [PATCH 1/6] bna: Brocade 10Gb Ethernet device driver
From: Debashis Dutt @ 2010-08-11 19:45 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev@vger.kernel.org
In-Reply-To: <20100809111505.1cdc3ae5@s6510>
Stephen,
Thanks a lot for explaining this.
--Debashis
-----Original Message-----
From: Stephen Hemminger [mailto:shemminger@vyatta.com]
Sent: Monday, August 09, 2010 8:15 AM
To: Debashis Dutt
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 1/6] bna: Brocade 10Gb Ethernet device driver
On Fri, 6 Aug 2010 20:23:21 -0700
Debashis Dutt <ddutt@Brocade.COM> wrote:
>
> Hi Stephen,
>
> Thanks a lot for your comments.
>
> > + if (likely
> > + (wis > BNA_QE_FREE_CNT(tcb, tcb->q_depth) ||
> > + vectors > BNA_QE_FREE_CNT(unmap_q, unmap_q->q_depth))) {
> > + BNAD_UPDATE_CTR(bnad, netif_queue_stop);
> > + return NETDEV_TX_BUSY;
>
> >The transmit routine should check for available space after
> > queueing to device, so you can avoid having to return
> >TX_BUSY.
>
> However your above comment is not very clear to me.
>
> Our Tx routine already cleans up the Tx buffers at the end, through a tasklet.
>
> Cleaning of Tx buffers happens
> 1) In the sending context at the end of the Tx routine.
> 2) In the IRQ context when we get a Tx completion interrupt.
>
> Only thing that we could have done, is do this check again at the end of the Tx routine
> and called netif_stop_queue() if required, so that the stack stops sending. Even then I am
> not sure that we could avoid the current check and returning TX_BUSY.
>
> It would be nice if you clarify, so that I understand this better.
>
> Thanks
> --Debashis
> Linux LL Driver Team.
>
>
> -----Original Message-----
> From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> Sent: Wednesday, August 04, 2010 10:09 AM
> To: Rasesh Mody
> Cc: netdev@vger.kernel.org; Debashis Dutt; Jing Huang
> Subject: Re: [PATCH 1/6] bna: Brocade 10Gb Ethernet device driver
>
> On Tue, 3 Aug 2010 22:15:36 -0700
> Rasesh Mody <rmody@brocade.com> wrote:
>
> > From: Rasesh Mody <rmody@brocade.com>
> >
> > This is patch 1/6 which contains linux driver source for
> > Brocade's BR1010/BR1020 10Gb CEE capable ethernet adapter.
> > Source is based against net-next-2.6.
> >
> > We wish this patch to be considered for inclusion in net-next-2.6
> >
> > Signed-off-by: Rasesh Mody <rmody@brocade.com>
> > ---
> > bnad.c | 3326 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > bnad.h | 474 ++++++++
> > bnad_ethtool.c | 1269 +++++++++++++++++++++
> > 3 files changed, 5069 insertions(+)
> >
> > diff -ruP net-next-2.6.35-rc1-orig/drivers/net/bna/bnad.c net-next-2.6.35-rc1-mod/drivers/net/bna/bnad.c
> > --- net-next-2.6.35-rc1-orig/drivers/net/bna/bnad.c 1969-12-31 16:00:00.000000000 -0800
> > +++ net-next-2.6.35-rc1-mod/drivers/net/bna/bnad.c 2010-08-02 17:19:19.447239000 -0700
> > @@ -0,0 +1,3326 @@
> > +/*
> > + * Linux network driver for Brocade Converged Network Adapter.
> > + *
> > + * This program is free software; you can redistribute it and/or modify it
> > + * under the terms of the GNU General Public License (GPL) Version 2 as
> > + * published by the Free Software Foundation
> > + *
> > + * This program is distributed in the hope that it will be useful, but
> > + * WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> > + * General Public License for more details.
> > + */
> > +/*
> > + * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
> > + * All rights reserved
> > + * www.brocade.com
> > + */
> > +#include <linux/netdevice.h>
> > +#include <linux/skbuff.h>
> > +#include <linux/etherdevice.h>
> > +#include <linux/in.h>
> > +#include <linux/ethtool.h>
> > +#include <linux/if_vlan.h>
> > +#include <linux/if_ether.h>
> > +#include <linux/ip.h>
> > +
> > +#include "bnad.h"
> > +#include "bna.h"
> > +#include "cna.h"
> > +
> > +DEFINE_MUTEX(bnad_fwimg_mutex);
> > +
> > +/*
> > + * Module params
> > + */
> > +static uint bnad_msix_disable;
> > +module_param(bnad_msix_disable, uint, 0444);
> > +MODULE_PARM_DESC(bnad_msix_disable, "Disable MSIX mode");
> > +
> > +static uint bnad_ioc_auto_recover = 1;
> > +module_param(bnad_ioc_auto_recover, uint, 0444);
> > +MODULE_PARM_DESC(bnad_ioc_auto_recover, "Enable / Disable auto recovery");
> > +
> > +/*
> > + * Global variables
> > + */
> > +u32 bna_id;
> > +u32 bnad_rxqs_per_cq = 2;
> > +
> > +DECLARE_MUTEX(bnad_list_sem);
> > +LIST_HEAD(bnad_list);
> > +
> > +const u8 bnad_bcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
>
> Surprised this isn't defined somewhere else.
>
> > +
> > +/*
> > + * Local MACROS
> > + */
> > +#define BNAD_TX_UNMAPQ_DEPTH (bnad->txq_depth * 2)
> > +
> > +#define BNAD_RX_UNMAPQ_DEPTH (bnad->rxq_depth)
> > +
> > +#define BNAD_GET_MBOX_IRQ(_bnad) \
> > + (((_bnad)->cfg_flags & BNAD_CF_MSIX) ? \
> > + ((_bnad)->msix_table[(_bnad)->msix_num - 1].vector) : \
> > + ((_bnad)->pcidev->irq))
> > +
> > +#define BNAD_FILL_UNMAPQ_MEM_REQ(_res_info, _num, _depth) \
> > +do { \
> > + (_res_info)->res_type = BNA_RES_T_MEM; \
> > + (_res_info)->res_u.mem_info.mem_type = BNA_MEM_T_KVA; \
> > + (_res_info)->res_u.mem_info.num = (_num); \
> > + (_res_info)->res_u.mem_info.len = \
> > + sizeof(struct bnad_unmap_q) + \
> > + (sizeof(struct bnad_skb_unmap) * ((_depth) - 1)); \
> > +} while (0)
> > +
> > +void
> > +bnad_add_to_list(struct bnad *bnad)
> > +{
> > + down(&bnad_list_sem);
> > + list_add_tail(&bnad->list_entry, &bnad_list);
> > + bna_id++;
> > + up(&bnad_list_sem);
> > +}
>
> Why do you need to list semaphore? Isn't RTNL mutex held
> when this is done. If you have to have own exclusion use
> a mutex for this.
>
> > +void
> > +bnad_remove_from_list(struct bnad *bnad)
> > +{
> > + down(&bnad_list_sem);
> > + list_del(&bnad->list_entry);
> > + up(&bnad_list_sem);
> > +}
> > +
> > +const struct pci_device_id bnad_pci_id_table[] = {
> > + {
> > + PCI_DEVICE(PCI_VENDOR_ID_BROCADE,
> > + PCI_DEVICE_ID_BROCADE_CT),
> > + .class = PCI_CLASS_NETWORK_ETHERNET << 8,
> > + .class_mask = 0xffff00
> > + }, {0, }
> > +};
>
> Why is this not static?
>
>
> > +/* TX */
> > +/* bnad_start_xmit : Netdev entry point for Transmit */
> > +/* Called under lock held by net_device */
> > +
> > +netdev_tx_t
> > +bnad_start_xmit(struct sk_buff *skb, struct net_device *netdev)
>
> Should also be static...
>
> > +{
> > + struct bnad *bnad = netdev_priv(netdev);
> > +
> > + u16 txq_prod, vlan_tag = 0;
> > + u32 unmap_prod, wis, wis_used, wi_range;
> > + u32 vectors, vect_id, i, acked;
> > + u32 tx_id;
> > + int err;
> > +
> > + struct bnad_tx_info *tx_info;
> > + struct bna_tcb *tcb;
> > + struct bnad_unmap_q *unmap_q;
> > + dma_addr_t dma_addr;
> > + struct bna_txq_entry *txqent;
> > + bna_txq_wi_ctrl_flag_t flags;
> > +
> > + if (unlikely
> > + (skb->len <= ETH_HLEN || skb->len > BFI_TX_MAX_DATA_PER_PKT)) {
> > + dev_kfree_skb(skb);
> > + return NETDEV_TX_OK;
> > + }
> > +
> > + /*
> > + * Takes care of the Tx that is scheduled between clearing the flag
> > + * and the netif_stop_queue() call.
> > + */
> > + if (unlikely(!test_bit(BNAD_RF_TX_STARTED, &bnad->run_flags))) {
> > + dev_kfree_skb(skb);
> > + return NETDEV_TX_OK;
> > + }
> > +
> > + tx_id = BNAD_GET_TX_ID(skb);
> > +
> > + tx_info = &bnad->tx_info[tx_id];
> > + tcb = tx_info->tcb[tx_id];
> > + unmap_q = tcb->unmap_q;
> > +
> > + vectors = 1 + skb_shinfo(skb)->nr_frags;
> > + if (vectors > BFI_TX_MAX_VECTORS_PER_PKT) {
> > + dev_kfree_skb(skb);
> > + return NETDEV_TX_OK;
> > + }
> > + wis = BNA_TXQ_WI_NEEDED(vectors); /* 4 vectors per work item */
> > + acked = 0;
> > + if (unlikely
> > + (wis > BNA_QE_FREE_CNT(tcb, tcb->q_depth) ||
> > + vectors > BNA_QE_FREE_CNT(unmap_q, unmap_q->q_depth))) {
> > + if ((u16) (*tcb->hw_consumer_index) !=
> > + tcb->consumer_index &&
> > + !test_and_set_bit(BNAD_TXQ_FREE_SENT, &tcb->flags)) {
> > + acked = bnad_free_txbufs(bnad, tcb);
> > + bna_ib_ack(tcb->i_dbell, acked);
> > + smp_mb__before_clear_bit();
> > + clear_bit(BNAD_TXQ_FREE_SENT, &tcb->flags);
> > + } else {
> > + netif_stop_queue(netdev);
> > + BNAD_UPDATE_CTR(bnad, netif_queue_stop);
> > + }
> > +
> > + smp_mb();
> > + /*
> > + * Check again to deal with race condition between
> > + * netif_stop_queue here, and netif_wake_queue in
> > + * interrupt handler which is not inside netif tx lock.
> > + */
> > + if (likely
> > + (wis > BNA_QE_FREE_CNT(tcb, tcb->q_depth) ||
> > + vectors > BNA_QE_FREE_CNT(unmap_q, unmap_q->q_depth))) {
> > + BNAD_UPDATE_CTR(bnad, netif_queue_stop);
> > + return NETDEV_TX_BUSY;
>
> The transmit routine should check for available space after
> queueing to device, so you can avoid having to return
> TX_BUSY.
The problem is that if device returns TX_BUSY, the net transmit scheduler
will end up re-calling the transmit routine. This looks ok in your driver
because it will set netif_stop_queue
^ permalink raw reply
* Re: Problem with non aligned DMA in usbnet on ARM
From: Greg KH @ 2010-08-11 20:13 UTC (permalink / raw)
To: Martin Fuzzey
Cc: Russell King - ARM Linux, linux-usb, netdev, linux-arm-kernel
In-Reply-To: <4C62F4EF.1050808@gmail.com>
On Wed, Aug 11, 2010 at 09:07:27PM +0200, Martin Fuzzey wrote:
> Greg KH wrote:
> >> So the question is are hcds expected to accept arbitarilly aligned but
> >> heap allocated pointers (such as the result of kmalloc() + 1)?
> >>
> >
> > It sounds like your HCD doesn't like this, so perhaps we should make
> > that rule :)
> >
> > If you allocate the urb with a kmalloc() call with no offset, does it
> > all work properly?
> Yes
> > The driver should be calling usb_alloc_urb() which
> > does this automatically for them, right? Or is it trying to allocate
> > things on its own somehow?
> >
> >
> It's not the URB itself (which is allocated by usb_alloc_urb) but rather
> the buffer pointer within the URB that causes the problem.
Doh, you are right, sorry about that.
> It's the asix driver (or more exactly the usbnet core used by that driver).
> It does (rx_submit() in drivers/net/usb/usbnet.c):
>
> urb = usb_alloc_urb();
> skb = alloc_skb (...);
> skb_reserve (skb, NET_IP_ALIGN);
> usb_fill_bulk_urb (urb,... skb->data);
> usb_submit_urb(urb)
>
> skb->data as returned by alloc_skb() is aligned
> but skb_reserve adds 2.
>
> Thus removing the skb_reserve() call makes it work.
> BUT if I do that the IP header is no longer aligned so accesses further
> up the network stack have to be fixed up by exception handlers which is
> expensive (even with hcds which don't require this)
Can you fix this in the host controller driver?
thanks,
greg k-h
^ permalink raw reply
* Re: arp_notify: allow drivers to explicitly request a notification event.
From: Ian Campbell @ 2010-08-11 20:16 UTC (permalink / raw)
To: Greg KH
Cc: Stephen Hemminger, Jeremy Fitzhardinge, David S. Miller,
netdev@vger.kernel.org
In-Reply-To: <20100811193959.GA9470@kroah.com>
On Wed, 2010-08-11 at 20:39 +0100, Greg KH wrote:
> On Wed, Aug 11, 2010 at 12:39:25PM -0700, Greg KH wrote:
> > > index 540703b..22c2abb 100644
> > > --- a/include/linux/notifier.h
> > > +++ b/include/linux/notifier.h
> > > @@ -210,6 +210,7 @@ static inline int notifier_to_errno(int ret)
> > > #define NETDEV_POST_INIT 0x0010
> > > #define NETDEV_UNREGISTER_BATCH 0x0011
> > > #define NETDEV_BONDING_DESLAVE 0x0012
> > > +#define NETDEV_NOTIFY_PEERS 0x0012
> >
> > Are you sure that you can duplicate this value?
>
> Oh nevermind, David already fixed this up with commit
> 38117d1495e587fbb10d6e55733139a27893cef5
David did mention that he fixed up a clash at the timebut I hadn't
realised it was a separate checkin, thanks for figuring it out.
> I'll go queue that up for -stable as well :)
Cool, thanks.
Ian.
^ permalink raw reply
* Re: [PATCH 1/2] ipw2100: register pm_qos request on hardware activation
From: John W. Linville @ 2010-08-11 20:22 UTC (permalink / raw)
To: Christoph Fritz
Cc: James Bottomley, Zhu Yi, David S. Miller, Joe Perches,
Rafael J. Wysocki, linux-wireless, netdev,
linux-kernel@vger.kernel.org
In-Reply-To: <1281555063.4367.1.camel@lovely.krouter>
On Wed, Aug 11, 2010 at 09:31:03PM +0200, Christoph Fritz wrote:
> Function pm_qos_add_request() has to be called before first
> pm_qos_update_request(). This was found out due to a change in pm_qos
> (commit 82f682514a5df89ffb3890627eebf0897b7a84ec "pm_qos: Get rid of
> the allocation in pm_qos_add_request()"). The warning call trace is below.
>
> This patch is similar to c128ec29208d410568469bd8bb373b4cdc10912a "e1000e:
> register pm_qos request on hardware activation".
>
> WARNING: at kernel/pm_qos_params.c:264 pm_qos_update_request+0x5e/0x70()
> pm_qos_update_request() called for unknown object
> Call Trace:
> [<c1024088>] ? warn_slowpath_common+0x78/0xb0
> [<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
> [<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
> [<c1024153>] ? warn_slowpath_fmt+0x33/0x40
> [<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
> [<f89fe15f>] ? ipw2100_up+0x3f/0xf10 [ipw2100]
> [<c11961c9>] ? vsnprintf+0xc9/0x530
> [<f89ff36c>] ? ipw2100_net_init+0x2c/0x1c0 [ipw2100]
> [<c12f542d>] ? register_netdevice+0x7d/0x3c0
> [<f89f9b00>] ? ipw2100_irq_tasklet+0x910/0x9a0 [ipw2100]
> [<c12f579f>] ? register_netdev+0x2f/0x40
> [<f89fd471>] ? ipw2100_pci_init_one+0xd21/0x1060 [ipw2100]
> [<c11a5ebb>] ? local_pci_probe+0xb/0x10
> [<c11a6d49>] ? pci_device_probe+0x69/0x90
> [<c1224704>] ? driver_probe_device+0x74/0x180
> [<c10dd15a>] ? sysfs_create_dir+0x6a/0xb0
> [<c1224889>] ? __driver_attach+0x79/0x80
> [<c1224810>] ? __driver_attach+0x0/0x80
> [<c1223fa2>] ? bus_for_each_dev+0x52/0x80
> [<c1224586>] ? driver_attach+0x16/0x20
> [<c1224810>] ? __driver_attach+0x0/0x80
> [<c122395f>] ? bus_add_driver+0x17f/0x250
> [<c11a5ec0>] ? pci_device_shutdown+0x0/0x20
> [<c11a6c80>] ? pci_device_remove+0x0/0x40
> [<c1224b13>] ? driver_register+0x63/0x120
> [<c11a6f96>] ? __pci_register_driver+0x36/0xa0
> [<f84f9048>] ? ipw2100_init+0x48/0x67 [ipw2100]
> [<c1001122>] ? do_one_initcall+0x32/0x170
> [<c1087078>] ? __vunmap+0xb8/0xf0
> [<f84f9000>] ? ipw2100_init+0x0/0x67 [ipw2100]
> [<c10510c1>] ? sys_init_module+0x161/0x1000
> [<c108f847>] ? sys_close+0x67/0xe0
> [<c13647c1>] ? syscall_call+0x7/0xb
>
> Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Thanks for identifying this problem! However, I think there is a
simpler fix. I'll include it in a follow-up email. Could you verify
that it also addresses this issue?
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* [PATCH] ipw2100: register pm_qos request before registering pci driver
From: John W. Linville @ 2010-08-11 20:22 UTC (permalink / raw)
To: linux-wireless
Cc: Christoph Fritz, James Bottomley, Zhu Yi, David S. Miller,
Joe Perches, Rafael J. Wysocki, netdev, linux-kernel,
John W. Linville
In-Reply-To: <1281555063.4367.1.camel@lovely.krouter>
It is necessary to call pm_qos_add_request prior to calling
pm_qos_update_request. It was revealed that ipw2100 has been
doing this wrong since "pm_qos: Get rid of the allocation in
pm_qos_add_request()" (commit 82f682514a5df89ffb3890627eebf0897b7a84ec)
added a WARN that results in the following backtrace:
WARNING: at kernel/pm_qos_params.c:264 pm_qos_update_request+0x5e/0x70()
pm_qos_update_request() called for unknown object
Call Trace:
[<c1024088>] ? warn_slowpath_common+0x78/0xb0
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<c1024153>] ? warn_slowpath_fmt+0x33/0x40
[<c1041c9e>] ? pm_qos_update_request+0x5e/0x70
[<f89fe15f>] ? ipw2100_up+0x3f/0xf10 [ipw2100]
[<c11961c9>] ? vsnprintf+0xc9/0x530
[<f89ff36c>] ? ipw2100_net_init+0x2c/0x1c0 [ipw2100]
[<c12f542d>] ? register_netdevice+0x7d/0x3c0
[<f89f9b00>] ? ipw2100_irq_tasklet+0x910/0x9a0 [ipw2100]
[<c12f579f>] ? register_netdev+0x2f/0x40
[<f89fd471>] ? ipw2100_pci_init_one+0xd21/0x1060 [ipw2100]
[<c11a5ebb>] ? local_pci_probe+0xb/0x10
[<c11a6d49>] ? pci_device_probe+0x69/0x90
[<c1224704>] ? driver_probe_device+0x74/0x180
[<c10dd15a>] ? sysfs_create_dir+0x6a/0xb0
[<c1224889>] ? __driver_attach+0x79/0x80
[<c1224810>] ? __driver_attach+0x0/0x80
[<c1223fa2>] ? bus_for_each_dev+0x52/0x80
[<c1224586>] ? driver_attach+0x16/0x20
[<c1224810>] ? __driver_attach+0x0/0x80
[<c122395f>] ? bus_add_driver+0x17f/0x250
[<c11a5ec0>] ? pci_device_shutdown+0x0/0x20
[<c11a6c80>] ? pci_device_remove+0x0/0x40
[<c1224b13>] ? driver_register+0x63/0x120
[<c11a6f96>] ? __pci_register_driver+0x36/0xa0
[<f84f9048>] ? ipw2100_init+0x48/0x67 [ipw2100]
[<c1001122>] ? do_one_initcall+0x32/0x170
[<c1087078>] ? __vunmap+0xb8/0xf0
[<f84f9000>] ? ipw2100_init+0x0/0x67 [ipw2100]
[<c10510c1>] ? sys_init_module+0x161/0x1000
[<c108f847>] ? sys_close+0x67/0xe0
[<c13647c1>] ? syscall_call+0x7/0xb
This patch moves pm_qos_add_request prior to pci_register_driver in
ipw2100 in order to avoid this problem.
Reported-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
drivers/net/wireless/ipw2x00/ipw2100.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 16bbfa3..1189dbb 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6665,12 +6665,13 @@ static int __init ipw2100_init(void)
printk(KERN_INFO DRV_NAME ": %s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
printk(KERN_INFO DRV_NAME ": %s\n", DRV_COPYRIGHT);
+ pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
+ PM_QOS_DEFAULT_VALUE);
+
ret = pci_register_driver(&ipw2100_pci_driver);
if (ret)
goto out;
- pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
- PM_QOS_DEFAULT_VALUE);
#ifdef CONFIG_IPW2100_DEBUG
ipw2100_debug_level = debug;
ret = driver_create_file(&ipw2100_pci_driver.driver,
--
1.7.2.1
^ permalink raw reply related
* [PATCH] orinoco: Fix walking past the end of the buffer
From: Denis Kirjanov @ 2010-08-11 20:32 UTC (permalink / raw)
To: linville-2XuSBdqkA4R54TAoqtyWWQ
Cc: proski-mXXj517/zsQ, hermes-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+,
davem-fT/PcQaiUtIeIZ0/mPfg9Q,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
orinoco-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
netdev-u79uwXL29TY76Z2rM5mHXA
Fix walking past the end of the bitrate_table array
in the case when the loop counter == BITRATE_TABLE_SIZE.
Mark bitrate as invalid in this case for the orinoco_ioctl_setrate()
Signed-off-by: Denis Kirjanov <dkirjanov-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c
index 077baa8..191bc03 100644
--- a/drivers/net/wireless/orinoco/hw.c
+++ b/drivers/net/wireless/orinoco/hw.c
@@ -765,9 +765,12 @@ int orinoco_hw_get_act_bitrate(struct orinoco_private *priv, int *bitrate)
if (bitrate_table[i].intersil_txratectrl == val)
break;
- if (i >= BITRATE_TABLE_SIZE)
+ if (i >= BITRATE_TABLE_SIZE) {
printk(KERN_INFO "%s: Unable to determine current bitrate (0x%04hx)\n",
priv->ndev->name, val);
+ *bitrate = 100001; /* Mark as invalid */
+ break;
+ }
*bitrate = bitrate_table[i].bitrate * 100000;
break;
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* Re: [iproute2] iproute2: Fix 'addr flush secondary' logic.
From: Brian Haley @ 2010-08-11 20:41 UTC (permalink / raw)
To: Ben Greear; +Cc: netdev
In-Reply-To: <1281547182-1252-1-git-send-email-greearb@candelatech.com>
On 08/11/2010 01:19 PM, Ben Greear wrote:
> @@ -648,7 +648,7 @@ int print_addrinfo_secondary(const struct sockaddr_nl *who, struct nlmsghdr *n,
> {
> struct ifaddrmsg *ifa = NLMSG_DATA(n);
>
> - if (ifa->ifa_flags & IFA_F_SECONDARY)
> + if (!ifa->ifa_flags & IFA_F_SECONDARY)
> return 0;
Shouldn't this be:
if (!(ifa->ifa_flags & IFA_F_SECONDARY))
-Brian
^ permalink raw reply
* Re: [iproute2] iproute2: Fix 'addr flush secondary' logic.
From: Ben Greear @ 2010-08-11 20:53 UTC (permalink / raw)
To: Brian Haley; +Cc: netdev
In-Reply-To: <4C630B0A.9010304@hp.com>
On 08/11/2010 01:41 PM, Brian Haley wrote:
> On 08/11/2010 01:19 PM, Ben Greear wrote:
>> @@ -648,7 +648,7 @@ int print_addrinfo_secondary(const struct sockaddr_nl *who, struct nlmsghdr *n,
>> {
>> struct ifaddrmsg *ifa = NLMSG_DATA(n);
>>
>> - if (ifa->ifa_flags& IFA_F_SECONDARY)
>> + if (!ifa->ifa_flags& IFA_F_SECONDARY)
>> return 0;
>
> Shouldn't this be:
>
> if (!(ifa->ifa_flags& IFA_F_SECONDARY))
Yes, that looks like a bug. Let me re-test to make sure
it wasn't hiding other bugs and will re-submit.
Thanks,
Ben
>
> -Brian
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
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