[PATCH] 3c59x: Fix resource leaks in vortex_open

2015-08-02 Thread Jia-Ju Bai
When vortex_up is failed, the skb buffers allocated by __netdev_alloc_skb
in vortex_open are not released, which may cause resource leaks.
This bug has been submitted before.
This patch modifies the error handling code to fix it.

Signed-off-by: Jia-Ju Bai baijiaju1...@163.com
---
 drivers/net/ethernet/3com/3c59x.c |   17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/3com/3c59x.c 
b/drivers/net/ethernet/3com/3c59x.c
index 2d1ce3c..753887d 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -1763,16 +1763,9 @@ vortex_open(struct net_device *dev)
vp-rx_ring[i].addr = 
cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb-data, PKT_BUF_SZ, 
PCI_DMA_FROMDEVICE));
}
if (i != RX_RING_SIZE) {
-   int j;
pr_emerg(%s: no memory for rx ring\n, dev-name);
-   for (j = 0; j  i; j++) {
-   if (vp-rx_skbuff[j]) {
-   dev_kfree_skb(vp-rx_skbuff[j]);
-   vp-rx_skbuff[j] = NULL;
-   }
-   }
retval = -ENOMEM;
-   goto err_free_irq;
+   goto err_free_skb;
}
/* Wrap the ring. */
vp-rx_ring[i-1].next = cpu_to_le32(vp-rx_ring_dma);
@@ -1782,7 +1775,13 @@ vortex_open(struct net_device *dev)
if (!retval)
goto out;
 
-err_free_irq:
+err_free_skb:
+   for (i = 0; i  RX_RING_SIZE; i++) {
+   if (vp-rx_skbuff[i]) {
+   dev_kfree_skb(vp-rx_skbuff[i]);
+   vp-rx_skbuff[i] = NULL;
+   }
+   }
free_irq(dev-irq, dev);
 err:
if (vortex_debug  1)
-- 
1.7.9.5


--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] igb: Fix a deadlock in igb_sriov_reinit

2015-08-02 Thread Jia-Ju Bai
When igb_init_interrupt_scheme in igb_sriov_reinit is failed, the lock 
acquired by rtnl_lock() is not released, which causes a deadlock.
This patch adds rtnl_unlock() in error handling to fix it.

Signed-off-by: Jia-Ju Bai baijiaju1...@163.com
---
 drivers/net/ethernet/intel/igb/igb_main.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c 
b/drivers/net/ethernet/intel/igb/igb_main.c
index 2f70a9b..311d1ca 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7539,6 +7539,7 @@ static int igb_sriov_reinit(struct pci_dev *dev)
 
if (igb_init_interrupt_scheme(adapter, true)) {
dev_err(pdev-dev, Unable to allocate memory for queues\n);
+   rtnl_unlock();
return -ENOMEM;
}
 
-- 
1.7.9.5


--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] fddi: Use a more more typical logging style

2015-08-02 Thread Joe Perches
Use macros that don't require fixed argument counts so
format and arguments can be verified by the compiler.

Miscellanea:

o Remove a few #if uses to allow dynamic debug to always work
o whitespace neatening

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/net/fddi/skfp/cfm.c| 16 +++
 drivers/net/fddi/skfp/drvfbi.c |  2 +-
 drivers/net/fddi/skfp/ecm.c| 16 +++
 drivers/net/fddi/skfp/ess.c| 51 ++--
 drivers/net/fddi/skfp/fplustm.c| 10 ++--
 drivers/net/fddi/skfp/h/cmtdef.h   | 95 +-
 drivers/net/fddi/skfp/h/osdef1st.h |  2 +
 drivers/net/fddi/skfp/pcmplc.c | 29 ++--
 drivers/net/fddi/skfp/pmf.c|  2 +-
 drivers/net/fddi/skfp/rmt.c| 28 ++-
 drivers/net/fddi/skfp/smt.c| 72 ++---
 drivers/net/fddi/skfp/srf.c| 12 ++---
 12 files changed, 179 insertions(+), 156 deletions(-)

diff --git a/drivers/net/fddi/skfp/cfm.c b/drivers/net/fddi/skfp/cfm.c
index e395ace..e2fab03 100644
--- a/drivers/net/fddi/skfp/cfm.c
+++ b/drivers/net/fddi/skfp/cfm.c
@@ -52,7 +52,6 @@ static const char ID_sccs[] = @(#)cfm.c  2.18 98/10/06 
(C) SK  ;
 #define ACTIONS_DONE() (smc-mib.fddiSMTCF_State = ~AFLAG)
 #define ACTIONS(x) (x|AFLAG)
 
-#ifdef DEBUG
 /*
  * symbolic state names
  */
@@ -68,7 +67,6 @@ static const char * const cfm_states[] = {
 static const char * const cfm_events[] = {
NONE,CF_LOOP_A,CF_LOOP_B,CF_JOIN_A,CF_JOIN_B
 } ;
-#endif
 
 /*
  * map from state to downstream port type
@@ -233,7 +231,7 @@ void cfm(struct s_smc *smc, int event)
DB_CFM(CFM : state %s%s,
(smc-mib.fddiSMTCF_State  AFLAG) ? ACTIONS  : ,
cfm_states[smc-mib.fddiSMTCF_State  ~AFLAG]) ;
-   DB_CFM( event %s\n,cfm_events[event],0) ;
+   DB_CFM( event %s\n, cfm_events[event]);
state = smc-mib.fddiSMTCF_State ;
cfm_fsm(smc,event) ;
event = 0 ;
@@ -297,7 +295,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
/* Don't do the WC-Flag changing here */
ACTIONS_DONE() ;
-   DB_CFMN(1,CFM : %s\n,cfm_states[smc-mib.fddiSMTCF_State],0) ;
+   DB_CFMN(1, CFM : %s\n, cfm_states[smc-mib.fddiSMTCF_State]);
break;
case SC0_ISOLATED :
/*SC07*/
@@ -338,7 +336,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
}
ACTIONS_DONE() ;
-   DB_CFMN(1,CFM : %s\n,cfm_states[smc-mib.fddiSMTCF_State],0) ;
+   DB_CFMN(1, CFM : %s\n, cfm_states[smc-mib.fddiSMTCF_State]);
break ;
case SC9_C_WRAP_A :
/*SC10*/
@@ -403,7 +401,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
}
ACTIONS_DONE() ;
-   DB_CFMN(1,CFM : %s\n,cfm_states[smc-mib.fddiSMTCF_State],0) ;
+   DB_CFMN(1, CFM : %s\n, cfm_states[smc-mib.fddiSMTCF_State]);
break ;
case SC10_C_WRAP_B :
/*SC20*/
@@ -448,7 +446,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
smc-r.rm_join = TRUE ;
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
ACTIONS_DONE() ;
-   DB_CFMN(1,CFM : %s\n,cfm_states[smc-mib.fddiSMTCF_State],0) ;
+   DB_CFMN(1, CFM : %s\n, cfm_states[smc-mib.fddiSMTCF_State]);
break ;
case SC4_THRU_A :
/*SC41*/
@@ -481,7 +479,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
smc-r.rm_join = TRUE ;
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
ACTIONS_DONE() ;
-   DB_CFMN(1,CFM : %s\n,cfm_states[smc-mib.fddiSMTCF_State],0) ;
+   DB_CFMN(1, CFM : %s\n, cfm_states[smc-mib.fddiSMTCF_State]);
break ;
case SC5_THRU_B :
/*SC51*/
@@ -519,7 +517,7 @@ static void cfm_fsm(struct s_smc *smc, int cmd)
queue_event(smc,EVENT_RMT,RM_JOIN) ;/* signal RMT */
}
ACTIONS_DONE() ;
-   DB_CFMN(1,CFM : %s\n,cfm_states[smc-mib.fddiSMTCF_State],0) ;
+   DB_CFMN(1, CFM : %s\n, cfm_states[smc-mib.fddiSMTCF_State]);
break ;
case SC11_C_WRAP_S :
/*SC70*/
diff --git a/drivers/net/fddi/skfp/drvfbi.c b/drivers/net/fddi/skfp/drvfbi.c
index 07da97c..6f85461 100644
--- a/drivers/net/fddi/skfp/drvfbi.c
+++ b/drivers/net/fddi/skfp/drvfbi.c
@@ -344,7 +344,7 @@ void init_board(struct s_smc *smc, u_char *mac_addr)
 void sm_pm_bypass_req(struct s_smc *smc, int mode)
 {

Re: [PATCH for-next V7 00/10] Move RoCE GID management to IB/Core

2015-08-02 Thread Matan Barak



On 8/2/2015 12:48 AM, Or Gerlitz wrote:

On Sat, Aug 1, 2015 at 1:01 AM, Jason Gunthorpe
jguntho...@obsidianresearch.com wrote:

On Sat, Aug 01, 2015 at 12:24:23AM +0300, Or Gerlitz wrote:


addressed in incremental patch, as Doug suggested. Jason, it's wrong
to send developers again and again to fix things which were
perfect in Vn-1 but also not being covered by reviewers on Vn-1, at
some point the reviewer can't load new comments which gate the


I don't even know what you are talking about Or.

v6 had some small problems in the logic and v7 introduces a fairly
serious flaw while trying to fix them. IMHO, you are better to merge
v6 than v7, at least v6's problems are less likely to be serious.


Jason, can you be more specific? I don't see any comments from you
expect for the cover-letter, so if something broke out, sure, a fix is
needed, but what is that?


That is the same argument you used for the timestamp _ex UAPI mess,
last cycle, where are the incremental fixes for that?


I remember you have provided review comment which pointed that the
time-stamping series stepped on something which was there before needs
some cleanup, not a real mess to my taste. Matan, do have the plan to
do that work?


Indeed this design flaw was introduced when the first legacy verb was
extended. I think that falling back from extended code to legacy code
should be in the uverbs code. ib_uverbs_write will return -ENOSYS only
if both extended and non-extended don't exist. The uverbs command itself 
will call the non-extended form if the comp_mask is zero and all

data between legacy size and the given size are zero as well.
What do you think?



Or.



Matan
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] virtio_net: add gro capability

2015-08-02 Thread Michael S. Tsirkin
On Fri, Jul 31, 2015 at 04:57:32PM -0700, David Miller wrote:
 From: Eric Dumazet eric.duma...@gmail.com
 Date: Fri, 31 Jul 2015 18:25:17 +0200
 
  From: Eric Dumazet eduma...@google.com
  
  Straightforward patch to add GRO processing to virtio_net.
  
  ...
  Signed-off-by: Eric Dumazet eduma...@google.com
  Tested-by: Rick Jones rick.jon...@hp.com
  Cc: Michael S. Tsirkin m...@redhat.com
 
 Michael, please review :-)

Will do shortly :)
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 11/11] net: rfkill: Allow compile test of GPIO consumers if !GPIOLIB

2015-08-02 Thread Geert Uytterhoeven
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org
Acked-by: Linus Walleij linus.wall...@linaro.org
---
v2:
  - Add Acked-by.
---
 net/rfkill/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/rfkill/Kconfig b/net/rfkill/Kconfig
index 4c10e7e6c9f6ae53..598d374f6a35f714 100644
--- a/net/rfkill/Kconfig
+++ b/net/rfkill/Kconfig
@@ -36,7 +36,8 @@ config RFKILL_REGULATOR
 
 config RFKILL_GPIO
tristate GPIO RFKILL driver
-   depends on RFKILL  GPIOLIB
+   depends on RFKILL
+   depends on GPIOLIB || COMPILE_TEST
default n
help
  If you say yes here you get support of a generic gpio RFKILL
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 04/11] net: phy: Allow compile test of GPIO consumers if !GPIOLIB

2015-08-02 Thread Geert Uytterhoeven
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org
Acked-by: Linus Walleij linus.wall...@linaro.org
---
v2:
  - Add Acked-by.
---
 drivers/net/phy/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 8ef81914422049ff..b98b4a2b8922a912 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -142,7 +142,8 @@ config MDIO_BITBANG
 
 config MDIO_GPIO
tristate Support for GPIO lib-based bitbanged MDIO buses
-   depends on MDIO_BITBANG  GPIOLIB
+   depends on MDIO_BITBANG
+   depends on GPIOLIB || COMPILE_TEST
---help---
  Supports GPIO lib-based MDIO busses.
 
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next] bnx2x: Correct logic for pvid configuration.

2015-08-02 Thread Yuval Mintz
Commit 05cc5a39ddb7 (bnx2x: add vlan filtering offload) has introduced
an incorrect logic for checking whether pvid should be configured for
a vf, causing the hypervisor driver to send unneeded ramrods for all of
the vfs each time a pvid has changed.

Reported-by: Dan Carpenter dan.carpen...@oracle.com
Signed-off-by: Yuval Mintz yuval.mi...@qlogic.com
Signed-off-by: Ariel Elior ariel.el...@qlogic.com
---
Looks like this has been hidden by the fact that
VLAN_VALID == (1  MAC_ADDR_VALID).
Since MAC is almost always set by the hypervisor it simply caused
additional ramrods to be sent instead of preventing the feature.
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c 
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index ec82831..9d02734 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -2528,7 +2528,7 @@ void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp)
DP(BNX2X_MSG_IOV, configuring vlan for VFs from sp-task\n);
for_each_vf(bp, vfidx) {
bulletin = BP_VF_BULLETIN(bp, vfidx);
-   if (bulletin-valid_bitmap  VLAN_VALID)
+   if (bulletin-valid_bitmap  (1  VLAN_VALID))
bnx2x_set_vf_vlan(bp-dev, vfidx, bulletin-vlan, 0);
}
 }
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] MIPS: Remove all the uses of custom gpio.h

2015-08-02 Thread Alban Bedel
Currently CONFIG_ARCH_HAVE_CUSTOM_GPIO_H is defined for all MIPS
machines, and each machine type provides its own gpio.h. However
only a handful really implement the GPIO API, most just forward
everythings to gpiolib.

The Alchemy machine is notable as it provides a system to allow
implementing the GPIO API at the board level. But it is not used by
any board currently supported, so it can also be removed.

For most machine types we can just remove the custom gpio.h, as well
as the custom wrappers if some exists. Some of the code found in
the wrappers must be moved to the respective GPIO driver.

A few more fixes are need in some drivers as they rely on linux/gpio.h
to provides some machine specific definitions, or used asm/gpio.h
instead of linux/gpio.h for the gpio API.

Signed-off-by: Alban Bedel al...@free.fr
---

This patch is based on my previous serie:
MIPS: ath79: Move the GPIO driver to drivers/gpio.

It supercede my previous patch named:
MIPS: Remove most of the custom gpio.h

Changelog:
v2: * Don't remove AR7_GPIO_MAX and TITAN_GPIO_MAX, that's for another
  patch
v1: * Fixed gpio_to_irq on jz4740 and rb532
* Cleaned up alchemy as well
* Removed asm/gpio.h

For testing I tried to build all mips defconfig, however my toolchain
couldn't handle a few configs: ip28 malta_qemu_32r6 maltasmvp_eva
sead3micro. If somebody can test these that would be more than welcome.

Now a few stats about the state of CONFIG_ARCH_HAVE_CUSTOM_GPIO_H
after appling this patch. Of the 31 supportd arch, 15 still have
asm/gpio.h, of these 9 are just a #warning Include linux/gpio.h
instead of asm/gpio.h. So we have 6 arch left: arm, avr32, blackfin,
m68k, sh and unicore32. But only m68k and unicore32 really provides
custom wrappers, all the others only forward to gpiolib.

On the drivers side we only have 13 occurences of '#include
asm/gpio.h' left, mostly in drivers used on ARM SoC.

So the work left to phase out the legacy GPIO is really not that much
anymore.

Alban
---
 arch/mips/Kconfig   |   1 -
 arch/mips/alchemy/Kconfig   |   7 --
 arch/mips/alchemy/board-gpr.c   |   1 +
 arch/mips/alchemy/board-mtx1.c  |   1 +
 arch/mips/alchemy/common/Makefile   |   7 +-
 arch/mips/alchemy/devboards/db1000.c|   1 +
 arch/mips/alchemy/devboards/db1300.c|   1 +
 arch/mips/alchemy/devboards/db1550.c|   1 +
 arch/mips/alchemy/devboards/pm.c|   2 +-
 arch/mips/ar7/gpio.c|   5 +-
 arch/mips/ar7/platform.c|   1 -
 arch/mips/ar7/setup.c   |   1 -
 arch/mips/include/asm/gpio.h|   6 -
 arch/mips/include/asm/mach-ar7/ar7.h|   4 +
 arch/mips/include/asm/mach-ar7/gpio.h   |  41 ---
 arch/mips/include/asm/mach-ath25/gpio.h |  16 ---
 arch/mips/include/asm/mach-ath79/gpio.h |  26 -
 arch/mips/include/asm/mach-au1x00/gpio-au1000.h | 148 ++--
 arch/mips/include/asm/mach-au1x00/gpio.h|  86 --
 arch/mips/include/asm/mach-bcm47xx/gpio.h   |  17 ---
 arch/mips/include/asm/mach-bcm63xx/gpio.h   |  15 ---
 arch/mips/include/asm/mach-cavium-octeon/gpio.h |  21 
 arch/mips/include/asm/mach-generic/gpio.h   |  21 
 arch/mips/include/asm/mach-jz4740/gpio.h|   2 -
 arch/mips/include/asm/mach-lantiq/gpio.h|  13 ---
 arch/mips/include/asm/mach-loongson64/gpio.h|  36 --
 arch/mips/include/asm/mach-pistachio/gpio.h |  21 
 arch/mips/include/asm/mach-rc32434/gpio.h   |  12 --
 arch/mips/jz4740/gpio.c |  20 ++--
 arch/mips/pci/pci-lantiq.c  |   1 -
 arch/mips/rb532/devices.c   |   1 +
 arch/mips/rb532/gpio.c  |   6 +
 arch/mips/txx9/generic/setup.c  |  16 ---
 drivers/ata/pata_rb532_cf.c |   3 +-
 drivers/gpio/gpio-ath79.c   |  32 -
 drivers/input/misc/rb532_button.c   |   1 +
 drivers/net/ethernet/ti/cpmac.c |   2 +
 37 files changed, 45 insertions(+), 551 deletions(-)
 delete mode 100644 arch/mips/include/asm/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-ar7/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-ath25/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-ath79/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-au1x00/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-bcm47xx/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-bcm63xx/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-cavium-octeon/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-generic/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-lantiq/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-loongson64/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-pistachio/gpio.h

diff --git 

[patch net] rocker: free netdevice during netdevice removal

2015-08-02 Thread Jiri Pirko
From: Ido Schimmel ido...@mellanox.com

When removing a port's netdevice in 'rocker_remove_ports', we should
also free the allocated 'net_device' structure. Do that by calling
'free_netdev' after unregistering it.

Signed-off-by: Ido Schimmel ido...@mellanox.com
Signed-off-by: Jiri Pirko j...@resnulli.us
Fixes: 4b8ac9660af (rocker: introduce rocker switch driver)
---
 drivers/net/ethernet/rocker/rocker.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/rocker/rocker.c 
b/drivers/net/ethernet/rocker/rocker.c
index 7b4c347..1d0f140 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4923,6 +4923,7 @@ static void rocker_remove_ports(const struct rocker 
*rocker)
rocker_port_ig_tbl(rocker_port, SWITCHDEV_TRANS_NONE,
   ROCKER_OP_FLAG_REMOVE);
unregister_netdev(rocker_port-dev);
+   free_netdev(rocker_port-dev);
}
kfree(rocker-ports);
 }
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH -4.2] rtlwifi: rtl8723be: Add module parameter for MSI interrupts

2015-08-02 Thread Larry Finger
The driver code allows for the disabling of MSI interrupts; however the
module_parm line was missed and the option fails to show with modinfo.

Signed-off-by: Larry Finger larry.fin...@lwfinger.net
Cc: Stable sta...@vger.kernel.org [3.15+]
---

Kalle,

This one-liner should be applied as soon as possible.

Thanks,

Larry
---
 drivers/net/wireless/rtlwifi/rtl8723be/sw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/sw.c 
b/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
index 1017f02..7bf88d9 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
@@ -385,6 +385,7 @@ module_param_named(debug, rtl8723be_mod_params.debug, int, 
0444);
 module_param_named(ips, rtl8723be_mod_params.inactiveps, bool, 0444);
 module_param_named(swlps, rtl8723be_mod_params.swctrl_lps, bool, 0444);
 module_param_named(fwlps, rtl8723be_mod_params.fwctrl_lps, bool, 0444);
+module_param_named(msi, rtl8723be_mod_params.msi_support, bool, 0444);
 module_param_named(disable_watchdog, rtl8723be_mod_params.disable_watchdog,
   bool, 0444);
 MODULE_PARM_DESC(swenc, Set to 1 for software crypto (default 0)\n);
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch net-next 1/2] rocker: enable support for scattered packets

2015-08-02 Thread Jiri Pirko
From: Ido Schimmel ido...@mellanox.com

rocker supports the transmission of scattered packets, so let the kernel
know about it by setting the NETIF_F_SG bit in the device's features.

Signed-off-by: Ido Schimmel ido...@mellanox.com
Signed-off-by: Jiri Pirko j...@resnulli.us
---
 drivers/net/ethernet/rocker/rocker.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/rocker/rocker.c 
b/drivers/net/ethernet/rocker/rocker.c
index 7b4c347..730bdc0 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4970,7 +4970,7 @@ static int rocker_probe_port(struct rocker *rocker, 
unsigned int port_number)
   NAPI_POLL_WEIGHT);
rocker_carrier_init(rocker_port);
 
-   dev-features |= NETIF_F_NETNS_LOCAL;
+   dev-features |= NETIF_F_NETNS_LOCAL | NETIF_F_SG;
 
err = register_netdev(dev);
if (err) {
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch net-next 2/2] rocker: linearize skb in case frags would not fit into tx descriptor

2015-08-02 Thread Jiri Pirko
Suggested-by: Scott Feldman sfel...@gmail.com
Signed-off-by: Jiri Pirko j...@resnulli.us
---
 drivers/net/ethernet/rocker/rocker.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/rocker/rocker.c 
b/drivers/net/ethernet/rocker/rocker.c
index 730bdc0..4cd5a71 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4157,8 +4157,11 @@ static netdev_tx_t rocker_port_xmit(struct sk_buff *skb, 
struct net_device *dev)
  skb-data, skb_headlen(skb));
if (err)
goto nest_cancel;
-   if (skb_shinfo(skb)-nr_frags  ROCKER_TX_FRAGS_MAX)
-   goto nest_cancel;
+   if (skb_shinfo(skb)-nr_frags  ROCKER_TX_FRAGS_MAX) {
+   err = skb_linearize(skb);
+   if (err)
+   goto unmap_frags;
+   }
 
for (i = 0; i  skb_shinfo(skb)-nr_frags; i++) {
const skb_frag_t *frag = skb_shinfo(skb)-frags[i];
-- 
1.9.3

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch net] rocker: free netdevice during netdevice removal

2015-08-02 Thread Scott Feldman
On Sun, Aug 2, 2015 at 10:29 AM, Jiri Pirko j...@resnulli.us wrote:
 From: Ido Schimmel ido...@mellanox.com

 When removing a port's netdevice in 'rocker_remove_ports', we should
 also free the allocated 'net_device' structure. Do that by calling
 'free_netdev' after unregistering it.

 Signed-off-by: Ido Schimmel ido...@mellanox.com
 Signed-off-by: Jiri Pirko j...@resnulli.us
 Fixes: 4b8ac9660af (rocker: introduce rocker switch driver)

Acked-by: Scott Feldman sfel...@gmail.com
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: Panic with demuxed ipv4 multicast udp sockets on 4.0.4

2015-08-02 Thread Gregory Hoggarth
Hi Eric,

The previous fix, which included the change to __udp4_lib_rcv did not fix the 
issue. The reproduction rate may perhaps have been slightly lower with that fix 
in place, hard to tell as our automated tests unfortunately failed after 600 
runs due to another issue and didn't automatically resume themselves (3 kernel 
crash observed, so 1/200 instead of previous 1/100).

I will apply the new suggested patch, reverting previous patch, and test 
overnight and update tomorrow.

Thanks,
Greg


From: Eric Dumazet eric.duma...@gmail.com
Sent: Friday, 31 July 2015 11:17 p.m.
To: Gregory Hoggarth
Cc: Shawn Bohrer; netdev@vger.kernel.org; alexgartr...@gmail.com
Subject: Re: Panic with demuxed ipv4 multicast udp sockets on 4.0.4

On Fri, 2015-07-31 at 12:17 +0200, Eric Dumazet wrote:
 On Thu, 2015-07-30 at 22:29 +, Gregory Hoggarth wrote:
  Hi Eric,
 
  Thanks for the patch. I have put this into our code and we'll run our test 
  over tonight and the weekend and report back on Monday.
 
  Thanks,

 Oh well, real fix will be :

 (Or at least test if DST_NOCACHE is set : those dst need special care)

Here is a more complete patch, not destroying performance of unicast
UDP.

Please guys test it, I am confident it should solve your problems.

Thanks

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 83aa604f9273..1b8c5ba7d5f7 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1995,12 +1995,19 @@ void udp_v4_early_demux(struct sk_buff *skb)

skb-sk = sk;
skb-destructor = sock_efree;
-   dst = sk-sk_rx_dst;
+   dst = READ_ONCE(sk-sk_rx_dst);

if (dst)
dst = dst_check(dst, 0);
-   if (dst)
-   skb_dst_set_noref(skb, dst);
+   if (dst) {
+   /* DST_NOCACHE can not be used without taking a reference */
+   if (dst-flags  DST_NOCACHE) {
+   if (likely(atomic_inc_not_zero(dst-__refcnt)))
+   skb_dst_set(skb, dst);
+   } else {
+   skb_dst_set_noref(skb, dst);
+   }
+   }
 }

 int udp_rcv(struct sk_buff *skb)

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Patch net] fq_codel: explicitly reset flows in -reset()

2015-08-02 Thread David Miller
From: Cong Wang xiyou.wangc...@gmail.com
Date: Fri, 31 Jul 2015 17:53:39 -0700

 From: Eric Dumazet eric.duma...@gmail.com
 
 Alex reported the following crash when using fq_codel
 with htb:
 ...
 As Jamal pointed out, there is actually no need to call dequeue
 to purge the queued skb's in reset, data structures can be just
 reset explicitly. Therefore, we reset everything except config's
 and stats, so that we would have a fresh start after device flipping.
 
 Fixes: 4b549a2ef4be (fq_codel: Fair Queue Codel AQM)
 Reported-by: Alex Gartrell agartr...@fb.com
 Cc: Alex Gartrell agartr...@fb.com
 Cc: Jamal Hadi Salim j...@mojatatu.com
 Signed-off-by: Eric Dumazet eric.duma...@gmail.com
 [xiyou.wangc...@gmail.com: added codel_vars_init() and 
 qdisc_qstats_backlog_dec()]
 Signed-off-by: Cong Wang xiyou.wangc...@gmail.com

Applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] bnx2x: Correct logic for pvid configuration.

2015-08-02 Thread David Miller
From: Yuval Mintz yuval.mi...@qlogic.com
Date: Sun, 2 Aug 2015 12:42:41 +0300

 Commit 05cc5a39ddb7 (bnx2x: add vlan filtering offload) has introduced
 an incorrect logic for checking whether pvid should be configured for
 a vf, causing the hypervisor driver to send unneeded ramrods for all of
 the vfs each time a pvid has changed.
 
 Reported-by: Dan Carpenter dan.carpen...@oracle.com
 Signed-off-by: Yuval Mintz yuval.mi...@qlogic.com
 Signed-off-by: Ariel Elior ariel.el...@qlogic.com
 ---
 Looks like this has been hidden by the fact that
 VLAN_VALID == (1  MAC_ADDR_VALID).
 Since MAC is almost always set by the hypervisor it simply caused
 additional ramrods to be sent instead of preventing the feature.

Applied, thank you.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] ebpf: add skb-hash to offset map for usage in {cls,act}_bpf or filters

2015-08-02 Thread David Miller
From: Daniel Borkmann dan...@iogearbox.net
Date: Sat,  1 Aug 2015 00:46:29 +0200

 Add skb-hash to the __sk_buff offset map, so it can be accessed from
 an eBPF program. We currently already do this for classic BPF filters,
 but not yet on eBPF, it might be useful as a demuxer in combination with
 helpers like bpf_clone_redirect(), toy example:
 
   __section(cls-lb) int ingress_main(struct __sk_buff *skb)
   {
 unsigned int which = 3 + (skb-hash  7);
 /* bpf_skb_store_bytes(skb, ...); */
 /* bpf_l{3,4}_csum_replace(skb, ...); */
 bpf_clone_redirect(skb, which, 0);
 return -1;
   }
 
 I was thinking whether to add skb_get_hash(), but then concluded the
 raw skb-hash seems fine in this case: we can directly access the hash
 w/o extra eBPF helper function call, it's filled out by many NICs on
 ingress, and in case the entropy level would not be sufficient, people
 can still implement their own specific sw fallback hash mix anyway.
 
 Signed-off-by: Daniel Borkmann dan...@iogearbox.net
 Acked-by: Alexei Starovoitov a...@plumgrid.com

Applied, thanks Daniel.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] e100: Release skb when DMA mapping is failed in e100_xmit_prepare

2015-08-02 Thread Jia-Ju Bai
When pci_dma_mapping_error in e100_xmit_prepare is failed, the skb buffer
allocated by netdev_alloc_skb_ip_align in e100_rx_alloc_skb is not
released, which causes a possible resource leak.
This patch adds error handling code to fix it.

Signed-off-by: Jia-Ju Bai baijiaju1...@163.com
---
 drivers/net/ethernet/intel/e100.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e100.c 
b/drivers/net/ethernet/intel/e100.c
index d2657a4..cc90616 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -1770,8 +1770,11 @@ static int e100_xmit_prepare(struct nic *nic, struct cb 
*cb,
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))
+   if (pci_dma_mapping_error(nic-pdev, dma_addr)) {
+   dev_kfree_skb_any(skb);
+   skb = NULL;
return -ENOMEM;
+   }
 
/*
 * Use the last 4 bytes of the SKB payload packet as the CRC, used for
-- 
1.7.9.5


--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch net] rocker: free netdevice during netdevice removal

2015-08-02 Thread David Miller
From: Jiri Pirko j...@resnulli.us
Date: Sun,  2 Aug 2015 19:29:16 +0200

 From: Ido Schimmel ido...@mellanox.com
 
 When removing a port's netdevice in 'rocker_remove_ports', we should
 also free the allocated 'net_device' structure. Do that by calling
 'free_netdev' after unregistering it.
 
 Signed-off-by: Ido Schimmel ido...@mellanox.com
 Signed-off-by: Jiri Pirko j...@resnulli.us
 Fixes: 4b8ac9660af (rocker: introduce rocker switch driver)

Applied and queued up for -stable, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] ebpf: add skb-hash to offset map for usage in {cls,act}_bpf or filters

2015-08-02 Thread Tom Herbert
On Fri, Jul 31, 2015 at 3:46 PM, Daniel Borkmann dan...@iogearbox.net wrote:
 Add skb-hash to the __sk_buff offset map, so it can be accessed from
 an eBPF program. We currently already do this for classic BPF filters,
 but not yet on eBPF, it might be useful as a demuxer in combination with
 helpers like bpf_clone_redirect(), toy example:

   __section(cls-lb) int ingress_main(struct __sk_buff *skb)
   {
 unsigned int which = 3 + (skb-hash  7);
 /* bpf_skb_store_bytes(skb, ...); */
 /* bpf_l{3,4}_csum_replace(skb, ...); */
 bpf_clone_redirect(skb, which, 0);
 return -1;
   }

 I was thinking whether to add skb_get_hash(), but then concluded the
 raw skb-hash seems fine in this case: we can directly access the hash
 w/o extra eBPF helper function call, it's filled out by many NICs on
 ingress, and in case the entropy level would not be sufficient, people
 can still implement their own specific sw fallback hash mix anyway.

Maybe we should add the skb_get_hash also? It doesn't as useful if
some scenarios we get a valid hash and in others not.

Tom

 Signed-off-by: Daniel Borkmann dan...@iogearbox.net
 Acked-by: Alexei Starovoitov a...@plumgrid.com
 ---
  include/uapi/linux/bpf.h | 1 +
  net/core/filter.c| 7 +++
  2 files changed, 8 insertions(+)

 diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
 index bc0d27d..2ce13c1 100644
 --- a/include/uapi/linux/bpf.h
 +++ b/include/uapi/linux/bpf.h
 @@ -290,6 +290,7 @@ struct __sk_buff {
 __u32 ifindex;
 __u32 tc_index;
 __u32 cb[5];
 +   __u32 hash;
  };

  struct bpf_tunnel_key {
 diff --git a/net/core/filter.c b/net/core/filter.c
 index 1b72264..a50dbfa 100644
 --- a/net/core/filter.c
 +++ b/net/core/filter.c
 @@ -1711,6 +1711,13 @@ static u32 bpf_net_convert_ctx_access(enum 
 bpf_access_type type, int dst_reg,
   offsetof(struct net_device, ifindex));
 break;

 +   case offsetof(struct __sk_buff, hash):
 +   BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4);
 +
 +   *insn++ = BPF_LDX_MEM(BPF_W, dst_reg, src_reg,
 + offsetof(struct sk_buff, hash));
 +   break;
 +
 case offsetof(struct __sk_buff, mark):
 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, mark) != 4);

 --
 1.9.3

 --
 To unsubscribe from this list: send the line unsubscribe netdev in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] net: dsa: fix EDSA frame from hwaccel frame

2015-08-02 Thread Vivien Didelot
If the underlying network device features NETIF_F_HW_VLAN_CTAG_TX,
an EDSA frame is prepended with a 802.1q header once queued.

To fix this, push the VLAN tag to the payload if present, before
checking the frame protocol.

[note: we may prefer to access directly VLAN TCI from hwaccel frames,
but this approach is simpler.]

Signed-off-by: Vivien Didelot vivien.dide...@savoirfairelinux.com
---
 net/dsa/tag_edsa.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c
index 2288c80..3ada4eb 100644
--- a/net/dsa/tag_edsa.c
+++ b/net/dsa/tag_edsa.c
@@ -9,6 +9,7 @@
  */
 
 #include linux/etherdevice.h
+#include linux/if_vlan.h
 #include linux/list.h
 #include linux/slab.h
 #include dsa_priv.h
@@ -21,6 +22,10 @@ static struct sk_buff *edsa_xmit(struct sk_buff *skb, struct 
net_device *dev)
struct dsa_slave_priv *p = netdev_priv(dev);
u8 *edsa_header;
 
+   skb = vlan_hwaccel_push_inside(skb);
+   if (unlikely(!skb))
+   return NULL;
+
/*
 * Convert the outermost 802.1q tag to a DSA tag and prepend
 * a DSA ethertype field is the packet is tagged, or insert
-- 
2.4.6

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] e100: Add a check after pci_pool_create to avoid null pointer dereference

2015-08-02 Thread Jia-Ju Bai
The driver lacks the check of nic-cbs_pool after pci_pool_create
in e100_probe. When this function is failed, a null pointer dereference 
occurs when pci_pool_alloc uses nic-cbs_pool in e100_alloc_cbs.
This patch adds a check and related error handling code to fix it.

Signed-off-by: Jia-Ju Bai baijiaju1...@163.com
---
 drivers/net/ethernet/intel/e100.c |7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/intel/e100.c 
b/drivers/net/ethernet/intel/e100.c
index d2657a4..767c161 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -2967,6 +2967,11 @@ static int e100_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
   nic-params.cbs.max * sizeof(struct cb),
   sizeof(u32),
   0);
+   if (!nic-cbs_pool) {
+   netif_err(nic, probe, nic-netdev, Cannot create DMA pool, 
aborting\n);
+   err = -ENOMEM;
+   goto err_out_pool;
+   }
netif_info(nic, probe, nic-netdev,
   addr 0x%llx, irq %d, MAC addr %pM\n,
   (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0),
@@ -2974,6 +2979,8 @@ static int e100_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
 
return 0;
 
+err_out_pool:
+   unregister_netdev(netdev);
 err_out_free:
e100_free(nic);
 err_out_iounmap:
-- 
1.7.9.5


--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Kernel Oops in __inet_twsk_kill()

2015-08-02 Thread charley
Phani pgargey at yahoo.com writes:

 
 
  
   The problem has been fixed. It is introduced by a third party patch,
   which decreases the refcnt of timewait socket.
 
 
 What is the fix?
 pl share the gerrit.
 
 

Here you go.

https://android.googlesource.com/kernel/common/+/android-
3.14/net/netfilter/xt_qtaguid.c


diff --git a/net/netfilter/xt_qtaguid.c b/net/netfilter/xt_qtaguid.c
--- a/net/netfilter/xt_qtaguid.c
+++ b/net/netfilter/xt_qtaguid.c
@@ -1605,7 +1605,8 @@ static struct sock 
*qtaguid_find_sk(const struct sk_buff *skb,
 * struct inet_timewait_sock which is missing fields.
 */
if (sk-sk_state  == TCP_TIME_WAIT) {
-   sock_gen_put(sk);
+  if (sk != skb-sk)
+   sock_gen_put(sk);
sk = NULL;
}
}

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html