RE: [PATCH] can: flexcan: fix deadlock when using self wakeup

2019-06-10 Thread Joakim Zhang
> -Original Message- > From: Sean Nyekjaer > Sent: 2019年6月9日 1:42 > To: Joakim Zhang ; m...@pengutronix.de; > linux-...@vger.kernel.org > Cc: dl-linux-imx ; w...@grandegger.com; > netdev@vger.kernel.org > Subject: Re: [PATCH] can: flexcan: fix deadlock when using self wakeup > > > > On

RE: [PATCH] can: flexcan: fix deadlock when using self wakeup

2019-06-10 Thread Joakim Zhang
> -Original Message- > From: Marc Kleine-Budde > Sent: 2019年5月18日 1:19 > To: Joakim Zhang ; linux-...@vger.kernel.org > Cc: dl-linux-imx ; w...@grandegger.com; > netdev@vger.kernel.org; Aisheng Dong > Subject: Re: [PATCH] can: flexcan: fix deadlock when using self wakeup > > On 5/17/19

Re: [PATCH net-next 1/3] selftests: mlxsw: Add ethtool_lib.sh

2019-06-10 Thread Ido Schimmel
On Mon, Jun 10, 2019 at 08:29:54AM -0700, Florian Fainelli wrote: > On 6/10/2019 6:56 AM, Ido Schimmel wrote: > > On Mon, Jun 10, 2019 at 03:35:38PM +0200, Andrew Lunn wrote: > >> On Mon, Jun 10, 2019 at 11:40:43AM +0300, Ido Schimmel wrote: > >>> From: Amit Cohen > >>> +declare -A speed_values >

[PATCH] can: flexcan: fix stop mode acknowledgment

2019-06-10 Thread Joakim Zhang
To enter stop mode, the CPU should manually assert a global Stop Mode request and check the acknowledgment asserted by FlexCAN. The CPU must only consider the FlexCAN in stop mode when both request and acknowledgment conditions are satisfied. Fixes: de3578c198c6 ("can: flexcan: add self wakeup sup

Re: tp->copied_seq used before assignment in tcp_check_urg

2019-06-10 Thread Zhongjie Wang
Hi Neal, Thanks for your valuable feedback! Yes, I think you are right. It seems not a problem if tp->urg_data and tp->urg_seq are used together. >From our test results, we can only see there are some paths requiring specific initial sequence number to reach. But as you said, it would not cause a

Re: [PATCH bpf-next] selftests/bpf: fix constness of source arg for bpf helpers

2019-06-10 Thread Alexei Starovoitov
On Mon, Jun 10, 2019 at 10:48 AM Andrii Nakryiko wrote: > > Fix signature of bpf_probe_read and bpf_probe_write_user to mark source > pointer as const. This causes warnings during compilation for > applications relying on those helpers. > > Signed-off-by: Andrii Nakryiko Applied. Thanks

Re: [PATCH bpf-next] samples: bpf: don't run probes at the local make stage

2019-06-10 Thread Alexei Starovoitov
On Fri, Jun 7, 2019 at 10:11 AM Jakub Kicinski wrote: > > Quentin reports that commit 07c3bbdb1a9b ("samples: bpf: print > a warning about headers_install") is producing the false > positive when make is invoked locally, from the samples/bpf/ > directory. > > When make is run locally it hits the "

Re: [PATCH v5 bpf-next 0/4] Better handling of xskmap entries

2019-06-10 Thread Alexei Starovoitov
On Thu, Jun 6, 2019 at 1:59 PM Jonathan Lemon wrote: > > Currently, the AF_XDP code uses a separate map in order to > determine if an xsk is bound to a queue. Have the xskmap > lookup return a XDP_SOCK pointer on the kernel side, which > the verifier uses to extract relevant values. > > Patches:

Re: [PATCH net-next 3/3] selftests: mlxsw: Add speed and auto-negotiation test

2019-06-10 Thread Ido Schimmel
On Mon, Jun 10, 2019 at 04:06:33PM +0200, Andrew Lunn wrote: > On Mon, Jun 10, 2019 at 04:58:48PM +0300, Ido Schimmel wrote: > > On Mon, Jun 10, 2019 at 03:48:20PM +0200, Andrew Lunn wrote: > > > > + # Skip 56G because this speed isn't supported with > > > > autoneg off. > > > > +

[net PATCH] net: tls, correctly account for copied bytes with multiple sk_msgs

2019-06-10 Thread John Fastabend
tls_sw_do_sendpage needs to return the total number of bytes sent regardless of how many sk_msgs are allocatedt. Unfortunately, copied (the value we return up the stack) is zero'd before each new sk_msg is alloced so we only return the copied size of the last sk_msg used. The application will then

Re: [PATCH bpf-next 0/8] BTF-defined BPF map definitions

2019-06-10 Thread Andrii Nakryiko
On Mon, Jun 10, 2019 at 9:48 PM Andrii Nakryiko wrote: > > This patch set implements initial version (as discussed at LSF/MM2019 > conference) of a new way to specify BPF maps, relying on BTF type information, > which allows for easy extensibility, preserving forward and backward > compatibility.

[PATCH bpf-next 8/8] selftests/bpf: switch tests to BTF-defined map definitions

2019-06-10 Thread Andrii Nakryiko
Switch test map definition to new BTF-defined format. Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bpf/progs/bpf_flow.c | 18 +++-- .../selftests/bpf/progs/get_cgroup_id_kern.c | 18 +++-- .../testing/selftests/bpf/progs/netcnt_prog.c | 22 +++--- .../selftests/bpf/progs/sample_m

[PATCH bpf-next 5/8] libbpf: split initialization and loading of BTF

2019-06-10 Thread Andrii Nakryiko
Libbpf does sanitization of BTF before loading it into kernel, if kernel doesn't support some of newer BTF features. This removes some of the important information from BTF (e.g., DATASEC and VAR description), which will be used for map construction. This patch splits BTF processing into initializa

[PATCH bpf-next 4/8] libbpf: identify maps by section index in addition to offset

2019-06-10 Thread Andrii Nakryiko
To support maps to be defined in multiple sections, it's important to identify map not just by offset within its section, but section index as well. This patch adds tracking of section index. For global data, we record section index of corresponding .data/.bss/.rodata ELF section for uniformity, a

[PATCH bpf-next 3/8] libbpf: refactor map initialization

2019-06-10 Thread Andrii Nakryiko
User and global data maps initialization has gotten pretty complicated and unnecessarily convoluted. This patch splits out the logic for global data map and user-defined map initialization. It also removes the restriction of pre-calculating how many maps will be initialized, instead allowing to kee

[PATCH bpf-next 2/8] libbpf: extract BTF loading and simplify ELF parsing logic

2019-06-10 Thread Andrii Nakryiko
As a preparation for adding BTF-based BPF map loading, extract .BTF and .BTF.ext loading logic. Also simplify error handling in bpf_object__elf_collect() by returning early, as there is no common clean up to be done. Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/libbpf.c | 137 +++

[PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-10 Thread Andrii Nakryiko
This patch adds support for a new way to define BPF maps. It relies on BTF to describe mandatory and optional attributes of a map, as well as captures type information of key and value naturally. This eliminates the need for BPF_ANNOTATE_KV_PAIR hack and ensures key/value sizes are always in sync w

[PATCH bpf-next 7/8] selftests/bpf: add test for BTF-defined maps

2019-06-10 Thread Andrii Nakryiko
Add file test for BTF-defined map definition. Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/progs/test_btf_newkv.c | 73 +++ tools/testing/selftests/bpf/test_btf.c| 10 +-- 2 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 tools/testing/sel

[PATCH bpf-next 1/8] libbpf: add common min/max macro to libbpf_internal.h

2019-06-10 Thread Andrii Nakryiko
Multiple files in libbpf redefine their own definitions for min/max. Let's define them in libbpf_internal.h and use those everywhere. Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/bpf.c | 7 ++- tools/lib/bpf/bpf_prog_linfo.c | 5 + tools/lib/bpf/btf.c | 3 ---

[PATCH bpf-next 0/8] BTF-defined BPF map definitions

2019-06-10 Thread Andrii Nakryiko
This patch set implements initial version (as discussed at LSF/MM2019 conference) of a new way to specify BPF maps, relying on BTF type information, which allows for easy extensibility, preserving forward and backward compatibility. See details and examples in description for patch #6. [0] contain

Re: [PATCH net v3 0/3] net/sched: fix actions reading the network header in case of QinQ packets

2019-06-10 Thread Eli Britstein
On 6/11/2019 3:52 AM, Cong Wang wrote: > On Wed, Jun 5, 2019 at 10:37 PM Eli Britstein wrote: >> >> On 6/6/2019 4:42 AM, Cong Wang wrote: >>> On Tue, Jun 4, 2019 at 11:19 AM Eli Britstein wrote: On 6/4/2019 8:55 PM, Cong Wang wrote: > On Sat, Jun 1, 2019 at 9:22 PM Eli Britstein wrote:

[PATCH net-next 02/12] net/tls: pass record number as a byte array

2019-06-10 Thread Jakub Kicinski
TLS offload code casts record number to a u64. The buffer should be aligned to 8 bytes, but its actually a __be64, and the rest of the TLS code treats it as big int. Make the offload callbacks take a byte array, drivers can make the choice to do the ugly cast if they want to. Prepare for copying

[PATCH net-next 06/12] nfp: rename nfp_ccm_mbox_alloc()

2019-06-10 Thread Jakub Kicinski
We need the name nfp_ccm_mbox_alloc() for allocating the mailbox communication channel itself. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe --- drivers/net/ethernet/netronome/nfp/ccm.h| 4 ++-- drivers/net/ethernet/netronome/nfp/ccm_mbox.c | 4 ++-- drivers/net/ethern

[PATCH net-next 05/12] nfp: tls: set skb decrypted flag

2019-06-10 Thread Jakub Kicinski
From: Dirk van der Merwe Firmware indicates when a packet has been decrypted by reusing the currently unused BPF flag. Transfer this information into the skb and provide a statistic of all decrypted segments. Signed-off-by: Dirk van der Merwe Signed-off-by: Jakub Kicinski --- drivers/net/eth

[PATCH net-next 07/12] nfp: add async version of mailbox communication

2019-06-10 Thread Jakub Kicinski
Some control messages must be sent from atomic context. The mailbox takes sleeping locks and uses a waitqueue so add a "posted" version of communication. Trylock the semaphore and if that's successful kick of the device communication. The device communication will be completed from a workqueue,

[PATCH net-next 08/12] nfp: tls: implement RX TLS resync

2019-06-10 Thread Jakub Kicinski
From: Dirk van der Merwe Enable kernel-controlled RX resync and propagate TLS connection RX resync from kernel TLS to firmware. Signed-off-by: Dirk van der Merwe Signed-off-by: Jakub Kicinski --- .../net/ethernet/netronome/nfp/crypto/tls.c | 32 +++ 1 file changed, 32 insert

[PATCH net-next 03/12] net/tls: rename handle_device_resync()

2019-06-10 Thread Jakub Kicinski
handle_device_resync() doesn't describe the function very well. The function checks if resync should be issued upon parsing of a new record. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe --- include/net/tls.h| 2 +- net/tls/tls_device.c | 2 +- net/tls/tls_sw.c | 3 ++-

[PATCH net-next 10/12] net/tls: generalize the resync callback

2019-06-10 Thread Jakub Kicinski
Currently only RX direction is ever resynced, however, TX may also get out of sequence if packets get dropped on the way to the driver. Rename the resync callback and add a direction parameter. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe --- drivers/net/ethernet/mellanox/mlx5

[PATCH net-next 12/12] nfp: tls: make use of kernel-driven TX resync

2019-06-10 Thread Jakub Kicinski
When TCP stream gets out of sync (driver stops receiving skbs with expected TCP sequence numbers) request a TX resync from the kernel. We try to distinguish retransmissions from missed transmissions by comparing the sequence number to expected - if it's further than the expected one - we probably

[PATCH net-next 09/12] nfp: tls: enable TLS RX offload

2019-06-10 Thread Jakub Kicinski
Set ethtool TLS RX feature based on NIC capabilities, and enable TLS RX when connections are added for decryption. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe --- .../ethernet/netronome/nfp/crypto/crypto.h| 5 .../net/ethernet/netronome/nfp/crypto/tls.c | 25 ++

[PATCH net-next 04/12] net/tls: add kernel-driven TLS RX resync

2019-06-10 Thread Jakub Kicinski
TLS offload device may lose sync with the TCP stream if packets arrive out of order. Drivers can currently request a resync at a specific TCP sequence number. When a record is found starting at that sequence number kernel will inform the device of the corresponding record number. This requires t

[PATCH net-next 11/12] net/tls: add kernel-driven resync mechanism for TX

2019-06-10 Thread Jakub Kicinski
TLS offload drivers keep track of TCP seq numbers to make sure the packets are fed into the HW in order. When packets get dropped on the way through the stack, the driver will get out of sync and have to use fallback encryption, but unless TCP seq number is resynced it will never match the packets

[PATCH net-next 01/12] net/tls: simplify seq calculation in handle_device_resync()

2019-06-10 Thread Jakub Kicinski
We subtract "TLS_HEADER_SIZE - 1" from req_seq, then if they match we add the same constant to seq. Just add it to seq, and we don't have to touch req_seq. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe --- net/tls/tls_device.c | 7 +++ 1 file changed, 3 insertions(+), 4 del

[PATCH net-next 00/12] tls: add support for kernel-driven resync and nfp RX offload

2019-06-10 Thread Jakub Kicinski
Hi! This series adds TLS RX offload for NFP and completes the offload by providing resync strategies. When TLS data stream looses segments or experiences reorder NIC can no longer perform in line offload. Resyncs provide information about placement of records in the stream so that offload can res

Re: [RFC PATCH bpf-next 0/8] BTF-defined BPF map definitions

2019-06-10 Thread Andrii Nakryiko
On Mon, Jun 10, 2019 at 9:35 PM Andrii Nakryiko wrote: > > This patch set implements initial version (as discussed at LSF/MM2019 > conference) of a new way to specify BPF maps, relying on BTF type information, > which allows for easy extensibility, preserving forward and backward > compatibility.

[RFC PATCH bpf-next 2/8] libbpf: extract BTF loading and simplify ELF parsing logic

2019-06-10 Thread Andrii Nakryiko
As a preparation for adding BTF-based BPF map loading, extract .BTF and .BTF.ext loading logic. Also simplify error handling in bpf_object__elf_collect() by returning early, as there is no common clean up to be done. Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/libbpf.c | 137 +++

[RFC PATCH bpf-next 5/8] libbpf: split initialization and loading of BTF

2019-06-10 Thread Andrii Nakryiko
Libbpf does sanitization of BTF before loading it into kernel, if kernel doesn't support some of newer BTF features. This removes some of the important information from BTF (e.g., DATASEC and VAR description), which will be used for map construction. This patch splits BTF processing into initializa

[RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-10 Thread Andrii Nakryiko
This patch adds support for a new way to define BPF maps. It relies on BTF to describe mandatory and optional attributes of a map, as well as captures type information of key and value naturally. This eliminates the need for BPF_ANNOTATE_KV_PAIR hack and ensures key/value sizes are always in sync w

[RFC PATCH bpf-next 8/8] selftests/bpf: switch tests to BTF-defined map definitions

2019-06-10 Thread Andrii Nakryiko
Switch test map definition to new BTF-defined format. Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bpf/progs/bpf_flow.c | 18 +++-- .../selftests/bpf/progs/get_cgroup_id_kern.c | 18 +++-- .../testing/selftests/bpf/progs/netcnt_prog.c | 22 +++--- .../selftests/bpf/progs/sample_m

[RFC PATCH bpf-next 4/8] libbpf: identify maps by section index in addition to offset

2019-06-10 Thread Andrii Nakryiko
To support maps to be defined in multiple sections, it's important to identify map not just by offset within its section, but section index as well. This patch adds tracking of section index. For global data, we record section index of corresponding .data/.bss/.rodata ELF section for uniformity, a

[RFC PATCH bpf-next 3/8] libbpf: refactor map initialization

2019-06-10 Thread Andrii Nakryiko
User and global data maps initialization has gotten pretty complicated and unnecessarily convoluted. This patch splits out the logic for global data map and user-defined map initialization. It also removes the restriction of pre-calculating how many maps will be initialized, instead allowing to kee

[RFC PATCH bpf-next 7/8] selftests/bpf: add test for BTF-defined maps

2019-06-10 Thread Andrii Nakryiko
Add file test for BTF-defined map definition. Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/progs/test_btf_newkv.c | 73 +++ tools/testing/selftests/bpf/test_btf.c| 10 +-- 2 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 tools/testing/sel

Re: [PATCH RESEND net] net: handle 802.1P vlan 0 packets properly

2019-06-10 Thread Toshiaki Makita
On 2019/06/11 3:31, Govindarajulu Varadarajan wrote: When stack receives pkt: [802.1P vlan 0][802.1AD vlan 100][IPv4], vlan_do_receive() returns false if it does not find vlan_dev. Later __netif_receive_skb_core() fails to find packet type handler for skb->protocol 801.1AD and drops the packet.

[RFC PATCH bpf-next 1/8] libbpf: add common min/max macro to libbpf_internal.h

2019-06-10 Thread Andrii Nakryiko
Multiple files in libbpf redefine their own definitions for min/max. Let's define them in libbpf_internal.h and use those everywhere. Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/bpf.c | 7 ++- tools/lib/bpf/bpf_prog_linfo.c | 5 + tools/lib/bpf/btf.c | 3 ---

[RFC PATCH bpf-next 0/8] BTF-defined BPF map definitions

2019-06-10 Thread Andrii Nakryiko
This patch set implements initial version (as discussed at LSF/MM2019 conference) of a new way to specify BPF maps, relying on BTF type information, which allows for easy extensibility, preserving forward and backward compatibility. See details and examples in description for patch #6. Patch #1 ce

[PATCH net-next] tcp: add optional per socket transmit delay

2019-06-10 Thread Eric Dumazet
Adding delays to TCP flows is crucial for studying behavior of TCP stacks, including congestion control modules. Linux offers netem module, but it has unpractical constraints : - Need root access to change qdisc - Hard to setup on egress if combined with non trivial qdisc like FQ - Single delay fo

Re: [PATCH] netfilter: nft_paylaod: add base type NFT_PAYLOAD_LL_HEADER_NO_TAG

2019-06-10 Thread wenxu
Hi Florian, Thx,  the patch is work! Br wenxu On 6/10/2019 5:44 PM, Florian Westphal wrote: > we...@ucloud.cn wrote: >> From: wenxu >> >> nft add rule bridge firewall rule-100-ingress ip protocol icmp drop > nft --debug=netlink add rule bridge firewall rule-100-ingress ip protocol > icmp d

Re: tp->copied_seq used before assignment in tcp_check_urg

2019-06-10 Thread Neal Cardwell
On Mon, Jun 10, 2019 at 7:48 PM Zhongjie Wang wrote: > > Hi Neal, > > Thanks for your reply. Sorry, I made a mistake in my previous email. > After I double checked the source code, I think it should be tp->urg_seq, > which is used before assignment, instead of tp->copied_seq. > Still in the same i

[PATCH RESEND net] net: handle 802.1P vlan 0 packets properly

2019-06-10 Thread Govindarajulu Varadarajan
When stack receives pkt: [802.1P vlan 0][802.1AD vlan 100][IPv4], vlan_do_receive() returns false if it does not find vlan_dev. Later __netif_receive_skb_core() fails to find packet type handler for skb->protocol 801.1AD and drops the packet. 801.1P header with vlan id 0 should be handled as untag

Re: [PATCH net] net: handle 802.1P vlan 0 packets properly

2019-06-10 Thread David Miller
From: "Christian Benvenuti (benve)" Date: Tue, 11 Jun 2019 00:35:59 + > if we assume that the kernel is supposed to deal properly with .1p tagged > frames, regardless > of what the next header is (802.{1Q,1AD} or something else), I think the case > this patch was > trying to address (that

[PATCH v6 bpf-next 2/3] selftests/bpf: remove bpf_util.h from BPF C progs

2019-06-10 Thread Hechao Li
Though currently there is no problem including bpf_util.h in kernel space BPF C programs, in next patch in this stack, I will reuse libbpf_num_possible_cpus() in bpf_util.h thus include libbpf.h in it, which will cause BPF C programs compile error. Therefore I will first remove bpf_util.h from all

[PATCH v6 bpf-next 3/3] bpf: use libbpf_num_possible_cpus internally

2019-06-10 Thread Hechao Li
Use the newly added bpf_num_possible_cpus() in bpftool and selftests and remove duplicate implementations. Signed-off-by: Hechao Li --- tools/bpf/bpftool/common.c | 53 +++--- tools/testing/selftests/bpf/bpf_util.h | 37 +++--- 2 files changed, 10 inse

[PATCH v6 bpf-next 0/3] Add a new API libbpf_num_possible_cpus()

2019-06-10 Thread Hechao Li
Getting number of possible CPUs is commonly used for per-CPU BPF maps and perf_event_maps. Add a new API libbpf_num_possible_cpus() that helps user with per-CPU related operations and remove duplicate implementations in bpftool and selftests. v2: Save errno before calling pr_warning in case it is

[PATCH v6 bpf-next 1/3] bpf: add a new API libbpf_num_possible_cpus()

2019-06-10 Thread Hechao Li
Adding a new API libbpf_num_possible_cpus() that helps user with per-CPU map operations. Signed-off-by: Hechao Li --- tools/lib/bpf/libbpf.c | 57 tools/lib/bpf/libbpf.h | 16 +++ tools/lib/bpf/libbpf.map | 1 + 3 files changed, 74 insertions

Re: [PATCH net v3 0/3] net/sched: fix actions reading the network header in case of QinQ packets

2019-06-10 Thread Cong Wang
On Wed, Jun 5, 2019 at 10:37 PM Eli Britstein wrote: > > > On 6/6/2019 4:42 AM, Cong Wang wrote: > > On Tue, Jun 4, 2019 at 11:19 AM Eli Britstein wrote: > >> > >> On 6/4/2019 8:55 PM, Cong Wang wrote: > >>> On Sat, Jun 1, 2019 at 9:22 PM Eli Britstein wrote: > I think that's because QinQ,

[PATCH v2 bpf-next] selftests/bpf : clean up feature/ when make clean

2019-06-10 Thread Hechao Li
An error "implicit declaration of function 'reallocarray'" can be thrown with the following steps: $ cd tools/testing/selftests/bpf $ make clean && make CC= $ make clean && make CC= The cause is that the feature folder generated by GCC 4.8.5 is not removed, leaving feature-reallocarray being 1, w

RE: [PATCH net] net: handle 802.1P vlan 0 packets properly

2019-06-10 Thread Christian Benvenuti (benve)
> -Original Message- > From: Stephen Suryaputra > Sent: Monday, June 10, 2019 4:09 PM > To: David Miller > Cc: Govindarajulu Varadarajan (gvaradar) ; Christian > Benvenuti (benve) ; netdev@vger.kernel.org; > govind.vara...@gmail.com > Subject: Re: [PATCH net] net: handle 802.1P vlan 0 pac

[PATCH net-next] ipv4: Support multipath hashing on inner IP pkts for GRE tunnel

2019-06-10 Thread Stephen Suryaputra
Multipath hash policy value of 0 isn't distributing since the outer IP dest and src aren't varied eventhough the inner ones are. Since the flow is on the inner ones in the case of tunneled traffic, hashing on them is desired. This currently only supports IP over GRE and CONFIG_NET_GRE_DEMUX must b

Re: [PATCH net] net_sched: sch_mqprio: handle return value of mqprio_queue_get

2019-06-10 Thread Jacob Wen
Hi Cong, This was detected by a tool. Thanks for the review :) I will abandon the patch. On 6/11/19 2:19 AM, Cong Wang wrote: On Sun, Jun 9, 2019 at 11:41 PM Jacob Wen wrote: It may return NULL thus we can't ignore it. How is this possible? All of the callers should have validated the 'cl'

Re: [PATCH v1 bpf-next] selftests/bpf : Clean up feature/ when make clean

2019-06-10 Thread Andrii Nakryiko
On Mon, Jun 10, 2019 at 12:03 PM Hechao Li wrote: > > Andrii Nakryiko wrote on Mon [2019-Jun-10 > 11:05:28 -0700]: > > On Mon, Jun 10, 2019 at 9:57 AM Hechao Li wrote: > > > > > > I got an error when compiling selftests/bpf: > > > > > > libbpf.c:411:10: error: implicit declaration of function '

Re: tp->copied_seq used before assignment in tcp_check_urg

2019-06-10 Thread Zhongjie Wang
Hi Neal, Thanks for your reply. Sorry, I made a mistake in my previous email. After I double checked the source code, I think it should be tp->urg_seq, which is used before assignment, instead of tp->copied_seq. Still in the same if-statement: 5189 if (tp->urg_seq == tp->copied_seq && tp->urg

Re: explicit maps. Was: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-10 Thread Andrii Nakryiko
On Sun, Jun 9, 2019 at 6:17 PM Alexei Starovoitov wrote: > > On 6/6/19 6:02 PM, Jakub Kicinski wrote: > > On Fri, 7 Jun 2019 00:27:52 +, Alexei Starovoitov wrote: > >> the solution we're discussing should solve BPF_ANNOTATE_KV_PAIR too. > >> That hack must go. > > > > I see. > > > >> If I unde

[PATCH mlx5-next 08/16] net/mlx5: Separate IRQ data from EQ table data

2019-06-10 Thread Saeed Mahameed
From: Yuval Avnery IRQ table should only exist for mlx5_core_dev for PF and VF only. EQ table of mediated devices should hold a pointer to the IRQ table of the parent PCI device. Signed-off-by: Yuval Avnery Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mell

[PATCH mlx5-next 16/16] net/mlx5: Add EQ enable/disable API

2019-06-10 Thread Saeed Mahameed
From: Yuval Avnery Previously, EQ joined the chain notifier on creation. This forced the caller to be ready to handle events before creating the EQ through eq_create_generic interface. To help the caller control when the created EQ will be attached to the IRQ, add enable/disable API. Signed-off

[PATCH mlx5-next 15/16] net/mlx5: Use a single IRQ for all async EQs

2019-06-10 Thread Saeed Mahameed
From: Ariel Levkovich The patch modifies the IRQ allocation so that all async EQs are assigned to the same IRQ resulting in more available IRQs for completion EQs. The changes are using the support for IRQ sharing and EQ polling budget that was introduced in previous patches so when the shared i

[PATCH mlx5-next 13/16] net/mlx5: Move all IRQ logic to pci_irq.c

2019-06-10 Thread Saeed Mahameed
From: Yuval Avnery Finalize IRQ separation and expose irq interface. Signed-off-by: Yuval Avnery Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/Makefile | 2 +- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 327 - .../net/

[PATCH mlx5-next 10/16] net/mlx5: Move IRQ affinity set to IRQ allocation phase

2019-06-10 Thread Saeed Mahameed
From: Yuval Avnery Affinity set/clear is part of the IRQ life-cycle. Signed-off-by: Yuval Avnery Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 25 +--- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/

[PATCH mlx5-next 12/16] net/mlx5: Generalize IRQ interface to work with irq_table

2019-06-10 Thread Saeed Mahameed
From: Yuval Avnery IRQ interface should operate within the irq_table context. It should be independent of any EQ data structure. The interface that will be exposed: init/clenup, create/destroy, attach/detach Signed-off-by: Yuval Avnery Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed

[PATCH mlx5-next 09/16] net/mlx5: Move IRQ rmap creation to IRQ allocation phase

2019-06-10 Thread Saeed Mahameed
From: Yuval Avnery Rmap creation/deletion is part of the IRQ life-cycle. Signed-off-by: Yuval Avnery Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 82 ++-- 1 file changed, 57 insertions(+), 25 deletions(-) diff --g

[PATCH mlx5-next 14/16] net/mlx5: Rename mlx5_irq_info to mlx5_irq

2019-06-10 Thread Saeed Mahameed
From: Yuval Avnery struct mlx5_irq_info is an active object and not just info. Signed-off-by: Yuval Avnery Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/pci_irq.c | 77 +-- 1 file changed, 38 insertions(+), 39 deletions(-) di

[PATCH mlx5-next 11/16] net/mlx5: Separate IRQ table creation from EQ table creation

2019-06-10 Thread Saeed Mahameed
From: Yuval Avnery IRQ allocation should be part of the IRQ table life-cycle. Signed-off-by: Yuval Avnery Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 22 +++ .../net/ethernet/mellanox/mlx5/core/main.c| 9 +++

[PATCH mlx5-next 07/16] net/mlx5: Separate IRQ request/free from EQ life cycle

2019-06-10 Thread Saeed Mahameed
From: Yuval Avnery Instead of requesting IRQ with eq creation, IRQs will be requested before EQ table creation. Instead of freeing the IRQs after EQ destroy, free IRQs after eq table destroy. Signed-off-by: Yuval Avnery Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/infi

[PATCH mlx5-next 00/16] Mellanox, mlx5 next updates 10-06-2019

2019-06-10 Thread Saeed Mahameed
Hi All, This series is aimed mlx5-next branch, it includes a couple of low level updates for mlx5_core driver, needed for both rdma and net-next trees. 1) Bodong refactors query esw functions so he could use it to support querying max VFs from device. 2) Vu, handles VF representors creation from

[PATCH mlx5-next 05/16] net/mlx5: Introduce EQ polling budget

2019-06-10 Thread Saeed Mahameed
From: Yuval Avnery Multiple EQs may share the same irq in subsequent patches. To avoid starvation, a budget is set per EQ's interrupt handler. Because of this change, it is no longer required to check that MLX5_NUM_SPARE_EQE eqes were polled (to detect that arm is required). It is guaranteed tha

[PATCH mlx5-next 04/16] net/mlx5: Support querying max VFs from device

2019-06-10 Thread Saeed Mahameed
From: Bodong Wang For ECPF with eswitch manager privilege, query the host max VF count by querying the device using query_functions command. With this enhancement: 1. flow steering entries are created only for valid vports based on the max VF count of the PF. 2. Driver only queries cap of val

[PATCH mlx5-next 06/16] net/mlx5: Change interrupt handler to call chain notifier

2019-06-10 Thread Saeed Mahameed
From: Yuval Avnery Multiple EQs may share the same IRQ in subsequent patches. Instead of calling the IRQ handler directly, the EQ will register to an atomic chain notfier. The Linux built-in shared IRQ is not used because it forces the caller to disable the IRQ and clear affinity before free_ir

[PATCH mlx5-next 02/16] net/mlx5: E-Switch, Handle representors creation in handler context

2019-06-10 Thread Saeed Mahameed
From: Vu Pham Unified representors creation in esw_functions_changed context handler. Emulate the esw_function_changed event for FW/HW that does not support this event. Signed-off-by: Vu Pham Reviewed-by: Parav Pandit Reviewed-by: Bodong Wang Signed-off-by: Saeed Mahameed --- .../net/ethern

[PATCH mlx5-next 01/16] net/mlx5: Increase wait time for fw initialization

2019-06-10 Thread Saeed Mahameed
From: Daniel Jurgens Firmware FLR happens sequentially, in some cases, like when destroying a VM that had many VFs, may require waiting much longer than 10 seconds. Increase the timeout to 2 minutes, and print a wait countdown status every 20 seconds. Signed-off-by: Daniel Jurgens Signed-off-by

[PATCH mlx5-next 03/16] net/mlx5: E-Switch, Return raw output for query esw functions

2019-06-10 Thread Saeed Mahameed
From: Bodong Wang Current function only returns host num of VFs, later patch requires other params such as host maximum num of VFs. Return the raw output so that caller can extract info as needed. Signed-off-by: Bodong Wang Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed --- .../net

Re: [PATCH v1 bpf-next] selftests/bpf : Clean up feature/ when make clean

2019-06-10 Thread Song Liu
> On Jun 10, 2019, at 12:02 PM, Hechao Li wrote: > > Andrii Nakryiko wrote on Mon [2019-Jun-10 > 11:05:28 -0700]: >> On Mon, Jun 10, 2019 at 9:57 AM Hechao Li wrote: >>> >>> I got an error when compiling selftests/bpf: >>> >>> libbpf.c:411:10: error: implicit declaration of function 'real

Re: [PATCH iproute2 1/2] netns: switch netns in the child when executing commands

2019-06-10 Thread Stephen Hemminger
On Tue, 11 Jun 2019 01:03:57 +0200 Matteo Croce wrote: > On Tue, Jun 11, 2019 at 12:52 AM Matteo Croce wrote: > > > > On Tue, Jun 11, 2019 at 12:46 AM Stephen Hemminger > > wrote: > > > > > > On Tue, 11 Jun 2019 00:16:12 +0200 > > > Matteo Croce wrote: > > > > > > > + printf("\nnetns:

Re: [PATCH net] net: handle 802.1P vlan 0 packets properly

2019-06-10 Thread Govindarajulu Varadarajan (gvaradar)
On Mon, 2019-06-10 at 14:28 -0700, David Miller wrote: > From: Govindarajulu Varadarajan > Date: Mon, 10 Jun 2019 07:27:02 -0700 > > > When stack receives pkt: [802.1P vlan 0][802.1AD vlan 100][IPv4], > > vlan_do_receive() returns false if it does not find vlan_dev. Later > > __netif_receive_skb_

Re: [PATCH net] net: handle 802.1P vlan 0 packets properly

2019-06-10 Thread Stephen Suryaputra
On Mon, Jun 10, 2019 at 02:28:10PM -0700, David Miller wrote: > From: Govindarajulu Varadarajan > Date: Mon, 10 Jun 2019 07:27:02 -0700 > > > When stack receives pkt: [802.1P vlan 0][802.1AD vlan 100][IPv4], > > vlan_do_receive() returns false if it does not find vlan_dev. Later > > __netif_recei

Re: [PATCH iproute2 1/2] netns: switch netns in the child when executing commands

2019-06-10 Thread Matteo Croce
On Tue, Jun 11, 2019 at 12:52 AM Matteo Croce wrote: > > On Tue, Jun 11, 2019 at 12:46 AM Stephen Hemminger > wrote: > > > > On Tue, 11 Jun 2019 00:16:12 +0200 > > Matteo Croce wrote: > > > > > + printf("\nnetns: %s\n", nsname); > > > + cmd_exec(argv[0], argv, true, nsname); > > >

Re: [PATCH net 0/2] Don't assume linear buffers in error handlers for VXLAN and GENEVE

2019-06-10 Thread Guillaume Nault
On Tue, Jun 11, 2019 at 12:27:04AM +0200, Stefano Brivio wrote: > Guillaume noticed the same issue fixed by commit 26fc181e6cac ("fou, fou6: > do not assume linear skbs") for fou and fou6 is also present in VXLAN and > GENEVE error handlers: we can't assume linear buffers there, we need to > use ps

Re: [PATCH iproute2 1/2] netns: switch netns in the child when executing commands

2019-06-10 Thread Matteo Croce
On Tue, Jun 11, 2019 at 12:46 AM Stephen Hemminger wrote: > > On Tue, 11 Jun 2019 00:16:12 +0200 > Matteo Croce wrote: > > > + printf("\nnetns: %s\n", nsname); > > + cmd_exec(argv[0], argv, true, nsname); > > return 0; > > simple printf breaks JSON output. It was just moved from on

Re: [PATCH net v3 0/2] ipv6: Fix listing and flushing of cached route exceptions

2019-06-10 Thread Stefano Brivio
On Mon, 10 Jun 2019 23:53:15 +0200 Stefano Brivio wrote: > On Mon, 10 Jun 2019 15:38:06 -0600 > David Ahern wrote: > > > in dot releases of stable trees, I think it would be better to converge > > on consistent behavior between v4 and v6. By that I mean without the > > CLONED flag, no exception

Re: [PATCH iproute2 1/2] netns: switch netns in the child when executing commands

2019-06-10 Thread Stephen Hemminger
On Tue, 11 Jun 2019 00:16:12 +0200 Matteo Croce wrote: > + printf("\nnetns: %s\n", nsname); > + cmd_exec(argv[0], argv, true, nsname); > return 0; simple printf breaks JSON output.

Re: [PATCH net-next] tcp: take care of SYN_RECV sockets in tcp_v4_send_ack() and tcp_v6_send_response()

2019-06-10 Thread Jonathan Maxwell
Sounds good Eric. Thanks On Tue, Jun 11, 2019 at 8:34 AM Eric Dumazet wrote: > > On Mon, Jun 10, 2019 at 3:27 PM Jonathan Maxwell wrote: > > > > Thanks for fixing that Eric. > > Hi Jonathan. > > There is no bug actually, at least not on sk->sk_mark part. > > I will send a simpler patch so that s

Re: [PATCH net-next] tcp: take care of SYN_RECV sockets in tcp_v4_send_ack() and tcp_v6_send_response()

2019-06-10 Thread Eric Dumazet
On Mon, Jun 10, 2019 at 3:27 PM Jonathan Maxwell wrote: > > Thanks for fixing that Eric. Hi Jonathan. There is no bug actually, at least not on sk->sk_mark part. I will send a simpler patch so that sock_net_uid() correctly fetches sk->sk_uid for FASTOPEN socket. Thanks ! > > On Tue, Jun 11,

[PATCH net 1/2] vxlan: Don't assume linear buffers in error handler

2019-06-10 Thread Stefano Brivio
In commit c3a43b9fec8a ("vxlan: ICMP error lookup handler") I wrongly assumed buffers from icmp_socket_deliver() would be linear. This is not the case: icmp_socket_deliver() only guarantees we have 8 bytes of linear data. Eric fixed this same issue for fou and fou6 in commits 26fc181e6cac ("fou, f

[PATCH net 2/2] geneve: Don't assume linear buffers in error handler

2019-06-10 Thread Stefano Brivio
In commit a07966447f39 ("geneve: ICMP error lookup handler") I wrongly assumed buffers from icmp_socket_deliver() would be linear. This is not the case: icmp_socket_deliver() only guarantees we have 8 bytes of linear data. Eric fixed this same issue for fou and fou6 in commits 26fc181e6cac ("fou,

Re: [PATCH net-next] tcp: take care of SYN_RECV sockets in tcp_v4_send_ack() and tcp_v6_send_response()

2019-06-10 Thread Jonathan Maxwell
Thanks for fixing that Eric. On Tue, Jun 11, 2019 at 7:45 AM Eric Dumazet wrote: > > TCP can send ACK packets on behalf of SYN_RECV sockets. > > tcp_v4_send_ack() and tcp_v6_send_response() incorrectly > dereference sk->sk_mark for non TIME_WAIT sockets. > > This field is not defined for SYN_RECV

[PATCH net 0/2] Don't assume linear buffers in error handlers for VXLAN and GENEVE

2019-06-10 Thread Stefano Brivio
Guillaume noticed the same issue fixed by commit 26fc181e6cac ("fou, fou6: do not assume linear skbs") for fou and fou6 is also present in VXLAN and GENEVE error handlers: we can't assume linear buffers there, we need to use pskb_may_pull() instead. Stefano Brivio (2): vxlan: Don't assume linear

[net/tls] Re: KMSAN: uninit-value in gf128mul_4k_lle (3)

2019-06-10 Thread Eric Biggers
This TLS bug is still present. See more recent report here: https://syzkaller.appspot.com/text?tag=CrashReport&x=10613446a0 On Wed, Nov 28, 2018 at 11:58:37AM +0100, 'Alexander Potapenko' via syzkaller-bugs wrote: > On Sat, Nov 24, 2018 at 12:02 AM Ard Biesheuvel > wrote: > > > > (+ TLS mai

Re: [PATCH bpf-next v3 0/5] net: xdp: refactor XDP program queries

2019-06-10 Thread Jakub Kicinski
On Mon, 10 Jun 2019 18:02:29 +0200, Björn Töpel wrote: > Jakub, what's your thoughts on the special handling of XDP offloading? > Maybe it's just overkill? Just allocate space for the offloaded > program regardless support or not? Also, please review the > dev_xdp_support_offload() addition into th

Re: [PATCH net-next v2 3/3] net/mlx5e: use indirect calls wrapper for the rx packet handler

2019-06-10 Thread Saeed Mahameed
On Mon, 2019-06-10 at 10:43 +0200, Paolo Abeni wrote: > Hi, > > On Fri, 2019-06-07 at 18:09 +, Saeed Mahameed wrote: > > On Thu, 2019-06-06 at 23:56 +0200, Paolo Abeni wrote: > > > We can avoid another indirect call per packet wrapping the rx > > > handler call with the proper helper. > > > >

[PATCH iproute2 2/2] netns: make netns_{save,restore} static

2019-06-10 Thread Matteo Croce
The netns_{save,restore} functions are only used in ipnetns.c now, since the restore is not needed anymore after the netns exec command. Move them in ipnetns.c, and make them static. Signed-off-by: Matteo Croce --- include/namespace.h | 2 -- ip/ip.c | 1 - ip/ipnetns.c| 31

[PATCH iproute2 0/2] refactor the 'ip netns exec' command

2019-06-10 Thread Matteo Croce
Refactor the netns code so less steps are needed to exec commands in a netns. Also remove some code which became dead. bloat-o-meter output: $ bloat-o-meter ip.old ip add/remove: 0/5 grow/shrink: 3/3 up/down: 159/-358 (-199) Function old new delta netns_ad

[PATCH iproute2 1/2] netns: switch netns in the child when executing commands

2019-06-10 Thread Matteo Croce
'ip netns exec' changes the current netns just before executing a child process, and restores it after forking. This is needed if we're running in batch or do_all mode, as well as other cleanup things like VRF associations. Add an argument to cmd_exec() which allows to switch the current netns dire

  1   2   3   >