Re: [PATCH 00/12 net-next,v2] add flow_rule infrastructure

2018-11-20 Thread Jiri Pirko
Tue, Nov 20, 2018 at 06:16:40PM CET, da...@davemloft.net wrote: >From: Jiri Pirko >Date: Tue, 20 Nov 2018 08:39:12 +0100 > >> If later on the netfilter code will use it, through another >> ndo/notifier/whatever, that is side a nice side-effect in my >> opinion. > >Netfilter HW offloading is the

Re: [PATCH net] sctp: hold transport before accessing its asoc in sctp_hash_transport

2018-11-20 Thread Xin Long
On Wed, Nov 21, 2018 at 9:46 AM Marcelo Ricardo Leitner wrote: > > On Tue, Nov 20, 2018 at 07:52:48AM -0500, Neil Horman wrote: > > On Tue, Nov 20, 2018 at 07:09:16PM +0800, Xin Long wrote: > > > In sctp_hash_transport, it dereferences a transport's asoc only under > > > rcu_read_lock. Without

[iproute2-next PATCH v4] tc: flower: Classify packets based port ranges

2018-11-20 Thread Amritha Nambiar
Added support for filtering based on port ranges. UAPI changes have been accepted into net-next. Example: 1. Match on a port range: - $ tc filter add dev enp4s0 protocol ip parent :\ prio 1 flower ip_proto tcp dst_port range 20-30 skip_hw\ action drop $ tc -s

Re: [iproute2-next PATCH v3 2/2] man: tc-flower: Add explanation for range option

2018-11-20 Thread Nambiar, Amritha
On 11/20/2018 8:59 PM, David Ahern wrote: > On 11/20/18 9:59 PM, Nambiar, Amritha wrote: >> Oops, submitted the v2 patch for man changes too soon, without seeing >> this. So, in this case, should I re-submit the iproute2-flower patch >> that was accepted removing the 'range' keyword? > > I think

Re: netns_id in bpf_sk_lookup_{tcp,udp}

2018-11-20 Thread David Ahern
On 11/20/18 2:05 AM, Nicolas Dichtel wrote: > Le 20/11/2018 à 00:46, David Ahern a écrit : > [snip] >> That revelation shows another hole: >> $ ip netns add foo >> $ ip netns set foo 0x > It also works with 0xf000 ... > >> $ ip netns list >> foo (id: 0) >> >> Seems like alloc_netid()

Re: [net-next 00/11][pull request] 100GbE Intel Wired LAN Driver Updates 2018-11-20

2018-11-20 Thread David Miller
From: Jeff Kirsher Date: Tue, 20 Nov 2018 12:22:36 -0800 > This series contains updates to the ice driver only. Pulled, thanks Jeff.

Re: [iproute2-next PATCH v3 2/2] man: tc-flower: Add explanation for range option

2018-11-20 Thread David Ahern
On 11/20/18 9:59 PM, Nambiar, Amritha wrote: > Oops, submitted the v2 patch for man changes too soon, without seeing > this. So, in this case, should I re-submit the iproute2-flower patch > that was accepted removing the 'range' keyword? I think so. Consistency across commands is a good thing.

Re: [iproute2-next PATCH v3 2/2] man: tc-flower: Add explanation for range option

2018-11-20 Thread Nambiar, Amritha
On 11/20/2018 8:46 PM, David Ahern wrote: > On 11/20/18 9:44 PM, Nambiar, Amritha wrote: >> On 11/20/2018 2:56 PM, David Ahern wrote: >>> On 11/15/18 5:55 PM, Amritha Nambiar wrote: Add details explaining filtering based on port ranges. Signed-off-by: Amritha Nambiar ---

Re: [PATCH v4 net-next 0/6] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers

2018-11-20 Thread David Miller
From: Date: Tue, 20 Nov 2018 15:55:04 -0800 > This series of patches is to modify the original KSZ9477 DSA driver so > that other KSZ switch drivers can be added and use the common code. Series applied.

[PATCH v5 bpf-next 0/2] bpf: adding support for mapinmap in libbpf

2018-11-20 Thread Nikita V. Shirokov
in this patch series i'm adding a helper for libbpf which would allow it to load map-in-map(BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_HASH_OF_MAPS). first patch contains new helper + explains proposed workflow second patch contains tests which also could be used as example of usage v4->v5: -

[PATCH v5 bpf-next 2/2] bpf: adding tests for map_in_map helpber in libbpf

2018-11-20 Thread Nikita V. Shirokov
adding test/example of bpf_map__set_inner_map_fd usage Signed-off-by: Nikita V. Shirokov Acked-by: Yonghong Song --- tools/testing/selftests/bpf/Makefile | 3 +- tools/testing/selftests/bpf/test_map_in_map.c | 49 +++ tools/testing/selftests/bpf/test_maps.c | 90

[PATCH v5 bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-20 Thread Nikita V. Shirokov
idea is pretty simple. for specified map (pointed by struct bpf_map) we would provide descriptor of already loaded map, which is going to be used as a prototype for inner map. proposed workflow: 1) open bpf's object (bpf_object__open) 2) create bpf's map which is going to be used as a prototype 3)

[iproute2-next PATCH v2] man: tc-flower: Add explanation for range option

2018-11-20 Thread Amritha Nambiar
Add details explaining filtering based on port ranges. v2: Modified description to remove range as standalone option and updated as part of dst_port/src_port. Signed-off-by: Amritha Nambiar --- man/man8/tc-flower.8 | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff

Re: [iproute2-next PATCH v3 2/2] man: tc-flower: Add explanation for range option

2018-11-20 Thread David Ahern
On 11/20/18 9:44 PM, Nambiar, Amritha wrote: > On 11/20/2018 2:56 PM, David Ahern wrote: >> On 11/15/18 5:55 PM, Amritha Nambiar wrote: >>> Add details explaining filtering based on port ranges. >>> >>> Signed-off-by: Amritha Nambiar >>> --- >>> man/man8/tc-flower.8 | 12 ++-- >>> 1

Re: [iproute2-next PATCH v3 2/2] man: tc-flower: Add explanation for range option

2018-11-20 Thread Nambiar, Amritha
On 11/20/2018 2:56 PM, David Ahern wrote: > On 11/15/18 5:55 PM, Amritha Nambiar wrote: >> Add details explaining filtering based on port ranges. >> >> Signed-off-by: Amritha Nambiar >> --- >> man/man8/tc-flower.8 | 12 ++-- >> 1 file changed, 10 insertions(+), 2 deletions(-) >> >>

RE: thunderx: nicvf_xdp_setup error code path

2018-11-20 Thread Goutham, Sunil
> -Original Message- > From: Lorenzo Bianconi > Sent: 20 November 2018 23:27 > To: netdev@vger.kernel.org > Cc: Goutham, Sunil > Subject: net: thunderx: nicvf_xdp_setup error code path > > External Email > > Hi all, > > looking at thunderx XDP support I noticed that nic->xdp_prog

Re: [PATCH v4 net-next 0/6] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers

2018-11-20 Thread Florian Fainelli
On 11/20/2018 3:55 PM, tristram...@microchip.com wrote: > From: Tristram Ha > > This series of patches is to modify the original KSZ9477 DSA driver so > that other KSZ switch drivers can be added and use the common code. > > There are several steps to accomplish this achievement. First is

Re: [PATCH v4 net-next 6/6] net: dsa: microchip: rename ksz_9477_reg.h to ksz9477_reg.h

2018-11-20 Thread Florian Fainelli
On 11/20/2018 3:55 PM, tristram...@microchip.com wrote: > From: Tristram Ha > > Rename ksz_9477_reg.h to ksz9477_reg.h for consistency as the product > name is always KSZ. > > Signed-off-by: Tristram Ha > Reviewed-by: Woojung Huh > Reviewed-by: Andrew Lunn Reviewed-by: Florian

Re: [PATCH v4 net-next 1/6] net: dsa: microchip: replace license with GPL

2018-11-20 Thread Florian Fainelli
On 11/20/2018 3:55 PM, tristram...@microchip.com wrote: > From: Tristram Ha > > Replace license with GPL. > > Signed-off-by: Tristram Ha > Reviewed-by: Woojung Huh > Reviewed-by: Andrew Lunn > Acked-by: Pavel Machek Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH net v2] net/sched: act_police: fix race condition on state variables

2018-11-20 Thread Cong Wang
On Tue, Nov 20, 2018 at 3:30 PM Eric Dumazet wrote: > > On Tue, Nov 20, 2018 at 3:28 PM David Miller wrote: > > > > Applied. > > We need a fix to make lockdep happy, as reported by Cong. > > Cong, do you want to handle this ? > I hope Davide could send a followup fix and really test it with

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-20 Thread Herbert Xu
On Tue, Nov 20, 2018 at 10:18:17AM -0800, Eric Dumazet wrote: > > > Something like this? Is it safe to linearize here? It looks safe to me. It's only unsafe if your skb is shared which from my grepping does not appear to be the case (and it cannot be shared if you're modifying skb->csum which

Re: [PATCH net] sctp: count sk_wmem_alloc by skb truesize in sctp_packet_transmit

2018-11-20 Thread David Miller
From: Marcelo Ricardo Leitner Date: Tue, 20 Nov 2018 22:56:07 -0200 > On Mon, Nov 19, 2018 at 12:39:55PM -0800, David Miller wrote: >> From: Xin Long >> Date: Sun, 18 Nov 2018 15:07:38 +0800 >> >> > Now sctp increases sk_wmem_alloc by 1 when doing set_owner_w for the >> > skb allocked in

Re: [PATCH v1 net] lan743x: fix return value for lan743x_tx_napi_poll

2018-11-20 Thread David Miller
From: Date: Wed, 21 Nov 2018 02:13:30 + > Slightly out of topic I am not sure why NAPI is used on the transmit side. > Originally NAPI was designed to fix the receive interrupt happening on each > receive frame problem, so on transmit side it is to avoid the transmit > done interrupt on each

[PATCH net-next,v3 01/12] flow_dissector: add flow_rule and flow_match structures and use them

2018-11-20 Thread Pablo Neira Ayuso
This patch wraps the dissector key and mask - that flower uses to represent the matching side - around the flow_match structure. To avoid a follow up patch that would edit the same LoCs in the drivers, this patch also wraps this new flow match structure around the flow rule object. This new

[PATCH net-next,v3 05/12] cls_flower: add statistics retrieval infrastructure and use it

2018-11-20 Thread Pablo Neira Ayuso
This patch provides the flow_stats structure that acts as container for tc_cls_flower_offload, then we can use to restore the statistics on the existing TC actions. Hence, tcf_exts_stats_update() is not used from drivers. Signed-off-by: Pablo Neira Ayuso --- v3: Suggested by Jiri Pirko:

[PATCH net-next,v3 07/12] cls_flower: don't expose TC actions to drivers anymore

2018-11-20 Thread Pablo Neira Ayuso
Now that drivers have been converted to use the flow action infrastructure, remove this field from the tc_cls_flower_offload structure. Signed-off-by: Pablo Neira Ayuso --- v3: no changes. include/net/pkt_cls.h | 1 - net/sched/cls_flower.c | 5 - 2 files changed, 6 deletions(-) diff

[PATCH net-next,v3 06/12] drivers: net: use flow action infrastructure

2018-11-20 Thread Pablo Neira Ayuso
This patch updates drivers to use the new flow action infrastructure. Signed-off-by: Pablo Neira Ayuso --- v3: rebase on top of previous patches. drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 74 +++--- .../net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c | 250 +--

[PATCH net-next,v3 11/12] qede: place ethtool_rx_flow_spec after code after TC flower codebase

2018-11-20 Thread Pablo Neira Ayuso
This is a preparation patch to reuse the existing TC flower codebase from ethtool_rx_flow_spec. This patch is merely moving the core ethtool_rx_flow_spec parser after tc flower offload driver code so we can skip a few forward function declarations in the follow up patch. Signed-off-by: Pablo

[PATCH net-next,v3 02/12] net/mlx5e: support for two independent packet edit actions

2018-11-20 Thread Pablo Neira Ayuso
This patch adds pedit_headers_action structure to store the result of parsing tc pedit actions. Then, it calls alloc_tc_pedit_action() to populate the mlx5e hardware intermediate representation once all actions have been parsed. This patch comes in preparation for the new flow_action

[PATCH net-next,v3 09/12] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator

2018-11-20 Thread Pablo Neira Ayuso
This patch adds a function to translate the ethtool_rx_flow_spec structure to the flow_rule representation. This allows us to reuse code from the driver side given that both flower and ethtool_rx_flow interfaces use the same representation. Signed-off-by: Pablo Neira Ayuso --- v3: Suggested by

[PATCH net-next,v3 08/12] flow_dissector: add wake-up-on-lan and queue to flow_action

2018-11-20 Thread Pablo Neira Ayuso
These actions need to be added to support bcm sf2 features available through the ethtool_rx_flow interface. Reviewed-by: Florian Fainelli Signed-off-by: Pablo Neira Ayuso --- v3: no changes. include/net/flow_offload.h | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH net-next,v3 04/12] cls_api: add translator to flow_action representation

2018-11-20 Thread Pablo Neira Ayuso
This patch implements a new function to translate from native TC action to the new flow_action representation. Moreover, this patch also updates cls_flower to use this new function. Signed-off-by: Pablo Neira Ayuso --- v3: add tcf_exts_num_actions() and pass it to flow_rule_alloc() to calculate

[PATCH net-next,v3 10/12] dsa: bcm_sf2: use flow_rule infrastructure

2018-11-20 Thread Pablo Neira Ayuso
Update this driver to use the flow_rule infrastructure, hence we can use the same code to populate hardware IR from ethtool_rx_flow and the cls_flower interfaces. Signed-off-by: Pablo Neira Ayuso --- v3: adapt it to use new ethtool_rx_flow_rule_alloc() drivers/net/dsa/bcm_sf2_cfp.c | 109

[PATCH net-next,v3 12/12] qede: use ethtool_rx_flow_rule() to remove duplicated parser code

2018-11-20 Thread Pablo Neira Ayuso
The qede driver supports for ethtool_rx_flow_spec and flower, both codebases look very similar. This patch uses the ethtool_rx_flow_rule() infrastructure to remove the duplicated ethtool_rx_flow_spec parser and consolidate ACL offload support around the flow_rule infrastructure. Furthermore,

[PATCH net-next,v3 03/12] flow_dissector: add flow action infrastructure

2018-11-20 Thread Pablo Neira Ayuso
This new infrastructure defines the nic actions that you can perform from existing network drivers. This infrastructure allows us to avoid a direct dependency with the native software TC action representation. Signed-off-by: Pablo Neira Ayuso --- v3: Suggested by Jiri Pirko: - Remove

[PATCH net-next,v3 00/12] add flow_rule infrastructure

2018-11-20 Thread Pablo Neira Ayuso
Hi, This patchset is the third iteration [1] [2] [3] to introduce a kernel intermediate (IR) to express ACL hardware offloads. This round addresses feedback from Jiri Pirko: * Add net/core/flow_offload.c and include/net/flow_offload.h. * Add flow_rule_alloc() helper function. * Remove _key

Re: [PATCH bpf-next] bpf: libbpf: retry program creation without the name

2018-11-20 Thread Quentin Monnet
2018-11-20 15:26 UTC-0800 ~ Stanislav Fomichev > On 11/20, Alexei Starovoitov wrote: >> On Wed, Nov 21, 2018 at 12:18:57AM +0100, Daniel Borkmann wrote: >>> On 11/21/2018 12:04 AM, Alexei Starovoitov wrote: On Tue, Nov 20, 2018 at 01:19:05PM -0800, Stanislav Fomichev wrote: > On 11/20,

Re: [PATCH bpf-next v2] libbpf: make sure bpf headers are c++ include-able

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 05:59:52PM -0800, Stanislav Fomichev wrote: > On 11/20, Alexei Starovoitov wrote: > > On Tue, Nov 20, 2018 at 04:05:55PM -0800, Stanislav Fomichev wrote: > > > On 11/20, Alexei Starovoitov wrote: > > > > On Tue, Nov 20, 2018 at 01:37:23PM -0800, Stanislav Fomichev wrote: >

Re: [PATCH bpf-next] bpf: add read/write access to skb->tstamp from tc clsact progs

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 07:18:48PM -0500, Vlad Dumitrescu wrote: > This could be used to rate limit egress traffic in concert with a qdisc > which supports Earliest Departure Time, such as FQ. > > Signed-off-by: Vlad Dumitrescu > --- > include/uapi/linux/bpf.h| 1 + >

RE: [PATCH v1 net] lan743x: fix return value for lan743x_tx_napi_poll

2018-11-20 Thread Tristram.Ha
Slightly out of topic I am not sure why NAPI is used on the transmit side. Originally NAPI was designed to fix the receive interrupt happening on each receive frame problem, so on transmit side it is to avoid the transmit done interrupt on each transmit frame? Typically hardware has a way to

[Patch net-next 2/2] net: dump whole skb data in netdev_rx_csum_fault()

2018-11-20 Thread Cong Wang
Currently, we only dump a few selected skb fields in netdev_rx_csum_fault(). It is not suffient for debugging checksum fault. This patch introduces skb_dump() which dumps skb mac header, network header and its whole skb->data too. Cc: Herbert Xu Cc: Eric Dumazet Cc: David Miller Signed-off-by:

[Patch net-next 1/2] net: introduce skb_network_header_was_set()

2018-11-20 Thread Cong Wang
Signed-off-by: Cong Wang --- include/linux/skbuff.h | 5 + net/core/skbuff.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a2e8297a5b00..afddb5c17ce5 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@

Re: [PATCH v4 bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 05:33:43PM -0800, Nikita V. Shirokov wrote: > idea is pretty simple. for specified map (pointed by struct bpf_map) > we would provide descriptor of already loaded map, which is going to be > used as a prototype for inner map. proposed workflow: > 1) open bpf's object

Re: [PATCH bpf-next] bpf: add read/write access to skb->tstamp from tc clsact progs

2018-11-20 Thread Willem de Bruijn
On Tue, Nov 20, 2018 at 8:22 PM Eric Dumazet wrote: > > > > On 11/20/2018 04:18 PM, Vlad Dumitrescu wrote: > > This could be used to rate limit egress traffic in concert with a qdisc > > which supports Earliest Departure Time, such as FQ. > > > > Signed-off-by: Vlad Dumitrescu > > --- > >

Re: [PATCH bpf-next v2] libbpf: make sure bpf headers are c++ include-able

2018-11-20 Thread Stanislav Fomichev
On 11/20, Alexei Starovoitov wrote: > On Tue, Nov 20, 2018 at 04:05:55PM -0800, Stanislav Fomichev wrote: > > On 11/20, Alexei Starovoitov wrote: > > > On Tue, Nov 20, 2018 at 01:37:23PM -0800, Stanislav Fomichev wrote: > > > > Wrap headers in extern "C", to turn off C++ mangling. > > > > This

Re: [PATCH net-next] net: don't keep lonely packets forever in the gro hash

2018-11-20 Thread Willem de Bruijn
On Tue, Nov 20, 2018 at 1:19 PM Paolo Abeni wrote: > > Eric noted that with UDP GRO and NAPI timeout, we could keep a single > UDP packet inside the GRO hash forever, if the related NAPI instance > calls napi_gro_complete() at an higher frequency than the NAPI timeout. > Willem noted that even

[PATCH v4 bpf-next 2/2] bpf: adding tests for mapinmap helpber in libbpf

2018-11-20 Thread Nikita V. Shirokov
adding test/example of bpf_map__add_inner_map_fd usage Signed-off-by: Nikita V. Shirokov Acked-by: Yonghong Song --- tools/testing/selftests/bpf/Makefile| 3 +- tools/testing/selftests/bpf/test_mapinmap.c | 49 + tools/testing/selftests/bpf/test_maps.c | 82

[PATCH v4 bpf-next 0/2] bpf: adding support for mapinmap in libbpf

2018-11-20 Thread Nikita V. Shirokov
in this patch series i'm adding a helper for libbpf which would allow it to load map-in-map(BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_HASH_OF_MAPS). first patch contains new helper + explains proposed workflow second patch contains tests which also could be used as example of usage v3->v4: -

[PATCH v4 bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-20 Thread Nikita V. Shirokov
idea is pretty simple. for specified map (pointed by struct bpf_map) we would provide descriptor of already loaded map, which is going to be used as a prototype for inner map. proposed workflow: 1) open bpf's object (bpf_object__open) 2) create bpf's map which is going to be used as a prototype 3)

[PATCH bpf-next v3 3/3] bpf: libbpf: don't specify prog name if kernel doesn't support it

2018-11-20 Thread Stanislav Fomichev
Use recently added capability check. See commit 23499442c319 ("bpf: libbpf: retry map creation without the name") for rationale. Signed-off-by: Stanislav Fomichev --- tools/lib/bpf/libbpf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/libbpf.c

[PATCH bpf-next v3 2/3] bpf: libbpf: remove map name retry from bpf_create_map_xattr

2018-11-20 Thread Stanislav Fomichev
Instead, check for a newly created caps.name bpf_object capability. If kernel doesn't support names, don't specify the attribute. See commit 23499442c319 ("bpf: libbpf: retry map creation without the name") for rationale. Signed-off-by: Stanislav Fomichev --- tools/lib/bpf/bpf.c| 11

[PATCH bpf-next v3 1/3] bpf, libbpf: introduce bpf_object__probe_caps to test BPF capabilities

2018-11-20 Thread Stanislav Fomichev
It currently only checks whether kernel supports map/prog names. This capability check will be used in the next two commits to skip setting prog/map names. Suggested-by: Daniel Borkmann Signed-off-by: Stanislav Fomichev --- tools/lib/bpf/libbpf.c | 58 ++

Re: [PATCH net] sctp: count sk_wmem_alloc by skb truesize in sctp_packet_transmit

2018-11-20 Thread Marcelo Ricardo Leitner
On Mon, Nov 19, 2018 at 12:39:55PM -0800, David Miller wrote: > From: Xin Long > Date: Sun, 18 Nov 2018 15:07:38 +0800 > > > Now sctp increases sk_wmem_alloc by 1 when doing set_owner_w for the > > skb allocked in sctp_packet_transmit and decreases by 1 when freeing > > this skb. > > > > But

Re: [PATCH bpf-next] bpf: add read/write access to skb->tstamp from tc clsact progs

2018-11-20 Thread Eric Dumazet
On 11/20/2018 04:18 PM, Vlad Dumitrescu wrote: > This could be used to rate limit egress traffic in concert with a qdisc > which supports Earliest Departure Time, such as FQ. > > Signed-off-by: Vlad Dumitrescu > --- > include/uapi/linux/bpf.h| 1 + > net/core/filter.c

Re: [PATCH net] sctp: hold transport before accessing its asoc in sctp_hash_transport

2018-11-20 Thread Marcelo Ricardo Leitner
On Tue, Nov 20, 2018 at 07:52:48AM -0500, Neil Horman wrote: > On Tue, Nov 20, 2018 at 07:09:16PM +0800, Xin Long wrote: > > In sctp_hash_transport, it dereferences a transport's asoc only under > > rcu_read_lock. Without holding the transport, its asoc could be freed > > already, which leads to a

[PATCH bpf-next] bpf: add read/write access to skb->tstamp from tc clsact progs

2018-11-20 Thread Vlad Dumitrescu
This could be used to rate limit egress traffic in concert with a qdisc which supports Earliest Departure Time, such as FQ. Signed-off-by: Vlad Dumitrescu --- include/uapi/linux/bpf.h| 1 + net/core/filter.c | 26 +

Re: [PATCH bpf-next v2] libbpf: make sure bpf headers are c++ include-able

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 04:05:55PM -0800, Stanislav Fomichev wrote: > On 11/20, Alexei Starovoitov wrote: > > On Tue, Nov 20, 2018 at 01:37:23PM -0800, Stanislav Fomichev wrote: > > > Wrap headers in extern "C", to turn off C++ mangling. > > > This simplifies including libbpf in c++ and linking

Re: [PATCH bpf-next v2] libbpf: make sure bpf headers are c++ include-able

2018-11-20 Thread Stanislav Fomichev
On 11/20, Alexei Starovoitov wrote: > On Tue, Nov 20, 2018 at 01:37:23PM -0800, Stanislav Fomichev wrote: > > Wrap headers in extern "C", to turn off C++ mangling. > > This simplifies including libbpf in c++ and linking against it. > > > > v2 changes: > > * do the same for btf.h > > > >

Re: BPF probe namespacing

2018-11-20 Thread Alexei Starovoitov
On Mon, Nov 19, 2018 at 03:29:07PM +, Peter Parkanyi wrote: > Hi, > > At LPC I raised the observation that currently it doesn't seem > feasible to insert a BPF probe from within a container that sees > events happening outside of the container, while it is possible to > insert a kernel

[PATCH v4 net-next 5/6] net: dsa: microchip: break KSZ9477 DSA driver into two files

2018-11-20 Thread Tristram.Ha
From: Tristram Ha Break KSZ9477 DSA driver into two files in preparation to add more KSZ switch drivers. Add common functions in ksz_common.h so that other KSZ switch drivers can access code in ksz_common.c. Add ksz_spi.h for common functions used by KSZ switch SPI drivers. Signed-off-by:

[PATCH v4 net-next 2/6] net: dsa: microchip: clean up code

2018-11-20 Thread Tristram.Ha
From: Tristram Ha Clean up code according to patch check suggestions. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Pavel Machek Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn --- drivers/net/dsa/microchip/ksz_common.c | 8 1 file changed, 4

[PATCH v4 net-next 3/6] net: dsa: microchip: rename some functions with ksz9477 prefix

2018-11-20 Thread Tristram.Ha
From: Tristram Ha Rename some functions with ksz9477 prefix to separate chip specific code from common code. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Pavel Machek Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn --- drivers/net/dsa/microchip/ksz_common.c |

[PATCH v4 net-next 6/6] net: dsa: microchip: rename ksz_9477_reg.h to ksz9477_reg.h

2018-11-20 Thread Tristram.Ha
From: Tristram Ha Rename ksz_9477_reg.h to ksz9477_reg.h for consistency as the product name is always KSZ. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Andrew Lunn --- drivers/net/dsa/microchip/ksz9477.c | 2 +-

[PATCH v4 net-next 1/6] net: dsa: microchip: replace license with GPL

2018-11-20 Thread Tristram.Ha
From: Tristram Ha Replace license with GPL. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Andrew Lunn Acked-by: Pavel Machek --- drivers/net/dsa/microchip/ksz_9477_reg.h | 17 +++-- drivers/net/dsa/microchip/ksz_common.c | 15 ++-

[PATCH v4 net-next 0/6] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers

2018-11-20 Thread Tristram.Ha
From: Tristram Ha This series of patches is to modify the original KSZ9477 DSA driver so that other KSZ switch drivers can be added and use the common code. There are several steps to accomplish this achievement. First is to rename some function names with a prefix to indicate chip specific

[PATCH v4 net-next 4/6] net: dsa: microchip: rename ksz_spi.c to ksz9477_spi.c

2018-11-20 Thread Tristram.Ha
From: Tristram Ha Rename ksz_spi.c to ksz9477_spi.c and update Kconfig in preparation to add more KSZ switch drivers. Signed-off-by: Tristram Ha Reviewed-by: Woojung Huh Reviewed-by: Pavel Machek Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn --- drivers/net/dsa/microchip/Kconfig

Re: [PATCH bpf-next v2] libbpf: make sure bpf headers are c++ include-able

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 01:37:23PM -0800, Stanislav Fomichev wrote: > Wrap headers in extern "C", to turn off C++ mangling. > This simplifies including libbpf in c++ and linking against it. > > v2 changes: > * do the same for btf.h > > Signed-off-by: Stanislav Fomichev > --- >

Re: [PATCH net v2] net/sched: act_police: fix race condition on state variables

2018-11-20 Thread Eric Dumazet
On Tue, Nov 20, 2018 at 3:28 PM David Miller wrote: > > From: Davide Caratti > Date: Tue, 20 Nov 2018 22:18:44 +0100 > > > after 'police' configuration parameters were converted to use RCU instead > > of spinlock, the state variables used to compute the traffic rate (namely > > 'tcfp_toks',

Re: [PATCH net v2] net/sched: act_police: fix race condition on state variables

2018-11-20 Thread David Miller
From: Davide Caratti Date: Tue, 20 Nov 2018 22:18:44 +0100 > after 'police' configuration parameters were converted to use RCU instead > of spinlock, the state variables used to compute the traffic rate (namely > 'tcfp_toks', 'tcfp_ptoks' and 'tcfp_t_c') are erroneously read/updated in > the

Re: [PATCH bpf-next] bpf: libbpf: retry program creation without the name

2018-11-20 Thread Stanislav Fomichev
On 11/20, Alexei Starovoitov wrote: > On Wed, Nov 21, 2018 at 12:18:57AM +0100, Daniel Borkmann wrote: > > On 11/21/2018 12:04 AM, Alexei Starovoitov wrote: > > > On Tue, Nov 20, 2018 at 01:19:05PM -0800, Stanislav Fomichev wrote: > > >> On 11/20, Alexei Starovoitov wrote: > > >>> On Mon, Nov 19,

Re: [PATCH bpf-next v2] bpf: fix a compilation error when CONFIG_BPF_SYSCALL is not defined

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 02:08:20PM -0800, Yonghong Song wrote: > Kernel test robot (l...@intel.com) reports a compilation error at > https://www.spinics.net/lists/netdev/msg534913.html > introduced by commit 838e96904ff3 ("bpf: Introduce bpf_func_info"). > > If CONFIG_BPF is defined and

Re: [PATCH bpf-next] bpf: libbpf: retry program creation without the name

2018-11-20 Thread Alexei Starovoitov
On Wed, Nov 21, 2018 at 12:18:57AM +0100, Daniel Borkmann wrote: > On 11/21/2018 12:04 AM, Alexei Starovoitov wrote: > > On Tue, Nov 20, 2018 at 01:19:05PM -0800, Stanislav Fomichev wrote: > >> On 11/20, Alexei Starovoitov wrote: > >>> On Mon, Nov 19, 2018 at 04:46:25PM -0800, Stanislav Fomichev

Re: [PATCH iproute2-next 2/8] json: add %hhu helpers

2018-11-20 Thread David Ahern
On 11/19/18 6:40 PM, Jakub Kicinski wrote: > On Mon, 19 Nov 2018 17:18:42 -0800, Stephen Hemminger wrote: >>> void jsonw_hu_field(json_writer_t *self, const char *prop, unsigned short >>> num) >>> { >>> jsonw_name(self, prop); >> >> Do you really need this? it turns out that because of C

Re: [PATCH bpf-next] bpf: libbpf: retry program creation without the name

2018-11-20 Thread Daniel Borkmann
On 11/21/2018 12:04 AM, Alexei Starovoitov wrote: > On Tue, Nov 20, 2018 at 01:19:05PM -0800, Stanislav Fomichev wrote: >> On 11/20, Alexei Starovoitov wrote: >>> On Mon, Nov 19, 2018 at 04:46:25PM -0800, Stanislav Fomichev wrote: [Recent commit 23499442c319 ("bpf: libbpf: retry map creation

Re: [PATCH v3 bpf-next 1/2] bpf: adding support for map in map in libbpf

2018-11-20 Thread Alexei Starovoitov
On Mon, Nov 19, 2018 at 10:42:21PM -0800, Nikita V. Shirokov wrote: > idea is pretty simple. for specified map (pointed by struct bpf_map) > we would provide descriptor of already loaded map, which is going to be > used as a prototype for inner map. proposed workflow: > 1) open bpf's object

[PATCH bpf-next v2 2/2] bpf: libbpf: move map name retry into libbpf.c

2018-11-20 Thread Stanislav Fomichev
To be in line with the previous commit ("bpf: libbpf: retry program creation without the name"), do the retry at the higher level, not the syscall level. Signed-off-by: Stanislav Fomichev --- tools/lib/bpf/bpf.c| 11 +-- tools/lib/bpf/libbpf.c | 11 +++ 2 files changed, 12

[PATCH bpf-next v2 1/2] bpf: libbpf: retry program creation without the name

2018-11-20 Thread Stanislav Fomichev
[Recent commit 23499442c319 ("bpf: libbpf: retry map creation without the name") fixed this issue for maps, let's do the same for programs.] Since commit 88cda1c9da02 ("bpf: libbpf: Provide basic API support to specify BPF obj name"), libbpf unconditionally sets bpf_attr->name for programs. Pre

Re: [PATCH bpf-next] bpf: libbpf: retry program creation without the name

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 01:19:05PM -0800, Stanislav Fomichev wrote: > On 11/20, Alexei Starovoitov wrote: > > On Mon, Nov 19, 2018 at 04:46:25PM -0800, Stanislav Fomichev wrote: > > > [Recent commit 23499442c319 ("bpf: libbpf: retry map creation without > > > the name") fixed this issue for maps,

Re: [iproute2-next PATCH v3 1/2] tc: flower: Classify packets based port ranges

2018-11-20 Thread David Ahern
On 11/15/18 5:55 PM, Amritha Nambiar wrote: > Added support for filtering based on port ranges. > UAPI changes have been accepted into net-next. > > Example: > 1. Match on a port range: > - > $ tc filter add dev enp4s0 protocol ip parent :\ > prio 1 flower ip_proto

Re: Kernel 4.19 network performance - forwarding/routing normal users traffic

2018-11-20 Thread Paweł Staszewski
W dniu 19.11.2018 o 22:59, David Ahern pisze: On 11/9/18 5:06 PM, David Ahern wrote: On 11/9/18 9:21 AM, David Ahern wrote: Is there possible to add only counters from xdp for vlans ? This will help me in testing. I will take a look today at adding counters that you can dump using bpftool.

Re: [iproute2-next PATCH v3 2/2] man: tc-flower: Add explanation for range option

2018-11-20 Thread David Ahern
On 11/15/18 5:55 PM, Amritha Nambiar wrote: > Add details explaining filtering based on port ranges. > > Signed-off-by: Amritha Nambiar > --- > man/man8/tc-flower.8 | 12 ++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/man/man8/tc-flower.8

Re: [PATCH v2 3/4] libbpf: require size hint in bpf_prog_test_run

2018-11-20 Thread Alexei Starovoitov
On Tue, Nov 20, 2018 at 07:43:57PM +, Lorenz Bauer wrote: > On Tue, 20 Nov 2018 at 19:18, Alexei Starovoitov > wrote: > > > > On Tue, Nov 20, 2018 at 03:43:05PM +, Lorenz Bauer wrote: > > > Require size_out to be non-NULL if data_out is given. This prevents > > > accidental overwriting of

Re: [PATCH net v2] net/sched: act_police: fix race condition on state variables

2018-11-20 Thread Cong Wang
On Tue, Nov 20, 2018 at 1:19 PM Davide Caratti wrote: > > after 'police' configuration parameters were converted to use RCU instead > of spinlock, the state variables used to compute the traffic rate (namely > 'tcfp_toks', 'tcfp_ptoks' and 'tcfp_t_c') are erroneously read/updated in > the traffic

Re: [PATCH iproute2 22/22] rdma: make local functions static

2018-11-20 Thread David Ahern
On 11/15/18 3:36 PM, Stephen Hemminger wrote: > Several functions only used inside utils.c > > Signed-off-by: Stephen Hemminger > --- > rdma/rdma.h | 11 --- > rdma/utils.c | 12 ++-- > 2 files changed, 6 insertions(+), 17 deletions(-) > this patch breaks builds for me on

Re: [PATCH net] MAINTAINERS: add myself as co-maintainer for r8169

2018-11-20 Thread David Miller
From: Heiner Kallweit Date: Tue, 20 Nov 2018 21:22:50 +0100 > Meanwhile I know the driver quite well and I refactored bigger parts > of it. As a result people contact me already with r8169 questions. > Therefore I'd volunteer to become co-maintainer of the driver also > officially. > >

[PATCH mlx5-next 08/11] net/mlx5: Resource tables, Use async events chain

2018-11-20 Thread Saeed Mahameed
Remove the explicit call to QP/SRQ resources events handlers on several FW events and let resources logic register resources events notifiers via the new API. Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 29

[PATCH mlx5-next 03/11] net/mlx5: FPGA, Use async events chain

2018-11-20 Thread Saeed Mahameed
Remove the explicit call to mlx5_fpga_event on MLX5_EVENT_TYPE_FPGA_ERROR or MLX5_EVENT_TYPE_FPGA_QP_ERROR let fpga core to register its own handler when its ready. Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 5 ---

[PATCH mlx5-next 01/11] net/mlx5: EQ, Introduce atomic notifier chain subscription API

2018-11-20 Thread Saeed Mahameed
Use atomic_notifier_chain to fire firmware events at internal mlx5 core components such as eswitch/fpga/clock/FW tracer/etc.., this is to avoid explicit calls from low level mlx5_core to upper components and to simplify the mlx5_core API for future developments. Simply provide register/unregister

[PATCH mlx5-next 10/11] net/mlx5: Device events, Use async events chain

2018-11-20 Thread Saeed Mahameed
Move all the generic async events handling into new specific events handling file events.c to keep eq.c file clean from concrete event logic handling. Use new API to register for NOTIFY_ANY to handle generic events and dispatch allowed events to mlx5_core consumers (mlx5_ib and mlx5e)

[PATCH mlx5-next 04/11] net/mlx5: Clock, Use async events chain

2018-11-20 Thread Saeed Mahameed
Remove the explicit call to mlx5_pps_event on MLX5_EVENT_TYPE_PPS_EVENT and let clock logic to register its own handler when its ready. Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 4 .../ethernet/mellanox/mlx5/core/lib/clock.c | 24

[PATCH mlx5-next 06/11] net/mlx5: FWPage, Use async events chain

2018-11-20 Thread Saeed Mahameed
Remove the explicit call to mlx5_core_req_pages_handler on MLX5_EVENT_TYPE_PAGE_REQUEST and let FW page logic to register its own handler when its ready. Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 11 - .../net/ethernet/mellanox/mlx5/core/main.c|

[PATCH mlx5-next 05/11] net/mlx5: E-Switch, Use async events chain

2018-11-20 Thread Saeed Mahameed
Remove the explicit call to mlx5_eswitch_vport_event on MLX5_EVENT_TYPE_NIC_VPORT_CHANGE and let the eswitch register its own handler when its ready. Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 4 -- .../net/ethernet/mellanox/mlx5/core/eswitch.c | 44

[PATCH mlx5-next 11/11] net/mlx5: Improve core device events handling

2018-11-20 Thread Saeed Mahameed
Register a separate handler per event type, rather than listening for all events and looking for the events to handle in a switch case. Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/events.c | 223 +++--- 1 file changed, 136 insertions(+), 87 deletions(-)

[PATCH mlx5-next 07/11] net/mlx5: CmdIF, Use async events chain

2018-11-20 Thread Saeed Mahameed
Remove the explicit call to mlx5_cmd_comp_handler on MLX5_EVENT_TYPE_CMD and let command interface to register its own handler when its ready. Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 48 ++- drivers/net/ethernet/mellanox/mlx5/core/eq.c

[PATCH mlx5-next 02/11] net/mlx5: FWTrace, Use async events chain

2018-11-20 Thread Saeed Mahameed
Remove the explicit call to mlx5_fw_tracer_event on MLX5_EVENT_TYPE_DEVICE_TRACER and let fw tracer to register its own handler when its ready. Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/diag/fw_tracer.c | 27 ++- .../mellanox/mlx5/core/diag/fw_tracer.h

[PATCH mlx5-next 00/11] mlx5 core internal firmware events handling improvements

2018-11-20 Thread Saeed Mahameed
Hi This patchset is for mlx5-next shared branch, and will be applied there once the review is done. The main idea of this change is to define a flexible scalable and simpler low level mlx5 core APIs to upper level components for better features decoupling and maximum code locality and

[PATCH mlx5-next 09/11] net/mlx5: CQ ERR, Use async events chain

2018-11-20 Thread Saeed Mahameed
Remove the explicit call to mlx5_eq_cq_event on MLX5_EVENT_TYPE_CQ_ERROR and register a specific CQ ERROR handler via the new API. Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 66 +--- 1 file changed, 44 insertions(+), 22 deletions(-) diff

Re: [PATCH bpf-next v2] libbpf: make sure bpf headers are c++ include-able

2018-11-20 Thread Y Song
On Tue, Nov 20, 2018 at 1:37 PM Stanislav Fomichev wrote: > > Wrap headers in extern "C", to turn off C++ mangling. > This simplifies including libbpf in c++ and linking against it. > > v2 changes: > * do the same for btf.h > > Signed-off-by: Stanislav Fomichev Acked-by: Yonghong Song > --- >

Re: [PATCH v1 net] lan743x: fix return value for lan743x_tx_napi_poll

2018-11-20 Thread Florian Fainelli
On 11/20/18 1:39 PM, bryan.whiteh...@microchip.com wrote: >> -Original Message- >> From: Andrew Lunn >> Sent: Tuesday, November 20, 2018 2:31 PM >> To: Bryan Whitehead - C21958 >> Cc: da...@davemloft.net; netdev@vger.kernel.org; UNGLinuxDriver >> >> Subject: Re: [PATCH v1 net] lan743x:

[PATCH bpf-next v2] bpf: fix a compilation error when CONFIG_BPF_SYSCALL is not defined

2018-11-20 Thread Yonghong Song
Kernel test robot (l...@intel.com) reports a compilation error at https://www.spinics.net/lists/netdev/msg534913.html introduced by commit 838e96904ff3 ("bpf: Introduce bpf_func_info"). If CONFIG_BPF is defined and CONFIG_BPF_SYSCALL is not defined, the following error will appear:

  1   2   3   >