Re: [PATCH net] r8169: fix NAPI handling under high load

2018-10-17 Thread Holger Hoffstätte
On 10/17/18 20:12, Heiner Kallweit wrote: On 16.10.2018 23:17, Holger Hoffstätte wrote: On 10/16/18 22:37, Heiner Kallweit wrote: rtl_rx() and rtl_tx() are called only if the respective bits are set in the interrupt status register. Under high load NAPI may not be able to process all data

Re: [PATCH bpf-next 2/3] bpf: emit RECORD_MMAP events for bpf prog load/unload

2018-10-17 Thread Alexei Starovoitov
On 10/17/18 11:53 AM, Arnaldo Carvalho de Melo wrote: > Em Wed, Oct 17, 2018 at 04:36:08PM +, Alexei Starovoitov escreveu: >> On 10/17/18 8:09 AM, David Ahern wrote: >>> On 10/16/18 11:43 PM, Song Liu wrote: I agree that processing events while recording has significant overhead. In

Re: [PATCH bpf-next 1/2] bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB

2018-10-17 Thread Song Liu
> On Oct 17, 2018, at 12:02 PM, Alexei Starovoitov wrote: > > On 10/17/18 10:26 AM, Alexei Starovoitov wrote: >> On Tue, Oct 16, 2018 at 10:56:05PM -0700, Song Liu wrote: >>> BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the >>> skb. This patch enables direct access of

Re: [PATCH bpf-next 1/2] bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB

2018-10-17 Thread Alexei Starovoitov
On 10/17/18 10:26 AM, Alexei Starovoitov wrote: > On Tue, Oct 16, 2018 at 10:56:05PM -0700, Song Liu wrote: >> BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the >> skb. This patch enables direct access of skb for these programs. > > The lack of direct packet access in

Re: [PATCH bpf-next 2/3] bpf: emit RECORD_MMAP events for bpf prog load/unload

2018-10-17 Thread Arnaldo Carvalho de Melo
Em Wed, Oct 17, 2018 at 04:36:08PM +, Alexei Starovoitov escreveu: > On 10/17/18 8:09 AM, David Ahern wrote: > > On 10/16/18 11:43 PM, Song Liu wrote: > >> I agree that processing events while recording has significant overhead. > >> In this case, perf user space need to know details about the

Re: Form sk_buff from DMA page

2018-10-17 Thread David Miller
From: Keyur Amrutbhai Patel Date: Wed, 17 Oct 2018 17:32:33 + > Can anyone help me on how to form sk_buff from DMA page? Basically I > get complete packet from DMA as single page. Read any driver that calls build_skb().

Re: ipmr, ip6mr: Unite dumproute flows

2018-10-17 Thread Nikolay Aleksandrov
On 17/10/2018 21:22, Colin Ian King wrote: > Hi, > > Static analysis on linux-next has picked up a potential bug with commit: > > commit 7b0db85737db3f4d76b2a412e4f19eae59b8b494 > Author: Yuval Mintz > Date: Wed Feb 28 23:29:39 2018 +0200 > > ipmr, ip6mr: Unite dumproute flows > > in

Fwd: Re: [PATCH net] r8169: fix NAPI handling under high load

2018-10-17 Thread Heiner Kallweit
Tomas, more than three years back you reported network problems after BQL was added to the r8169 driver. Due to this the change was reverted. Now the discussion to add BQL popped up again. You mentioned that the issue exists on one of your systems only. Therefore it could be an issue specific to

RE: Form sk_buff from DMA page

2018-10-17 Thread Keyur Amrutbhai Patel
Hi Stephen, Thanks you for answering my query. I am looking into build_skb it seems addressing to my query. Appreciated.. Any good article on sk_buff which explains everything about it? Regards, Keyur -Original Message- From: Stephen Hemminger Sent: Wednesday, October 17, 2018

Re: ipmr, ip6mr: Unite dumproute flows

2018-10-17 Thread Colin Ian King
Hi, Static analysis on linux-next has picked up a potential bug with commit: commit 7b0db85737db3f4d76b2a412e4f19eae59b8b494 Author: Yuval Mintz Date: Wed Feb 28 23:29:39 2018 +0200 ipmr, ip6mr: Unite dumproute flows in function mr_table_dump(), s_e is and never seems to change, so the

Re: [PATCH net] r8169: fix NAPI handling under high load

2018-10-17 Thread Heiner Kallweit
On 16.10.2018 23:17, Holger Hoffstätte wrote: > On 10/16/18 22:37, Heiner Kallweit wrote: >> rtl_rx() and rtl_tx() are called only if the respective bits are set >> in the interrupt status register. Under high load NAPI may not be >> able to process all data (work_done == budget) and it will

Re: [PATCH net] sctp: fix the data size calculation in sctp_data_size

2018-10-17 Thread Marcelo Ricardo Leitner
On Wed, Oct 17, 2018 at 09:11:27PM +0800, Xin Long wrote: > sctp data size should be calculated by subtracting data chunk header's > length from chunk_hdr->length, not just data header. > > Fixes: 668c9beb9020 ("sctp: implement assign_number for > sctp_stream_interleave") > Signed-off-by: Xin

Re: Form sk_buff from DMA page

2018-10-17 Thread Stephen Hemminger
On Wed, 17 Oct 2018 17:32:33 + Keyur Amrutbhai Patel wrote: > Hi, > > Can anyone help me on how to form sk_buff from DMA page? Basically I get > complete packet from DMA as single page. > > Regards, > Keyur > This email and any attachments are intended for the sole use of the named >

Re: [PATCH bpf-next v2 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-17 Thread Martin Lau
On Wed, Oct 17, 2018 at 10:25:21AM -0700, Yonghong Song wrote: > > > On 10/17/18 9:13 AM, Edward Cree wrote: > > On 17/10/18 08:23, Yonghong Song wrote: > >> This patch adds BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO > >> support to the type section. BTF_KIND_FUNC_PROTO is used > >> to specify the

Re: [PATCH bpf-next v2 4/8] tls: convert to generic sk_msg interface

2018-10-17 Thread Daniel Borkmann
On 10/17/2018 04:55 PM, Eric Dumazet wrote: > On 10/12/2018 05:45 PM, Daniel Borkmann wrote: >> Convert kTLS over to make use of sk_msg interface for plaintext and >> encrypted scattergather data, so it reuses all the sk_msg helpers >> and data structure which later on in a second step enables to

Form sk_buff from DMA page

2018-10-17 Thread Keyur Amrutbhai Patel
Hi, Can anyone help me on how to form sk_buff from DMA page? Basically I get complete packet from DMA as single page. Regards, Keyur This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary,

Re: [PATCH bpf-next v2 13/13] tools/bpf: bpftool: add support for jited func types

2018-10-17 Thread Yonghong Song
On 10/17/18 4:11 AM, Edward Cree wrote: > On 17/10/18 08:24, Yonghong Song wrote: >> This patch added support to print function signature >> if btf func_info is available. Note that ksym >> now uses function name instead of prog_name as >> prog_name has a limit of 16 bytes including >> ending

Re: [PATCH bpf-next v2 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-17 Thread Yonghong Song
On 10/17/18 9:13 AM, Edward Cree wrote: > On 17/10/18 08:23, Yonghong Song wrote: >> This patch adds BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO >> support to the type section. BTF_KIND_FUNC_PROTO is used >> to specify the type of a function pointer. With this, >> BTF has a complete set of C types

Re: [PATCH bpf-next 1/2] bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB

2018-10-17 Thread Alexei Starovoitov
On Tue, Oct 16, 2018 at 10:56:05PM -0700, Song Liu wrote: > BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the > skb. This patch enables direct access of skb for these programs. The lack of direct packet access in CGROUP_SKB progs was an unpleasant surprise to me, so thank you

Re: [PATCH bpf-next 05/13] bpf: get better bpf_prog ksyms based on btf func type_id

2018-10-17 Thread Martin Lau
On Tue, Oct 16, 2018 at 05:32:13PM -0700, Yonghong Song wrote: > > > On 10/15/18 4:12 PM, Martin Lau wrote: > > On Fri, Oct 12, 2018 at 11:54:42AM -0700, Yonghong Song wrote: > >> This patch added interface to load a program with the following > >> additional information: > >> . prog_btf_fd

For your photos 20

2018-10-17 Thread Jenny
We provide photoshop services to some of the companies from around the world. Some online stores use our services for retouching portraits, jewelry, apparels, furnitures etc. Here are the details of what we provide: Clipping path for photos Deep etching for photos Image masking for photos

Re: [PATCH bpf-next 2/3] bpf: emit RECORD_MMAP events for bpf prog load/unload

2018-10-17 Thread Alexei Starovoitov
On 10/17/18 8:09 AM, David Ahern wrote: > On 10/16/18 11:43 PM, Song Liu wrote: >> I agree that processing events while recording has significant overhead. >> In this case, perf user space need to know details about the the jited BPF >> program. It is impossible to pass all these details to user

Re: [PATCH bpf-next 2/3] bpf: emit RECORD_MMAP events for bpf prog load/unload

2018-10-17 Thread Song Liu
Hi David, On Wed, Oct 17, 2018 at 8:09 AM David Ahern wrote: > > On 10/16/18 11:43 PM, Song Liu wrote: > > I agree that processing events while recording has significant overhead. > > In this case, perf user space need to know details about the the jited BPF > > program. It is impossible to pass

Re: [PATCH bpf-next v2 00/13] bpf: add btf func info support

2018-10-17 Thread Yonghong Song
On 10/17/18 4:02 AM, Edward Cree wrote: > I think the BTF work needs to be better documented; at the moment the only way >  to determine how BTF sections are structured is to read through the headers, >  and cross-reference with the DWARF spec to guess at the semantics of various >  fields. 

Re: [PATCH bpf-next v2 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-17 Thread Edward Cree
On 17/10/18 08:23, Yonghong Song wrote: > This patch adds BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO > support to the type section. BTF_KIND_FUNC_PROTO is used > to specify the type of a function pointer. With this, > BTF has a complete set of C types (except float). > > BTF_KIND_FUNC is used to

Re: [PATCH bpf-next 2/3] bpf: emit RECORD_MMAP events for bpf prog load/unload

2018-10-17 Thread Song Liu
On Wed, Oct 17, 2018 at 5:50 AM Arnaldo Carvalho de Melo wrote: > > Em Wed, Oct 17, 2018 at 09:11:40AM -0300, Arnaldo Carvalho de Melo escreveu: > > Adding Alexey, Jiri and Namhyung as they worked/are working on > > multithreading 'perf record'. > > > > Em Tue, Oct 16, 2018 at 11:43:11PM -0700,

Re: [PATCH rdma-next] IB/mlx5: Add support for extended atomic operations

2018-10-17 Thread Doug Ledford
On Wed, 2018-10-10 at 09:25 +0300, Leon Romanovsky wrote: > From: Yonatan Cohen > > Extended atomic operations cmp and fetch is a Mellanox > feature extending the standard atomic operation to use, varied > operand sizes, as apposed to normal atomic operation that use > an 8 byte operand only. >

Re: [PATCH bpf-next 3/3] bpf, libbpf: use proper barriers in perf ring buffer walk

2018-10-17 Thread Peter Zijlstra
On Wed, Oct 17, 2018 at 04:41:56PM +0200, Daniel Borkmann wrote: > +static __u64 bpf_perf_read_head(struct perf_event_mmap_page *header) > +{ > + __u64 data_head = READ_ONCE(header->data_head); > + > + smp_rmb(); > + return data_head; > +} > + > +static void bpf_perf_write_tail(struct

Re: [PATCH bpf-next 2/3] tools, perf: use smp_{rmb,mb} barriers instead of {rmb,mb}

2018-10-17 Thread Peter Zijlstra
On Wed, Oct 17, 2018 at 04:41:55PM +0200, Daniel Borkmann wrote: > @@ -73,7 +73,8 @@ static inline u64 perf_mmap__read_head(struct perf_mmap *mm) > { > struct perf_event_mmap_page *pc = mm->base; > u64 head = READ_ONCE(pc->data_head); > - rmb(); > + > + smp_rmb(); >

Re: [PATCH bpf] bpf: fix doc of bpf_skb_adjust_room() in uapi

2018-10-17 Thread Quentin Monnet
2018-10-17 16:24 UTC+0200 ~ Nicolas Dichtel len_diff is signed. Fixes: fa15601ab31e ("bpf: add documentation for eBPF helpers (33-41)") CC: Quentin Monnet Signed-off-by: Nicolas Dichtel --- include/uapi/linux/bpf.h | 2 +- tools/include/uapi/linux/bpf.h | 2 +- 2 files changed, 2

Re: [PATCH rdma-next v1 0/4] Scatter to CQE

2018-10-17 Thread Doug Ledford
On Tue, 2018-10-16 at 22:00 +0300, Leon Romanovsky wrote: > On Tue, Oct 16, 2018 at 02:39:01PM -0400, Doug Ledford wrote: > > On Tue, 2018-10-09 at 12:05 +0300, Leon Romanovsky wrote: > > > From: Leon Romanovsky > > > > > > Changelog v0->v1: > > > * Changed patch #3 to use check_mask function

Re: [PATCH bpf-next 2/3] bpf: emit RECORD_MMAP events for bpf prog load/unload

2018-10-17 Thread David Ahern
On 10/16/18 11:43 PM, Song Liu wrote: > I agree that processing events while recording has significant overhead. > In this case, perf user space need to know details about the the jited BPF > program. It is impossible to pass all these details to user space through > the relatively stable

Re: [PATCH bpf-next 0/3] improve and fix barriers for walking perf rb

2018-10-17 Thread Arnaldo Carvalho de Melo
Em Wed, Oct 17, 2018 at 04:41:53PM +0200, Daniel Borkmann escreveu: > This set first adds smp_* barrier variants to tools infrastructure > and in a second step updates perf and libbpf to make use of them. > For details, please see individual patches, thanks! > > Arnaldo, if there are no

Re: [PATCH net] sctp: not free the new asoc when sctp_wait_for_connect returns err

2018-10-17 Thread Marcelo Ricardo Leitner
On Wed, Oct 17, 2018 at 03:06:12AM +0800, Xin Long wrote: > When sctp_wait_for_connect is called to wait for connect ready > for sp->strm_interleave in sctp_sendmsg_to_asoc, a panic could > be triggered if cpu is scheduled out and the new asoc is freed > elsewhere, as it will return err and later

Re: [PATCH bpf-next v2 4/8] tls: convert to generic sk_msg interface

2018-10-17 Thread Eric Dumazet
On 10/12/2018 05:45 PM, Daniel Borkmann wrote: > Convert kTLS over to make use of sk_msg interface for plaintext and > encrypted scattergather data, so it reuses all the sk_msg helpers > and data structure which later on in a second step enables to glue > this to BPF. > > This also allows to

Re: Bug in MACSec - stops passing traffic after approx 5TB

2018-10-17 Thread Josh Coombs
I see it reusing SAs, so I'm good. Joshua Coombs On Wed, Oct 17, 2018 at 9:45 AM Josh Coombs wrote: > > I've got wpa_supplicant working with macsec on Fedora, my test bed has > shuffled 16 billion packets so far without interruption. I am a bit > concerned that I've just pushed the resource

[PATCH bpf-next 3/3] bpf, libbpf: use proper barriers in perf ring buffer walk

2018-10-17 Thread Daniel Borkmann
Add bpf_perf_read_head() and bpf_perf_write_tail() helpers to make it more clear in what context barriers are used here, and use smp_rmb() as well as smp_mb() barriers. Given libbpf is not restricted to x86-64 only, the compiler barrier needs to be replaced with smp_rmb(). Also the

[PATCH bpf-next 0/3] improve and fix barriers for walking perf rb

2018-10-17 Thread Daniel Borkmann
This set first adds smp_* barrier variants to tools infrastructure and in a second step updates perf and libbpf to make use of them. For details, please see individual patches, thanks! Arnaldo, if there are no objections, could this be routed via bpf-next with Acked-by's due to later dependencies

[PATCH bpf-next 2/3] tools, perf: use smp_{rmb,mb} barriers instead of {rmb,mb}

2018-10-17 Thread Daniel Borkmann
Switch both rmb()/mb() barriers to more lightweight smp_rmb()/smp_mb() ones. When walking the perf ring buffer they pair the following way, quoting kernel/events/ring_buffer.c: Since the mmap() consumer (userspace) can run on a different CPU: kernel user

[PATCH bpf-next 1/3] tools: add smp_* barrier variants to include infrastructure

2018-10-17 Thread Daniel Borkmann
Add the definition for smp_rmb(), smp_wmb(), and smp_mb() to the tools include infrastructure. This patch adds the implementation for x86-64 and arm64, and have it fall back for other archs which do not have it implemented at this point such that others can be added successively for those who have

[PATCH bpf] bpf: fix doc of bpf_skb_adjust_room() in uapi

2018-10-17 Thread Nicolas Dichtel
len_diff is signed. Fixes: fa15601ab31e ("bpf: add documentation for eBPF helpers (33-41)") CC: Quentin Monnet Signed-off-by: Nicolas Dichtel --- include/uapi/linux/bpf.h | 2 +- tools/include/uapi/linux/bpf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

Re: Bug in MACSec - stops passing traffic after approx 5TB

2018-10-17 Thread Josh Coombs
I've got wpa_supplicant working with macsec on Fedora, my test bed has shuffled 16 billion packets so far without interruption. I am a bit concerned that I've just pushed the resource exhaustion issue down the road though, looking at the output of ip macsec show I see four SAs for TX and RX, it

[PATCH net] sctp: fix the data size calculation in sctp_data_size

2018-10-17 Thread Xin Long
sctp data size should be calculated by subtracting data chunk header's length from chunk_hdr->length, not just data header. Fixes: 668c9beb9020 ("sctp: implement assign_number for sctp_stream_interleave") Signed-off-by: Xin Long --- include/net/sctp/sm.h | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH bpf-next 2/3] bpf: emit RECORD_MMAP events for bpf prog load/unload

2018-10-17 Thread Arnaldo Carvalho de Melo
Em Wed, Oct 17, 2018 at 09:11:40AM -0300, Arnaldo Carvalho de Melo escreveu: > Adding Alexey, Jiri and Namhyung as they worked/are working on > multithreading 'perf record'. > > Em Tue, Oct 16, 2018 at 11:43:11PM -0700, Song Liu escreveu: > > On Tue, Oct 16, 2018 at 4:43 PM David Ahern wrote: >

[PATCH V1 net-next] net: ena: enable Low Latency Queues

2018-10-17 Thread akiyano
From: Arthur Kiyanovski Use the new API to enable usage of LLQ. Signed-off-by: Arthur Kiyanovski --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c

Re: [PATCH bpf-next 2/3] bpf: emit RECORD_MMAP events for bpf prog load/unload

2018-10-17 Thread Arnaldo Carvalho de Melo
Adding Alexey, Jiri and Namhyung as they worked/are working on multithreading 'perf record'. Em Tue, Oct 16, 2018 at 11:43:11PM -0700, Song Liu escreveu: > On Tue, Oct 16, 2018 at 4:43 PM David Ahern wrote: > > On 10/15/18 4:33 PM, Song Liu wrote: > > > I am working with Alexei on the idea of

Application of f8b39039cbf2a15f ("net: fs_enet: do not call phy_stop() in interrupts") to 4.9 and 4.14 stable

2018-10-17 Thread Christophe LEROY
Hi, Could you please apply f8b39039cbf2a15f2b8c9f081e1cbd5dee00aaf5 to 4.9 and 4.14 ? It fixes an Oops when Ethernet transmission times out. As you can observe in the commit log, the Oops what initially observed in 4.9. The fix has been in mainline since 4.15 Thanks Christophe

Re: [PATCH bpf-next v2 13/13] tools/bpf: bpftool: add support for jited func types

2018-10-17 Thread Edward Cree
On 17/10/18 08:24, Yonghong Song wrote: > This patch added support to print function signature > if btf func_info is available. Note that ksym > now uses function name instead of prog_name as > prog_name has a limit of 16 bytes including > ending '\0'. > > The following is a sample output for

Re: [PATCH bpf-next v2 00/13] bpf: add btf func info support

2018-10-17 Thread Edward Cree
I think the BTF work needs to be better documented; at the moment the only way  to determine how BTF sections are structured is to read through the headers,  and cross-reference with the DWARF spec to guess at the semantics of various  fields.  I've been working on adding BTF support to ebpf_asm,

[PATCH V2 net-next] net: ena: Fix Kconfig dependency on X86

2018-10-17 Thread netanel
From: Netanel Belgazal The Kconfig limitation of X86 is to too wide. The ENA driver only requires a little endian dependency. Change the dependency to be on little endian CPU. Signed-off-by: Netanel Belgazal --- drivers/net/ethernet/amazon/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH net-next] net: ena: Fix Kconfig dependencies X86

2018-10-17 Thread Belgazal, Netanel
Sure. Removing them and resubmit. On 10/17/18, 11:37 AM, "Sergei Shtylyov" wrote: Hello! On 17.10.2018 11:16, neta...@amazon.com wrote: > From: Netanel Belgazal > > The Kconfig limitation of X86 is to too wide. > The ENA driver only requires a little endian

[PATCH net] udp6: fix encap return code for resubmitting

2018-10-17 Thread Paolo Abeni
The commit eb63f2964dbe ("udp6: add missing checks on edumux packet processing") used the same return code convention of the ipv4 counterpart, but ipv6 uses the opposite one: positive values means resubmit. This change addresses the issue, using positive return value for resubmitting. Also update

Details.

2018-10-17 Thread Smadar Barber-Tsadik
My name is Smadar Barber-Tsadik, I'm the Chief Executive Officer (C.P.A) of the First International Bank of Israel (FIBI). I'm getting in touch with you in regards to a very important and urgent matter. Kindly respond back at your earliest convenience so I can provide you the details.

Re: [PATCH net-next] net: ena: Fix Kconfig dependencies X86

2018-10-17 Thread Sergei Shtylyov
Hello! On 17.10.2018 11:16, neta...@amazon.com wrote: From: Netanel Belgazal The Kconfig limitation of X86 is to too wide. The ENA driver only requires a little endian dependency. Change the dependency to be on little endian CPU. Signed-off-by: Netanel Belgazal ---

Re: [PATCH] [PATCH net-next] openvswitch: Use correct reply values in datapath and vport ops

2018-10-17 Thread Koichiro Den
On Sat, 2018-09-29 at 11:44 -0700, David Miller wrote: > From: Yifeng Sun > Date: Wed, 26 Sep 2018 11:40:14 -0700 > > > This patch fixes the bug that all datapath and vport ops are returning > > wrong values (OVS_FLOW_CMD_NEW or OVS_DP_CMD_NEW) in their replies. > > > > Signed-off-by: Yifeng

[PATCH net-next] net: ena: Fix Kconfig dependencies X86

2018-10-17 Thread netanel
From: Netanel Belgazal The Kconfig limitation of X86 is to too wide. The ENA driver only requires a little endian dependency. Change the dependency to be on little endian CPU. Signed-off-by: Netanel Belgazal --- drivers/net/ethernet/amazon/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH net] mlxsw: core: Fix use-after-free when flashing firmware during init

2018-10-17 Thread Ido Schimmel
When the switch driver (e.g., mlxsw_spectrum) determines it needs to flash a new firmware version it resets the ASIC after the flashing process. The bus driver (e.g., mlxsw_pci) then registers itself again with mlxsw_core which means (among other things) that the device registers itself again with

[PATCH bpf-next v2 11/13] tools/bpf: refactor to implement btf_get_from_id() in lib/bpf

2018-10-17 Thread Yonghong Song
The function get_btf() is implemented in tools/bpf/bpftool/map.c to get a btf structure given a map_info. This patch refactored this function to be function btf_get_from_id() in tools/lib/bpf so that it can be used later. Signed-off-by: Yonghong Song --- tools/bpf/bpftool/map.c | 68

[PATCH bpf-next v2 10/13] tools/bpf: do not use pahole if clang/llvm can generate BTF sections

2018-10-17 Thread Yonghong Song
Add additional checks in tools/testing/selftests/bpf and samples/bpf such that if clang/llvm compiler can generate BTF sections, do not use pahole. Signed-off-by: Yonghong Song --- samples/bpf/Makefile | 8 tools/testing/selftests/bpf/Makefile | 8 2 files

[PATCH bpf-next v2 13/13] tools/bpf: bpftool: add support for jited func types

2018-10-17 Thread Yonghong Song
This patch added support to print function signature if btf func_info is available. Note that ksym now uses function name instead of prog_name as prog_name has a limit of 16 bytes including ending '\0'. The following is a sample output for selftests test_btf with file test_btf_haskv.o: $

[PATCH bpf-next v2 12/13] tools/bpf: enhance test_btf file testing to test func info

2018-10-17 Thread Yonghong Song
Change the bpf programs test_btf_haskv.c and test_btf_nokv.c to have two sections, and enhance test_btf.c test_file feature to test btf func_info returned by the kernel. Signed-off-by: Yonghong Song --- tools/testing/selftests/bpf/test_btf.c | 72 +++-

[PATCH bpf-next v2 06/13] tools/bpf: sync kernel uapi bpf.h header to tools directory

2018-10-17 Thread Yonghong Song
The kernel uapi bpf.h is synced to tools directory. Signed-off-by: Yonghong Song --- tools/include/uapi/linux/bpf.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index f9187b41dff6..7ebbf4f06a65 100644 ---

[PATCH bpf-next v2 09/13] tools/bpf: add support to read .BTF.ext sections

2018-10-17 Thread Yonghong Song
The .BTF section is already available to encode types. These types can be used for map pretty print. The whole .BTF will be passed to the kernel as well for which kernel can verify and return to the user space for pretty print etc. The llvm patch at https://reviews.llvm.org/D53261 will generate

[PATCH bpf-next v2 07/13] tools/bpf: add new fields for program load in lib/bpf

2018-10-17 Thread Yonghong Song
The new fields are added for program load in lib/bpf so application uses api bpf_load_program_xattr() is able to load program with btf and func_info data. This functionality will be used in next patch by bpf selftest test_btf. Signed-off-by: Yonghong Song --- tools/lib/bpf/bpf.c | 3 +++

[PATCH bpf-next v2 00/13] bpf: add btf func info support

2018-10-17 Thread Yonghong Song
The BTF support was added to kernel by Commit 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)"), which introduced .BTF section into ELF file and is primarily used for map pretty print. pahole is used to convert dwarf to BTF for ELF files. This patch added func info support to the kernel

[PATCH bpf-next v2 01/13] bpf: btf: Break up btf_type_is_void()

2018-10-17 Thread Yonghong Song
This patch breaks up btf_type_is_void() into btf_type_is_void() and btf_type_is_fwd(). It also adds btf_type_nosize() to better describe it is testing a type has nosize info. Signed-off-by: Martin KaFai Lau Signed-off-by: Yonghong Song --- kernel/bpf/btf.c | 37

[PATCH bpf-next v2 03/13] tools/bpf: sync kernel btf.h header

2018-10-17 Thread Yonghong Song
The kernel uapi btf.h is synced to the tools directory. Signed-off-by: Martin KaFai Lau Signed-off-by: Yonghong Song --- tools/include/uapi/linux/btf.h | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/include/uapi/linux/btf.h b/tools/include/uapi/linux/btf.h

[PATCH bpf-next v2 08/13] tools/bpf: extends test_btf to test load/retrieve func_type info

2018-10-17 Thread Yonghong Song
A two function bpf program is loaded with btf and func_info. After successful prog load, the bpf_get_info syscall is called to retrieve prog info to ensure the types returned from the kernel matches the types passed to the kernel from the user space. Several negative tests are also added to test

[PATCH bpf-next v2 05/13] bpf: get better bpf_prog ksyms based on btf func type_id

2018-10-17 Thread Yonghong Song
This patch added interface to load a program with the following additional information: . prog_btf_fd . func_info and func_info_len where func_info will provides function range and type_id corresponding to each function. If verifier agrees with function range provided by the user, the

[PATCH bpf-next v2 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-17 Thread Yonghong Song
This patch adds BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO support to the type section. BTF_KIND_FUNC_PROTO is used to specify the type of a function pointer. With this, BTF has a complete set of C types (except float). BTF_KIND_FUNC is used to specify the signature of a defined subprogram.

[PATCH bpf-next v2 04/13] tools/bpf: add btf func/func_proto unit tests in selftest test_btf

2018-10-17 Thread Yonghong Song
Add several BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO unit tests in bpf selftest test_btf. Signed-off-by: Martin KaFai Lau Signed-off-by: Yonghong Song --- tools/lib/bpf/btf.c| 4 + tools/testing/selftests/bpf/test_btf.c | 216 + 2 files changed, 220

Re: [PATCH bpf-next 2/3] bpf: emit RECORD_MMAP events for bpf prog load/unload

2018-10-17 Thread Song Liu
Hi David, On Tue, Oct 16, 2018 at 4:43 PM David Ahern wrote: > > On 10/15/18 4:33 PM, Song Liu wrote: > > I am working with Alexei on the idea of fetching BPF program information via > > BPF_OBJ_GET_INFO_BY_FD cmd. I added PERF_RECORD_BPF_EVENT > > to perf_event_type, and dumped these events to

Re: [PATCH] net-xfrm: add build time cfg option to PF_KEY SHA256 to use RFC4868-compliant truncation

2018-10-17 Thread Maciej Żenczykowski
I'm afraid it's nothing we're using. It's what people are using. I guess we'll just carry this patch for a few more years.

Re: [PATCH] net-xfrm: add build time cfg option to PF_KEY SHA256 to use RFC4868-compliant truncation

2018-10-17 Thread Herbert Xu
Maciej Żenczykowski wrote: > > +#if IS_ENABLED(CONFIG_XFRM_HMAC_SHA256_RFC4868) > + .icv_truncbits = 128, > +#else >.icv_truncbits = 96, > +#endif Nack. We don't want a build-time configuration knob for this. This needs to be decided at run-time.

<    1   2