[PATCH net-next 15/21] xfrm: take refcnt of dst when creating struct xfrm_dst bundle

2017-06-16 Thread Wei Wang
From: Wei Wang During the creation of xfrm_dst bundle, always take ref count when allocating the dst. This way, xfrm_bundle_create() will form a linked list of dst with dst->child pointing to a ref counted dst child. And the returned dst pointer is also ref counted. This makes the link from the f

[PATCH net-next 19/21] net: remove DST_NOCACHE flag

2017-06-16 Thread Wei Wang
From: Wei Wang DST_NOCACHE flag check has been removed from dst_release() and dst_hold_safe() in a previous patch because all the dst are now ref counted properly and can be released based on refcnt only. Looking at the rest of the DST_NOCACHE use, all of them can now be removed or replaced with

[PATCH net-next 06/21] ipv4: take dst->__refcnt when caching dst in fib

2017-06-16 Thread Wei Wang
From: Wei Wang In IPv4 routing code, fib_nh and fib_nh_exception can hold pointers to struct rtable but they never increment dst->__refcnt. This leads to the need of the dst garbage collector because when user is done with this dst and calls dst_release(), it can only decrement dst->__refcnt and

[PATCH net-next 10/21] ipv6: take dst->__refcnt for insertion into fib6 tree

2017-06-16 Thread Wei Wang
From: Wei Wang In IPv6 routing code, struct rt6_info is created for each static route and RTF_CACHE route and inserted into fib6 tree. In both cases, dst ref count is not taken. As explained in the previous patch, this leads to the need of the dst garbage collector. This patch holds ref count of

[PATCH net-next 14/21] ipv6: get rid of icmp6 dst garbage collector

2017-06-16 Thread Wei Wang
From: Wei Wang icmp6 dst route is currently ref counted during creation and will be freed by user during its call of dst_release(). So no need of a garbage collector for it. Remove all icmp6 dst garbage collector related code. Signed-off-by: Wei Wang Acked-by: Martin KaFai Lau --- include/net

[PATCH net-next 20/21] net: reorder all the dst flags

2017-06-16 Thread Wei Wang
From: Wei Wang As some dst flags are removed, reorder the dst flags to fill in the blanks. Note: these flags are not exposed into user space. So it is safe to reorder. Signed-off-by: Wei Wang Acked-by: Martin KaFai Lau --- include/net/dst.h | 10 +- 1 file changed, 5 insertions(+), 5

[PATCH net-next 08/21] ipv4: call dst_hold_safe() properly

2017-06-16 Thread Wei Wang
From: Wei Wang This patch checks all the calls to dst_hold()/skb_dst_force()/dst_clone()/dst_use() to see if dst_hold_safe() is needed to avoid double free issue if dst gc is removed and dst_release() directly destroys dst when dst->__refcnt drops to 0. In tx path, TCP hold sk->sk_rx_dst ref cou

[PATCH net-next 17/21] net: remove dst gc related code

2017-06-16 Thread Wei Wang
From: Wei Wang This patch removes all dst gc related code and all the dst free functions Signed-off-by: Wei Wang Acked-by: Martin KaFai Lau --- include/net/dst.h | 21 -- net/core/dev.c| 1 - net/core/dst.c| 213 -- 3 files ch

[PATCH net-next 01/21] ipv6: remove unnecessary dst_hold() in ip6_fragment()

2017-06-16 Thread Wei Wang
From: Wei Wang In ipv6 tx path, rcu_read_lock() is taken so that dst won't get freed during the execution of ip6_fragment(). Hence, no need to hold dst in it. Signed-off-by: Wei Wang Acked-by: Martin KaFai Lau --- net/ipv6/ip6_output.c | 4 1 file changed, 4 deletions(-) diff --git a/ne

[PATCH net-next 00/21] remove dst garbage collector logic

2017-06-16 Thread Wei Wang
From: Wei Wang The current mechanism of dst release is a bit complicated. It is because the users of dst get divided into 2 situations: 1. Most users take the reference count when using a dst and release the reference count when done. 2. Exceptional users like IPv4/IPv6/decnet/xfrm routi

[PATCH net] decnet: always not take dst->__refcnt when inserting dst into hash table

2017-06-16 Thread Wei Wang
From: Wei Wang In the existing dn_route.c code, dn_route_output_slow() takes dst->__refcnt before calling dn_insert_route() while dn_route_input_slow() does not take dst->__refcnt before calling dn_insert_route(). This makes the whole routing code very buggy. In dn_dst_check_expire(), dnrt_free()

Re: [PATCH v2 03/11] tty: kbd: reduce stack size with KASAN

2017-06-16 Thread Dmitry Torokhov
On Fri, Jun 16, 2017 at 8:58 AM, Samuel Thibault wrote: > Arnd Bergmann, on ven. 16 juin 2017 17:41:47 +0200, wrote: >> The problem are the 'ch' and 'flag' variables that are passed into >> tty_insert_flip_char by value, and from there into >> tty_insert_flip_string_flags by reference. In this ca

Re: [PATCH 1/3] dev: Prevent creating network devices with negative ifindex

2017-06-16 Thread Stephen Hemminger
On Fri, 16 Jun 2017 19:44:45 +0300 Serhey Popovych wrote: > > On Fri, 16 Jun 2017 17:23:51 +0300 > > Serhey Popovych wrote: > > > >> Interface index is signed integer, we can pass ifm->ifi_index > >> from userspace via netlink and create network device with > >> negative ifindex value. > >> >

[PATCH 1/2] net/core: use local_bh_disable() in netif_rx_ni()

2017-06-16 Thread Sebastian Andrzej Siewior
In 2004 [0] netif_rx_ni() gained a preempt_disable() section around netif_rx() and its do_softirq() + testing for it. The do_softirq() part is required because netif_rx() raises the softirq but does not invoke it. The preempt_disable() is required to avoid running the BH in parallel. All this can b

[PATCH 2/2] net/core: remove explicit do_softirq() from busy_poll_stop()

2017-06-16 Thread Sebastian Andrzej Siewior
Since commit 217f69743681 ("net: busy-poll: allow preemption in sk_busy_loop()") there is an explicit do_softirq() invocation after local_bh_enable() has been invoked. I don't understand why we need this because local_bh_enable() will invoke do_softirq() once the softirq counter reached zero and we

[PATCH] net/phy: micrel: configure intterupts after autoneg workaround

2017-06-16 Thread Zach Brown
The commit ("net/phy: micrel: Add workaround for bad autoneg") fixes an autoneg failure case by resetting the hardware. This turns off intterupts. Things will work themselves out if the phy polls, as it will figure out it's state during a poll. However if the phy uses only intterupts, the phy will

Re: [PATCH v2 03/11] tty: kbd: reduce stack size with KASAN

2017-06-16 Thread Andrey Ryabinin
On 06/16/2017 06:41 PM, Arnd Bergmann wrote: > On Fri, Jun 16, 2017 at 3:02 PM, Greg Kroah-Hartman > wrote: >> On Fri, Jun 16, 2017 at 02:01:57PM +0200, Arnd Bergmann wrote: >>> On Thu, Jun 15, 2017 at 6:53 AM, Greg Kroah-Hartman >>> wrote: On Thu, Jun 15, 2017 at 06:52:21AM +0200, Greg Kroa

Re: [PATCH net-next 0/3] rds: tcp: misc bug fixes

2017-06-16 Thread David Miller
From: Sowmini Varadhan Date: Thu, 15 Jun 2017 11:28:52 -0700 > This series contains 2 bug fixes (patch2, patch3) and one bit of > code cleanup (patch1) identified during database testing Series applied, thank you.

Re: [PATCH 1/3] dev: Prevent creating network devices with negative ifindex

2017-06-16 Thread Serhey Popovych
> On Fri, 16 Jun 2017 17:23:51 +0300 > Serhey Popovych wrote: > >> Interface index is signed integer, we can pass ifm->ifi_index >> from userspace via netlink and create network device with >> negative ifindex value. >> >> Fixes: 9c7dafbfab15 ("net: Allow to create links with given ifindex") >>

Re: [PATCH net-next 0/2] net: dsa: loop: Driver updates

2017-06-16 Thread David Miller
From: Florian Fainelli Date: Thu, 15 Jun 2017 10:15:51 -0700 > This patch series updates drivers/net/dsa/dsa_loop.c to provide more useful > coverage of the DSA APIs and how we mangle the CPU ports ethtool statistics > to include its switch-facing port counters. Series applied, thanks Florian.

dev: Reclaim network device indexes

2017-06-16 Thread Serhey Popovych
While making dev_new_index() return zero on overrun prevents from infinite loop, there is no way to recovery mechanisms since namespace ifindex only increases and never reused from released network devices. To address this we introduce dev_free_index() helper which is used to reclaim released netw

Re: [PATCH net-next V2 0/2] pktgen new parameters

2017-06-16 Thread David Miller
From: Tariq Toukan Date: Thu, 15 Jun 2017 19:07:20 +0300 > This patchset adds two parameters to the pktgen scripts. > * The first patch adds a parameter to control the number of > packets sent by every pktgen thread. > * The second patch adds a parameter to control the index of > first thread

Re: [PATCH 2/3] dev: Avoid infinite loop on network device index exhaustion

2017-06-16 Thread Serhey Popovych
> On Fri, 16 Jun 2017 17:23:52 +0300 > Serhey Popovych wrote: > >> If network device indexes exhaust in namespace dev_new_index() >> can loop indefinitely since there is no condition to exit >> except case where free index is found. >> >> Since all it's caller hold RTNL mutex this may completely

Re: [PATCH net-next v5 00/11] net: mvmdio: add xMDIO xSMI support

2017-06-16 Thread David Miller
From: Antoine Tenart Date: Thu, 15 Jun 2017 16:43:15 +0200 > This series aims to add the xSMI support on the xMDIO bus to the > mvmdio driver. The xSMI interface complies with the IEEE 802.3 clause 45 > and is used by 10GbE devices. On 7k and 8k (as of now), such an > interface is found and is us

Re: [PATCH 1/3] dev: Prevent creating network devices with negative ifindex

2017-06-16 Thread Stephen Hemminger
On Fri, 16 Jun 2017 17:23:51 +0300 Serhey Popovych wrote: > Interface index is signed integer, we can pass ifm->ifi_index > from userspace via netlink and create network device with > negative ifindex value. > > Fixes: 9c7dafbfab15 ("net: Allow to create links with given ifindex") > Signed-off-b

Re: [PATCH 2/3] dev: Avoid infinite loop on network device index exhaustion

2017-06-16 Thread Stephen Hemminger
On Fri, 16 Jun 2017 17:23:52 +0300 Serhey Popovych wrote: > If network device indexes exhaust in namespace dev_new_index() > can loop indefinitely since there is no condition to exit > except case where free index is found. > > Since all it's caller hold RTNL mutex this may completely > lock dow

Re: [PATCH RFC 2/3] samples/bpf: Add define __EMITTING_BPF__ when building BPF

2017-06-16 Thread David Miller
From: Daniel Borkmann Date: Fri, 16 Jun 2017 12:24:06 +0200 > On 06/16/2017 12:35 AM, David Daney wrote: >> ... this allows gating of inline assembly code that causes llvm to >> fail when emitting BPF. >> >> Signed-off-by: David Daney > > I don't have a better idea at the moment, perhaps there

Re: [PATCH iproute2 2/2] tc: m_tunnel_key: add csum/nocsum option

2017-06-16 Thread Stephen Hemminger
On Wed, 14 Jun 2017 21:30:18 +0200 Jiri Benc wrote: > Allows control of UDP zero checksum. > > Signed-off-by: Jiri Benc Applied both patches to net-next

Re: Request for -stable inclusion (xt_TCPMSS)

2017-06-16 Thread David Miller
From: Guillaume Nault Date: Fri, 16 Jun 2017 09:45:17 +0200 > Hi David, > > Please queue 2638fd0f92d4 ("netfilter: xt_TCPMSS: add more sanity tests on > tcph->doff") > for -stable. > It fixes hard to debug crashes in production, that can be triggered by > remote peers. Pablo handles netfilter

Re: [patch iproute2/net-next] tc: don't print error message on miss when parsing control action with default

2017-06-16 Thread Stephen Hemminger
On Thu, 15 Jun 2017 14:10:51 +0200 Jiri Pirko wrote: > From: Jiri Pirko > > In case default control action parsing takes place, it is ok to miss. > So don't print error message. > > Fixes: e67aba559581 ("tc: actions: add helpers to parse and print control > actions") > Reported-by: Jiri Benc

Re: [PATCH iproute2 net] iproute: fix compilation issue with older glibc

2017-06-16 Thread Stephen Hemminger
On Fri, 16 Jun 2017 15:54:28 +0200 David Lebrun wrote: > If a header that includes linux/in6.h is included before > iproute's utils.h, then iproute2 fails to compile on older > glibc versions. > > Fixes: e8493916a8ede9970732e33ea52d30b83071f401 ("iproute: add support for > SR-IPv6 lwtunnel enca

Re: [PATCH v4 1/2] ip_tunnel: fix potential issue in ip_tunnel_rcv

2017-06-16 Thread David Miller
From: Haishuang Yan Date: Thu, 15 Jun 2017 10:29:29 +0800 > When ip_tunnel_rcv fails, the tun_dst won't be freed, so call > dst_release to free it in error code path. > > Fixes: 2e15ea390e6f ("ip_gre: Add support to collect tunnel metadata.") > Acked-by: Eric Dumazet > Acked-by: Pravin B Shelar

Re: [PATCH v4 2/2] ip6_tunnel: fix potential issue in __ip6_tnl_rcv

2017-06-16 Thread David Miller
From: Haishuang Yan Date: Thu, 15 Jun 2017 10:29:30 +0800 > When __ip6_tnl_rcv fails, the tun_dst won't be freed, so call > dst_release to free it in error code path. > > Fixes: 8d79266bc48c ("ip6_tunnel: add collect_md mode to IPv6 tunnels") > CC: Alexei Starovoitov > Tested-by: Zhang Shengju

Re: [PATCHv2 iproute2 net-next] ip neigh: allow flush FAILED neighbour entry

2017-06-16 Thread Stephen Hemminger
On Fri, 16 Jun 2017 11:31:52 +0800 Hangbin Liu wrote: > After upstream commit 5071034e4af7 ('neigh: Really delete an arp/neigh entry > on "ip neigh delete" or "arp -d"'), we could delete a single FAILED neighbour > entry now. But `ip neigh flush` still skip the FAILED entry. > > Move the filter

Re: [PATCH v3 net-next 0/9] bpf: xdp: Report bpf_prog ID in IFLA_XDP

2017-06-16 Thread David Miller
From: Martin KaFai Lau Date: Thu, 15 Jun 2017 17:29:08 -0700 > This is the first usage of the new bpf_prog ID. It is for > reporting the ID of a xdp_prog through netlink. > > It rides on the existing IFLA_XDP. This patch adds IFLA_XDP_PROG_ID > for the bpf_prog ID reporting. > > It starts wit

Re: [PATCH v2 03/11] tty: kbd: reduce stack size with KASAN

2017-06-16 Thread Samuel Thibault
Arnd Bergmann, on ven. 16 juin 2017 17:41:47 +0200, wrote: > The problem are the 'ch' and 'flag' variables that are passed into > tty_insert_flip_char by value, and from there into > tty_insert_flip_string_flags by reference. In this case, kasan tries > to detect whether tty_insert_flip_string_fla

Re: [PATCH 0/5] skb data accessors cleanup

2017-06-16 Thread David Miller
From: Johannes Berg Date: Fri, 16 Jun 2017 09:07:42 +0200 > Over night, Fengguang's bot told me that it compiled all of its many > various configurations successfully, and I had done allyesconfig on > x86_64 myself yesterday to iron out the things I missed. > > So now I think I'm happy with it.

Re: [PATCH net-next 4/7] qed*: Rename qede_roce.[ch]

2017-06-16 Thread David Miller
From: "Mintz, Yuval" Date: Fri, 16 Jun 2017 12:41:15 + >>In file included from drivers/net//ethernet/qlogic/qede/qede.h:43:0, >> from drivers/net//ethernet/qlogic/qede/qede_ptp.h:38, >> from drivers/net//ethernet/qlogic/qede/qede_fp.c:43: >> >> incl

Re: [PATCH v2 03/11] tty: kbd: reduce stack size with KASAN

2017-06-16 Thread Arnd Bergmann
On Fri, Jun 16, 2017 at 3:02 PM, Greg Kroah-Hartman wrote: > On Fri, Jun 16, 2017 at 02:01:57PM +0200, Arnd Bergmann wrote: >> On Thu, Jun 15, 2017 at 6:53 AM, Greg Kroah-Hartman >> wrote: >> > On Thu, Jun 15, 2017 at 06:52:21AM +0200, Greg Kroah-Hartman wrote: >> >> On Wed, Jun 14, 2017 at 11:15

Fw: [Bug 196093] New: dot1q S-VLAN frame on dot1ad configured interface is accepted

2017-06-16 Thread Stephen Hemminger
I suspect that VLAN offload on this Intel NIC is allowing any of the VLAN types. Begin forwarded message: Date: Fri, 16 Jun 2017 15:33:35 + From: bugzilla-dae...@bugzilla.kernel.org To: step...@networkplumber.org Subject: [Bug 196093] New: dot1q S-VLAN frame on dot1ad configured interface is

Re: [PATCH net-next v2 0/2] r8152: adjust runtime suspend/resume

2017-06-16 Thread David Miller
From: Hayes Wang Date: Fri, 16 Jun 2017 03:29:01 + > David Miller [mailto:da...@davemloft.net] >> Sent: Wednesday, June 14, 2017 1:02 AM >> > v2: >> > For #1, replace GFP_KERNEL with GFP_NOIO for usb_submit_urb(). >> > >> > v1: >> > Improve the flow about runtime suspend/resume and make the c

Re: [net-next:master 1119/1146] ERROR: "tcp_rate_check_app_limited" [net/tls/tls.ko] undefined!

2017-06-16 Thread David Miller
From: kbuild test robot Date: Fri, 16 Jun 2017 05:19:10 +0800 > tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git > master > head: 3715c47bcda8bb56f7e2be27276282a2d0d48c09 > commit: 3c4d7559159bfe1e3b94df3a657b2cda3a34e218 [1119/1146] tls: kernel TLS > support > confi

[PATCH] veth: Be more robust on network device creation when no attributes

2017-06-16 Thread Serhey Popovych
There are number of problems with configuration peer network device in absence of IFLA_VETH_PEER attributes where attributes for main network device shared with peer. First it is not feasible to configure both network devices with same MAC address since this makes communication in such configurati

Re: [PATCH iproute2 net] iproute: fix compilation issue with older glibc

2017-06-16 Thread Daniel Borkmann
On 06/16/2017 03:54 PM, David Lebrun wrote: If a header that includes linux/in6.h is included before iproute's utils.h, then iproute2 fails to compile on older glibc versions. Fixes: e8493916a8ede9970732e33ea52d30b83071f401 ("iproute: add support for SR-IPv6 lwtunnel encapsulation") Reported-by

Re: [PATCH v2] ip6_tunnel: Correct tos value in collect_md mode

2017-06-16 Thread Daniel Borkmann
On 06/15/2017 05:54 AM, Peter Dawson wrote: On Thu, 15 Jun 2017 10:30:29 +0800 Haishuang Yan wrote: Same as ip_gre, geneve and vxlan, use key->tos as tos value. CC: Peter Dawson Fixes: 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets”) Suggested-by: Daniel Bork

Re: [PATCH v4 2/3] PCI: Enable PCIe Relaxed Ordering if supported

2017-06-16 Thread Alexander Duyck
On Thu, Jun 15, 2017 at 6:10 PM, Ding Tianhong wrote: > > > On 2017/6/13 5:28, Alexander Duyck wrote: >> On Mon, Jun 12, 2017 at 4:05 AM, Ding Tianhong >> wrote: > ... >>> /** >>> + * pcie_clear_relaxed_ordering - clear PCI Express relaxed ordering bit >>> + * @dev: PCI device to query >>> + *

[PATCH 2/3] dev: Avoid infinite loop on network device index exhaustion

2017-06-16 Thread Serhey Popovych
If network device indexes exhaust in namespace dev_new_index() can loop indefinitely since there is no condition to exit except case where free index is found. Since all it's caller hold RTNL mutex this may completely lock down network subsystem configuration operations. Instead of retrying with

[PATCH 0/3] dev: Fix network device ifindex allocation

2017-06-16 Thread Serhey Popovych
There are some problems with network device ifindex handling in the core and veth driver. * Network device index (ifindex) is signed int, but only values > 0 consodered to be valid. However it is possible for userspace to supply negative ifindex value using following command: # ip link ad

[PATCH 1/3] dev: Prevent creating network devices with negative ifindex

2017-06-16 Thread Serhey Popovych
Interface index is signed integer, we can pass ifm->ifi_index from userspace via netlink and create network device with negative ifindex value. Fixes: 9c7dafbfab15 ("net: Allow to create links with given ifindex") Signed-off-by: Serhey Popovych --- net/core/dev.c | 2 +- 1 file changed, 1 insert

[PATCH 3/3] veth: Set ifindex only if given and not negative

2017-06-16 Thread Serhey Popovych
There is already check for ifindex being non negative in register_netdevice(). Do the same here for convenience. Fixes: e6f8f1a739b6 ("veth: Allow to create peer link with given ifindex") Signed-off-by: Serhey Popovych --- drivers/net/veth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: Toggling link state breaks network connectivity

2017-06-16 Thread Mason
On 15/06/2017 12:19, Måns Rullgård wrote: > Now I did notice one thing. When the interrupts from the loopback > frames are handled, the rx interrupt is all but disabled for NAPI poll > mode. Of course, NAPI isn't active, so the rx interrupt never gets > re-enabled. We should probably do this in

[PATCH net-next] net/mlx4_en: don't set CHECKSUM_COMPLETE on SCTP packets

2017-06-16 Thread Davide Caratti
if the NIC fails to validate the checksum on TCP/UDP, and validation of IP checksum is successful, the driver subtracts the pseudo-header checksum from the value obtained by the hardware and sets CHECKSUM_COMPLETE. Don't do that if protocol is IPPROTO_SCTP, otherwise CRC32c validation fails. Repor

Re: [RFC PATCH net-next v2 10/15] bpf: Add support for changing congestion control

2017-06-16 Thread Daniel Borkmann
On 06/15/2017 10:08 PM, Lawrence Brakmo wrote: Added support for changing congestion control for SOCKET_OPS bps programs through the setsockopt bpf helper function. It also adds a new SOCKET_OPS op, BPF_SOCKET_OPS_NEEDS_ECN, that is needed for congestion controls, like dctcp, that need to enable

[PATCH iproute2 net] iproute: fix compilation issue with older glibc

2017-06-16 Thread David Lebrun
If a header that includes linux/in6.h is included before iproute's utils.h, then iproute2 fails to compile on older glibc versions. Fixes: e8493916a8ede9970732e33ea52d30b83071f401 ("iproute: add support for SR-IPv6 lwtunnel encapsulation") Reported-by: Daniel Borkmann Signed-off-by: David Lebrun

[PATCH net 2/4] macvlan: Fix passthru macvlan mac address inheritance

2017-06-16 Thread Vladislav Yasevich
When a lower device of the passthru macvlan changes it's address, passthru macvlan is supposed to change it's own address as well. However, that doesn't happen correctly because the check in macvlan_addr_busy() will catch the fact that the lower level (port) mac address is the same as the address w

[PATCH net 4/4] macvlan: Let passthru macvlan correctly restore lower mac address

2017-06-16 Thread Vladislav Yasevich
Passthru macvlans directly change the mac address of the lower level device. That's OK, but after the macvlan is deleted, the lower device is left with changed address and one needs to reboot to bring back the origina HW addresses. This scenario is actually quite common with passthru macvtap devi

[PATCH net 3/4] macvlan: convert port passthru to flags.

2017-06-16 Thread Vladislav Yasevich
Convert the port passthru boolean into flags with access functions. Signed-off-by: Vladislav Yasevich --- drivers/net/macvlan.c | 37 - 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index a735a64.

[PATCH net 1/4] macvlan: Do not return error when setting the same mac address

2017-06-16 Thread Vladislav Yasevich
The user currently gets an EBUSY error when attempting to set the mac address on a macvlan device to the same value. This should really be a no-op as nothing changes. Catch the condition and return early. Signed-off-by: Vladislav Yasevich --- drivers/net/macvlan.c | 4 1 file changed, 4 i

[PATCH net 0/4] macvlan: Fix some issues with changing mac addresses

2017-06-16 Thread Vladislav Yasevich
There are some issues in macvlan wrt to changing it's mac address. * An error is returned in the specified address is the same as an already assigned address. * In passthru mode, the mac address of the macvlan device doesn't change. * After changing the mac address of a passthru macvlan and then

Re: [RFC PATCH net-next v2 07/15] bpf: Add setsockopt helper function to bpf

2017-06-16 Thread Daniel Borkmann
On 06/15/2017 10:08 PM, Lawrence Brakmo wrote: Added support for calling a subset of socket setsockopts from BPF_PROG_TYPE_SOCKET_OPS programs. The code was duplicated rather than making the changes to call the socket setsockopt function because the changes required would have been larger. The o

Re: [PATCH v2 03/11] tty: kbd: reduce stack size with KASAN

2017-06-16 Thread Greg Kroah-Hartman
On Fri, Jun 16, 2017 at 02:01:57PM +0200, Arnd Bergmann wrote: > On Thu, Jun 15, 2017 at 6:53 AM, Greg Kroah-Hartman > wrote: > > On Thu, Jun 15, 2017 at 06:52:21AM +0200, Greg Kroah-Hartman wrote: > >> On Wed, Jun 14, 2017 at 11:15:38PM +0200, Arnd Bergmann wrote: > >> > As reported by kernelci,

fib_rules: Resolve goto rules target on delete

2017-06-16 Thread Serhey Popovych
We should avoid marking goto rules unresolved when their target is actually reachable after rule deletion. Consolder following sample scenario: # ip -4 ru sh 0: from all lookup local 32000: from all goto 32100 32100: from all lookup main 32100: from all lookup default 32766:

RE: [PATCH net-next 5/7] qed*: Set rdma generic functions prefix

2017-06-16 Thread Mintz, Yuval
> Hi Michal, > > [auto build test ERROR on net-next/master] > > url:https://github.com/0day-ci/linux/commits/Yuval-Mintz/qed-RDMA- > and-infrastructure-for-iWARP/20170616-043925 > config: i386-randconfig-x076-06120530 (attached as .config) > compiler: gcc-6 (Debian

RE: [PATCH net-next 4/7] qed*: Rename qede_roce.[ch]

2017-06-16 Thread Mintz, Yuval
>In file included from drivers/net//ethernet/qlogic/qede/qede.h:43:0, > from drivers/net//ethernet/qlogic/qede/qede_ptp.h:38, > from drivers/net//ethernet/qlogic/qede/qede_fp.c:43: > >> include/linux/qed/qede_rdma.h:57:12: warning: 'struct pci_dev' declar

[PATCH v2 5/6] networking: make skb_push & __skb_push return void pointers

2017-06-16 Thread Johannes Berg
From: Johannes Berg It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer w

[PATCH v2 6/6] networking: add and use skb_put_u8()

2017-06-16 Thread Johannes Berg
From: Johannes Berg Joe and Bjørn suggested that it'd be nicer to not have the cast in the fairly common case of doing *(u8 *)skb_put(skb, 1) = c; Add skb_put_u8() for this case, and use it across the code, using the following spatch: @@ expression SKB, C, S; typedef u8;

[PATCH v2 1/6] networking: convert many more places to skb_put_zero()

2017-06-16 Thread Johannes Berg
From: Johannes Berg There were many places that my previous spatch didn't find, as pointed out by yuan linyu in various patches. The following spatch found many more and also removes the now unnecessary casts: @@ identifier p, p2; expression len; expression skb; type t, t2;

[PATCH v2 0/6] skb data accessor cleanups

2017-06-16 Thread Johannes Berg
Changes from v1: * add skb_put_u8() as suggested by Joe and Bjørn Again build-tested by myself and kbuild bot. johannes

[PATCH v2 4/6] networking: make skb_pull & friends return void pointers

2017-06-16 Thread Johannes Berg
From: Johannes Berg It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer w

rtnetlink: add IFLA_GROUP to ifla_policy

2017-06-16 Thread Serhey Popovych
Network interface groups support added while ago, however there is no IFLA_GROUP attribute description in policy and netlink message size calculations until now. Add IFLA_GROUP attribute to the policy. Fixes: cbda10fa97d7 ("net_device: add support for network device groups") Signed-off-by: Serhey

[PATCH] loopback: Force LOOPBACK_IFINDEX for registration

2017-06-16 Thread Serhey Popovych
Now with commit 9c7dafb (net: Allow to create links with given ifindex) support registration of network devices with specific ifindex is added. We can force loopback network device index before call to register_netdev() to ensure we always configure it with LOOPBACK_IFINDEX. Kill BUG_ON() since s

Re: [RFC PATCH net-next v2 01/15] bpf: BPF support for socket ops

2017-06-16 Thread Daniel Borkmann
On 06/15/2017 10:08 PM, Lawrence Brakmo wrote: Created a new BPF program type, BPF_PROG_TYPE_SOCKET_OPS, and a corresponding struct that allows BPF programs of this type to access some of the socket's fields (such as IP addresses, ports, etc.). Currently there is functionality to load one global

[PATCH v3 4/4] net: macb: Add hardware PTP support

2017-06-16 Thread Rafal Ozieblo
This patch is based on original Harini's patch and Andrei's patch, implemented in a separate file to ease the review/maintanance and integration with other platforms. This driver supports GEM-GXL: - Register ptp clock framework - Initialize PTP related registers - HW time stamp on the PTP Ethernet

Re: [PATCH v2 03/11] tty: kbd: reduce stack size with KASAN

2017-06-16 Thread Arnd Bergmann
On Thu, Jun 15, 2017 at 6:53 AM, Greg Kroah-Hartman wrote: > On Thu, Jun 15, 2017 at 06:52:21AM +0200, Greg Kroah-Hartman wrote: >> On Wed, Jun 14, 2017 at 11:15:38PM +0200, Arnd Bergmann wrote: >> > As reported by kernelci, some functions in the VT code use significant >> > amounts of kernel stac

[PATCH v3 2/4] net: macb: Add tsu_clk to device tree

2017-06-16 Thread Rafal Ozieblo
Signed-off-by: Rafal Ozieblo Acked-by: Rob Herring --- Documentation/devicetree/bindings/net/macb.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt index 1506e94..27966ae 100644 --- a/Documenta

[PATCH v3 1/4] net: macb: Add support for PTP timestamps in DMA descriptors

2017-06-16 Thread Rafal Ozieblo
This patch adds support for PTP timestamps in DMA buffer descriptors. It checks capability at runtime and uses appropriate buffer descriptor. Signed-off-by: Rafal Ozieblo --- drivers/net/ethernet/cadence/Kconfig | 10 ++- drivers/net/ethernet/cadence/macb.c | 117 ++

[PATCH v3 0/4] PTP support for macb driver

2017-06-16 Thread Rafal Ozieblo
This patch series adds support for PTP synchronization protocol in Cadence GEM driver based on PHC. v2 changes: * removed alarm's support * removed external time stamp support * removed PTP event interrupt handling * removed ptp_hw_support flag * removed all extra sanity checks * removed unnecessa

Re: [PATCH v2 11/11] kasan: rework Kconfig settings

2017-06-16 Thread Dmitry Vyukov
On Fri, Jun 16, 2017 at 1:42 PM, Arnd Bergmann wrote: >>> diff --git a/lib/Kconfig.kmemcheck b/lib/Kconfig.kmemcheck >>> index 846e039a86b4..58b9f3f81dc8 100644 >>> --- a/lib/Kconfig.kmemcheck >>> +++ b/lib/Kconfig.kmemcheck >>> @@ -7,6 +7,7 @@ menuconfig KMEMCHECK >>> bool "kmemcheck: tra

ipv6: Do not leak throw route references

2017-06-16 Thread Serhey Popovych
While commit 73ba57b (ipv6: fix backtracking for throw routes) does good job on error propagation to the fib_rules_lookup() in fib rules core framework that also corrects throw routes handling, it does not solve route reference leakage problem happened when we return -EAGAIN to the fib_rules_lookup

Re: [PATCH v2 11/11] kasan: rework Kconfig settings

2017-06-16 Thread Arnd Bergmann
On Thu, Jun 15, 2017 at 9:02 AM, Dmitry Vyukov wrote: > On Wed, Jun 14, 2017 at 11:15 PM, Arnd Bergmann wrote: >> diff --git a/lib/Kconfig.kmemcheck b/lib/Kconfig.kmemcheck >> index 846e039a86b4..58b9f3f81dc8 100644 >> --- a/lib/Kconfig.kmemcheck >> +++ b/lib/Kconfig.kmemcheck >> @@ -7,6 +7,7 @@

Re: [RFC 1/3] networking: make skb_put & friends return void pointers

2017-06-16 Thread Joe Perches
On Fri, 2017-06-16 at 13:03 +0200, Johannes Berg wrote: > On Fri, 2017-06-16 at 03:39 -0700, Joe Perches wrote: > > > > I would suggest avoiding using skb_put_u8 as it > > would suggest there should be skb_put_u16 etc > > If there are enough users, I don't know why we wouldn't add it? Though > it

Re: [RFC 1/3] networking: make skb_put & friends return void pointers

2017-06-16 Thread Johannes Berg
On Fri, 2017-06-16 at 03:39 -0700, Joe Perches wrote: > > I would suggest avoiding using skb_put_u8 as it > would suggest there should be skb_put_u16 etc If there are enough users, I don't know why we wouldn't add it? Though it should be _unaligned_le16 and _unaligned_be16, if at all :) johannes

Re: Request for -stable inclusion (xt_TCPMSS)

2017-06-16 Thread Guillaume Nault
On Fri, Jun 16, 2017 at 11:59:12AM +0200, Pablo Neira Ayuso wrote: > Hi Guillaume, > > On Fri, Jun 16, 2017 at 09:45:17AM +0200, Guillaume Nault wrote: > > Hi David, > > > > Please queue 2638fd0f92d4 ("netfilter: xt_TCPMSS: add more sanity tests on > > tcph->doff") > > for -stable. > > It fixes

Re: [RFC 1/3] networking: make skb_put & friends return void pointers

2017-06-16 Thread Joe Perches
On Fri, 2017-06-16 at 10:42 +0200, Johannes Berg wrote: > On Fri, 2017-06-16 at 09:53 +0200, Bjørn Mork wrote: > > > There seem to be a large number of places where the char pointer was > > used directly. Not that I have any strong opinion either way, but > > adding lots of ugly casts like this se

Re: [PATCH RFC 2/3] samples/bpf: Add define __EMITTING_BPF__ when building BPF

2017-06-16 Thread Daniel Borkmann
On 06/16/2017 12:35 AM, David Daney wrote: ... this allows gating of inline assembly code that causes llvm to fail when emitting BPF. Signed-off-by: David Daney I don't have a better idea at the moment, perhaps there could be a clang rewrite plugin that would ignore all inline assembly code s

[PATCH net-next] cxgb4: fix a NULL dereference

2017-06-16 Thread Ganesh Goudar
Avoid NULL dereference in setup_sge_queues() when the adapter is in non offload mode. Fixes: 0fbc81b3ad51 ('chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's') Signed-off-by: Ganesh Goudar --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 5 - 1 file chan

Re: Request for -stable inclusion (xt_TCPMSS)

2017-06-16 Thread Pablo Neira Ayuso
Hi Guillaume, On Fri, Jun 16, 2017 at 09:45:17AM +0200, Guillaume Nault wrote: > Hi David, > > Please queue 2638fd0f92d4 ("netfilter: xt_TCPMSS: add more sanity tests on > tcph->doff") > for -stable. > It fixes hard to debug crashes in production, that can be triggered by > remote peers. What s

Re: [RFC 3/3] networking: make skb_push & __skb_push return void pointers

2017-06-16 Thread Johannes Berg
On Fri, 2017-06-16 at 02:19 -0700, Joe Perches wrote: > > >   if (frag_size  == > > PN533_CMD_DATAFRAME_MAXLEN) > > - *skb_push(frag, sizeof(u8)) = > > - (PN533_CMD > > _MI_MASK | 1); > > -

Re: [RFC 3/3] networking: make skb_push & __skb_push return void pointers

2017-06-16 Thread Joe Perches
On Fri, 2017-06-16 at 00:12 +0200, Johannes Berg wrote: > From: Johannes Berg [] > diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c [] > @@ -2090,10 +2090,10 @@ static int pn533_fill_fragment_skbs(struct pn533 > *dev, struct sk_buff *skb) > > /* MI + TG *

Re: [alsa-devel] [PATCH 04/11] sound/hal2: switch to dma_alloc_attrs

2017-06-16 Thread Takashi Iwai
On Fri, 16 Jun 2017 10:51:47 +0200, Christoph Hellwig wrote: > > On Fri, Jun 16, 2017 at 10:49:56AM +0200, Takashi Iwai wrote: > > On Fri, 16 Jun 2017 09:17:09 +0200, > > Christoph Hellwig wrote: > > > > > > Use dma_alloc_attrs directly instead of the dma_alloc_noncoherent wrapper. > > > > > > S

Re: [patch iproute2/net-next] tc: don't print error message on miss when parsing control action with default

2017-06-16 Thread Jiri Benc
On Thu, 15 Jun 2017 14:10:51 +0200, Jiri Pirko wrote: > From: Jiri Pirko > > In case default control action parsing takes place, it is ok to miss. > So don't print error message. > > Fixes: e67aba559581 ("tc: actions: add helpers to parse and print control > actions") > Reported-by: Jiri Benc

[PATCH] net: macb: add fixed-link node support

2017-06-16 Thread Michael Grzeschik
In case the MACB is directly connected to a non-mdio PHY/device, it should be possible to provide a fixed link configuration in the DT. Signed-off-by: Michael Grzeschik --- drivers/net/ethernet/cadence/macb.c | 21 + drivers/net/ethernet/cadence/macb.h | 2 +- 2 files change

[PATCH NET] net/hns:bugfix of ethtool -t phy self_test

2017-06-16 Thread Lin Yun Sheng
This patch fixes the phy loopback self_test failed issue. when Marvell Phy Module is loaded, it will powerdown fiber when doing phy loopback self test, which cause phy loopback self_test fail. Signed-off-by: Lin Yun Sheng --- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 16 ++--

Re: [alsa-devel] [PATCH 04/11] sound/hal2: switch to dma_alloc_attrs

2017-06-16 Thread Christoph Hellwig
On Fri, Jun 16, 2017 at 10:49:56AM +0200, Takashi Iwai wrote: > On Fri, 16 Jun 2017 09:17:09 +0200, > Christoph Hellwig wrote: > > > > Use dma_alloc_attrs directly instead of the dma_alloc_noncoherent wrapper. > > > > Signed-off-by: Christoph Hellwig > > Should I take this one through sound git

Re: [alsa-devel] [PATCH 04/11] sound/hal2: switch to dma_alloc_attrs

2017-06-16 Thread Takashi Iwai
On Fri, 16 Jun 2017 09:17:09 +0200, Christoph Hellwig wrote: > > Use dma_alloc_attrs directly instead of the dma_alloc_noncoherent wrapper. > > Signed-off-by: Christoph Hellwig Should I take this one through sound git tree, or would you prefer taking all through another? In the latter case,

Re: [PATCH 28/44] sparc: remove arch specific dma_supported implementations

2017-06-16 Thread Christoph Hellwig
On Fri, Jun 09, 2017 at 12:22:48AM +1000, Julian Calaby wrote: > I'm guessing there's a few places that have DMA ops but DMA isn't > actually supported. Why not have a common method for this, maybe > "dma_not_supported"? It's not common at all. Except for sbus all dma API user first call set_dma_

Re: [PATCH 27/44] sparc: remove leon_dma_ops

2017-06-16 Thread Christoph Hellwig
On Mon, Jun 12, 2017 at 10:06:26AM +0200, Andreas Larsson wrote: > Yes, it is needed. LEON systems are AMBA bus based. The common case here is > DMA over AMBA buses. Some LEON systems have PCI bridges, but in general > CONFIG_PCI is not a given. Ok, and even for AMBA we use the pci ops, so I'll

[PATCH v4.9 -stable] sfc: provide dummy definitions of vswitch functions

2017-06-16 Thread Bert Kenward
efx_probe_all() calls efx->type->vswitching_probe during probe. For SFC4000 (Falcon) NICs this function is not defined, leading to a BUG with the top of the call stack similar to: ? efx_pci_probe_main+0x29a/0x830 efx_pci_probe+0x7d3/0xe70 vswitching_restore and vswitching_remove also need to b

Re: [PATCH 25/44] arm: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
On Thu, Jun 08, 2017 at 03:43:14PM +0100, Russell King - ARM Linux wrote: > BOn Thu, Jun 08, 2017 at 03:25:50PM +0200, Christoph Hellwig wrote: > > +static int dmabounce_mapping_error(struct device *dev, dma_addr_t dma_addr) > > +{ > > + if (dev->archdata.dmabounce) > > + return 0; > >

Re: [RFC 1/3] networking: make skb_put & friends return void pointers

2017-06-16 Thread Johannes Berg
On Fri, 2017-06-16 at 09:53 +0200, Bjørn Mork wrote: > There seem to be a large number of places where the char pointer was > used directly. Not that I have any strong opinion either way, but > adding lots of ugly casts like this seems to contradict the whole > purpose of this change?: > > -

<    1   2   3   >