Re: Cleanup of -Wunused-const-variable in drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c

2019-06-18 Thread Maxime Chevallier
Hello Nathan, On Thu, 13 Jun 2019 10:53:05 -0700 Nathan Huckleberry wrote: >Hey all, > >I'm looking into cleaning up ignored warnings in the kernel so we can >remove compiler flags to ignore warnings. > >There's an unused variable 'mvpp2_dbgfs_prs_pmap_fops' in >mvpp2_debugfs.c. It looks like th

Re: [PATCH ipsec] xfrm: fix sa selector validation

2019-06-18 Thread Steffen Klassert
On Sat, Jun 15, 2019 at 12:11:48AM +0800, Herbert Xu wrote: > On Fri, Jun 14, 2019 at 11:13:55AM +0200, Nicolas Dichtel wrote: > > After commit b38ff4075a80, the following command does not work anymore: > > $ ip xfrm state add src 10.125.0.2 dst 10.125.0.1 proto esp spi 34 reqid 1 \ > > mode tunn

Re: [PATCH net-next 0/2] net: sched: act_ctinfo: fixes

2019-06-18 Thread Kevin 'ldir' Darbyshire-Bryant
> On 17 Jun 2019, at 22:01, David Miller wrote: > > From: Kevin Darbyshire-Bryant > Date: Mon, 17 Jun 2019 11:03:25 +0100 > >> >> If I ever get to a developer conference please feel free to >> tar/feather/apply cone of shame. > > :-) In kernel networking development we prefer brown paper

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

2019-06-18 Thread wenxu
On 6/18/2019 6:42 AM, Florian Westphal wrote: > Pablo Neira Ayuso wrote: >>> Subject: Change bridge l3 dependency to meta protocol >>> >>> This examines skb->protocol instead of ethernet header type, which >>> might be different when vlan is involved. >>> >>> + if (ctx->pctx.family == NFPROT

Re: [PATCH net-next v1 09/11] xdp: force mem allocator removal and periodic warning

2019-06-18 Thread Jesper Dangaard Brouer
On Sat, 15 Jun 2019 11:59:16 +0300 Ivan Khoronzhuk wrote: > >@@ -388,10 +411,12 @@ static void __xdp_return(void *data, struct > >xdp_mem_info *mem, bool napi_direct, > > /* mem->id is valid, checked in xdp_rxq_info_reg_mem_model() */ > > xa = rhashtable_lookup(mem_id_ht,

Re: [RFC PATCH net-next 1/1] tc-testing: Restore original behaviour for namespaces in tdc

2019-06-18 Thread Nicolas Dichtel
Le 17/06/2019 à 04:04, Lucas Bates a écrit : > On Fri, Jun 14, 2019 at 5:37 AM Nicolas Dichtel > wrote: [snip] > The tests that make use of DEV2 are intended to be run with a physical > NIC. This feature was originally submitted by Chris Mi from Mellanox > back in 2017 (commit 31c2611b) to reprod

Re: [PATCH net-next v3 2/6] etf: Add skip_sock_check

2019-06-18 Thread Sergei Shtylyov
Hello! On 17.06.2019 22:31, Vedang Patel wrote: Currently, etf expects a socket with SO_TXTIME option set for each packet it encounters. So, it will drop all other packets. But, in the future commits we are planning to add functionality which where tstamp value will be set by another qdisc. Als

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

2019-06-18 Thread Pablo Neira Ayuso
On Tue, Jun 18, 2019 at 12:42:32AM +0200, Florian Westphal wrote: > Pablo Neira Ayuso wrote: > > > Subject: Change bridge l3 dependency to meta protocol > > > > > > This examines skb->protocol instead of ethernet header type, which > > > might be different when vlan is involved. > > > > > > + i

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

2019-06-18 Thread Florian Westphal
wenxu wrote: > On 6/18/2019 6:42 AM, Florian Westphal wrote: > > Pablo Neira Ayuso wrote: > >>> Subject: Change bridge l3 dependency to meta protocol > >>> > >>> This examines skb->protocol instead of ethernet header type, which > >>> might be different when vlan is involved. > >>> > >>> + if (

Re: [PATCH 0/2] net: fastopen: follow-up tweaks for SipHash switch

2019-06-18 Thread Eric Dumazet
On Tue, Jun 18, 2019 at 2:32 AM Ard Biesheuvel wrote: > > A pair of tweaks for issues spotted by Eric Biggers. Patch #1 is > mostly cosmetic, since the error check it adds is unreachable in > practice, and the other changes are syntactic cleanups. Patch #2 > adds endian swabbing of the SipHash out

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

2019-06-18 Thread Florian Westphal
Pablo Neira Ayuso wrote: > On Tue, Jun 18, 2019 at 12:42:32AM +0200, Florian Westphal wrote: > > Pablo Neira Ayuso wrote: > > > > Subject: Change bridge l3 dependency to meta protocol > > > > > > > > This examines skb->protocol instead of ethernet header type, which > > > > might be different wh

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

2019-06-18 Thread Pablo Neira Ayuso
On Tue, Jun 18, 2019 at 11:46:13AM +0200, Florian Westphal wrote: > Pablo Neira Ayuso wrote: [...] > > Could you describe this problem a bit more? Small example rule plus > > scenario. > > It was what wenxu reported originally: > > nft add rule bridge filter forward ip protocol counter .. > > T

Re: [PATCH mlx5-next 11/15] RDMA/mlx5: Add vport metadata matching for IB representors

2019-06-18 Thread Leon Romanovsky
On Mon, Jun 17, 2019 at 07:23:30PM +, Saeed Mahameed wrote: > From: Jianbo Liu > > If vport metadata matching is enabled in eswitch, the rule created > must be changed to match on the metadata, instead of source port. > > Signed-off-by: Jianbo Liu > Reviewed-by: Roi Dayan > Reviewed-by: Mark

RE: [PATCH mlx5-next 12/15] net/mlx5: E-Switch, Enable vport metadata matching if firmware supports it

2019-06-18 Thread Parav Pandit
> -Original Message- > From: linux-rdma-ow...@vger.kernel.org ow...@vger.kernel.org> On Behalf Of Saeed Mahameed > Sent: Tuesday, June 18, 2019 12:54 AM > To: Saeed Mahameed ; Leon Romanovsky > > Cc: netdev@vger.kernel.org; linux-r...@vger.kernel.org; Jianbo Liu > ; Roi Dayan ; Mark Blo

RE: [PATCH mlx5-next 05/15] net/mlx5: E-Switch, Tag packet with vport number in VF vports and uplink ingress ACLs

2019-06-18 Thread Parav Pandit
> -Original Message- > From: netdev-ow...@vger.kernel.org On > Behalf Of Saeed Mahameed > Sent: Tuesday, June 18, 2019 12:53 AM > To: Saeed Mahameed ; Leon Romanovsky > > Cc: netdev@vger.kernel.org; linux-r...@vger.kernel.org; Jianbo Liu > ; Eli Britstein ; Roi Dayan > ; Mark Bloch > S

Re: [PATCH mlx5-next 12/15] net/mlx5: E-Switch, Enable vport metadata matching if firmware supports it

2019-06-18 Thread Leon Romanovsky
On Tue, Jun 18, 2019 at 10:24:49AM +, Parav Pandit wrote: > > > > -Original Message- > > From: linux-rdma-ow...@vger.kernel.org > ow...@vger.kernel.org> On Behalf Of Saeed Mahameed > > Sent: Tuesday, June 18, 2019 12:54 AM > > To: Saeed Mahameed ; Leon Romanovsky > > > > Cc: netdev@vg

Re: [PATCH mlx5-next 15/15] RDMA/mlx5: Cleanup rep when doing unload

2019-06-18 Thread Leon Romanovsky
On Mon, Jun 17, 2019 at 07:23:39PM +, Saeed Mahameed wrote: > From: Bodong Wang > > When an IB rep is loaded, netdev for the same vport is saved for later > reference. However, it's not cleaned up when doing unload. For ECPF, > kernel crashes when driver is referring to the already removed net

Re: [PATCH mlx5-next 14/15] {IB, net}/mlx5: E-Switch, Use index of rep for vport to IB port mapping

2019-06-18 Thread Leon Romanovsky
On Mon, Jun 17, 2019 at 07:23:37PM +, Saeed Mahameed wrote: > From: Bodong Wang > > In the single IB device mode, the mapping between vport number and > rep relies on a counter. However for dynamic vport allocation, it is > desired to keep consistent map of eswitch vport and IB port. > > Hence

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

2019-06-18 Thread Florian Westphal
Pablo Neira Ayuso wrote: > On Tue, Jun 18, 2019 at 11:46:13AM +0200, Florian Westphal wrote: > > Pablo Neira Ayuso wrote: > [...] > > > Could you describe this problem a bit more? Small example rule plus > > > scenario. > > > > It was what wenxu reported originally: > > > > nft add rule bridge

RE: [PATCH mlx5-next 14/15] {IB, net}/mlx5: E-Switch, Use index of rep for vport to IB port mapping

2019-06-18 Thread Parav Pandit
Hi Leon, > -Original Message- > From: Leon Romanovsky > Sent: Tuesday, June 18, 2019 4:12 PM > To: Saeed Mahameed > Cc: netdev@vger.kernel.org; linux-r...@vger.kernel.org; Bodong Wang > ; Parav Pandit ; Mark Bloch > > Subject: Re: [PATCH mlx5-next 14/15] {IB, net}/mlx5: E-Switch, Use ind

RE: [PATCH mlx5-next 05/15] net/mlx5: E-Switch, Tag packet with vport number in VF vports and uplink ingress ACLs

2019-06-18 Thread Parav Pandit
> -Original Message- > From: netdev-ow...@vger.kernel.org On > Behalf Of Saeed Mahameed > Sent: Tuesday, June 18, 2019 12:53 AM > To: Saeed Mahameed ; Leon Romanovsky > > Cc: netdev@vger.kernel.org; linux-r...@vger.kernel.org; Jianbo Liu > ; Eli Britstein ; Roi Dayan > ; Mark Bloch > S

Re: [PATCH net-next 0/2] net: mediatek: Add MT7621 TRGMII mode support

2019-06-18 Thread René van Dorst
Quoting Florian Fainelli : Hi Andrew and Florian, On 6/17/2019 6:53 PM, Andrew Lunn wrote: By adding some extra speed states in the code it seems to work. + if (state->speed == 1200) + mcr |= PMCR_FORCE_SPEED_1000; Hi René Is TRGMII always 1.2G? Or can y

[PATCH 1/2] net: intel: igb: minor ethool regdump amendment

2019-06-18 Thread Artem Bityutskiy
From: Artem Bityutskiy This patch has no functional impact and it is just a preparation for the following patch. It removes an early return from the 'igb_get_regs()' function by moving the 82576-only registers dump into an "if" block. With this preparation, we can dump more non-82576 registers at

[PATCH 2/2] net: intel: igb: add RR2DCDELAY to ethtool registers dump

2019-06-18 Thread Artem Bityutskiy
From: Artem Bityutskiy This patch adds the RR2DCDELAY register to the ethtool registers dump. RR2DCDELAY exists on I210 and I211 Intel Gigabit Ethernet chips and it stands for "Read Request To Data Completion Delay". Here is how this register is described in the I210 datasheet: "This field captu

Re: [PATCH bpf-next v4 17/17] net/mlx5e: Add XSK zero-copy support

2019-06-18 Thread Maxim Mikityanskiy
On 2019-06-15 18:42, Jakub Kicinski wrote: > On Wed, 12 Jun 2019 15:57:09 +, Maxim Mikityanskiy wrote: >> @@ -390,6 +391,12 @@ void mlx5e_ethtool_get_channels(struct mlx5e_priv *priv, >> { >> ch->max_combined = mlx5e_get_netdev_max_channels(priv->netdev); >> ch->combined_count = p

Re: [PATCH bpf-next v4 05/17] xsk: Change the default frame size to 4096 and allow controlling it

2019-06-18 Thread Maxim Mikityanskiy
On 2019-06-15 04:40, Jakub Kicinski wrote: > On Fri, 14 Jun 2019 13:25:28 +, Maxim Mikityanskiy wrote: >> On 2019-06-13 20:29, Jakub Kicinski wrote: >>> On Thu, 13 Jun 2019 14:01:39 +, Maxim Mikityanskiy wrote: >>> >>> Yes, okay, I get that. But I still don't know what's the exact use you

Re: [PATCH bpf-next v4 07/17] libbpf: Support drivers with non-combined channels

2019-06-18 Thread Maxim Mikityanskiy
On 2019-06-14 20:15, Maciej Fijalkowski wrote: > On Fri, 14 Jun 2019 13:25:24 + > Maxim Mikityanskiy wrote: > >> On 2019-06-13 17:45, Maciej Fijalkowski wrote: >>> On Thu, 13 Jun 2019 14:01:39 + >>> Maxim Mikityanskiy wrote: >>> On 2019-06-12 23:23, Jakub Kicinski wrote: > O

[PATCH bpf-next v5 02/16] xsk: Add API to check for available entries in FQ

2019-06-18 Thread Maxim Mikityanskiy
Add a function that checks whether the Fill Ring has the specified amount of descriptors available. It will be useful for mlx5e that wants to check in advance, whether it can allocate a bulk of RX descriptors, to get the best performance. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Touka

[PATCH bpf-next v5 03/16] xsk: Add getsockopt XDP_OPTIONS

2019-06-18 Thread Maxim Mikityanskiy
Make it possible for the application to determine whether the AF_XDP socket is running in zero-copy mode. To achieve this, add a new getsockopt option XDP_OPTIONS that returns flags. The only flag supported for now is the zero-copy mode indicator. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Ta

[PATCH bpf-next v5 04/16] libbpf: Support getsockopt XDP_OPTIONS

2019-06-18 Thread Maxim Mikityanskiy
Query XDP_OPTIONS in libbpf to determine if the zero-copy mode is active or not. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed Acked-by: Björn Töpel --- tools/lib/bpf/xsk.c | 12 1 file changed, 12 insertions(+) diff --git a/tools/lib/bpf/x

[PATCH bpf-next v5 08/16] net/mlx5e: Calculate linear RX frag size considering XSK

2019-06-18 Thread Maxim Mikityanskiy
Additional conditions introduced: - XSK implies XDP. - Headroom includes the XSK headroom if it exists. - No space is reserved for struct shared_skb_info in XSK mode. - Fragment size smaller than the XSK chunk size is not allowed. A new auxiliary function mlx5e_get_linear_rq_headroom with the sup

[PATCH bpf-next v5 09/16] net/mlx5e: Allow ICO SQ to be used by multiple RQs

2019-06-18 Thread Maxim Mikityanskiy
Prepare to creation of the XSK RQ, which will require posting UMRs, too. The same ICO SQ will be used for both RQs and also to trigger interrupts by posting NOPs. UMR WQEs can't be reused any more. Optimization introduced in commit ab966d7e4ff98 ("net/mlx5e: RX, Recycle buffer of UMR WQEs") is reve

[PATCH bpf-next v5 13/16] net/mlx5e: Consider XSK in XDP MTU limit calculation

2019-06-18 Thread Maxim Mikityanskiy
Use the existing mlx5e_get_linear_rq_headroom function to calculate the headroom for mlx5e_xdp_max_mtu. This function takes the XSK headroom into consideration, which will be used in the following patches. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed ---

[PATCH bpf-next v5 10/16] net/mlx5e: Refactor struct mlx5e_xdp_info

2019-06-18 Thread Maxim Mikityanskiy
Currently, struct mlx5e_xdp_info has some issues that have to be cleaned up before the upcoming AF_XDP support makes things too complicated and messy. This structure is used both when sending the packet and on completion. Moreover, the cleanup procedure on completion depends on the origin of the pa

[PATCH bpf-next v5 12/16] net/mlx5e: XDP_TX from UMEM support

2019-06-18 Thread Maxim Mikityanskiy
When an XDP program returns XDP_TX, and the RQ is XSK-enabled, it requires careful handling, because convert_to_xdp_frame creates a new page and copies the data there, while our driver expects the xdp_frame to point to the same memory as the xdp_buff. Handle this case separately: map the page, and

[PATCH bpf-next v5 07/16] net/mlx5e: Replace deprecated PCI_DMA_TODEVICE

2019-06-18 Thread Maxim Mikityanskiy
The PCI API for DMA is deprecated, and PCI_DMA_TODEVICE is just defined to DMA_TO_DEVICE for backward compatibility. Just use DMA_TO_DEVICE. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 +- 1 file

[PATCH bpf-next v5 15/16] net/mlx5e: Move queue param structs to en/params.h

2019-06-18 Thread Maxim Mikityanskiy
structs mlx5e_{rq,sq,cq,channel}_param are going to be used in the upcoming XSK RX and TX patches. Move them to a header file to make them accessible from other C files. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/en/

[PATCH bpf-next v5 01/16] net/mlx5e: Attach/detach XDP program safely

2019-06-18 Thread Maxim Mikityanskiy
When an XDP program is set, a full reopen of all channels happens in two cases: 1. When there was no program set, and a new one is being set. 2. When there was a program set, but it's being unset. The full reopen is necessary, because the channel parameters may change if XDP is enabled or disabl

[PATCH bpf-next v5 05/16] xsk: Change the default frame size to 4096 and allow controlling it

2019-06-18 Thread Maxim Mikityanskiy
The typical XDP memory scheme is one packet per page. Change the AF_XDP frame size in libbpf to 4096, which is the page size on x86, to allow libbpf to be used with the drivers with the packet-per-page scheme. Add a command line option -f to xdpsock to allow to specify a custom frame size. Signed

[PATCH bpf-next v5 00/16] AF_XDP infrastructure improvements and mlx5e support

2019-06-18 Thread Maxim Mikityanskiy
This series contains improvements to the AF_XDP kernel infrastructure and AF_XDP support in mlx5e. The infrastructure improvements are required for mlx5e, but also some of them benefit to all drivers, and some can be useful for other drivers that want to implement AF_XDP. The performance testing w

[PATCH bpf-next v5 06/16] xsk: Return the whole xdp_desc from xsk_umem_consume_tx

2019-06-18 Thread Maxim Mikityanskiy
Some drivers want to access the data transmitted in order to implement acceleration features of the NICs. It is also useful in AF_XDP TX flow. Change the xsk_umem_consume_tx API to return the whole xdp_desc, that contains the data pointer, length and DMA address, instead of only the latter two. Ad

[PATCH bpf-next v5 14/16] net/mlx5e: Encapsulate open/close queues into a function

2019-06-18 Thread Maxim Mikityanskiy
Create new functions mlx5e_{open,close}_queues to encapsulate opening and closing RQs and SQs, and call the new functions from mlx5e_{open,close}_channel. It simplifies the existing functions a bit and prepares them for the upcoming AF_XDP changes. Signed-off-by: Maxim Mikityanskiy Reviewed-by: T

[PATCH bpf-next v5 11/16] net/mlx5e: Share the XDP SQ for XDP_TX between RQs

2019-06-18 Thread Maxim Mikityanskiy
Put the XDP SQ that is used for XDP_TX into the channel. It used to be a part of the RQ, but with introduction of AF_XDP there will be one more RQ that could share the same XDP SQ. This patch is a preparation for that change. Separate XDP_TX statistics per RQ were implemented in one of the previou

[PATCH net-next] mlxsw: spectrum_ptp: Fix compilation on 32-bit ARM

2019-06-18 Thread Shalom Toledo
Compilation on 32-bit ARM fails after commit 992aa864dca0 ("mlxsw: spectrum_ptp: Add implementation for physical hardware clock operations") because of 64-bit division: arm-linux-gnueabi-ld: drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.o: in function `mlxsw_sp1_ptp_phc_settime': spectrum_ptp.c

Re: [PATCH net-next v1 08/11] xdp: tracking page_pool resources and safe removal

2019-06-18 Thread Ivan Khoronzhuk
On Sun, Jun 16, 2019 at 10:56:25AM +, Tariq Toukan wrote: Hi Tariq On 6/15/2019 12:33 PM, Ivan Khoronzhuk wrote: On Thu, Jun 13, 2019 at 08:28:42PM +0200, Jesper Dangaard Brouer wrote: Hi, Jesper This patch is needed before we can allow drivers to use page_pool for DMA-mappings. Today

[RFC bpf-next 0/7] Programming socket lookup with BPF

2019-06-18 Thread Jakub Sitnicki
We have been exploring an idea of making listening socket lookup (inet_lookup) programmable with BPF. Why? At last Netdev Marek talked [1] about two limitations of bind() API we're hitting when running services on our edge servers: 1) sharing a port between two services Services are accepting

[RFC bpf-next 5/7] libbpf: Add support for inet_lookup program type

2019-06-18 Thread Jakub Sitnicki
Make libbpf aware of the newly added program type. Reserve a section name for it. Signed-off-by: Jakub Sitnicki --- tools/lib/bpf/libbpf.c| 4 tools/lib/bpf/libbpf.h| 2 ++ tools/lib/bpf/libbpf.map | 2 ++ tools/lib/bpf/libbpf_probes.c | 1 + 4 files changed, 9 insertio

[RFC bpf-next 6/7] bpf: Test destination address remapping with inet_lookup

2019-06-18 Thread Jakub Sitnicki
Check if destination IP address and/or port remapping happens when an inet_lookup program is attached to the net namespace. Signed-off-by: Jakub Sitnicki --- tools/testing/selftests/bpf/.gitignore| 1 + tools/testing/selftests/bpf/Makefile | 6 +- .../selftests/bpf/progs/ine

[RFC bpf-next 1/7] bpf: Introduce inet_lookup program type

2019-06-18 Thread Jakub Sitnicki
Add a new BPF program type that attaches to the network namespace. Its purpose is to run before the listening socket lookup so that we can override the destination IP and/or port from BPF. The inet_lookup program receives the lookup 4-tuple via context as input for making a decision. It is allowe

[RFC bpf-next 7/7] bpf: Add verifier tests for inet_lookup context access

2019-06-18 Thread Jakub Sitnicki
Exercise verifier access checks for bpf_inet_lookup context object fields. Signed-off-by: Jakub Sitnicki --- .../selftests/bpf/verifier/ctx_inet_lookup.c | 511 ++ 1 file changed, 511 insertions(+) create mode 100644 tools/testing/selftests/bpf/verifier/ctx_inet_lookup.c diff

[RFC bpf-next 2/7] ipv4: Run inet_lookup bpf program on socket lookup

2019-06-18 Thread Jakub Sitnicki
Run a BPF program before looking up the listening socket, or in case of udp before looking up any socket, connected or not. The program is allowed to change the destination address & port we use as keys for the lookup, providing its return code is BPF_REDIRECT. This allows us to redirect traffic d

[RFC bpf-next 4/7] bpf: Sync linux/bpf.h to tools/

2019-06-18 Thread Jakub Sitnicki
Newly added program and context type is needed for tests in subsequent patches. Signed-off-by: Jakub Sitnicki --- tools/include/uapi/linux/bpf.h | 27 +++ 1 file changed, 27 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index

[RFC bpf-next 3/7] ipv6: Run inet_lookup bpf program on socket lookup

2019-06-18 Thread Jakub Sitnicki
Following the ipv4 changes, run a BPF program attached to netns in context of which we're doing the socket lookup so that it can rewrite the destination IP and port we use as keys for the lookup. The program is called before the listening socket lookup for TCP, and before connected or not-connecte

[PATCH net-next v2 01/12] net: page_pool: add helper function to retrieve dma addresses

2019-06-18 Thread Jesper Dangaard Brouer
From: Ilias Apalodimas On a previous patch dma addr was stored in 'struct page'. Use that to retrieve DMA addresses used by network drivers Signed-off-by: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer --- include/net/page_pool.h |5 + 1 file changed, 5 insertions(+) diff --g

[PATCH net-next v2 00/12] xdp: page_pool fixes and in-flight accounting

2019-06-18 Thread Jesper Dangaard Brouer
This patchset fix page_pool API and users, such that drivers can use it for DMA-mapping. A number of places exist, where the DMA-mapping would not get released/unmapped, all these are fixed. This occurs e.g. when an xdp_frame gets converted to an SKB. As network stack doesn't have any callback for

[PATCH net-next v2 06/12] page_pool: introduce page_pool_free and use in mlx5

2019-06-18 Thread Jesper Dangaard Brouer
In case driver fails to register the page_pool with XDP return API (via xdp_rxq_info_reg_mem_model()), then the driver can free the page_pool resources more directly than calling page_pool_destroy(), which does a unnecessarily RCU free procedure. This patch is preparing for removing page_pool_dest

[PATCH net-next v2 09/12] xdp: force mem allocator removal and periodic warning

2019-06-18 Thread Jesper Dangaard Brouer
If bugs exists or are introduced later e.g. by drivers misusing the API, then we want to warn about the issue, such that developer notice. This patch will generate a bit of noise in form of periodic pr_warn every 30 seconds. It is not nice to have this stall warning running forever. Thus, this pat

[PATCH net-next v2 12/12] page_pool: make sure struct device is stable

2019-06-18 Thread Jesper Dangaard Brouer
For DMA mapping use-case the page_pool keeps a pointer to the struct device, which is used in DMA map/unmap calls. For our in-flight handling, we also need to make sure that the struct device have not disappeared. This is assured via using get_device/put_device API. Signed-off-by: Jesper Dangaar

[PATCH net-next v2 11/12] page_pool: add tracepoints for page_pool with details need by XDP

2019-06-18 Thread Jesper Dangaard Brouer
The xdp tracepoints for mem id disconnect don't carry information about, why it was not safe_to_remove. The tracepoint page_pool:page_pool_inflight in this patch can be used for extract this info for further debugging. This patchset also adds tracepoint for the pages_state_* release/hold transiti

[PATCH net-next v2 05/12] veth: use xdp_release_frame for XDP_PASS

2019-06-18 Thread Jesper Dangaard Brouer
Like cpumap use xdp_release_frame() when an xdp_frame got converted into an SKB and send towars the network stack. Signed-off-by: Jesper Dangaard Brouer --- drivers/net/veth.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 52110e54e621..c6916

[PATCH net-next v2 02/12] net: page_pool: add helper function to unmap dma addresses

2019-06-18 Thread Jesper Dangaard Brouer
From: Ilias Apalodimas On a previous patch dma addr was stored in 'struct page'. Use that to unmap DMA addresses used by network drivers Signed-off-by: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer --- include/net/page_pool.h |1 + net/core/page_pool.c|7 +++ 2 files

[PATCH net-next v2 07/12] mlx5: more strict use of page_pool API

2019-06-18 Thread Jesper Dangaard Brouer
The mlx5 driver is using page_pool, but not for DMA-mapping (currently), and is a little too relaxed about returning or releasing page resources, as it is not strictly necessary, when not using DMA-mappings. As this patchset is working towards tracking page_pool resources, to know about in-flight

[PATCH net-next v2 03/12] xdp: fix leak of IDA cyclic id if rhashtable_insert_slow fails

2019-06-18 Thread Jesper Dangaard Brouer
Fix error handling case, where inserting ID with rhashtable_insert_slow fails in xdp_rxq_info_reg_mem_model, which leads to never releasing the IDA ID, as the lookup in xdp_rxq_info_unreg_mem_model fails and thus ida_simple_remove() is never called. Fix by releasing ID via ida_simple_remove(), and

[PATCH net-next v2 08/12] xdp: tracking page_pool resources and safe removal

2019-06-18 Thread Jesper Dangaard Brouer
This patch is needed before we can allow drivers to use page_pool for DMA-mappings. Today with page_pool and XDP return API, it is possible to remove the page_pool object (from rhashtable), while there are still in-flight packet-pages. This is safely handled via RCU and failed lookups in __xdp_retu

[PATCH net-next v2 04/12] xdp: page_pool related fix to cpumap

2019-06-18 Thread Jesper Dangaard Brouer
When converting an xdp_frame into an SKB, and sending this into the network stack, then the underlying XDP memory model need to release associated resources, because the network stack don't have callbacks for XDP memory models. The only memory model that needs this is page_pool, when a driver use

[PATCH net-next v2 10/12] xdp: add tracepoints for XDP mem

2019-06-18 Thread Jesper Dangaard Brouer
These tracepoints make it easier to troubleshoot XDP mem id disconnect. The xdp:mem_disconnect tracepoint cannot be replaced via kprobe. It is placed at the last stable place for the pointer to struct xdp_mem_allocator, just before it's scheduled for RCU removal. It also extract info on 'safe_to_r

[PATCH v2 2/3] ipv4: fix confirm_addr_indev() when enable route_localnet

2019-06-18 Thread luoshijie
From: Shijie Luo When arp_ignore=3, the NIC won't reply for scope host addresses, but if enable route_locanet, we need to reply ip address with head 127 and scope RT_SCOPE_HOST. Fixes: d0daebc3d622 ("ipv4: Add interface option to enable routing of 127.0.0.0/8") Signed-off-by: Shijie Luo Signe

[PATCH v2 0/3] fix bugs when enable route_localnet

2019-06-18 Thread luoshijie
From: Shijie Luo When enable route_localnet, route of the 127/8 address is enabled. But in some situations like arp_announce=2, ARP requests or reply work abnormally. This patchset fix some bugs when enable route_localnet. Change History: V2: - Change a single patch to a patchset. - Add bug fi

[PATCH v2 3/3] selftests: add route_localnet test script

2019-06-18 Thread luoshijie
From: Shijie Luo Add a simple scripts to exercise several situations when enable route_localnet. Signed-off-by: Shijie Luo Signed-off-by: Zhiqiang liu --- tools/testing/selftests/net/route_localnet.sh | 74 +++ 1 file changed, 74 insertions(+) create mode 100755 tools/testing

[PATCH v2 1/3] ipv4: fix inet_select_addr() when enable route_localnet

2019-06-18 Thread luoshijie
From: Shijie Luo Suppose we have two interfaces eth0 and eth1 in two hosts, follow the same steps in the two hosts: # sysctl -w net.ipv4.conf.eth1.route_localnet=1 # sysctl -w net.ipv4.conf.eth1.arp_announce=2 # ip route del 127.0.0.0/8 dev lo table local and then set ip to eth1 in host1 like:

[PATCH net v5 0/6] Fix listing (IPv4, IPv6) and flushing (IPv6) of cached route exceptions

2019-06-18 Thread Stefano Brivio
For IPv6 cached routes, the commands 'ip -6 route list cache' and 'ip -6 route flush cache' don't work at all after route exceptions have been moved to a separate hash table in commit 2b760fcf5cfb ("ipv6: hook up exception table to store dst cache"). For IPv4 cached routes, the command 'ip route l

[PATCH net v5 2/6] ipv4/fib_frontend: Allow RTM_F_CLONED flag to be used for filtering

2019-06-18 Thread Stefano Brivio
This functionally reverts the check introduced by commit e8ba330ac0c5 ("rtnetlink: Update fib dumps for strict data checking") as modified by commit e4e92fb160d7 ("net/ipv4: Bail early if user only wants prefix entries"). As we are preparing to fix listing of IPv4 cached routes, we need to give us

[PATCH net v5 5/6] ipv6: Dump route exceptions if requested

2019-06-18 Thread Stefano Brivio
Since commit 2b760fcf5cfb ("ipv6: hook up exception table to store dst cache"), route exceptions reside in a separate hash table, and won't be found by walking the FIB, so they won't be dumped to userspace on a RTM_GETROUTE message. This causes 'ip -6 route list cache' and 'ip -6 route flush cache

[PATCH net v5 4/6] Revert "net/ipv6: Bail early if user only wants cloned entries"

2019-06-18 Thread Stefano Brivio
This reverts commit 08e814c9e8eb5a982cbd1e8f6bd255d97c51026f: as we are preparing to fix listing and dumping of IPv6 cached routes, we need to allow RTM_F_CLONED as a flag to match routes against while dumping them. Signed-off-by: Stefano Brivio --- v5: No changes v4: New patch net/ipv6/ip6_fi

[PATCH net v5 1/6] fib_frontend, ip6_fib: Select routes or exceptions dump from RTM_F_CLONED

2019-06-18 Thread Stefano Brivio
The following patches add back the ability to dump IPv4 and IPv6 exception routes, and we need to allow selection of regular routes or exceptions. Use RTM_F_CLONED as filter to decide whether to dump routes or exceptions: iproute2 passes it in dump requests (except for IPv6 cache flush requests, t

[PATCH net v5 3/6] ipv4: Dump route exceptions if requested

2019-06-18 Thread Stefano Brivio
Since commit 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions."), cached exception routes are stored as a separate entity, so they are not dumped on a FIB dump, even if the RTM_F_CLONED flag is passed. This implies that the command 'ip route list cache' doesn't return any result anymore. If the RT

[PATCH net v5 6/6] ip6_fib: Don't discard nodes with valid routing information in fib6_locate_1()

2019-06-18 Thread Stefano Brivio
When we perform an inexact match on FIB nodes via fib6_locate_1(), longer prefixes will be preferred to shorter ones. However, it might happen that a node, with higher fn_bit value than some other, has no valid routing information. In this case, we'll pick that node, but it will be discarded by th

Re: [PATCH net-next v1 08/11] xdp: tracking page_pool resources and safe removal

2019-06-18 Thread Ilias Apalodimas
Hi Ivan, Tariq, > >>>+ [...] > >> > >>What would you recommend to do for the following situation: > >> > >>Same receive queue is shared between 2 network devices. The receive ring is > >>filled by pages from page_pool, but you don't know the actual port (ndev) > >>filling this ring, because a devi

Re: [PATCH net-next v1 08/11] xdp: tracking page_pool resources and safe removal

2019-06-18 Thread Ivan Khoronzhuk
On Tue, Jun 18, 2019 at 04:30:12PM +0300, Ilias Apalodimas wrote: Hi Ivan, Tariq, >>>+ [...] >> >>What would you recommend to do for the following situation: >> >>Same receive queue is shared between 2 network devices. The receive ring is >>filled by pages from page_pool, but you don't know t

Re: [RFC bpf-next 0/7] Programming socket lookup with BPF

2019-06-18 Thread Florian Westphal
Jakub Sitnicki wrote: > - XDP programs using bpf_sk_lookup helpers, like load balancers, can't >find the listening socket to check for SYN cookies with TPROXY redirect. Sorry for the question, but where is the problem? (i.e., is it with TPROXY or bpf side)? > - TPROXY takes a reference to

Re: [PATCH 1/2] net: intel: igb: minor ethool regdump amendment

2019-06-18 Thread Andrew Lunn
On Tue, Jun 18, 2019 at 02:55:12PM +0300, Artem Bityutskiy wrote: > From: Artem Bityutskiy Hi Artem. The subject line is missing a t in ethtool. > Signed-off-by: Artem Bityutskiy Otherwise Reviewed-by: Andrew Lunn Andrew

Re: [PATCH v3 bpf-next 0/9] bpf: bounded loops and other features

2019-06-18 Thread Paul Chaignon
On Mon, Jun 17, 2019 at 06:57PM, Alexei Starovoitov wrote: > On 6/17/19 9:39 AM, Andrii Nakryiko wrote: > > On Sat, Jun 15, 2019 at 12:12 PM Alexei Starovoitov wrote: > >> > >> v2->v3: fixed issues in backtracking pointed out by Andrii. > >> The next step is to add a lot more tests for backtrackin

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

2019-06-18 Thread wenxu
在 2019/6/18 17:37, Florian Westphal 写道: > wenxu wrote: >> On 6/18/2019 6:42 AM, Florian Westphal wrote: >>> Pablo Neira Ayuso wrote: > Subject: Change bridge l3 dependency to meta protocol > > This examines skb->protocol instead of ethernet header type, which > might be differen

Re: [PATCH net v5 3/6] ipv4: Dump route exceptions if requested

2019-06-18 Thread David Ahern
On 6/18/19 7:20 AM, Stefano Brivio wrote: > diff --git a/include/net/route.h b/include/net/route.h > index 065b47754f05..f0d0086e76ce 100644 > --- a/include/net/route.h > +++ b/include/net/route.h > @@ -221,6 +221,9 @@ void ip_rt_get_source(u8 *src, struct sk_buff *skb, > struct rtable *rt); > st

Re: [PATCH net v5 1/6] fib_frontend, ip6_fib: Select routes or exceptions dump from RTM_F_CLONED

2019-06-18 Thread David Ahern
On 6/18/19 7:20 AM, Stefano Brivio wrote: > The following patches add back the ability to dump IPv4 and IPv6 exception > routes, and we need to allow selection of regular routes or exceptions. > > Use RTM_F_CLONED as filter to decide whether to dump routes or exceptions: > iproute2 passes it in du

Re: [PATCH net v5 2/6] ipv4/fib_frontend: Allow RTM_F_CLONED flag to be used for filtering

2019-06-18 Thread David Ahern
On 6/18/19 7:20 AM, Stefano Brivio wrote: > This functionally reverts the check introduced by commit > e8ba330ac0c5 ("rtnetlink: Update fib dumps for strict data checking") > as modified by commit e4e92fb160d7 ("net/ipv4: Bail early if user only > wants prefix entries"). > > As we are preparing to

[PATCH iproute2 v2 0/3] refactor the cmd_exec()

2019-06-18 Thread Matteo Croce
Refactor the netns and ipvrf code so less steps are needed to exec commands in a netns or a VRF context. Also remove some code which became dead. bloat-o-meter shows a tiny saving. Matteo Croce (3): netns: switch netns in the child when executing commands ip vrf: use hook to change VRF in the

[PATCH iproute2 v2 2/3] ip vrf: use hook to change VRF in the child

2019-06-18 Thread Matteo Croce
On vrf exec, reset the VRF associations in the child process, via the new hook added to cmd_exec(). In this way, the parent doesn't have to reset the VRF associations before spawning other processes. Signed-off-by: Matteo Croce --- ip/ipvrf.c | 12 1 file changed, 8 insertions(+), 4

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

2019-06-18 Thread Matteo Croce
'ip netns exec' changes the current netns just before executing a child process, and restores it after forking. This is needed if we're running in batch or do_all mode. Some cleanups must be done both in the parent and in the child: the parent must restore the previous netns, while the child must r

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

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

Re: [PATCH net v5 0/6] Fix listing (IPv4, IPv6) and flushing (IPv6) of cached route exceptions

2019-06-18 Thread David Ahern
On 6/18/19 7:20 AM, Stefano Brivio wrote: > For IPv6 cached routes, the commands 'ip -6 route list cache' and > 'ip -6 route flush cache' don't work at all after route exceptions have > been moved to a separate hash table in commit 2b760fcf5cfb ("ipv6: hook > up exception table to store dst cache")

Re: [PATCH net v5 4/6] Revert "net/ipv6: Bail early if user only wants cloned entries"

2019-06-18 Thread David Ahern
On 6/18/19 7:20 AM, Stefano Brivio wrote: > This reverts commit 08e814c9e8eb5a982cbd1e8f6bd255d97c51026f: as we > are preparing to fix listing and dumping of IPv6 cached routes, we > need to allow RTM_F_CLONED as a flag to match routes against while > dumping them. > > Signed-off-by: Stefano Brivi

[PATCH net-next v2 00/16] mlxsw: Improve IPv6 route insertion rate

2019-06-18 Thread Ido Schimmel
From: Ido Schimmel Unlike IPv4, an IPv6 multipath route in the kernel is composed from multiple sibling routes, each representing a single nexthop. Therefore, an addition of a multipath route with N nexthops translates to N in-kernel notifications. This is inefficient for device drivers that nee

[PATCH net-next v2 01/16] netlink: Document all fields of 'struct nl_info'

2019-06-18 Thread Ido Schimmel
From: Ido Schimmel Some fields were not documented. Add documentation. Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko Reviewed-by: David Ahern --- include/net/netlink.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/net/netlink.h b/include/net/netlink.h index 28ece67f5312..c

[PATCH net-next v2 04/16] mlxsw: spectrum_router: Ignore IPv6 multipath notifications

2019-06-18 Thread Ido Schimmel
From: Ido Schimmel IPv6 multipath notifications are about to be sent, but mlxsw is not ready to process them, so ignore them. The limitation will be lifted by a subsequent patch which will also stop the kernel from sending a notification for each nexthop. Signed-off-by: Ido Schimmel Acked-by:

[PATCH net-next v2 03/16] ipv6: Extend notifier info for multipath routes

2019-06-18 Thread Ido Schimmel
From: Ido Schimmel Extend the IPv6 FIB notifier info with number of sibling routes being notified. This will later allow listeners to process one notification for a multipath routes instead of N, where N is the number of nexthops. Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko --- include/

[PATCH net-next v2 05/16] netdevsim: Ignore IPv6 multipath notifications

2019-06-18 Thread Ido Schimmel
From: Ido Schimmel In a similar fashion to previous patch, have netdevsim ignore IPv6 multipath notifications for now. Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko --- drivers/net/netdevsim/fib.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/netdevsim/fib.c b/driv

[PATCH net-next v2 02/16] netlink: Add field to skip in-kernel notifications

2019-06-18 Thread Ido Schimmel
From: Ido Schimmel The struct includes a 'skip_notify' flag that indicates if netlink notifications to user space should be suppressed. As explained in commit 3b1137fe7482 ("net: ipv6: Change notifications for multipath add to RTA_MULTIPATH"), this is useful to suppress per-nexthop RTM_NEWROUTE n

[PATCH net-next v2 06/16] ipv6: Add IPv6 multipath notifications for add / replace

2019-06-18 Thread Ido Schimmel
From: Ido Schimmel Emit a notification when a multipath routes is added or replace. Note that unlike the replace notifications sent from fib6_add_rt2node(), it is possible we are sending a 'FIB_EVENT_ENTRY_REPLACE' when a route was merely added and not replaced. Signed-off-by: Ido Schimmel Ack

[PATCH net-next v2 09/16] mlxsw: spectrum_router: Prepare function to return errors

2019-06-18 Thread Ido Schimmel
From: Ido Schimmel The function mlxsw_sp_router_fib6_event() takes care of preparing the needed information for the work item that actually inserts the route into the device. When processing an IPv6 multipath route, the function will need to allocate an array to store pointers to all the sibling

  1   2   3   >