Re: [PATCH bpf-next] selftests/bpf: remove generated verifier/tests.h on 'make clean'

2019-02-01 Thread Y Song
On Fri, Feb 1, 2019 at 3:49 PM Stanislav Fomichev wrote: > > 'make clean' is supposed to remove generated files. > > Signed-off-by: Stanislav Fomichev Acked-by: Yonghong Song > --- > tools/testing/selftests/bpf/Makefile | 8 +--- > 1 file changed, 5 insertions(+), 3 deletions(-) >

Re: [PATCH bpf-next 0/2] nfp: bpf: shifts support cleanups

2019-02-01 Thread Alexei Starovoitov
On Fri, Feb 01, 2019 at 10:39:27PM +, Jiong Wang wrote: > NFP JIT back-end is missing several ALU32 logic shifts support. > > Also, shifts with shift amount be zero are not handled properly. > > This set cleans up these issues. Applied, Thanks

[PATCH net-next] bonding: check slave set command firstly

2019-02-01 Thread xiangxia . m . yue
From: Tonghao Zhang This patch is a little improvement. If user use the command shown as below, we should print the info [1] instead of [2]. The eth0 exists actually, and it may confuse user. $ echo "eth0" > /sys/class/net/bond4/bonding/slaves [1] "bond4: no command found in slaves file - use +

Re: [RFC net-next 11/13] nfp: Handle SWITCHDEV_PORT_ATTR_GET event

2019-02-01 Thread Florian Fainelli
Le 2/1/19 à 7:45 PM, Jakub Kicinski a écrit : > On Fri, 1 Feb 2019 14:06:55 -0800, Florian Fainelli wrote: >> Following patches will change the way we communicate getting or setting >> a port's attribute and use a blocking notifier to perform those tasks. >> >> Prepare nfp to support receiving not

[PATCH net-next] net: Fix ip_mc_{dec,inc}_group allocation context

2019-02-01 Thread Florian Fainelli
After 4effd28c1245 ("bridge: join all-snoopers multicast address"), I started seeing the following sleep in atomic warnings: [ 26.763893] BUG: sleeping function called from invalid context at mm/slab.h:421 [ 26.771425] in_atomic(): 1, irqs_disabled(): 0, pid: 1658, name: sh [ 26.777855] INF

Re: pull-request: bpf-next 2019-02-01

2019-02-01 Thread David Miller
From: Alexei Starovoitov Date: Fri, 1 Feb 2019 18:14:32 -0800 > The following pull-request contains BPF updates for your *net-next* tree. > > The main changes are: > > 1) introduce bpf_spin_lock, from Alexei. > > 2) convert xdp samples to libbpf, from Maciej. > > 3) skip verifier tests for un

Re: [RFC net-next 11/13] nfp: Handle SWITCHDEV_PORT_ATTR_GET event

2019-02-01 Thread Jakub Kicinski
On Fri, 1 Feb 2019 14:06:55 -0800, Florian Fainelli wrote: > Following patches will change the way we communicate getting or setting > a port's attribute and use a blocking notifier to perform those tasks. > > Prepare nfp to support receiving notifier events targeting > SWITCHDEV_PORT_ATTR_GET an

Re: [PATCH net-next v4 02/12] socket: move compat timeout handling into sock.c

2019-02-01 Thread Deepa Dinamani
> On Feb 2, 2019, at 12:28 AM, Willem de Bruijn > wrote: > >> On Fri, Feb 1, 2019 at 7:48 AM Deepa Dinamani wrote: >> >> From: Arnd Bergmann >> >> This is a cleanup to prepare for the addition of 64-bit time_t >> in O_SNDTIMEO/O_RCVTIMEO. The existing compat handler seems >> unnecessarily

[v2, 7/9] ptp: add QorIQ PTP support for ENETC

2019-02-01 Thread Yangbo Lu
This patch is to add QorIQ PTP support for ENETC. ENETC PTP driver which is a PCI driver for same 1588 timer IP block will reuse QorIQ PTP driver. Signed-off-by: Yangbo Lu --- Chanbges for v2: - None. --- drivers/ptp/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) di

[v2, 9/9] MAINTAINERS: add enetc_ptp driver into QorIQ PTP list

2019-02-01 Thread Yangbo Lu
This patch to add enetc_ptp driver into QorIQ PTP list for maintaining. Signed-off-by: Yangbo Lu --- Changes for v2: - None. --- MAINTAINERS |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 019a2bc..f0b50f8 100644 --- a/MAINTAINERS

[v2, 8/9] enetc: add PTP clock driver

2019-02-01 Thread Yangbo Lu
This patch is to add PTP clock driver for ENETC. The driver reused QorIQ PTP clock driver. Signed-off-by: Yangbo Lu --- Changes for v2: - None. --- drivers/net/ethernet/freescale/enetc/Kconfig | 12 ++ drivers/net/ethernet/freescale/enetc/Makefile|3 + drivers/net/ethernet/

[v2, 3/9] ptp_qoriq: convert to use ptp_qoriq_init()

2019-02-01 Thread Yangbo Lu
Moved QorIQ PTP clock initialization into new function qoriq_ptp_init(). This function could also be reused by ENETC PTP drvier which is a PCI driver for same 1588 timer IP block. Signed-off-by: Yangbo Lu --- Changes for v2: - None. --- drivers/ptp/ptp_qoriq.c | 120 ++

[v2, 5/9] dt-binding: ptp_qoriq: add little-endian support

2019-02-01 Thread Yangbo Lu
Specify "little-endian" property if the 1588 timer IP block is little-endian mode. The default endian mode is big-endian. Signed-off-by: Yangbo Lu --- Changes for v2: - None. --- .../devicetree/bindings/ptp/ptp-qoriq.txt |3 +++ 1 files changed, 3 insertions(+), 0 deletions(

[v2, 4/9] ptp_qoriq: add little enadian support

2019-02-01 Thread Yangbo Lu
There is QorIQ 1588 timer IP block on the new ENETC Ethernet controller. However it uses little endian mode which is different with before. This patch is to add little endian support for the driver by using "little-endian" dts node property. Signed-off-by: Yangbo Lu --- Changes for v2: -

[v2, 1/9] ptp_qoriq: make structure/function names more consistent

2019-02-01 Thread Yangbo Lu
Strings containing "ptp_qoriq" or "qoriq_ptp" which were used for structure/function names were complained by users. Let's just use the unique "ptp_qoriq" to make these names more consistent. This patch is just to unify the names using "ptp_qoriq". It hasn't changed any functions. Signed-off-by: Y

[v2, 6/9] ptp_qoriq: fix register memory map

2019-02-01 Thread Yangbo Lu
The 1588 timer on eTSEC Ethernet controller uses different register memory map with DPAA Ethernet controller. Now the new ENETC Ethernet controller uses same reigster memory map with DPAA. To support ENETC, let's use register memory map of DPAA/ENETC in default. Signed-off-by: Yangbo Lu --- Chang

[v2, 0/9] Add ENETC PTP clock driver

2019-02-01 Thread Yangbo Lu
There is same QorIQ 1588 timer IP block on the new ENETC Ethernet controller with eTSEC/DPAA Ethernet controllers. However it's different endianness (little-endian) and using PCI driver. To support ENETC PTP driver, ptp_qoriq driver needed to be reworked to make functions global for reusing, to ad

[v2, 2/9] ptp_qoriq: make ptp operations global

2019-02-01 Thread Yangbo Lu
This patch is to make functions of ptp operations global, so that ENETC PTP driver which is a PCI driver for same 1588 timer IP block could reuse them. Signed-off-by: Yangbo Lu --- Changes for v2: - None. --- drivers/ptp/ptp_qoriq.c | 27 --- include/linux

[net-next RFC/PATCH] net: nixge: Make mdio child node optional

2019-02-01 Thread Moritz Fischer
Make MDIO child optional and only instantiate the MDIO bus if the child is actually present. There are currently no (in-tree) users of this binding; all (out-of-tree) users use overlays that get shipped together with the FPGA images that contain the IP. This will significantly increase maintainab

Re: [PATCH v2] net: dp83640: expire old TX-skb

2019-02-01 Thread Richard Cochran
On Fri, Feb 01, 2019 at 10:09:18PM +0100, Sebastian Andrzej Siewior wrote: > During sendmsg() a cloned skb is saved via dp83640_txtstamp() in > ->tx_queue. After the NIC sends this packet, the PHY will reply with a > timestamp for that TX packet. If the cable is pulled at the right time I > don't s

Re: [PATCH bpf-next 1/6] bpf: Add a bpf_sock pointer to __sk_buff and a bpf_sk_fullsock helper

2019-02-01 Thread Alexei Starovoitov
On Thu, Jan 31, 2019 at 11:03:56PM -0800, Martin KaFai Lau wrote: > In kernel, it is common to check "!skb->sk && sk_fullsock(skb->sk)" > before accessing the fields in sock. For example, in __netdev_pick_tx: > > static u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb, >

pull-request: bpf-next 2019-02-01

2019-02-01 Thread Alexei Starovoitov
Hi David, The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) introduce bpf_spin_lock, from Alexei. 2) convert xdp samples to libbpf, from Maciej. 3) skip verifier tests for unsupported program/map types, from Stanislav. 4) powerpc64 JIT support

[PATCH net-next] net: devlink: report cell size of shared buffers

2019-02-01 Thread Jakub Kicinski
Shared buffer allocation is usually done in cell increments. Drivers will either round up the allocation or refuse the configuration if it's not an exact multiple of cell size. Drivers know exactly the cell size of shared buffer, so help out users by providing this information in dumps. Signed-off

Re: [RFC net-next 08/13] liquidio: Handle SWITCHDEV_PORT_ATTR_GET event

2019-02-01 Thread Felix Manlunas
On Fri, 1 Feb 2019 14:06:52 -0800, Florian Fainelli wrote: > Following patches will change the way we communicate getting or setting > a port's attribute and use a blocking notifier to perform those tasks. > > Prepare bnxt to support receiving notifier events targeting The code portion is fine (

RE: [PATCH 2/2] igb: Exclude device from suspend direct complete optimization

2019-02-01 Thread Brown, Aaron F
> From: netdev-ow...@vger.kernel.org [mailto:netdev- > ow...@vger.kernel.org] On Behalf Of Kai-Heng Feng > Sent: Tuesday, December 11, 2018 12:00 AM > To: Kirsher, Jeffrey T > Cc: da...@davemloft.net; intel-wired-...@lists.osuosl.org; > netdev@vger.kernel.org; linux-ker...@vger.kernel.org; Kai-Hen

[PATCH bpf-next v4 0/3] tools/bpf: changes of libbpf debug interfaces

2019-02-01 Thread Yonghong Song
These are patches responding to my comments for Magnus's patch (https://patchwork.ozlabs.org/patch/1032848/). The goal is to make pr_* macros available to other C files than libbpf.c, and to simplify API function libbpf_set_print(). Specifically, Patch #1 used global functions to facilitate pr_* m

[PATCH bpf-next v4 1/3] tools/bpf: move libbpf pr_* debug print functions to headers

2019-02-01 Thread Yonghong Song
A global function libbpf_print, which is invisible outside the shared library, is defined to print based on levels. The pr_warning, pr_info and pr_debug macros are moved into the newly created header common.h. So any .c file including common.h can use these macros directly. Currently btf__new and

[PATCH bpf-next v4 2/3] tools/bpf: print out btf log at LIBBPF_WARN level

2019-02-01 Thread Yonghong Song
Currently, the btf log is allocated and printed out in case of error at LIBBPF_DEBUG level. Such logs from kernel are very important for debugging. For example, bpf syscall BPF_PROG_LOAD command can get verifier logs back to user space. In function load_program() of libbpf.c, the log buffer is allo

[PATCH bpf-next v4 3/3] tools/bpf: simplify libbpf API function libbpf_set_print()

2019-02-01 Thread Yonghong Song
Currently, the libbpf API function libbpf_set_print() takes three function pointer parameters for warning, info and debug printout respectively. This patch changes the API to have just one function pointer parameter and the function pointer has one additional parameter "debugging level". So if in

[PATCH iproute2-next] devlink: add info subcommand

2019-02-01 Thread Jakub Kicinski
Add support for reading the device serial number and versions from the kernel. RFCv2: - make info subcommand of dev. Signed-off-by: Jakub Kicinski --- devlink/devlink.c | 207 + man/man8/devlink-dev.8 | 36 +++ 2 files changed, 243 insertions(+

RE: [PATCH] igb: fix various indentation issues

2019-02-01 Thread Brown, Aaron F
> From: netdev-ow...@vger.kernel.org [mailto:netdev- > ow...@vger.kernel.org] On Behalf Of Colin King > Sent: Wednesday, January 16, 2019 10:53 AM > To: Kirsher, Jeffrey T ; David S . Miller > ; intel-wired-...@lists.osuosl.org; > netdev@vger.kernel.org > Cc: kernel-janit...@vger.kernel.org; linux-

Re: [PATCH bpf-next v3 1/3] tools/bpf: move libbpf pr_* debug print functions to headers

2019-02-01 Thread Yonghong Song
On 2/1/19 2:52 PM, Alexei Starovoitov wrote: > On Fri, Feb 01, 2019 at 02:06:16PM -0800, Yonghong Song wrote: >> A global function libbpf_debug_print, which is invisible >> outside the shared library, is defined to print based >> on levels. The pr_warning, pr_info and pr_debug >> macros are moved

Re: [PATCH] bpfilter: remove extra header search paths for bpfilter_umh

2019-02-01 Thread Alexei Starovoitov
On Thu, Jan 31, 2019 at 12:15:35PM +0900, Masahiro Yamada wrote: > Currently, the header search paths -Itools/include and > -Itools/include/uapi are not used. Let's drop the unused code. > > We can remove -I. too by fixing up one C file. > > Signed-off-by: Masahiro Yamada > --- > > Perhaps, are

Re: [PATCH bpf-next] selftests/bpf: remove generated verifier/tests.h on 'make clean'

2019-02-01 Thread Alexei Starovoitov
On Fri, Feb 01, 2019 at 03:47:38PM -0800, Jakub Kicinski wrote: > On Fri, 1 Feb 2019 15:46:38 -0800, Stanislav Fomichev wrote: > > 'make clean' is supposed to remove generated files. > > > > Signed-off-by: Stanislav Fomichev > > Acked-by: Jakub Kicinski Applied, Thanks

Re: [PATCH bpf-next] selftests/bpf: remove generated verifier/tests.h on 'make clean'

2019-02-01 Thread Jakub Kicinski
On Fri, 1 Feb 2019 15:46:38 -0800, Stanislav Fomichev wrote: > 'make clean' is supposed to remove generated files. > > Signed-off-by: Stanislav Fomichev Acked-by: Jakub Kicinski Ah, thanks!

[PATCH bpf-next] selftests/bpf: remove generated verifier/tests.h on 'make clean'

2019-02-01 Thread Stanislav Fomichev
'make clean' is supposed to remove generated files. Signed-off-by: Stanislav Fomichev --- tools/testing/selftests/bpf/Makefile | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 8993e9c8f4

Re: [PATCH net-next v4 0/8] devlink: add device (driver) information API

2019-02-01 Thread David Miller
From: Jakub Kicinski Date: Thu, 31 Jan 2019 10:50:39 -0800 > fw_version field in ethtool -i does not suit modern needs with 31 > characters being quite limiting on more complex systems. There is > also no distinction between the running and flashed versions of > the firmware. > > Since the driv

Re: [PATCH bpf-next v2 1/3] tools/bpf: move libbpf pr_* debug print functions to headers

2019-02-01 Thread Arnaldo Carvalho de Melo
Em Fri, Feb 01, 2019 at 11:20:44PM +, Yonghong Song escreveu: > On 2/1/19 3:10 PM, Arnaldo Carvalho de Melo wrote: > > Em Fri, Feb 01, 2019 at 09:47:31AM -0800, Yonghong Song escreveu: > >> @@ -698,13 +695,13 @@ struct btf_ext *btf_ext__new(__u8 *data, __u32 size, > >> btf_print_fn_t err_log)

RE: [PATCH] e1000e: fix cyclic resets at link up with active tx

2019-02-01 Thread Brown, Aaron F
> -Original Message- > From: netdev-ow...@vger.kernel.org [mailto:netdev- > ow...@vger.kernel.org] On Behalf Of Konstantin Khlebnikov > Sent: Monday, January 14, 2019 5:30 AM > To: netdev@vger.kernel.org; intel-wired-...@lists.osuosl.org; Kirsher, > Jeffrey T > Cc: linux-ker...@vger.kern

Re: pull-request: bpf 2019-01-31

2019-02-01 Thread David Miller
From: Alexei Starovoitov Date: Thu, 31 Jan 2019 14:50:40 -0800 > The following pull-request contains BPF updates for your *net* tree. > > The main changes are: > > 1) disable preemption in sender side of socket filters, from Alexei. > > 2) fix two potential deadlocks in syscall bpf lookup and

Re: [PATCH net-next 00/11] selftests: Various fixes

2019-02-01 Thread David Miller
From: Petr Machata Date: Thu, 31 Jan 2019 22:35:08 + > This patch set contains various fixes whose common denominator is > improving quality of forwarding and mlxsw selftests. > > Most of the fixes are improvements in determinism (such that timing and > latency don't impact the test performa

Re: [PATCH v2] ipconfig: add carrier_timeout kernel parameter

2019-02-01 Thread David Miller
From: Martin Kepplinger Date: Thu, 31 Jan 2019 11:14:18 +0100 > commit 3fb72f1e6e61 ("ipconfig wait for carrier") added a > "wait for carrier" policy, with a fixed worst case maximum wait > of two minutes. > > Now make the wait for carrier timeout configurable on the kernel > commandline and use

Re: [PATCH net-next] tulip: eeprom: use struct_size() in kmalloc()

2019-02-01 Thread David Miller
From: "Gustavo A. R. Silva" Date: Wed, 30 Jan 2019 18:33:55 -0600 > One of the more common cases of allocation size calculations is finding > the size of a structure that has a zero-sized array at the end, along > with memory for some number of elements for that array. For example: > > struct fo

Re: [PATCH net-next] ipv4: fib: use struct_size() in kzalloc()

2019-02-01 Thread David Miller
From: "Gustavo A. R. Silva" Date: Wed, 30 Jan 2019 18:51:48 -0600 > One of the more common cases of allocation size calculations is finding > the size of a structure that has a zero-sized array at the end, along > with memory for some number of elements for that array. For example: > > struct fo

Re: [PATCH net-next] net: tls: Set async_capable for tls zerocopy only if we see EINPROGRESS

2019-02-01 Thread David Miller
From: Dave Watson Date: Wed, 30 Jan 2019 22:08:21 + > Currently we don't zerocopy if the crypto framework async bit is set. > However some crypto algorithms (such as x86 AESNI) support async, > but in the context of sendmsg, will never run asynchronously. Instead, > check for actual EINPROGR

Re: [PATCH net-next] cxgb4: smt: use struct_size() in kvzalloc()

2019-02-01 Thread David Miller
From: "Gustavo A. R. Silva" Date: Wed, 30 Jan 2019 18:27:44 -0600 > One of the more common cases of allocation size calculations is > finding the size of a structure that has a zero-sized array at > the end, along with memory for some number of elements for that > array. For example: > > struct

Re: [PATCH net-next] cxgb4: sched: use struct_size() in kvzalloc()

2019-02-01 Thread David Miller
From: "Gustavo A. R. Silva" Date: Wed, 30 Jan 2019 18:23:14 -0600 > One of the more common cases of allocation size calculations is > finding the size of a structure that has a zero-sized array at > the end, along with memory for some number of elements for that > array. For example: > > struct

Re: [PATCH net-next] nfp: use struct_size() in kzalloc()

2019-02-01 Thread David Miller
From: "Gustavo A. R. Silva" Date: Wed, 30 Jan 2019 18:38:59 -0600 > One of the more common cases of allocation size calculations is finding > the size of a structure that has a zero-sized array at the end, along > with memory for some number of elements for that array. For example: > > struct fo

Re: [PATCH 0/9] Add ENETC PTP clock driver

2019-02-01 Thread David Miller
From: David Miller Date: Fri, 01 Feb 2019 15:17:02 -0800 (PST) > From: Yangbo Lu > Date: Thu, 31 Jan 2019 10:33:01 +0800 > >> There is same QorIQ 1588 timer IP block on the new ENETC Ethernet >> controller with eTSEC/DPAA Ethernet controllers. However it's >> different endianness (little-endian

Re: [PATCH bpf-next v2 1/3] tools/bpf: move libbpf pr_* debug print functions to headers

2019-02-01 Thread Yonghong Song
On 2/1/19 3:10 PM, Arnaldo Carvalho de Melo wrote: > Em Fri, Feb 01, 2019 at 09:47:31AM -0800, Yonghong Song escreveu: >> @@ -698,13 +695,13 @@ struct btf_ext *btf_ext__new(__u8 *data, __u32 size, >> btf_print_fn_t err_log) >> if (!btf_ext) >> return ERR_PTR(-ENOMEM); >> >>

Re: [PATCH] stable-kernel-rules.rst: add link to networking patch queue

2019-02-01 Thread Jonathan Corbet
On Tue, 22 Jan 2019 19:46:32 +0100 Greg Kroah-Hartman wrote: > The networking maintainer keeps a public list of the patches being > queued up for the next round of stable releases. Be sure to check there > before asking for a patch to be applied so that you do not waste > people's time. > > Sig

Re: [PATCH 0/9] Add ENETC PTP clock driver

2019-02-01 Thread David Miller
From: Yangbo Lu Date: Thu, 31 Jan 2019 10:33:01 +0800 > There is same QorIQ 1588 timer IP block on the new ENETC Ethernet > controller with eTSEC/DPAA Ethernet controllers. However it's > different endianness (little-endian) and using PCI driver. > > To support ENETC PTP driver, ptp_qoriq driver

Re: Co-existing XDP generic and native mode? (Re: [PATCH bpf-next v5 5/8] xdp: Provide extack messages when prog attachment failed)

2019-02-01 Thread Daniel Borkmann
On 02/01/2019 10:44 PM, Jakub Kicinski wrote: [...] > diff --git a/net/core/dev.c b/net/core/dev.c > index 8e276e0192a1..ce4880e5e95d 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -7976,11 +7976,13 @@ int dev_change_xdp_fd(struct net_device *dev, struct > netlink_ext_ack *extack, >

Re: [PATCH bpf-next v2 1/3] tools/bpf: move libbpf pr_* debug print functions to headers

2019-02-01 Thread Arnaldo Carvalho de Melo
Em Fri, Feb 01, 2019 at 09:47:31AM -0800, Yonghong Song escreveu: > @@ -698,13 +695,13 @@ struct btf_ext *btf_ext__new(__u8 *data, __u32 size, > btf_print_fn_t err_log) > if (!btf_ext) > return ERR_PTR(-ENOMEM); > > - err = btf_ext_copy_func_info(btf_ext, data, size, err_

Re: [PATCH net-next v2 0/5] net: tls: TLS 1.3 support

2019-02-01 Thread David Miller
From: Dave Watson Date: Wed, 30 Jan 2019 21:57:58 + > This patchset adds 256bit keys and TLS1.3 support to the kernel TLS > socket. > > TLS 1.3 is requested by passing TLS_1_3_VERSION in the setsockopt > call, which changes the framing as required for TLS1.3. > > 256bit keys are request

Re: [PATCH bpf-next v5 7/8] libbpf: Add a support for getting xdp prog id on ifindex

2019-02-01 Thread Daniel Borkmann
On 02/01/2019 10:47 PM, Jakub Kicinski wrote: > On Fri, 1 Feb 2019 22:43:39 +0100, Daniel Borkmann wrote: >> On 02/01/2019 01:19 AM, Maciej Fijalkowski wrote: >>> Since we have a dedicated netlink attributes for xdp setup on a >>> particular interface, it is now possible to retrieve the program id

Re: [PATCH bpf-next] bpf: add optional memory accounting for maps

2019-02-01 Thread Alexei Starovoitov
On Fri, Feb 01, 2019 at 01:03:45PM +0200, Martynas wrote: > > > There are nokmem and nosocket memcg boot options. > > We can add one more to turn off accounting of bpf map memory. > > > > Considering the suggested boot option, I'm OK with enabling it by default. Do > you want me to add the opti

Re: [PATCH bpf-next v3 1/3] tools/bpf: move libbpf pr_* debug print functions to headers

2019-02-01 Thread Alexei Starovoitov
On Fri, Feb 01, 2019 at 02:06:16PM -0800, Yonghong Song wrote: > A global function libbpf_debug_print, which is invisible > outside the shared library, is defined to print based > on levels. The pr_warning, pr_info and pr_debug > macros are moved into the newly created header > common.h. So any .c

Re: [PATCH net] dccp: fool proof ccid_hc_[rt]x_parse_options()

2019-02-01 Thread David Miller
From: Eric Dumazet Date: Wed, 30 Jan 2019 11:39:41 -0800 > Similarly to commit 276bdb82dedb ("dccp: check ccid before dereferencing") > it is wise to test for a NULL ccid. ... > Signed-off-by: Eric Dumazet > Reported-by: syzbot > Cc: Gerrit Renker Applied and queued up for -stable.

Re: [PATCH net 0/9] net/smc: fixes 2019-01-30

2019-02-01 Thread David Miller
From: Ursula Braun Date: Wed, 30 Jan 2019 18:50:59 +0100 > here are some fixes in different areas of the smc code for the net > tree. Series applied, thanks.

Re: [PATCH bpf-next v6 0/8] xdp: Avoid unloading xdp prog not attached by sample

2019-02-01 Thread Daniel Borkmann
On 02/01/2019 10:42 PM, Maciej Fijalkowski wrote: > Hi! > This patchset tries to address the situation where: > * user loads a particular xdp sample application that does stats polling > * user loads another sample application on the same interface > * then, user sends SIGINT/SIGTERM to the app tha

Re: [PATCH net] enic: fix checksum validation for IPv6

2019-02-01 Thread David Miller
From: Govindarajulu Varadarajan Date: Wed, 30 Jan 2019 06:59:00 -0800 > In case of IPv6 pkts, ipv4_csum_ok is 0. Because of this, driver does > not set skb->ip_summed. So IPv6 rx checksum is not offloaded. > > Signed-off-by: Govindarajulu Varadarajan Applied and queued up for -stable, thanks.

[PATCH bpf-next 1/2] nfp: bpf: correct the behavior for shifts by zero

2019-02-01 Thread Jiong Wang
Shifts by zero do nothing, and should be treated as nops. Even though compiler is not supposed to generate such instructions and manual written assembly is unlikely to have them, but they are legal instructions and have defined behavior. This patch correct existing shifts code-gen to make sure th

[PATCH bpf-next 0/2] nfp: bpf: shifts support cleanups

2019-02-01 Thread Jiong Wang
NFP JIT back-end is missing several ALU32 logic shifts support. Also, shifts with shift amount be zero are not handled properly. This set cleans up these issues. Jiong Wang (2): nfp: bpf: correct the behavior for shifts by zero nfp: bpf: complete ALU32 shift supports drivers/net/ethernet/n

Re: [PATCH v2 net-next 2/5] exthdrs: Registration of TLV handlers and parameters

2019-02-01 Thread David Miller
From: Tom Herbert Date: Mon, 28 Jan 2019 10:22:52 -0800 > + tpt = vmalloc(tlv_param_table_size(old->count - 1)); > + if (!tpt) > + return -ENOMEM; ... > + tsize = tlv_param_table_size(ARRAY_SIZE(tlv_init_params) + 1); > + > + tpt = vmalloc(tsize); > + if (!tpt) >

[PATCH bpf-next 2/2] nfp: bpf: complete ALU32 logic shift supports

2019-02-01 Thread Jiong Wang
The following ALU32 logic shift supports are missing: BPF_ALU | BPF_LSH | BPF_X BPF_ALU | BPF_RSH | BPF_X BPF_ALU | BPF_RSH | BPF_K For BPF_RSH | BPF_K, it could be implemented using NFP direct shift instruction. For the other BPF_X shifts, NFP indirect shifts sequences need to be used. Se

Re: [PATCH bpf-next v6 2/5] bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap

2019-02-01 Thread Peter Oskolkov
On Fri, Feb 1, 2019 at 1:06 PM Alexei Starovoitov wrote: > > On Fri, Feb 01, 2019 at 09:22:26AM -0800, Peter Oskolkov wrote: > > This patch implements BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap > > BPF helper. It enables BPF programs (specifically, BPF_PROG_TYPE_LWT_IN > > and BPF_PROG_TYPE_LWT_X

[RFC net-next 04/13] mlxsw: spectrum_switchdev: Handle SWITCHDEV_PORT_ATTR_GET/SET

2019-02-01 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare mlxsw to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET/SET and simply translate that into the existing mlxsw_sp_port_attr_{se

[RFC net-next 05/13] net: mscc: ocelot: Handle SWITCHDEV_PORT_ATTR_GET/SET

2019-02-01 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare ocelot to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET/SET and simply translate that into the existing ocelot_port_attr_{set

[RFC net-next 00/13] Get rid of switchdev_ops

2019-02-01 Thread Florian Fainelli
Hi all, This patch series converts SWITCHDEV_PORT_ATTR_{GET,SET} to use a blocking notifier, similar to how SWITCHDEV_PORT_OBJ_{ADD,DEL} has been changed recently by Petr. This was suggested by Ido to help with a particular use case I have where I want to be able to veto a switchdev bridge attrib

[RFC net-next 06/13] staging: fsl-dpaa2: ethsw: Handle SWITCHDEV_PORT_ATTR_GET/SET

2019-02-01 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare ethsw to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET/SET and simply translate that into the existing swdev_port_attr_{set,g

[RFC net-next 02/13] rocker: Handle SWITCHDEV_PORT_ATTR_GET/SET

2019-02-01 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare rocker to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET/SET and simply translate that into the existing rocker_port_attr_{set

[RFC net-next 03/13] net: dsa: Handle SWITCHDEV_PORT_ATTR_GET/SET

2019-02-01 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare DSA to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET/SET and simply translate that into the existing dsa_slave_port_attr_{set

[RFC net-next 07/13] bnxt: Handle SWITCHDEV_PORT_ATTR_GET event

2019-02-01 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare bnxt to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET and simply translate that into the existing switchdev_ops::switchdev_po

[RFC net-next 08/13] liquidio: Handle SWITCHDEV_PORT_ATTR_GET event

2019-02-01 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare bnxt to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET and simply translate that into the existing switchdev_ops::switchdev_po

[RFC net-next 09/13] mlxsw: switchx2: Handle SWITCHDEV_PORT_ATTR_GET event

2019-02-01 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare bnxt to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET and simply translate that into the existing switchdev_ops::switchdev_po

[RFC net-next 10/13] net/mlx5e: Handle SWITCHDEV_PORT_ATTR_GET event

2019-02-01 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare mlx5e/en_rep.c to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET and simply translate that into the existing switchdev_ops::sw

[RFC net-next 11/13] nfp: Handle SWITCHDEV_PORT_ATTR_GET event

2019-02-01 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare nfp to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET and simply translate that into the existing switchdev_ops::switchdev_por

[RFC net-next 13/13] net: switchdev: Replace port attr get/set SDO with a notification

2019-02-01 Thread Florian Fainelli
Drop switchdev_ops.switchdev_port_attr_get and _set. Drop the uses of this field from all clients, which were migrated to use switchdev notification in the previous patches. Add a new function switchdev_port_attr_notify() that sends the switchdev notifications SWITCHDEV_PORT_ATTR_GET and _SET. Up

[RFC net-next 12/13] netdevsim: Handle SWITCHDEV_PORT_ATTR_GET event

2019-02-01 Thread Florian Fainelli
Following patches will change the way we communicate getting or setting a port's attribute and use a blocking notifier to perform those tasks. Prepare netdevsim to support receiving notifier events targeting SWITCHDEV_PORT_ATTR_GET and simply translate that into the existing switchdev_ops::switchd

[RFC net-next 01/13] switchdev: Add SWITCHDEV_PORT_ATTR_SET, SWITCHDEV_PORT_ATTR_GET

2019-02-01 Thread Florian Fainelli
In preparation for allowing switchdev enabled drivers to veto specific attribute settings from within the context of the caller, introduce a new switchdev notifier type for port attributes. Suggested-by: Ido Schimmel Signed-off-by: Florian Fainelli --- include/net/switchdev.h | 10 ++ 1

[PATCH bpf-next v3 2/3] tools/bpf: print out btf log at LIBBPF_WARN level

2019-02-01 Thread Yonghong Song
Currently, the btf log is allocated and printed out in case of error at LIBBPF_DEBUG level. Such logs from kernel are very important for debugging. For example, bpf syscall BPF_PROG_LOAD command can get verifier logs back to user space. In function load_program() of libbpf.c, the log buffer is allo

[PATCH bpf-next v3 3/3] tools/bpf: simplify libbpf API function libbpf_set_print()

2019-02-01 Thread Yonghong Song
Currently, the libbpf API function libbpf_set_print() takes three function pointer parameters for warning, info and debug printout respectively. This patch changes the API to have just one function pointer parameter and the function pointer has one additional parameter "debugging level". So if in

[PATCH bpf-next v3 1/3] tools/bpf: move libbpf pr_* debug print functions to headers

2019-02-01 Thread Yonghong Song
A global function libbpf_debug_print, which is invisible outside the shared library, is defined to print based on levels. The pr_warning, pr_info and pr_debug macros are moved into the newly created header common.h. So any .c file including common.h can use these macros directly. Currently btf__ne

[PATCH bpf-next v3 0/3] tools/bpf: changes of libbpf debug interfaces

2019-02-01 Thread Yonghong Song
These are patches responding to my comments for Magnus's patch (https://patchwork.ozlabs.org/patch/1032848/). The goal is to make pr_* macros available to other C files than libbpf.c, and to simplify API function libbpf_set_print(). Specifically, Patch #1 used global functions to facilitate pr_* m

[PATCH bpf-next v6 6/8] samples/bpf: Add a "force" flag to XDP samples

2019-02-01 Thread Maciej Fijalkowski
Make xdp samples consistent with iproute2 behavior and set the XDP_FLAGS_UPDATE_IF_NOEXIST by default when setting the xdp program on interface. Provide an option for user to force the program loading, which as a result will not include the mentioned flag in bpf_set_link_xdp_fd call. Signed-off-by

[PATCH bpf-next v6 8/8] samples/bpf: Check the prog id before exiting

2019-02-01 Thread Maciej Fijalkowski
Check the program id within the signal handler on polling xdp samples that were previously converted to libbpf usage. Avoid the situation of unloading the program that was not attached by sample that is exiting. Handle also the case where bpf_get_link_xdp_id didn't exit with an error but the xdp pr

[PATCH bpf-next v6 7/8] libbpf: Add a support for getting xdp prog id on ifindex

2019-02-01 Thread Maciej Fijalkowski
Since we have a dedicated netlink attributes for xdp setup on a particular interface, it is now possible to retrieve the program id that is currently attached to the interface. The use case is targeted for sample xdp programs, which will store the program id just after loading bpf program onto ifac

Re: [PATCH bpf-next v5 7/8] libbpf: Add a support for getting xdp prog id on ifindex

2019-02-01 Thread Jakub Kicinski
On Fri, 1 Feb 2019 22:43:39 +0100, Daniel Borkmann wrote: > On 02/01/2019 01:19 AM, Maciej Fijalkowski wrote: > > Since we have a dedicated netlink attributes for xdp setup on a > > particular interface, it is now possible to retrieve the program id that > > is currently attached to the interface.

[PATCH bpf-next v6 3/8] samples/bpf: Convert XDP samples to libbpf usage

2019-02-01 Thread Maciej Fijalkowski
Some of XDP samples that are attaching the bpf program to the interface via libbpf's bpf_set_link_xdp_fd are still using the bpf_load.c for loading and manipulating the ebpf program and maps. Convert them to do this through libbpf usage and remove bpf_load from the picture. While at it remove what

[PATCH bpf-next v6 4/8] samples/bpf: Extend RLIMIT_MEMLOCK for xdp_{sample_pkts, router_ipv4}

2019-02-01 Thread Maciej Fijalkowski
There is a common problem with xdp samples that happens when user wants to run a particular sample and some bpf program is already loaded. The default 64kb RLIMIT_MEMLOCK resource limit will cause a following error (assuming that xdp sample that is failing was converted to libbpf usage): libbpf: E

[PATCH bpf-next v6 1/8] libbpf: Add a helper for retrieving a map fd for a given name

2019-02-01 Thread Maciej Fijalkowski
XDP samples are mostly cooperating with eBPF maps through their file descriptors. In case of a eBPF program that contains multiple maps it might be tiresome to iterate through them and call bpf_map__fd for each one. Add a helper mostly based on bpf_object__find_map_by_name, but instead of returning

Re: [PATCH bpf-next v5 0/8] xdp: Avoid unloading xdp prog not attached by sample

2019-02-01 Thread Maciej Fijałkowski
On Fri, 1 Feb 2019 22:23:45 +0100 Daniel Borkmann wrote: > On 02/01/2019 01:19 AM, Maciej Fijalkowski wrote: > > Hi! > > This patchset tries to address the situation where: > > * user loads a particular xdp sample application that does stats polling > > * user loads another sample application on

[PATCH bpf-next v6 2/8] samples/bpf: xdp_redirect_cpu have not need for read_trace_pipe

2019-02-01 Thread Maciej Fijalkowski
From: Jesper Dangaard Brouer The sample xdp_redirect_cpu is not using helper bpf_trace_printk. Thus it makes no sense that the --debug option us reading from /sys/kernel/debug/tracing/trace_pipe via read_trace_pipe. Simply remove it. Signed-off-by: Jesper Dangaard Brouer Acked-by: John Fastaben

[PATCH bpf-next v6 5/8] xdp: Provide extack messages when prog attachment failed

2019-02-01 Thread Maciej Fijalkowski
In order to provide more meaningful messages to user when the process of loading xdp program onto network interface failed, let's add extack messages within dev_change_xdp_fd. Suggested-by: Jakub Kicinski Signed-off-by: Maciej Fijalkowski Acked-by: Jesper Dangaard Brouer --- net/core/dev.c | 1

[PATCH bpf-next v6 0/8] xdp: Avoid unloading xdp prog not attached by sample

2019-02-01 Thread Maciej Fijalkowski
Hi! This patchset tries to address the situation where: * user loads a particular xdp sample application that does stats polling * user loads another sample application on the same interface * then, user sends SIGINT/SIGTERM to the app that was attached as a first one * second application ends up w

Re: Co-existing XDP generic and native mode? (Re: [PATCH bpf-next v5 5/8] xdp: Provide extack messages when prog attachment failed)

2019-02-01 Thread Jakub Kicinski
On Fri, 1 Feb 2019 22:33:22 +0100, Daniel Borkmann wrote: > On 02/01/2019 07:47 PM, Jakub Kicinski wrote: > >> These are only refactor ideas, so if you can argue why your internal > >> feature request for simultaneous generic and native make more sense, > >> then I'm open for allowing this ? > >

Re: [PATCH bpf-next v5 7/8] libbpf: Add a support for getting xdp prog id on ifindex

2019-02-01 Thread Daniel Borkmann
On 02/01/2019 01:19 AM, Maciej Fijalkowski wrote: > Since we have a dedicated netlink attributes for xdp setup on a > particular interface, it is now possible to retrieve the program id that > is currently attached to the interface. The use case is targeted for > sample xdp programs, which will sto

Re: Co-existing XDP generic and native mode? (Re: [PATCH bpf-next v5 5/8] xdp: Provide extack messages when prog attachment failed)

2019-02-01 Thread Daniel Borkmann
On 02/01/2019 07:47 PM, Jakub Kicinski wrote: [...] >> These are only refactor ideas, so if you can argue why your internal >> feature request for simultaneous generic and native make more sense, >> then I'm open for allowing this ? > > The request was actually to enable xdpoffload and xdpgeneric

Re: [PATCH bpf-next v5 0/8] xdp: Avoid unloading xdp prog not attached by sample

2019-02-01 Thread Daniel Borkmann
On 02/01/2019 01:19 AM, Maciej Fijalkowski wrote: > Hi! > This patchset tries to address the situation where: > * user loads a particular xdp sample application that does stats polling > * user loads another sample application on the same interface > * then, user sends SIGINT/SIGTERM to the app tha

  1   2   3   >