Re: [PATCH] xfrm: policy: Fix out-of-bound array accesses in __xfrm_policy_unlink

2019-02-27 Thread Herbert Xu
On Thu, Feb 28, 2019 at 03:18:59PM +0800, Yue Haibing wrote: > From: YueHaibing > > UBSAN report this: > > UBSAN: Undefined behaviour in net/xfrm/xfrm_policy.c:1289:24 > index 6 is out of range for type 'unsigned int [6]' > CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.162-514.55.6.9.x86_64+ #13

Re: [PATCH RESEND net] net: phy: xgmiitorgmii: Support generic PHY status read

2019-02-27 Thread Harini Katakam
Hi, On Wed, Feb 27, 2019 at 2:35 PM Harini Katakam wrote: > > Hi Andrew, Paul, > > On Wed, Feb 27, 2019 at 2:15 PM Michal Simek wrote: > > > > On 21. 02. 19 12:03, Michal Simek wrote: > > > On 21. 02. 19 11:24, Paul Kocialkowski wrote: > > >> Hi, > > >> > > >> On Wed, 2019-02-20 at 07:58 +0100, M

[PATCH] net: mscc: Enable all ports in QSGMII

2019-02-27 Thread Kavyasree.Kotagiri
From: Kavya Sree Kotagiri When Ocelot phy-mode is QSGMII, all 4 ports involved in QSGMII shall be kept out of reset and Tx lanes shall be enabled to pass the data. Fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support") Signed-off-by: Kavya Sree Kotagiri Signed-off-by: Steen Hegelu

[PATCH] xfrm: policy: Fix out-of-bound array accesses in __xfrm_policy_unlink

2019-02-27 Thread Yue Haibing
From: YueHaibing UBSAN report this: UBSAN: Undefined behaviour in net/xfrm/xfrm_policy.c:1289:24 index 6 is out of range for type 'unsigned int [6]' CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.162-514.55.6.9.x86_64+ #13 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu

Re: [PATCH v3] xfrm: policy: Fix possible user after free in __xfrm_policy_unlink

2019-02-27 Thread YueHaibing
Pls ignore this, will fix the patch title On 2019/2/28 14:56, Yue Haibing wrote: > From: YueHaibing > > UBSAN report this: > > UBSAN: Undefined behaviour in net/xfrm/xfrm_policy.c:1289:24 > index 6 is out of range for type 'unsigned int [6]' > CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.162-5

Re: [PATCH net-next] switchdev: Remove unused transaction item queue

2019-02-27 Thread Jiri Pirko
Thu, Feb 28, 2019 at 01:29:16AM CET, f.faine...@gmail.com wrote: >There are no more in tree users of the >switchdev_trans_item_{dequeue,enqueue} or switchdev_trans_item structure >in the kernel since commit 00fc0c51e35b ("rocker: Change world_ops API >and implementation to be switchdev independant"

Re: linux-next: manual merge of the staging tree with the net-next tree

2019-02-27 Thread Greg KH
On Thu, Feb 28, 2019 at 03:52:01PM +1100, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the staging tree got a conflict in: > > drivers/staging/fsl-dpaa2/ethsw/ethsw.c > > between commit: > > 570b68c8ddde ("staging: fsl-dpaa2: ethsw: Handle SWITCHDEV_PORT_ATTR_SET") > >

[PATCH net-next 02/14] mlxsw: spectrum_acl: Don't migrate already migrated entry

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko Check if the entry is already in a chunk where we want it to be. In that case, skip migration. This is preparation for "per parts" migration where this situation may occur. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_

[PATCH net-next 04/14] mlxsw: spectrum_acl: Push rehash start/end code into separate functions

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko In preparations for interrupt/continue of rehash work, put the code at the beginning/end of the rehash function into separate functions. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../mellanox/mlxsw/spectrum_acl_tcam.c| 41 +++ 1 file ch

[PATCH net-next 09/14] mlxsw: spectrum_acl: Put this_is_rollback to rehash context struct

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko Put the this_is_rollback flag into rehash context struct in preparations for interrupt/continue of rehash work. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../mellanox/mlxsw/spectrum_acl_tcam.c| 19 --- 1 file changed, 12 insertions(+),

[PATCH net-next 11/14] mlxsw: spectrum_acl: Do rollback as another call to mlxsw_sp_acl_tcam_vchunk_migrate_all()

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko In order to simplify the code and to prepare it for interrupted/continued migration process, do the rollback in case of migration error as another call to mlxsw_sp_acl_tcam_vchunk_migrate_all(). It can be understood as "migrate all back". Signed-off-by: Jiri Pirko Signed-off-by

[PATCH net-next 03/14] mlxsw: spectrum_acl: Introduce new rehash context struct and save hint_priv there

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko Prepare for continued migration. Introduce a new structure to track rehash context and save hint_priv into it. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/spectrum_acl_tcam.c | 16 1 file changed, 12 insertions(+), 4

[PATCH net-next 08/14] mlxsw: spectrum_acl: Rename variables in mlxsw_sp_acl_tcam_ventry_migrate()

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko Remove some of variables in function mlxsw_sp_acl_tcam_ventry_migrate() so the names are aligned with the rest of the code. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/spectrum_acl_tcam.c| 14 +++--- 1 file changed, 7 inse

[PATCH net-next 10/14] mlxsw: spectrum_acl: Put vchunk migrate start/end code into separate functions

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko In preparations of interrupt/continue of rehash work, put the code that is done at the beginning/end of vchunk migrate function into separate functions. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../mellanox/mlxsw/spectrum_acl_tcam.c| 43 ++

[PATCH net-next 06/14] mlxsw: spectrum_acl: assign vregion->region by the newly created region

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko Make the vregion->region contain pointer of a new region we migrate to. In case of a rollback, it contains the original region. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../mellanox/mlxsw/spectrum_acl_tcam.c| 42 +-- 1 file changed, 20

[PATCH net-next 07/14] mlxsw: spectrum_acl: assign vchunk->chunk by the newly created chunk

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko Make the vchunk->chunk contain pointer of a new chunk we migrate to. In case of a rollback, it contains the original chunk. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../mellanox/mlxsw/spectrum_acl_tcam.c | 18 ++ 1 file changed, 10 ins

[PATCH net-next 12/14] mlxsw: spectrum_acl: Allow to interrupt/continue rehash work

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko Currently, migration of vregions with many entries may take long time during which insertions and removals of the rules are blocked due to wait to acquire vregion->lock. To overcome this, allow to interrupt and continue rehash work according to the set credits - number of rules

[PATCH net-next 14/14] mlxsw: spectrum_acl: Make mlxsw_sp_acl_tcam_vregion_rehash() return void

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko The return value is ignored anyway, so just return void. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/mellan

[PATCH net-next 13/14] mlxsw: spectrum_acl: Remember where to continue rehash migration

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko Store pointer to vchunk where the migration was interrupted, as well as ventry pointer to start from and to stop at (during rollback). This saved pointers need to be forgotten in case of ventries list or vchunk list changes, which is done by couple of "changed" helpers. Signed-o

[PATCH net-next 05/14] mlxsw: spectrum_acl: Push code start/end from mlxsw_sp_acl_tcam_vregion_migrate()

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko Push code from the beginning and end of function mlxsw_sp_acl_tcam_vregion_migrate() into rehash_start()/end() functions. Then all the things needed to be done before and after the actual migration process will be grouped together. Signed-off-by: Jiri Pirko Signed-off-by: Ido S

[PATCH net-next 01/14] mlxsw: spectrum_acl: Push rehash dw struct into rehash sub-struct

2019-02-27 Thread Ido Schimmel
From: Jiri Pirko More rehash related fields are going to come. Push "dw" into sub-struct that will accommodate the others as well. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../ethernet/mellanox/mlxsw/spectrum_acl_tcam.c | 16 +--- 1 file changed, 9 insertions(+),

Re: [PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type()

2019-02-27 Thread Yonghong Song
On 2/27/19 9:46 PM, Dan Carpenter wrote: > The "ref_type_id" variable needs to be signed for the error handling > to work. > > Fixes: d5caef5b5655 ("btf: add BTF types deduplication algorithm") > Signed-off-by: Dan Carpenter > --- > This goes through the BPF tree probably, although it does appl

[PATCH net-next 00/14] mlxsw: spectrum_acl: Split rehash work into chunks

2019-02-27 Thread Ido Schimmel
Jiri says: When rehash happens on a vregion with many rules and they are being migrated, it might take significant time to finish the job. During that time vregion->lock is taken which prevents rules from being added/deleted from the vregion. Aim of this patchset is to allow to interrupt migratio

[PATCH 2/2] can: flexcan: add ISO CAN FD feature support

2019-02-27 Thread Joakim Zhang
ISO CAN FD is introduced to increase the failture detection capability than non-ISO CAN FD. The non-ISO CAN FD is still supported by FlexCAN so that it can be used mainly during an intermediate phase, for evaluation and development purposes. Therefore, it is strongly recommended to configure FlexC

[PATCH 1/2] can: flexcan: add CANFD BRS support and improve bittiming setting

2019-02-27 Thread Joakim Zhang
From: Dong Aisheng This patch intends to add CANFD BitRate Switch(BRS) support. Bit timing must be set in CBT register other than CTRL1 register when CANFD supports BRS, it will extend the range of all CAN bit timing variables (PRESDIV, PROPSEG, PSEG1, PSEG2 and RJW), which will improve the bit t

[PATCH 0/2] can: flexcan: add CANFD BRS and ISO FD support

2019-02-27 Thread Joakim Zhang
Hi Marc, This patch set intends to enable CANFD bitrate switch and ISO FD mode support. You may need to firstly review the patch set([PATCH 0/3] can: flexcan: add imx8qm support). I noticed that you have been reviewing my patches recetnly, please feel free to let me know if you want me to rebase

[PATCH v3] xfrm: policy: Fix possible user after free in __xfrm_policy_unlink

2019-02-27 Thread Yue Haibing
From: YueHaibing UBSAN report this: UBSAN: Undefined behaviour in net/xfrm/xfrm_policy.c:1289:24 index 6 is out of range for type 'unsigned int [6]' CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.162-514.55.6.9.x86_64+ #13 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu

Re: [PATCH v2] xfrm: policy: Fix possible user after free in __xfrm_policy_unlink

2019-02-27 Thread YueHaibing
On 2019/2/28 14:41, Herbert Xu wrote: > On Thu, Feb 28, 2019 at 02:38:01PM +0800, Yue Haibing wrote: >> >> diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c >> index a131f9f..aaa45c9 100644 >> --- a/net/xfrm/xfrm_user.c >> +++ b/net/xfrm/xfrm_user.c >> @@ -1424,7 +1424,8 @@ static int veri

Re: [PATCH v2] xfrm: policy: Fix possible user after free in __xfrm_policy_unlink

2019-02-27 Thread Herbert Xu
On Thu, Feb 28, 2019 at 02:38:01PM +0800, Yue Haibing wrote: > > diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c > index a131f9f..aaa45c9 100644 > --- a/net/xfrm/xfrm_user.c > +++ b/net/xfrm/xfrm_user.c > @@ -1424,7 +1424,8 @@ static int verify_newpolicy_info(struct > xfrm_userpolicy_info

[PATCH v2 net] net: dsa: mv88e6xxx: prevent interrupt storm caused by mv88e6390x_port_set_cmode

2019-02-27 Thread Heiner Kallweit
When debugging another issue I faced an interrupt storm in this driver (88E6390, port 9 in SGMII mode), consisting of alternating link-up / link-down interrupts. Analysis showed that the driver wanted to set a cmode that was set already. But so far mv88e6390x_port_set_cmode() doesn't check this and

[PATCH v2] xfrm: policy: Fix possible user after free in __xfrm_policy_unlink

2019-02-27 Thread Yue Haibing
From: YueHaibing UBSAN report this: UBSAN: Undefined behaviour in net/xfrm/xfrm_policy.c:1289:24 index 6 is out of range for type 'unsigned int [6]' CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.162-514.55.6.9.x86_64+ #13 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu

Re: [PATCH net-next 1/1] net: sched: act_csum: Fix csum calc for tagged packets

2019-02-27 Thread David Miller
From: Eli Britstein Date: Tue, 26 Feb 2019 09:57:34 + > The csum calculation is different for IPv4/6. For VLAN packets, > tc_skb_protocol returns the VLAN protocol rather than the packet's one > (e.g. IPv4/6), so csum is not calculated. Furthermore, VLAN may not be > stripped so csum is not c

Re: [PATCH net-next] net: hns: use struct_size() in devm_kzalloc()

2019-02-27 Thread David Miller
From: "Gustavo A. R. Silva" Date: Mon, 25 Feb 2019 18:27:57 -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

[PATCH] tools/libbpf: signedness bug in btf_dedup_ref_type()

2019-02-27 Thread Dan Carpenter
The "ref_type_id" variable needs to be signed for the error handling to work. Fixes: d5caef5b5655 ("btf: add BTF types deduplication algorithm") Signed-off-by: Dan Carpenter --- This goes through the BPF tree probably, although it does apply to net-next. tools/lib/bpf/btf.c | 3 ++- 1 file chan

Re: [PATCH] netlabel: fix out-of-bounds memory accesses

2019-02-27 Thread David Miller
From: Paul Moore Date: Mon, 25 Feb 2019 19:06:06 -0500 > There are two array out-of-bounds memory accesses, one in > cipso_v4_map_lvl_valid(), the other in netlbl_bitmap_walk(). Both > errors are embarassingly simple, and the fixes are straightforward. > > As a FYI for anyone backporting this p

Re: [PATCH net] ipv4: Pass original device to ip_rcv_finish_core

2019-02-27 Thread David Miller
From: David Ahern Date: Mon, 25 Feb 2019 13:55:48 -0800 > From: David Ahern > > ip_route_input_rcu expects the original ingress device (e.g., for > proper multicast handling). The skb->dev can be changed by l3mdev_ip_rcv, > so dev needs to be saved prior to calling it. This was the behavior pri

Re: Request for suggestion on net device re-naming/re-ordering based on DT alias

2019-02-27 Thread Harini Katakam
On Thu, Feb 28, 2019 at 12:10 AM Stephen Hemminger wrote: > > On Wed, 27 Feb 2019 17:24:03 +0530 > Harini Katakam wrote: > > > Device naming is a hard problem, and there is no perfect solution. > > Device tree should be providing hints to userspace policy for naming, not > trying to do it in the

Re: [PATCH net-next 0/2] net: phy: marvell10g: Clean .get_features by using C45 helpers

2019-02-27 Thread David Miller
From: Maxime Chevallier Date: Mon, 25 Feb 2019 17:14:05 +0100 > Recent work on C45 helpers by Heiner made the > genphy_c45_pma_read_abilities function generic enough to use as a > default .get_featutes implementation. > > This series removes the remaining redundant code in > mv3310_get_features(

Re: [PATCH net-next v2] net: sched: act_tunnel_key: fix metadata handling

2019-02-27 Thread David Miller
From: Vlad Buslov Date: Mon, 25 Feb 2019 17:30:14 +0200 > Tunnel key action params->tcft_enc_metadata is only set when action is > TCA_TUNNEL_KEY_ACT_SET. However, metadata pointer is incorrectly > dereferenced during tunnel key init and release without verifying that > action is if correct type,

Re: [PATCH net v3 0/2] selftests: pmtu: fix and increase coverage

2019-02-27 Thread David Miller
From: Paolo Abeni Date: Mon, 25 Feb 2019 16:08:35 +0100 > This series includes a fixup for the pmtu.sh test script, related to IPv6 > address management, and adds coverage for the recently reported and fixed > PMTU exception issue > > v2 -> v3: > - more cleanups > > v1 -> v2: > - several scri

Re: [PATCH] net: phy: dp83867: add soft reset delay

2019-02-27 Thread David Miller
From: Max Uvarov Date: Mon, 25 Feb 2019 12:15:10 +0300 > Similar to dp83640 delay after soft reset > is needed to set up registers correctly. > > Signed-off-by: Max Uvarov Applied, thanks.

Re: [BUG] net/sched : qlen can not really be per cpu ?

2019-02-27 Thread Eric Dumazet
On 02/27/2019 06:46 PM, Cong Wang wrote: > Hmm, looking into this, do we really need to check cl->leaf.q->q.qlen > in htb_activate() for pfifo_fast? htb_activate() is only called when > qdisc_enqueue() returns NET_XMIT_SUCCESS, so for pfifo_fast > that is always qlen!=0, right? > > So somethin

[PATCH v5 perf,bpf 03/15] bpf: bpftool: use bpf_program__get_prog_info_linear() in prog.c:do_dump()

2019-02-27 Thread Song Liu
This patches uses bpf_program__get_prog_info_linear() to simplify the logic in prog.c do_dump(). Cc: Daniel Borkmann Cc: Alexei Starovoitov Signed-off-by: Song Liu --- tools/bpf/bpftool/prog.c | 266 +-- 1 file changed, 59 insertions(+), 207 deletions(-) di

[PATCH v5 perf,bpf 04/15] perf, bpf: synthesize bpf events with bpf_program__get_prog_info_linear()

2019-02-27 Thread Song Liu
With bpf_program__get_prog_info_linear, we can simplify the logic that synthesizes bpf events. This patch doesn't change the behavior of the code. Signed-off-by: Song Liu --- tools/perf/util/bpf-event.c | 118 1 file changed, 40 insertions(+), 78 deletions(-

[PATCH v5 perf,bpf 01/15] perf, bpf: consider events with attr.bpf_event as side-band events

2019-02-27 Thread Song Liu
Events with bpf_event should be considered as side-band event, as they carry information about BPF programs. Fixes: 6ee52e2a3fe4 ("perf, bpf: Introduce PERF_RECORD_BPF_EVENT") Signed-off-by: Song Liu --- kernel/events/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/k

[PATCH v5 perf,bpf 07/15] perf, bpf: save bpf_prog_info information as headers to perf.data

2019-02-27 Thread Song Liu
This patch enables perf-record to save bpf_prog_info information as headers to perf.data. A new header type HEADER_BPF_PROG_INFO is introduced for this data. Signed-off-by: Song Liu --- tools/perf/util/header.c | 143 ++- tools/perf/util/header.h | 1 + 2 fi

[PATCH v5 perf,bpf 06/15] perf, bpf: save bpf_prog_info in a rbtree in perf_env

2019-02-27 Thread Song Liu
bpf_prog_info contains information necessary to annotate bpf programs. This patch saves bpf_prog_info for bpf programs loaded in the system. Some big picture of the next few patches: To fully annotate BPF programs with source code mapping, 4 different information are needed: 1) PERF_RECORD_KS

[PATCH v5 perf,bpf 08/15] perf, bpf: save btf in a rbtree in perf_env

2019-02-27 Thread Song Liu
btf contains information necessary to annotate bpf programs. This patch saves btf for bpf programs loaded in the system. Signed-off-by: Song Liu --- tools/perf/util/bpf-event.c | 24 ++ tools/perf/util/bpf-event.h | 7 tools/perf/util/env.c | 65 ++

[PATCH v5 perf,bpf 12/15] perf, bpf: enable annotation of bpf program

2019-02-27 Thread Song Liu
This patch enables the annotation of bpf program. A new dso type DSO_BINARY_TYPE__BPF_PROG_INFO is introduced to for BPF programs. In symbol__disassemble(), DSO_BINARY_TYPE__BPF_PROG_INFO dso calls into a new function symbol__disassemble_bpf(), where annotation line information is filled based bpf

[PATCH v5 perf,bpf 09/15] perf, bpf: save btf information as headers to perf.data

2019-02-27 Thread Song Liu
This patch enables perf-record to save btf information as headers to perf.data A new header type HEADER_BPF_BTF is introduced for this data. Signed-off-by: Song Liu --- tools/perf/util/header.c | 108 ++- tools/perf/util/header.h | 1 + 2 files changed, 108

[PATCH v5 perf,bpf 11/15] perf: add -lopcodes to feature-libbfd

2019-02-27 Thread Song Liu
Both libbfd and libopcodes are distributed with binutil-dev/devel. When libbfd presents, it is OK to assume libopcodes also presents. This has been a safe assumption for bpftool. This patch adds -lopcodes to perf/Makefile.config. libopcodes will be used in the next commit for bpf annotation. Sign

[PATCH v5 perf,bpf 10/15] perf-top: add option --no-bpf-event

2019-02-27 Thread Song Liu
bpf events should be tracked by default for perf-top. This patch makes it on by default, and adds option to disable bpf events. Signed-off-by: Song Liu --- tools/perf/builtin-top.c | 3 +++ tools/perf/util/top.h| 1 + 2 files changed, 4 insertions(+) diff --git a/tools/perf/builtin-top.c b/

[PATCH v5 perf,bpf 14/15] perf: introduce side band thread

2019-02-27 Thread Song Liu
This patch introduces side band thread that captures extended information for events like PERF_RECORD_BPF_EVENT. This new thread uses its own evlist that uses ring buffer with very low watermark for lower latency. In the next patch, we uses this thread to handle PERF_RECORD_BPF_EVENT. Signed-off-

[PATCH v5 perf,bpf 13/15] perf, bpf: process PERF_BPF_EVENT_PROG_LOAD for annotation

2019-02-27 Thread Song Liu
This patch adds processing of PERF_BPF_EVENT_PROG_LOAD, which sets proper DSO type/id/etc of memory regions mapped to BPF programs to DSO_BINARY_TYPE__BPF_PROG_INFO Signed-off-by: Song Liu --- tools/perf/util/bpf-event.c | 53 + 1 file changed, 53 insertions(+

[PATCH v5 perf,bpf 15/15] perf, bpf: save bpf_prog_info and btf of short living bpf programs

2019-02-27 Thread Song Liu
To fully annotate BPF programs with source code mapping, 4 different information are needed: 1) PERF_RECORD_KSYMBOL 2) PERF_RECORD_BPF_EVENT 3) bpf_prog_info 4) btf This patch handles 3) and 4) for short living BPF programs. For timely process of these information, a dedicated even

[PATCH v5 perf,bpf 05/15] perf: change prototype of perf_event__synthesize_bpf_events()

2019-02-27 Thread Song Liu
This patch changes the arguments of perf_event__synthesize_bpf_events() to include perf_session* instead of perf_tool*. perf_session will be used in the next patch. Signed-off-by: Song Liu --- tools/perf/builtin-record.c | 2 +- tools/perf/builtin-top.c| 2 +- tools/perf/util/bpf-event.c | 8

[PATCH v5 perf,bpf 00/15] perf annotation of BPF programs

2019-02-27 Thread Song Liu
Changes v4 to v5: 1. Rebase to latest bpf-next; 2. Add dependency of 94816add0005 from Arnaldo's tree; 3. More details in change logs; 4. Add perf_env__init() to init bpf related lock and rbtrees; 5. Small clean ups. Changes v3 to v4: 1. Incorporate feedbacks from Jiri and Namhyung; 2. Fixed compi

[PATCH v5 perf,bpf 02/15] bpf: libbpf: introduce bpf_program__get_prog_info_linear()

2019-02-27 Thread Song Liu
Currently, bpf_prog_info includes 9 arrays. The user has the option to fetch any combination of these arrays. However, this requires a lot of handling of these arrays. This work becomes more tricky when we need to store bpf_prog_info to a file, because these arrays are allocated independently. Thi

linux-next: manual merge of the staging tree with the net-next tree

2019-02-27 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the staging tree got a conflict in: drivers/staging/fsl-dpaa2/ethsw/ethsw.c between commit: 570b68c8ddde ("staging: fsl-dpaa2: ethsw: Handle SWITCHDEV_PORT_ATTR_SET") from the net-next tree and commit: 11f27765f611 ("staging: fsl-dpaa2: ethsw: Add mis

Re: [virtio-dev] Re: net_failover slave udev renaming (was Re: [RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework)

2019-02-27 Thread Michael S. Tsirkin
On Wed, Feb 27, 2019 at 05:52:18PM -0800, Jakub Kicinski wrote: > On Wed, 27 Feb 2019 20:26:02 -0500, Michael S. Tsirkin wrote: > > On Wed, Feb 27, 2019 at 04:52:05PM -0800, Jakub Kicinski wrote: > > > On Wed, 27 Feb 2019 19:41:32 -0500, Michael S. Tsirkin wrote: > > > > > As this scheme adds muc

Re: [PATCH net-next 4/6] ethernet: eth: add default vid len for all ehternet kind devices

2019-02-27 Thread Florian Fainelli
On 2/26/2019 10:45 AM, Ivan Khoronzhuk wrote: > IVDF - individual virtual device filtering. Allows to set per vlan > l2 address filters on end real network device (for unicast and for > multicast) and drop redundant not expected packet income. > > If CONFIG_VLAN_8021Q_IVDF is enabled the follow

Re: [PATCH net-next 1/6] net: core: dev_addr_lists: add VID to device address

2019-02-27 Thread Florian Fainelli
On 2/26/2019 10:45 AM, Ivan Khoronzhuk wrote: > Despite this is supposed to be used for Ethernet VLANs, not Ethernet > addresses with space for VID also can reuse this, so VID is considered > as virtual ID extension, not belonging strictly to Ethernet VLAN VIDs, > and overall change can be named in

Re: [PATCH net-next 5/6] net: ethernet: ti: cpsw: update mc filtering to use IVDF

2019-02-27 Thread Florian Fainelli
On 2/26/2019 10:45 AM, Ivan Khoronzhuk wrote: > The cpsw can filter multicast addresses only per vlan. Thus if mcast > address is set for one of them or only for real device it must be > added for every created vlan consuming ALE table w/o reason. In order to > simplify dispatching vlan filters,

Re: [PATCH net-next 3/6] net: 8021q: vlan_dev: add vid tag for vlan device own address

2019-02-27 Thread Florian Fainelli
On 2/26/2019 10:45 AM, Ivan Khoronzhuk wrote: > The vlan device address is held separately from uc/mc lists and > handled differently. The vlan dev address is bound with real device > address only if it's inherited from init, in all other cases it's > separate address entry in uc list. With vid

Re: [PATCH] xfrm: policy: Fix possible user after free in __xfrm_policy_unlink

2019-02-27 Thread Herbert Xu
On Thu, Feb 28, 2019 at 11:16:23AM +0800, Yue Haibing wrote: > > diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c > index 8d1a898..b27eb742 100644 > --- a/net/xfrm/xfrm_policy.c > +++ b/net/xfrm/xfrm_policy.c > @@ -316,6 +316,8 @@ static void xfrm_policy_timer(struct timer_list *t) >

Re: [PATCH net-next 2/6] net: 8021q: vlan_dev: add vid tag to addresses of uc and mc lists

2019-02-27 Thread Florian Fainelli
On 2/26/2019 10:45 AM, Ivan Khoronzhuk wrote: > Update vlan mc and uc addresses with VID tag while propagating > addresses to lower devices, do this only if address is not synced. > It allows at end driver level to distinguish addresses belonging > to vlan devices. > > Signed-off-by: Ivan Khoro

Re: [PATCH] net: dsa: read mac address from DT for slave device

2019-02-27 Thread Florian Fainelli
On 2/27/2019 6:23 PM, xiaof...@codeaurora.org wrote: > On 2019-02-27 11:13, Florian Fainelli wrote: >> On 2/26/2019 6:04 PM, xiaof...@codeaurora.org wrote: >>> On 2019-02-26 15:45, xiaof...@codeaurora.org wrote: On 2019-02-26 01:27, Florian Fainelli wrote: > On 2/25/19 5:28 AM, xiaof...

Re: [PATCH bpf-next 3/5] tools: libbpf: add a correctly named define for map iteration

2019-02-27 Thread Andrii Nakryiko
On Wed, Feb 27, 2019 at 6:47 PM Alexei Starovoitov wrote: > > On Wed, Feb 27, 2019 at 03:57:03PM -0800, Jakub Kicinski wrote: > > On Wed, 27 Feb 2019 15:47:56 -0800, Andrii Nakryiko wrote: > > > On Wed, Feb 27, 2019 at 3:31 PM Jakub Kicinski > > > wrote: > > > > > > > > For historical reasons the

RE: [PATCH] can: flexcan: add TX support for variable payload size

2019-02-27 Thread Joakim Zhang
> -Original Message- > From: Marc Kleine-Budde > Sent: 2019年2月27日 22:03 > To: Joakim Zhang ; linux-...@vger.kernel.org > Cc: w...@grandegger.com; netdev@vger.kernel.org; > linux-ker...@vger.kernel.org; dl-linux-imx > Subject: Re: [PATCH] can: flexcan: add TX support for variable payload

Re: [PATCH bpf-next v2 4/5] samples: bpf: use libbpf where easy

2019-02-27 Thread Andrii Nakryiko
On Wed, Feb 27, 2019 at 7:04 PM Jakub Kicinski wrote: > > Some samples don't really need the magic of bpf_load, > switch them to libbpf. > > v2: - specify program types. thanks! Acked-by: Andrii Nakryiko > > Signed-off-by: Jakub Kicinski > Reviewed-by: Quentin Monnet > --- > samples/bpf/Mak

[PATCH] xfrm: policy: Fix possible user after free in __xfrm_policy_unlink

2019-02-27 Thread Yue Haibing
From: YueHaibing UBSAN report this: UBSAN: Undefined behaviour in net/xfrm/xfrm_policy.c:1289:24 index 6 is out of range for type 'unsigned int [6]' CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.162-514.55.6.9.x86_64+ #13 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu

[PATCH bpf-next v2 4/5] samples: bpf: use libbpf where easy

2019-02-27 Thread Jakub Kicinski
Some samples don't really need the magic of bpf_load, switch them to libbpf. v2: - specify program types. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet --- samples/bpf/Makefile | 6 +++--- samples/bpf/fds_example.c | 10 +++--- samples/bpf/sockex1_user.c | 23 ++

[PATCH bpf-next v2 3/5] tools: libbpf: add a correctly named define for map iteration

2019-02-27 Thread Jakub Kicinski
For historical reasons the helper to loop over maps in an object is called bpf_map__for_each while it really should be called bpf_object__for_each_map. Rename and add a correctly named define for backward compatibility. Switch all in-tree users to the correct name (Quentin). Signed-off-by: Jakub

[PATCH bpf-next v2 2/5] samples: bpf: remove load_sock_ops in favour of bpftool

2019-02-27 Thread Jakub Kicinski
bpftool can do all the things load_sock_ops used to do, and more. Point users to bpftool instead of maintaining this sample utility. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Andrii Nakryiko --- samples/bpf/.gitignore | 1 - samples/bpf/Makefile

[PATCH bpf-next v2 5/5] tools: libbpf: make sure readelf shows full names in build checks

2019-02-27 Thread Jakub Kicinski
readelf truncates its output by default to attempt to make it more readable. This can lead to function names getting aliased if they differ late in the string. Use --wide parameter to avoid truncation. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Andrii Nakryiko --- to

[PATCH bpf-next v2 1/5] samples: bpf: force IPv4 in ping

2019-02-27 Thread Jakub Kicinski
ping localhost may default of IPv6 on modern systems, but samples are trying to only parse IPv4. Force IPv4. samples/bpf/tracex1_user.c doesn't interpret the packet so we don't care which IP version will be used there. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Andrii

[PATCH bpf-next v2 0/5] samples: bpf: continue effort to get rid of bpf_load

2019-02-27 Thread Jakub Kicinski
Hi! This set is next part of a quest to get rid of the bpf_load ELF loader. It fixes some minor issues with the samples and starts the conversion. First patch fixes ping invocations, ping localhost defaults to IPv6 on modern setups. Next load_sock_ops sample is removed and users are directed tow

Re: [PATCH bpf-next 3/5] tools: libbpf: add a correctly named define for map iteration

2019-02-27 Thread Alexei Starovoitov
On Wed, Feb 27, 2019 at 03:57:03PM -0800, Jakub Kicinski wrote: > On Wed, 27 Feb 2019 15:47:56 -0800, Andrii Nakryiko wrote: > > On Wed, Feb 27, 2019 at 3:31 PM Jakub Kicinski > > wrote: > > > > > > For historical reasons the helper to loop over maps in an object > > > is called bpf_map__for_each

Re: [BUG] net/sched : qlen can not really be per cpu ?

2019-02-27 Thread Cong Wang
On Tue, Feb 26, 2019 at 4:56 PM Eric Dumazet wrote: > > > > On 02/26/2019 03:51 PM, Cong Wang wrote: > > On Tue, Feb 26, 2019 at 3:19 PM Eric Dumazet wrote: > >> > >> > >> > >> On 02/25/2019 10:42 PM, Eric Dumazet wrote: > >>> HTB + pfifo_fast as a leaf qdisc hits badly the following warning in

Re: [PATCH 0/4] mwifiex PCI/wake-up interrupt fixes

2019-02-27 Thread Brian Norris
Hi Rafael, On Wed, Feb 27, 2019 at 3:04 PM Rafael J. Wysocki wrote: > On Wed, Feb 27, 2019 at 9:58 PM Brian Norris wrote: > > On Wed, Feb 27, 2019 at 11:16:12AM +0100, Ard Biesheuvel wrote: > > > So I'd argue that we should add an optional 'wake-gpio' DT property > > > instead to the generic PCI

[PATCH v2] appletalk: Fix use-after-free in atalk_proc_exit

2019-02-27 Thread Yue Haibing
From: YueHaibing KASAN report this: BUG: KASAN: use-after-free in pde_subdir_find+0x12d/0x150 fs/proc/generic.c:71 Read of size 8 at addr 8881f41fe5b0 by task syz-executor.0/2806 CPU: 0 PID: 2806 Comm: syz-executor.0 Not tainted 5.0.0-rc7+ #45 Hardware name: QEMU Standard PC (i440FX + PIIX,

[PATCH bpf-next] bpf: fix build without bpf_syscall

2019-02-27 Thread Alexei Starovoitov
wrap bpf_stats_enabled sysctl with #ifdef Reported-by: Stephen Rothwell Fixes: 492ecee892c2 ("bpf: enable program stats") Signed-off-by: Alexei Starovoitov --- kernel/sysctl.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 86e0

Re: [PATCH] net: dsa: read mac address from DT for slave device

2019-02-27 Thread xiaofeis
On 2019-02-27 11:13, Florian Fainelli wrote: On 2/26/2019 6:04 PM, xiaof...@codeaurora.org wrote: On 2019-02-26 15:45, xiaof...@codeaurora.org wrote: On 2019-02-26 01:27, Florian Fainelli wrote: On 2/25/19 5:28 AM, xiaof...@codeaurora.org wrote: Hi Florian We have two slave DSA interfaces, w

Re: [PATCH RFC v3 4/5] sctp: Make sctp_enqueue_event tak an skb list.

2019-02-27 Thread Marcelo Ricardo Leitner
On Wed, Feb 27, 2019 at 05:00:24PM -0800, David Miller wrote: > > Pass this, instead of an event. Then everything trickles down and we > always have events a non-empty list. > > Then we needs a list creating stub to place into .enqueue_event for > sctp_stream_interleave_1. > > Signed-off-by: D

Re: linux-next: build failure after merge of the bpf-next tree

2019-02-27 Thread Alexei Starovoitov
On Wed, Feb 27, 2019 at 5:31 PM Stephen Rothwell wrote: > > Hi all, > > After merging the bpf-next tree, today's linux-next build (arm > multi_v7_defconfig) failed like this: > > kernel/sysctl.c:1238:13: error: 'sysctl_bpf_stats_enabled' undeclared here > (not in a function); did you mean 'sysctl

[PATCH] xen-netback: fix occasional leak of grant ref mappings under memory pressure

2019-02-27 Thread Igor Druzhinin
Zero-copy callback flag is not yet set on frag list skb at the moment xenvif_handle_frag_list() returns -ENOMEM. This eventually results in leaking grant ref mappings since xenvif_zerocopy_callback() is never called for these fragments. Those eventually build up and cause Xen to kill Dom0 as the sl

Re: [virtio-dev] Re: net_failover slave udev renaming (was Re: [RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework)

2019-02-27 Thread Jakub Kicinski
On Wed, 27 Feb 2019 20:26:02 -0500, Michael S. Tsirkin wrote: > On Wed, Feb 27, 2019 at 04:52:05PM -0800, Jakub Kicinski wrote: > > On Wed, 27 Feb 2019 19:41:32 -0500, Michael S. Tsirkin wrote: > > > > As this scheme adds much complexity to the kernel naming convention > > > > (currently it's jus

Re: [PATCH net 03/16] net/sched: act_csum: validate the control action inside init()

2019-02-27 Thread Cong Wang
On Wed, Feb 27, 2019 at 9:41 AM Davide Caratti wrote: > @@ -108,7 +116,16 @@ static int tcf_csum_init(struct net *net, struct nlattr > *nla, > if (ret == ACT_P_CREATED) > tcf_idr_insert(tn, *a); > > + if (oldchain) > + tcf_chain_put_by_act(oldchain);

Re: [PATCH -next] appletalk: use remove_proc_subtree to simplify procfs code

2019-02-27 Thread YueHaibing
On 2019/2/28 7:28, kbuild test robot wrote: > Hi YueHaibing, > > Thank you for the patch! Perhaps something to improve: > > [auto build test WARNING on next-20190227] > > url: > https://github.com/0day-ci/linux/commits/Yue-Haibing/appletalk-use-remove_proc_subtree

[PATCH v2 -next] appletalk: use remove_proc_subtree to simplify procfs code

2019-02-27 Thread Yue Haibing
From: YueHaibing Use remove_proc_subtree to remove the whole subtree on cleanup.Also do some cleanup. Signed-off-by: YueHaibing --- net/appletalk/atalk_proc.c | 56 ++ 1 file changed, 17 insertions(+), 39 deletions(-) diff --git a/net/appletalk/atal

linux-next: build failure after merge of the bpf-next tree

2019-02-27 Thread Stephen Rothwell
Hi all, After merging the bpf-next tree, today's linux-next build (arm multi_v7_defconfig) failed like this: kernel/sysctl.c:1238:13: error: 'sysctl_bpf_stats_enabled' undeclared here (not in a function); did you mean 'sysctl_base_table'? .data = &sysctl_bpf_stats_enabled, ^

Re: [PATCH net 01/16] net/sched: prepare TC actions to properly validate the control action

2019-02-27 Thread Cong Wang
On Wed, Feb 27, 2019 at 9:41 AM Davide Caratti wrote: > +int tcf_action_check_ctrlact(int action, struct tcf_proto *tp, > +struct tcf_chain **handle, Please use a better name than 'handle'. 'handle' is usually used for a hex numeric ID. Here you just want to save the

Re: [virtio-dev] Re: net_failover slave udev renaming (was Re: [RFC PATCH net-next v6 4/4] netvsc: refactor notifier/event handling code to use the bypass framework)

2019-02-27 Thread Michael S. Tsirkin
On Wed, Feb 27, 2019 at 04:52:05PM -0800, Jakub Kicinski wrote: > On Wed, 27 Feb 2019 19:41:32 -0500, Michael S. Tsirkin wrote: > > > As this scheme adds much complexity to the kernel naming convention > > > (currently it's just ethX names) that no userspace can understand. > > > > Anything that

Re: [PATCH] appletalk: Fix use-after-free in atalk_proc_exit

2019-02-27 Thread YueHaibing
On 2019/2/28 2:14, David Miller wrote: > From: Yue Haibing > Date: Wed, 27 Feb 2019 22:59:00 +0800 > >> @@ -1925,7 +1925,10 @@ static int __init atalk_init(void) >> >> register_netdevice_notifier(&ddp_notifier); >> aarp_proto_init(); >> -atalk_proc_init(); >> +rc = atalk_proc_

Re: [PATCH] bpf: drop refcount if bpf_map_new_fd() fails in map_create()

2019-02-27 Thread Alexei Starovoitov
On Wed, Feb 27, 2019 at 04:52:16PM +, Martin Lau wrote: > On Wed, Feb 27, 2019 at 10:36:25PM +0800, zerons wrote: > > In bpf/syscall.c, map_create() first set map->usercnt to 1, a file > > descriptor is > > supposed to return to userspace. When bpf_map_new_fd() fails, drop the > > refcount. >

Re: [PATCH bpf-next 0/2] bpf: set inner_map_meta->spin_lock_off correctly

2019-02-27 Thread Alexei Starovoitov
On Wed, Feb 27, 2019 at 01:22:56PM -0800, Yonghong Song wrote: > The inner_map_meta->spin_lock_off is not set correctly during > map creation for BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_HASH_OF_MAPS. > This may lead verifier error due to misinformation. > This patch set fixed the issue with Pat

[PATCH bpf-next 5/7] selftests: bpf: break up test_progs - tracepoint

2019-02-27 Thread Stanislav Fomichev
Move tracepoint prog tests into separate files. Signed-off-by: Stanislav Fomichev --- .../bpf/prog_tests/get_stack_raw_tp.c | 139 ++ .../bpf/prog_tests/task_fd_query_rawtp.c | 78 .../bpf/prog_tests/task_fd_query_tp.c | 82 .../bpf/prog_tests/tp_attach_query

[PATCH bpf-next 7/7] selftests: bpf: break up test_progs - misc

2019-02-27 Thread Stanislav Fomichev
Move the rest of prog tests into separate files. Signed-off-by: Stanislav Fomichev --- .../selftests/bpf/prog_tests/bpf_obj_id.c | 249 ++ .../selftests/bpf/prog_tests/flow_dissector.c | 72 ++ .../selftests/bpf/prog_tests/l4lb_all.c | 90 +++ .../selftests/bpf/prog_tests/obj_nam

[PATCH bpf-next 6/7] selftests: bpf: break up test_progs - spinlock

2019-02-27 Thread Stanislav Fomichev
Move spinlock prog tests into separate files. Signed-off-by: Stanislav Fomichev --- .../selftests/bpf/prog_tests/map_lock.c | 75 + .../selftests/bpf/prog_tests/spinlock.c | 29 + tools/testing/selftests/bpf/test_progs.c | 104 +- tools/testing/

[PATCH bpf-next 3/7] selftests: bpf: break up test_progs - xdp

2019-02-27 Thread Stanislav Fomichev
Move xdp prog tests into separate files. Signed-off-by: Stanislav Fomichev --- tools/testing/selftests/bpf/prog_tests/xdp.c | 46 + .../bpf/prog_tests/xdp_adjust_tail.c | 31 .../selftests/bpf/prog_tests/xdp_noinline.c | 82 + tools/testing/selftests/bpf/test_prog

  1   2   3   4   >