Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 0/1] mv643xx_eth: Disable TSO by default
From: Eric Dumazet @ 2014-11-01 17:26 UTC (permalink / raw)
  To: Ezequiel Garcia
  Cc: netdev, David Miller, Thomas Petazzoni, Gregory Clement,
	Tawfik Bayouk, Lior Amsalem, Nadav Haklai
In-Reply-To: <1414855820-15094-1-git-send-email-ezequiel.garcia@free-electrons.com>

On Sat, 2014-11-01 at 12:30 -0300, Ezequiel Garcia wrote:
> Several users ([1], [2]) have been reporting data corruption with TSO on
> Kirkwood platforms (i.e. using the mv643xx_eth driver).
> 
> Until we manage to find what's causing this, this simple patch will make
> the TSO path disabled by default. This patch should be queued for stable,
> fixing the TSO feature introduced in v3.16.
> 
> The corruption itself is very easy to reproduce: checking md5sum on a mounted
> NFS directory gives a different result each time. Same tests using the mvneta
> driver (Armada 370/38x/XP SoC) pass with no issues.
> 
> Frankly, I'm a bit puzzled about this, and so any ideas or debugging hints
> are well received.

lack of barriers maybe ?

It seems you might need to populate all TX descriptors but delay the
first, like doing the populate in descending order.

If you take a look at txq_submit_skb(), you'll see the final
desc->cmd_sts = cmd_sts (line 959) is done _after_ frags were cooked by
txq_submit_frag_skb()

You should kick the nick only when all TX descriptors are ready and
committed to memory.

^ permalink raw reply

* Re: [stable request <= 3.11] net/mlx4_en: Fix BlueFlame race
From: Cong Wang @ 2014-11-01 17:17 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Vinson Lee, David S. Miller, Amir Vadai, Or Gerlitz,
	Jack Morgenstein, Eugenia Emantayev, Matan Barak, netdev
In-Reply-To: <1414805353.16849.98.camel@decadent.org.uk>

On Fri, Oct 31, 2014 at 6:29 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> On Sat, 2014-10-18 at 14:14 -0700, Vinson Lee wrote:
>> Hi.
>>
>> Please consider backporting upstream commit
>> 2d4b646613d6b12175b017aca18113945af1faf3 "net/mlx4_en: Fix BlueFlame
>> race" to stable kernels <= 3.11.
>>
>> commit 2d4b646613d6b12175b017aca18113945af1faf3
>> Author: Eugenia Emantayev <eugenia@mellanox.com>
>> Date:   Thu Jul 25 19:21:23 2013 +0300
>>
>>     net/mlx4_en: Fix BlueFlame race
> [...]
>
> David doesn't support anything older than 3.12 now, so you should send
> requests for older stable branches directly to the stable list.

Interesting, is there a document saying which stable kernels netdev
supports? and how are they chosen?

I thought netdev supports all -stable maintainers support.

Anyway, we will send the request directly to Greg then.

Thanks.

^ permalink raw reply

* Re: [PATCH 1/1] net: mv643xx_eth: Make TSO disabled by default
From: Thomas Petazzoni @ 2014-11-01 17:00 UTC (permalink / raw)
  To: Ezequiel Garcia
  Cc: netdev, David Miller, Gregory Clement, Tawfik Bayouk,
	Lior Amsalem, Nadav Haklai
In-Reply-To: <1414855820-15094-2-git-send-email-ezequiel.garcia@free-electrons.com>

Dear Ezequiel Garcia,

On Sat,  1 Nov 2014 12:30:20 -0300, Ezequiel Garcia wrote:
> Data corruption has been observed to be produced by TSO. For instance,
> accessing files on a NFS-server with TSO enabled results in different data
> transferred each time.
> 
> This has been observed only on Kirkwood platforms, i.e. with the mv643xx_eth
> driver. Same tests on platforms using the mvneta ethernet driver have
> passed without errors.
> 
> Make TSO disabled by default for now, until we can found a proper fix
> for the regression.
> 
> Fixes: 3ae8f4e0b98 ('net: mv643xx_eth: Implement software TSO')
> Reported-by: Slawomir Gajzner <slawomir.gajzner@gmail.com>
> Reported-by: Julien D'Ascenzio <jdascenzio@yahoo.fr>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>

Shouldn't you have a:

   Cc: <stable@vger.kernel.org> # v3.16+

here ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply

* DONATION!!!
From: Mrs Birgit Rausing @ 2014-10-30 21:28 UTC (permalink / raw)





I,Birgit authenticate this email, you can read about me on:
http://en.wikipedia.org/wiki/Birgit_Rausing
I have funds for you to manage and disburse to various charities of your
choice. If you are sure you can handle this, it will be of help to you and
others. Please reply if you are interested  for more details.please
Contact my private  email;( mrs_BirgitRausin0@qq.com ) for more
information

With love,
Mrs Birgit Rausing

^ permalink raw reply

* Re: [PATCH v2] PPC: bpf_jit_comp: add SKF_AD_PKTTYPE instruction
From: Denis Kirjanov @ 2014-11-01 16:19 UTC (permalink / raw)
  To: Denis Kirjanov
  Cc: Alexei Starovoitov, netdev@vger.kernel.org, linuxppc-dev,
	Michael Ellerman, Matt Evans
In-Reply-To: <CAHj3AVkpouHa1y0jt9c5dyYvnd6dctociTMW1ORdxaKdsFEbhQ@mail.gmail.com>

ping

On 10/31/14, Denis Kirjanov <kirjanov@gmail.com> wrote:
> On 10/30/14, Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
>> On Wed, Oct 29, 2014 at 11:12 PM, Denis Kirjanov <kda@linux-powerpc.org>
>> wrote:
>>> Add BPF extension SKF_AD_PKTTYPE to ppc JIT to load
>>> skb->pkt_type field.
>>>
>>> Before:
>>> [   88.262622] test_bpf: #11 LD_IND_NET 86 97 99 PASS
>>> [   88.265740] test_bpf: #12 LD_PKTTYPE 109 107 PASS
>>>
>>> After:
>>> [   80.605964] test_bpf: #11 LD_IND_NET 44 40 39 PASS
>>> [   80.607370] test_bpf: #12 LD_PKTTYPE 9 9 PASS
>>
>> if you'd only quoted #12, it would all make sense ;)
>> but #11 test is not using PKTTYPE. So your patch shouldn't
>> make a difference. Are these numbers with JIT on and off?
>
> Right.
>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
>
> --
> Regards,
> Denis
>

^ permalink raw reply

* [PATCH 1/1] net: mv643xx_eth: Make TSO disabled by default
From: Ezequiel Garcia @ 2014-11-01 15:30 UTC (permalink / raw)
  To: netdev, David Miller
  Cc: Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
	Nadav Haklai, Ezequiel Garcia
In-Reply-To: <1414855820-15094-1-git-send-email-ezequiel.garcia@free-electrons.com>

Data corruption has been observed to be produced by TSO. For instance,
accessing files on a NFS-server with TSO enabled results in different data
transferred each time.

This has been observed only on Kirkwood platforms, i.e. with the mv643xx_eth
driver. Same tests on platforms using the mvneta ethernet driver have
passed without errors.

Make TSO disabled by default for now, until we can found a proper fix
for the regression.

Fixes: 3ae8f4e0b98 ('net: mv643xx_eth: Implement software TSO')
Reported-by: Slawomir Gajzner <slawomir.gajzner@gmail.com>
Reported-by: Julien D'Ascenzio <jdascenzio@yahoo.fr>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
 drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index b151a94..8b72780 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -3110,11 +3110,11 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 	dev->watchdog_timeo = 2 * HZ;
 	dev->base_addr = 0;
 
-	dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
+	dev->features = NETIF_F_SG | NETIF_F_IP_CSUM;
 	dev->vlan_features = dev->features;
 
 	dev->features |= NETIF_F_RXCSUM;
-	dev->hw_features = dev->features;
+	dev->hw_features = dev->features  | NETIF_F_TSO;
 
 	dev->priv_flags |= IFF_UNICAST_FLT;
 	dev->gso_max_segs = MV643XX_MAX_TSO_SEGS;
-- 
2.1.0

^ permalink raw reply related

* [PATCH 0/1] mv643xx_eth: Disable TSO by default
From: Ezequiel Garcia @ 2014-11-01 15:30 UTC (permalink / raw)
  To: netdev, David Miller
  Cc: Thomas Petazzoni, Gregory Clement, Tawfik Bayouk, Lior Amsalem,
	Nadav Haklai, Ezequiel Garcia

Several users ([1], [2]) have been reporting data corruption with TSO on
Kirkwood platforms (i.e. using the mv643xx_eth driver).

Until we manage to find what's causing this, this simple patch will make
the TSO path disabled by default. This patch should be queued for stable,
fixing the TSO feature introduced in v3.16.

The corruption itself is very easy to reproduce: checking md5sum on a mounted
NFS directory gives a different result each time. Same tests using the mvneta
driver (Armada 370/38x/XP SoC) pass with no issues.

Frankly, I'm a bit puzzled about this, and so any ideas or debugging hints
are well received.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764162
[2] http://archlinuxarm.org/forum/viewtopic.php?f=9&t=7692

Ezequiel Garcia (1):
  net: mv643xx_eth: Make TSO disabled by default

 drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.1.0

^ permalink raw reply

* [PATCH]  net: mvpp2: fix possible memory leak
From: Sudip Mukherjee @ 2014-11-01 11:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: Sudip Mukherjee, netdev, linux-kernel

we are allocating memory using kzalloc for struct mvpp2_prs_entry,
but later when we are getting error we were just returning the error
value without releasing the memory.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

hi,
i could not build test after modifying it. I tried to compile using
multi_v7_defconfig , but the cross compiler i have is not able to
compile it and giving sevaral warnings from the assembler.

 drivers/net/ethernet/marvell/mvpp2.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index ece83f1..c4382b3 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -1692,6 +1692,7 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai,
 {
 	struct mvpp2_prs_entry *pe;
 	int tid_aux, tid;
+	int ret = 0;
 
 	pe = mvpp2_prs_vlan_find(priv, tpid, ai);
 
@@ -1723,8 +1724,10 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai,
 				break;
 		}
 
-		if (tid <= tid_aux)
-			return -EINVAL;
+		if (tid <= tid_aux) {
+			ret = -EINVAL;
+			goto error;
+		}
 
 		memset(pe, 0 , sizeof(struct mvpp2_prs_entry));
 		mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN);
@@ -1756,9 +1759,10 @@ static int mvpp2_prs_vlan_add(struct mvpp2 *priv, unsigned short tpid, int ai,
 
 	mvpp2_prs_hw_write(priv, pe);
 
+error:
 	kfree(pe);
 
-	return 0;
+	return ret;
 }
 
 /* Get first free double vlan ai number */
@@ -1821,7 +1825,7 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
 				     unsigned int port_map)
 {
 	struct mvpp2_prs_entry *pe;
-	int tid_aux, tid, ai;
+	int tid_aux, tid, ai, ret = 0;
 
 	pe = mvpp2_prs_double_vlan_find(priv, tpid1, tpid2);
 
@@ -1838,8 +1842,10 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
 
 		/* Set ai value for new double vlan entry */
 		ai = mvpp2_prs_double_vlan_ai_free_get(priv);
-		if (ai < 0)
-			return ai;
+		if (ai < 0) {
+			ret = ai;
+			goto error;
+		}
 
 		/* Get first single/triple vlan tid */
 		for (tid_aux = MVPP2_PE_FIRST_FREE_TID;
@@ -1859,8 +1865,10 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
 				break;
 		}
 
-		if (tid >= tid_aux)
-			return -ERANGE;
+		if (tid >= tid_aux) {
+			ret = -ERANGE;
+			goto error;
+		}
 
 		memset(pe, 0, sizeof(struct mvpp2_prs_entry));
 		mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_VLAN);
@@ -1887,8 +1895,9 @@ static int mvpp2_prs_double_vlan_add(struct mvpp2 *priv, unsigned short tpid1,
 	mvpp2_prs_tcam_port_map_set(pe, port_map);
 	mvpp2_prs_hw_write(priv, pe);
 
+error:
 	kfree(pe);
-	return 0;
+	return ret;
 }
 
 /* IPv4 header parsing for fragmentation and L4 offset */
-- 
1.8.1.2

^ permalink raw reply related

* RE: suspend/resume broken on 3.18-rc2
From: fugang.duan @ 2014-11-01  7:25 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Anson.Huang@freescale.com, Frank.Li@freescale.com, Russell King,
	Shawn Guo, netdev@vger.kernel.org
In-Reply-To: <CAOMZO5AeBSusV=xHgy8KJOb9po9WbS=DkaKXnS8iOpW8t-Y_Fw@mail.gmail.com>

From: Fabio Estevam <festevam@gmail.com> Sent: Saturday, November 01, 2014 3:36 AM
>To: Duan Fugang-B38611
>Cc: Huang Yongcai-B20788; Li Frank-B20596; Russell King; Shawn Guo;
>netdev@vger.kernel.org
>Subject: Re: suspend/resume broken on 3.18-rc2
>
>Andy,
>
>On Thu, Oct 30, 2014 at 1:11 AM, fugang.duan@freescale.com
><fugang.duan@freescale.com> wrote:
>
>> I tried it yesterday with FEC close, resume cannot back.
>> I will try it again.
>
>We have a regression in 3.18-rc1: if I use the imx6sx-sdb.dtb from
>3.17.1 then I get:
>
>root@freescale /$ echo enabled > /sys/class/tty/ttymxc0/power/wakeup
>root@freescale /$ echo mem > /sys/power/state
>[   13.883094] PM: Syncing filesystems ... done.
>[   13.932184] Freezing user space processes ... (elapsed 0.003 seconds)
>done.
>[   13.942928] Freezing remaining freezable tasks ... (elapsed 0.003
>seconds) d.
>[   14.014823] PM: suspend of devices complete after 54.572 msecs
>[   14.020730] PM: suspend devices took 0.060 seconds
>[   14.035241] PM: late suspend of devices complete after 9.545 msecs
>[   14.050901] PM: noirq suspend of devices complete after 9.383 msecs
>[   14.057626] Disabling non-boot CPUs ...
>[   14.071514] PM: noirq resume of devices complete after 8.338 msecs
>[   14.085645] PM: early resume of devices complete after 6.417 msecs
>[   14.097720] fec 2188000.ethernet eth0: rcv is not +last
>[   14.187491] PM: resume of devices complete after 95.494 msecs
>[   14.199039] PM: resume devices took 0.100 seconds
>[   14.203831] Restarting tasks ... done.
>[   15.892318] fec 2188000.ethernet eth0: rcv is not +last
>[   15.897688] fec 2188000.ethernet eth0: rcv is not +last
>[   15.903010] fec 2188000.ethernet eth0: rcv is not +last
>[   15.908326] fec 2188000.ethernet eth0: rcv is not +last
>[   15.913635] fec 2188000.ethernet eth0: rcv is not +last
>[   15.918945] fec 2188000.ethernet eth0: rcv is not +last
>
>So fec suspend/resume is broken for mx6sx.
>
>Please take a look at it.
Hi, Fabio,

Thanks, I will fix it.

Regards,
Andy

^ permalink raw reply

* Re: DMA-API warning from sunhme - unchecked dma_map_single error
From: David Miller @ 2014-11-01  4:24 UTC (permalink / raw)
  To: mroos; +Cc: netdev, sparclinux
In-Reply-To: <alpine.DEB.2.03.1410312258170.17220@cyber.ee>

From: Meelis Roos <mroos@linux.ee>
Date: Fri, 31 Oct 2014 23:01:09 +0200 (EET)

>>> It seems to be correct warning - dma_map_single is used unchecked in
>>> sunhme.c. I can try fixing it - the error handling will be the only
>>> problem. Is it considered worthwile?
>>
>> Can you test this patch?
> 
> It works fine on E3500 where I had many debugging options on and
> caught it. No warnings, network still works.

Thanks for testing, I'll push this to Linus and -stable soon.

^ permalink raw reply

* Re: [PATCH] drivers: net: ethernet: xilinx: xilinx_emaclite: Compatible with 'xlnx,xps-ethernetlite-2.00.b' for QEMU using
From: Chen Gang @ 2014-11-01  3:59 UTC (permalink / raw)
  To: michal.simek, soren.brinkmann
  Cc: davem, sthokal, manuel.schoelling, paul.gortmaker, f.fainelli,
	ebiederm, netdev, linux-arm-kernel, linux-kernel@vger.kernel.org
In-Reply-To: <54544E98.4060007@gmail.com>

On 11/1/14 11:08, Chen Gang wrote:
> When use current latest upstream qemu (current version: 2.1.2), need let
> driver compatible with 'xlnx,xps-ethernetlite-2.00.b', or can not find
> net device in microblaze qemu. Related QEMU commands under fedora 20:
> 
>   yum install libvirt
>   yum install tunctl
>   tunctl -b
>   ip link set tap0 up
>   brctl addif virbr0 tap0
>   ./microblaze-softmmu/qemu-system-microblaze -M petalogix-s3adsp1800 \
>     -kernel ../linux-stable.microblaze/arch/microblaze/boot/linux.bin \
>     -no-reboot -append "console=ttyUL0,115200 doreboot" -nographic \
>     -net nic,vlan=0,model=xlnx.xps-ethernetlite,macaddr=00:16:35:AF:94:00 \
>     -net tap,vlan=0,ifname=tap0,script=no,downscript=no
> 
>   in microblaze qemu bash (guest machine):
> 
>     ifconfig eth0 add 192.168.122.1 netmask 255.255.255.0

Oh, sorry, it is 192.168.122.2 (192.168.122.1 is the router address).

Thanks.

>     ifconfig eth0 up
> 
> After add this patch, can find the device, and can be used by 'telnetd'
> (need cross-build busybox with glibc for it), then outside can telnet to
> it without password.
> 
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>  drivers/net/ethernet/xilinx/xilinx_emaclite.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> index 28dbbdc..298fad3 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> @@ -1236,6 +1236,7 @@ static struct of_device_id xemaclite_of_match[] = {
>  	{ .compatible = "xlnx,opb-ethernetlite-1.01.b", },
>  	{ .compatible = "xlnx,xps-ethernetlite-1.00.a", },
>  	{ .compatible = "xlnx,xps-ethernetlite-2.00.a", },
> +	{ .compatible = "xlnx,xps-ethernetlite-2.00.b", },
>  	{ .compatible = "xlnx,xps-ethernetlite-2.01.a", },
>  	{ .compatible = "xlnx,xps-ethernetlite-3.00.a", },
>  	{ /* end of list */ },
> 

-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

^ permalink raw reply

* [PATCH] drivers: net: ethernet: xilinx: xilinx_emaclite: Compatible with 'xlnx,xps-ethernetlite-2.00.b' for QEMU using
From: Chen Gang @ 2014-11-01  3:08 UTC (permalink / raw)
  To: michal.simek, soren.brinkmann
  Cc: davem, sthokal, manuel.schoelling, paul.gortmaker, f.fainelli,
	ebiederm, netdev, linux-arm-kernel, linux-kernel@vger.kernel.org

When use current latest upstream qemu (current version: 2.1.2), need let
driver compatible with 'xlnx,xps-ethernetlite-2.00.b', or can not find
net device in microblaze qemu. Related QEMU commands under fedora 20:

  yum install libvirt
  yum install tunctl
  tunctl -b
  ip link set tap0 up
  brctl addif virbr0 tap0
  ./microblaze-softmmu/qemu-system-microblaze -M petalogix-s3adsp1800 \
    -kernel ../linux-stable.microblaze/arch/microblaze/boot/linux.bin \
    -no-reboot -append "console=ttyUL0,115200 doreboot" -nographic \
    -net nic,vlan=0,model=xlnx.xps-ethernetlite,macaddr=00:16:35:AF:94:00 \
    -net tap,vlan=0,ifname=tap0,script=no,downscript=no

  in microblaze qemu bash (guest machine):

    ifconfig eth0 add 192.168.122.1 netmask 255.255.255.0
    ifconfig eth0 up

After add this patch, can find the device, and can be used by 'telnetd'
(need cross-build busybox with glibc for it), then outside can telnet to
it without password.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 drivers/net/ethernet/xilinx/xilinx_emaclite.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 28dbbdc..298fad3 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -1236,6 +1236,7 @@ static struct of_device_id xemaclite_of_match[] = {
 	{ .compatible = "xlnx,opb-ethernetlite-1.01.b", },
 	{ .compatible = "xlnx,xps-ethernetlite-1.00.a", },
 	{ .compatible = "xlnx,xps-ethernetlite-2.00.a", },
+	{ .compatible = "xlnx,xps-ethernetlite-2.00.b", },
 	{ .compatible = "xlnx,xps-ethernetlite-2.01.a", },
 	{ .compatible = "xlnx,xps-ethernetlite-3.00.a", },
 	{ /* end of list */ },
-- 
1.9.3

^ permalink raw reply related

* Re: [PATCH] net: fix saving TX flow hash in sock for outgoing connections
From: Ben Hutchings @ 2014-11-01  1:30 UTC (permalink / raw)
  To: David Miller; +Cc: eric.dumazet, Sathya.Perla, netdev, therbert
In-Reply-To: <20141022.161402.119032019463935567.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 1442 bytes --]

On Wed, 2014-10-22 at 16:14 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 22 Oct 2014 12:09:56 -0700
> 
> > On Wed, 2014-10-22 at 18:35 +0000, Sathya Perla wrote:
> >> Agree. Are you suggesting that drivers should automatically
> >> register an XPS configuration? I thought it was upto the user
> >> to enable it...
> > 
> > Yep, search for netif_set_xps_queue()
> > 
> > (commit 537c00de1c9ba9876b9)
> > 
> > Look at commit d03a68f8217ea0349 for an example of how it can be done,
> > if user do not override this later.
> 
> Very few people know about this :-/
> 
> I only see 4 drivers adjusted to do this, it would be nice if this
> was more widespread.

It seems to require that the driver also sets IRQ affinity hints, which
I've never been very comfortable with.  Drivers either set queue n = CPU
n without regard for topology, or optimise for whichever
micro-architecture the vendor most cares about.  irqbalance then
slavishly follows these hints, so we have each driver (rather than the
administrator) setting policy.

Alternately the driver could create an irq_cpu_rmap for its TX interupts
and that could be used to select queues based on current affinity
(<http://thread.gmane.org/gmane.linux.network/186698>).  But we already
seem to have too many ways to do TX queue selection.

Ben.

-- 
Ben Hutchings
The world is coming to an end.	Please log off.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply

* Re: [stable request <= 3.11] net/mlx4_en: Fix BlueFlame race
From: Ben Hutchings @ 2014-11-01  1:29 UTC (permalink / raw)
  To: Vinson Lee
  Cc: David S. Miller, Amir Vadai, Or Gerlitz, Jack Morgenstein,
	Eugenia Emantayev, Matan Barak, netdev
In-Reply-To: <CAHTgTXVn1479XCoh1-j=Xghtad3zA-hf0za5r_AyoaKuKeFZ2g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 753 bytes --]

On Sat, 2014-10-18 at 14:14 -0700, Vinson Lee wrote:
> Hi.
> 
> Please consider backporting upstream commit
> 2d4b646613d6b12175b017aca18113945af1faf3 "net/mlx4_en: Fix BlueFlame
> race" to stable kernels <= 3.11.
> 
> commit 2d4b646613d6b12175b017aca18113945af1faf3
> Author: Eugenia Emantayev <eugenia@mellanox.com>
> Date:   Thu Jul 25 19:21:23 2013 +0300
> 
>     net/mlx4_en: Fix BlueFlame race
[...]

David doesn't support anything older than 3.12 now, so you should send
requests for older stable branches directly to the stable list.

I tried to apply this one to 3.2-stable, but it failed.  If it's needed
there you'll have to provide a backport.

Ben.

-- 
Ben Hutchings
The world is coming to an end.	Please log off.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply

* [PATCH net 2/2] net: systemport: do not crash freeing an unitialized TX ring
From: Florian Fainelli @ 2014-10-31 22:51 UTC (permalink / raw)
  To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1414795895-31612-1-git-send-email-f.fainelli@gmail.com>

Callers of bcm_sysport_init_tx_ring() can currently fail, and will
always call bcm_sysport_fini_tx_ring() in a loop ending at the number of
TX queues (32) without checking if the TX ring was successfully
initialized or not.

Update bcm_sysport_fini_tx_ring() to return early and avoid a crash
de-referencing ring->cbs if the TX ring was not initialized, since
ring->cbs is the last part of the initialization done by
bcm_sysport_init_tx_ring() that could fail.

Fixes: 80105befdb4b ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
Reported-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index c81bf74685c0..531bb7c57531 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1175,6 +1175,13 @@ static void bcm_sysport_fini_tx_ring(struct bcm_sysport_priv *priv,
 	if (!(reg & TDMA_DISABLED))
 		netdev_warn(priv->netdev, "TDMA not stopped!\n");
 
+	/* ring->cbs is the last part in bcm_sysport_init_tx_ring which could
+	 * fail, so by checking this pointer we know whether the TX ring was
+	 * fully initialized or not.
+	 */
+	if (!ring->cbs)
+		return;
+
 	napi_disable(&ring->napi);
 	netif_napi_del(&ring->napi);
 
-- 
1.9.1

^ permalink raw reply related

* [PATCH net 1/2] net: systemport: fix DMA allocation/freeing sizes
From: Florian Fainelli @ 2014-10-31 22:51 UTC (permalink / raw)
  To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1414795895-31612-1-git-send-email-f.fainelli@gmail.com>

We should not be allocating a single byte of DMA coherent memory, but
instead a full-sized struct dma_desc (8 bytes).

Fixes: 80105befdb4b ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 3a6778a667f4..c81bf74685c0 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1110,7 +1110,8 @@ static int bcm_sysport_init_tx_ring(struct bcm_sysport_priv *priv,
 	/* We just need one DMA descriptor which is DMA-able, since writing to
 	 * the port will allocate a new descriptor in its internal linked-list
 	 */
-	p = dma_zalloc_coherent(kdev, 1, &ring->desc_dma, GFP_KERNEL);
+	p = dma_zalloc_coherent(kdev, sizeof(struct dma_desc), &ring->desc_dma,
+				GFP_KERNEL);
 	if (!p) {
 		netif_err(priv, hw, priv->netdev, "DMA alloc failed\n");
 		return -ENOMEM;
@@ -1183,7 +1184,8 @@ static void bcm_sysport_fini_tx_ring(struct bcm_sysport_priv *priv,
 	ring->cbs = NULL;
 
 	if (ring->desc_dma) {
-		dma_free_coherent(kdev, 1, ring->desc_cpu, ring->desc_dma);
+		dma_free_coherent(kdev, sizeof(struct dma_desc),
+				  ring->desc_cpu, ring->desc_dma);
 		ring->desc_dma = 0;
 	}
 	ring->size = 0;
-- 
1.9.1

^ permalink raw reply related

* [PATCH net 0/2] net: systemport: TX dma fixes
From: Florian Fainelli @ 2014-10-31 22:51 UTC (permalink / raw)
  To: netdev; +Cc: davem, Florian Fainelli

Hi David,

This patch series contains two fixes for our transmit path, first one
is a pretty nasty one since we were not allocating a large enough
dma coherent pool for our transmit descriptors, which would work most of the
time, since allocations are contiguous and we could have.

Second patch fixes a less frequent, though highly likley crash when using
CMA allocations.

I just missed your pull request to Linus, though I assume there will be
another one?

Thanks!

Florian Fainelli (2):
  net: systemport: fix DMA allocation/freeing sizes
  net: systemport: do not crash freeing an unitialized TX ring

 drivers/net/ethernet/broadcom/bcmsysport.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

-- 
1.9.1

^ permalink raw reply

* [PATCH v4 1/1] ip-link: add switch to show human readable output
From: Christian Hesse @ 2014-10-31 21:33 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Christian Hesse
In-Reply-To: <20141031123115.4cd13371@urahara>

Byte and packet count can increase to really big numbers. This adds a
switch to show human readable output.

4: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 00:de:ad:be:ee:ef brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    1523846973 3969051  0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    8710088361 6077735  0       0       0       0
4: wl: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 00:de:ad:be:ee:ef brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    1.5G       3.9M     0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    8.7G       6.0M     0       0       0       0
---
 include/utils.h       |   1 +
 ip/ip.c               |   5 +
 ip/ipaddress.c        | 286 ++++++++++++++++++++++++++++++++++++++------------
 man/man8/ip-link.8.in |   7 ++
 4 files changed, 233 insertions(+), 66 deletions(-)

diff --git a/include/utils.h b/include/utils.h
index 704dc51..7bb19e9 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -11,6 +11,7 @@
 #include "rtm_map.h"
 
 extern int preferred_family;
+extern int human_readable;
 extern int show_stats;
 extern int show_details;
 extern int show_raw;
diff --git a/ip/ip.c b/ip/ip.c
index 739b88d..6b352c8 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -24,6 +24,7 @@
 #include "ip_common.h"
 
 int preferred_family = AF_UNSPEC;
+int human_readable = 0;
 int show_stats = 0;
 int show_details = 0;
 int resolve_hosts = 0;
@@ -47,6 +48,7 @@ static void usage(void)
 "                   tunnel | tuntap | maddr | mroute | mrule | monitor | xfrm |\n"
 "                   netns | l2tp | tcp_metrics | token | netconf }\n"
 "       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
+"                    -h[uman-readable] |\n"
 "                    -f[amily] { inet | inet6 | ipx | dnet | bridge | link } |\n"
 "                    -4 | -6 | -I | -D | -B | -0 |\n"
 "                    -l[oops] { maximum-addr-flush-attempts } |\n"
@@ -212,6 +214,9 @@ int main(int argc, char **argv)
 			preferred_family = AF_DECnet;
 		} else if (strcmp(opt, "-B") == 0) {
 			preferred_family = AF_BRIDGE;
+		} else if (matches(opt, "-human") == 0 ||
+			   matches(opt, "-human-readable") == 0) {
+			++human_readable;
 		} else if (matches(opt, "-stats") == 0 ||
 			   matches(opt, "-statistics") == 0) {
 			++show_stats;
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 45729d8..4b8ddca 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -319,107 +319,261 @@ static void print_vfinfo(FILE *fp, struct rtattr *vfinfo)
 	}
 }
 
+
+static void print_human64(FILE *fp, int length, uint64_t count)
+{
+	char * prefix = "kMGTPE";
+	int written = 0, i;
+	uint64_t powi = 1;
+
+	if (count < 1000) {
+		/* we are below 1000, so no precision and no prefix */
+		written = fprintf(fp, "%"PRIu64, count);
+	} else {
+		/* increase value by a factor of 1000 and print
+		 * if result is something a human can read */
+		for (i = 0; i < 6; i++) {
+			powi *= 1000;
+			if (count / 1000 < powi) {
+				 written = fprintf(fp, "%"PRIu64".%"PRIu64"%c",
+					 count / powi, count * 10 / powi % 10, *prefix);
+				 break;
+			}
+			prefix++;
+		}
+	}
+
+	do {
+		fputc(' ', fp);
+	} while (written++ < length);
+}
+
+static void print_human32(FILE *fp, int length, uint32_t count)
+{
+	char * prefix = "KMG";
+	int written = 0, i;
+	uint32_t powi = 1;
+
+	if (count < 1000) {
+		/* we are below 1000, so no precision and no prefix */
+		written = fprintf(fp, "%u", count);
+	} else {
+		/* increase value by a factor of 1000 and print
+		 * if result is something a human can read */
+		for (i = 0; i < 3; i++) {
+			powi *= 1000;
+			if (count / 1000 < powi) {
+				 written = fprintf(fp, "%u.%u%c",
+					 count / powi, count * 10 / powi % 10, *prefix);
+				 break;
+			}
+			prefix++;
+		}
+	}
+
+	do {
+		fputc(' ', fp);
+	} while (written++ < length);
+}
+
 static void print_link_stats64(FILE *fp, const struct rtnl_link_stats64 *s,
                                const struct rtattr *carrier_changes)
 {
+	/* RX stats */
 	fprintf(fp, "    RX: bytes  packets  errors  dropped overrun mcast   %s%s",
 		s->rx_compressed ? "compressed" : "", _SL_);
-	fprintf(fp, "    %-10"PRIu64" %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
-		(uint64_t)s->rx_bytes,
-		(uint64_t)s->rx_packets,
-		(uint64_t)s->rx_errors,
-		(uint64_t)s->rx_dropped,
-		(uint64_t)s->rx_over_errors,
-		(uint64_t)s->multicast);
-	if (s->rx_compressed)
-		fprintf(fp, " %-7"PRIu64"",
-			(uint64_t)s->rx_compressed);
+	if (human_readable) {
+		fprintf(fp, "    ");
+		print_human64(fp, 10, (uint64_t)s->rx_bytes);
+		print_human64(fp, 8, (uint64_t)s->rx_packets);
+		print_human64(fp, 7, (uint64_t)s->rx_errors);
+		print_human64(fp, 7, (uint64_t)s->rx_dropped);
+		print_human64(fp, 7, (uint64_t)s->rx_over_errors);
+		print_human64(fp, 7, (uint64_t)s->multicast);
+		if (s->rx_compressed)
+			print_human64(fp, 7, (uint64_t)s->rx_compressed);
+	} else {
+		fprintf(fp, "    %-10"PRIu64" %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
+			(uint64_t)s->rx_bytes,
+			(uint64_t)s->rx_packets,
+			(uint64_t)s->rx_errors,
+			(uint64_t)s->rx_dropped,
+			(uint64_t)s->rx_over_errors,
+			(uint64_t)s->multicast);
+		if (s->rx_compressed)
+			fprintf(fp, " %-7"PRIu64"",
+				(uint64_t)s->rx_compressed);
+	}
+
+	/* RX error stats */
 	if (show_stats > 1) {
 		fprintf(fp, "%s", _SL_);
-		fprintf(fp, "    RX errors: length  crc     frame   fifo    missed%s", _SL_);
-		fprintf(fp, "               %-7"PRIu64"  %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
-			(uint64_t)s->rx_length_errors,
-			(uint64_t)s->rx_crc_errors,
-			(uint64_t)s->rx_frame_errors,
-			(uint64_t)s->rx_fifo_errors,
-			(uint64_t)s->rx_missed_errors);
+		fprintf(fp, "    RX errors: length   crc     frame   fifo    missed%s", _SL_);
+		if (human_readable) {
+			fprintf(fp, "               ");
+			print_human64(fp, 8, (uint64_t)s->rx_length_errors);
+			print_human64(fp, 7, (uint64_t)s->rx_crc_errors);
+			print_human64(fp, 7, (uint64_t)s->rx_frame_errors);
+			print_human64(fp, 7, (uint64_t)s->rx_fifo_errors);
+			print_human64(fp, 7, (uint64_t)s->rx_missed_errors);
+		} else {
+			fprintf(fp, "               %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
+				(uint64_t)s->rx_length_errors,
+				(uint64_t)s->rx_crc_errors,
+				(uint64_t)s->rx_frame_errors,
+				(uint64_t)s->rx_fifo_errors,
+				(uint64_t)s->rx_missed_errors);
+		}
 	}
 	fprintf(fp, "%s", _SL_);
+
+	/* TX stats */
 	fprintf(fp, "    TX: bytes  packets  errors  dropped carrier collsns %s%s",
 		(uint64_t)s->tx_compressed ? "compressed" : "", _SL_);
-	fprintf(fp, "    %-10"PRIu64" %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
-		(uint64_t)s->tx_bytes,
-		(uint64_t)s->tx_packets,
-		(uint64_t)s->tx_errors,
-		(uint64_t)s->tx_dropped,
-		(uint64_t)s->tx_carrier_errors,
-		(uint64_t)s->collisions);
-	if (s->tx_compressed)
-		fprintf(fp, " %-7"PRIu64"",
-			(uint64_t)s->tx_compressed);
+	if (human_readable) {
+		fprintf(fp, "    ");
+		print_human64(fp, 10, (uint64_t)s->tx_bytes);
+		print_human64(fp, 8, (uint64_t)s->tx_packets);
+		print_human64(fp, 7, (uint64_t)s->tx_errors);
+		print_human64(fp, 7, (uint64_t)s->tx_dropped);
+		print_human64(fp, 7, (uint64_t)s->tx_carrier_errors);
+		print_human64(fp, 7, (uint64_t)s->collisions);
+		if (s->tx_compressed)
+			print_human64(fp, 7, (uint64_t)s->tx_compressed);
+	} else {
+		fprintf(fp, "    %-10"PRIu64" %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
+			(uint64_t)s->tx_bytes,
+			(uint64_t)s->tx_packets,
+			(uint64_t)s->tx_errors,
+			(uint64_t)s->tx_dropped,
+			(uint64_t)s->tx_carrier_errors,
+			(uint64_t)s->collisions);
+		if (s->tx_compressed)
+			fprintf(fp, " %-7"PRIu64"",
+				(uint64_t)s->tx_compressed);
+	}
+
+	/* TX error stats */
 	if (show_stats > 1) {
 		fprintf(fp, "%s", _SL_);
-		fprintf(fp, "    TX errors: aborted fifo    window  heartbeat");
+		fprintf(fp, "    TX errors: aborted  fifo   window heartbeat");
                 if (carrier_changes)
 			fprintf(fp, " transns");
 		fprintf(fp, "%s", _SL_);
-		fprintf(fp, "               %-7"PRIu64"  %-7"PRIu64" %-7"PRIu64" %-8"PRIu64"",
-			(uint64_t)s->tx_aborted_errors,
-			(uint64_t)s->tx_fifo_errors,
-			(uint64_t)s->tx_window_errors,
-			(uint64_t)s->tx_heartbeat_errors);
-		if (carrier_changes)
-			fprintf(fp, " %-7u",
-				*(uint32_t*)RTA_DATA(carrier_changes));
+		if (human_readable) {
+			fprintf(fp, "               ");
+			print_human64(fp, 8, (uint64_t)s->tx_aborted_errors);
+			print_human64(fp, 7, (uint64_t)s->tx_fifo_errors);
+			print_human64(fp, 7, (uint64_t)s->tx_window_errors);
+			print_human64(fp, 7, (uint64_t)s->tx_heartbeat_errors);
+			if (carrier_changes)
+				print_human64(fp, 7, (uint64_t)*(uint32_t*)RTA_DATA(carrier_changes));
+		} else {
+			fprintf(fp, "               %-8"PRIu64" %-7"PRIu64" %-7"PRIu64" %-7"PRIu64"",
+				(uint64_t)s->tx_aborted_errors,
+				(uint64_t)s->tx_fifo_errors,
+				(uint64_t)s->tx_window_errors,
+				(uint64_t)s->tx_heartbeat_errors);
+			if (carrier_changes)
+				fprintf(fp, " %-7u",
+					*(uint32_t*)RTA_DATA(carrier_changes));
+		}
 	}
 }
 
 static void print_link_stats32(FILE *fp, const struct rtnl_link_stats *s,
 			       const struct rtattr *carrier_changes)
 {
+	/* RX stats */
 	fprintf(fp, "    RX: bytes  packets  errors  dropped overrun mcast   %s%s",
 		s->rx_compressed ? "compressed" : "", _SL_);
-	fprintf(fp, "    %-10u %-8u %-7u %-7u %-7u %-7u",
-		s->rx_bytes, s->rx_packets, s->rx_errors,
-		s->rx_dropped, s->rx_over_errors,
-		s->multicast
-		);
-	if (s->rx_compressed)
-		fprintf(fp, " %-7u", s->rx_compressed);
+	if (human_readable) {
+		fprintf(fp, "    ");
+		print_human32(fp, 10, s->rx_bytes);
+		print_human32(fp, 8, s->rx_packets);
+		print_human32(fp, 7, s->rx_errors);
+		print_human32(fp, 7, s->rx_dropped);
+		print_human32(fp, 7, s->rx_over_errors);
+		print_human32(fp, 7, s->multicast);
+		if (s->rx_compressed)
+			print_human32(fp, 7, s->rx_compressed);
+	} else {
+		fprintf(fp, "    %-10u %-8u %-7u %-7u %-7u %-7u",
+			s->rx_bytes, s->rx_packets, s->rx_errors,
+			s->rx_dropped, s->rx_over_errors,
+			s->multicast);
+		if (s->rx_compressed)
+			fprintf(fp, " %-7u", s->rx_compressed);
+	}
+
+	/* RX error stats */
 	if (show_stats > 1) {
 		fprintf(fp, "%s", _SL_);
-		fprintf(fp, "    RX errors: length  crc     frame   fifo    missed%s", _SL_);
-		fprintf(fp, "               %-7u  %-7u %-7u %-7u %-7u",
-			s->rx_length_errors,
-			s->rx_crc_errors,
-			s->rx_frame_errors,
-			s->rx_fifo_errors,
-			s->rx_missed_errors
-			);
+		fprintf(fp, "    RX errors: length   crc     frame   fifo    missed%s", _SL_);
+		if (human_readable) {
+			fprintf(fp, "               ");
+			print_human32(fp, 8, s->rx_length_errors);
+			print_human32(fp, 7, s->rx_crc_errors);
+			print_human32(fp, 7, s->rx_frame_errors);
+			print_human32(fp, 7, s->rx_fifo_errors);
+			print_human32(fp, 7, s->rx_missed_errors);
+		} else {
+			fprintf(fp, "               %-8u %-7u %-7u %-7u %-7u",
+				s->rx_length_errors,
+				s->rx_crc_errors,
+				s->rx_frame_errors,
+				s->rx_fifo_errors,
+				s->rx_missed_errors);
+		}
 	}
 	fprintf(fp, "%s", _SL_);
+
+	/* TX stats */
 	fprintf(fp, "    TX: bytes  packets  errors  dropped carrier collsns %s%s",
 		s->tx_compressed ? "compressed" : "", _SL_);
-	fprintf(fp, "    %-10u %-8u %-7u %-7u %-7u %-7u",
-		s->tx_bytes, s->tx_packets, s->tx_errors,
-		s->tx_dropped, s->tx_carrier_errors, s->collisions);
-	if (s->tx_compressed)
-		fprintf(fp, " %-7u", s->tx_compressed);
+	if (human_readable) {
+		fprintf(fp, "    ");
+		print_human32(fp, 10, s->tx_bytes);
+		print_human32(fp, 8, s->tx_packets);
+		print_human32(fp, 7, s->tx_errors);
+		print_human32(fp, 7, s->tx_dropped);
+		print_human32(fp, 7, s->tx_carrier_errors);
+		print_human32(fp, 7, s->collisions);
+		if (s->tx_compressed)
+			print_human32(fp, 7, s->tx_compressed);
+	} else {
+		fprintf(fp, "    %-10u %-8u %-7u %-7u %-7u %-7u",
+			s->tx_bytes, s->tx_packets, s->tx_errors,
+			s->tx_dropped, s->tx_carrier_errors, s->collisions);
+		if (s->tx_compressed)
+			fprintf(fp, " %-7u", s->tx_compressed);
+	}
+
+	/* TX error stats */
 	if (show_stats > 1) {
 		fprintf(fp, "%s", _SL_);
-		fprintf(fp, "    TX errors: aborted fifo    window  heartbeat");
+		fprintf(fp, "    TX errors: aborted  fifo   window heartbeat");
                 if (carrier_changes)
 			fprintf(fp, " transns");
 		fprintf(fp, "%s", _SL_);
-		fprintf(fp, "               %-7u  %-7u %-7u %-8u",
-			s->tx_aborted_errors,
-			s->tx_fifo_errors,
-			s->tx_window_errors,
-			s->tx_heartbeat_errors
-			);
-		if (carrier_changes)
-			fprintf(fp, " %-7u",
-				*(uint32_t*)RTA_DATA(carrier_changes));
+		if (human_readable) {
+			fprintf(fp, "               ");
+			print_human32(fp, 8, s->tx_aborted_errors);
+			print_human32(fp, 7, s->tx_fifo_errors);
+			print_human32(fp, 7, s->tx_window_errors);
+			print_human32(fp, 7, s->tx_heartbeat_errors);
+			if (carrier_changes)
+				print_human32(fp, 7, *(uint32_t*)RTA_DATA(carrier_changes));
+		} else {
+			fprintf(fp, "               %-8u %-7u %-7u %-7u",
+				s->tx_aborted_errors,
+				s->tx_fifo_errors,
+				s->tx_window_errors,
+				s->tx_heartbeat_errors);
+			if (carrier_changes)
+				fprintf(fp, " %-7u",
+					*(uint32_t*)RTA_DATA(carrier_changes));
+		}
 	}
 }
 
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index 464009d..9747c4c 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -16,6 +16,7 @@ ip-link \- network device configuration
 .ti -8
 .IR OPTIONS " := { "
 \fB\-V\fR[\fIersion\fR] |
+\fB\-h\fR[\fIuman-readable\fR] |
 \fB\-s\fR[\fItatistics\fR] |
 \fB\-r\fR[\fIesolve\fR] |
 \fB\-f\fR[\fIamily\fR] {
@@ -660,6 +661,12 @@ specifies what group of devices to show.
 .B up
 only display running interfaces.
 
+.SH "NOTES"
+Human readable values are calculated with SI prefixes, so with a decimal
+base, not binary. (This is unlike
+.BR ifconfig (8)
+, with uses binary prefix.) 1,000 bytes are 1 kB, 1,000 kB are 1 MB, ...
+
 .SH "EXAMPLES"
 .PP
 ip link show
-- 
2.1.3

^ permalink raw reply related

* Re: DMA allocations from CMA and fatal_signal_pending check
From: Maxime Bizon @ 2014-10-31 21:07 UTC (permalink / raw)
  To: Joonsoo Kim
  Cc: Florian Fainelli, lauraa, netdev@vger.kernel.org, linux-kernel,
	mina86, linux-mm, aneesh.kumar, Gregory Fong, gioh.kim, akpm,
	Brian Norris, linux-arm-kernel, m.szyprowski
In-Reply-To: <20141031082818.GB14642@js1304-P5Q-DELUXE>


On Fri, 2014-10-31 at 17:28 +0900, Joonsoo Kim wrote:

> I guess that it is okay that bcm_sysport_open() return -EINTR?

actually, since CMA alloc is hidden behind dma_alloc_coherent(), all you
get back is NULL and then return ENOMEM.

-- 
Maxime


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: DMA-API warning from sunhme - unchecked dma_map_single error
From: Meelis Roos @ 2014-10-31 21:01 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, sparclinux
In-Reply-To: <20141031205258.C3A2F7FE2E@ilves.cyber.ee>

>> It seems to be correct warning - dma_map_single is used unchecked in
>> sunhme.c. I can try fixing it - the error handling will be the only
>> problem. Is it considered worthwile?
>
> Can you test this patch?

It works fine on E3500 where I had many debugging options on and caught 
it. No warnings, network still works.

-- 
Meelis Roos (mroos@linux.ee)

^ permalink raw reply

* [GIT] Networking
From: David Miller @ 2014-10-31 20:59 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


A bit has accumulated, but it's been a week or so since my
last batch of post-merge-window fixes, so...

1) Missing module license in netfilter reject module, from Pablo.  Lots
   of people ran into this.

2) Off by one in mac80211 baserate calculation, from Karl Beldan.

3) Fix incorrect return value from ax88179_178a driver's set_mac_addr
   op, which broke use of it with bonding.  From Ian Morgan.

4) Checking of skb_gso_segment()'s return value was not all
   encompassing, it can return an SKB pointer, a pointer error, or
   NULL.  Fix from Florian Westphal.

   This is crummy, and longer term will be fixed to just return
   error pointers or a real SKB.

6) Encapsulation offloads not being handled by
   skb_gso_transport_seglen().  From Florian Westphal.

7) Fix deadlock in TIPC stack, from Ying Xue.

8) Fix performance regression from using rhashtable for netlink
   sockets.  The problem was the synchronize_net() invoked for
   every socket destroy.  From Thomas Graf.

9) Fix bug in eBPF verifier, and remove the strong dependency of
   BPF on NET.  From Alexei Starovoitov.

10) In qdisc_create(), use the correct interface to allocate
    ->cpu_bstats, otherwise the u64_stats_sync member isn't
    initialized properly.  From Sabrina Dubroca.

11) Off by one in ip_set_nfnl_get_byindex(), from Dan Carpenter.

12) nf_tables_newchain() was erroneously expecting error pointers
    from netdev_alloc_pcpu_stats().  It only returna a valid pointer
    or NULL.  From Sabrina Dubroca.

13) Fix use-after-free in _decode_session6(), from Li RongQing.

14) When we set the TX flow hash on a socket, we mistakenly do so
    before we've nailed down the final source port.  Move the setting
    deeper to fix this.  From Sathya Perla.

15) NAPI budget accounting in amd-xgbe driver was counting descriptors
    instead of full packets, fix from Thomas Lendacky.

16) Fix total_data_buflen calculation in hyperv driver, from Haiyang
    Zhang.

17) Fix bcma driver build with OF_ADDRESS disabled, from Hauke
    Mehrtens.

18) Fix mis-use of per-cpu memory in TCP md5 code.  The problem is that
    something that ends up being vmalloc memory can't be passed to
    the crypto hash routines via scatter-gather lists.  From Eric
    Dumazet.

19) Fix regression in promiscuous mode enabling in cdc-ether, from
    Olivier Blin.

20) Bucket eviction and frag entry killing can race with eachother,
    causing an unlink of the object from the wrong list.  Fix from
    Nikolay Aleksandrov.

21) Missing initialization of spinlock in cxgb4 driver, from Anish
    Bhatt.

22) Do not cache ipv4 routing failures, otherwise if the sysctl
    for forwarding is subsequently enabled this won't be seen.
    From Nicolas Cavallari.

Please pull, thanks a lot!

The following changes since commit 61ed53deb1c6a4386d8710dbbfcee8779c381931:

  Merge tag 'ntb-3.18' of git://github.com/jonmason/ntb (2014-10-19 12:58:22 -0700)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master

for you to fetch changes up to 99a49ce613057f1934e1c378808374fd683b1541:

  Merge tag 'master-2014-10-30' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless (2014-10-31 16:18:35 -0400)

----------------------------------------------------------------

Alex Gartrell (1):
      ipvs: Avoid null-pointer deref in debug code

Alexei Starovoitov (2):
      bpf: fix bug in eBPF verifier
      bpf: split eBPF out of NET

Andrew Lunn (2):
      net: dsa: Error out on tagging protocol mismatches
      dsa: mv88e6171: Fix tagging protocol/Kconfig

Andy Shevchenko (1):
      stmmac: pci: set default of the filter bins

Anish Bhatt (3):
      cxgb4 : Improve handling of DCB negotiation or loss thereof
      cxgb4 : Handle dcb enable correctly
      cxgb4 : Fix missing initialization of win0_lock

Arturo Borrero (1):
      netfilter: nft_compat: fix wrong target lookup in nft_target_select_ops()

Ben Hutchings (3):
      drivers/net: Disable UFO through virtio
      drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets
      drivers/net: macvtap and tun depend on INET

Cyril Brulebois (1):
      wireless: rt2x00: add new rt2800usb device

Dan Carpenter (3):
      netfilter: ipset: off by one in ip_set_nfnl_get_byindex()
      i40e: _MASK vs _SHIFT typo in i40e_handle_mdd_event()
      ath9k: fix some debugfs output

David S. Miller (18):
      Merge git://git.kernel.org/.../pablo/nf
      Merge branch 'gso_encap_fixes'
      Merge branch 'enic'
      Merge branch 'amd-xgbe'
      Merge branch 'xen-netback'
      Merge branch 'mellanox'
      Merge git://git.kernel.org/.../pablo/nf
      Merge branch 'cxgb4-net'
      Merge branch 'dsa-net'
      Merge tag 'master-2014-10-27' of git://git.kernel.org/.../linville/wireless
      Merge branch 'systemport-net'
      Merge branch 'cdc-ether'
      Merge branch 'r8152-net'
      Merge branch 'master' of git://git.kernel.org/.../jkirsher/net
      Merge branch 'mellanox-net'
      Merge branch 'ufo-fix'
      Merge git://git.kernel.org/.../pablo/nf
      Merge tag 'master-2014-10-30' of git://git.kernel.org/.../linville/wireless

David Vrabel (3):
      xen-netback: make feature-rx-notify mandatory
      xen-netback: fix unlimited guest Rx internal queue and carrier flapping
      xen-netback: reintroduce guest Rx stall detection

Eli Cohen (2):
      net/mlx5_core: Call synchronize_irq() before freeing EQ buffer
      net/mlx4_core: Call synchronize_irq() before freeing EQ buffer

Emil Tantilov (1):
      ixgbe: fix race when setting advertised speed

Emmanuel Grumbach (6):
      iwlwifi: configure the LTR
      iwlwifi: mvm: BT Coex - update the MPLUT Boost register value
      iwlwifi: mvm: BT coex - fix BT prio for probe requests
      iwlwifi: dvm: drop non VO frames when flushing
      Revert "iwlwifi: mvm: treat EAPOLs like mgmt frames wrt rate"
      iwlwifi: pcie: fix polling in various places

Eric Dumazet (4):
      tcp: md5: do not use alloc_percpu()
      macvlan: fix a race on port dismantle and possible skb leaks
      net: napi_reuse_skb() should check pfmemalloc
      net: skb_fclone_busy() needs to detect orphaned skb

Fabian Frederick (1):
      net: rfkill: kernel-doc warning fixes

Felix Fietkau (2):
      ath: use CTL region from cfg80211 if unset in EEPROM
      ath9k_common: always update value in ath9k_cmn_update_txpow

Florian Fainelli (2):
      net: systemport: enable RX interrupts after NAPI
      net: systemport: reset UniMAC coming out of a suspend cycle

Florian Westphal (5):
      net: gso: use feature flag argument in all protocol gso handlers
      net: make skb_gso_segment error handling more robust
      net: core: handle encapsulation offloads when computing segment lengths
      netfilter: nf_log: account for size of NLMSG_DONE attribute
      netfilter: nfnetlink_log: fix maximum packet length logged to userspace

Francesco Ruggeri (1):
      e1000: unset IFF_UNICAST_FLT on WMware 82545EM

Geert Uytterhoeven (1):
      drivers: net: xgene: Rewrite buggy loop in xgene_enet_ecc_init()

Govindarajulu Varadarajan (2):
      enic: fix possible deadlock in enic_stop/ enic_rfs_flw_tbl_free
      enic: Do not call napi_disable when preemption is disabled.

Guenter Roeck (1):
      net: ethtool: Return -EOPNOTSUPP if user space tries to read EEPROM with lengh 0

Haim Dreyfuss (1):
      iwlwifi: mvm: Add tx power condition to bss_info_changed_ap_ibss

Haiyang Zhang (1):
      hyperv: Fix the total_data_buflen in send path

Hariprasad Shenai (1):
      cxgb4vf: Replace repetitive pci device ID's with right ones

Hauke Mehrtens (1):
      bcma: fix build when CONFIG_OF_ADDRESS is not set

Herbert Xu (1):
      bridge: Do not compile options in br_parse_ip_options

Houcheng Lin (1):
      netfilter: nf_log: release skbuff on nlmsg put failure

Ian Morgan (1):
      ax88179_178a: fix bonding failure

John W. Linville (2):
      Merge tag 'iwlwifi-for-john-2014-10-23' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
      Merge tag 'mac80211-for-john-2014-10-23' of git://git.kernel.org/.../jberg/mac80211

Jon Cooper (1):
      sfc: remove incorrect EFX_BUG_ON_PARANOID check

Junwei Zhang (1):
      ixgbe: need not repeat init skb with NULL

Karl Beldan (3):
      mac80211: fix typo in starting baserate for rts_cts_rate_idx
      mac80211: minstrels: fix buffer overflow in HT debugfs rc_stats
      net: tso: fix unaligned access to crafted TCP header in helper API

Karsten Wiese (3):
      rtl8192cu: Fix for rtlwifi's bluetooth coexist functionality
      rtl8192cu: Call ieee80211_register_hw from rtl_usb_probe
      rtl8192cu: Prevent Ooops under rtl92c_set_fw_rsvdpagepkt

Kees Cook (1):
      rtlwifi: prevent format string usage from leaking

LEROY Christophe (1):
      net: fs_enet: set back promiscuity mode after restart

Larry Finger (8):
      rtlwifi: rtl8192ee: Prevent log spamming for switch statements
      rtlwifi: rtl8821ae: Fix possible array overrun
      rtlwifi: Add check for get_btc_status callback
      rtlwifi: rtl8192ce: rtl8192de: rtl8192se: Fix handling for missing get_btc_status
      rtlwifi: rtl8192se: Fix duplicate calls to ieee80211_register_hw()
      rtlwifi: rtl8192se: Add missing section to read descriptor setting
      rtlwifi: rtl8192ce: Add missing section to read descriptor setting
      rtlwifi: rtl8192se: Fix firmware loading

Lendacky, Thomas (2):
      amd-xgbe: Properly handle feature changes via ethtool
      amd-xgbe: Fix napi Rx budget accounting

Lennart Sorensen (2):
      drivers: net: cpsw: Fix broken loop condition in switch mode
      drivers: net: cpsw: Support ALLMULTI and fix IFF_PROMISC in switch mode

Li RongQing (1):
      xfrm6: fix a potential use after free in xfrm6_policy.c

Liad Kaufman (2):
      mac80211: fix warning on htmldocs for last_tdls_pkt_time
      iwlwifi: 8000: fix string given to MODULE_FIRMWARE

Lubomir Rintel (1):
      ipv6: notify userspace when we added or changed an ipv6 token

Luciano Coelho (2):
      mac80211: return the vif's chandef in ieee80211_cfg_get_channel()
      nl80211: sanity check the channel switch counter value

Marc Yang (1):
      mwifiex: restart rxreorder timer correctly

Marcelo Leitner (1):
      netfilter: nf_conntrack: allow server to become a client in TW handling

Matti Gottlieb (1):
      iwlwifi: mvm: ROC - bug fixes around time events and locking

Mugunthan V N (1):
      drivers: net:cpsw: fix probe_dt when only slave 1 is pinned out

Nicolas Cavallari (1):
      ipv4: Do not cache routing failures due to disabled forwarding.

Nikolay Aleksandrov (2):
      inet: frags: fix a race between inet_evict_bucket and inet_frag_kill
      inet: frags: remove the WARN_ON from inet_evict_bucket

Olivier Blin (3):
      usbnet: add a callback for set_rx_mode
      cdc-ether: extract usbnet_cdc_update_filter function
      cdc-ether: handle promiscuous mode with a set_rx_mode callback

Or Gerlitz (2):
      net/mlx4_en: Don't attempt to TX offload the outer UDP checksum for VXLAN
      mlx4: Avoid leaking steering rules on flow creation error flow

Pablo Neira Ayuso (12):
      netfilter: missing module license in the nf_reject_ipvX modules
      netfilter: nf_tables: restrict nat/masq expressions to nat chain type
      netfilter: nft_compat: fix hook validation for non-base chains
      netfilter: nft_compat: validate chain type in match/target
      netfilter: nft_nat: insufficient attribute validation
      netfilter: nft_nat: NFTA_NAT_REG_ADDR_MAX depends on NFTA_NAT_REG_ADDR_MIN
      netfilter: nft_nat: dump attributes if they are set
      netfilter: nf_tables_bridge: update hook_mask to allow {pre,post}routing
      netfilter: nf_reject_ipv4: split nf_send_reset() in smaller functions
      netfilter: nf_reject_ipv6: split nf_send_reset6() in smaller functions
      netfilter: nft_reject_bridge: don't use IP stack to reject traffic
      netfilter: nft_reject_bridge: restrict reject to prerouting and input

Philipp Zabel (1):
      net: fec: ptp: fix NULL pointer dereference if ptp_clock is not set

Pravin B Shelar (2):
      mpls: Fix mpls_gso handler.
      mpls: Allow mpls_gso to be built as module

Rafał Miłecki (1):
      bcma: add another PCI ID of device with BCM43228

Randy Dunlap (1):
      skbuff.h: fix kernel-doc warning for headers_end

Richard Cochran (1):
      ptp: restore the makefile for building the test program.

Rickard Strandqvist (1):
      brcmfmac: dhd_sdio.c: Cleaning up missing null-terminate in conjunction with strncpy

Roman Gushchin (1):
      igb: don't reuse pages with pfmemalloc flag

Sabrina Dubroca (2):
      net: sched: initialize bstats syncp
      netfilter: nf_tables: check for NULL in nf_tables_newchain pcpu stats allocation

Sathya Perla (1):
      net: fix saving TX flow hash in sock for outgoing connections

Sujith Manoharan (1):
      ath9k: Enable HW queue control only for MCC

Tej Parkash (1):
      cnic: Update the rcu_access_pointer() usages

Thomas Graf (1):
      netlink: Re-add locking to netlink_lookup() and seq walker

Tom Herbert (1):
      gre: Use inner mac length when computing tunnel length

Tony Lindgren (1):
      net: smc91x: Fix gpios for device tree based booting

Vince Bridgers (1):
      net: phy: Add SGMII Configuration for Marvell 88E1145 Initialization

WANG Cong (1):
      sch_pie: schedule the timer after all init succeed

Ying Xue (2):
      tipc: fix a potential deadlock
      tipc: fix lockdep warning when intra-node messages are delivered

hayeswang (4):
      r8152: clear SELECTIVE_SUSPEND when autoresuming
      r8152: reset tp->speed before autoresuming in open function
      r8152: check WORK_ENABLE in suspend function
      r8152: stop submitting intr for -EPROTO

 Documentation/devicetree/bindings/net/smsc-lan91c111.txt |   2 +
 Documentation/ptp/testptp.mk                             |  33 +++++
 arch/arm/boot/dts/omap3-n900.dts                         |   2 +
 arch/arm/mach-omap2/pdata-quirks.c                       |   3 -
 drivers/bcma/host_pci.c                                  |   5 +-
 drivers/bcma/main.c                                      |   2 +-
 drivers/infiniband/hw/mlx4/main.c                        |  10 +-
 drivers/net/Kconfig                                      |   2 +
 drivers/net/dsa/mv88e6171.c                              |   2 +-
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c                 |  22 +--
 drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c        |  16 +--
 drivers/net/ethernet/broadcom/bcmsysport.c               |  11 +-
 drivers/net/ethernet/broadcom/cnic.c                     |   5 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c           |  55 +++++++-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c          |   7 +-
 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c      |  16 +--
 drivers/net/ethernet/cisco/enic/enic_clsf.c              |  12 +-
 drivers/net/ethernet/cisco/enic/enic_main.c              |   4 +-
 drivers/net/ethernet/freescale/fec_main.c                |   3 +-
 drivers/net/ethernet/freescale/fs_enet/mac-fec.c         |   3 +
 drivers/net/ethernet/freescale/fs_enet/mac-scc.c         |   3 +
 drivers/net/ethernet/intel/e1000/e1000_main.c            |   5 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c              |   4 +-
 drivers/net/ethernet/intel/igb/igb_main.c                |   6 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c         |   4 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c            |   2 +-
 drivers/net/ethernet/mellanox/mlx4/en_tx.c               |   7 +-
 drivers/net/ethernet/mellanox/mlx4/eq.c                  |   1 +
 drivers/net/ethernet/mellanox/mlx4/mcg.c                 |   4 +
 drivers/net/ethernet/mellanox/mlx5/core/eq.c             |   1 +
 drivers/net/ethernet/sfc/tx.c                            |   4 -
 drivers/net/ethernet/smsc/smc91x.c                       |  58 ++++++++
 drivers/net/ethernet/smsc/smc91x.h                       |   3 +
 drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c         |   7 +
 drivers/net/ethernet/ti/cpsw.c                           |  48 ++++---
 drivers/net/ethernet/ti/cpsw_ale.c                       |  29 ++++
 drivers/net/ethernet/ti/cpsw_ale.h                       |   2 +
 drivers/net/hyperv/netvsc_drv.c                          |   1 +
 drivers/net/macvlan.c                                    |  10 +-
 drivers/net/macvtap.c                                    |  16 +--
 drivers/net/phy/marvell.c                                |  19 +++
 drivers/net/tun.c                                        |  25 ++--
 drivers/net/usb/ax88179_178a.c                           |   7 +-
 drivers/net/usb/cdc_ether.c                              |  47 +++++--
 drivers/net/usb/r8152.c                                  |  17 ++-
 drivers/net/usb/usbnet.c                                 |  20 +++
 drivers/net/virtio_net.c                                 |  24 ++--
 drivers/net/wireless/ath/ath.h                           |   1 +
 drivers/net/wireless/ath/ath9k/common.c                  |   8 +-
 drivers/net/wireless/ath/ath9k/debug.c                   |   2 +-
 drivers/net/wireless/ath/ath9k/init.c                    |  55 ++++----
 drivers/net/wireless/ath/ath9k/main.c                    |   3 +
 drivers/net/wireless/ath/ath9k/xmit.c                    |  10 +-
 drivers/net/wireless/ath/regd.c                          |  14 ++
 drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c       |  25 ++--
 drivers/net/wireless/iwlwifi/dvm/mac80211.c              |  24 ++--
 drivers/net/wireless/iwlwifi/iwl-8000.c                  |   3 +-
 drivers/net/wireless/iwlwifi/iwl-trans.h                 |   2 +
 drivers/net/wireless/iwlwifi/mvm/coex.c                  |   4 +-
 drivers/net/wireless/iwlwifi/mvm/coex_legacy.c           |   4 +-
 drivers/net/wireless/iwlwifi/mvm/fw-api-power.h          |  35 ++++-
 drivers/net/wireless/iwlwifi/mvm/fw-api.h                |   1 +
 drivers/net/wireless/iwlwifi/mvm/fw.c                    |   9 ++
 drivers/net/wireless/iwlwifi/mvm/mac80211.c              |  32 +++--
 drivers/net/wireless/iwlwifi/mvm/ops.c                   |   1 +
 drivers/net/wireless/iwlwifi/mvm/scan.c                  |   3 +-
 drivers/net/wireless/iwlwifi/mvm/time-event.c            |   2 +-
 drivers/net/wireless/iwlwifi/mvm/tx.c                    |   8 +-
 drivers/net/wireless/iwlwifi/pcie/trans.c                |  22 +--
 drivers/net/wireless/mwifiex/11n_rxreorder.c             |  52 ++++++--
 drivers/net/wireless/mwifiex/11n_rxreorder.h             |   2 +
 drivers/net/wireless/mwifiex/main.h                      |   1 +
 drivers/net/wireless/rt2x00/rt2800usb.c                  |   1 +
 drivers/net/wireless/rtlwifi/base.c                      |   2 +-
 drivers/net/wireless/rtlwifi/core.c                      |   6 +
 drivers/net/wireless/rtlwifi/core.h                      |   1 +
 drivers/net/wireless/rtlwifi/pci.c                       |   3 +-
 drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c        |   8 +-
 drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h        |   4 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/def.h             |   2 +
 drivers/net/wireless/rtlwifi/rtl8192ce/hw.c              |   2 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/sw.c              |   1 +
 drivers/net/wireless/rtlwifi/rtl8192ce/trx.c             |   3 +
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c              |  17 ++-
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.h              |   1 -
 drivers/net/wireless/rtlwifi/rtl8192cu/sw.c              |   7 +
 drivers/net/wireless/rtlwifi/rtl8192de/sw.c              |   1 +
 drivers/net/wireless/rtlwifi/rtl8192ee/hw.c              |   8 +-
 drivers/net/wireless/rtlwifi/rtl8192se/def.h             |   2 +
 drivers/net/wireless/rtlwifi/rtl8192se/sw.c              |  22 +--
 drivers/net/wireless/rtlwifi/rtl8192se/trx.c             |   3 +
 drivers/net/wireless/rtlwifi/rtl8821ae/phy.c             |  15 ++-
 drivers/net/wireless/rtlwifi/usb.c                       |  11 ++
 drivers/net/xen-netback/common.h                         |  39 +++---
 drivers/net/xen-netback/interface.c                      |  74 +++-------
 drivers/net/xen-netback/netback.c                        | 319 ++++++++++++++++++++++++++++----------------
 drivers/net/xen-netback/xenbus.c                         |  22 +--
 include/linux/skbuff.h                                   |  12 +-
 include/linux/usb/usbnet.h                               |   4 +
 include/net/ipv6.h                                       |   2 +
 include/net/netfilter/ipv4/nf_reject.h                   |  10 ++
 include/net/netfilter/ipv6/nf_reject.h                   |  10 ++
 include/net/netfilter/nf_tables.h                        |   3 +
 include/net/netfilter/nft_masq.h                         |   3 +
 init/Kconfig                                             |  14 ++
 kernel/Makefile                                          |   2 +-
 kernel/bpf/Makefile                                      |   6 +-
 kernel/bpf/core.c                                        |   9 ++
 kernel/bpf/verifier.c                                    |   3 +-
 net/Kconfig                                              |   2 +-
 net/bridge/br_forward.c                                  |   1 +
 net/bridge/br_netfilter.c                                |  24 +---
 net/bridge/netfilter/nf_tables_bridge.c                  |   6 +-
 net/bridge/netfilter/nft_reject_bridge.c                 | 296 ++++++++++++++++++++++++++++++++++++++--
 net/core/dev.c                                           |   4 +
 net/core/ethtool.c                                       |   6 +-
 net/core/skbuff.c                                        |  13 +-
 net/core/tso.c                                           |   3 +-
 net/dsa/dsa.c                                            |   5 +-
 net/ipv4/af_inet.c                                       |   2 +-
 net/ipv4/gre_offload.c                                   |   4 +-
 net/ipv4/inet_fragment.c                                 |   4 +-
 net/ipv4/ip_output.c                                     |   2 +-
 net/ipv4/netfilter/nf_reject_ipv4.c                      |  91 +++++++++----
 net/ipv4/netfilter/nft_masq_ipv4.c                       |   1 +
 net/ipv4/route.c                                         |   1 +
 net/ipv4/tcp.c                                           |  59 +++-----
 net/ipv4/tcp_ipv4.c                                      |   4 +-
 net/ipv4/tcp_output.c                                    |   2 +-
 net/ipv4/udp_offload.c                                   |   2 +-
 net/ipv6/addrconf.c                                      |   1 +
 net/ipv6/ip6_offload.c                                   |   2 +-
 net/ipv6/netfilter/nf_reject_ipv6.c                      | 179 ++++++++++++++++---------
 net/ipv6/netfilter/nft_masq_ipv6.c                       |   1 +
 net/ipv6/output_core.c                                   |  34 +++++
 net/ipv6/tcp_ipv6.c                                      |   4 +-
 net/ipv6/xfrm6_policy.c                                  |  11 +-
 net/mac80211/cfg.c                                       |   2 +-
 net/mac80211/rate.c                                      |   2 +-
 net/mac80211/rc80211_minstrel_debugfs.c                  |  12 +-
 net/mac80211/rc80211_minstrel_ht_debugfs.c               |  13 +-
 net/mac80211/sta_info.h                                  |   1 +
 net/mpls/Makefile                                        |   2 +-
 net/mpls/mpls_gso.c                                      |   5 +-
 net/netfilter/ipset/ip_set_core.c                        |   2 +-
 net/netfilter/ipvs/ip_vs_xmit.c                          |   4 +-
 net/netfilter/nf_conntrack_proto_tcp.c                   |   4 +-
 net/netfilter/nf_tables_api.c                            |  18 ++-
 net/netfilter/nfnetlink_log.c                            |  31 ++---
 net/netfilter/nfnetlink_queue_core.c                     |   2 +-
 net/netfilter/nft_compat.c                               |  81 +++++++++--
 net/netfilter/nft_masq.c                                 |  12 ++
 net/netfilter/nft_nat.c                                  |  86 +++++++-----
 net/netlink/af_netlink.c                                 |  37 +++--
 net/openvswitch/datapath.c                               |   2 +
 net/sched/sch_api.c                                      |   2 +-
 net/sched/sch_pie.c                                      |   2 +-
 net/tipc/node.c                                          |  46 ++++---
 net/tipc/node.h                                          |   7 +-
 net/tipc/socket.c                                        |   6 +-
 net/wireless/nl80211.c                                   |  10 +-
 net/xfrm/xfrm_output.c                                   |   2 +
 net/xfrm/xfrm_policy.c                                   |   2 +-
 samples/bpf/test_verifier.c                              |  11 ++
 164 files changed, 1943 insertions(+), 789 deletions(-)
 create mode 100644 Documentation/ptp/testptp.mk

^ permalink raw reply

* Re: DMA allocations from CMA and fatal_signal_pending check
From: Florian Fainelli @ 2014-10-31 20:58 UTC (permalink / raw)
  To: Joonsoo Kim
  Cc: linux-arm-kernel, Brian Norris, Gregory Fong, linux-kernel,
	linux-mm, lauraa, gioh.kim, aneesh.kumar, mina86, m.szyprowski,
	akpm, netdev@vger.kernel.org
In-Reply-To: <20141031082818.GB14642@js1304-P5Q-DELUXE>

Hi Joonsoo,

On 10/31/2014 01:28 AM, Joonsoo Kim wrote:
> On Tue, Oct 28, 2014 at 12:08:46PM -0700, Florian Fainelli wrote:
>> Hello,
>>
>> While debugging why some dma_alloc_coherent() allocations where
>> returning NULL on our brcmstb platform, specifically with
>> drivers/net/ethernet/broadcom/bcmcsysport.c, I came across the
>> fatal_signal_pending() check in mm/page_alloc.c which is there.
>>
>> This driver calls dma_alloc_coherent(, GFP_KERNEL) which ends up making
>> a coherent allocation from a CMA region on our platform. Since that
>> allocation is allowed to sleep, and because we are in bcm_syport_open(),
>> executed from process context, a pending signal makes
>> dma_alloc_coherent() return NULL.
> 
> Hello, Florian.
> 
> fatal_signal_pending means that there is SIGKILL on that process.
> I guess that caller of dma_alloc_coherent() will die soon.
> In this case, why CMA should be succeed?

I agree that the CMA allocation should not be allowed to succeed, but
the dma_alloc_coherent() allocation should succeed. If we look at the
sysport driver, there are kmalloc() calls to initialize private
structures, those will succeed (except under high memory pressure), so
by the same token, a driver expects DMA allocations to succeed (unless
we are under high memory pressure)

What are we trying to solve exactly with the fatal_signal_pending()
check here? Are we just optimizing for the case where a process has
allocated from a CMA region to allow this region to be returned to the
pool of free pages when it gets killed? Could there be another mechanism
used to reclaim those pages if we know the process is getting killed anyway?

> 
>>
>> There are two ways I could fix this:
>>
>> - use a GFP_ATOMIC allocation, which would avoid this sensitivity to a
>> pending signal being fatal (we suffer from the same issue in
>> bcm_sysport_resume)
>>
>> - move the DMA coherent allocation before bcm_sysport_open(), in the
>> driver's probe function, but if the network interface is never used, we
>> would be waisting precious DMA coherent memory for nothing (it is only 4
>> bytes times 32 but still
> 
> I guess that it is okay that bcm_sysport_open() return -EINTR?

Well, not really. This driver is not an isolated case, there are tons of
other networking drivers that do exactly the same thing, and we do
expect these dma_alloc_* calls to succeed.

I think we would want to ignore the fatal_signal_pending() check for
allocations coming through the dma_alloc_* API, although I agree this
could be a tough one when they are done from process context.

Updating all drivers to switch to GFP_ATOMIC allocations is not a good
idea, since that would exhaust the atomic DMA coherent pool for no good
reason.

FYI, we are hitting the same problem during suspend/resume, if you are
unlucky enough the suspending process get interrupted, you can get a lot
of crashes from drivers that do not expect their dma_alloc_coherent()
allocation to be sensible to signals.
--
Florian

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [PATCH 2/2] staging: lustre: lnet: lnet: trailing statements should be on next line
From: Greg KH @ 2014-10-31 20:50 UTC (permalink / raw)
  To: Balavasu; +Cc: netdev, linux-kernel, andreas.dilger, oleg.drokin
In-Reply-To: <20141031182040.GA7916@vasu-Inspiron-3542>

On Fri, Oct 31, 2014 at 11:50:40PM +0530, Balavasu wrote:
> This patch fixes the checkpatch.pl issue
> Error: trailing statements should be on next line
> 
> Signed-off-by: Balavasu <kp.balavasu@gmail.com>
> ---
>  drivers/staging/lustre/lnet/lnet/router.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

Same comments as 1/2

^ permalink raw reply

* Re: [PATCH 1/2] staging: lustre: lnet: lnet: do not initialise statics to 0 or NULL
From: Greg KH @ 2014-10-31 20:50 UTC (permalink / raw)
  To: Balavasu; +Cc: netdev, linux-kernel, andreas.dilger, oleg.drokin
In-Reply-To: <20141031181808.GA7830@vasu-Inspiron-3542>

On Fri, Oct 31, 2014 at 11:48:08PM +0530, Balavasu wrote:
> This patch fixes the checkpatch.pl issue
> Error: do not initialise statics to 0 or NULL for time
> 
> Signed-off-by: Balavasu <kp.balavasu@gmail.com>
> ---
>  drivers/staging/lustre/lnet/lnet/do not instalise 0 | 10 +++++-----

That line doesn't look right, does it?

And why netdev and not the mailing list for the drivers/staging/ tree?

And again, I need a full name.

greg k-h

^ permalink raw reply

* Re: [Patch net-next] neigh: remove dynamic neigh table registration support
From: Cong Wang @ 2014-10-31 20:39 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev, David S. Miller
In-Reply-To: <1414787651-8499-1-git-send-email-xiyou.wangcong@gmail.com>

On Fri, Oct 31, 2014 at 1:34 PM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> +       switch (family) {
> +       case AF_INET:
> +               tbl = neigh_tables[NEIGH_ARP_TABLE];
> +               break;
> +#if IS_ENABLED(CONFIG_IPV6)
> +       case AF_INET6:
> +               tbl = neigh_tables[NEIGH_ND_TABLE];
> +               break;
> +#endif
> +#if IS_ENABLED(CONFIG_DECNET)
> +       case AF_DECnet:
> +               tbl = neigh_tables[NEIGH_DN_TABLE];
> +               break;
> +#endif

These #ifdef's are not necessary, I will update it after getting other
feedbacks.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox