Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net] sctp: use __GFP_NOWARN for sctpw.fifo allocation
From: Marcelo Ricardo Leitner @ 2017-08-05 17:08 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, linux-sctp, davem, Neil Horman
In-Reply-To: <53b360387db05bf31db481234e7070e4a7ba6a25.1501936269.git.lucien.xin@gmail.com>

On Sat, Aug 05, 2017 at 08:31:09PM +0800, Xin Long wrote:
> Chen Wei found a kernel call trace when modprobe sctp_probe with
> bufsize set with a huge value.
> 
> It's because in sctpprobe_init when alloc memory for sctpw.fifo,
> the size is got from userspace. If it is too large, kernel will
> fail and give a warning.

Yes but sctp_probe can only be loaded by an admin and it would happen
only during modprobe. It's different from the commit mentioned below, on
which any user could trigger it.

> 
> As there will be a fallback allocation later, this patch is just
> to fail silently and return ret, just as commit 0ccc22f425e5
> ("sit: use __GFP_NOWARN for user controlled allocation") did.
> 
> Reported-by: Chen Wei <weichen@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
>  net/sctp/probe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/sctp/probe.c b/net/sctp/probe.c
> index 6cc2152..5bf3164 100644
> --- a/net/sctp/probe.c
> +++ b/net/sctp/probe.c
> @@ -210,7 +210,7 @@ static __init int sctpprobe_init(void)
>  
>  	init_waitqueue_head(&sctpw.wait);
>  	spin_lock_init(&sctpw.lock);
> -	if (kfifo_alloc(&sctpw.fifo, bufsize, GFP_KERNEL))
> +	if (kfifo_alloc(&sctpw.fifo, bufsize, GFP_KERNEL | __GFP_NOWARN))
>  		return ret;
>  
>  	if (!proc_create(procname, S_IRUSR, init_net.proc_net,
> -- 
> 2.1.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply

* Re: [PATCH] samples/bpf: Fix cross compiler error with bpf sample
From: Joel Fernandes @ 2017-08-05 18:53 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: LKML, Alexei Starovoitov,
	open list:BPF (Safe dynamic programs and tools), Marc Zyngier,
	Will Deacon
In-Reply-To: <5984C09B.8090301@iogearbox.net>

Hi Daniel,

<snip>
>>>
>>> So the only arch that sets __ARCH_WANT_SYSCALL_DEPRECATED
>>> is score:
>>>
>>>    $ git grep -n __ARCH_WANT_SYSCALL_DEPRECATED
>>>    arch/score/include/uapi/asm/unistd.h:7:#define
>>> __ARCH_WANT_SYSCALL_DEPRECATED
>>>    include/uapi/asm-generic/unistd.h:837:#ifdef
>>> __ARCH_WANT_SYSCALL_DEPRECATED
>>>    include/uapi/asm-generic/unistd.h:899:#endif /*
>>> __ARCH_WANT_SYSCALL_DEPRECATED */
>>>
>>> But even if this would make aarch64 compile, the syscall
>>> numbers don't match up:
>>>
>>>    $ git grep -n __NR_getpgrp include/uapi/asm-generic/unistd.h
>>>    include/uapi/asm-generic/unistd.h:841:#define __NR_getpgrp 1060
>>>    include/uapi/asm-generic/unistd.h:843:__SYSCALL(__NR_getpgrp,
>>> sys_getpgrp)
>>>
>>> The only thing that can be found on arm64 is:
>>>
>>>    $ git grep -n __NR_getpgrp arch/arm64/
>>>    arch/arm64/include/asm/unistd32.h:154:#define __NR_getpgrp 65
>>>    arch/arm64/include/asm/unistd32.h:155:__SYSCALL(__NR_getpgrp,
>>> sys_getpgrp)
>>>
>>> In arch/arm64/include/asm/unistd.h, it does include the
>>> uapi/asm/unistd.h when compat is not set, but without the
>>> __ARCH_WANT_SYSCALL_DEPRECATED. That doesn't look correct
>>> unless I'm missing something, hmm, can't we just attach the
>>> kprobes to a different syscall, one that is not deprecated,
>>> so that we don't run into this in the first place?
>>
>>
>> Yes, I agree that's better. I think we can use getpgid. I'll try to
>> whip something today and send it out.

So switching to getppid fixes it, however most of the _kern.o BPF
samples still don't build on aarch64 for me.

The trouble is with inline assembler statements in the ARM64 asm
include headers (which I think upsets LLVM/clang when building for the
BPF target).

Also about skipping headers to fix this, currently we pass
-D__ASM_SYSREG_H from samples/bpf/Makefile so that inline assembler
statements are skipped (this was added in 2015 to this file). However,
not including this causes build errors at the moment. So as sysreg.h
isn't included, the SYS_MIDR_EL1 macro from
arch/arm64/include/asm/sysreg.h is missing causing this build error.
This caused by an include originating from skbuff.h :

In file included from samples/bpf/map_perf_test_kern.c:7:
In file included from ./include/linux/skbuff.h:17:
In file included from ./include/linux/kernel.h:13:
In file included from ./include/linux/printk.h:8:
In file included from ./include/linux/cache.h:5:
In file included from ./arch/arm64/include/asm/cache.h:19:
./arch/arm64/include/asm/cputype.h:119:9: error: use of undeclared
identifier 'SYS_MPIDR_EL1'
        return read_cpuid(MPIDR_EL1);
               ^

There are other paths too like mm.h including asm/pgtable.h which
breaks because of the inline assembler issues.

In file included from samples/bpf/map_perf_test_kern.c:7:
In file included from ./include/linux/skbuff.h:34:
In file included from ./include/linux/dma-mapping.h:10:
In file included from ./include/linux/scatterlist.h:7:
In file included from ./include/linux/mm.h:70:
./arch/arm64/include/asm/pgtable.h:607:9: error: value
'18446744073709550591' out of range for constraint 'L'
        : "L" (~PTE_AF), "I" (ilog2(PTE_AF)));


I believe the main problem here is we are trying to build for BPF
target while including ARM64 asm headers (which I think we can't
avoid?). I was thinking of just setting ARCH to x86 when compiling the
_kern.o parts of the bpf samples. However that doesn't make sense as
we probably need to be arch aware in the samples?

I am at a loss at the moment for ideas. I would love to get any other
ideas - how does x86 solve this issue?. I tried doing something like:
skip as many asm headers using the -D trick,  passing "-include
<stubs.h>" and defining as many things as I can in stubs.h as noops.
However I got stuck with that idea when I hit the above mm build
error.

I am also CC'ing some ARM64 folks as well for any thoughts, I am
looking forward to getting the samples working on my arm64 platform.

Thanks!

Best,

-Joel




>
> Ok, cool. Please make sure that this doesn't clash with anything
> else attached to map_perf_test_kern.c already given the obj file
> is loaded first with the attachment points.
>
>> I also wanted to fix something else, HOSTCC is set to gcc, but I want
>> the boostrap part of the sample to run an ARM so I have to make HOSTCC
>> my cross-compiler. Right now I'm hacking it to point to the arm64 gcc
>> however I think I'd like to add a 'cross compile mode' or something
>> whether HOSTCC points to CROSS_COMPILE instead. I'm happy to discuss
>> any ideas to get this fixed too.
>
>
> Yeah, sounds like a good idea to add such possibility. In case of
> cross compiling to a target arch with different endianess, you might
> also need to specifically select bpfeb (big endian) resp. bpfel
> (little endian) as clang target. (Just bpf target uses host endianess.)
>
> Thanks, Joel!

^ permalink raw reply

* Re: [PATCH net-next 1/3] net: dsa: assign switch device in legacy code
From: Vivien Didelot @ 2017-08-05 20:09 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: netdev, linux-kernel, kernel, David S. Miller, Florian Fainelli
In-Reply-To: <20170805005526.GA19193@lunn.ch>

Hi Andrew,

Andrew Lunn <andrew@lunn.ch> writes:

>> @@ -251,8 +251,9 @@ dsa_switch_setup(struct dsa_switch_tree *dst, struct net_device *master,
>>  	ds->cd = cd;
>>  	ds->ops = ops;
>>  	ds->priv = priv;
>> +	ds->dev = parent;
>
> Is this even needed? dsa_switch_alloc() does ds->dev = dev.

You are correct! Respinning.


Thanks,

        Vivien

^ permalink raw reply

* [PATCH net-next v2 1/3] net: dsa: remove useless argument in legacy setup
From: Vivien Didelot @ 2017-08-05 20:20 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
	Andrew Lunn, Vivien Didelot
In-Reply-To: <20170805202019.1679-1-vivien.didelot@savoirfairelinux.com>

dsa_switch_alloc() already assigns ds-dev, which can be used in
dsa_switch_setup_one and dsa_cpu_dsa_setups instead of requiring an
additional struct device argument.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 net/dsa/legacy.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c
index 1d7a3282f2a7..fa162030a69c 100644
--- a/net/dsa/legacy.c
+++ b/net/dsa/legacy.c
@@ -78,7 +78,7 @@ dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr,
 }
 
 /* basic switch operations **************************************************/
-static int dsa_cpu_dsa_setups(struct dsa_switch *ds, struct device *dev)
+static int dsa_cpu_dsa_setups(struct dsa_switch *ds)
 {
 	struct dsa_port *dport;
 	int ret, port;
@@ -88,15 +88,15 @@ static int dsa_cpu_dsa_setups(struct dsa_switch *ds, struct device *dev)
 			continue;
 
 		dport = &ds->ports[port];
-		ret = dsa_cpu_dsa_setup(ds, dev, dport, port);
+		ret = dsa_cpu_dsa_setup(ds, ds->dev, dport, port);
 		if (ret)
 			return ret;
 	}
 	return 0;
 }
 
-static int dsa_switch_setup_one(struct dsa_switch *ds, struct net_device *master,
-				struct device *parent)
+static int dsa_switch_setup_one(struct dsa_switch *ds,
+				struct net_device *master)
 {
 	const struct dsa_switch_ops *ops = ds->ops;
 	struct dsa_switch_tree *dst = ds->dst;
@@ -176,7 +176,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct net_device *master
 	}
 
 	if (!ds->slave_mii_bus && ops->phy_read) {
-		ds->slave_mii_bus = devm_mdiobus_alloc(parent);
+		ds->slave_mii_bus = devm_mdiobus_alloc(ds->dev);
 		if (!ds->slave_mii_bus)
 			return -ENOMEM;
 		dsa_slave_mii_bus_init(ds);
@@ -196,14 +196,14 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct net_device *master
 		if (!(ds->enabled_port_mask & (1 << i)))
 			continue;
 
-		ret = dsa_slave_create(ds, parent, i, cd->port_names[i]);
+		ret = dsa_slave_create(ds, ds->dev, i, cd->port_names[i]);
 		if (ret < 0)
 			netdev_err(master, "[%d]: can't create dsa slave device for port %d(%s): %d\n",
 				   index, i, cd->port_names[i], ret);
 	}
 
 	/* Perform configuration of the CPU and DSA ports */
-	ret = dsa_cpu_dsa_setups(ds, parent);
+	ret = dsa_cpu_dsa_setups(ds);
 	if (ret < 0)
 		netdev_err(master, "[%d] : can't configure CPU and DSA ports\n",
 			   index);
@@ -252,7 +252,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, struct net_device *master,
 	ds->ops = ops;
 	ds->priv = priv;
 
-	ret = dsa_switch_setup_one(ds, master, parent);
+	ret = dsa_switch_setup_one(ds, master);
 	if (ret)
 		return ERR_PTR(ret);
 
-- 
2.13.3

^ permalink raw reply related

* [PATCH net-next v2 2/3] net: dsa: remove useless args of dsa_cpu_dsa_setup
From: Vivien Didelot @ 2017-08-05 20:20 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
	Andrew Lunn, Vivien Didelot
In-Reply-To: <20170805202019.1679-1-vivien.didelot@savoirfairelinux.com>

dsa_cpu_dsa_setup currently takes 4 arguments but they are all available
from the dsa_port argument. Remove all others.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 net/dsa/dsa.c      | 10 +++++-----
 net/dsa/dsa2.c     |  4 ++--
 net/dsa/dsa_priv.h |  3 +--
 net/dsa/legacy.c   |  4 +---
 4 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 0ba842c08dd3..64db6eece3c1 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -67,17 +67,17 @@ const struct dsa_device_ops *dsa_device_ops[DSA_TAG_LAST] = {
 	[DSA_TAG_PROTO_NONE] = &none_ops,
 };
 
-int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct device *dev,
-		      struct dsa_port *dport, int port)
+int dsa_cpu_dsa_setup(struct dsa_port *port)
 {
-	struct device_node *port_dn = dport->dn;
+	struct device_node *port_dn = port->dn;
+	struct dsa_switch *ds = port->ds;
 	struct phy_device *phydev;
 	int ret, mode;
 
 	if (of_phy_is_fixed_link(port_dn)) {
 		ret = of_phy_register_fixed_link(port_dn);
 		if (ret) {
-			dev_err(dev, "failed to register fixed PHY\n");
+			dev_err(ds->dev, "failed to register fixed PHY\n");
 			return ret;
 		}
 		phydev = of_phy_find_device(port_dn);
@@ -90,7 +90,7 @@ int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct device *dev,
 		genphy_config_init(phydev);
 		genphy_read_status(phydev);
 		if (ds->ops->adjust_link)
-			ds->ops->adjust_link(ds, port, phydev);
+			ds->ops->adjust_link(ds, port->index, phydev);
 
 		put_device(&phydev->mdio.dev);
 	}
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index c442051d5a55..2a0120493cf1 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -219,7 +219,7 @@ static int dsa_dsa_port_apply(struct dsa_port *port)
 	struct dsa_switch *ds = port->ds;
 	int err;
 
-	err = dsa_cpu_dsa_setup(ds, ds->dev, port, port->index);
+	err = dsa_cpu_dsa_setup(port);
 	if (err) {
 		dev_warn(ds->dev, "Failed to setup dsa port %d: %d\n",
 			 port->index, err);
@@ -243,7 +243,7 @@ static int dsa_cpu_port_apply(struct dsa_port *port)
 	struct dsa_switch *ds = port->ds;
 	int err;
 
-	err = dsa_cpu_dsa_setup(ds, ds->dev, port, port->index);
+	err = dsa_cpu_dsa_setup(port);
 	if (err) {
 		dev_warn(ds->dev, "Failed to setup cpu port %d: %d\n",
 			 port->index, err);
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
index 7aa0656296c2..46851c91c7fe 100644
--- a/net/dsa/dsa_priv.h
+++ b/net/dsa/dsa_priv.h
@@ -101,8 +101,7 @@ struct dsa_slave_priv {
 };
 
 /* dsa.c */
-int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct device *dev,
-		      struct dsa_port *dport, int port);
+int dsa_cpu_dsa_setup(struct dsa_port *port);
 void dsa_cpu_dsa_destroy(struct dsa_port *dport);
 const struct dsa_device_ops *dsa_resolve_tag_protocol(int tag_protocol);
 int dsa_cpu_port_ethtool_setup(struct dsa_port *cpu_dp);
diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c
index fa162030a69c..903e8d70c792 100644
--- a/net/dsa/legacy.c
+++ b/net/dsa/legacy.c
@@ -80,15 +80,13 @@ dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr,
 /* basic switch operations **************************************************/
 static int dsa_cpu_dsa_setups(struct dsa_switch *ds)
 {
-	struct dsa_port *dport;
 	int ret, port;
 
 	for (port = 0; port < ds->num_ports; port++) {
 		if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)))
 			continue;
 
-		dport = &ds->ports[port];
-		ret = dsa_cpu_dsa_setup(ds, ds->dev, dport, port);
+		ret = dsa_cpu_dsa_setup(&ds->ports[port]);
 		if (ret)
 			return ret;
 	}
-- 
2.13.3

^ permalink raw reply related

* [PATCH net-next v2 3/3] net: dsa: remove useless args of dsa_slave_create
From: Vivien Didelot @ 2017-08-05 20:20 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
	Andrew Lunn, Vivien Didelot
In-Reply-To: <20170805202019.1679-1-vivien.didelot@savoirfairelinux.com>

dsa_slave_create currently takes 4 arguments while it only needs the
related dsa_port and its name. Remove all other arguments.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 net/dsa/dsa2.c     |  2 +-
 net/dsa/dsa_priv.h |  3 +--
 net/dsa/legacy.c   |  2 +-
 net/dsa/slave.c    | 14 +++++++-------
 4 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 2a0120493cf1..cceaa4dd9f53 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -275,7 +275,7 @@ static int dsa_user_port_apply(struct dsa_port *port)
 	if (!name)
 		name = "eth%d";
 
-	err = dsa_slave_create(ds, ds->dev, port->index, name);
+	err = dsa_slave_create(port, name);
 	if (err) {
 		dev_warn(ds->dev, "Failed to create slave %d: %d\n",
 			 port->index, err);
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
index 46851c91c7fe..73426f9c2cca 100644
--- a/net/dsa/dsa_priv.h
+++ b/net/dsa/dsa_priv.h
@@ -148,8 +148,7 @@ int dsa_port_vlan_dump(struct dsa_port *dp,
 extern const struct dsa_device_ops notag_netdev_ops;
 void dsa_slave_mii_bus_init(struct dsa_switch *ds);
 void dsa_cpu_port_ethtool_init(struct ethtool_ops *ops);
-int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
-		     int port, const char *name);
+int dsa_slave_create(struct dsa_port *port, const char *name);
 void dsa_slave_destroy(struct net_device *slave_dev);
 int dsa_slave_suspend(struct net_device *slave_dev);
 int dsa_slave_resume(struct net_device *slave_dev);
diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c
index 903e8d70c792..612acf16d573 100644
--- a/net/dsa/legacy.c
+++ b/net/dsa/legacy.c
@@ -194,7 +194,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds,
 		if (!(ds->enabled_port_mask & (1 << i)))
 			continue;
 
-		ret = dsa_slave_create(ds, ds->dev, i, cd->port_names[i]);
+		ret = dsa_slave_create(&ds->ports[i], cd->port_names[i]);
 		if (ret < 0)
 			netdev_err(master, "[%d]: can't create dsa slave device for port %d(%s): %d\n",
 				   index, i, cd->port_names[i], ret);
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 83252e8426d7..8e25ca412672 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1165,9 +1165,9 @@ int dsa_slave_resume(struct net_device *slave_dev)
 	return 0;
 }
 
-int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
-		     int port, const char *name)
+int dsa_slave_create(struct dsa_port *port, const char *name)
 {
+	struct dsa_switch *ds = port->ds;
 	struct dsa_switch_tree *dst = ds->dst;
 	struct net_device *master;
 	struct net_device *slave_dev;
@@ -1197,13 +1197,13 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
 	netdev_for_each_tx_queue(slave_dev, dsa_slave_set_lockdep_class_one,
 				 NULL);
 
-	SET_NETDEV_DEV(slave_dev, parent);
-	slave_dev->dev.of_node = ds->ports[port].dn;
+	SET_NETDEV_DEV(slave_dev, port->ds->dev);
+	slave_dev->dev.of_node = port->dn;
 	slave_dev->vlan_features = master->vlan_features;
 
 	p = netdev_priv(slave_dev);
 	u64_stats_init(&p->stats64.syncp);
-	p->dp = &ds->ports[port];
+	p->dp = port;
 	INIT_LIST_HEAD(&p->mall_tc_list);
 	p->xmit = dst->tag_ops->xmit;
 
@@ -1211,12 +1211,12 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
 	p->old_link = -1;
 	p->old_duplex = -1;
 
-	ds->ports[port].netdev = slave_dev;
+	port->netdev = slave_dev;
 	ret = register_netdev(slave_dev);
 	if (ret) {
 		netdev_err(master, "error %d registering interface %s\n",
 			   ret, slave_dev->name);
-		ds->ports[port].netdev = NULL;
+		port->netdev = NULL;
 		free_netdev(slave_dev);
 		return ret;
 	}
-- 
2.13.3

^ permalink raw reply related

* [PATCH net-next v2 0/3] net: dsa: remove useless arguments
From: Vivien Didelot @ 2017-08-05 20:20 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
	Andrew Lunn, Vivien Didelot

Several DSA core setup functions take many arguments, mostly because of
the legacy code. This patch series removes the useless args of these
functions, where either the dsa_switch or dsa_port argument is enough.

Changes in v2:
  - ds->dev is already assigned by dsa_switch_alloc

Vivien Didelot (3):
  net: dsa: remove useless argument in legacy setup
  net: dsa: remove useless args of dsa_cpu_dsa_setup
  net: dsa: remove useless args of dsa_slave_create

 net/dsa/dsa.c      | 10 +++++-----
 net/dsa/dsa2.c     |  6 +++---
 net/dsa/dsa_priv.h |  6 ++----
 net/dsa/legacy.c   | 18 ++++++++----------
 net/dsa/slave.c    | 14 +++++++-------
 5 files changed, 25 insertions(+), 29 deletions(-)

-- 
2.13.3

^ permalink raw reply

* Fw: [Bug 196595] New: Regression IGMP sysctl init values if not IP_MULTICAST
From: Stephen Hemminger @ 2017-08-06  4:38 UTC (permalink / raw)
  To: netdev



Begin forwarded message:

Date: Sat, 05 Aug 2017 23:57:48 +0000
From: bugzilla-daemon@bugzilla.kernel.org
To: stephen@networkplumber.org
Subject: [Bug 196595] New: Regression IGMP sysctl init values if not IP_MULTICAST


https://bugzilla.kernel.org/show_bug.cgi?id=196595

            Bug ID: 196595
           Summary: Regression IGMP sysctl init values if not IP_MULTICAST
           Product: Networking
           Version: 2.5
    Kernel Version: 4.5 - 4.12
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: IPV4
          Assignee: stephen@networkplumber.org
          Reporter: vmlinuz386@gmail.com
        Regression: No

I just upgraded from 4.4.x to 4.12.x and detected that igmp related settings
are not set to default values (1, 20, 10):

net.ipv4.igmp_link_local_mcast_reports = 0
net.ipv4.igmp_max_memberships = 0
net.ipv4.igmp_max_msf = 0

This is fixed if I enable IP_MULTICAST. Looks like a regression since some
changes made to "Namespaceify" commit dcd87999d415d39cf2ae510bfed6b8206d778e1c 
and related commits.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply

* Re: [PATCH net] sctp: use __GFP_NOWARN for sctpw.fifo allocation
From: Xin Long @ 2017-08-06  6:14 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner; +Cc: network dev, linux-sctp, davem, Neil Horman
In-Reply-To: <20170805170859.GA7613@localhost.localdomain>

On Sun, Aug 6, 2017 at 5:08 AM, Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
> On Sat, Aug 05, 2017 at 08:31:09PM +0800, Xin Long wrote:
>> Chen Wei found a kernel call trace when modprobe sctp_probe with
>> bufsize set with a huge value.
>>
>> It's because in sctpprobe_init when alloc memory for sctpw.fifo,
>> the size is got from userspace. If it is too large, kernel will
>> fail and give a warning.
>
> Yes but sctp_probe can only be loaded by an admin and it would happen
> only during modprobe. It's different from the commit mentioned below, on
> which any user could trigger it.
yeah, in this way it's different, I think generally it's acceptable to have
this kinda warning call trace by admin.

But it could get the feedback from the return value and the warning
call trace seems not useful. sometimes users may be confused
with this call trace. So it may be better not to dump the warning ?

Or you think it can be helpful if we leave it here ?

>
>>
>> As there will be a fallback allocation later, this patch is just
>> to fail silently and return ret, just as commit 0ccc22f425e5
>> ("sit: use __GFP_NOWARN for user controlled allocation") did.
>>
>> Reported-by: Chen Wei <weichen@redhat.com>
>> Signed-off-by: Xin Long <lucien.xin@gmail.com>
>> ---
>>  net/sctp/probe.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/sctp/probe.c b/net/sctp/probe.c
>> index 6cc2152..5bf3164 100644
>> --- a/net/sctp/probe.c
>> +++ b/net/sctp/probe.c
>> @@ -210,7 +210,7 @@ static __init int sctpprobe_init(void)
>>
>>       init_waitqueue_head(&sctpw.wait);
>>       spin_lock_init(&sctpw.lock);
>> -     if (kfifo_alloc(&sctpw.fifo, bufsize, GFP_KERNEL))
>> +     if (kfifo_alloc(&sctpw.fifo, bufsize, GFP_KERNEL | __GFP_NOWARN))
>>               return ret;
>>
>>       if (!proc_create(procname, S_IRUSR, init_net.proc_net,
>> --
>> 2.1.0
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>

^ permalink raw reply

* [PATCH 0/3] ATM-iphase: Adjustments for some function implementations
From: SF Markus Elfring @ 2017-08-06  6:23 UTC (permalink / raw)
  To: linux-atm-general, netdev, Chas Williams; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 6 Aug 2017 08:18:28 +0200

A few update suggestions were taken into account
from static source code analysis.

Markus Elfring (3):
  Adjust 11 function calls together with a variable assignment
  Delete five error messages for a failed memory allocation
  Adjust four checks for null pointers

 drivers/atm/iphase.c | 95 +++++++++++++++++++++++++++-------------------------
 1 file changed, 49 insertions(+), 46 deletions(-)

-- 
2.13.4

^ permalink raw reply

* [PATCH 1/3] ATM-iphase: Adjust 11 function calls together with a variable assignment
From: SF Markus Elfring @ 2017-08-06  6:26 UTC (permalink / raw)
  To: linux-atm-general, netdev, Chas Williams; +Cc: LKML, kernel-janitors
In-Reply-To: <c30df8dd-a6e9-23c1-842b-afa8696e10d4@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 5 Aug 2017 21:39:06 +0200

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/atm/iphase.c | 57 +++++++++++++++++++++++++++++++---------------------
 1 file changed, 34 insertions(+), 23 deletions(-)

diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index fc72b763fdd7..472762f70921 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -152,7 +152,8 @@ static void ia_hack_tcq(IADEV *dev) {
         *(u_short *) (dev->seg_ram + dev->host_tcq_wr) = 0;
      }                                 
      else if (dev->desc_tbl[desc1 -1].timestamp) {
-        if (!(iavcc_r = dev->desc_tbl[desc1 -1].iavcc)) { 
+			iavcc_r = dev->desc_tbl[desc1 - 1].iavcc;
+			if (!iavcc_r) {
            printk("IA: Fatal err in get_desc\n");
            continue;
         }
@@ -617,7 +618,8 @@ static int ia_que_tx (IADEV *iadev) {
    num_desc = ia_avail_descs(iadev);
 
    while (num_desc && (skb = skb_dequeue(&iadev->tx_backlog))) {
-      if (!(vcc = ATM_SKB(skb)->vcc)) {
+		vcc = ATM_SKB(skb)->vcc;
+		if (!vcc) {
          dev_kfree_skb_any(skb);
          printk("ia_que_tx: Null vcc\n");
          break;
@@ -1172,8 +1174,9 @@ static int rx_pkt(struct atm_dev *dev)
            atomic_inc(&vcc->stats->rx_err);
 	   goto out_free_desc;
         }
-		  
-        if (!(skb = atm_alloc_charge(vcc, len, GFP_ATOMIC))) {
+
+	skb = atm_alloc_charge(vcc, len, GFP_ATOMIC);
+	if (!skb) {
            if (vcc->vci < 32)
               printk("Drop control packets\n");
 	   goto out_free_desc;
@@ -1296,7 +1299,8 @@ static void rx_dle_intr(struct atm_dev *dev)
       desc = ATM_DESC(skb);
       free_desc(dev, desc);  
                
-      if (!(len = skb->len))
+	len = skb->len;
+	if (!len)
       {  
           printk("rx_dle_intr: skb len 0\n");  
 	  dev_kfree_skb_any(skb);  
@@ -1882,9 +1886,9 @@ static int open_tx(struct atm_vcc *vcc)
                 }
                 vc->type = CBR;
                 vc->status = CRC_APPEND;
-                if ((ret = ia_cbr_setup (iadev, vcc)) < 0) {     
-                    return ret;
-                }
+		ret = ia_cbr_setup(iadev, vcc);
+		if (ret < 0)
+			return ret;
 	} else {
 		printk("iadev:  Non UBR, ABR and CBR traffic not supported\n");
 	}
@@ -2293,15 +2297,19 @@ static int reset_sar(struct atm_dev *dev)
 	unsigned int pci[64];  
 	  
 	iadev = INPH_IA_DEV(dev);  
-	for(i=0; i<64; i++)  
-	  if ((error = pci_read_config_dword(iadev->pci,  
-				i*4, &pci[i])) != PCIBIOS_SUCCESSFUL)  
-  	      return error;  
+	for (i = 0; i < 64; i++) {
+		error = pci_read_config_dword(iadev->pci, i * 4, &pci[i]);
+		if (error != PCIBIOS_SUCCESSFUL)
+			return error;
+	}
+
 	writel(0, iadev->reg+IPHASE5575_EXT_RESET);  
-	for(i=0; i<64; i++)  
-	  if ((error = pci_write_config_dword(iadev->pci,  
-					i*4, pci[i])) != PCIBIOS_SUCCESSFUL)  
-	    return error;  
+	for (i = 0; i < 64; i++) {
+		error = pci_write_config_dword(iadev->pci, i * 4, pci[i]);
+		if (error != PCIBIOS_SUCCESSFUL)
+			return error;
+	}
+
 	udelay(5);  
 	return 0;  
 }  
@@ -2516,9 +2524,10 @@ static int ia_start(struct atm_dev *dev)
         }  
         /* @@@ should release IRQ on error */  
 	/* enabling memory + master */  
-        if ((error = pci_write_config_word(iadev->pci,   
-				PCI_COMMAND,   
-				PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER )))   
+	error = pci_write_config_word(iadev->pci,
+				      PCI_COMMAND,
+				      PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
+	if (error)
 	{  
                 printk(KERN_ERR DEV_LABEL "(itf %d): can't enable memory+"  
                     "master (0x%x)\n",dev->number, error);  
@@ -2569,7 +2578,8 @@ static int ia_start(struct atm_dev *dev)
                                readl(iadev->reg+IPHASE5575_BUS_CONTROL_REG));)  
         phy = 0; /* resolve compiler complaint */
         IF_INIT ( 
-	if ((phy=ia_phy_get(dev,0)) == 0x30)  
+	phy = ia_phy_get(dev, 0);
+	if (phy == 0x30)
 		printk("IA: pm5346,rev.%d\n",phy&0x0f);  
 	else  
 		printk("IA: utopia,rev.%0x\n",phy);) 
@@ -2710,15 +2720,16 @@ static int ia_open(struct atm_vcc *vcc)
 	ia_vcc = kmalloc(sizeof(*ia_vcc), GFP_KERNEL);  
 	if (!ia_vcc) return -ENOMEM;  
 	vcc->dev_data = ia_vcc;
-  
-	if ((error = open_rx(vcc)))  
+	error = open_rx(vcc);
+	if (error)
 	{  
 		IF_EVENT(printk("iadev: error in open_rx, closing\n");)  
 		ia_close(vcc);  
 		return error;  
 	}  
   
-	if ((error = open_tx(vcc)))  
+	error = open_tx(vcc);
+	if (error)
 	{  
 		IF_EVENT(printk("iadev: error in open_tx, closing\n");)  
 		ia_close(vcc);  
-- 
2.13.4

^ permalink raw reply related

* [PATCH 2/3] ATM-iphase: Delete five error messages for a failed memory allocation
From: SF Markus Elfring @ 2017-08-06  6:28 UTC (permalink / raw)
  To: linux-atm-general, netdev, Chas Williams; +Cc: LKML, kernel-janitors
In-Reply-To: <c30df8dd-a6e9-23c1-842b-afa8696e10d4@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 5 Aug 2017 22:10:41 +0200

Omit extra messages for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/atm/iphase.c | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 472762f70921..ad4c1b41ba98 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -1623,11 +1623,8 @@ static int rx_init(struct atm_dev *dev)
 	iadev->rx_free_desc_qhead = NULL;   
 
 	iadev->rx_open = kzalloc(4 * iadev->num_vc, GFP_KERNEL);
-	if (!iadev->rx_open) {
-		printk(KERN_ERR DEV_LABEL "itf %d couldn't get free page\n",
-		dev->number);  
+	if (!iadev->rx_open)
 		goto err_free_dle;
-	}  
 
         iadev->rxing = 1;
         iadev->rx_pkt_cnt = 0;
@@ -1982,19 +1979,17 @@ static int tx_init(struct atm_dev *dev)
 	iadev->tx_buf = kmalloc_array(iadev->num_tx_desc,
 				      sizeof(*iadev->tx_buf),
 				      GFP_KERNEL);
-        if (!iadev->tx_buf) {
-            printk(KERN_ERR DEV_LABEL " couldn't get mem\n");
-	    goto err_free_dle;
-        }
+	if (!iadev->tx_buf)
+		goto err_free_dle;
+
        	for (i= 0; i< iadev->num_tx_desc; i++)
        	{
 	    struct cpcs_trailer *cpcs;
  
        	    cpcs = kmalloc(sizeof(*cpcs), GFP_KERNEL|GFP_DMA);
-            if(!cpcs) {                
-		printk(KERN_ERR DEV_LABEL " couldn't get freepage\n"); 
-		goto err_free_tx_bufs;
-            }
+		if (!cpcs)
+			goto err_free_tx_bufs;
+
 	    iadev->tx_buf[i].cpcs = cpcs;
 	    iadev->tx_buf[i].dma_addr = dma_map_single(&iadev->pci->dev,
 						       cpcs,
@@ -2004,10 +1999,8 @@ static int tx_init(struct atm_dev *dev)
 	iadev->desc_tbl = kmalloc_array(iadev->num_tx_desc,
 					sizeof(*iadev->desc_tbl),
 					GFP_KERNEL);
-	if (!iadev->desc_tbl) {
-		printk(KERN_ERR DEV_LABEL " couldn't get mem\n");
+	if (!iadev->desc_tbl)
 		goto err_free_all_tx_bufs;
-	}
   
 	/* Communication Queues base address */  
         i = TX_COMP_Q * iadev->memSize;
@@ -2134,10 +2127,9 @@ static int tx_init(struct atm_dev *dev)
 	iadev->testTable = kmalloc_array(iadev->num_vc,
 					 sizeof(*iadev->testTable),
 					 GFP_KERNEL);
-        if (!iadev->testTable) {
-           printk("Get freepage  failed\n");
-	   goto err_free_desc_tbl;
-        }
+	if (!iadev->testTable)
+		goto err_free_desc_tbl;
+
 	for(i=0; i<iadev->num_vc; i++)  
 	{  
 		memset((caddr_t)vc, 0, sizeof(*vc));  
-- 
2.13.4

^ permalink raw reply related

* [PATCH 3/3] ATM-iphase: Adjust four checks for null pointers
From: SF Markus Elfring @ 2017-08-06  6:30 UTC (permalink / raw)
  To: linux-atm-general, netdev, Chas Williams; +Cc: LKML, kernel-janitors
In-Reply-To: <c30df8dd-a6e9-23c1-842b-afa8696e10d4@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 5 Aug 2017 22:30:04 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written !…

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/atm/iphase.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index ad4c1b41ba98..19782fed572a 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -101,7 +101,7 @@ static void ia_init_rtn_q (IARTN_Q *que)
 static void ia_enque_head_rtn_q (IARTN_Q *que, IARTN_Q * data) 
 {
    data->next = NULL;
-   if (que->next == NULL) 
+	if (!que->next)
       que->next = que->tail = data;
    else {
       data->next = que->next;
@@ -116,7 +116,7 @@ static int ia_enque_rtn_q (IARTN_Q *que, struct desc_tbl_t data) {
       return -ENOMEM;
    entry->data = data;
    entry->next = NULL;
-   if (que->next == NULL) 
+	if (!que->next)
       que->next = que->tail = entry;
    else {
       que->tail->next = entry;
@@ -127,7 +127,7 @@ static int ia_enque_rtn_q (IARTN_Q *que, struct desc_tbl_t data) {
 
 static IARTN_Q * ia_deque_rtn_q (IARTN_Q *que) {
    IARTN_Q *tmpdata;
-   if (que->next == NULL)
+	if (!que->next)
       return NULL;
    tmpdata = que->next;
    if ( que->next == que->tail)  
@@ -1321,7 +1321,7 @@ static void rx_dle_intr(struct atm_dev *dev)
               goto INCR_DLE;
           }
           ia_vcc = INPH_IA_VCC(vcc);
-          if (ia_vcc == NULL)
+		if (!ia_vcc)
           {
              atomic_inc(&vcc->stats->rx_err);
              atm_return(vcc, skb->truesize);
-- 
2.13.4

^ permalink raw reply related

* [PATCH] can: c_can_pci: make c_can_pci_data const
From: Bhumika Goyal @ 2017-08-06  6:48 UTC (permalink / raw)
  To: julia.lawall, wg, mkl, linux-can, netdev, linux-kernel; +Cc: Bhumika Goyal

Make c_can_pci_data structures const as they are only used during
a copy operation.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/net/can/c_can/c_can_pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
index cf7c189..70f5659 100644
--- a/drivers/net/can/c_can/c_can_pci.c
+++ b/drivers/net/can/c_can/c_can_pci.c
@@ -252,14 +252,14 @@ static void c_can_pci_remove(struct pci_dev *pdev)
 	pci_disable_device(pdev);
 }
 
-static struct c_can_pci_data c_can_sta2x11= {
+static const struct c_can_pci_data c_can_sta2x11= {
 	.type = BOSCH_C_CAN,
 	.reg_align = C_CAN_REG_ALIGN_32,
 	.freq = 52000000, /* 52 Mhz */
 	.bar = 0,
 };
 
-static struct c_can_pci_data c_can_pch = {
+static const struct c_can_pci_data c_can_pch = {
 	.type = BOSCH_C_CAN,
 	.reg_align = C_CAN_REG_32,
 	.freq = 50000000, /* 50 MHz */
-- 
1.9.1

^ permalink raw reply related

* RE: XFRM pcpu cache issue
From: Ilan Tayari @ 2017-08-06  6:50 UTC (permalink / raw)
  To: Florian Westphal
  Cc: Steffen Klassert, netdev@vger.kernel.org, Yevgeny Kliteynik,
	Yossi Kuperman, Boris Pismenny, Yossef Efraim, Ayham Masood
In-Reply-To: <20170804165543.GD15456@breakpoint.cc>

> -----Original Message-----
> From: Florian Westphal [mailto:fw@strlen.de]
> Subject: Re: XFRM pcpu cache issue
> 
> I dropped the stale_bundle() check vs. rfc, that was a stupid thing
> to do because that is what would detect this....
> 
> Does this help?

Yes, this fixes the regression for me.

Reported-by: Ayham Masood <ayhamm@mellanox.com>
Tested-by: Ilan Tayari <ilant@mellanox.com>

Thanks, Florian!


^ permalink raw reply

* RE: [PATCH net 3/3] tcp: fix xmit timer to only be reset if data ACKed/SACKed
From: maowenan @ 2017-08-06  7:39 UTC (permalink / raw)
  To: Willy Tarreau, Neal Cardwell
  Cc: David Miller, netdev@vger.kernel.org, Yuchung Cheng,
	Nandita Dukkipati, Eric Dumazet
In-Reply-To: <20170804181854.GA5478@1wt.eu>



> -----Original Message-----
> From: Willy Tarreau [mailto:w@1wt.eu]
> Sent: Saturday, August 05, 2017 2:19 AM
> To: Neal Cardwell
> Cc: maowenan; David Miller; netdev@vger.kernel.org; Yuchung Cheng; Nandita
> Dukkipati; Eric Dumazet
> Subject: Re: [PATCH net 3/3] tcp: fix xmit timer to only be reset if data
> ACKed/SACKed
> 
> On Fri, Aug 04, 2017 at 02:01:34PM -0400, Neal Cardwell wrote:
> > On Fri, Aug 4, 2017 at 1:10 PM, Willy Tarreau <w@1wt.eu> wrote:
> > > Hi Neal,
> > >
> > > On Fri, Aug 04, 2017 at 12:59:51PM -0400, Neal Cardwell wrote:
> > >> I have attached patches for this fix rebased on to v3.10.107, the
> > >> latest stable release for 3.10. That's pretty far back in history,
> > >> so there were substantial conflict resolutions and adjustments required.
> > >> :-) Hope that helps.
> > >
> > > At least it will help me :-)
> > >
> > > Do you suggest that I queue them for 3.10.108, that I wait for
> > > Maowenan to test them more broadly first or anything else ?
> >
> > Let's wait for Maowenan to test them first.
[Mao Wenan]It works well with these patches of v3.10, and the 
retransmission packet is about 250ms after TLP probe.
Thank you very much for these patches under 3.10.
> 
> Fine, thanks.
> Willy

^ permalink raw reply

* Re: [PATCH net 3/3] tcp: fix xmit timer to only be reset if data ACKed/SACKed
From: Willy Tarreau @ 2017-08-06  7:44 UTC (permalink / raw)
  To: maowenan
  Cc: Neal Cardwell, David Miller, netdev@vger.kernel.org,
	Yuchung Cheng, Nandita Dukkipati, Eric Dumazet
In-Reply-To: <F95AC9340317A84688A5F0DF0246F3F202940EA5@DGGEMI512-MBX.china.huawei.com>

On Sun, Aug 06, 2017 at 07:39:57AM +0000, maowenan wrote:
> 
> 
> > -----Original Message-----
> > From: Willy Tarreau [mailto:w@1wt.eu]
> > Sent: Saturday, August 05, 2017 2:19 AM
> > To: Neal Cardwell
> > Cc: maowenan; David Miller; netdev@vger.kernel.org; Yuchung Cheng; Nandita
> > Dukkipati; Eric Dumazet
> > Subject: Re: [PATCH net 3/3] tcp: fix xmit timer to only be reset if data
> > ACKed/SACKed
> > 
> > On Fri, Aug 04, 2017 at 02:01:34PM -0400, Neal Cardwell wrote:
> > > On Fri, Aug 4, 2017 at 1:10 PM, Willy Tarreau <w@1wt.eu> wrote:
> > > > Hi Neal,
> > > >
> > > > On Fri, Aug 04, 2017 at 12:59:51PM -0400, Neal Cardwell wrote:
> > > >> I have attached patches for this fix rebased on to v3.10.107, the
> > > >> latest stable release for 3.10. That's pretty far back in history,
> > > >> so there were substantial conflict resolutions and adjustments required.
> > > >> :-) Hope that helps.
> > > >
> > > > At least it will help me :-)
> > > >
> > > > Do you suggest that I queue them for 3.10.108, that I wait for
> > > > Maowenan to test them more broadly first or anything else ?
> > >
> > > Let's wait for Maowenan to test them first.
> [Mao Wenan]It works well with these patches of v3.10, and the 
> retransmission packet is about 250ms after TLP probe.
> Thank you very much for these patches under 3.10.

Thanks, I'll take them then.

Willy

^ permalink raw reply

* [PATCH] ATM-lanai: Delete an error message for a failed memory allocation in lanai_init_one()
From: SF Markus Elfring @ 2017-08-06  8:00 UTC (permalink / raw)
  To: linux-atm-general, netdev, Chas Williams; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 6 Aug 2017 09:42:52 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/atm/lanai.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index 2351dad78ff5..f4cb6c5870bf 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -2562,11 +2562,8 @@ static int lanai_init_one(struct pci_dev *pci,
 	int result;
 
 	lanai = kmalloc(sizeof(*lanai), GFP_KERNEL);
-	if (lanai == NULL) {
-		printk(KERN_ERR DEV_LABEL
-		       ": couldn't allocate dev_data structure!\n");
+	if (!lanai)
 		return -ENOMEM;
-	}
 
 	atmdev = atm_dev_register(DEV_LABEL, &pci->dev, &ops, -1, NULL);
 	if (atmdev == NULL) {
-- 
2.13.4

^ permalink raw reply related

* [PATCH] ATM-nicstar: Delete an error message for a failed memory allocation in ns_init_card()
From: SF Markus Elfring @ 2017-08-06  8:16 UTC (permalink / raw)
  To: linux-atm-general, netdev, Chas Williams; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 6 Aug 2017 10:10:21 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/atm/nicstar.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 9588d80f318e..08d5aa8b9524 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -372,9 +372,6 @@ static int ns_init_card(int i, struct pci_dev *pcidev)
 
 	card = kmalloc(sizeof(*card), GFP_KERNEL);
 	if (!card) {
-		printk
-		    ("nicstar%d: can't allocate memory for device structure.\n",
-		     i);
 		error = 2;
 		ns_init_card_error(card, error);
 		return error;
-- 
2.13.4

^ permalink raw reply related

* [PATCH ipsec-next] xfrm: check that cached bundle is still valid
From: Florian Westphal @ 2017-08-06  8:19 UTC (permalink / raw)
  To: netdev; +Cc: Florian Westphal

Quoting Ilan Tayari:
  1. Set up a host-to-host IPSec tunnel (or transport, doesn't matter)
  2. Ping over IPSec, or do something to populate the pcpu cache
  3. Join a MC group, then leave MC group
  4. Try to ping again using same CPU as before -> traffic
     doesn't egress the machine at all

Ilan debugged the problem down to the fact that one of the path dsts
devices point to lo due to earlier dst_dev_put().
In this case, dst is marked as DEAD and we cannot reuse the bundle.

The cache only asserted that the requested policy and that of the cached
bundle match, but its not enough - also verify the path is still valid.

Fixes: ec30d78c14a813 ("xfrm: add xdst pcpu cache")
Reported-by: Ayham Masood <ayhamm@mellanox.com>
Tested-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 net/xfrm/xfrm_policy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 06c3bf7ab86b..8da428f56aec 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1818,7 +1818,8 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols,
 	    xdst->num_pols == num_pols &&
 	    !xfrm_pol_dead(xdst) &&
 	    memcmp(xdst->pols, pols,
-		   sizeof(struct xfrm_policy *) * num_pols) == 0) {
+		   sizeof(struct xfrm_policy *) * num_pols) == 0 &&
+	    xfrm_bundle_ok(xdst)) {
 		dst_hold(&xdst->u.dst);
 		return xdst;
 	}
-- 
2.13.3

^ permalink raw reply related

* [PATCH] atm: solos-pci: Delete an error message for a failed memory allocation in fpga_probe()
From: SF Markus Elfring @ 2017-08-06  8:41 UTC (permalink / raw)
  To: linux-atm-general, netdev, Chas Williams; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 6 Aug 2017 10:37:31 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/atm/solos-pci.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 8754793223cd..cb3424a4f91f 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -1293,7 +1293,6 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
 			card->dma_alignment = 3;
 			card->dma_bounce = kmalloc(card->nr_ports * BUF_SIZE, GFP_KERNEL);
 			if (!card->dma_bounce) {
-				dev_warn(&card->dev->dev, "Failed to allocate DMA bounce buffers\n");
 				err = -ENOMEM;
 				/* Fallback to MMIO doesn't work */
 				goto out_unmap_both;
-- 
2.13.4

^ permalink raw reply related

* [PATCH] hamradio: baycom: make hdlcdrv_ops const
From: Bhumika Goyal @ 2017-08-06  8:51 UTC (permalink / raw)
  To: julia.lawall, t.sailer, linux-hams, netdev, linux-kernel; +Cc: Bhumika Goyal

Make hdlcdrv_ops structures const as they are only passed to
hdlcdrv_register function. The corresponding argument is of type const,
so make the structures const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/net/hamradio/baycom_par.c     | 2 +-
 drivers/net/hamradio/baycom_ser_fdx.c | 2 +-
 drivers/net/hamradio/baycom_ser_hdx.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index 92b13b3..e178383 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -386,7 +386,7 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
 
 /* --------------------------------------------------------------------- */
 
-static struct hdlcdrv_ops par96_ops = {
+static const struct hdlcdrv_ops par96_ops = {
 	.drvname = bc_drvname,
 	.drvinfo = bc_drvinfo,
 	.open    = par96_open,
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index d9a646a..190f66c 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -508,7 +508,7 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
 
 /* --------------------------------------------------------------------- */
 
-static struct hdlcdrv_ops ser12_ops = {
+static const struct hdlcdrv_ops ser12_ops = {
 	.drvname = bc_drvname,
 	.drvinfo = bc_drvinfo,
 	.open    = ser12_open,
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index f1c8a9f..3c823c6 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -542,7 +542,7 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
 
 /* --------------------------------------------------------------------- */
 
-static struct hdlcdrv_ops ser12_ops = {
+static const struct hdlcdrv_ops ser12_ops = {
 	.drvname = bc_drvname,
 	.drvinfo = bc_drvinfo,
 	.open    = ser12_open,
-- 
1.9.1

^ permalink raw reply related

* [PATCH] ATM-ENI: Delete an error message for a failed memory allocation in eni_start()
From: SF Markus Elfring @ 2017-08-06  9:20 UTC (permalink / raw)
  To: linux-atm-general, netdev, Chas Williams; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 6 Aug 2017 11:15:17 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/atm/eni.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index ce47eb17901d..d4b11ef940ee 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -1849,8 +1849,6 @@ static int eni_start(struct atm_dev *dev)
 					   sizeof(*eni_dev->free_list),
 					   GFP_KERNEL);
 	if (!eni_dev->free_list) {
-		printk(KERN_ERR DEV_LABEL "(itf %d): couldn't get free page\n",
-		    dev->number);
 		error = -ENOMEM;
 		goto free_irq;
 	}
-- 
2.13.4

^ permalink raw reply related

* [PATCH] tcp_input: move out condition check from tcp_data_queue()
From: Ilya Matveychikov @ 2017-08-06  9:51 UTC (permalink / raw)
  To: netdev

As tcp_data_queue() function is used just only twice it's better
to move out the first check and wrap it with inline. It saves a
single call in case the condition evaluated as true.

Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>
---
 net/ipv4/tcp_input.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 2920e0c..141a722 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4585,16 +4585,12 @@ int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size)
 
 }
 
-static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
+static void __tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 	bool fragstolen = false;
 	int eaten = -1;
 
-	if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) {
-		__kfree_skb(skb);
-		return;
-	}
 	skb_dst_drop(skb);
 	__skb_pull(skb, tcp_hdr(skb)->doff * 4);
 
@@ -4703,6 +4699,14 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 	tcp_data_queue_ofo(sk, skb);
 }
 
+static inline void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
+{
+	if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq)
+		__kfree_skb(skb);
+	else
+		__tcp_data_queue(sk, skb);
+}
+
 static struct sk_buff *tcp_skb_next(struct sk_buff *skb, struct sk_buff_head *list)
 {
 	if (list)
-- 
2.7.4

^ permalink raw reply related

* Re: [Patch net-next 1/2] net_sched: refactor notification code for RTM_DELTFILTER
From: Jamal Hadi Salim @ 2017-08-06 11:42 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: jiri
In-Reply-To: <20170805043143.13680-2-xiyou.wangcong@gmail.com>

On 17-08-05 12:31 AM, Cong Wang wrote:
> It is confusing to use 'unsigned long fh' as both a handle
> and a pointer, especially commit 9ee7837449b3
> ("net sched filters: fix notification of filter delete with proper handle").
> 
> This patch introduces tfilter_del_notify() so that we can
> pass it as a pointer as before, and we don't need to check
> RTM_DELTFILTER in tcf_fill_node() any more.
>
> This prepares for the next patch.
>


Looks good to me.
A small question below:


> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: Jiri Pirko <jiri@resnulli.us>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> ---
>   net/sched/cls_api.c | 44 +++++++++++++++++++++++++++++++++++++++-----
>   1 file changed, 39 insertions(+), 5 deletions(-)
> 
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index e655221c654e..afd099727aea 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -104,6 +104,10 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb,
>   			  struct nlmsghdr *n, struct tcf_proto *tp,
>   			  unsigned long fh, int event, bool unicast);
>   
> +static int tfilter_del_notify(struct net *net, struct sk_buff *oskb,
> +			      struct nlmsghdr *n, struct tcf_proto *tp,
> +			      unsigned long fh, bool unicast, bool *last);
> +

Any reason not to move the functin up here and getting rid of this
forward declaration?

otherwise:
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

^ 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