[PATCH v4 bpf-next 3/5] selftests/bpf: add BPF ringbuf selftests

2020-05-29 Thread Andrii Nakryiko
Both singleton BPF ringbuf and BPF ringbuf with map-in-map use cases are tested. Also reserve+submit/discards and output variants of API are validated. Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/prog_tests/ringbuf.c| 211 ++ .../selftests/bpf/prog_tests/ringbuf_

[PATCH v4 bpf-next 0/5] BPF ring buffer

2020-05-29 Thread Andrii Nakryiko
Implement a new BPF ring buffer, as presented at BPF virtual conference ([0]). It presents an alternative to perf buffer, following its semantics closely, but allowing sharing same instance of ring buffer across multiple CPUs efficiently. Most patches have extensive commentary explaining various a

[PATCH v4 bpf-next 5/5] docs/bpf: add BPF ring buffer design notes

2020-05-29 Thread Andrii Nakryiko
Add commit description from patch #1 as a stand-alone documentation under Documentation/bpf, as it might be more convenient format, in long term perspective. Suggested-by: Stanislav Fomichev Signed-off-by: Andrii Nakryiko --- Documentation/bpf/ringbuf.rst | 209 +

[PATCH v4 bpf-next 2/5] libbpf: add BPF ring buffer support

2020-05-29 Thread Andrii Nakryiko
Declaring and instantiating BPF ring buffer doesn't require any changes to libbpf, as it's just another type of maps. So using existing BTF-defined maps syntax with __uint(type, BPF_MAP_TYPE_RINGBUF) and __uint(max_elements, ) is all that's necessary to create and use BPF ring buffer. This patch a

[PATCH v4 bpf-next 4/5] bpf: add BPF ringbuf and perf buffer benchmarks

2020-05-29 Thread Andrii Nakryiko
Extend bench framework with ability to have benchmark-provided child argument parser for custom benchmark-specific parameters. This makes bench generic code modular and independent from any specific benchmark. Also implement a set of benchmarks for new BPF ring buffer and existing perf buffer. 4 b

[PATCH v4 bpf-next 1/5] bpf: implement BPF ring buffer and verifier support for it

2020-05-29 Thread Andrii Nakryiko
This commit adds a new MPSC ring buffer implementation into BPF ecosystem, which allows multiple CPUs to submit data to a single shared ring buffer. On the consumption side, only single consumer is assumed. Motivation -- There are two distinctive motivators for this work, which are not sat

[PATCH 1/6] vhost: allow device that does not depend on vhost worker

2020-05-29 Thread Jason Wang
vDPA device currently relays the eventfd via vhost worker. This is inefficient due the latency of wakeup and scheduling, so this patch tries to introduce a use_worker attribute for the vhost device. When use_worker is not set with vhost_dev_init(), vhost won't try to allocate a worker thread and th

[PATCH 2/6] vhost: use mmgrab() instead of mmget() for non worker device

2020-05-29 Thread Jason Wang
For the device that doesn't use vhost worker and use_mm(), mmget() is too heavy weight and it may brings troubles for implementing mmap() support for vDPA device. This is because, an reference to the address space was held via mm_get() in vhost_dev_set_owner() and an reference to the file was held

[PATCH 0/6] vDPA: doorbell mapping

2020-05-29 Thread Jason Wang
Hi all: This series introduce basic functionality of doorbell mapping support for vhost-vDPA. Userspace program may use mmap() to map a the doorbell of a specific virtqueue into its address space. This is help to reudce the syscall or vmexit overhead. A new vdpa_config_ops was introduced to repor

[PATCH 5/6] vdpa: introduce virtio pci driver

2020-05-29 Thread Jason Wang
This patch introduce a vDPA driver for virtio-pci device. It bridges the virtio-pci control command to the vDPA bus. This will be used for developing new features for both software vDPA framework and hardware vDPA feature. Compared to vdpa_sim, it has several advantages: - it's a real device driv

[PATCH 3/6] vdpa: introduce get_vq_notification method

2020-05-29 Thread Jason Wang
This patch introduces a new method in the vdpa_config_ops which reports the physical address and the size of the doorbell for a specific virtqueue. This will be used by the future patches that maps doorbell to userspace. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 16

[PATCH 6/6] vdpa: vp_vdpa: report doorbell location

2020-05-29 Thread Jason Wang
This patch adds support for reporting doorbell location in vp_vdpa driver. The doorbell mapping could be then enabled by e.g launching qemu's virtio-net-pci device with page-per-vq enabled. Signed-off-by: Jason Wang --- drivers/vdpa/vp_vdpa/vp_vdpa.c | 29 + 1 file ch

[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap

2020-05-29 Thread Jason Wang
Currently the doorbell is relayed via eventfd which may have significant overhead because of the cost of vmexits or syscall. This patch introduces mmap() based doorbell mapping which can eliminate the overhead caused by vmexit or syscall. To ease the userspace modeling of the doorbell layout (usua

[PATCH net-next 2/2] bridge: mrp: Add support for role MRA

2020-05-29 Thread Horatiu Vultur
A node that has the MRA role, it can behave as MRM or MRC. Initially it starts as MRM and sends MRP_Test frames on both ring ports. If it detects that there are MRP_Test send by another MRM, then it checks if these frames have a lower priority than itself. In this case it would send MRP_Nack frame

[PATCH net-next 1/2] bridge: mrp: Set the priority of MRP instance

2020-05-29 Thread Horatiu Vultur
Each MRP instance has a priority, a lower value means a higher priority. The priority of MRP instance is stored in MRP_Test frame in this way all the MRP nodes in the ring can see other nodes priority. Signed-off-by: Horatiu Vultur --- include/net/switchdev.h| 1 + include/uapi/linux/if_

[PATCH net-next 0/2] bridge: mrp: Add support for MRA role

2020-05-29 Thread Horatiu Vultur
This patch series extends the MRP with the MRA role. A node that has the MRA role can behave as a MRM or as a MRC. In case there are multiple nodes in the topology that has the MRA role then only one node can behave as MRM and all the others need to be have as MRC. The node that has the higher prio

Re: [PATCH net-next 1/2] bridge: mrp: Set the priority of MRP instance

2020-05-29 Thread Nikolay Aleksandrov
On 29/05/2020 13:05, Horatiu Vultur wrote: > Each MRP instance has a priority, a lower value means a higher priority. > The priority of MRP instance is stored in MRP_Test frame in this way > all the MRP nodes in the ring can see other nodes priority. > > Signed-off-by: Horatiu Vultur > --- > inc

Re: [PATCH net-next 11/11] net: dsa: ocelot: introduce driver for Seville VSC9953 switch

2020-05-29 Thread Alexandre Belloni
On 29/05/2020 01:09:16+0300, Vladimir Oltean wrote: > On Fri, 29 May 2020 at 00:56, Andrew Lunn wrote: > > > > > Extending the Felix driver to probe a PCI as well as a platform device > > > would have introduced unnecessary complexity. The 'meat' of both drivers > > > is in drivers/net/ethernet/ms

Re: [PATCH v3 bpf-next 1/5] devmap: Formalize map value as a named struct

2020-05-29 Thread Jesper Dangaard Brouer
On Thu, 28 May 2020 23:20:53 -0600 David Ahern wrote: > Add 'struct bpf_devmap_val' to the bpf uapi to formalize the > expected values that can be passed in for a DEVMAP. > Update devmap code to use the struct. > > Signed-off-by: David Ahern > --- > include/uapi/linux/bpf.h | 5 + >

Re: [PATCH v2 bpf-next 2/4] bpf: Introduce sleepable BPF programs

2020-05-29 Thread Andrii Nakryiko
On Thu, May 28, 2020 at 9:39 PM Alexei Starovoitov wrote: > > From: Alexei Starovoitov > > Introduce sleepable BPF programs that can request such property for themselves > via BPF_F_SLEEPABLE flag at program load time. In such case they will be able > to use helpers like bpf_copy_from_user() that

[PATCH] net: ethernet: mtk-star-emac: remove unused variable

2020-05-29 Thread Bartosz Golaszewski
From: Bartosz Golaszewski The desc pointer is set but not used. Remove it. Reported-by: kbuild test robot Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver") Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/mediatek/mtk_star_emac.c | 3 --- 1 file changed, 3 deletions(

Re: [PATCH] net: ethernet: mtk-star-emac: remove unused variable

2020-05-29 Thread Bartosz Golaszewski
pt., 29 maj 2020 o 10:26 Bartosz Golaszewski napisał(a): > > From: Bartosz Golaszewski > > The desc pointer is set but not used. Remove it. > > Reported-by: kbuild test robot > Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver") > Signed-off-by: Bartosz Golaszewski > --- > drivers

Re: [PATCH net-next 11/11] net: dsa: ocelot: introduce driver for Seville VSC9953 switch

2020-05-29 Thread Vladimir Oltean
Hi Alexandre, On Fri, 29 May 2020 at 11:14, Alexandre Belloni wrote: > > On 29/05/2020 01:09:16+0300, Vladimir Oltean wrote: > > On Fri, 29 May 2020 at 00:56, Andrew Lunn wrote: > > > > > > > Extending the Felix driver to probe a PCI as well as a platform device > > > > would have introduced unn

Re: Self-XORing BPF registers is undefined behavior

2020-05-29 Thread Edward Cree
On 29/05/2020 07:14, Dmitry Vyukov wrote: >> (In C99 it gets subtler because an 'indeterminate value' is >> defined to be 'either a valid value or a trap representation', >> so arguably the compiler can only do this stuff if it _has_ >> trap representations for the type in question.) > Interesti

Re: [PATCH] net: qrtr: Allocate workqueue before kernel_bind

2020-05-29 Thread Manivannan Sadhasivam
On Thu, May 28, 2020 at 04:05:26PM -0700, Chris Lew wrote: > A null pointer dereference in qrtr_ns_data_ready() is seen if a client > opens a qrtr socket before qrtr_ns_init() can bind to the control port. > When the control port is bound, the ENETRESET error will be broadcasted > and clients will

Re: [02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ae_dev()

2020-05-29 Thread Markus Elfring
>> Would you like to add the tag “Fixes” to the commit message? > > Since it seems not a very urgent issue, so i send it to the -next I suggest to take another look at the prioritisation for another completion of the exception handling. > and make it as a code optimization. I propose to reconsi

Re: [PATCH net-next 11/11] net: dsa: ocelot: introduce driver for Seville VSC9953 switch

2020-05-29 Thread Alexandre Belloni
On 29/05/2020 11:30:43+0300, Vladimir Oltean wrote: > > As ocelot can be used in a DSA configuration (even if it is not > > implemented yet), I don't think this would be correct. From my point of > > view, felix and seville are part of the ocelot family. > > > > In this case, there would be a thir

Re: Link down reasons

2020-05-29 Thread Petr Machata
Andrew Lunn writes: > It is called downshift. And we have support for it in the phylib core, > if the PHY has the needed vendor register. > > https://elixir.bootlin.com/linux/v5.7-rc7/source/drivers/net/phy/phy-core.c#L341 > https://elixir.bootlin.com/linux/v5.7-rc7/source/drivers/net/phy/phy.c

Re: [PATCH] bpf/sockmap: fix kernel panic at __tcp_bpf_recvmsg

2020-05-29 Thread dihu
On 2020/5/27 5:10, John Fastabend wrote: dihu wrote: From 865a45747de6b68fd02a0ff128a69a5c8feb73c3 Mon Sep 17 00:00:00 2001 From: dihu Date: Mon, 25 May 2020 17:23:16 +0800 Subject: [PATCH] bpf/sockmap: fix kernel panic at __tcp_bpf_recvmsg When user application calls read() with MSG_PEEK f

Re: [PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap

2020-05-29 Thread Mika Penttilä
Hi, On 29.5.2020 11.03, Jason Wang wrote: Currently the doorbell is relayed via eventfd which may have significant overhead because of the cost of vmexits or syscall. This patch introduces mmap() based doorbell mapping which can eliminate the overhead caused by vmexit or syscall. Just wonderin

Re: [PATCH] net: atm: Replace kmalloc with kzalloc in the error message

2020-05-29 Thread Andy Shevchenko
On Fri, May 29, 2020 at 09:01:42AM +0800, Yi Wang wrote: > From: Liao Pingfang > > Use kzalloc instead of kmalloc in the error message according to > the previous kzalloc() call. Looking into the context (atomic!) and error message itself I would rather drop message completely. > Signed-off-by:

Re: [PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap

2020-05-29 Thread Jason Wang
On 2020/5/29 下午5:16, Mika Penttilä wrote: Hi, On 29.5.2020 11.03, Jason Wang wrote: Currently the doorbell is relayed via eventfd which may have significant overhead because of the cost of vmexits or syscall. This patch introduces mmap() based doorbell mapping which can eliminate the overhead

[PATCH net-next] net: phy: mscc: fix PHYs using the vsc8574_probe

2020-05-29 Thread Antoine Tenart
PHYs using the vsc8574_probe fail to be initialized and their config_init return -EIO leading to errors like: "could not attach PHY: -5". This is because when the conversion of the MSCC PHY driver to use the shared PHY package helpers was done, the base address retrieval and the base PHY read and

[PATCH net-next] net: phy: marvell: unlock after phy_select_page() failure

2020-05-29 Thread Dan Carpenter
We need to call phy_restore_page() even if phy_select_page() fails. Otherwise we are holding the phy_lock_mdio_bus() lock. This requirement is documented at the start of the phy_select_page() function. Fixes: a618e86da91d ("net : phy: marvell: Speedup TDR data retrieval by only changing page onc

Re: [PATCH net-next v3] net: phy: micrel: add phy-mode support for the KSZ9031 PHY

2020-05-29 Thread Geert Uytterhoeven
Hi Andrew, On Thu, May 28, 2020 at 6:08 PM Andrew Lunn wrote: > On Thu, May 28, 2020 at 03:10:06PM +0200, Geert Uytterhoeven wrote: > > On Wed, May 27, 2020 at 10:52 PM Andrew Lunn wrote: > > > > You may wonder what's the difference between 3 and 4? It's not just the > > > > PHY driver that look

pull request (net-next): ipsec-next 2020-05-29

2020-05-29 Thread Steffen Klassert
1) Add IPv6 encapsulation support for ESP over UDP and TCP. From Sabrina Dubroca. 2) Remove unneeded reference when initializing xfrm interfaces. From Nicolas Dichtel. 3) Remove some indirect calls from the state_afinfo. From Florian Westphal. Please note that this pull request has two

[PATCH 06/11] xfrm: move xfrm4_extract_header to common helper

2020-05-29 Thread Steffen Klassert
From: Florian Westphal The function only initializes the XFRM CB in the skb. After previous patch xfrm4_extract_header is only called from net/xfrm/xfrm_{input,output}.c. Because of IPV6=m linker errors the ipv6 equivalent (xfrm6_extract_header) was already placed in xfrm_inout.h because we can

[PATCH 01/11] xfrm interface: don't take extra reference to netdev

2020-05-29 Thread Steffen Klassert
From: Nicolas Dichtel I don't see any reason to do this. Maybe needed before commit 56c5ee1a5823 ("xfrm interface: fix memory leak on creation"). Signed-off-by: Nicolas Dichtel Signed-off-by: Steffen Klassert --- net/xfrm/xfrm_interface.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/n

[PATCH 05/11] xfrm: state: remove extract_input indirection from xfrm_state_afinfo

2020-05-29 Thread Steffen Klassert
From: Florian Westphal In order to keep CONFIG_IPV6=m working, xfrm6_extract_header needs to be duplicated. It will be removed again in a followup change when the remaining caller is moved to net/xfrm as well. Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert --- include/net/xf

[PATCH 04/11] xfrm: avoid extract_output indirection for ipv4

2020-05-29 Thread Steffen Klassert
From: Florian Westphal We can use a direct call for ipv4, so move the needed functions to net/xfrm/xfrm_output.c and call them directly. For ipv6 the indirection can be avoided as well but it will need a bit more work -- to ease review it will be done in another patch. Signed-off-by: Florian We

[PATCH 09/11] xfrm: remove extract_output indirection from xfrm_state_afinfo

2020-05-29 Thread Steffen Klassert
From: Florian Westphal Move this to xfrm_output.c. This avoids the state->extract_output indirection. This patch also removes the duplicated __xfrm6_extract_header helper added in an earlier patch, we can now use the one from xfrm_inout.h . Signed-off-by: Florian Westphal Signed-off-by: Steff

[PATCH 08/11] xfrm: place xfrm6_local_dontfrag in xfrm.h

2020-05-29 Thread Steffen Klassert
From: Florian Westphal so next patch can re-use it from net/xfrm/xfrm_output.c without causing a linker error when IPV6 is a module. Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert --- include/net/xfrm.h | 16 net/ipv6/xfrm6_output.c | 21 ++--

[PATCH 03/11] xfrm: add IPv6 support for espintcp

2020-05-29 Thread Steffen Klassert
From: Sabrina Dubroca This extends espintcp to support IPv6, building on the existing code and the new UDPv6 encapsulation support. Most of the code is either reused directly (stream parser, ULP) or very similar to the IPv4 variant (net/ipv6/esp6.c changes). The separation of config options for

[PATCH 07/11] xfrm: expose local_rxpmtu via ipv6_stubs

2020-05-29 Thread Steffen Klassert
From: Florian Westphal We cannot call this function from the core kernel unless we would force CONFIG_IPV6=y. Therefore expose this via ipv6_stubs so we can call it from net/xfrm in the followup patch. Since the call is expected to be unlikely, no extra code for the IPV6=y case is added and we

[PATCH 02/11] xfrm: add support for UDPv6 encapsulation of ESP

2020-05-29 Thread Steffen Klassert
From: Sabrina Dubroca This patch adds support for encapsulation of ESP over UDPv6. The code is very similar to the IPv4 encapsulation implementation, and allows to easily add espintcp on IPv6 as a follow-up. Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert --- include/net/ipv6_s

[PATCH 11/11] xfrm: fix unused variable warning if CONFIG_NETFILTER=n

2020-05-29 Thread Steffen Klassert
From: Florian Westphal After recent change 'x' is only used when CONFIG_NETFILTER is set: net/ipv4/xfrm4_output.c: In function '__xfrm4_output': net/ipv4/xfrm4_output.c:19:21: warning: unused variable 'x' [-Wunused-variable] 19 | struct xfrm_state *x = skb_dst(skb)->xfrm; Expand the CONFIG_

[PATCH 10/11] xfrm: remove output_finish indirection from xfrm_state_afinfo

2020-05-29 Thread Steffen Klassert
From: Florian Westphal There are only two implementaions, one for ipv4 and one for ipv6. Both are almost identical, they clear skb->cb[], set the TRANSFORMED flag in IP(6)CB and then call the common xfrm_output() function. By placing the IPCB handling into the common function, we avoid the need

Re: [PATCHv2 ipsec] xfrm: fix a warning in xfrm_policy_insert_list

2020-05-29 Thread Steffen Klassert
On Mon, May 25, 2020 at 01:53:37PM +0800, Xin Long wrote: > This waring can be triggered simply by: > > # ip xfrm policy update src 192.168.1.1/24 dst 192.168.1.2/24 dir in \ > priority 1 mark 0 mask 0x10 #[1] > # ip xfrm policy update src 192.168.1.1/24 dst 192.168.1.2/24 dir in \ >

Re: [PATCH ipsec] xfrm: fix a NULL-ptr deref in xfrm_local_error

2020-05-29 Thread Steffen Klassert
On Tue, May 26, 2020 at 05:41:46PM +0800, Xin Long wrote: > This patch is to fix a crash: > > [ ] kasan: GPF could be caused by NULL-ptr deref or user memory access > [ ] general protection fault: [#1] SMP KASAN PTI > [ ] RIP: 0010:ipv6_local_error+0xac/0x7a0 > [ ] Call Trace: > [ ]

[PATCH 09/15] xfrm: call xfrm_output_gso when inner_protocol is set in xfrm_output

2020-05-29 Thread Steffen Klassert
From: Xin Long An use-after-free crash can be triggered when sending big packets over vxlan over esp with esp offload enabled: [] BUG: KASAN: use-after-free in ipv6_gso_pull_exthdrs.part.8+0x32c/0x4e0 [] Call Trace: [] dump_stack+0x75/0xa0 [] kasan_report+0x37/0x50 [] ipv6_gso_pull_

[PATCH 03/15] esp6: get the right proto for transport mode in esp6_gso_encap

2020-05-29 Thread Steffen Klassert
From: Xin Long For transport mode, when ipv6 nexthdr is set, the packet format might be like: || dest | | | | ESP| ESP | | IP6 hdr| opts.| ESP | TCP | Data | Trailer | ICV | ---

[PATCH 01/15] xfrm: allow to accept packets with ipv6 NEXTHDR_HOP in xfrm_input

2020-05-29 Thread Steffen Klassert
From: Xin Long For beet mode, when it's ipv6 inner address with nexthdrs set, the packet format might be: | outer | | dest | | | ESP| ESP | | IP hdr | ESP | opts.| TCP | Data | Trailer | ICV | ---

[PATCH 08/15] esp4: support ipv6 nexthdrs process for beet gso segment

2020-05-29 Thread Steffen Klassert
From: Xin Long For beet mode, when it's ipv6 inner address with nexthdrs set, the packet format might be: | outer | | dest | | | ESP| ESP | | IP hdr | ESP | opts.| TCP | Data | Trailer | ICV | ---

[PATCH 05/15] xfrm: fix error in comment

2020-05-29 Thread Steffen Klassert
From: Antony Antony s/xfrm_state_offload/xfrm_user_offload/ Fixes: d77e38e612a ("xfrm: Add an IPsec hardware offloading API") Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert --- include/uapi/linux/xfrm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/

[PATCH 04/15] xfrm: remove the xfrm_state_put call becofe going to out_reset

2020-05-29 Thread Steffen Klassert
From: Xin Long This xfrm_state_put call in esp4/6_gro_receive() will cause double put for state, as in out_reset path secpath_reset() will put all states set in skb sec_path. So fix it by simply remove the xfrm_state_put call. Fixes: 6ed69184ed9c ("xfrm: Reset secpath in xfrm failure") Signed-o

[PATCH 07/15] esp6: support ipv6 nexthdrs process for beet gso segment

2020-05-29 Thread Steffen Klassert
From: Xin Long For beet mode, when it's ipv6 inner address with nexthdrs set, the packet format might be: | outer | | dest | | | ESP| ESP | | IP6 hdr| ESP | opts.| TCP | Data | Trailer | ICV | ---

pull request (net): ipsec 2020-05-29

2020-05-29 Thread Steffen Klassert
1) Several fixes for ESP gro/gso in transport and beet mode when IPv6 extension headers are present. From Xin Long. 2) Fix a wrong comment on XFRMA_OFFLOAD_DEV. From Antony Antony. 3) Fix sk_destruct callback handling on ESP in TCP encapsulation. From Sabrina Dubroca. 4) Fix a use after

[PATCH 02/15] xfrm: do pskb_pull properly in __xfrm_transport_prep

2020-05-29 Thread Steffen Klassert
From: Xin Long For transport mode, when ipv6 nexthdr is set, the packet format might be like: || dest | | | | ESP| ESP | | IP6 hdr| opts.| ESP | TCP | Data | Trailer | ICV | ---

Re: [PATCH net] net: mvpp2: Enable autoneg bypass for 1000BaseX/2500BaseX ports

2020-05-29 Thread Thomas Bogendoerfer
On Thu, 28 May 2020 23:04:20 +0100 Russell King - ARM Linux admin wrote: > Can you explain this please? Just as we think we understand what's > going on here, you throw in a new comment that makes us confused. sorry about that. > You said previously that the mvpp2 was connected to a switch, wh

[PATCH 13/15] esp4: improve xfrm4_beet_gso_segment() to be more readable

2020-05-29 Thread Steffen Klassert
From: Xin Long This patch is to improve the code to make xfrm4_beet_gso_segment() more readable, and keep consistent with xfrm6_beet_gso_segment(). Signed-off-by: Xin Long Signed-off-by: Steffen Klassert --- net/ipv4/esp4_offload.c | 19 +++ 1 file changed, 11 insertions(+), 8

[PATCH 14/15] xfrm: fix a warning in xfrm_policy_insert_list

2020-05-29 Thread Steffen Klassert
From: Xin Long This waring can be triggered simply by: # ip xfrm policy update src 192.168.1.1/24 dst 192.168.1.2/24 dir in \ priority 1 mark 0 mask 0x10 #[1] # ip xfrm policy update src 192.168.1.1/24 dst 192.168.1.2/24 dir in \ priority 2 mark 0 mask 0x1 #[2] # ip xfrm policy

[PATCH 10/15] ip_vti: receive ipip packet by calling ip_tunnel_rcv

2020-05-29 Thread Steffen Klassert
From: Xin Long In Commit dd9ee3444014 ("vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel"), it tries to receive IPIP packets in vti by calling xfrm_input(). This case happens when a small packet or frag sent by peer is too small to get compressed. However, xfrm_input() will stil

[PATCH 15/15] xfrm: fix a NULL-ptr deref in xfrm_local_error

2020-05-29 Thread Steffen Klassert
From: Xin Long This patch is to fix a crash: [ ] kasan: GPF could be caused by NULL-ptr deref or user memory access [ ] general protection fault: [#1] SMP KASAN PTI [ ] RIP: 0010:ipv6_local_error+0xac/0x7a0 [ ] Call Trace: [ ] xfrm6_local_error+0x1eb/0x300 [ ] xfrm_local_error

Re: [PATCH net-next] net: phy: mscc: fix PHYs using the vsc8574_probe

2020-05-29 Thread Michael Walle
Am 29. Mai 2020 11:49:09 MESZ schrieb Antoine Tenart : >PHYs using the vsc8574_probe fail to be initialized and their >config_init return -EIO leading to errors like: >"could not attach PHY: -5". > >This is because when the conversion of the MSCC PHY driver to use the >shared PHY package helpers w

[PATCH 12/15] esp6: calculate transport_header correctly when sel.family != AF_INET6

2020-05-29 Thread Steffen Klassert
From: Xin Long In esp6_init_state() for beet mode when x->sel.family != AF_INET6: x->props.header_len = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead) + IPV4_BEET_PHMAXLEN + (sizeof(struct ipv6hdr) - sizeof(struct iphdr)) In xfrm6_beet_gso_segment() skb->transport_header is su

[PATCH 06/15] xfrm: espintcp: save and call old ->sk_destruct

2020-05-29 Thread Steffen Klassert
From: Sabrina Dubroca When ESP encapsulation is enabled on a TCP socket, I'm replacing the existing ->sk_destruct callback with espintcp_destruct. We still need to call the old callback to perform the other cleanups when the socket is destroyed. Save the old callback, and call it from espintcp_de

[PATCH 11/15] xfrm interface: fix oops when deleting a x-netns interface

2020-05-29 Thread Steffen Klassert
From: Nicolas Dichtel Here is the steps to reproduce the problem: ip netns add foo ip netns add bar ip -n foo link add xfrmi0 type xfrm dev lo if_id 42 ip -n foo link set xfrmi0 netns bar ip netns del foo ip netns del bar Which results to: [ 186.686395] general protection fault, probably for no

[PATCH net-next 0/2] selftests: forwarding: Two small changes

2020-05-29 Thread Petr Machata
Two unrelated changes in this patchset: - In patch #1, convert mirror tests from using ping directly to generating ICMP packets by mausezahn. Using ping in tests is error-prone, because ping is too smart. On a flaky system (notably in a simulator), when packets don't come quickly enough, mor

[PATCH net-next 1/2] selftests: forwarding: mirror_lib: Use mausezahn

2020-05-29 Thread Petr Machata
Using ping in tests is error-prone, because ping is too smart. On a flaky system (notably in a simulator), when packets don't come quickly enough, more pings are sent, and that throws off counters. Instead use mausezahn to generate ICMP echo request packets. That allows us to send them in quicker s

[PATCH net-next 2/2] selftests: forwarding: pedit_dsfield: Check counter value

2020-05-29 Thread Petr Machata
A missing stats_update callback was recently added to act_pedit. Now that iproute2 supports JSON dumping for pedit, extend the pedit_dsfield selftest with a check that would have caught the fact that the callback was missing. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding

[PATCH] net: udp: remove the redundant assignment

2020-05-29 Thread Wang Li
Signed-off-by: Wang Li --- net/ipv4/udp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 32564b350823..54db5182c884 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -798,7 +798,6 @@ void udp_set_csum(bool nocheck, struct sk_buff *skb, } else if

Re: [PATCH] net: udp: remove the redundant assignment

2020-05-29 Thread Joe Perches
On Fri, 2020-05-29 at 19:23 +0800, Wang Li wrote: > diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c [] > @@ -798,7 +798,6 @@ void udp_set_csum(bool nocheck, struct sk_buff *skb, > } else if (skb_is_gso(skb)) { > uh->check = ~udp_v4_check(len, saddr, daddr, 0); > } else if (sk

RE: [PATCH v2 net-next 0/7] dpaa2-eth: add support for Rx traffic classes

2020-05-29 Thread Ioana Ciornei
> Subject: Re: [PATCH v2 net-next 0/7] dpaa2-eth: add support for Rx traffic > classes > > On Sat, 16 May 2020 08:16:47 + Ioana Ciornei wrote: > > > With the Rx QoS features users won't even be able to tell via > > > standard Linux interfaces what the config was. > > > > Ok, that is true. So h

Re: [PATCH net-next 1/2] bridge: mrp: Set the priority of MRP instance

2020-05-29 Thread Horatiu Vultur
The 05/29/2020 11:12, Nikolay Aleksandrov wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > On 29/05/2020 13:05, Horatiu Vultur wrote: > > Each MRP instance has a priority, a lower value means a higher priority. > > The priority of MRP insta

remove kernel_setsockopt v4

2020-05-29 Thread Christoph Hellwig
Hi Dave and Marcelo, now that only the dlm calls to sctp are left for kernel_setsockopt, while we haven't really made much progress with the sctp setsockopt refactoring, how about this small series that splits out a sctp_setsockopt_bindx_kernel that takes a kernel space address array to share more

[PATCH 3/4] net: add a new bind_add method

2020-05-29 Thread Christoph Hellwig
The SCTP protocol allows to bind multiple address to a socket. That feature is currently only exposed as a socket option. Add a bind_add method struct proto that allows to bind additional addresses, and switch the dlm code to use the method instead of going through the socket option from kernel s

[PATCH 4/4] net: remove kernel_setsockopt

2020-05-29 Thread Christoph Hellwig
No users left. Signed-off-by: Christoph Hellwig --- include/linux/net.h | 2 -- net/socket.c| 31 --- 2 files changed, 33 deletions(-) diff --git a/include/linux/net.h b/include/linux/net.h index 74ef5d7315f70..e10f378194a59 100644 --- a/include/linux/net.h

[PATCH 2/4] sctp: refactor sctp_setsockopt_bindx

2020-05-29 Thread Christoph Hellwig
Split out a sctp_setsockopt_bindx_kernel that takes a kernel pointer to the sockaddr and make sctp_setsockopt_bindx a small wrapper around it. This prepares for adding a new bind_add proto op. Signed-off-by: Christoph Hellwig --- net/sctp/socket.c | 61 ++

[PATCH 1/4] sctp: add sctp_sock_set_nodelay

2020-05-29 Thread Christoph Hellwig
Add a helper to directly set the SCTP_NODELAY sockopt from kernel space without going through a fake uaccess. Signed-off-by: Christoph Hellwig --- fs/dlm/lowcomms.c | 10 ++ include/net/sctp/sctp.h | 7 +++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/dlm/

[PATCH v2] staging: wfx: fix coherency of hif_scan() prototype

2020-05-29 Thread Jerome Pouiller
From: Jérôme Pouiller The function hif_scan() return the timeout for the completion of the scan request. It is the only function from hif_tx.c that return another thing than just an error code. This behavior is not coherent with the rest of file. Worse, if value returned is positive, the caller c

[PATCH 2/2] staging: wfx: drop useless loop

2020-05-29 Thread Jerome Pouiller
From: Jérôme Pouiller It is guarantee that the loop will stop at first iteration. So drop the loop. Fixes: 6bf418c50f98a ("staging: wfx: change the way to choose frame to send") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 19 --- 1 file changed, 8 insertion

[PATCH 1/2] staging: wfx: fix AC priority

2020-05-29 Thread Jerome Pouiller
From: Jérôme Pouiller In order to work properly all the queues of the device must be filled (the device chooses itself the queue to use depending of AC parameters and other things). It is the job of wfx_tx_queues_get_skb() to choose which queue must be filled. However, the sorting algorithm was i

[PATCH] net: octeon: mgmt: Repair filling of RX ring

2020-05-29 Thread Alexander A Sverdlin
From: Alexander Sverdlin The removal of mips_swiotlb_ops exposed a problem in octeon_mgmt Ethernet driver. mips_swiotlb_ops had an mb() after most of the operations and the removal of the ops had broken the receive functionality of the driver. My code inspection has shown no other places except o

[PATCH RFT] ravb: Mask PHY mode to avoid inserting delays twice

2020-05-29 Thread Geert Uytterhoeven
Until recently, the Micrel KSZ9031 PHY driver ignored any PHY mode ("RGMII-*ID") settings, but used the hardware defaults, augmented by explicit configuration of individual skew values using the "*-skew-ps" DT properties. The lack of PHY mode support was compensated by the EtherAVB MAC driver, whi

RE: [PATCH 4/4] net: remove kernel_setsockopt

2020-05-29 Thread David Laight
From: Christoph Hellwig > Sent: 29 May 2020 13:10 > > No users left. There is no point even proposing this until all the changes to remove its use have made it at least as far into 'net-next' and probably 'net'. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keyne

Re: [PATCH 4/4] net: remove kernel_setsockopt

2020-05-29 Thread 'Christoph Hellwig'
On Fri, May 29, 2020 at 12:27:12PM +, David Laight wrote: > From: Christoph Hellwig > > Sent: 29 May 2020 13:10 > > > > No users left. > > There is no point even proposing this until all the changes to remove > its use have made it at least as far into 'net-next' and probably 'net'. If you l

RE: [PATCH bpf-next] bpf: add SO_KEEPALIVE and related options to bpf_setsockopt

2020-05-29 Thread David Laight
From: Eric Dumazet > Sent: 27 May 2020 17:43 > > On 5/27/20 8:05 AM, Dmitry Yakunin wrote: > > This patch adds support of SO_KEEPALIVE flag and TCP related options > > to bpf_setsockopt() routine. This is helpful if we want to enable or tune > > TCP keepalive for applications which don't do it in

[PATCH net] sch_cake: Take advantage of skb->hash where appropriate

2020-05-29 Thread Toke Høiland-Jørgensen
While the other fq-based qdiscs take advantage of skb->hash and doesn't recompute it if it is already set, sch_cake does not. This was a deliberate choice because sch_cake hashes various parts of the packet header to support its advanced flow isolation modes. However, foregoing the use of skb->has

[PATCH] virtio_vsock: Fix race condition in virtio_transport_recv_pkt

2020-05-29 Thread Jia He
When client tries to connect(SOCK_STREAM) the server in the guest with NONBLOCK mode, there will be a panic on a ThunderX2 (armv8a server): [ 463.718844][ T5040] Unable to handle kernel NULL pointer dereference at virtual address [ 463.718848][ T5040] Mem abort info: [ 463.7188

Re: [PATCH] virtio_vsock: Fix race condition in virtio_transport_recv_pkt

2020-05-29 Thread Stefano Garzarella
Hi Jia, thanks for the patch! I have some comments. On Fri, May 29, 2020 at 09:31:23PM +0800, Jia He wrote: > When client tries to connect(SOCK_STREAM) the server in the guest with > NONBLOCK > mode, there will be a panic on a ThunderX2 (armv8a server): > [ 463.718844][ T5040] Unable to handle k

Re: [PATCH net-next] net: phy: marvell: unlock after phy_select_page() failure

2020-05-29 Thread Andrew Lunn
On Fri, May 29, 2020 at 01:02:07PM +0300, Dan Carpenter wrote: > We need to call phy_restore_page() even if phy_select_page() fails. > Otherwise we are holding the phy_lock_mdio_bus() lock. This requirement > is documented at the start of the phy_select_page() function. > > Fixes: a618e86da91d ("

Re: [PATCH RFT] ravb: Mask PHY mode to avoid inserting delays twice

2020-05-29 Thread Andrew Lunn
On Fri, May 29, 2020 at 02:25:40PM +0200, Geert Uytterhoeven wrote: > Until recently, the Micrel KSZ9031 PHY driver ignored any PHY mode > ("RGMII-*ID") settings, but used the hardware defaults, augmented by > explicit configuration of individual skew values using the "*-skew-ps" > DT properties.

Re: [PATCH ethtool 02/21] netlink: fix nest type grouping in parser

2020-05-29 Thread Andrew Lunn
On Fri, May 29, 2020 at 01:21:17AM +0200, Michal Kubecek wrote: > Even if we are only interested in one nested attribute when using > PARSER_GROUP_NEST group type, the temporary buffer must contain proper > netlink header and have pointer to it and payload set up correctly for > libmnl composition

Re: [PATCH v2 net-next 1/4] devlink: Add new "allow_fw_live_reset" generic device parameter.

2020-05-29 Thread Vasundhara Volam
On Fri, May 29, 2020 at 12:35 AM Jakub Kicinski wrote: > > On Thu, 28 May 2020 07:20:00 +0530 Vasundhara Volam wrote: > > > > The permanent value should be the NVRAM value. If the NVRAM value is > > > > false, the feature is always and unconditionally disabled. If the > > > > permanent value is

Re: [PATCH ethtool 03/21] netlink: fix msgbuff_append() helper

2020-05-29 Thread Andrew Lunn
On Fri, May 29, 2020 at 01:21:22AM +0200, Michal Kubecek wrote: > As msgbuff_append() only copies protocol payload, i.e. part of the buffer > without netlink and genetlink header, and mnl_nlmsg_get_payload_len() only > subtracts netlink header length, we need to subtract genetlink header > length m

Re: [PATCH v4 02/11] thermal: Store thermal mode in a dedicated enum

2020-05-29 Thread Guenter Roeck
On Thu, May 28, 2020 at 09:20:42PM +0200, Andrzej Pietrasiewicz wrote: > Prepare for storing mode in struct thermal_zone_device. > > Signed-off-by: Andrzej Pietrasiewicz > --- > drivers/acpi/thermal.c| 27 +-- > drivers/platform/x86/acerhdf.c

Re: [PATCH v4 01/11] acpi: thermal: Fix error handling in the register function

2020-05-29 Thread Guenter Roeck
On Thu, May 28, 2020 at 09:20:41PM +0200, Andrzej Pietrasiewicz wrote: > The acpi_thermal_register_thermal_zone() is missing any error handling. > This needs to be fixed. > > Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Guenter Roeck > --- > drivers/acpi/thermal.c | 20 --

Re: [PATCH v4 03/11] thermal: Add current mode to thermal zone device

2020-05-29 Thread Guenter Roeck
On Thu, May 28, 2020 at 09:20:43PM +0200, Andrzej Pietrasiewicz wrote: > Prepare for changing the place where the mode is stored: now it is in > drivers, which might or might not implement get_mode()/set_mode() methods. > A lot of cleanup can be done thanks to storing it in struct tzd. The > get_mo

Re: [PATCH v3 12/13] RDMA: Remove 'max_fmr'

2020-05-29 Thread Bernard Metzler
-"Jason Gunthorpe" wrote: - >To: linux-r...@vger.kernel.org, netdev@vger.kernel.org >From: "Jason Gunthorpe" >Date: 05/28/2020 09:46PM >Cc: "Ariel Elior" , "Bernard Metzler" >, "Dennis Dalessandro" >, "Devesh Sharma" >, "Max Gurtovoy" , >"Mike Marciniszyn" , "Michal Kalderon" >, o...@mel

Re: [PATCH net] net: mvpp2: Enable autoneg bypass for 1000BaseX/2500BaseX ports

2020-05-29 Thread Andrew Lunn
On Fri, May 29, 2020 at 01:05:39PM +0200, Thomas Bogendoerfer wrote: > On Thu, 28 May 2020 23:04:20 +0100 > Russell King - ARM Linux admin wrote: > > > Can you explain this please? Just as we think we understand what's > > going on here, you throw in a new comment that makes us confused. > > so

  1   2   3   4   >