* [PATCH net-next 3/4] qlcnic: Fix sparse warnings.
From: Rajesh Borundia @ 2013-04-02 15:34 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1364916883-10109-1-git-send-email-rajesh.borundia@qlogic.com>
warning: 'pf_info.max_tx_ques' may be used uninitialized in this function
[-Wmaybe-uninitialized]
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
.../net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
index d6ac7dc..bed5056 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
@@ -156,6 +156,7 @@ static int qlcnic_sriov_get_pf_info(struct qlcnic_adapter *adapter,
npar_info->max_local_ipv6_addrs = LSW(cmd.rsp.arg[8]);
npar_info->max_remote_ipv6_addrs = MSW(cmd.rsp.arg[8]);
+ qlcnic_sriov_pf_set_ff_max_res(adapter, npar_info);
dev_info(&adapter->pdev->dev,
"\n\ttotal_pf: %d,\n"
"\n\ttotal_rss_engines: %d max_vports: %d max_tx_ques %d,\n"
@@ -376,8 +377,6 @@ static int qlcnic_sriov_pf_init(struct qlcnic_adapter *adapter)
if (err)
goto delete_vport;
- qlcnic_sriov_pf_set_ff_max_res(adapter, &pf_info);
-
err = qlcnic_get_nic_info(adapter, &nic_info, func);
if (err)
goto delete_vport;
--
1.6.3.3
^ permalink raw reply related
* [PATCH net-next 4/4] qlcnic: Bump up the version to 5.2.40
From: Rajesh Borundia @ 2013-04-02 15:34 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1364916883-10109-1-git-send-email-rajesh.borundia@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index e5af69d..ef55718 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -38,8 +38,8 @@
#define _QLCNIC_LINUX_MAJOR 5
#define _QLCNIC_LINUX_MINOR 2
-#define _QLCNIC_LINUX_SUBVERSION 39
-#define QLCNIC_LINUX_VERSIONID "5.2.39"
+#define _QLCNIC_LINUX_SUBVERSION 40
+#define QLCNIC_LINUX_VERSIONID "5.2.40"
#define QLCNIC_DRV_IDC_VER 0x01
#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
(_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
--
1.6.3.3
^ permalink raw reply related
* [PATCH net-next 1/4] qlcnic: Fix potential NULL dereference
From: Rajesh Borundia @ 2013-04-02 15:34 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1364916883-10109-1-git-send-email-rajesh.borundia@qlogic.com>
[net-next:master 301/302] drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c:563
qlcnic_set_multi() error: potential null dereference 'cur'. (kzalloc returns null)
o Break out of the loop after memory allocation failure. Program all the
MAC addresses that were cached in the return path.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index ddc130b..253b3ac 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -560,6 +560,8 @@ void qlcnic_set_multi(struct net_device *netdev)
netdev_for_each_mc_addr(ha, netdev) {
cur = kzalloc(sizeof(struct qlcnic_mac_list_s),
GFP_ATOMIC);
+ if (cur == NULL)
+ break;
memcpy(cur->mac_addr,
ha->addr, ETH_ALEN);
list_add_tail(&cur->list, &adapter->vf_mc_list);
--
1.6.3.3
^ permalink raw reply related
* [PATCH net-next 2/4] qlcnic: Fix NULL dereference in error path.
From: Rajesh Borundia @ 2013-04-02 15:34 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1364916883-10109-1-git-send-email-rajesh.borundia@qlogic.com>
o Fix for smatch tool reported error
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:2029
qlcnic_probe() error: potential NULL dereference 'adapter'.
o While returning from an error path in probe, adapter is not
initialized. So do not access adapter in cleanup path.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 3ee593e..0d00b2b 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -546,11 +546,10 @@ void qlcnic_teardown_intr(struct qlcnic_adapter *adapter)
}
}
-static void
-qlcnic_cleanup_pci_map(struct qlcnic_adapter *adapter)
+static void qlcnic_cleanup_pci_map(struct qlcnic_hardware_context *ahw)
{
- if (adapter->ahw->pci_base0 != NULL)
- iounmap(adapter->ahw->pci_base0);
+ if (ahw->pci_base0 != NULL)
+ iounmap(ahw->pci_base0);
}
static int qlcnic_get_act_pci_func(struct qlcnic_adapter *adapter)
@@ -2026,7 +2025,7 @@ err_out_free_netdev:
free_netdev(netdev);
err_out_iounmap:
- qlcnic_cleanup_pci_map(adapter);
+ qlcnic_cleanup_pci_map(ahw);
err_out_free_hw_res:
kfree(ahw);
@@ -2083,7 +2082,7 @@ static void qlcnic_remove(struct pci_dev *pdev)
qlcnic_remove_sysfs(adapter);
- qlcnic_cleanup_pci_map(adapter);
+ qlcnic_cleanup_pci_map(adapter->ahw);
qlcnic_release_firmware(adapter);
--
1.6.3.3
^ permalink raw reply related
* [PATCH net-next 0/4] qlcnic: Bug Fixes
From: Rajesh Borundia @ 2013-04-02 15:34 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver
Please apply it to net-next.
Rajesh Borundia (4):
qlcnic: Fix potential NULL dereference
qlcnic: Fix NULL dereference in error path.
qlcnic: Fix sparse warnings.
qlcnic: Bump up the version to 5.2.40
^ permalink raw reply
* Re: [PATCH net-next] bridge: remove a redundant synchronize_net()
From: Veaceslav Falico @ 2013-04-02 15:58 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev, Stephen Hemminger
In-Reply-To: <1364917500.5113.176.camel@edumazet-glaptop>
On Tue, Apr 02, 2013 at 08:45:00AM -0700, Eric Dumazet wrote:
>From: Eric Dumazet <edumazet@google.com>
>
>commit 00cfec37484761 (net: add a synchronize_net() in
>netdev_rx_handler_unregister())
>allows us to remove the synchronized_net() call from del_nbp()
>
>Signed-off-by: Eric Dumazet <edumazet@google.com>
>Cc: Veaceslav Falico <vfalico@redhat.com>
>Cc: Stephen Hemminger <stephen@networkplumber.org>
>---
> net/bridge/br_if.c | 1 -
> 1 file changed, 1 deletion(-)
>
>diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
>index ef1b914..f17fcb3 100644
>--- a/net/bridge/br_if.c
>+++ b/net/bridge/br_if.c
>@@ -148,7 +148,6 @@ static void del_nbp(struct net_bridge_port *p)
> dev->priv_flags &= ~IFF_BRIDGE_PORT;
>
> netdev_rx_handler_unregister(dev);
>- synchronize_net();
>
> netdev_upper_dev_unlink(dev, br->dev);
>
>
>
Thanks, didn't see that when fixing bonding.
Acked-by: Veaceslav Falico <vfalico@redhat.com>
^ permalink raw reply
* Re: [PATCH] bonding: get netdev_rx_handler_unregister out of locks
From: David Miller @ 2013-04-02 16:07 UTC (permalink / raw)
To: eric.dumazet; +Cc: vfalico, netdev, fubar, andy, edumazet
In-Reply-To: <1364916362.5113.167.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 02 Apr 2013 08:26:02 -0700
> On Tue, 2013-04-02 at 17:15 +0200, Veaceslav Falico wrote:
>> Now that netdev_rx_handler_unregister contains synchronize_net(), we need
>> to call it outside of bond->lock, cause it might sleep. Also, remove the
>> already unneded synchronize_net().
>>
>> Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
...
> Acked-by: Eric Dumazet <edumazet@google.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net] net/mlx4_en: Fix setting initial MAC address
From: David Miller @ 2013-04-02 16:09 UTC (permalink / raw)
To: yanb; +Cc: netdev, ogerlitz, amirv
In-Reply-To: <1364910585-2963-1-git-send-email-yanb@mellanox.com>
From: Yan Burman <yanb@mellanox.com>
Date: Tue, 2 Apr 2013 16:49:45 +0300
> Commit 6bbb6d9 "net/mlx4_en: Optimize Rx fast path filter checks" introduced a regression
> under which the MAC address read from the card was not converted correctly
> (the most significant byte was not handled), fix that.
>
> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
> Signed-off-by: Yan Burman <yanb@mellanox.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] bridge: remove a redundant synchronize_net()
From: David Miller @ 2013-04-02 16:12 UTC (permalink / raw)
To: vfalico; +Cc: eric.dumazet, netdev, stephen
In-Reply-To: <20130402155822.GB29115@redhat.com>
From: Veaceslav Falico <vfalico@redhat.com>
Date: Tue, 2 Apr 2013 17:58:22 +0200
> On Tue, Apr 02, 2013 at 08:45:00AM -0700, Eric Dumazet wrote:
>>From: Eric Dumazet <edumazet@google.com>
>>
>>commit 00cfec37484761 (net: add a synchronize_net() in
>>netdev_rx_handler_unregister())
>>allows us to remove the synchronized_net() call from del_nbp()
>>
>>Signed-off-by: Eric Dumazet <edumazet@google.com>
...
> Acked-by: Veaceslav Falico <vfalico@redhat.com>
Applied.
Note that we have a few spots now that do two synchronize_net()'s per
opertaion, such as team port removal, and openvswitch has such a path
as well. They all are of the form:
netdev_rx_handler_unregister()
...
lots of other stuff
...
synchronize_net();
So might be harder to factor back out than this br_if.c case.
^ permalink raw reply
* Re: [patch 2/2] qeth: fix qeth_wait_for_threads() deadlock for OSN devices
From: Eric Dumazet @ 2013-04-02 16:13 UTC (permalink / raw)
To: frank.blaschka; +Cc: davem, netdev, linux-s390, Stefan Raspl
In-Reply-To: <20130402105707.222865335@de.ibm.com>
On Tue, 2013-04-02 at 12:56 +0200, frank.blaschka@de.ibm.com wrote:
> plain text document attachment (602-qeth-thread-deadlock.diff)
> From: Stefan Raspl <raspl@linux.vnet.ibm.com>
> +static bool qeth_is_recovery_task(struct qeth_card *card)
> +{
> + return (card->recovery_task == current);
> +}
> +
static bool qeth_is_recovery_task(const struct qeth_card *card)
{
return card->recovery_task == current;
}
^ permalink raw reply
* Re: [PATCH net-next] bridge: remove a redundant synchronize_net()
From: Eric Dumazet @ 2013-04-02 16:27 UTC (permalink / raw)
To: David Miller; +Cc: vfalico, netdev, stephen, Jiri Pirko
In-Reply-To: <20130402.121223.496337697838525487.davem@davemloft.net>
On Tue, 2013-04-02 at 12:12 -0400, David Miller wrote:
> Note that we have a few spots now that do two synchronize_net()'s per
> opertaion, such as team port removal, and openvswitch has such a path
> as well. They all are of the form:
>
> netdev_rx_handler_unregister()
> ...
> lots of other stuff
> ...
> synchronize_net();
>
> So might be harder to factor back out than this br_if.c case.
>
Strange, I do see call_rcu() in openvswitch, not a synchronize_{net|
rcu}(). Probably OK to leave as is, as it's not a big deal.
I'll let Jiri handle the team driver change, as its not clear what
synchronize_rcu() call in team_port_del() is protecting
^ permalink raw reply
* [PATCH net-next] tcp: Remove dead sysctl_tcp_cookie_size declaration
From: Neal Cardwell @ 2013-04-02 17:13 UTC (permalink / raw)
To: David Miller; +Cc: edumazet, ycheng, christoph.paasch, netdev, Neal Cardwell
Remove a declaration left over from the TCPCT-ectomy. This sysctl is
no longer referenced anywhere since 1a2c6181c4 ("tcp: Remove TCPCT").
Signed-off-by: Neal Cardwell <ncardwell@google.com>
---
include/net/tcp.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index d1dcb59..4475aaf 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -282,7 +282,6 @@ extern int sysctl_tcp_base_mss;
extern int sysctl_tcp_workaround_signed_windows;
extern int sysctl_tcp_slow_start_after_idle;
extern int sysctl_tcp_max_ssthresh;
-extern int sysctl_tcp_cookie_size;
extern int sysctl_tcp_thin_linear_timeouts;
extern int sysctl_tcp_thin_dupack;
extern int sysctl_tcp_early_retrans;
--
1.8.1.3
^ permalink raw reply related
* [PATCH net-next] e100: Add dma mapping error check
From: Neil Horman @ 2013-04-02 17:30 UTC (permalink / raw)
To: netdev; +Cc: Neil Horman, Josh Boyer, David S. Miller, Jeff Kirsher,
e1000-devel
e100 uses pci_map_single, but fails to check for a dma mapping error after its
use, resulting in a stack trace:
[ 46.656594] ------------[ cut here ]------------
[ 46.657004] WARNING: at lib/dma-debug.c:933 check_unmap+0x47b/0x950()
[ 46.657004] Hardware name: To Be Filled By O.E.M.
[ 46.657004] e100 0000:00:0e.0: DMA-API: device driver failed to check map
error[device address=0x000000007a4540fa] [size=90 bytes] [mapped as single]
[ 46.657004] Modules linked in:
[ 46.657004] w83627hf hwmon_vid snd_via82xx ppdev snd_ac97_codec ac97_bus
snd_seq snd_pcm snd_mpu401 snd_mpu401_uart ns558 snd_rawmidi gameport parport_pc
e100 snd_seq_device parport snd_page_alloc snd_timer snd soundcore skge shpchp
k8temp mii edac_core i2c_viapro edac_mce_amd nfsd auth_rpcgss nfs_acl lockd
sunrpc binfmt_misc uinput ata_generic pata_acpi radeon i2c_algo_bit
drm_kms_helper ttm firewire_ohci drm firewire_core pata_via sata_via i2c_core
sata_promise crc_itu_t
[ 46.657004] Pid: 792, comm: ip Not tainted 3.8.0-0.rc6.git0.1.fc19.x86_64 #1
[ 46.657004] Call Trace:
[ 46.657004] <IRQ> [<ffffffff81065ed0>] warn_slowpath_common+0x70/0xa0
[ 46.657004] [<ffffffff81065f4c>] warn_slowpath_fmt+0x4c/0x50
[ 46.657004] [<ffffffff81364cfb>] check_unmap+0x47b/0x950
[ 46.657004] [<ffffffff8136522f>] debug_dma_unmap_page+0x5f/0x70
[ 46.657004] [<ffffffffa030f0f0>] ? e100_tx_clean+0x30/0x210 [e100]
[ 46.657004] [<ffffffffa030f1a8>] e100_tx_clean+0xe8/0x210 [e100]
[ 46.657004] [<ffffffffa030fc6f>] e100_poll+0x56f/0x6c0 [e100]
[ 46.657004] [<ffffffff8159dce1>] ? net_rx_action+0xa1/0x370
[ 46.657004] [<ffffffff8159ddb2>] net_rx_action+0x172/0x370
[ 46.657004] [<ffffffff810703bf>] __do_softirq+0xef/0x3d0
[ 46.657004] [<ffffffff816e4ebc>] call_softirq+0x1c/0x30
[ 46.657004] [<ffffffff8101c485>] do_softirq+0x85/0xc0
[ 46.657004] [<ffffffff81070885>] irq_exit+0xd5/0xe0
[ 46.657004] [<ffffffff816e5756>] do_IRQ+0x56/0xc0
[ 46.657004] [<ffffffff816dacb2>] common_interrupt+0x72/0x72
[ 46.657004] <EOI> [<ffffffff816da1eb>] ?
_raw_spin_unlock_irqrestore+0x3b/0x70
[ 46.657004] [<ffffffff816d124d>] __slab_free+0x58/0x38b
[ 46.657004] [<ffffffff81214424>] ? fsnotify_clear_marks_by_inode+0x34/0x120
[ 46.657004] [<ffffffff811b0417>] ? kmem_cache_free+0x97/0x320
[ 46.657004] [<ffffffff8157fc14>] ? sock_destroy_inode+0x34/0x40
[ 46.657004] [<ffffffff8157fc14>] ? sock_destroy_inode+0x34/0x40
[ 46.657004] [<ffffffff811b0692>] kmem_cache_free+0x312/0x320
[ 46.657004] [<ffffffff8157fc14>] sock_destroy_inode+0x34/0x40
[ 46.657004] [<ffffffff811e8c28>] destroy_inode+0x38/0x60
[ 46.657004] [<ffffffff811e8d5e>] evict+0x10e/0x1a0
[ 46.657004] [<ffffffff811e9605>] iput+0xf5/0x180
[ 46.657004] [<ffffffff811e4338>] dput+0x248/0x310
[ 46.657004] [<ffffffff811ce0e1>] __fput+0x171/0x240
[ 46.657004] [<ffffffff811ce26e>] ____fput+0xe/0x10
[ 46.657004] [<ffffffff8108d54c>] task_work_run+0xac/0xe0
[ 46.657004] [<ffffffff8106c6ed>] do_exit+0x26d/0xc30
[ 46.657004] [<ffffffff8109eccc>] ? finish_task_switch+0x7c/0x120
[ 46.657004] [<ffffffff816dad58>] ? retint_swapgs+0x13/0x1b
[ 46.657004] [<ffffffff8106d139>] do_group_exit+0x49/0xc0
[ 46.657004] [<ffffffff8106d1c4>] sys_exit_group+0x14/0x20
[ 46.657004] [<ffffffff816e3b19>] system_call_fastpath+0x16/0x1b
[ 46.657004] ---[ end trace 4468c44e2156e7d1 ]---
[ 46.657004] Mapped at:
[ 46.657004] [<ffffffff813663d1>] debug_dma_map_page+0x91/0x140
[ 46.657004] [<ffffffffa030e8eb>] e100_xmit_prepare+0x12b/0x1c0 [e100]
[ 46.657004] [<ffffffffa030c924>] e100_exec_cb+0x84/0x140 [e100]
[ 46.657004] [<ffffffffa030e56a>] e100_xmit_frame+0x3a/0x190 [e100]
[ 46.657004] [<ffffffff8159ee89>] dev_hard_start_xmit+0x259/0x6c0
Easy fix, modify the cb paramter to e100_exec_cb to return an error, and do the
dma_mapping_error check in the obvious place
This was reported previously here:
http://article.gmane.org/gmane.linux.network/257893
But nobody stepped up and fixed it.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Michal Jaegermann <michal@harddata.com>
CC: Josh Boyer <jwboyer@redhat.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
CC: e1000-devel@lists.sourceforge.net
---
drivers/net/ethernet/intel/e100.c | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index ec800b0..d2bea3f 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -870,7 +870,7 @@ err_unlock:
}
static int e100_exec_cb(struct nic *nic, struct sk_buff *skb,
- void (*cb_prepare)(struct nic *, struct cb *, struct sk_buff *))
+ int (*cb_prepare)(struct nic *, struct cb *, struct sk_buff *))
{
struct cb *cb;
unsigned long flags;
@@ -888,10 +888,13 @@ static int e100_exec_cb(struct nic *nic, struct sk_buff *skb,
nic->cbs_avail--;
cb->skb = skb;
+ err = cb_prepare(nic, cb, skb);
+ if (err)
+ goto err_unlock;
+
if (unlikely(!nic->cbs_avail))
err = -ENOSPC;
- cb_prepare(nic, cb, skb);
/* Order is important otherwise we'll be in a race with h/w:
* set S-bit in current first, then clear S-bit in previous. */
@@ -1091,7 +1094,7 @@ static void e100_get_defaults(struct nic *nic)
nic->mii.mdio_write = mdio_write;
}
-static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
+static int e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
{
struct config *config = &cb->u.config;
u8 *c = (u8 *)config;
@@ -1181,6 +1184,7 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
"[16-23]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]);
+ return 0;
}
/*************************************************************************
@@ -1331,7 +1335,7 @@ static const struct firmware *e100_request_firmware(struct nic *nic)
return fw;
}
-static void e100_setup_ucode(struct nic *nic, struct cb *cb,
+static int e100_setup_ucode(struct nic *nic, struct cb *cb,
struct sk_buff *skb)
{
const struct firmware *fw = (void *)skb;
@@ -1358,6 +1362,7 @@ static void e100_setup_ucode(struct nic *nic, struct cb *cb,
cb->u.ucode[min_size] |= cpu_to_le32((BUNDLESMALL) ? 0xFFFF : 0xFF80);
cb->command = cpu_to_le16(cb_ucode | cb_el);
+ return 0;
}
static inline int e100_load_ucode_wait(struct nic *nic)
@@ -1400,18 +1405,20 @@ static inline int e100_load_ucode_wait(struct nic *nic)
return err;
}
-static void e100_setup_iaaddr(struct nic *nic, struct cb *cb,
+static int e100_setup_iaaddr(struct nic *nic, struct cb *cb,
struct sk_buff *skb)
{
cb->command = cpu_to_le16(cb_iaaddr);
memcpy(cb->u.iaaddr, nic->netdev->dev_addr, ETH_ALEN);
+ return 0;
}
-static void e100_dump(struct nic *nic, struct cb *cb, struct sk_buff *skb)
+static int e100_dump(struct nic *nic, struct cb *cb, struct sk_buff *skb)
{
cb->command = cpu_to_le16(cb_dump);
cb->u.dump_buffer_addr = cpu_to_le32(nic->dma_addr +
offsetof(struct mem, dump_buf));
+ return 0;
}
static int e100_phy_check_without_mii(struct nic *nic)
@@ -1581,7 +1588,7 @@ static int e100_hw_init(struct nic *nic)
return 0;
}
-static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb)
+static int e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb)
{
struct net_device *netdev = nic->netdev;
struct netdev_hw_addr *ha;
@@ -1596,6 +1603,7 @@ static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb)
memcpy(&cb->u.multi.addr[i++ * ETH_ALEN], &ha->addr,
ETH_ALEN);
}
+ return 0;
}
static void e100_set_multicast_list(struct net_device *netdev)
@@ -1756,11 +1764,18 @@ static void e100_watchdog(unsigned long data)
round_jiffies(jiffies + E100_WATCHDOG_PERIOD));
}
-static void e100_xmit_prepare(struct nic *nic, struct cb *cb,
+static int e100_xmit_prepare(struct nic *nic, struct cb *cb,
struct sk_buff *skb)
{
+ dma_addr_t dma_addr;
cb->command = nic->tx_command;
+ dma_addr = pci_map_single(nic->pdev,
+ skb->data, skb->len, PCI_DMA_TODEVICE);
+ /* If we can't map the skb, have the upper layer try later */
+ if (pci_dma_mapping_error(nic->pdev, dma_addr))
+ return -ENOMEM;
+
/*
* Use the last 4 bytes of the SKB payload packet as the CRC, used for
* testing, ie sending frames with bad CRC.
@@ -1777,11 +1792,10 @@ static void e100_xmit_prepare(struct nic *nic, struct cb *cb,
cb->u.tcb.tcb_byte_count = 0;
cb->u.tcb.threshold = nic->tx_threshold;
cb->u.tcb.tbd_count = 1;
- cb->u.tcb.tbd.buf_addr = cpu_to_le32(pci_map_single(nic->pdev,
- skb->data, skb->len, PCI_DMA_TODEVICE));
- /* check for mapping failure? */
+ cb->u.tcb.tbd.buf_addr = cpu_to_le32(dma_addr);
cb->u.tcb.tbd.size = cpu_to_le16(skb->len);
skb_tx_timestamp(skb);
+ return 0;
}
static netdev_tx_t e100_xmit_frame(struct sk_buff *skb,
--
1.7.11.7
^ permalink raw reply related
* [PATCH net-next] vxlan: Bypass encapsulation if the destination is local
From: Sridhar Samudrala @ 2013-04-02 18:10 UTC (permalink / raw)
To: shemminger, davem, dlstevens; +Cc: netdev
This patch bypasses vxlan encapsulation if the destination vxlan
endpoint is a local device.
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
---
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 62a4438..2ad2311 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -912,6 +912,36 @@ static int handle_offloads(struct sk_buff *skb)
return 0;
}
+/* Bypass encapsulation if the destination is local */
+static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan,
+ struct vxlan_dev *dst_vxlan)
+{
+ struct pcpu_tstats *tx_stats = this_cpu_ptr(src_vxlan->dev->tstats);
+ struct pcpu_tstats *rx_stats = this_cpu_ptr(dst_vxlan->dev->tstats);
+
+ skb->pkt_type = PACKET_HOST;
+ skb->encapsulation = 0;
+ skb->dev = dst_vxlan->dev;
+ __skb_pull(skb, skb_network_offset(skb));
+
+ if (dst_vxlan->flags & VXLAN_F_LEARN)
+ vxlan_snoop(skb->dev, INADDR_LOOPBACK, eth_hdr(skb)->h_source);
+
+ u64_stats_update_begin(&tx_stats->syncp);
+ tx_stats->tx_packets++;
+ tx_stats->tx_bytes += skb->len;
+ u64_stats_update_end(&tx_stats->syncp);
+
+ if (netif_rx(skb) == NET_RX_SUCCESS) {
+ u64_stats_update_begin(&rx_stats->syncp);
+ rx_stats->rx_packets++;
+ rx_stats->rx_bytes += skb->len;
+ u64_stats_update_end(&rx_stats->syncp);
+ } else {
+ skb->dev->stats.rx_dropped++;
+ }
+}
+
static netdev_tx_t vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
struct vxlan_rdst *rdst, bool did_rsc)
{
@@ -922,7 +952,6 @@ static netdev_tx_t vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
struct vxlanhdr *vxh;
struct udphdr *uh;
struct flowi4 fl4;
- unsigned int pkt_len = skb->len;
__be32 dst;
__u16 src_port, dst_port;
u32 vni;
@@ -935,22 +964,8 @@ static netdev_tx_t vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
if (!dst) {
if (did_rsc) {
- __skb_pull(skb, skb_network_offset(skb));
- skb->ip_summed = CHECKSUM_NONE;
- skb->pkt_type = PACKET_HOST;
-
/* short-circuited back to local bridge */
- if (netif_rx(skb) == NET_RX_SUCCESS) {
- struct pcpu_tstats *stats = this_cpu_ptr(dev->tstats);
-
- u64_stats_update_begin(&stats->syncp);
- stats->tx_packets++;
- stats->tx_bytes += pkt_len;
- u64_stats_update_end(&stats->syncp);
- } else {
- dev->stats.tx_errors++;
- dev->stats.tx_aborted_errors++;
- }
+ vxlan_encap_bypass(skb, vxlan, vxlan);
return NETDEV_TX_OK;
}
goto drop;
@@ -997,6 +1012,16 @@ static netdev_tx_t vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
goto tx_error;
}
+ /* Bypass encapsulation if the destination is local */
+ if (rt->rt_flags & RTCF_LOCAL) {
+ struct vxlan_dev *dst_vxlan;
+
+ dst_vxlan = vxlan_find_vni(dev_net(dev), vni);
+ vxlan_encap_bypass(skb, vxlan, dst_vxlan);
+ ip_rt_put(rt);
+ return NETDEV_TX_OK;
+ }
+
memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
IPSKB_REROUTED);
^ permalink raw reply related
* Re: [PATCH net-next] bridge: remove a redundant synchronize_net()
From: David Miller @ 2013-04-02 18:19 UTC (permalink / raw)
To: eric.dumazet; +Cc: vfalico, netdev, stephen, jiri
In-Reply-To: <1364920077.5113.185.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 02 Apr 2013 09:27:57 -0700
> On Tue, 2013-04-02 at 12:12 -0400, David Miller wrote:
>
>> Note that we have a few spots now that do two synchronize_net()'s per
>> opertaion, such as team port removal, and openvswitch has such a path
>> as well. They all are of the form:
>>
>> netdev_rx_handler_unregister()
>> ...
>> lots of other stuff
>> ...
>> synchronize_net();
>>
>> So might be harder to factor back out than this br_if.c case.
>>
>
> Strange, I do see call_rcu() in openvswitch, not a synchronize_{net|
> rcu}(). Probably OK to leave as is, as it's not a big deal.
My bad, I misread the code.
> I'll let Jiri handle the team driver change, as its not clear what
> synchronize_rcu() call in team_port_del() is protecting
Ok.
^ permalink raw reply
* Re: [PATCH net-next] tcp: Remove dead sysctl_tcp_cookie_size declaration
From: David Miller @ 2013-04-02 18:25 UTC (permalink / raw)
To: ncardwell; +Cc: edumazet, ycheng, christoph.paasch, netdev
In-Reply-To: <1364922787-3756-1-git-send-email-ncardwell@google.com>
From: Neal Cardwell <ncardwell@google.com>
Date: Tue, 2 Apr 2013 13:13:07 -0400
> Remove a declaration left over from the TCPCT-ectomy. This sysctl is
> no longer referenced anywhere since 1a2c6181c4 ("tcp: Remove TCPCT").
>
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
Applied, thanks Neal.
^ permalink raw reply
* Re: [PATCH net-next 0/4] qlcnic: Bug Fixes
From: David Miller @ 2013-04-02 18:27 UTC (permalink / raw)
To: rajesh.borundia; +Cc: netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1364916883-10109-1-git-send-email-rajesh.borundia@qlogic.com>
From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Date: Tue, 2 Apr 2013 11:34:39 -0400
> Please apply it to net-next.
>
> Rajesh Borundia (4):
> qlcnic: Fix potential NULL dereference
> qlcnic: Fix NULL dereference in error path.
> qlcnic: Fix sparse warnings.
> qlcnic: Bump up the version to 5.2.40
All applied, thanks.
^ permalink raw reply
* Re: [PATCH 1/1] cbq: incorrect processing of high limits
From: David Miller @ 2013-04-02 18:30 UTC (permalink / raw)
To: eric.dumazet; +Cc: vvs, netdev, kuznet, jhs
In-Reply-To: <1364833476.5113.157.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 01 Apr 2013 09:24:36 -0700
> On Mon, 2013-04-01 at 17:01 +0400, Vasily Averin wrote:
>> currently cbq works incorrectly for limits > 10% real link bandwidth,
>> and practically does not work for limits > 50% real link bandwidth.
>> Below are results of experiments taken on 1 Gbit link
>>
>> In shaper | Actual Result
>> -----------+---------------
>> 100M | 108 Mbps
>> 200M | 244 Mbps
>> 300M | 412 Mbps
>> 500M | 893 Mbps
>>
>> This happen because of q->now changes incorrectly in cbq_dequeue():
>> when it is called before real end of packet transmitting,
>> L2T is greater than real time delay, q_now gets an extra boost
>> but never compensate it.
>>
>> To fix this problem we prevent change of q->now until its synchronization
>> with real time.
>>
>> Signed-off-by: Vasily Averin <vvs@openvz.org>
>> Reviewed-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
...
> Acked-by: Eric Dumazet <edumazet@google.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] ISDN:divert: beautify code: useless 'break', 'return (0)', additional comments.
From: David Miller @ 2013-04-02 18:31 UTC (permalink / raw)
To: gang.chen; +Cc: sergei.shtylyov, isdn, jslaby, trivial, tilman, netdev
In-Reply-To: <515A3674.7090606@asianux.com>
From: Chen Gang <gang.chen@asianux.com>
Date: Tue, 02 Apr 2013 09:37:56 +0800
>
> delete useless 'break' after 'return'.
> let 'return 0' instead of 'return (0)'
> also give a comment for 'break' to let readers notice it.
>
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] forcedeth: Do a dma_mapping_error check after skb_frag_dma_map
From: David Miller @ 2013-04-02 18:32 UTC (permalink / raw)
To: nhorman; +Cc: netdev
In-Reply-To: <1364826718-16269-1-git-send-email-nhorman@tuxdriver.com>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Mon, 1 Apr 2013 10:31:58 -0400
> This backtrace was recently reported on a 3.9 kernel:
...
> Its pretty plainly the result of an skb fragment getting unmapped without having
> its initial mapping operation checked for errors. This patch corrects that.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Applied, thanks Neil.
^ permalink raw reply
* Re: [PATCH] of_net.h: Provide dummy functions if OF_NET is not configured
From: David Miller @ 2013-04-02 18:33 UTC (permalink / raw)
To: robherring2
Cc: linux, linux-kernel, devicetree-discuss, netdev, rob.herring,
david.daney
In-Reply-To: <5159DC82.3050804@gmail.com>
From: Rob Herring <robherring2@gmail.com>
Date: Mon, 01 Apr 2013 14:14:10 -0500
> On 04/01/2013 02:01 PM, Guenter Roeck wrote:
>> On Mon, Apr 01, 2013 at 01:44:24PM -0500, Rob Herring wrote:
>>> On 04/01/2013 01:19 PM, Guenter Roeck wrote:
>>>> of_get_mac_address() and of_get_phy_mode() are only provided if OF_NET
>>>> is configured. While most callers check for the define, not all do, and those
>>>> who do require #ifdef around the code. For those who don't, the missing check
>>>> can result in errors such as
>>>
>>> How about removing the ifdef from those callers?
>>>
>> That would be the next step, after/if this one is accepted.
>> If not, it doesn't make sense to waste my time.
>
> Assuming that is done:
>
> Acked-by: Rob Herring <rob.herring@calxeda.com>
>
> Presumably with the follow-on patches, this can go in thru the net tree.
Indeed, please resubmit this with the follow-on cleanups.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next] ipconfig: add informative timeout messages while waiting for carrier
From: David Miller @ 2013-04-02 18:35 UTC (permalink / raw)
To: paul.gortmaker; +Cc: netdev
In-Reply-To: <1364911105-21734-1-git-send-email-paul.gortmaker@windriver.com>
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Tue, 2 Apr 2013 09:58:25 -0400
> Commit 3fb72f1e6e6165c5f495e8dc11c5bbd14c73385c ("ipconfig wait
> for carrier") added a "wait for carrier on at least one interface"
> policy, with a worst case maximum wait of two minutes.
>
> However, if you encounter this, you won't get any feedback from
> the console as to the nature of what is going on. You just see
> the booting process hang for two minutes and then continue.
>
> Here we add a message so the user knows what is going on, and
> hence can take action to rectify the situation (e.g. fix network
> cable or whatever.) After the 1st 10s pause, output now begins
> that looks like this:
>
> Waiting up to 110 more seconds for network.
> Waiting up to 100 more seconds for network.
> Waiting up to 90 more seconds for network.
> Waiting up to 80 more seconds for network.
> ...
>
> Since most systems will have no problem getting link/carrier in the
> 1st 10s, the only people who will see these messages are people with
> genuine issues that need to be resolved.
>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
This is fine, applied, thanks.
^ permalink raw reply
* Re: [PATCH v2] net IPv6 : Fix broken IPv6 routing table after loopback down-up
From: David Miller @ 2013-04-02 18:37 UTC (permalink / raw)
To: kumaran.4353
Cc: yoshfuji, eric.dumazet, kaber, kuznet, jmorris,
Balakumaran.Kannan, maruthi.thotad, netdev, jamshed.a,
amit.agarwal, takuzo.ohara, aaditya.kumar
In-Reply-To: <515AB6B1.4080501@gmail.com>
From: Balakumaran Kannan <kumaran.4353@gmail.com>
Date: Tue, 02 Apr 2013 16:15:05 +0530
> IPv6 Routing table becomes broken once we do ifdown, ifup of the loopback(lo)
> interface. After down-up, routes of other interface's IPv6 addresses through
> 'lo' are lost.
>
> IPv6 addresses assigned to all interfaces are routed through 'lo' for internal
> communication. Once 'lo' is down, those routing entries are removed from routing
> table. But those removed entries are not being re-created properly when 'lo' is
> brought up. So IPv6 addresses of other interfaces becomes unreachable from the
> same machine. Also this breaks communication with other machines because of
> NDISC packet processing failure.
>
> This patch fixes this issue by reading all interface's IPv6 addresses and adding
> them to IPv6 routing table while bringing up 'lo'.
>
> Patch is prepared for Linux-3.9.rc5 kernel.
>
> Signed-off-by: Balakumaran Kannan <Balakumaran.Kannan@ap.sony.com>
> Signed-off-by: Maruthi Thotad <Maruthi.Thotad@ap.sony.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] VSOCK: Handle changes to the VMCI context ID.
From: David Miller @ 2013-04-02 18:39 UTC (permalink / raw)
To: grantr; +Cc: netdev, linux-kernel, pv-drivers
In-Reply-To: <1364841712-22810-1-git-send-email-grantr@vmware.com>
From: Reilly Grant <grantr@vmware.com>
Date: Mon, 1 Apr 2013 11:41:52 -0700
> The VMCI context ID of a virtual machine may change at any time. There
> is a VMCI event which signals this but datagrams may be processed before
> this is handled. It is therefore necessary to be flexible about the
> destination context ID of any datagrams received. (It can be assumed to
> be correct because it is provided by the hypervisor.) The context ID on
> existing sockets should be updated to reflect how the hypervisor is
> currently referring to the system.
>
> Signed-off-by: Reilly Grant <grantr@vmware.com>
> Acked-by: Andy King <acking@vmware.com>
Applied, thanks.
^ permalink raw reply
* [PATCH 0/6] 802.15.4 and 6LoWPAN Buffering Fixes
From: Alan Ott @ 2013-04-02 18:47 UTC (permalink / raw)
To: Alexander Smirnov, Dmitry Eremin-Solenikov, David S. Miller
Cc: Alan Ott, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
These patches fix an issue in the 802.15.4 code where the output buffer
(which prior to this patchset is just a workqueue) can grow to an arbitrary
size. This is basically fixed as follows:
1. Use netif_stop_queue() and netif_wake_queue() to stop and start the
transmit queue, preventing packets from piling up without bound on the
mac802154 workqueue.
2. Increase the default tx_buffer_len for mac802154 (wpan) devices from 10
to 300, enabling Qdisc to work properly on the transmit queue.
Additionally the following related issues are fixed:
1. Handle dev_queue_xmit() return values properly in the 6LoWPAN code (and
return the proper errors to the higher layers). This will cause the higher
layers to retry later if the mac802154 queue is full.
2. Fix the retry of transmit failures in mac802154.
Alan Ott (6):
mac802154: Immediately retry sending failed packets
mac802154: Move xmit_attemps to stack
mac802154: Use netif flow control
mac802154: Increase tx_buffer_len
6lowpan: handle dev_queue_xmit error code properly
6lowpan: return the dev_queue_xmit() return value from lowpan_xmit()
net/ieee802154/6lowpan.c | 4 ++--
net/mac802154/tx.c | 34 ++++++++++++++++++++++++----------
net/mac802154/wpan.c | 2 +-
3 files changed, 27 insertions(+), 13 deletions(-)
--
1.7.11.2
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
^ 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