Re: [PATCH v2 bpf-next 0/3] bpf: optimize explored_states

2019-05-21 Thread Andrii Nakryiko
On Tue, May 21, 2019 at 8:17 PM Alexei Starovoitov wrote: > > Convert explored_states array into hash table and use simple hash to > reduce verifier peak memory consumption for programs with bpf2bpf calls. > More details in patch 3. > > v1->v2: fixed Jakub's small nit in patch 1 > > Alexei Starovo

Re: [PATCH RFC] net: qualcomm: rmnet: Move common struct definitions to include

2019-05-21 Thread Subash Abhinov Kasiviswanathan
I think I'd just duplicate the structure definitions then, to avoid having the bitfield definitions in a common header and using them in the new driver. Doing would allow each driver to represent the bits as suitable, at the cost of some duplication and confusion. Confusion, because it doesn

[PATCH bpf-next v2 2/3] tools/bpf: sync bpf uapi header bpf.h to tools directory

2019-05-21 Thread Yonghong Song
The bpf uapi header include/uapi/linux/bpf.h is sync'ed to tools/include/uapi/linux/bpf.h. Signed-off-by: Yonghong Song --- tools/include/uapi/linux/bpf.h | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/lin

[PATCH bpf-next v2 0/3] bpf: implement bpf_send_signal() helper

2019-05-21 Thread Yonghong Song
This patch tries to solve the following specific use case. Currently, bpf program can already collect stack traces through kernel function get_perf_callchain() when certain events happens (e.g., cache miss counter or cpu clock counter overflows). But such stack traces are not enough for jitted pro

[PATCH bpf-next v2 1/3] bpf: implement bpf_send_signal() helper

2019-05-21 Thread Yonghong Song
This patch tries to solve the following specific use case. Currently, bpf program can already collect stack traces through kernel function get_perf_callchain() when certain events happens (e.g., cache miss counter or cpu clock counter overflows). But such stack traces are not enough for jitted pro

[PATCH bpf-next v2 3/3] tools/bpf: add a selftest for bpf_send_signal() helper

2019-05-21 Thread Yonghong Song
The test covered both nmi and tracepoint perf events. $ ./test_send_signal_user test_send_signal (tracepoint): OK test_send_signal (perf_event): OK Signed-off-by: Yonghong Song --- tools/testing/selftests/bpf/Makefile | 3 +- tools/testing/selftests/bpf/bpf_helpers.h | 1 +

Re: [PATCH] net/mlx5e: Allow removing representors netdev to other namespace

2019-05-21 Thread Or Gerlitz
On Wed, May 22, 2019 at 4:26 AM Tonghao Zhang wrote: > I review the reps of netronome nfp codes, nfp does't set the > NETIF_F_NETNS_LOCAL to netdev->features. > And I changed the OFED codes which used for our product environment, > and then send this patch to upstream. The real question here is

Re: [PATCH bpf-next 3/3] bpf: convert explored_states to hash table

2019-05-21 Thread Alexei Starovoitov
On 5/21/19 9:09 PM, Andrii Nakryiko wrote: > >> Hit/miss heuristic is not counting index miscompare as a miss. >> Otherwise verifier stats become unstable when experimenting >> with different hash functions. >> >> If insn comparison is done inside states_equal() then >> miss > hit * 3 + 3 he

Re: [PATCH bpf-next 3/3] bpf: convert explored_states to hash table

2019-05-21 Thread Andrii Nakryiko
On Tue, May 21, 2019 at 7:17 PM Alexei Starovoitov wrote: > > On Tue, May 21, 2019 at 05:55:06PM -0700, Andrii Nakryiko wrote: > > On Tue, May 21, 2019 at 4:08 PM Alexei Starovoitov wrote: > > > > > > All prune points inside a callee bpf function most likely will have > > > different callsites. F

Re: Question about IRQs during the .remove() of virtio-vsock driver

2019-05-21 Thread Jason Wang
On 2019/5/21 下午9:56, Michael S. Tsirkin wrote: On Tue, May 21, 2019 at 03:49:20PM +0200, Stefano Garzarella wrote: On Tue, May 21, 2019 at 06:05:31AM -0400, Michael S. Tsirkin wrote: On Tue, May 21, 2019 at 11:44:07AM +0200, Stefano Garzarella wrote: Hi Micheal, Jason, as suggested by Stefan

[PATCH v2 bpf-next 3/3] bpf: convert explored_states to hash table

2019-05-21 Thread Alexei Starovoitov
All prune points inside a callee bpf function most likely will have different callsites. For example, if function foo() is called from two callsites the half of explored states in all prune points in foo() will be useless for subsequent walking of one of those callsites. Fortunately explored_states

[PATCH v2 bpf-next 2/3] bpf: split explored_states

2019-05-21 Thread Alexei Starovoitov
split explored_states into prune_point boolean mark and link list of explored states. This removes STATE_LIST_MARK hack and allows marks to be separate from states. Signed-off-by: Alexei Starovoitov --- include/linux/bpf_verifier.h | 1 + kernel/bpf/verifier.c| 31 +-

[PATCH v2 bpf-next 1/3] bpf: cleanup explored_states

2019-05-21 Thread Alexei Starovoitov
clean up explored_states to prep for introduction of hashtable No functional changes. Signed-off-by: Alexei Starovoitov --- kernel/bpf/verifier.c | 29 - 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index

Re: [PATCH net] xfrm: Fix xfrm sel prefix length validation

2019-05-21 Thread Herbert Xu
On Tue, May 21, 2019 at 08:59:47PM +0530, Anirudh Gupta wrote: > Family of src/dst can be different from family of selector src/dst. > Use xfrm selector family to validate address prefix length, > while verifying new sa from userspace. > > Validated patch with this command: > ip xfrm state add src

[PATCH v2 bpf-next 0/3] bpf: optimize explored_states

2019-05-21 Thread Alexei Starovoitov
Convert explored_states array into hash table and use simple hash to reduce verifier peak memory consumption for programs with bpf2bpf calls. More details in patch 3. v1->v2: fixed Jakub's small nit in patch 1 Alexei Starovoitov (3): bpf: cleanup explored_states bpf: split explored_states b

[PATCH v2 bpf-next 3/3] selftests/bpf: add pyperf scale test

2019-05-21 Thread Alexei Starovoitov
Add a snippet of pyperf bpf program used to collect python stack traces as a scale test for the verifier. At 189 loop iterations llvm 9.0 starts ignoring '#pragma unroll' and generates partially unrolled loop instead. Hence use 50, 100, and 180 loop iterations to stress test. Signed-off-by: Alexe

[PATCH v2 bpf-next 2/3] selftests/bpf: adjust verifier scale test

2019-05-21 Thread Alexei Starovoitov
Adjust scale tests to check for new jmp sequence limit. BPF_JGT had to be changed to BPF_JEQ because the verifier was too smart. It tracked the known safe range of R0 values and pruned the search earlier before hitting exact 8192 limit. bpf_semi_rand_get() was too (un)?lucky. k = 0; was missing i

[PATCH v2 bpf-next 0/3] bpf: increase jmp sequence limit

2019-05-21 Thread Alexei Starovoitov
Patch 1 - jmp sequence limit Patch 2 - improve existing tests Patch 3 - add pyperf-based realistic bpf program that takes advantage of higher limit and use it as a stress test v1->v2: fixed nit in patch 3. added Andrii's acks Alexei Starovoitov (3): bpf: bump jmp sequence limit selftests/bpf:

[PATCH v2 bpf-next 1/3] bpf: bump jmp sequence limit

2019-05-21 Thread Alexei Starovoitov
The limit of 1024 subsequent jumps was causing otherwise valid programs to be rejected. Bump it to 8192 and make the error more verbose. Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko --- kernel/bpf/verifier.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git

Re: [PATCH bpf-next 3/3] bpf: convert explored_states to hash table

2019-05-21 Thread Alexei Starovoitov
On Tue, May 21, 2019 at 05:55:06PM -0700, Andrii Nakryiko wrote: > On Tue, May 21, 2019 at 4:08 PM Alexei Starovoitov wrote: > > > > All prune points inside a callee bpf function most likely will have > > different callsites. For example, if function foo() is called from > > two callsites the half

[PATCH net 1/3] net/tls: avoid NULL-deref on resync during device removal

2019-05-21 Thread Jakub Kicinski
When netdev with active kTLS sockets in unregistered notifier callback walks the offloaded sockets and cleans up offload state. RX data may still be processed, however, and if resync was requested prior to device removal we would hit a NULL pointer dereference on ctx->netdev use. Make sure resync

[PATCH net 2/3] net/tls: fix state removal with feature flags off

2019-05-21 Thread Jakub Kicinski
TLS offload drivers shouldn't (and currently don't) block the TLS offload feature changes based on whether there are active offloaded connections or not. This seems to be a good idea, because we want the admin to be able to disable the TLS offload at any time, and there is no clean way of disablin

[PATCH net 3/3] net/tls: don't ignore netdev notifications if no TLS features

2019-05-21 Thread Jakub Kicinski
On device surprise removal path (the notifier) we can't bail just because the features are disabled. They may have been enabled during the lifetime of the device. This bug leads to leaking netdev references and use-after-frees if there are active connections while device features are cleared. Fix

[PATCH net 0/3] net/tls: fix device surprise removal with offload

2019-05-21 Thread Jakub Kicinski
Hi! This series fixes two issues with device surprise removal. First we need to take a read lock around resync, otherwise netdev notifier handler may clear the structures from under our feet. Secondly we need to be careful about the interpretation of device features. Offload has to be properly c

Re: [PATCH] samples: bpf: fix: change the buffer size for read()

2019-05-21 Thread luke
On Tue, May 21, 2019 at 11:05 PM David Laight wrote: > > From: Chang-Hsien Tsai > > @@ -678,7 +678,7 @@ void read_trace_pipe(void) > > static char buf[4096]; > > ssize_t sz; > > > > - sz = read(trace_fd, buf, sizeof(buf)); > > + sz = read(trace_f

[PATCH net v2 1/3] Documentation: net: move device drivers docs to a submenu

2019-05-21 Thread Jakub Kicinski
Some of the device drivers have really long document titles making the networking table of contents hard to look through. Place vendor drivers under a submenu. Signed-off-by: Jakub Kicinski Acked-by: Dave Watson Acked-by: Alexei Starovoitov --- .../networking/device_drivers/index.rst | 3

[PATCH net v2 3/3] Documentation: add TLS offload documentation

2019-05-21 Thread Jakub Kicinski
Describe existing kernel TLS offload (added back in Linux 4.19) - the mechanism, the expected behavior and the notable corner cases. This documentation is mostly targeting hardware vendors who want to implement offload, to ensure consistency between implementations. v2: - add emphasis around TLS

[PATCH net v2 2/3] Documentation: tls: RSTify the ktls documentation

2019-05-21 Thread Jakub Kicinski
Convert the TLS doc to RST. Use C code blocks for the code samples, and mark hyperlinks. Signed-off-by: Jakub Kicinski Acked-by: Dave Watson Acked-by: Alexei Starovoitov --- Documentation/networking/index.rst| 1 + Documentation/networking/{tls.txt => tls.rst} | 42 +-

[PATCH net v2 0/3] Documentation: tls: add offload documentation

2019-05-21 Thread Jakub Kicinski
Hi! This set adds documentation for TLS offload. It starts by making the networking documentation a little easier to navigate by hiding driver docs a little deeper. It then RSTifys the existing Kernel TLS documentation. Last but not least TLS offload documentation is added. This should help vendor

Re: [PATCH V3 net-next 6/6] ptp: Add a driver for InES time stamping IP core.

2019-05-21 Thread Andrew Lunn
> +static bool ines_match(struct sk_buff *skb, unsigned int ptp_class, > +struct ines_timestamp *ts); > +static int ines_rxfifo_read(struct ines_port *port); > +static u64 ines_rxts64(struct ines_port *port, unsigned int words); > +static bool ines_timestamp_expired(struct ines_

Re: [PATCH] net/mlx5e: Allow removing representors netdev to other namespace

2019-05-21 Thread Tonghao Zhang
On Wed, May 22, 2019 at 12:45 AM Or Gerlitz wrote: > > On Tue, May 21, 2019 at 7:36 AM Tonghao Zhang > wrote: > > On Tue, May 21, 2019 at 4:24 AM Or Gerlitz wrote: > > > > > > On Mon, May 20, 2019 at 3:19 PM wrote: > > > > > > > > From: Tonghao Zhang > > > > > > > > At most case, we use the C

Re: [PATCH V3 net-next 5/6] net: mdio: of: Register discovered MII time stampers.

2019-05-21 Thread Andrew Lunn
> +struct mii_timestamper *of_find_mii_timestamper(struct device_node *node) > +{ > + struct of_phandle_args arg; > + int err; > + > + err = of_parse_phandle_with_fixed_args(node, "timestamper", 1, 0, &arg); > + > + if (err == -ENOENT) > + return NULL; > + else if (e

Re: [PATCH V3 net-next 4/6] dt-bindings: ptp: Introduce MII time stamping devices.

2019-05-21 Thread Andrew Lunn
On Tue, May 21, 2019 at 03:47:21PM -0700, Richard Cochran wrote: > This patch add a new binding that allows non-PHY MII time stamping > devices to find their buses. The new documentation covers both the > generic binding and one upcoming user. > > Signed-off-by: Richard Cochran Reviewed-by: And

Re: [PATCH V3 net-next 3/6] net: Add a layer for non-PHY MII time stamping drivers.

2019-05-21 Thread Andrew Lunn
> +struct mii_timestamper *register_mii_timestamper(struct device_node *node, > + unsigned int port) > +{ > + struct mii_timestamper *mii_ts = NULL; > + struct mii_timestamping_desc *desc; > + struct list_head *this; > + > + mutex_lock(&t

Re: [PATCH bpf-next 1/3] bpf: cleanup explored_states

2019-05-21 Thread Jakub Kicinski
On Tue, 21 May 2019 16:06:33 -0700, Alexei Starovoitov wrote: > clean up explored_states to prep for introduction of hashtable > No functional changes. > > Signed-off-by: Alexei Starovoitov > --- > kernel/bpf/verifier.c | 30 +- > 1 file changed, 21 insertions(+), 9 d

Re: [PATCH V3 net-next 2/6] net: Introduce a new MII time stamping interface.

2019-05-21 Thread Andrew Lunn
> -static int dp83640_hwtstamp(struct phy_device *phydev, struct ifreq *ifr) > +static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq > *ifr) > { > - struct dp83640_private *dp83640 = phydev->priv; > + struct dp83640_private *dp83640 = > + container_of(mii_t

Re: [PATCH bpf-next 3/3] selftests/bpf: add pyperf scale test

2019-05-21 Thread Andrii Nakryiko
On Tue, May 21, 2019 at 5:50 PM Alexei Starovoitov wrote: > > On 5/21/19 5:36 PM, Andrii Nakryiko wrote: > >> --- /dev/null > >> +++ b/tools/testing/selftests/bpf/progs/pyperf.h > >> @@ -0,0 +1,268 @@ > >> +// SPDX-License-Identifier: GPL-2.0 > >> +// Copyright (c) 2019 Facebook > > > > Maybe let'

Re: [PATCH bpf-next 3/3] bpf: convert explored_states to hash table

2019-05-21 Thread Andrii Nakryiko
On Tue, May 21, 2019 at 4:08 PM Alexei Starovoitov wrote: > > All prune points inside a callee bpf function most likely will have > different callsites. For example, if function foo() is called from > two callsites the half of explored states in all prune points in foo() > will be useless for subs

Re: [PATCH bpf-next 3/3] selftests/bpf: add pyperf scale test

2019-05-21 Thread Alexei Starovoitov
On 5/21/19 5:36 PM, Andrii Nakryiko wrote: >> --- /dev/null >> +++ b/tools/testing/selftests/bpf/progs/pyperf.h >> @@ -0,0 +1,268 @@ >> +// SPDX-License-Identifier: GPL-2.0 >> +// Copyright (c) 2019 Facebook > > Maybe let's include a link to an up-to-date real tool, that was used > to create this

Re: [PATCH bpf-next 0/3] bpf: increase jmp sequence limit

2019-05-21 Thread Andrii Nakryiko
On Tue, May 21, 2019 at 4:09 PM Alexei Starovoitov wrote: > > Patch 1 - jmp sequence limit > Patch 2 - improve existing tests > Patch 3 - add pyperf-based realistic bpf program that takes advantage > of higher limit and use it as a stress test Some minor nits for patch #3, but other than that, fo

Re: [PATCH bpf-next 3/3] selftests/bpf: add pyperf scale test

2019-05-21 Thread Andrii Nakryiko
On Tue, May 21, 2019 at 4:10 PM Alexei Starovoitov wrote: > > Add a snippet of pyperf bpf program used to collect python stack traces > as a scale test for the verifier. > > At 189 loop iterations llvm 9.0 starts ignoring '#pragma unroll' > and generates partially unrolled loop instead. > Hence us

[PATCH] samples: bpf: fix style in bpf_load

2019-05-21 Thread Daniel T. Lee
This commit fixes style problem in samples/bpf/bpf_load.c Styles that have been changed are: - Magic string use of 'DEBUGFS' - Useless zero initialization of a global variable - Minor style fix with whitespace Signed-off-by: Daniel T. Lee --- samples/bpf/bpf_load.c | 11 +++ 1 file c

[PATCH bpf-next 0/3] bpf: increase jmp sequence limit

2019-05-21 Thread Alexei Starovoitov
Patch 1 - jmp sequence limit Patch 2 - improve existing tests Patch 3 - add pyperf-based realistic bpf program that takes advantage of higher limit and use it as a stress test Alexei Starovoitov (3): bpf: bump jmp sequence limit selftests/bpf: adjust verifier scale test selftests/bpf: add py

[PATCH bpf-next 2/3] selftests/bpf: adjust verifier scale test

2019-05-21 Thread Alexei Starovoitov
Adjust scale tests to check for new jmp sequence limit. BPF_JGT had to be changed to BPF_JEQ because the verifier was too smart. It tracked the known safe range of R0 values and pruned the search earlier before hitting exact 8192 limit. bpf_semi_rand_get() was too (un)?lucky. k = 0; was missing i

[PATCH bpf-next 1/3] bpf: bump jmp sequence limit

2019-05-21 Thread Alexei Starovoitov
The limit of 1024 subsequent jumps was causing otherwise valid programs to be rejected. Bump it to 8192 and make the error more verbose. Signed-off-by: Alexei Starovoitov --- kernel/bpf/verifier.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/bpf/verifier.c b/

[PATCH bpf-next 3/3] selftests/bpf: add pyperf scale test

2019-05-21 Thread Alexei Starovoitov
Add a snippet of pyperf bpf program used to collect python stack traces as a scale test for the verifier. At 189 loop iterations llvm 9.0 starts ignoring '#pragma unroll' and generates partially unrolled loop instead. Hence use 50, 100, and 180 loop iterations to stress test. Signed-off-by: Alexe

[PATCH bpf-next 1/3] bpf: cleanup explored_states

2019-05-21 Thread Alexei Starovoitov
clean up explored_states to prep for introduction of hashtable No functional changes. Signed-off-by: Alexei Starovoitov --- kernel/bpf/verifier.c | 30 +- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c inde

[PATCH bpf-next 2/3] bpf: split explored_states

2019-05-21 Thread Alexei Starovoitov
split explored_states into prune_point boolean mark and link list of explored states. This removes STATE_LIST_MARK hack and allows marks to be separate from states. Signed-off-by: Alexei Starovoitov --- include/linux/bpf_verifier.h | 1 + kernel/bpf/verifier.c| 31 +-

[PATCH bpf-next 3/3] bpf: convert explored_states to hash table

2019-05-21 Thread Alexei Starovoitov
All prune points inside a callee bpf function most likely will have different callsites. For example, if function foo() is called from two callsites the half of explored states in all prune points in foo() will be useless for subsequent walking of one of those callsites. Fortunately explored_states

[PATCH bpf-next 0/3] bpf: optimize explored_states

2019-05-21 Thread Alexei Starovoitov
Convert explored_states array into hash table and use simple hash to reduce verifier peak memory consumption for programs with bpf2bpf calls. More details in patch 3. Alexei Starovoitov (3): bpf: cleanup explored_states bpf: split explored_states bpf: convert explored_states to hash table

[PATCH V3 net-next 5/6] net: mdio: of: Register discovered MII time stampers.

2019-05-21 Thread Richard Cochran
When parsing a PHY node, register its time stamper, if any, and attach the instance to the PHY device. Signed-off-by: Richard Cochran --- drivers/net/phy/phy_device.c | 3 +++ drivers/of/of_mdio.c | 24 2 files changed, 27 insertions(+) diff --git a/drivers/net

[PATCH V3 net-next 3/6] net: Add a layer for non-PHY MII time stamping drivers.

2019-05-21 Thread Richard Cochran
While PHY time stamping drivers can simply attach their interface directly to the PHY instance, stand alone drivers require support in order to manage their services. Non-PHY MII time stamping drivers have a control interface over another bus like I2C, SPI, UART, or via a memory mapped peripheral.

[PATCH V3 net-next 4/6] dt-bindings: ptp: Introduce MII time stamping devices.

2019-05-21 Thread Richard Cochran
This patch add a new binding that allows non-PHY MII time stamping devices to find their buses. The new documentation covers both the generic binding and one upcoming user. Signed-off-by: Richard Cochran --- Documentation/devicetree/bindings/ptp/ptp-ines.txt | 35 ++ .../devicet

[PATCH V3 net-next 2/6] net: Introduce a new MII time stamping interface.

2019-05-21 Thread Richard Cochran
Currently the stack supports time stamping in PHY devices. However, there are newer, non-PHY devices that can snoop an MII bus and provide time stamps. In order to support such devices, this patch introduces a new interface to be used by both PHY and non-PHY devices. In addition, the one and onl

[PATCH V3 net-next 1/6] net: Introduce peer to peer one step PTP time stamping.

2019-05-21 Thread Richard Cochran
The 1588 standard defines one step operation for both Sync and PDelay_Resp messages. Up until now, hardware with P2P one step has been rare, and kernel support was lacking. This patch adds support of the mode in anticipation of new hardware developments. Signed-off-by: Richard Cochran --- driv

[PATCH V3 net-next 6/6] ptp: Add a driver for InES time stamping IP core.

2019-05-21 Thread Richard Cochran
The InES at the ZHAW offers a PTP time stamping IP core. The FPGA logic recognizes and time stamps PTP frames on the MII bus. This patch adds a driver for the core along with a device tree binding to allow hooking the driver to MII buses. Signed-off-by: Richard Cochran --- drivers/ptp/Kconfig

[PATCH V3 net-next 0/6] Peer to Peer One-Step time stamping

2019-05-21 Thread Richard Cochran
This series adds support for PTP (IEEE 1588) P2P one-step time stamping along with a driver for a hardware device that supports this. If the hardware supports p2p one-step, it subtracts the ingress time stamp value from the Pdelay_Request correction field. The user space software stack then simpl

bpf-next is OPEN

2019-05-21 Thread Daniel Borkmann
Merge window is closed, so new round begins as usual. Thanks everyone, Daniel

Re: [PATCH RFC] net: qualcomm: rmnet: Move common struct definitions to include

2019-05-21 Thread Alex Elder
On 5/21/19 4:08 PM, Bjorn Andersson wrote: > On Tue 21 May 13:45 PDT 2019, Arnd Bergmann wrote: > >> On Tue, May 21, 2019 at 9:35 PM Subash Abhinov Kasiviswanathan >> wrote: >>> >>> Create if_rmnet.h and move the rmnet MAP packet structs to this >>> common include file. To account for portability

Re: RFC: Fixing SK_REUSEPORT from sk_lookup_* helpers

2019-05-21 Thread Alexei Starovoitov
On Tue, May 21, 2019 at 04:47:58PM +0100, Lorenz Bauer wrote: > On Fri, 17 May 2019 at 00:38, Nitin Hande wrote: > > > > On Thu, May 16, 2019 at 2:57 PM Alexei Starovoitov > > wrote: > > > > > > On Thu, May 16, 2019 at 09:41:34AM +0100, Lorenz Bauer wrote: > > > > On Wed, 15 May 2019 at 18:16, Jo

Re: [PATCH iproute2 net-next] ip: add a new parameter -Numeric

2019-05-21 Thread David Ahern
On 5/21/19 6:13 AM, Hangbin Liu wrote: > BTW, for some pre-defined names in iproute2, like rtnl_rtprot_tab, > nl_proto_tab. Should we also print the number directly or just keep > using the human readable names? > > I would like to keep them as this is defined in iproute and we can control > them.

Re: [PATCH RFC] net: qualcomm: rmnet: Move common struct definitions to include

2019-05-21 Thread Bjorn Andersson
On Tue 21 May 13:45 PDT 2019, Arnd Bergmann wrote: > On Tue, May 21, 2019 at 9:35 PM Subash Abhinov Kasiviswanathan > wrote: > > > > Create if_rmnet.h and move the rmnet MAP packet structs to this > > common include file. To account for portability, add little and > > big endian bitfield definiti

Re: [PATCH RFC] net: qualcomm: rmnet: Move common struct definitions to include

2019-05-21 Thread Arnd Bergmann
On Tue, May 21, 2019 at 9:35 PM Subash Abhinov Kasiviswanathan wrote: > > Create if_rmnet.h and move the rmnet MAP packet structs to this > common include file. To account for portability, add little and > big endian bitfield definitions similar to the ip & tcp headers. > > The definitions in the

Re: [PATCH net] selftests: fib_rule_tests: use pre-defined DEV_ADDR

2019-05-21 Thread David Miller
From: Hangbin Liu Date: Tue, 21 May 2019 14:40:47 +0800 > DEV_ADDR is defined but not used. Use it in address setting. > Do the same with IPv6 for consistency. > > Reported-by: David Ahern > Fixes: fc82d93e57e3 ("selftests: fib_rule_tests: fix local IPv4 address typo") > Signed-off-by: Hangbin

Re: [RFC net-next 9/9] net: dsa: mv88e6xxx: setup RMU bus

2019-05-21 Thread Andrew Lunn
> + ether_addr_copy(eth_dest_addr, dest_addr); /* Marvell broadcast or > switch MAC */ > + ether_addr_copy(eth_src_addr, dev->dev_addr); > + dsa_tag[0] = 0x40 | (chip->ds->index & 0x1f); /* From_CPU */ > + dsa_tag[1] = 0xfa; > + dsa_tag[2] = 0xf; > + dsa_tag[3] = ++chip->rm

Re: [PATCH net-next] cxgb4: Revert "cxgb4: Remove SGE_HOST_PAGE_SIZE dependency on page size"

2019-05-21 Thread David Miller
From: Vishal Kulkarni Date: Tue, 21 May 2019 09:12:02 +0530 > This reverts commit 2391b0030e241386d710df10e53e2cfc3c5d4fc1 > SGE's BAR2 Doorbell/GTS Page Size is now interpreted correctly in the > firmware itself by using actual host page size. Hence previous commit > needs to be reverted. > > S

Re: [PATCH net-next] cxgb4: Enable hash filter with offload

2019-05-21 Thread David Miller
From: Vishal Kulkarni Date: Tue, 21 May 2019 09:10:37 +0530 > This patch enables hash filter along with offload > > Signed-off-by: Vishal Kulkarni This commit message is too terse. What is going on here. Why does this change need to made? Why did you implement it this way? Is this a bug fi

Re: [PATCH net] ipv6: Consider sk_bound_dev_if when binding a raw socket to an address

2019-05-21 Thread David Miller
From: Mike Manning Date: Mon, 20 May 2019 19:57:17 +0100 > IPv6 does not consider if the socket is bound to a device when binding > to an address. The result is that a socket can be bound to eth0 and > then bound to the address of eth1. If the device is a VRF, the result > is that a socket can on

Re: [PATCH net] net: phylink: ensure inband AN works correctly

2019-05-21 Thread David Miller
From: Russell King Date: Mon, 20 May 2019 16:07:20 +0100 > Do not update the link interface mode while the link is down to avoid > spurious link interface changes. > > Always call mac_config if we have a PHY to propagate the pause mode > settings to the MAC. > > Signed-off-by: Russell King Ap

Re: [PATCH net] sk_msg: Keep reference on socket file while psock lives

2019-05-21 Thread John Fastabend
Jakub Sitnicki wrote: > Hi Daniel, > > On Tue, Feb 19, 2019 at 05:00 PM CET, Daniel Borkmann wrote: > > On 02/11/2019 10:09 AM, Jakub Sitnicki wrote: > >> Backlog work for psock (sk_psock_backlog) might sleep while waiting for > >> memory to free up when sending packets. While sleeping, socket can

[PATCH RFC] net: qualcomm: rmnet: Move common struct definitions to include

2019-05-21 Thread Subash Abhinov Kasiviswanathan
Create if_rmnet.h and move the rmnet MAP packet structs to this common include file. To account for portability, add little and big endian bitfield definitions similar to the ip & tcp headers. The definitions in the headers can now be re-used by the upcoming ipa driver series as well as qmi_wwan.

[RFC net-next 6/9] net: dsa: mv88e6xxx: add default bus operations

2019-05-21 Thread Vivien Didelot
In order to prepare the introduction of alternative busses, add a default mv88e6xxx_bus_ops pointer to the mv88e6xxx_chip structure. A bus may set the default operations if they aren't already set. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 10 -- drivers/net/d

[RFC net-next 9/9] net: dsa: mv88e6xxx: setup RMU bus

2019-05-21 Thread Vivien Didelot
Implement the RMU register operations Read and Write and setup a proper bus to use as an alternative for SMI. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c | 14 ++ drivers/net/dsa/mv88e6xxx/chip.h | 10 ++ drivers/net/dsa/mv88e6xxx/rmu.c | 256 +++

[RFC net-next 4/9] net: dsa: introduce dsa_is_upstream_port

2019-05-21 Thread Vivien Didelot
Introduce a dsa_is_upstream_port helper to check if a given switch port is directly or indirectly connected to a CPU port. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/net/dsa.h b/include/net/dsa.h index 7b10a067b06d..c5

[RFC net-next 8/9] net: dsa: mv88e6xxx: setup RMU port

2019-05-21 Thread Vivien Didelot
Enable the RMU on the first upstream port found on this switch. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/Makefile | 1 + drivers/net/dsa/mv88e6xxx/chip.c | 9 + drivers/net/dsa/mv88e6xxx/rmu.c| 58 ++ drivers/net/dsa/mv88e6xxx/rmu.h|

[RFC net-next 5/9] net: dsa: introduce dsa_to_master

2019-05-21 Thread Vivien Didelot
Introduce a dsa_to_master helper to find the master interface dedicated to a given switch port. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/net/dsa.h b/include/net/dsa.h index c5b45bfeea01..b0be2687bd61 100644 ---

[RFC net-next 7/9] net: dsa: mv88e6xxx: implement RMU enable

2019-05-21 Thread Vivien Didelot
Implement a new operation to enable the Remote Management Unit (RMU) on a specified port. Add such support for 88E6352 and 88E6390 switches. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx/chip.c| 10 ++ drivers/net/dsa/mv88e6xxx/chip.h| 1 + drivers/net/dsa/mv88e6xxx/gl

[RFC net-next 1/9] net: dsa: introduce dsa_master_find_switch

2019-05-21 Thread Vivien Didelot
Introduce a DSA helper to find a dsa_switch structure by ID from a master interface, that will be useful for frames with a switch ID but no port ID. Signed-off-by: Vivien Didelot --- net/dsa/dsa_priv.h | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/net/dsa

[RFC net-next 3/9] net: dsa: allow switches to transmit frames

2019-05-21 Thread Vivien Didelot
Introduce an xmit and work queue to allow switches to send frames on their own, which can be useful to implement control frames via Ethernet for instance. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 5 + net/dsa/dsa2.c | 6 ++ net/dsa/dsa_priv.h | 2 ++ net/dsa/switch.c

[RFC net-next 2/9] net: dsa: allow switches to receive frames

2019-05-21 Thread Vivien Didelot
Add a rcv DSA switch operation to allow taggers to let the driver of the source switch to process the received frame on its own. At the moment, only DSA and EDSA taggers make use of this hook. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 5 + net/dsa/tag_dsa.c | 6 ++ net/dsa

[RFC net-next 0/9] net: dsa: mv88e6xxx: add RMU support

2019-05-21 Thread Vivien Didelot
This series is a request for comment for the support for sending and receiving special management frames between Linux and Ethernet switch drivers. The (Marvell) Ethernet switches can respond to special control frames used to access the internal switch registers. This provides an alternative contr

Re: [PATCH V2 net-next 5/5] ptp: Add a driver for InES time stamping IP core.

2019-05-21 Thread Richard Cochran
On Fri, Oct 12, 2018 at 03:42:57PM -0500, Rob Herring wrote: > On Sun, Oct 07, 2018 at 10:38:23AM -0700, Richard Cochran wrote: > > + > > +Required properties of the control node: > > + > > +- compatible: "ines,ptp-ctrl" > > ines is not registered vendor prefix. Should it be 'zhaw' in

[PATCH iproute2] man: fix macaddr section of ip-link

2019-05-21 Thread Stephen Hemminger
The formatting of setting mac address was confusing. Break lines and fix highlighting. Signed-off-by: Stephen Hemminger --- man/man8/ip-link.8.in | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index d035a5c92ed5..88

[PATCH net] ocelot: Dont allocate another multicast list, use __dev_mc_sync

2019-05-21 Thread Claudiu Manoil
Doing kmalloc in atomic context is always an issue, more so for a list that can grow significantly. Turns out that the driver only uses the duplicated list of multicast mac addresses to keep track of what addresses to delete from h/w before committing the new list from kernel to h/w back again via

Re: [PATCH] net/mlx5e: Allow removing representors netdev to other namespace

2019-05-21 Thread Or Gerlitz
On Tue, May 21, 2019 at 7:36 AM Tonghao Zhang wrote: > On Tue, May 21, 2019 at 4:24 AM Or Gerlitz wrote: > > > > On Mon, May 20, 2019 at 3:19 PM wrote: > > > > > > From: Tonghao Zhang > > > > > > At most case, we use the ConnectX-5 NIC on compute node for VMs, > > > but we will offload forwardi

Re: RFC: Fixing SK_REUSEPORT from sk_lookup_* helpers

2019-05-21 Thread Lorenz Bauer
On Fri, 17 May 2019 at 00:38, Nitin Hande wrote: > > On Thu, May 16, 2019 at 2:57 PM Alexei Starovoitov > wrote: > > > > On Thu, May 16, 2019 at 09:41:34AM +0100, Lorenz Bauer wrote: > > > On Wed, 15 May 2019 at 18:16, Joe Stringer wrote: > > > > > > > > On Wed, May 15, 2019 at 8:11 AM Lorenz Ba

Re: [Intel-wired-lan] [PATCH] e1000e: Work around hardware unit hang by disabling TSO

2019-05-21 Thread Juliana Rodrigueiro
Hello Sasha, On Wednesday, 15 May 2019 07:39:46 CEST Neftin, Sasha wrote: > You are right, in some particular configurations e1000e devices stuck at > Tx hang while TCP segmentation offload is on. But for all other users we > should keep the TCP segmentation option is enabled as default. I suggest

Re: [PATCH v2 net 2/2] net: core: generic XDP support for stacked device

2019-05-21 Thread Jiri Pirko
Tue, May 21, 2019 at 04:45:53PM CEST, step...@networkplumber.org wrote: >On Tue, 21 May 2019 08:15:36 +0200 >Jiri Pirko wrote: > >> +if (static_branch_unlikely(&generic_xdp_needed_key)) { >> +int ret2; >> + >> +preempt_disable(); >> +rcu_read_lock(); >> +

RE: [PATCH] samples: bpf: fix: change the buffer size for read()

2019-05-21 Thread David Laight
From: Chang-Hsien Tsai > Sent: 19 May 2019 10:06 > If the trace for read is larger than 4096, > the return value sz will be 4096. > This results in off-by-one error on buf. > > static char buf[4096]; > ssize_t sz; > > sz = read(trace_fd, buf, sizeof(buf)); > if (sz > 0) { >

Re: [PATCH] samples: bpf: fix: change the buffer size for read()

2019-05-21 Thread Daniel Borkmann
On 05/19/2019 11:05 AM, Chang-Hsien Tsai wrote: > If the trace for read is larger than 4096, > the return value sz will be 4096. > This results in off-by-one error on buf. > > static char buf[4096]; > ssize_t sz; > > sz = read(trace_fd, buf, sizeof(buf)); > if (sz > 0) { >

Re: [PATCH bpf] bpf: fix out-of-bounds read in __bpf_skc_lookup

2019-05-21 Thread Daniel Borkmann
On 05/21/2019 09:52 AM, Lorenz Bauer wrote: > __bpf_skc_lookup takes a socket tuple and the length of the > tuple as an argument. Based on the length, it decides which > address family to pass to the helper function sk_lookup. > > In case of AF_INET6, it fails to verify that the length > of the tu

Re: [PATCH bpf] bpf: Check sk_fullsock() before returning from bpf_sk_lookup()

2019-05-21 Thread Daniel Borkmann
On 05/17/2019 11:21 PM, Martin KaFai Lau wrote: > The BPF_FUNC_sk_lookup_xxx helpers return RET_PTR_TO_SOCKET_OR_NULL. > Meaning a fullsock ptr and its fullsock's fields in bpf_sock can be > accessed, e.g. type, protocol, mark and priority. > Some new helper, like bpf_sk_storage_get(), also expects

Re: [PATCH] Documentation/networking: fix af_xdp.rst Sphinx warnings

2019-05-21 Thread Daniel Borkmann
On 05/20/2019 11:22 PM, Randy Dunlap wrote: > From: Randy Dunlap > > Fix Sphinx warnings in Documentation/networking/af_xdp.rst by > adding indentation: > > Documentation/networking/af_xdp.rst:319: WARNING: Literal block expected; > none found. > Documentation/networking/af_xdp.rst:326: WARNING

Re: [PATCH v2 net 2/2] net: core: generic XDP support for stacked device

2019-05-21 Thread Stephen Hemminger
On Tue, 21 May 2019 08:15:36 +0200 Jiri Pirko wrote: > + if (static_branch_unlikely(&generic_xdp_needed_key)) { > + int ret2; > + > + preempt_disable(); > + rcu_read_lock(); > + ret2 = do_xdp_generic(rcu_dereference(skb->dev->xdp_prog), skb); >

[PATCH iproute2-next 2/4] rdma: Add man pages for rdma system commands

2019-05-21 Thread Parav Pandit
Reviewed-by: Leon Romanovsky Signed-off-by: Parav Pandit --- man/man8/rdma-system.8 | 82 ++ man/man8/rdma.8| 7 +++- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 man/man8/rdma-system.8 diff --git a/man/man8/rdma-system.8

[PATCH iproute2-next 0/4] Enrich rdma tool for net namespace commands

2019-05-21 Thread Parav Pandit
RDMA subsystem can be running in either of the modes. (a) Sharing RDMA devices among multiple net namespaces or (b) Exclusive mode where RDMA device is bound to single net namespace This patch series adds (1) query command to query rdma subsystem sharing mode (2) set command to change rdma subsys

[PATCH iproute2-next 1/4] rdma: Add an option to query,set net namespace sharing sys parameter

2019-05-21 Thread Parav Pandit
Enrich rdma tool with an option to query rdma subsystem parameter whether rdma devices are shared among multiple network namespaces or exclusive to single network namespace. rdma tool command examples and output. $ rdma system show netns shared $ rdma system set netns exclusive $ rdma system sh

[PATCH iproute2-next 4/4] rdma: Add man page for rdma dev set netns command

2019-05-21 Thread Parav Pandit
Add man page to describe additional set netns command for rdma device. Reviewed-by: Leon Romanovsky Signed-off-by: Parav Pandit --- man/man8/rdma-dev.8 | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/man/man8/rdma-dev.8 b/man/man8/rdma-dev.8 index 069f471

[PATCH iproute2-next 3/4] rdma: Add an option to set net namespace of rdma device

2019-05-21 Thread Parav Pandit
Enrich rdma tool with an option to set network namespace of RDMA device. After successful execution of it, rdma device will be accessible only in assigned network namespace. rdma tool command examples and output. First set netns mode to exclusive. $ rdma system set netns exclusive Now create ne

Re: [PATCH bpf] bpf, riscv: clear target register high 32-bits for and/or/xor on ALU32

2019-05-21 Thread Björn Töpel
On Tue, 21 May 2019 at 16:02, Daniel Borkmann wrote: > > On 05/21/2019 03:46 PM, Björn Töpel wrote: > > When using 32-bit subregisters (ALU32), the RISC-V JIT would not clear > > the high 32-bits of the target register and therefore generate > > incorrect code. > > > > E.g., in the following code:

  1   2   >