Re: [PATCH net-next] bpf/verifier: improve disassembly of BPF_END instructions

2017-09-23 Thread Alexei Starovoitov
On Fri, Sep 22, 2017 at 09:49:10PM -0700, Y Song wrote: > On Fri, Sep 22, 2017 at 9:23 AM, Edward Cree wrote: > > On 22/09/17 16:16, Alexei Starovoitov wrote: > >> looks like we're converging on > >> "be16/be32/be64/le16/le32/le64 #register" for BPF_END. > >> I guess it can

[PATCH] mac80211: aead api to reduce redundancy

2017-09-23 Thread Xiang Gao
Currently, the aes_ccm.c and aes_gcm.c are almost line by line copy of each other. This patch reduce code redundancy by moving the code in these two files to crypto/aead_api.c to make it a higher level aead api. The aes_ccm.c and aes_gcm.c are removed and all the functions are now implemented in

Re: [PATCH 1/1] forcedeth: optimize the xmit/rx with unlikely

2017-09-23 Thread David Miller
From: Zhu Yanjun Date: Fri, 22 Sep 2017 10:20:21 -0400 > In the xmit/rx fastpath, the function dma_map_single rarely fails. > Therefore, add an unlikely() optimization to this error check > conditional. > > Signed-off-by: Zhu Yanjun Applied to

Re: [PATCH net] net: qualcomm: rmnet: Fix rcu splat in rmnet_is_real_dev_registered

2017-09-23 Thread David Miller
From: Subash Abhinov Kasiviswanathan Date: Thu, 21 Sep 2017 18:00:36 -0600 > Xiaolong reported a suspicious rcu_dereference_check in the device > unregister notifier callback. Since we do not dereference the > rx_handler_data, it's ok to just check for the value of the

Re: [PATCH net-next 09/14] gtp: Allow configuring GTP interface as standalone

2017-09-23 Thread Harald Welte
Hi Tom, On Thu, Sep 21, 2017 at 09:43:02AM -0700, Tom Herbert wrote: > Please see the cover letter for the original GTP kernel patches dated > May 10, 2016. My first question on those was "Is there a timeline for > adding IPv6 support?". To which Pablo replied that there was a > preliminary patch

Re: [PATCH net-next 03/14] gtp: Call common functions to get tunnel routes and add dst_cache

2017-09-23 Thread Harald Welte
Hi Andreas, On Wed, Sep 20, 2017 at 05:37:52PM +0200, Andreas Schultz wrote: > I think we had this discussion before. The sending IP and port are not part > of the identity of the PDP context. So IMHO the sender is permitted > to change the source IP at random. Thanks for the reminder: You are

[PATCH] staging: rtl8822be: Keep array subscript no lower than zero

2017-09-23 Thread Larry Finger
The kbuild test robot reports the following: drivers/staging//rtlwifi/phydm/phydm_dig.c: In function 'odm_pause_dig': drivers/staging//rtlwifi/phydm/phydm_dig.c:494:45: warning: array subscript is below array bounds [-Warray-bounds] odm_write_dig(dm,

Re: [Patch net-next] net_sched: use idr to allocate bpf filter handles

2017-09-23 Thread David Miller
From: Cong Wang Date: Thu, 21 Sep 2017 16:43:00 -0700 > @@ -421,27 +427,6 @@ static int cls_bpf_set_parms(struct net *net, struct > tcf_proto *tp, > return 0; > } > > -static u32 cls_bpf_grab_new_handle(struct tcf_proto *tp, > -

Re: [PATCH] cnic: Fix an error handling path in 'cnic_alloc_bnx2x_resc()'

2017-09-23 Thread David Miller
From: Christophe JAILLET Date: Fri, 22 Sep 2017 01:01:11 +0200 > All the error handling paths 'goto error', except this one. > We should also go to error in this case, or some resources will be > leaking. > > Signed-off-by: Christophe JAILLET

Re: [PATCH net-next v3 3/6] rtnetlink: add helper to dump ifalias

2017-09-23 Thread Florian Westphal
Eric Dumazet wrote: > On Sat, 2017-09-23 at 21:26 +0200, Florian Westphal wrote: > > Reviewed-by: David Ahern > > Signed-off-by: Florian Westphal > > --- > > Changes since v3: don't add rtnl assertion, I placed the assertion > > in my

Re: [PATCH net-next v3 3/6] rtnetlink: add helper to dump ifalias

2017-09-23 Thread Eric Dumazet
On Sat, 2017-09-23 at 21:26 +0200, Florian Westphal wrote: > Reviewed-by: David Ahern > Signed-off-by: Florian Westphal > --- > Changes since v3: don't add rtnl assertion, I placed the assertion > in my working tree instead as a reminder. > >

[PATCH] au1k_ir.c fix warning: Prefer [subsystem eg: netdev]_info([subsystem]dev, ...

2017-09-23 Thread Yurii Pavlenko
This patch fixes the following checkpatch.pl warning: fix Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... Signed-off-by: Yurii Pavlenko --- drivers/staging/irda/drivers/au1k_ir.c | 40

[PATCH 2/2] neigh: make strucrt neigh_table::entry_size unsigned int

2017-09-23 Thread Alexey Dobriyan
Key length can't be negative. Leave comparisons against nla_len() signed just in case truncated attribute can sneak in there. Space savings: add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-7 (-7) function old new delta pneigh_delete

[PATCH 1/2] neigh: make struct neigh_table::entry_size unsigned int

2017-09-23 Thread Alexey Dobriyan
Neigh entry size can't be negative. Space savings: add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-7 (-7) function old new delta lowpan_neigh_construct25 24 -1 clip_seq_sub_iter

[PATCH net-next] net: speed up skb_rbtree_purge()

2017-09-23 Thread Eric Dumazet
From: Eric Dumazet As measured in my prior patch ("sch_netem: faster rb tree removal"), rbtree_postorder_for_each_entry_safe() is nice looking but much slower than using rb_next() directly, except when tree is small enough to fit in CPU caches (then the cost is the same)

[RESEND] Re: usb/net/p54: trying to register non-static key in p54_unregister_leds

2017-09-23 Thread Christian Lamparter
This got rejected by gmail once. Let's see if it works now. On Thursday, September 21, 2017 8:22:45 PM CEST Andrey Konovalov wrote: > On Wed, Sep 20, 2017 at 9:55 PM, Johannes Berg > wrote: > > On Wed, 2017-09-20 at 21:27 +0200, Christian Lamparter wrote: > > > >> It

[PATCH net-next v3 5/6] rtnetlink: add helpers to dump netnsid information

2017-09-23 Thread Florian Westphal
Reviewed-by: David Ahern Signed-off-by: Florian Westphal --- Changes since v2: this hunk was part of patch #4. net/core/rtnetlink.c | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/net/core/rtnetlink.c

[PATCH net-next v3 1/6] selftests: rtnetlink.sh: add rudimentary vrf test

2017-09-23 Thread Florian Westphal
Acked-by: David Ahern Signed-off-by: Florian Westphal --- Changes since v1: indent all lines with tabs, not spaces tools/testing/selftests/net/rtnetlink.sh | 42 1 file changed, 42 insertions(+) diff --git

[PATCH net-next v3 3/6] rtnetlink: add helper to dump ifalias

2017-09-23 Thread Florian Westphal
Reviewed-by: David Ahern Signed-off-by: Florian Westphal --- Changes since v3: don't add rtnl assertion, I placed the assertion in my working tree instead as a reminder. net/core/rtnetlink.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-)

[PATCH net-next v3 6/6] rtnetlink: rtnl_have_link_slave_info doesn't need rtnl

2017-09-23 Thread Florian Westphal
it can be switched to rcu. Reviewed-by: David Ahern Signed-off-by: Florian Westphal --- Changes since v2: remove ASSERT_RTNL. net/core/rtnetlink.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/net/core/rtnetlink.c

[PATCH net-next v3 4/6] rtnetlink: add helpers to dump vf information

2017-09-23 Thread Florian Westphal
similar to earlier patches, split out more parts of this function to better see what is happening and where we assume rtnl is locked. Reviewed-by: David Ahern Signed-off-by: Florian Westphal --- changes since v2: split this patch into two, last submission

[PATCH net-next v3 2/6] rtnetlink: add helper to put master and link ifindexes

2017-09-23 Thread Florian Westphal
rtnl_fill_ifinfo currently requires caller to hold the rtnl mutex. Unfortunately the function is quite large which makes it harder to see which spots require the lock, which spots assume it and which ones could do without. Add helpers to factor out the ifindex dumping, one can use rcu to avoid

[PATCH net-next v3 0/6] rtnetlink: preparation patches for further rtnl lock pushdown/removal

2017-09-23 Thread Florian Westphal
First patch adds a rudimentary vrf test case. Remaining patches split large rtnl_fill_ifinfo into smaller chunks to better see which parts 1. require rtnl 2. do not require it at all 3. rely on rtnl locking now but could be converted I removed all the ASSERT_RTNL spots that v1 and v2 added, i

Re: [PATCH net-next v2 3/6] rtnetlink: add helper to dump qdisc name

2017-09-23 Thread Florian Westphal
Eric Dumazet wrote: > On Fri, 2017-09-22 at 08:10 +0200, Florian Westphal wrote: > > We can use rcu here to make this safe even if we would not hold rtnl: > > qdisc_destroy uses call_rcu to free the Qdisc struct. > > > Where do you see call_rcu() called from

[PATCH net-next] sch_netem: faster rb tree removal

2017-09-23 Thread Eric Dumazet
From: Eric Dumazet While running TCP tests involving netem storing millions of packets, I had the idea to speed up tfifo_reset() and did experiments. I tried the rbtree_postorder_for_each_entry_safe() method that is used in skb_rbtree_purge() but discovered it was slower

Re: [PATCH net-next v2 3/6] rtnetlink: add helper to dump qdisc name

2017-09-23 Thread Eric Dumazet
On Fri, 2017-09-22 at 08:10 +0200, Florian Westphal wrote: > We can use rcu here to make this safe even if we would not hold rtnl: > qdisc_destroy uses call_rcu to free the Qdisc struct. Where do you see call_rcu() called from qdisc_destroy() ? You missed this commit I guess

Re: [PATCH] net: dsa: avoid null pointer dereference on p->phy

2017-09-23 Thread Florian Fainelli
On 09/23/2017 09:57 AM, Colin King wrote: > From: Colin Ian King > > Currently p->phy is being null checked in several places to avoid > null pointer dereferences on p->phy, however, the final call > to phy_attached_info on p->phy when p->phy will perform a null >

Re: [PATCH net-next v2 6/6] rtnetlink: rtnl_have_link_slave_info doesn't need rtnl

2017-09-23 Thread David Ahern
On 9/22/17 12:10 AM, Florian Westphal wrote: > Switch it to rcu. > > rtnl_link_slave_info_fill on to other hand does need rtnl mutex for now so > add an annotation to its caller as a reminder. > > Signed-off-by: Florian Westphal > --- > Change since v1: > - don't add

Re: [PATCH net-next v2 4/6] rtnetlink: add helper to dump ifalias

2017-09-23 Thread David Ahern
On 9/22/17 12:10 AM, Florian Westphal wrote: > ifalias is currently protected by rtnl mutex, add assertion > as a reminder. > > Signed-off-by: Florian Westphal > --- > net/core/rtnetlink.c | 13 +++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git

Re: [PATCH] net: dsa: avoid null pointer dereference on p->phy

2017-09-23 Thread Joe Perches
On Sat, 2017-09-23 at 17:57 +0100, Colin King wrote: > From: Colin Ian King > > Currently p->phy is being null checked in several places to avoid > null pointer dereferences on p->phy, however, the final call > to phy_attached_info on p->phy when p->phy will perform a

Re: [PATCH net-next v2 5/6] rtnetlink: add helpers to dump vf and netnsid information

2017-09-23 Thread David Ahern
On 9/22/17 12:10 AM, Florian Westphal wrote: > +static noinline_for_stack int rtnl_fill_vf(struct sk_buff *skb, > +struct net_device *dev, > +u32 ext_filter_mask) > +{ > + struct nlattr *vfinfo; > + int i,

Re: [PATCH net-next v2 1/6] selftests: rtnetlink.sh: add rudimentary vrf test

2017-09-23 Thread David Ahern
On 9/22/17 12:10 AM, Florian Westphal wrote: > +kci_test_vrf() > +{ > + vrfname="test-vrf" > + ret=0 > + > + ip link show type vrf 2>/dev/null > + if [ $? -ne 0 ]; then > + echo "SKIP: vrf: iproute2 too old" > + return 0 > + fi > + > + ip link add

Re: [PATCH net-next v2 3/6] rtnetlink: add helper to dump qdisc name

2017-09-23 Thread David Ahern
On 9/22/17 12:10 AM, Florian Westphal wrote: > We can use rcu here to make this safe even if we would not hold rtnl: > qdisc_destroy uses call_rcu to free the Qdisc struct. > > Signed-off-by: Florian Westphal > --- > net/core/rtnetlink.c | 16 ++-- > 1 file changed,

Re: [PATCH net-next v2 2/6] rtnetlink: add helper to put master ifindex

2017-09-23 Thread David Ahern
On 9/22/17 12:10 AM, Florian Westphal wrote: > rtnl_fill_ifinfo currently requires caller to hold the rtnl mutex. > Unfortunately the function is quite large which makes it harder to see > which spots need the lock, which spots assume it and which ones could do > without. > > Add helpers to

Re: [PATCH net-next v2 1/6] selftests: rtnetlink.sh: add rudimentary vrf test

2017-09-23 Thread David Ahern
On 9/22/17 12:10 AM, Florian Westphal wrote: > Cc: David Ahern > Signed-off-by: Florian Westphal > --- > tools/testing/selftests/net/rtnetlink.sh | 42 > > 1 file changed, 42 insertions(+) Acked-by: David Ahern

Re: tools: selftests: psock_tpacket: skip un-supported tpacket_v3 test

2017-09-23 Thread David Miller
From: Fathi Boudra Date: Sat, 23 Sep 2017 14:27:15 +0300 > On 23 September 2017 at 04:20, David Miller wrote: >> From: Orson Zhai >> Date: Fri, 22 Sep 2017 18:17:17 +0800 >> >>> The TPACKET_V3 test of PACKET_TX_RING will fail

[PATCH] net: dsa: avoid null pointer dereference on p->phy

2017-09-23 Thread Colin King
From: Colin Ian King Currently p->phy is being null checked in several places to avoid null pointer dereferences on p->phy, however, the final call to phy_attached_info on p->phy when p->phy will perform a null pointer dereference. Fix this by simply moving the call

Re: [PATCH net-next] liquidio: pass date and time info to NIC firmware

2017-09-23 Thread Andrew Lunn
On Fri, Sep 22, 2017 at 05:35:18PM -0700, Felix Manlunas wrote: > From: Veerasenareddy Burru This is kind of interesting. So you do this once. It could be before the RTC driver has probed, so it is 1970. It could be before the NTP daemon has started, and so the

Re: [patch net-next 07/12] mlxsw: spectrum: Add the multicast routing offloading logic

2017-09-23 Thread Andrew Lunn
> > So when i look at these patches, i try to make sure the general use > > cases works, not just the plain boring Ethernet switch box use cases > > :-) > > So when doing it, we did think about multi-ASIC situations, so I think it > should > fit :) Maybe, maybe not. DSA is multi switch. That is

[PATCH net-next] tun: delete original tun_get() and rename __tun_get() to tun_get()

2017-09-23 Thread yuan linyu
From: yuan linyu it seems no need to keep tun_get() and __tun_get() at same time. Signed-off-by: yuan linyu --- drivers/net/tun.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git

Re: [PATCH net-next 2/2] net: dsa: lan9303: Add basic offloading of unicast traffic

2017-09-23 Thread Andrew Lunn
> The point is: Once both external ports are in "forwarding", I see no way > to prevent traffic flowing directly between the external ports. Generally, there are port vectors. Port X can send frames only to Port Y. If you don't have that, there are possibilities with VLANs. Each port is given a

Re: [PATCH net] sctp: Fix a big endian bug in sctp_for_each_transport()

2017-09-23 Thread Xin Long
On Sat, Sep 23, 2017 at 6:25 PM, Dan Carpenter wrote: > Fundamentally, the "pos" pointer points to "cb->args[2]" which is a long. > In the current code, we only use the high 32 bits and cast it as an > int. That works on little endian systems but will fail on big endian

Re: tools: selftests: psock_tpacket: skip un-supported tpacket_v3 test

2017-09-23 Thread Fathi Boudra
On 23 September 2017 at 04:20, David Miller wrote: > From: Orson Zhai > Date: Fri, 22 Sep 2017 18:17:17 +0800 > >> The TPACKET_V3 test of PACKET_TX_RING will fail with kernel version >> lower than v4.11. Supported code of tx ring was add with commit id

[PATCH net-next] cxgb4: do DCB state reset in couple of places

2017-09-23 Thread Ganesh Goudar
reset the driver's DCB state in couple of places where it was missing. Signed-off-by: Casey Leedom Signed-off-by: Ganesh Goudar --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c | 15 +++ drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.h |

[PATCH net] sctp: Fix a big endian bug in sctp_for_each_transport()

2017-09-23 Thread Dan Carpenter
Fundamentally, the "pos" pointer points to "cb->args[2]" which is a long. In the current code, we only use the high 32 bits and cast it as an int. That works on little endian systems but will fail on big endian systems. Fixes: d25adbeb0cdb ("sctp: fix an use-after-free issue in sctp_sock_dump")

Re: [PATCH net-next 2/2] net: dsa: lan9303: Add basic offloading of unicast traffic

2017-09-23 Thread Egil Hjelmeland
Den 22. sep. 2017 22:08, skrev Andrew Lunn: I'm wondering how this is supposed to work. Please add a good comment here, since the hardware is forcing you to do something odd. Maybe it would be a good idea to save the STP state in chip. And then when chip->is_bridged is set true, change the

Re: [patch net-next 07/12] mlxsw: spectrum: Add the multicast routing offloading logic

2017-09-23 Thread Yotam Gigi
On 09/22/2017 04:21 PM, Andrew Lunn wrote: > On Fri, Sep 22, 2017 at 11:36:59AM +0300, Yotam Gigi wrote: >> On 09/21/2017 06:26 PM, Andrew Lunn wrote: +static void mlxsw_sp_mr_route_stats_update(struct mlxsw_sp *mlxsw_sp, + struct mlxsw_sp_mr_route