[PATCH bpf-next 1/3] selftests/bpf: add benchmark runner infrastructure

2020-05-08 Thread Andrii Nakryiko
While working on BPF ringbuf implementation, testing, and benchmarking, I've developed a pretty generic and modular benchmark runner, which seems to be generically useful, as I've already used it for one more purpose (testing fastest way to trigger BPF program, to minimize overhead of in-kernel cod

[PATCH bpf-next 0/3] Add benchmark runner and few benchmarks

2020-05-08 Thread Andrii Nakryiko
Add generic benchmark runner framework which simplifies writing various performance benchmarks in a consistent fashion. This framework will be used in follow up patches to test performance of perf buffer and ring buffer as well. Patch #1 adds generic runner implementation and atomic counter bench

[PATCH bpf-next 3/3] selftest/bpf: add BPF triggring benchmark

2020-05-08 Thread Andrii Nakryiko
It is sometimes desirable to be able to trigger BPF program from user-space with minimal overhead. sys_enter would seem to be a good candidate, yet in a lot of cases there will be a lot of noise from syscalls triggered by other processes on the system. So while searching for low-overhead alternativ

[PATCH bpf-next 2/3] selftest/bpf: fmod_ret prog and implement test_overhead as part of bench

2020-05-08 Thread Andrii Nakryiko
Add fmod_ret BPF program to existing test_overhead selftest. Also re-implement user-space benchmarking part into benchmark runner to compare results. Results with ./bench are consistently somewhat lower than test_overhead's, but relative performance of various types of BPF programs stay consisten

Re: [PATCH bpf-next 02/17] bpf: Introduce SK_LOOKUP program type with a dedicated attach point

2020-05-08 Thread Martin KaFai Lau
On Wed, May 06, 2020 at 02:54:58PM +0200, Jakub Sitnicki wrote: > Add a new program type BPF_PROG_TYPE_SK_LOOKUP and a dedicated attach type > called BPF_SK_LOOKUP. The new program kind is to be invoked by the > transport layer when looking up a socket for a received packet. > > When called, SK_LO

Re: [PATCH] via-rhine: Add platform dependencies

2020-05-08 Thread Geert Uytterhoeven
Hi David, On Thu, May 7, 2020 at 10:17 PM David Miller wrote: > From: Geert Uytterhoeven > Date: Thu, 7 May 2020 13:42:05 +0200 > > > The VIA Rhine Ethernet interface is only present on PCI devices or > > VIA/WonderMedia VT8500/WM85xx SoCs. Add platform dependencies to the > > VIA_RHINE config

Re: [PATCH] libbpf hashmap: fix undefined behavior in hash_bits

2020-05-08 Thread Andrii Nakryiko
On Thu, May 7, 2020 at 11:40 PM Ian Rogers wrote: > > If bits is 0, the case when the map is empty, then the >> is the size of > the register which is undefined behavior - on x86 it is the same as a > shift by 0. Fix by handling the 0 case explicitly. > > Signed-off-by: Ian Rogers > --- No need.

Re: [PATCH bpf-next v4 2/4] selftests/bpf: move existing common networking parts into network_helpers

2020-05-08 Thread Martin KaFai Lau
On Thu, May 07, 2020 at 12:12:13PM -0700, Stanislav Fomichev wrote: > 1. Move pkt_v4 and pkt_v6 into network_helpers and adjust the users. > 2. Copy-paste spin_lock_thread into two tests that use it. > > Cc: Martin KaFai Lau > Signed-off-by: Stanislav Fomichev Acked-by: Martin KaFai Lau

Re: [PATCH bpf-next v4 1/4] selftests/bpf: generalize helpers to control background listener

2020-05-08 Thread Martin KaFai Lau
On Thu, May 07, 2020 at 12:12:12PM -0700, Stanislav Fomichev wrote: > Move the following routines that let us start a background listener > thread and connect to a server by fd to the test_prog: > * start_server - socket+bind+listen > * connect_to_fd - connect to the server identified by fd > > Th

Re: [PATCH net-next v2 21/33] virtio_net: add XDP frame size in two code paths

2020-05-08 Thread Jesper Dangaard Brouer
On Fri, 8 May 2020 10:05:46 +0800 Jason Wang wrote: > On 2020/5/7 上午4:34, Michael S. Tsirkin wrote: > > On Thu, Apr 30, 2020 at 01:22:08PM +0200, Jesper Dangaard Brouer wrote: > >> The virtio_net driver is running inside the guest-OS. There are two > >> XDP receive code-paths in virtio_net, nam

[PATCH net-next] nfp: abm: fix error return code in nfp_abm_vnic_alloc()

2020-05-08 Thread Wei Yongjun
Fix to return negative error code -ENOMEM from the kzalloc() error handling case instead of 0, as done elsewhere in this function. Fixes: 174ab544e3bc ("nfp: abm: add cls_u32 offload for simple band classification") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/net/ethernet/ne

[v5,iproute2-next 1/2] iproute2-next:tc:action: add a gate control action

2020-05-08 Thread Po Liu
Introduce a ingress frame gate control flow action. Tc gate action does the work like this: Assume there is a gate allow specified ingress frames can pass at specific time slot, and also drop at specific time slot. Tc filter chooses the ingress frames, and tc gate action would specify what slot doe

[v5,iproute2-next 2/2] iproute2-next: add gate action man page

2020-05-08 Thread Po Liu
This patch is to add the man page for the tc gate action. Signed-off-by: Po Liu --- changes before v4: No changes. changes from v4: - Update the examples with input/output time and size routine support man/man8/tc-gate.8 | 123 + 1 file changed, 123

Re: [PATCH] octeontx2-pf: Use the napi_alloc_frag() to alloc the pool buffers

2020-05-08 Thread Sunil Kovvuri
On Fri, May 8, 2020 at 11:00 AM Kevin Hao wrote: > > On Fri, May 08, 2020 at 10:18:27AM +0530, Sunil Kovvuri wrote: > > On Fri, May 8, 2020 at 9:43 AM Kevin Hao wrote: > > > > > > In the current codes, the octeontx2 uses its own method to allocate > > > the pool buffers, but there are some issues

Re: [PATCH] octeontx2-pf: Use the napi_alloc_frag() to alloc the pool buffers

2020-05-08 Thread Sunil Kovvuri
On Fri, May 8, 2020 at 9:43 AM Kevin Hao wrote: > > In the current codes, the octeontx2 uses its own method to allocate > the pool buffers, but there are some issues in this implementation. > 1. We have to run the otx2_get_page() for each allocation cycle and >this is pretty error prone. As I

[PATCH v2] brcmfmac: remove Comparison to bool in brcmf_p2p_send_action_frame()

2020-05-08 Thread Jason Yan
Fix the following coccicheck warning: drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:1785:5-8: WARNING: Comparison to bool Signed-off-by: Jason Yan Reviewed-by: Chi-hsien Lin --- v2: Rebased on top of wireless-drivers-next and drop one already fixed line. drivers/net/wireless/broadco

Re: [PATCH net-next 06/12] net: qed: gather debug data on hw errors

2020-05-08 Thread Igor Russkikh
> On Wed, 6 May 2020 14:33:08 +0300 Igor Russkikh wrote: >> To implement debug dump retrieval on a live system we add callbacks to >> collect the same data which is collected now during manual `ethtool -d` >> call. >> >> But we instead collect the dump immediately at the moment bad thing >> happe

Re: [PATCH ipsec-next v2 0/7] xfrm: remove three more indirect calls from packet path

2020-05-08 Thread Steffen Klassert
On Mon, May 04, 2020 at 10:06:02AM +0200, Florian Westphal wrote: > v2: rebase on top of ipsec-next, no other changes. > > This patch series removes three more indirect calls from the state_afinfo > struct. > > These are: > - extract_input (no dependencies on other modules) > - output_finish (sam

Re: [PATCH net] dt-bindings: net: Convert UniPhier AVE4 controller to json-schema

2020-05-08 Thread Kunihiko Hayashi
Hi David, Rob, On 2020/05/02 7:21, David Miller wrote: From: Kunihiko Hayashi Date: Tue, 28 Apr 2020 15:31:22 +0900 Convert the UniPhier AVE4 controller binding to DT schema format. This changes phy-handle property to required. Signed-off-by: Kunihiko Hayashi DT folks, is it ok if I take

Re: [PATCH net-next] net: ethernet: ti: fix error return code in am65_cpsw_nuss_probe()

2020-05-08 Thread Grygorii Strashko
On 08/05/2020 05:10, Wei Yongjun wrote: Fix to return negative error code -ENOMEM from the cpsw_ale_create() error handling case instead of 0, as done elsewhere in this function. Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver") Reported-by: Hulk R

Re: [RFC PATCHv2 bpf-next 1/2] xdp: add a new helper for dev map multicast support

2020-05-08 Thread Hangbin Liu
On Wed, May 06, 2020 at 12:00:08PM +0200, Toke Høiland-Jørgensen wrote: > > No, I haven't test the performance. Do you have any suggestions about how > > to test it? I'd like to try forwarding pkts to 10+ ports. But I don't know > > how to test the throughput. I don't think netperf or iperf support

Re: [PATCH bpf-next 02/17] bpf: Introduce SK_LOOKUP program type with a dedicated attach point

2020-05-08 Thread Jakub Sitnicki
On Thu, May 07, 2020 at 10:55 PM CEST, Martin KaFai Lau wrote: > On Wed, May 06, 2020 at 03:53:35PM +0200, Jakub Sitnicki wrote: >> On Wed, May 06, 2020 at 03:16 PM CEST, Lorenz Bauer wrote: >> > On Wed, 6 May 2020 at 13:55, Jakub Sitnicki wrote: >> >> [...] >> >> >> @@ -4012,4 +4051,18 @@ struct

Re: XDP bpf_tail_call_redirect(): yea or nay?

2020-05-08 Thread Björn Töpel
On Thu, 7 May 2020 at 16:48, Toke Høiland-Jørgensen wrote: > [] > Well, my immediate thought would be that the added complexity would not > be worth it, because: > > - A new action would mean either you'd need to patch all drivers or > (more likely) we'd end up with yet another difference betwee

Re: XDP bpf_tail_call_redirect(): yea or nay?

2020-05-08 Thread Björn Töpel
On Thu, 7 May 2020 at 20:08, John Fastabend wrote: > [] > > I'm wondering if we can teach the verifier to recognize tail calls, > > int xdp_prog1(struct xdp_md *ctx) > { > return xdp_do_redirect(ctx, &xsks_map, 0); > } > > This would be useful for normal calls as well. I guess the question

Re: [PATCH net-next 7/7] net: atlantic: unify get_mac_permanent

2020-05-08 Thread Igor Russkikh
Hi Jakub, >> This patch moves MAC generation into a separate function, which is > called >> from both places to reduce the amount of copy/paste. > > Right, but why do you have your own mac generation rather than using > eth_hw_addr_random(). You need to set NET_ADDR_RANDOM for example, > just us

[PATCH net v3] net: ethernet: ti: fix build and remove TI_CPTS_MOD workaround

2020-05-08 Thread Grygorii Strashko
From: Clay McClure My recent commit b6d49cab44b5 ("net: Make PTP-specific drivers depend on PTP_1588_CLOCK") exposes a missing dependency in defconfigs that select TI_CPTS without selecting PTP_1588_CLOCK, leading to linker errors of the form: drivers/net/ethernet/ti/cpsw.o: in function `cpsw_nd

[PATCH net-next v2] net: ethernet: ti: fix some return value check of cpsw_ale_create()

2020-05-08 Thread Wei Yongjun
cpsw_ale_create() can return both NULL and PTR_ERR(), but all of the caller only check NULL for error handling. This patch convert it to only return PTR_ERR() in all error cases, all the caller using IS_ERR() install of NULL test. Also fix a return negative error code from the cpsw_ale_create() er

[PATCH net-next] net: dsa: vsc73xx: convert to devm_platform_ioremap_resource

2020-05-08 Thread Wei Yongjun
Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. Signed-off-by: Wei Yongjun --- drivers/net/dsa/vitesse-vsc73xx-platform.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/net/dsa/vitesse-vsc73xx-pl

Re: [PATCH net v3] net: ethernet: ti: fix build and remove TI_CPTS_MOD workaround

2020-05-08 Thread Arnd Bergmann
On Fri, May 8, 2020 at 11:59 AM Grygorii Strashko wrote: > > From: Clay McClure > > My recent commit b6d49cab44b5 ("net: Make PTP-specific drivers depend on > PTP_1588_CLOCK") exposes a missing dependency in defconfigs that select > TI_CPTS without selecting PTP_1588_CLOCK, leading to linker erro

Re: [PATCH bpf-next 02/17] bpf: Introduce SK_LOOKUP program type with a dedicated attach point

2020-05-08 Thread Jakub Sitnicki
On Fri, May 08, 2020 at 09:06 AM CEST, Martin KaFai Lau wrote: > On Wed, May 06, 2020 at 02:54:58PM +0200, Jakub Sitnicki wrote: >> Add a new program type BPF_PROG_TYPE_SK_LOOKUP and a dedicated attach type >> called BPF_SK_LOOKUP. The new program kind is to be invoked by the >> transport layer whe

Re: [PATCH net-next v2 28/33] mlx5: rx queue setup time determine frame_sz for XDP

2020-05-08 Thread Jesper Dangaard Brouer
On Fri, 1 May 2020 14:32:32 +0200 Jesper Dangaard Brouer wrote: > On Thu, 30 Apr 2020 20:12:11 +0300 > Tariq Toukan wrote: > > > >> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h > > >> b/drivers/net/ethernet/mellanox/mlx5/core/en.h > > >> index 23701c0e36ec..ba6a0ee297c6 100644 > >

[PATCH net-next v3 03/33] sfc: add XDP frame size

2020-05-08 Thread Jesper Dangaard Brouer
This driver uses RX page-split when possible. It was recently fixed in commit 86e85bf6981c ("sfc: fix XDP-redirect in this driver") to add needed tailroom for XDP-redirect. After the fix efx->rx_page_buf_step is the frame size, with enough head and tail-room for XDP-redirect. Signed-off-by: Jespe

[PATCH net-next v3 00/33] XDP extend with knowledge of frame size

2020-05-08 Thread Jesper Dangaard Brouer
(Send for net-next due to all the driver updates) V3: - Fix issue on virtio_net patch spotted by Jason Wang - Adjust name for variable in mlx5 patch - Collected more ACKs V2: - Fix bug in mlx5 for XDP_PASS case - Collected nitpicks and ACKs from mailing list V1: - Fix bug in dpaa2 XDP have evol

[PATCH net-next v3 01/33] xdp: add frame size to xdp_buff

2020-05-08 Thread Jesper Dangaard Brouer
XDP have evolved to support several frame sizes, but xdp_buff was not updated with this information. The frame size (frame_sz) member of xdp_buff is introduced to know the real size of the memory the frame is delivered in. When introducing this also make it clear that some tailroom is reserved/req

[PATCH net-next v3 02/33] bnxt: add XDP frame size to driver

2020-05-08 Thread Jesper Dangaard Brouer
This driver uses full PAGE_SIZE pages when XDP is enabled. In case of XDP uses driver uses __bnxt_alloc_rx_page which does full page DMA-map. Thus, xdp_adjust_tail grow is DMA compliant for XDP_TX action that does DMA-sync. Cc: Michael Chan Cc: Andy Gospodarek Signed-off-by: Jesper Dangaard Bro

[PATCH net-next v3 04/33] mvneta: add XDP frame size to driver

2020-05-08 Thread Jesper Dangaard Brouer
This marvell driver mvneta uses PAGE_SIZE frames, which makes it really easy to convert. Driver updates rxq and now frame_sz once per NAPI call. This driver takes advantage of page_pool PP_FLAG_DMA_SYNC_DEV that can help reduce the number of cache-lines that need to be flushed when doing DMA sync

[PATCH net-next v3 09/33] veth: adjust hard_start offset on redirect XDP frames

2020-05-08 Thread Jesper Dangaard Brouer
When native XDP redirect into a veth device, the frame arrives in the xdp_frame structure. It is then processed in veth_xdp_rcv_one(), which can run a new XDP bpf_prog on the packet. Doing so requires converting xdp_frame to xdp_buff, but the tricky part is that xdp_frame memory area is located in

[PATCH net-next v3 05/33] net: netsec: Add support for XDP frame size

2020-05-08 Thread Jesper Dangaard Brouer
From: Ilias Apalodimas This driver takes advantage of page_pool PP_FLAG_DMA_SYNC_DEV that can help reduce the number of cache-lines that need to be flushed when doing DMA sync for_device. Due to xdp_adjust_tail can grow the area accessible to the by the CPU (can possibly write into), then max syn

[PATCH net-next v3 07/33] xdp: xdp_frame add member frame_sz and handle in convert_to_xdp_frame

2020-05-08 Thread Jesper Dangaard Brouer
Use hole in struct xdp_frame, when adding member frame_sz, which keeps same sizeof struct (32 bytes) Drivers ixgbe and sfc had bug cases where the necessary/expected tailroom was not reserved. This can lead to some hard to catch memory corruption issues. Having the drivers frame_sz this can be det

[PATCH net-next v3 08/33] xdp: cpumap redirect use frame_sz and increase skb_tailroom

2020-05-08 Thread Jesper Dangaard Brouer
Knowing the memory size backing the packet/xdp_frame data area, and knowing it already have reserved room for skb_shared_info, simplifies using build_skb significantly. With this change we no-longer lie about the SKB truesize, but more importantly a significant larger skb_tailroom is now provided,

[PATCH net-next v3 10/33] veth: xdp using frame_sz in veth driver

2020-05-08 Thread Jesper Dangaard Brouer
The veth driver can run XDP in "native" mode in it's own NAPI handler, and since commit 9fc8d518d9d5 ("veth: Handle xdp_frames in xdp napi ring") packets can come in two forms either xdp_frame or skb, calling respectively veth_xdp_rcv_one() or veth_xdp_rcv_skb(). For packets to arrive in xdp_frame

[PATCH net-next v3 12/33] hv_netvsc: add XDP frame size to driver

2020-05-08 Thread Jesper Dangaard Brouer
The hyperv NIC driver does memory allocation and copy even without XDP. In XDP mode it will allocate a new page for each packet and copy over the payload, before invoking the XDP BPF-prog. The positive thing it that its easy to determine the xdp.frame_sz. The XDP implementation for hv_netvsc tran

[PATCH net-next v3 14/33] net: ethernet: ti: add XDP frame size to driver cpsw

2020-05-08 Thread Jesper Dangaard Brouer
The driver code cpsw.c and cpsw_new.c both use page_pool with default order-0 pages or their RX-pages. Cc: Grygorii Strashko Cc: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer Reviewed-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw.c |1 + drivers/net/ethernet/ti/cpsw_

[PATCH net-next v3 15/33] ena: add XDP frame size to amazon NIC driver

2020-05-08 Thread Jesper Dangaard Brouer
Frame size ENA_PAGE_SIZE is limited to 16K on systems with larger PAGE_SIZE than 16K. Change ENA_XDP_MAX_MTU to also take into account the reserved tailroom. Cc: Arthur Kiyanovski Acked-by: Sameeh Jubran Signed-off-by: Jesper Dangaard Brouer --- drivers/net/ethernet/amazon/ena/ena_netdev.c |

[PATCH net-next v3 06/33] net: XDP-generic determining XDP frame size

2020-05-08 Thread Jesper Dangaard Brouer
The SKB "head" pointer points to the data area that contains skb_shared_info, that can be found via skb_end_pointer(). Given xdp->data_hard_start have been established (basically pointing to skb->head), frame size is between skb_end_pointer() and data_hard_start, plus the size reserved to skb_share

[PATCH net-next v3 11/33] dpaa2-eth: add XDP frame size

2020-05-08 Thread Jesper Dangaard Brouer
The dpaa2-eth driver reserve some headroom used for hardware and software annotation area in RX/TX buffers. Thus, xdp.data_hard_start doesn't start at page boundary. When XDP is configured the area reserved via dpaa2_fd_get_offset(fd) is 448 bytes of which XDP have reserved 256 bytes. As frame_sz

[PATCH net-next v3 24/33] ixgbevf: add XDP frame size to VF driver

2020-05-08 Thread Jesper Dangaard Brouer
This patch mirrors the changes to ixgbe in previous patch. This VF driver doesn't support XDP_REDIRECT, but correct tailroom is still necessary for BPF-helper xdp_adjust_tail. In legacy-mode + larger PAGE_SIZE, due to lacking tailroom, we accept that xdp_adjust_tail shrink doesn't work. Cc: inte

[PATCH net-next v3 22/33] ixgbe: fix XDP redirect on archs with PAGE_SIZE above 4K

2020-05-08 Thread Jesper Dangaard Brouer
The ixgbe driver have another memory model when compiled on archs with PAGE_SIZE above 4096 bytes. In this mode it doesn't split the page in two halves, but instead increment rx_buffer->page_offset by truesize of packet (which include headroom and tailroom for skb_shared_info). This is done correc

[PATCH net-next v3 13/33] qlogic/qede: add XDP frame size to driver

2020-05-08 Thread Jesper Dangaard Brouer
The driver qede uses a full page, when XDP is enabled. The drivers value in rx_buf_seg_size (struct qede_rx_queue) will be PAGE_SIZE when an XDP bpf_prog is attached. Cc: Ariel Elior Cc: gr-everest-linux...@marvell.com Signed-off-by: Jesper Dangaard Brouer --- drivers/net/ethernet/qlogic/qede/q

[PATCH net-next v3 23/33] ixgbe: add XDP frame size to driver

2020-05-08 Thread Jesper Dangaard Brouer
This driver uses different memory models depending on PAGE_SIZE at compile time. For PAGE_SIZE 4K it uses page splitting, meaning for normal MTU frame size is 2048 bytes (and headroom 192 bytes). For larger MTUs the driver still use page splitting, by allocating order-1 pages (8192 bytes) for RX fr

[PATCH net-next v3 21/33] virtio_net: add XDP frame size in two code paths

2020-05-08 Thread Jesper Dangaard Brouer
The virtio_net driver is running inside the guest-OS. There are two XDP receive code-paths in virtio_net, namely receive_small() and receive_mergeable(). The receive_big() function does not support XDP. In receive_small() the frame size is available in buflen. The buffer backing these frames are a

[PATCH net-next v3 18/33] nfp: add XDP frame size to netronome driver

2020-05-08 Thread Jesper Dangaard Brouer
The netronome nfp driver use PAGE_SIZE when xdp_prog is set, but xdp.data_hard_start begins at offset NFP_NET_RX_BUF_HEADROOM. Thus, adjust for this when setting xdp.frame_sz, as it counts from data_hard_start. When doing XDP_TX this driver is smart and instead of a full DMA-map does a DMA-sync on

[PATCH net-next v3 25/33] i40e: add XDP frame size to driver

2020-05-08 Thread Jesper Dangaard Brouer
This driver uses different memory models depending on PAGE_SIZE at compile time. For PAGE_SIZE 4K it uses page splitting, meaning for normal MTU frame size is 2048 bytes (and headroom 192 bytes). For larger MTUs the driver still use page splitting, by allocating order-1 pages (8192 bytes) for RX fr

[PATCH net-next v3 16/33] mlx4: add XDP frame size and adjust max XDP MTU

2020-05-08 Thread Jesper Dangaard Brouer
The mlx4 drivers size of memory backing the RX packet is stored in frag_stride. For XDP mode this will be PAGE_SIZE (normally 4096). For normal mode frag_stride is 2048. Also adjust MLX4_EN_MAX_XDP_MTU to take tailroom into account. Cc: Tariq Toukan Cc: Saeed Mahameed Signed-off-by: Jesper Dang

[PATCH net-next v3 27/33] xdp: for Intel AF_XDP drivers add XDP frame_sz

2020-05-08 Thread Jesper Dangaard Brouer
Intel drivers implement native AF_XDP zerocopy in separate C-files, that have its own invocation of bpf_prog_run_xdp(). The setup of xdp_buff is also handled in separately from normal code path. This patch update XDP frame_sz for AF_XDP zerocopy drivers i40e, ice and ixgbe, as the code changes nee

[PATCH net-next v3 17/33] net: thunderx: add XDP frame size

2020-05-08 Thread Jesper Dangaard Brouer
To help reviewers these are the defines related to RCV_FRAG_LEN #define DMA_BUFFER_LEN 1536 /* In multiples of 128bytes */ #define RCV_FRAG_LEN (SKB_DATA_ALIGN(DMA_BUFFER_LEN + NET_SKB_PAD) + \ SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) Cc: Sunil Goutham Cc: Rob

[PATCH net-next v3 20/33] vhost_net: also populate XDP frame size

2020-05-08 Thread Jesper Dangaard Brouer
In vhost_net_build_xdp() the 'buf' that gets queued via an xdp_buff have embedded a struct tun_xdp_hdr (located at xdp->data_hard_start) which contains the buffer length 'buflen' (with tailroom for skb_shared_info). Also storing this buflen in xdp->frame_sz, does not obsolete struct tun_xdp_hdr, as

[PATCH net-next v3 26/33] ice: add XDP frame size to driver

2020-05-08 Thread Jesper Dangaard Brouer
This driver uses different memory models depending on PAGE_SIZE at compile time. For PAGE_SIZE 4K it uses page splitting, meaning for normal MTU frame size is 2048 bytes (and headroom 192 bytes). For larger MTUs the driver still use page splitting, by allocating order-1 pages (8192 bytes) for RX fr

[PATCH net-next v3 19/33] tun: add XDP frame size

2020-05-08 Thread Jesper Dangaard Brouer
The tun driver have two code paths for running XDP (bpf_prog_run_xdp). In both cases 'buflen' contains enough tailroom for skb_shared_info. Cc: Jason Wang Signed-off-by: Jesper Dangaard Brouer Acked-by: Michael S. Tsirkin Acked-by: Jason Wang --- drivers/net/tun.c |2 ++ 1 file changed, 2

[PATCH net-next v3 28/33] mlx5: rx queue setup time determine frame_sz for XDP

2020-05-08 Thread Jesper Dangaard Brouer
The mlx5 driver have multiple memory models, which are also changed according to whether a XDP bpf_prog is attached. The 'rx_striding_rq' setting is adjusted via ethtool priv-flags e.g.: # ethtool --set-priv-flags mlx5p2 rx_striding_rq off On the general case with 4K page_size and regular MTU pa

[PATCH net-next v3 29/33] xdp: allow bpf_xdp_adjust_tail() to grow packet size

2020-05-08 Thread Jesper Dangaard Brouer
Finally, after all drivers have a frame size, allow BPF-helper bpf_xdp_adjust_tail() to grow or extend packet size at frame tail. Remember that helper/macro xdp_data_hard_end have reserved some tailroom. Thus, this helper makes sure that the BPF-prog don't have access to this tailroom area. V2:

[PATCH net-next v3 32/33] selftests/bpf: adjust BPF selftest for xdp_adjust_tail

2020-05-08 Thread Jesper Dangaard Brouer
Current selftest for BPF-helper xdp_adjust_tail only shrink tail. Make it more clear that this is a shrink test case. Signed-off-by: Jesper Dangaard Brouer --- .../selftests/bpf/prog_tests/xdp_adjust_tail.c |9 +- .../testing/selftests/bpf/progs/test_adjust_tail.c | 30

[PATCH net-next v3 33/33] selftests/bpf: xdp_adjust_tail add grow tail tests

2020-05-08 Thread Jesper Dangaard Brouer
Extend BPF selftest xdp_adjust_tail with grow tail tests, which is added as subtest's. The first grow test stays in same form as original shrink test. The second grow test use the newer bpf_prog_test_run_xattr() calls, and does extra checking of data contents. Signed-off-by: Jesper Dangaard Brouer

[PATCH net-next v3 30/33] xdp: clear grow memory in bpf_xdp_adjust_tail()

2020-05-08 Thread Jesper Dangaard Brouer
Clearing memory of tail when grow happens, because it is too easy to write a XDP_PASS program that extend the tail, which expose this memory to users that can run tcpdump. Signed-off-by: Jesper Dangaard Brouer Acked-by: Toke Høiland-Jørgensen --- net/core/filter.c |4 1 file changed, 4

[PATCH net-next v3 31/33] bpf: add xdp.frame_sz in bpf_prog_test_run_xdp().

2020-05-08 Thread Jesper Dangaard Brouer
Update the memory requirements, when adding xdp.frame_sz in BPF test_run function bpf_prog_test_run_xdp() which e.g. is used by XDP selftests. Specifically add the expected reserved tailroom, but also allocated a larger memory area to reflect that XDP frames usually comes in this format. Limit the

Re: [PATCH net v3] net: ethernet: ti: fix build and remove TI_CPTS_MOD workaround

2020-05-08 Thread Grygorii Strashko
On 08/05/2020 13:10, Arnd Bergmann wrote: On Fri, May 8, 2020 at 11:59 AM Grygorii Strashko wrote: From: Clay McClure My recent commit b6d49cab44b5 ("net: Make PTP-specific drivers depend on PTP_1588_CLOCK") exposes a missing dependency in defconfigs that select TI_CPTS without selecting

Re: [PATCH net v3] net: ethernet: ti: fix build and remove TI_CPTS_MOD workaround

2020-05-08 Thread Arnd Bergmann
On Fri, May 8, 2020 at 1:14 PM Grygorii Strashko wrote: > On 08/05/2020 13:10, Arnd Bergmann wrote: > > On Fri, May 8, 2020 at 11:59 AM Grygorii Strashko > >> That's because TI_CPTS_MOD (which is the symbol gating the _compilation_ of > >> cpts.c) now depends on PTP_1588_CLOCK, and so is not enab

Re: [PATCH net-next v2] net: ethernet: ti: fix some return value check of cpsw_ale_create()

2020-05-08 Thread Grygorii Strashko
On 08/05/2020 13:06, Wei Yongjun wrote: cpsw_ale_create() can return both NULL and PTR_ERR(), but all of the caller only check NULL for error handling. This patch convert it to only return PTR_ERR() in all error cases, all the caller using IS_ERR() install of NULL test. Also fix a return nega

Re: [PATCH] octeontx2-pf: Use the napi_alloc_frag() to alloc the pool buffers

2020-05-08 Thread Kevin Hao
On Fri, May 08, 2020 at 01:10:00PM +0530, Sunil Kovvuri wrote: > On Fri, May 8, 2020 at 9:43 AM Kevin Hao wrote: > > > > In the current codes, the octeontx2 uses its own method to allocate > > the pool buffers, but there are some issues in this implementation. > > 1. We have to run the otx2_get_pa

Re: [RFC PATCH bpf-next 1/3] arm64: insn: Fix two bugs in encoding 32-bit logical immediates

2020-05-08 Thread Will Deacon
On Thu, May 07, 2020 at 02:48:07PM -0700, Luke Nelson wrote: > Thanks for the comments! Responses below: > > > It's a bit grotty spreading the checks out now. How about we tweak things > > slightly along the lines of: > > > > > > diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c > >

[PATCH v2] octeontx2-pf: Use the napi_alloc_frag() to alloc the pool buffers

2020-05-08 Thread Kevin Hao
In the current codes, the octeontx2 uses its own method to allocate the pool buffers, but there are some issues in this implementation. 1. We have to run the otx2_get_page() for each allocation cycle and this is pretty error prone. As I can see there is no invocation of the otx2_get_page() in

[PATCH -next] net: dsa: sja1105: remove set but not used variable 'prev_time'

2020-05-08 Thread Samuel Zou
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/dsa/sja1105/sja1105_vl.c:468:6: warning: variable ‘prev_time’ set but not used [-Wunused-but-set-variable] u32 prev_time = 0; ^ Reported-by: Hulk Robot Signed-off-by: Samuel Zou --- drivers/net/dsa/sja1105/sja1105_vl.c

Re: [PATCH bpf-next 10/14] mlx5, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-08 Thread Maxim Mikityanskiy
On 2020-05-07 13:42, Björn Töpel wrote: From: Björn Töpel Use the new MEM_TYPE_XSK_BUFF_POOL API in lieu of MEM_TYPE_ZERO_COPY in mlx5e. It allows to drop a lot of code from the driver (which is now common in AF_XDP core and was related to XSK RX frame allocation, DMA mapping, etc.) and slightl

Re: [PATCH bpf-next 04/14] xsk: introduce AF_XDP buffer allocation API

2020-05-08 Thread Maxim Mikityanskiy
On 2020-05-07 13:42, Björn Töpel wrote: From: Björn Töpel In order to simplify AF_XDP zero-copy enablement for NIC driver developers, a new AF_XDP buffer allocation API is added. The implementation is based on a single core (single producer/consumer) buffer pool for the AF_XDP UMEM. A buffer i

Re: [PATCH net 11/16] net: ethernet: marvell: mvneta: fix fixed-link phydev leaks

2020-05-08 Thread Greg Kroah-Hartman
On Fri, May 08, 2020 at 08:21:19AM +0200, Johan Hovold wrote: > On Fri, May 08, 2020 at 03:35:02AM +0530, Naresh Kamboju wrote: > > On Thu, 7 May 2020 at 16:43, Greg Kroah-Hartman > > wrote: > > > > > > > > > > > > > > > Greg, 3f65047c853a ("of_mdio: add helper to deregister fixed-link > > > > >

Re: [PATCH] net: Protect INET_ADDR_COOKIE on 32-bit architectures

2020-05-08 Thread Stephen Kitt
On Tue, 28 Apr 2020 14:07:46 -0700 (PDT), David Miller wrote: > From: Stephen Kitt > Date: Tue, 28 Apr 2020 09:52:31 +0200 > > > This patch changes INET_ADDR_COOKIE to declare a dummy typedef (so it > > makes checkpatch.pl complain, sorry...) > > This is trading one problem for another, so in

Re: [PATCH bpf-next 10/14] mlx5, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-08 Thread Björn Töpel
On 2020-05-08 13:55, Maxim Mikityanskiy wrote: On 2020-05-07 13:42, Björn Töpel wrote: From: Björn Töpel Use the new MEM_TYPE_XSK_BUFF_POOL API in lieu of MEM_TYPE_ZERO_COPY in mlx5e. It allows to drop a lot of code from the driver (which is now common in AF_XDP core and was related to XSK RX

Re: [PATCH bpf-next 04/14] xsk: introduce AF_XDP buffer allocation API

2020-05-08 Thread Björn Töpel
On 2020-05-08 13:55, Maxim Mikityanskiy wrote: On 2020-05-07 13:42, Björn Töpel wrote: From: Björn Töpel In order to simplify AF_XDP zero-copy enablement for NIC driver developers, a new AF_XDP buffer allocation API is added. The implementation is based on a single core (single producer/consum

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

2020-05-08 Thread Jason Gunthorpe
On Fri, May 08, 2020 at 01:18:51PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the net-next tree got a conflict in: > > drivers/net/bonding/bond_main.c > > between commits: > > ed7d4f023b1a ("bonding: Rename slave_arr to usable_slaves") > c071d91d2a89 ("bondin

[PATCH -next] sunrpc: use kmemdup_nul() in gssp_stringify()

2020-05-08 Thread Chen Zhou
It is more efficient to use kmemdup_nul() if the size is known exactly . According to doc: "Note: Use kmemdup_nul() instead if the size is known exactly." Signed-off-by: Chen Zhou --- net/sunrpc/auth_gss/gss_rpc_upcall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/su

Re: [PATCH v3 net-next 2/4] net: dsa: permit cross-chip bridging between all trees in the system

2020-05-08 Thread Vladimir Oltean
Hi Florian, Thank you so much for the review! On Fri, 8 May 2020 at 06:16, Florian Fainelli wrote: > > > > On 5/3/2020 3:12 PM, Vladimir Oltean wrote: > > From: Vladimir Oltean > > > > One way of utilizing DSA is by cascading switches which do not all have > > compatible taggers. Consider the f

Re: [PATCH -next] net: dsa: sja1105: remove set but not used variable 'prev_time'

2020-05-08 Thread Vladimir Oltean
Hi Samuel, On Fri, 8 May 2020 at 14:55, Samuel Zou wrote: > > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/net/dsa/sja1105/sja1105_vl.c:468:6: warning: variable ‘prev_time’ set > but not used [-Wunused-but-set-variable] > u32 prev_time = 0; > ^ > > Reported-by: Hulk

Re: [PATCH bpf-next 10/14] mlx5, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-08 Thread Maxim Mikityanskiy
On 2020-05-08 15:27, Björn Töpel wrote: On 2020-05-08 13:55, Maxim Mikityanskiy wrote: On 2020-05-07 13:42, Björn Töpel wrote: From: Björn Töpel Use the new MEM_TYPE_XSK_BUFF_POOL API in lieu of MEM_TYPE_ZERO_COPY in mlx5e. It allows to drop a lot of code from the driver (which is now common

Re: [PATCH] octeontx2-pf: Use the napi_alloc_frag() to alloc the pool buffers

2020-05-08 Thread Andrew Lunn
On Fri, May 08, 2020 at 01:08:13PM +0530, Sunil Kovvuri wrote: > On Fri, May 8, 2020 at 11:00 AM Kevin Hao wrote: > > > > On Fri, May 08, 2020 at 10:18:27AM +0530, Sunil Kovvuri wrote: > > > On Fri, May 8, 2020 at 9:43 AM Kevin Hao wrote: > > > > > > > > In the current codes, the octeontx2 uses i

[tip: perf/core] tools feature: Add support for detecting libpfm4

2020-05-08 Thread tip-bot2 for Stephane Eranian
The following commit has been merged into the perf/core branch of tip: Commit-ID: 5ef86146de941f273d669a8e018036f549bf058c Gitweb: https://git.kernel.org/tip/5ef86146de941f273d669a8e018036f549bf058c Author:Stephane Eranian AuthorDate:Wed, 29 Apr 2020 16:14:41 -07:00 Commit

Re: [PATCH bpf-next 10/14] mlx5, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-08 Thread Björn Töpel
On Fri, 8 May 2020 at 15:01, Maxim Mikityanskiy wrote: > > On 2020-05-08 15:27, Björn Töpel wrote: > > On 2020-05-08 13:55, Maxim Mikityanskiy wrote: > >> On 2020-05-07 13:42, Björn Töpel wrote: > >>> From: Björn Töpel > >>> > >>> Use the new MEM_TYPE_XSK_BUFF_POOL API in lieu of MEM_TYPE_ZERO_CO

[tip: perf/core] perf pmu: Add perf_pmu__find_by_type helper

2020-05-08 Thread tip-bot2 for Stephane Eranian
The following commit has been merged into the perf/core branch of tip: Commit-ID: 3a50dc76058d7cd8315f9c712b793d81a7ff4541 Gitweb: https://git.kernel.org/tip/3a50dc76058d7cd8315f9c712b793d81a7ff4541 Author:Stephane Eranian AuthorDate:Wed, 29 Apr 2020 16:14:42 -07:00 Commit

[tip: perf/core] perf doc: Pass ASCIIDOC_EXTRA as an argument

2020-05-08 Thread tip-bot2 for Ian Rogers
The following commit has been merged into the perf/core branch of tip: Commit-ID: 4b1984491e65c9592f9f2bfbe8fb5bf4d4e51587 Gitweb: https://git.kernel.org/tip/4b1984491e65c9592f9f2bfbe8fb5bf4d4e51587 Author:Ian Rogers AuthorDate:Wed, 29 Apr 2020 16:14:40 -07:00 Committer:

Re: [PATCH net-next 7/7] net: atlantic: unify get_mac_permanent

2020-05-08 Thread Andrew Lunn
On Fri, May 08, 2020 at 12:14:51PM +0300, Igor Russkikh wrote: > Hi Jakub, > > > >> This patch moves MAC generation into a separate function, which is > > called > >> from both places to reduce the amount of copy/paste. > > > > Right, but why do you have your own mac generation rather than using

Re: [PATCH bpf-next 10/14] mlx5, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-08 Thread Björn Töpel
On Fri, 8 May 2020 at 15:08, Björn Töpel wrote: > > On Fri, 8 May 2020 at 15:01, Maxim Mikityanskiy wrote: > > [] > > All zeros hints that you're probably putting in the wrong DMA address > somewhere. > Hmm, I can't see that you're using xsk_buff_xdp_get_dma() anywhere in the code. Probably it?

Re: [EXT] Re: [PATCH net-next 7/7] net: atlantic: unify get_mac_permanent

2020-05-08 Thread Igor Russkikh
>>> Right, but why do you have your own mac generation rather than using >>> eth_hw_addr_random(). You need to set NET_ADDR_RANDOM for example, >>> just use standard helpers, please. >> >> We want this still be an Aquantia vendor id MAC, not a fully random mac. >> Thats why the logic below random

Re: [PATCH -next] brcmfmac: make non-global functions static

2020-05-08 Thread Wright Feng
Chen Zhou 於 5/8/2020 9:32 AM 寫道: Fix sparse warning: drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:2206:5: warning: symbol 'brcmf_p2p_get_conn_idx' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: Chen Zhou Reviewed-by: Wright Feng --- dri

Re: [EXT] Re: [PATCH net-next 7/7] net: atlantic: unify get_mac_permanent

2020-05-08 Thread Andrew Lunn
On Fri, May 08, 2020 at 04:22:40PM +0300, Igor Russkikh wrote: > > >>> Right, but why do you have your own mac generation rather than using > >>> eth_hw_addr_random(). You need to set NET_ADDR_RANDOM for example, > >>> just use standard helpers, please. > >> > >> We want this still be an Aquantia

Re: [PATCH v2] net: tcp: fixes commit 98aaa913b4ed ("tcp: Extend SOF_TIMESTAMPING_RX_SOFTWARE to TCP recvmsg")

2020-05-08 Thread Willem de Bruijn
On Thu, May 7, 2020 at 9:18 PM Kelly Littlepage wrote: > > The stated intent of the original commit is to is to "return the timestamp > corresponding to the highest sequence number data returned." The current > implementation returns the timestamp for the last byte of the last fully > read skb, wh

Re: iproute2: tc deletion freezes whole server

2020-05-08 Thread Václav Zindulka
On Thu, May 7, 2020 at 8:52 PM Cong Wang wrote: > > On Tue, May 5, 2020 at 1:46 AM Václav Zindulka > wrote: > > > > On Mon, May 4, 2020 at 7:46 PM Cong Wang wrote: > > > > > > Sorry for the delay. I lost connection to my dev machine, I am trying > > > to setup this on my own laptop. > > > > Sorr

Re: XDP bpf_tail_call_redirect(): yea or nay?

2020-05-08 Thread Toke Høiland-Jørgensen
Björn Töpel writes: > On Thu, 7 May 2020 at 20:08, John Fastabend wrote: >> > [] >> >> I'm wondering if we can teach the verifier to recognize tail calls, >> >> int xdp_prog1(struct xdp_md *ctx) >> { >> return xdp_do_redirect(ctx, &xsks_map, 0); >> } >> >> This would be useful for normal

[RFC PATCH v2 0/3] kprobes: Support nested kprobes

2020-05-08 Thread Masami Hiramatsu
Hi, Here is the 2nd version of the series to add nested-kprobes support to x86, arm64 and arm. This makes kprobes to accept 1-level nesting instead of incrementing missed count. In this version, I fixed a mistake for the kprobes on ftrace on x86 and dump nested probes when we detect an unrecovera

[RFC PATCH v2 3/3] arm: kprobes: Support nested kprobes

2020-05-08 Thread Masami Hiramatsu
Make kprobes to accept 1-level nesting instead of missing it on arm. Any kprobes hits in kprobes pre/post handler context can be nested at once. If the other kprobes hits in the nested pre/post handler context, that will be missed. We can test this feature on the kernel with CONFIG_KPROBE_EVENTS_

[PATCH v3] net: tcp: fix rx timestamp behavior for tcp_recvmsg

2020-05-08 Thread Kelly Littlepage
The stated intent of the original commit is to is to "return the timestamp corresponding to the highest sequence number data returned." The current implementation returns the timestamp for the last byte of the last fully read skb, which is not necessarily the last byte in the recv buffer. This patc

[RFC PATCH v2 1/3] x86/kprobes: Support nested kprobes

2020-05-08 Thread Masami Hiramatsu
Make kprobes to accept 1-level nesting instead of missing it. Any kprobes hits in kprobes pre/post handler context can be nested at once. If the other kprobes hits in the nested pre/post handler context, that will be missed. This is useful if user wants to trace/debug the code which can be invoke

  1   2   3   4   >