From 8df8a47538ac2e26f07efabc8793c06e96a35226 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 22 May 2011 20:35:54 -0400 Subject: rionet: Remove pointless printk of skb pointer. Casting to u32 warns anyways. Signed-off-by: David S. Miller --- drivers/net/rionet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/net') diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c index 26afbaae23f0..77c5092a6a40 100644 --- a/drivers/net/rionet.c +++ b/drivers/net/rionet.c @@ -162,8 +162,8 @@ static int rionet_queue_tx_msg(struct sk_buff *skb, struct net_device *ndev, rnet->tx_slot &= (RIONET_TX_RING_SIZE - 1); if (netif_msg_tx_queued(rnet)) - printk(KERN_INFO "%s: queued skb %8.8x len %8.8x\n", DRV_NAME, - (u32) skb, skb->len); + printk(KERN_INFO "%s: queued skb len %8.8x\n", DRV_NAME, + skb->len); return 0; } -- cgit v1.2.3 From c0cba59e77b5640912a331566bbfa66ae5029f37 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Sun, 22 May 2011 11:02:08 +0000 Subject: drivers/net: add prefetch header for prefetch users After discovering that wide use of prefetch on modern CPUs could be a net loss instead of a win, net drivers which were relying on the implicit inclusion of prefetch.h via the list headers showed up in the resulting cleanup fallout. Give them an explicit include via the following $0.02 script. ========================================= #!/bin/bash MANUAL="" for i in `git grep -l 'prefetch(.*)' .` ; do grep -q '' $i if [ $? = 0 ] ; then continue fi ( echo '?^#include ' echo . echo w echo q ) | ed -s $i > /dev/null 2>&1 if [ $? != 0 ]; then echo $i needs manual fixup MANUAL="$i $MANUAL" fi done echo ------------------- 8\<---------------------- echo vi $MANUAL ========================================= Signed-off-by: Paul Signed-off-by: David S. Miller --- drivers/net/benet/be_main.c | 1 + drivers/net/bna/bnad.c | 1 + drivers/net/bnx2x/bnx2x_cmn.c | 1 + drivers/net/chelsio/sge.c | 1 + drivers/net/cnic.c | 1 + drivers/net/cxgb3/sge.c | 1 + drivers/net/cxgb4/sge.c | 1 + drivers/net/cxgb4vf/sge.c | 1 + drivers/net/e1000/e1000_main.c | 1 + drivers/net/e1000e/netdev.c | 1 + drivers/net/ehea/ehea_qmr.h | 1 + drivers/net/enic/enic_main.c | 1 + drivers/net/forcedeth.c | 1 + drivers/net/igb/igb_main.c | 1 + drivers/net/igbvf/netdev.c | 1 + drivers/net/ixgb/ixgb_main.c | 1 + drivers/net/ixgbe/ixgbe_main.c | 1 + drivers/net/ixgbevf/ixgbevf_main.c | 1 + drivers/net/myri10ge/myri10ge.c | 1 + drivers/net/pasemi_mac.c | 1 + drivers/net/pch_gbe/pch_gbe_main.c | 1 + drivers/net/qla3xxx.c | 1 + drivers/net/qlge/qlge_main.c | 1 + drivers/net/r8169.c | 1 + drivers/net/s2io.c | 1 + drivers/net/sb1250-mac.c | 1 + drivers/net/sfc/rx.c | 1 + drivers/net/skge.c | 1 + drivers/net/stmmac/stmmac_main.c | 1 + drivers/net/tc35815.c | 1 + drivers/net/vxge/vxge-main.c | 1 + drivers/net/vxge/vxge-traffic.c | 1 + 32 files changed, 32 insertions(+) (limited to 'drivers/net') diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 4b5e0ed49ed8..a485f7fdaf37 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c @@ -15,6 +15,7 @@ * Costa Mesa, CA 92626 */ +#include #include "be.h" #include "be_cmds.h" #include diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c index e588511f47fb..7d25a97d33f6 100644 --- a/drivers/net/bna/bnad.c +++ b/drivers/net/bna/bnad.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "bnad.h" #include "bna.h" diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index ca2bbc0e5d48..64d01e728a9d 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "bnx2x_cmn.h" #include "bnx2x_init.h" diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index b948ea737550..58380d240619 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c @@ -54,6 +54,7 @@ #include #include #include +#include #include "cpl5_cmd.h" #include "sge.h" diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index cde59b4e5ef8..11a92afdf982 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c @@ -27,6 +27,7 @@ #include #include #include +#include #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) #define BCM_VLAN 1 #endif diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index cba1401377ab..3f562ba2f0c9 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include "common.h" #include "regs.h" diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c index 75a4b0fa19ee..56adf448b9fe 100644 --- a/drivers/net/cxgb4/sge.c +++ b/drivers/net/cxgb4/sge.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include "cxgb4.h" diff --git a/drivers/net/cxgb4vf/sge.c b/drivers/net/cxgb4vf/sge.c index 5182960e29fd..5fd75fdaa631 100644 --- a/drivers/net/cxgb4vf/sge.c +++ b/drivers/net/cxgb4vf/sge.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "t4vf_common.h" #include "t4vf_defs.h" diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index c18cb8e883dd..76e8af00d86d 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -29,6 +29,7 @@ #include "e1000.h" #include #include +#include /* Intel Media SOC GbE MDIO physical base address */ static unsigned long ce4100_gbe_mdio_base_phy; diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 0939040305fa..d9600566a1fc 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -49,6 +49,7 @@ #include #include #include +#include #include "e1000.h" diff --git a/drivers/net/ehea/ehea_qmr.h b/drivers/net/ehea/ehea_qmr.h index 38104734a3be..fddff8ec8cfd 100644 --- a/drivers/net/ehea/ehea_qmr.h +++ b/drivers/net/ehea/ehea_qmr.h @@ -29,6 +29,7 @@ #ifndef __EHEA_QMR_H__ #define __EHEA_QMR_H__ +#include #include "ehea.h" #include "ehea_hw.h" diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 3d99b0f1a236..2f433fbfca0c 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include "cq_enet_desc.h" diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index d09e8b0add01..537b6957bb79 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c @@ -64,6 +64,7 @@ #include #include #include +#include #include #include diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index ce7838e55827..0ae93529bfc1 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c @@ -47,6 +47,7 @@ #include #ifdef CONFIG_IGB_DCA #include +#include #endif #include "igb.h" diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index 1d04ca6fdaea..1c77fb3bf4ae 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "igbvf.h" diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 0f681ac2da8d..6a130eb51cfa 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c @@ -28,6 +28,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include "ixgb.h" char ixgb_driver_name[] = "ixgb"; diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index fa01b0b03b77..08e8e25c159d 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include "ixgbe.h" diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c index d7ab202fb95c..28d3cb21d376 100644 --- a/drivers/net/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ixgbevf/ixgbevf_main.c @@ -44,6 +44,7 @@ #include #include #include +#include #include "ixgbevf.h" diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index b1358f79ba0a..bf84849600ce 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 828e97cacdbf..9ec112ca62e4 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c index c2476fd96573..eac3c5ca9731 100644 --- a/drivers/net/pch_gbe/pch_gbe_main.c +++ b/drivers/net/pch_gbe/pch_gbe_main.c @@ -20,6 +20,7 @@ #include "pch_gbe.h" #include "pch_gbe_api.h" +#include #define DRV_VERSION "1.00" const char pch_driver_version[] = DRV_VERSION; diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index d495a6859fd9..771bb614ccc9 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -35,6 +35,7 @@ #include #include #include +#include #include "qla3xxx.h" diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 6c9d124cfc76..930ae45457bb 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include "qlge.h" diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 04f4e6086cd0..ef1ce2ebeb4a 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 89cfee7e8643..a9a5f5ed19c6 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -78,6 +78,7 @@ #include #include #include +#include #include #include diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index d96d2f7a3f14..68d50429ddf3 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include diff --git a/drivers/net/sfc/rx.c b/drivers/net/sfc/rx.c index b7dc891b4461..62e43649466e 100644 --- a/drivers/net/sfc/rx.c +++ b/drivers/net/sfc/rx.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include "net_driver.h" diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 52a48cb75440..f4be5c78ebfd 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include "skge.h" diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index e15c4a0bb96d..e25e44a45c28 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c @@ -45,6 +45,7 @@ #include #include #include +#include #include "stmmac.h" #define STMMAC_RESOURCE_NAME "stmmaceth" diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c index 7ca51cebcddd..4a55a162dfe6 100644 --- a/drivers/net/tc35815.c +++ b/drivers/net/tc35815.c @@ -47,6 +47,7 @@ static const char *version = "tc35815.c:v" DRV_VERSION "\n"; #include #include #include +#include #include #include diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c index fc837cf6bd4d..8ab870a2ad02 100644 --- a/drivers/net/vxge/vxge-main.c +++ b/drivers/net/vxge/vxge-main.c @@ -52,6 +52,7 @@ #include #include #include +#include #include "vxge-main.h" #include "vxge-reg.h" diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c index 2638b8d97b8f..f93517055162 100644 --- a/drivers/net/vxge/vxge-traffic.c +++ b/drivers/net/vxge/vxge-traffic.c @@ -12,6 +12,7 @@ * Copyright(c) 2002-2010 Exar Corp. ******************************************************************************/ #include +#include #include "vxge-traffic.h" #include "vxge-config.h" -- cgit v1.2.3 From a37dd3332319260cce81ac91ce25fcc3a31de997 Mon Sep 17 00:00:00 2001 From: David Ward Date: Thu, 19 May 2011 02:53:20 +0000 Subject: macvlan: Forward unicast frames in bridge mode to lowerdev Unicast frames between macvlan interfaces in bridge mode are not otherwise sent to network taps on the lowerdev (as all other macvlan frames are), so forward the frames to the receive queue of the lowerdev first. Signed-off-by: David Ward Signed-off-by: David S. Miller --- drivers/net/macvlan.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/net') diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index d72a70615c0f..d6aeaa5f25ea 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -238,10 +238,8 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) dest = macvlan_hash_lookup(port, eth->h_dest); if (dest && dest->mode == MACVLAN_MODE_BRIDGE) { - unsigned int length = skb->len + ETH_HLEN; - int ret = dest->forward(dest->dev, skb); - macvlan_count_rx(dest, length, - ret == NET_RX_SUCCESS, 0); + /* send to lowerdev first for its network taps */ + vlan->forward(vlan->lowerdev, skb); return NET_XMIT_SUCCESS; } -- cgit v1.2.3 From 8d8fc29d02a33e4bd5f4fa47823c1fd386346093 Mon Sep 17 00:00:00 2001 From: Amerigo Wang Date: Thu, 19 May 2011 21:39:10 +0000 Subject: netpoll: disable netpoll when enslave a device V3: rename NETDEV_ENSLAVE to NETDEV_JOIN Currently we do nothing when we enslave a net device which is running netconsole. Neil pointed out that we may get weird results in such case, so let's disable netpoll on the device being enslaved. I think it is too harsh to prevent the device being ensalved if it is running netconsole. By the way, this patch also removes the NETDEV_GOING_DOWN from netconsole netdev notifier, because netpoll will check if the device is running or not and we don't handle NETDEV_PRE_UP neither. This patch is based on net-next-2.6. Signed-off-by: WANG Cong Cc: Neil Horman Signed-off-by: David S. Miller --- drivers/net/bonding/bond_main.c | 2 ++ drivers/net/netconsole.c | 26 +++++++++++++++++--------- include/linux/notifier.h | 1 + 3 files changed, 20 insertions(+), 9 deletions(-) (limited to 'drivers/net') diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 088fd845ffdf..f4960f516c39 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1640,6 +1640,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) } } + call_netdevice_notifiers(NETDEV_JOIN, slave_dev); + /* If this is the first slave, then we need to set the master's hardware * address to be the same as the slave's. */ if (is_zero_ether_addr(bond->dev->dev_addr)) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index a83e101440fd..4190786de403 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -621,11 +621,10 @@ static int netconsole_netdev_event(struct notifier_block *this, bool stopped = false; if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER || - event == NETDEV_BONDING_DESLAVE || event == NETDEV_GOING_DOWN)) + event == NETDEV_BONDING_DESLAVE || event == NETDEV_JOIN)) goto done; spin_lock_irqsave(&target_list_lock, flags); -restart: list_for_each_entry(nt, &target_list, list) { netconsole_target_get(nt); if (nt->np.dev == dev) { @@ -633,6 +632,8 @@ restart: case NETDEV_CHANGENAME: strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ); break; + case NETDEV_BONDING_DESLAVE: + case NETDEV_JOIN: case NETDEV_UNREGISTER: /* * rtnl_lock already held @@ -647,11 +648,7 @@ restart: dev_put(nt->np.dev); nt->np.dev = NULL; netconsole_target_put(nt); - goto restart; } - /* Fall through */ - case NETDEV_GOING_DOWN: - case NETDEV_BONDING_DESLAVE: nt->enabled = 0; stopped = true; break; @@ -660,10 +657,21 @@ restart: netconsole_target_put(nt); } spin_unlock_irqrestore(&target_list_lock, flags); - if (stopped && (event == NETDEV_UNREGISTER || event == NETDEV_BONDING_DESLAVE)) + if (stopped) { printk(KERN_INFO "netconsole: network logging stopped on " - "interface %s as it %s\n", dev->name, - event == NETDEV_UNREGISTER ? "unregistered" : "released slaves"); + "interface %s as it ", dev->name); + switch (event) { + case NETDEV_UNREGISTER: + printk(KERN_CONT "unregistered\n"); + break; + case NETDEV_BONDING_DESLAVE: + printk(KERN_CONT "released slaves\n"); + break; + case NETDEV_JOIN: + printk(KERN_CONT "is joining a master device\n"); + break; + } + } done: return NOTIFY_DONE; diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 621dfa16acc0..a577762afbe7 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h @@ -211,6 +211,7 @@ static inline int notifier_to_errno(int ret) #define NETDEV_UNREGISTER_BATCH 0x0011 #define NETDEV_BONDING_DESLAVE 0x0012 #define NETDEV_NOTIFY_PEERS 0x0013 +#define NETDEV_JOIN 0x0014 #define SYS_DOWN 0x0001 /* Notify of system down */ #define SYS_RESTART SYS_DOWN -- cgit v1.2.3 From daf9209bb2c8b07ca025eac82e3d175534086c77 Mon Sep 17 00:00:00 2001 From: Amerigo Wang Date: Thu, 19 May 2011 21:39:12 +0000 Subject: net: rename NETDEV_BONDING_DESLAVE to NETDEV_RELEASE s/NETDEV_BONDING_DESLAVE/NETDEV_RELEASE/ as Andy suggested. Signed-off-by: WANG Cong Cc: Andy Gospodarek Cc: Neil Horman Signed-off-by: David S. Miller --- drivers/net/bonding/bond_main.c | 2 +- drivers/net/netconsole.c | 6 +++--- include/linux/notifier.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/net') diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index f4960f516c39..6dc428461541 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1974,7 +1974,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) } block_netpoll_tx(); - netdev_bonding_change(bond_dev, NETDEV_BONDING_DESLAVE); + netdev_bonding_change(bond_dev, NETDEV_RELEASE); write_lock_bh(&bond->lock); slave = bond_get_slave_by_dev(bond, slave_dev); diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 4190786de403..dfc82720065a 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -621,7 +621,7 @@ static int netconsole_netdev_event(struct notifier_block *this, bool stopped = false; if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER || - event == NETDEV_BONDING_DESLAVE || event == NETDEV_JOIN)) + event == NETDEV_RELEASE || event == NETDEV_JOIN)) goto done; spin_lock_irqsave(&target_list_lock, flags); @@ -632,7 +632,7 @@ static int netconsole_netdev_event(struct notifier_block *this, case NETDEV_CHANGENAME: strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ); break; - case NETDEV_BONDING_DESLAVE: + case NETDEV_RELEASE: case NETDEV_JOIN: case NETDEV_UNREGISTER: /* @@ -664,7 +664,7 @@ static int netconsole_netdev_event(struct notifier_block *this, case NETDEV_UNREGISTER: printk(KERN_CONT "unregistered\n"); break; - case NETDEV_BONDING_DESLAVE: + case NETDEV_RELEASE: printk(KERN_CONT "released slaves\n"); break; case NETDEV_JOIN: diff --git a/include/linux/notifier.h b/include/linux/notifier.h index a577762afbe7..c0688b0168b3 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h @@ -209,7 +209,7 @@ static inline int notifier_to_errno(int ret) #define NETDEV_POST_TYPE_CHANGE 0x000F #define NETDEV_POST_INIT 0x0010 #define NETDEV_UNREGISTER_BATCH 0x0011 -#define NETDEV_BONDING_DESLAVE 0x0012 +#define NETDEV_RELEASE 0x0012 #define NETDEV_NOTIFY_PEERS 0x0013 #define NETDEV_JOIN 0x0014 -- cgit v1.2.3 From 40955532bc9d865999dfc58b7896605d58650655 Mon Sep 17 00:00:00 2001 From: Vladislav Zolotarov Date: Sun, 22 May 2011 10:06:58 +0000 Subject: bnx2x: call dev_kfree_skb_any instead of dev_kfree_skb replace function calls when possible call in both irq/non-irq contexts Signed-off-by: Dmitry Kravkov Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x/bnx2x_cmn.c | 4 ++-- drivers/net/bnx2x/bnx2x_cmn.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/net') diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index 64d01e728a9d..d5bd35b7f2e1 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c @@ -131,7 +131,7 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fastpath *fp, /* release skb */ WARN_ON(!skb); - dev_kfree_skb(skb); + dev_kfree_skb_any(skb); tx_buf->first_bd = 0; tx_buf->skb = NULL; @@ -465,7 +465,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, } else { DP(NETIF_MSG_RX_STATUS, "Failed to allocate new pages" " - dropping packet!\n"); - dev_kfree_skb(skb); + dev_kfree_skb_any(skb); } diff --git a/drivers/net/bnx2x/bnx2x_cmn.h b/drivers/net/bnx2x/bnx2x_cmn.h index fab161e8030d..1a3545bd8a92 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.h +++ b/drivers/net/bnx2x/bnx2x_cmn.h @@ -840,7 +840,7 @@ static inline int bnx2x_alloc_rx_skb(struct bnx2x *bp, mapping = dma_map_single(&bp->pdev->dev, skb->data, fp->rx_buf_size, DMA_FROM_DEVICE); if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { - dev_kfree_skb(skb); + dev_kfree_skb_any(skb); return -ENOMEM; } -- cgit v1.2.3 From c3a8ce6145cfcfce192513187000cd723313d94f Mon Sep 17 00:00:00 2001 From: Vladislav Zolotarov Date: Sun, 22 May 2011 10:08:09 +0000 Subject: bnx2x: properly handle CFC DEL in cnic flow Signed-off-by: Dmitry Kravkov Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x/bnx2x_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/net') diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index f45c0caf3240..fb23d575d633 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c @@ -3666,7 +3666,8 @@ static int bnx2x_cnic_handle_cfc_del(struct bnx2x *bp, u32 cid, union event_ring_elem *elem) { if (!bp->cnic_eth_dev.starting_cid || - cid < bp->cnic_eth_dev.starting_cid) + (cid < bp->cnic_eth_dev.starting_cid && + cid != bp->cnic_eth_dev.iscsi_l2_cid)) return 1; DP(BNX2X_MSG_SP, "got delete ramrod for CNIC CID %d\n", cid); -- cgit v1.2.3 From 5e374b5aeb9a030c1859b3054e3b36dea3b29cfc Mon Sep 17 00:00:00 2001 From: Dmitry Kravkov Date: Sun, 22 May 2011 10:09:19 +0000 Subject: bnx2x: fix DMAE timeout according to hw specifications Signed-off-by: Dmitry Kravkov Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x/bnx2x_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net') diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index fb23d575d633..f7abebfa0f5d 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c @@ -571,7 +571,7 @@ static int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae) { u32 *wb_comp = bnx2x_sp(bp, wb_comp); - int cnt = CHIP_REV_IS_SLOW(bp) ? (400000) : 40; + int cnt = CHIP_REV_IS_SLOW(bp) ? (400000) : 4000; int rc = 0; DP(BNX2X_MSG_OFF, "data before [0x%08x 0x%08x 0x%08x 0x%08x]\n", -- cgit v1.2.3 From 1b6e2ceb4745b5838cb94463131d19dbea6cf0e3 Mon Sep 17 00:00:00 2001 From: Dmitry Kravkov Date: Sun, 22 May 2011 10:11:26 +0000 Subject: bnx2x: allow device properly initialize after hotplug Signed-off-by: Dmitry Kravkov Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/bnx2x/bnx2x_main.c | 67 +++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 43 deletions(-) (limited to 'drivers/net') diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index f7abebfa0f5d..a97d9be331d1 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c @@ -7288,51 +7288,35 @@ static inline void bnx2x_mcp_wait_one(struct bnx2x *bp) msleep(MCP_ONE_TIMEOUT); } -static int bnx2x_reset_mcp_comp(struct bnx2x *bp, u32 magic_val) +/* + * initializes bp->common.shmem_base and waits for validity signature to appear + */ +static int bnx2x_init_shmem(struct bnx2x *bp) { - u32 shmem, cnt, validity_offset, val; - int rc = 0; - - msleep(100); + int cnt = 0; + u32 val = 0; - /* Get shmem offset */ - shmem = REG_RD(bp, MISC_REG_SHARED_MEM_ADDR); - if (shmem == 0) { - BNX2X_ERR("Shmem 0 return failure\n"); - rc = -ENOTTY; - goto exit_lbl; - } + do { + bp->common.shmem_base = REG_RD(bp, MISC_REG_SHARED_MEM_ADDR); + if (bp->common.shmem_base) { + val = SHMEM_RD(bp, validity_map[BP_PORT(bp)]); + if (val & SHR_MEM_VALIDITY_MB) + return 0; + } - validity_offset = offsetof(struct shmem_region, validity_map[0]); + bnx2x_mcp_wait_one(bp); - /* Wait for MCP to come up */ - for (cnt = 0; cnt < (MCP_TIMEOUT / MCP_ONE_TIMEOUT); cnt++) { - /* TBD: its best to check validity map of last port. - * currently checks on port 0. - */ - val = REG_RD(bp, shmem + validity_offset); - DP(NETIF_MSG_HW, "shmem 0x%x validity map(0x%x)=0x%x\n", shmem, - shmem + validity_offset, val); + } while (cnt++ < (MCP_TIMEOUT / MCP_ONE_TIMEOUT)); - /* check that shared memory is valid. */ - if ((val & (SHR_MEM_VALIDITY_DEV_INFO | SHR_MEM_VALIDITY_MB)) - == (SHR_MEM_VALIDITY_DEV_INFO | SHR_MEM_VALIDITY_MB)) - break; + BNX2X_ERR("BAD MCP validity signature\n"); - bnx2x_mcp_wait_one(bp); - } - - DP(NETIF_MSG_HW, "Cnt=%d Shmem validity map 0x%x\n", cnt, val); + return -ENODEV; +} - /* Check that shared memory is valid. This indicates that MCP is up. */ - if ((val & (SHR_MEM_VALIDITY_DEV_INFO | SHR_MEM_VALIDITY_MB)) != - (SHR_MEM_VALIDITY_DEV_INFO | SHR_MEM_VALIDITY_MB)) { - BNX2X_ERR("Shmem signature not present. MCP is not up !!\n"); - rc = -ENOTTY; - goto exit_lbl; - } +static int bnx2x_reset_mcp_comp(struct bnx2x *bp, u32 magic_val) +{ + int rc = bnx2x_init_shmem(bp); -exit_lbl: /* Restore the `magic' bit value */ if (!CHIP_IS_E1(bp)) bnx2x_clp_reset_done(bp, magic_val); @@ -7845,10 +7829,12 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) BNX2X_DEV_INFO("flash_size 0x%x (%d)\n", bp->common.flash_size, bp->common.flash_size); - bp->common.shmem_base = REG_RD(bp, MISC_REG_SHARED_MEM_ADDR); + bnx2x_init_shmem(bp); + bp->common.shmem2_base = REG_RD(bp, (BP_PATH(bp) ? MISC_REG_GENERIC_CR_1 : MISC_REG_GENERIC_CR_0)); + bp->link_params.shmem_base = bp->common.shmem_base; bp->link_params.shmem2_base = bp->common.shmem2_base; BNX2X_DEV_INFO("shmem offset 0x%x shmem2 offset 0x%x\n", @@ -7860,11 +7846,6 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) return; } - val = SHMEM_RD(bp, validity_map[BP_PORT(bp)]); - if ((val & (SHR_MEM_VALIDITY_DEV_INFO | SHR_MEM_VALIDITY_MB)) - != (SHR_MEM_VALIDITY_DEV_INFO | SHR_MEM_VALIDITY_MB)) - BNX2X_ERR("BAD MCP validity signature\n"); - bp->common.hw_config = SHMEM_RD(bp, dev_info.shared_hw_config.config); BNX2X_DEV_INFO("hw_config 0x%08x\n", bp->common.hw_config); -- cgit v1.2.3