[bpf-next v2 2/3] bpf: libbpf support for msg_push_data

2018-10-19 Thread John Fastabend
Add support for new bpf_msg_push_data in libbpf. Signed-off-by: John Fastabend --- tools/include/uapi/linux/bpf.h| 20 +++- tools/testing/selftests/bpf/bpf_helpers.h | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git

[bpf-next v2 0/3] sockmap, bpf_msg_push_data helper

2018-10-19 Thread John Fastabend
This series adds a new helper bpf_msg_push_data to be used by sk_msg programs. The helper can be used to insert extra bytes into the message that can then be used by the program as metadata tags among other things. The first patch adds the helper, second patch the libbpf support, and last patch

[bpf-next v2 1/3] bpf: sk_msg program helper bpf_msg_push_data

2018-10-19 Thread John Fastabend
This allows user to push data into a msg using sk_msg program types. The format is as follows, bpf_msg_push_data(msg, offset, len, flags) this will insert 'len' bytes at offset 'offset'. For example to prepend 10 bytes at the front of the message the user can,

[bpf-next v2 3/3] bpf: test_sockmap add options to use msg_push_data

2018-10-19 Thread John Fastabend
Add options to run msg_push_data, this patch creates two more flags in test_sockmap that can be used to specify the offset and length of bytes to be added. The new options are --txmsg_start_push to specify where bytes should be inserted and --txmsg_end_push to specify how many bytes. This is

Re: [PATCH net-next] net: loopback: clear skb->tstamp before netif_rx()

2018-10-19 Thread Soheil Hassas Yeganeh
On Fri, Oct 19, 2018 at 10:11 PM Eric Dumazet wrote: > > At least UDP / TCP stacks can now cook skbs with a tstamp using > MONOTONIC base (or arbitrary values with SCM_TXTIME) > > Since loopback driver does not call (directly or indirectly) > skb_scrub_packet(), we need to clear skb->tstamp so

[PATCH net-next] net: loopback: clear skb->tstamp before netif_rx()

2018-10-19 Thread Eric Dumazet
At least UDP / TCP stacks can now cook skbs with a tstamp using MONOTONIC base (or arbitrary values with SCM_TXTIME) Since loopback driver does not call (directly or indirectly) skb_scrub_packet(), we need to clear skb->tstamp so that net_timestamp_check() can eventually resample the time, using

RE: [Intel-wired-lan] [PATCH] igb: shorten maximum PHC timecounter update interval

2018-10-19 Thread Brown, Aaron F
> From: Intel-wired-lan [mailto:intel-wired-lan-boun...@osuosl.org] On > Behalf Of Miroslav Lichvar > Sent: Friday, October 12, 2018 4:14 AM > To: intel-wired-...@lists.osuosl.org; netdev@vger.kernel.org > Cc: Thomas Gleixner ; Richard Cochran > > Subject: [Intel-wired-lan] [PATCH] igb: shorten

Re: [PATCH net] net: fix pskb_trim_rcsum_slow() with odd trim offset

2018-10-19 Thread Eric Dumazet
On 10/19/2018 05:07 PM, Dimitris Michailidis wrote: > We've been getting checksum errors involving small UDP packets, usually > 59B packets with 1 extra non-zero padding byte. netdev_rx_csum_fault() > has been complaining that HW is providing bad checksums. Turns out the > problem is in

[PATCH net] net: fix pskb_trim_rcsum_slow() with odd trim offset

2018-10-19 Thread Dimitris Michailidis
We've been getting checksum errors involving small UDP packets, usually 59B packets with 1 extra non-zero padding byte. netdev_rx_csum_fault() has been complaining that HW is providing bad checksums. Turns out the problem is in pskb_trim_rcsum_slow(), introduced in commit 88078d98d1bb ("net:

Re: [PATCH] net: ethernet: lpc_eth: remove unused local variable

2018-10-19 Thread David Miller
From: Vladimir Zapolskiy Date: Fri, 19 Oct 2018 02:06:53 +0300 > A trivial change which removes an unused local variable, the issue > is reported as a compile time warning: > > drivers/net/ethernet/nxp/lpc_eth.c: In function 'lpc_eth_drv_probe': > drivers/net/ethernet/nxp/lpc_eth.c:1250:21:

Re: [PATCH] net: ethernet: lpc_eth: add device and device node local variables

2018-10-19 Thread David Miller
From: Vladimir Zapolskiy Date: Fri, 19 Oct 2018 02:25:11 +0300 > Trivial non-functional change added to simplify getting multiple > references to device pointer in lpc_eth_drv_probe(). > > Signed-off-by: Vladimir Zapolskiy Applied.

Re: [PATCH] net: ethernet: lpc_eth: clean up the list of included headers

2018-10-19 Thread David Miller
From: Vladimir Zapolskiy Date: Fri, 19 Oct 2018 01:53:25 +0300 > The change removes all unnecessary included headers from the driver > source code, the remaining list is sorted in alphabetical order. > > Signed-off-by: Vladimir Zapolskiy Applied.

Re: [PATCH] net: ethernet: lpc_eth: remove CONFIG_OF guard from the driver

2018-10-19 Thread David Miller
From: Vladimir Zapolskiy Date: Fri, 19 Oct 2018 01:58:41 +0300 > The MAC controller device is available on NXP LPC32xx platform only, > and the LPC32xx platform supports OF builds only, so additional > checks in the device driver are not needed. > > Signed-off-by: Vladimir Zapolskiy Applied.

Re: [PATCH net-next v2] netpoll: allow cleanup to be synchronous

2018-10-19 Thread David Miller
From: Debabrata Banerjee Date: Thu, 18 Oct 2018 11:18:26 -0400 > This fixes a problem introduced by: > commit 2cde6acd49da ("netpoll: Fix __netpoll_rcu_free so that it can hold the > rtnl lock") > > When using netconsole on a bond, __netpoll_cleanup can asynchronously > recurse multiple times,

Re: [bpf-next v3 0/2] Fix kcm + sockmap by checking psock type

2018-10-19 Thread John Fastabend
On 10/19/2018 03:57 PM, Daniel Borkmann wrote: > On 10/20/2018 12:51 AM, Daniel Borkmann wrote: >> On 10/18/2018 10:58 PM, John Fastabend wrote: >>> We check if the sk_user_data (the psock in skmsg) is in fact a sockmap >>> type to late, after we read the refcnt which is an error. This >>> series

Re: [PATCH bpf-next v2 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-19 Thread Martin Lau
On Fri, Oct 19, 2018 at 10:26:53PM +0100, Edward Cree wrote: > On 19/10/18 20:36, Martin Lau wrote: > > On Fri, Oct 19, 2018 at 06:04:11PM +0100, Edward Cree wrote: > >> But you *do* have such a new section. > >> The patch comment talks about a 'FuncInfo Table' which appears to > > Note that the

Re: [PATCH v8 bpf-next 0/2] bpf: add cg_skb_is_valid_access

2018-10-19 Thread Alexei Starovoitov
On Fri, Oct 19, 2018 at 09:57:56AM -0700, Song Liu wrote: > Changes v7 -> v8: > 1. Dynamically allocate the dummy sk to avoid race conditions. > > Changes v6 -> v7: > 1. Make dummy sk a global variable (test_run_sk). > > Changes v5 -> v6: > 1. Fixed dummy sk in bpf_prog_test_run_skb() as

Re: [PATCH bpf-next] bpf: Extend the sk_lookup() helper to XDP hookpoint.

2018-10-19 Thread Nitin Hande
On Fri, 19 Oct 2018 22:32:28 +0200 Daniel Borkmann wrote: > On 10/19/2018 06:47 PM, Joe Stringer wrote: > > On Thu, 18 Oct 2018 at 22:07, Martin Lau wrote: > >> On Thu, Oct 18, 2018 at 04:52:40PM -0700, Joe Stringer wrote: > >>> On Thu, 18 Oct 2018 at 14:20, Daniel Borkmann > >>> wrote:

Re: [bpf-next v3 0/2] Fix kcm + sockmap by checking psock type

2018-10-19 Thread Daniel Borkmann
On 10/20/2018 12:51 AM, Daniel Borkmann wrote: > On 10/18/2018 10:58 PM, John Fastabend wrote: >> We check if the sk_user_data (the psock in skmsg) is in fact a sockmap >> type to late, after we read the refcnt which is an error. This >> series moves the check up before reading refcnt and also

Re: [bpf-next v3 0/2] Fix kcm + sockmap by checking psock type

2018-10-19 Thread Daniel Borkmann
On 10/18/2018 10:58 PM, John Fastabend wrote: > We check if the sk_user_data (the psock in skmsg) is in fact a sockmap > type to late, after we read the refcnt which is an error. This > series moves the check up before reading refcnt and also adds a test > to test_maps to test trying to add a KCM

Re: Fw: [Bug 201423] New: eth0: hw csum failure

2018-10-19 Thread Eric Dumazet
On 10/19/2018 02:58 PM, Eric Dumazet wrote: > > > On 10/16/2018 06:00 AM, Eric Dumazet wrote: >> On Mon, Oct 15, 2018 at 11:30 PM Andre Tomt wrote: >>> >>> On 15.10.2018 17:41, Eric Dumazet wrote: On Mon, Oct 15, 2018 at 8:15 AM Stephen Hemminger > Something is changed between

Re: Fw: [Bug 201423] New: eth0: hw csum failure

2018-10-19 Thread Eric Dumazet
On 10/16/2018 06:00 AM, Eric Dumazet wrote: > On Mon, Oct 15, 2018 at 11:30 PM Andre Tomt wrote: >> >> On 15.10.2018 17:41, Eric Dumazet wrote: >>> On Mon, Oct 15, 2018 at 8:15 AM Stephen Hemminger Something is changed between 4.17.12 and 4.18, after bisecting the problem I got

Re: [PATCH v2 net] r8169: fix NAPI handling under high load

2018-10-19 Thread Francois Romieu
Eric Dumazet : > On 10/18/2018 03:59 PM, Francois Romieu wrote: > > Eric Dumazet : > > [...] > >> One has to wonder why rtl8169_poll(), which might be called in a loop > >> under DOS, > >> has to call rtl_ack_events() ? > > > > So as to cover a wider temporal range before any event can trigger

Re: [PATCH bpf-next v2 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-19 Thread Edward Cree
On 19/10/18 20:36, Martin Lau wrote: > On Fri, Oct 19, 2018 at 06:04:11PM +0100, Edward Cree wrote: >> But you *do* have such a new section. >> The patch comment talks about a 'FuncInfo Table' which appears to > Note that the new section, which contains the FuncInfo Table, > is in a new ELF

[no subject]

2018-10-19 Thread David Miller
From: David Howells Date: Fri, 19 Oct 2018 21:51:35 +0100 > David Miller wrote: > >> > Is there going to be a merge of net into net-next before the merge >> > window opens? Or do you have a sample merge that I can rebase my >> > afs-next branch on? >> >> I'll be doing a net to net-next merge

[no subject]

2018-10-19 Thread David Howells
David Miller wrote: > > Is there going to be a merge of net into net-next before the merge > > window opens? Or do you have a sample merge that I can rebase my > > afs-next branch on? > > I'll be doing a net to net-next merge some time today. Excellent, thanks! David

RE: [PATCH net-next v2] netpoll: allow cleanup to be synchronous

2018-10-19 Thread Banerjee, Debabrata
> From: Neil Horman > I presume you've tested this with some of the stacked devices? I think I'm > ok with this change, but I'd like confirmation that its worked. > > Neil Yes I've tested this on a bond device with vlan stacked on top. -Deb > > > CC: Neil Horman > > CC: "David S. Miller"

Re: [PATCH bpf-next v2 0/2] improve and fix barriers for walking perf ring buffer

2018-10-19 Thread Alexei Starovoitov
On Fri, Oct 19, 2018 at 03:51:01PM +0200, Daniel Borkmann wrote: > This set first adds smp_* barrier variants to tools infrastructure > and updates perf and libbpf to make use of them. For details, please > see individual patches, thanks! > > Arnaldo, if there are no objections, could this be

[PATCH iproute2-next] Tree wide: Drop sockaddr_nl arg

2018-10-19 Thread David Ahern
From: David Ahern No command, filter, or print function uses the sockaddr_nl arg, so just drop it. Signed-off-by: David Ahern --- bridge/br_common.h | 9 +++-- bridge/fdb.c | 2 +- bridge/link.c| 3 +-- bridge/mdb.c | 2 +- bridge/monitor.c | 9 -

Re: [PATCH net v2] net/sched: act_gact: properly init 'goto chain'

2018-10-19 Thread Cong Wang
On Thu, Oct 18, 2018 at 8:30 AM Davide Caratti wrote: > The alternative is, we systematically forbid usage of 'goto chain' in > tcfg_paction, so that: > > # tc f a dev v0 egress matchall action random determ goto chain 4 5 > > is systematically rejected with -EINVAL. This comand never worked, so

Re: [PATCH bpf-next v2 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-19 Thread Martin Lau
On Fri, Oct 19, 2018 at 12:36:49PM -0700, Martin Lau wrote: > On Fri, Oct 19, 2018 at 06:04:11PM +0100, Edward Cree wrote: > > On 18/10/18 22:19, Martin Lau wrote: > > > As I have mentioned earlier, it is also special to > > > the kernel because the BTF verifier and bpf_prog_load() > > > need to

Re: [PATCH net-next v2] netpoll: allow cleanup to be synchronous

2018-10-19 Thread Neil Horman
On Thu, Oct 18, 2018 at 11:18:26AM -0400, Debabrata Banerjee wrote: > This fixes a problem introduced by: > commit 2cde6acd49da ("netpoll: Fix __netpoll_rcu_free so that it can hold the > rtnl lock") > > When using netconsole on a bond, __netpoll_cleanup can asynchronously > recurse multiple

Re: [PATCH bpf-next] bpf: Extend the sk_lookup() helper to XDP hookpoint.

2018-10-19 Thread Daniel Borkmann
On 10/19/2018 06:47 PM, Joe Stringer wrote: > On Thu, 18 Oct 2018 at 22:07, Martin Lau wrote: >> On Thu, Oct 18, 2018 at 04:52:40PM -0700, Joe Stringer wrote: >>> On Thu, 18 Oct 2018 at 14:20, Daniel Borkmann wrote: On 10/18/2018 11:06 PM, Joe Stringer wrote: > On Thu, 18 Oct 2018 at

Re: [PATCH bpf-next v3 0/7] Implement queue/stack maps

2018-10-19 Thread Alexei Starovoitov
On Fri, Oct 19, 2018 at 10:08:08PM +0200, Daniel Borkmann wrote: > On 10/18/2018 03:16 PM, Mauricio Vasquez B wrote: > > In some applications this is needed have a pool of free elements, for > > example the list of free L4 ports in a SNAT. None of the current maps allow > > to do it as it is not

[PATCH iproute2-next] iplink: Remove flags argument from iplink_get

2018-10-19 Thread David Ahern
From: David Ahern iplink_get has 1 caller and the flags arg is 0, so just remove it. Signed-off-by: David Ahern --- ip/ip_common.h | 2 +- ip/ipaddress.c | 2 +- ip/iplink.c| 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ip/ip_common.h b/ip/ip_common.h index

[PATCH net] qlcnic: fix a return in qlcnic_dcb_get_capability()

2018-10-19 Thread Dan Carpenter
These functions are supposed to return one on failure and zero on success. Returning a zero here could cause uninitialized variable bugs in several of the callers. For example: drivers/scsi/cxgbi/cxgb4i/cxgb4i.c:1660 get_iscsi_dcb_priority() error: uninitialized symbol 'caps'. Fixes:

Re: [PATCH bpf-next v3 0/7] Implement queue/stack maps

2018-10-19 Thread Daniel Borkmann
On 10/18/2018 03:16 PM, Mauricio Vasquez B wrote: > In some applications this is needed have a pool of free elements, for > example the list of free L4 ports in a SNAT. None of the current maps allow > to do it as it is not possible to get any element without having they key > it is associated

[PATCH net-next 3/4] net/ipv4: Add support for dumping addresses for a specific device

2018-10-19 Thread David Ahern
From: David Ahern If an RTM_GETADDR dump request has ifa_index set in the ifaddrmsg header, then return only the addresses for that device. Signed-off-by: David Ahern --- net/ipv4/devinet.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git

[PATCH net-next 2/4] net/ipv6: Remove ip_idx arg to in6_dump_addrs

2018-10-19 Thread David Ahern
From: David Ahern ip_idx is always 0 going into in6_dump_addrs; it is passed as a pointer to save the last good index into cb. Since cb is already argument to in6_dump_addrs, just save the value there. Signed-off-by: David Ahern --- net/ipv6/addrconf.c | 16 ++-- 1 file changed, 6

[PATCH net-next 1/4] net/ipv4: Move loop over addresses on a device into in_dev_dump_addr

2018-10-19 Thread David Ahern
From: David Ahern Similar to IPv6 move the logic that walks over the ipv4 address list for a device into a helper. Signed-off-by: David Ahern --- net/ipv4/devinet.c | 49 ++--- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git

[PATCH net-next 4/4] net/ipv6: Add support for dumping addresses for a specific device

2018-10-19 Thread David Ahern
From: David Ahern If an RTM_GETADDR dump request has ifa_index set in the ifaddrmsg header, then return only the addresses for that device. Since inet6_dump_addr is reused for multicast and anycast addresses, this adds support for device specfic dumps of RTM_GETMULTICAST and RTM_GETANYCAST as

[PATCH net-next 0/4] net: Add support for dumping addresses for a specific device

2018-10-19 Thread David Ahern
From: David Ahern Use the recently added kernel side filter infrastructure to add support for dumping addresses only for a specific device. Patch 1 creates an IPv4 version similar to IPv6's in6_dump_addrs function. Patch 2 simplifies in6_dump_addrs by moving index tracking of IP addresses from

Re: [PATCH bpf-next v2 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-19 Thread Martin Lau
On Fri, Oct 19, 2018 at 06:04:11PM +0100, Edward Cree wrote: > On 18/10/18 22:19, Martin Lau wrote: > > As I have mentioned earlier, it is also special to > > the kernel because the BTF verifier and bpf_prog_load() > > need to do different checks for FUNC and FUNC_PROTO to > > ensure they are

Re: C45 Phys and PHY_FORCING state

2018-10-19 Thread Florian Fainelli
On 10/19/2018 05:02 AM, Jose Abreu wrote: > Hello Andrew and Florian, > > Currently I have a 10G C45 phy that is fixed at 10G link. This > version does not support auto negotiation so I'm turning off the > feature in phydev struct field. I found out that when I do this > phylib is not composing

[PATCH][next] igc: fix error return handling from call to netif_set_real_num_tx_queues

2018-10-19 Thread Colin King
From: Colin Ian King The call to netif_set_real_num_tx_queues is not assigning the error return to variable err even though the next line checks err for an error. Fix this by adding the missing err assignment. Detected by CoverityScan, CID#1474551 ("Logically dead code") Fixes: 3df25e4c1e66

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

2018-10-19 Thread Florian Fainelli
On 08/16/2018 02:34 PM, tristram...@microchip.com wrote: >> -Original Message- >> From: Florian Fainelli >> Sent: Wednesday, August 15, 2018 5:29 PM >> To: Tristram Ha - C24268 ; Andrew Lunn >> ; Pavel Machek ; Ruediger Schmitt >> >> Cc: Arkadi Sharshevsky ; UNGLinuxDriver >> ;

[no subject]

2018-10-19 Thread David Miller
From: David Howells Date: Fri, 19 Oct 2018 15:40:53 +0100 > Is there going to be a merge of net into net-next before the merge > window opens? Or do you have a sample merge that I can rebase my > afs-next branch on? I'll be doing a net to net-next merge some time today.

Re: [PATCH net-next] rocker: Drop pointless static qualifier

2018-10-19 Thread David Miller
From: YueHaibing Date: Fri, 19 Oct 2018 12:02:59 + > There is no need to have the 'struct rocker_desc_info *desc_info' > variable static since new value always be assigned before use it. > > Signed-off-by: YueHaibing Applied, thank you.

Re: [PATCH bpf-next v2 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-19 Thread Edward Cree
On 18/10/18 22:19, Martin Lau wrote: > As I have mentioned earlier, it is also special to > the kernel because the BTF verifier and bpf_prog_load() > need to do different checks for FUNC and FUNC_PROTO to > ensure they are sane. > > First, we need to agree that the kernel needs to verify > them

[PATCH net] net/ipv6: Fix index counter for unicast addresses in in6_dump_addrs

2018-10-19 Thread David Ahern
From: David Ahern The loop wants to skip previously dumped addresses, so loops until current index >= saved index. If the message fills it wants to save the index for the next address to dump - ie., the one that did not fit in the current message. Currently, it is incrementing the index counter

[PATCH v8 bpf-next 1/2] bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB

2018-10-19 Thread Song Liu
BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the skb. This patch enables direct access of skb for these programs. Two helper functions bpf_compute_and_save_data_end() and bpf_restore_data_end() are introduced. There are used in __cgroup_bpf_run_filter_skb(), to compute

[PATCH v8 bpf-next 0/2] bpf: add cg_skb_is_valid_access

2018-10-19 Thread Song Liu
Changes v7 -> v8: 1. Dynamically allocate the dummy sk to avoid race conditions. Changes v6 -> v7: 1. Make dummy sk a global variable (test_run_sk). Changes v5 -> v6: 1. Fixed dummy sk in bpf_prog_test_run_skb() as suggested by Eric Dumazet. Changes v4 -> v5: 1. Replaced

[PATCH v8 bpf-next 2/2] bpf: add tests for direct packet access from CGROUP_SKB

2018-10-19 Thread Song Liu
Tests are added to make sure CGROUP_SKB cannot access: tc_classid, data_meta, flow_keys and can read and write: mark, prority, and cb[0-4] and can read other fields. To make selftest with skb->sk work, a dummy sk is added in bpf_prog_test_run_skb(). Signed-off-by: Song Liu ---

RE: Improving accuracy of PHC readings

2018-10-19 Thread Keller, Jacob E
> -Original Message- > From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org] On > Behalf Of Miroslav Lichvar > Sent: Friday, October 19, 2018 2:52 AM > To: netdev@vger.kernel.org > Cc: Richard Cochran ; Keller, Jacob E > > Subject: Improving accuracy of PHC readings >

Re: [PATCH bpf-next] bpf: Extend the sk_lookup() helper to XDP hookpoint.

2018-10-19 Thread Joe Stringer
On Thu, 18 Oct 2018 at 22:07, Martin Lau wrote: > > On Thu, Oct 18, 2018 at 04:52:40PM -0700, Joe Stringer wrote: > > On Thu, 18 Oct 2018 at 14:20, Daniel Borkmann wrote: > > > > > > On 10/18/2018 11:06 PM, Joe Stringer wrote: > > > > On Thu, 18 Oct 2018 at 11:54, Nitin Hande wrote: > > > [...]

Re: [PATCH v7 bpf-next 2/2] bpf: add tests for direct packet access from CGROUP_SKB

2018-10-19 Thread Eric Dumazet
On 10/19/2018 09:27 AM, Song Liu wrote: > Tests are added to make sure CGROUP_SKB cannot access: > tc_classid, data_meta, flow_keys > > and can read and write: > mark, prority, and cb[0-4] > > and can read other fields. > > To make selftest with skb->sk work, a dummy sk is added in >

[PATCH v7 bpf-next 0/2] bpf: add cg_skb_is_valid_access

2018-10-19 Thread Song Liu
Changes v6 -> v7: 1. Make dummy sk a global variable (test_run_sk). Changes v5 -> v6: 1. Fixed dummy sk in bpf_prog_test_run_skb() as suggested by Eric Dumazet. Changes v4 -> v5: 1. Replaced bpf_compute_and_save_data_pointers() with bpf_compute_and_save_data_end(); Replaced

[PATCH v7 bpf-next 1/2] bpf: add cg_skb_is_valid_access for BPF_PROG_TYPE_CGROUP_SKB

2018-10-19 Thread Song Liu
BPF programs of BPF_PROG_TYPE_CGROUP_SKB need to access headers in the skb. This patch enables direct access of skb for these programs. Two helper functions bpf_compute_and_save_data_end() and bpf_restore_data_end() are introduced. There are used in __cgroup_bpf_run_filter_skb(), to compute

[PATCH v7 bpf-next 2/2] bpf: add tests for direct packet access from CGROUP_SKB

2018-10-19 Thread Song Liu
Tests are added to make sure CGROUP_SKB cannot access: tc_classid, data_meta, flow_keys and can read and write: mark, prority, and cb[0-4] and can read other fields. To make selftest with skb->sk work, a dummy sk is added in bpf_prog_test_run_skb(). Signed-off-by: Song Liu ---

Re: [danie...@cisco.com: Re: gianfar: Implement MAC reset and reconfig procedure]

2018-10-19 Thread Daniel Walker
On Thu, Oct 18, 2018 at 04:49:26PM +, Claudiu Manoil wrote: > > I can only advise you to check whether the MACCFG2 register settings are > consistent > at this point, when ping fails. You should check the I/F Mode bits (22-23) > and the > Full Duplex bit (31), in big-endian format. If

Re: [PATCH 1/2] net: emac: implement 802.1Q VLAN TX tagging support

2018-10-19 Thread Christian Lamparter
On Wednesday, October 17, 2018 10:09:10 PM CEST Florian Fainelli wrote: > On 10/17/2018 01:08 PM, Florian Fainelli wrote: > > On 10/17/2018 12:53 PM, Christian Lamparter wrote: > >> As per' APM82181 Embedded Processor User Manual 26.1 EMAC Features: > >> VLAN: > >> - Support for VLAN tag ID in

[iproute PATCH] tc: htb: Print default value in hex

2018-10-19 Thread Phil Sutter
Value of 'default' is assumed to be hexadecimal when parsing, so consequently it should be printed in hex as well. This is a regression introduced when adding JSON output. Fixes: f354fa6aa5ff0 ("tc: jsonify htb qdisc") Signed-off-by: Phil Sutter --- tc/q_htb.c | 2 +- 1 file changed, 1

Re: [PATCH 2/2] net: emac: implement TCP TSO

2018-10-19 Thread Christian Lamparter
Hello, On Wednesday, October 17, 2018 10:09:44 PM CEST Florian Fainelli wrote: > On 10/17/2018 12:53 PM, Christian Lamparter wrote: > > This patch enables TSO(v4) hw feature for emac driver. > > As atleast the APM82181's TCP/IP acceleration hardware > > controller (TAH) provides TCP segmentation

Re: [PATCH v6 bpf-next 2/2] bpf: add tests for direct packet access from CGROUP_SKB

2018-10-19 Thread Eric Dumazet
On 10/18/2018 10:53 PM, Song Liu wrote: > Tests are added to make sure CGROUP_SKB cannot access: > tc_classid, data_meta, flow_keys > > and can read and write: > mark, prority, and cb[0-4] > > and can read other fields. > > To make selftest with skb->sk work, a dummy sk is added in >

[no subject]

2018-10-19 Thread David Howells
Hi Dave, Is there going to be a merge of net into net-next before the merge window opens? Or do you have a sample merge that I can rebase my afs-next branch on? The problem I have is that there's a really necessary patch in net that's not in net-next:

[RFC PATCH v2 08/10] selftests: conditionally enable XDP support in udpgso_bench_rx

2018-10-19 Thread Paolo Abeni
XDP support will be used by a later patch to test the GRO path in a net namespace, leveraging the veth XDP implementation. To avoid breaking existing setup, XDP support is conditionally enabled and build only if llc is locally available. Signed-off-by: Paolo Abeni ---

[RFC PATCH v2 07/10] selftests: add GRO support to udp bench rx program

2018-10-19 Thread Paolo Abeni
And fix a couple of buglets (port option processing, clean termination on SIGINT). This is preparatory work for GRO tests. Signed-off-by: Paolo Abeni --- tools/testing/selftests/net/udpgso_bench_rx.c | 37 +++ 1 file changed, 30 insertions(+), 7 deletions(-) diff --git

[RFC PATCH v2 09/10] selftests: add some benchmark for UDP GRO

2018-10-19 Thread Paolo Abeni
Run on top of veth pair, using a dummy XDP program to enable the GRO. Signed-off-by: Paolo Abeni --- tools/testing/selftests/net/Makefile| 1 + tools/testing/selftests/net/udpgro_bench.sh | 92 + 2 files changed, 93 insertions(+) create mode 100755

[RFC PATCH v2 10/10] selftests: add functionals test for UDP GRO

2018-10-19 Thread Paolo Abeni
Extends the existing udp programs to allow checking for proper GRO aggregation/GSO size, and run the tests via a shell script, using a veth pair with XDP program attached to trigger the GRO code path. Signed-off-by: Paolo Abeni --- tools/testing/selftests/net/Makefile | 2 +-

[RFC PATCH v2 06/10] udp: cope with UDP GRO packet misdirection

2018-10-19 Thread Paolo Abeni
In some scenarios, the GRO engine can assemble an UDP GRO packet that ultimately lands on a non GRO-enabled socket. This patch tries to address the issue explicitly checking for the UDP socket features before enqueuing the packet, and eventually segmenting the unexpected GRO packet, as needed. We

[RFC PATCH v2 03/10] udp: add support for UDP_GRO cmsg

2018-10-19 Thread Paolo Abeni
When UDP GRO is enabled, the UDP_GRO cmsg will carry the ingress datagram size. User-space can use such info to compute the original packets layout. Signed-off-by: Paolo Abeni --- CHECK: should we use a separate setsockopt to explicitly enable gso_size cmsg reception? So that user space can

[RFC PATCH v2 02/10] udp: implement GRO for plain UDP sockets.

2018-10-19 Thread Paolo Abeni
This is the RX counterpart of commit bec1f6f69736 ("udp: generate gso with UDP_SEGMENT"). When UDP_GRO is enabled, such socket is also eligible for GRO in the rx path: UDP segments directed to such socket are assembled into a larger GSO_UDP_L4 packet. The core UDP GRO support is enabled with

[RFC PATCH v2 05/10] ipv6: factor out protocol delivery helper

2018-10-19 Thread Paolo Abeni
So that we can re-use it at the UDP lavel in the next patch Signed-off-by: Paolo Abeni --- net/ipv6/ip6_input.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index 96577e742afd..3065226bdc57 100644

[RFC PATCH v2 00/10] udp: implement GRO support

2018-10-19 Thread Paolo Abeni
This series implements GRO support for UDP sockets, as the RX counterpart of commit bec1f6f69736 ("udp: generate gso with UDP_SEGMENT"). The core functionality is implemented by the second patch, introducing a new sockopt to enable UDP_GRO, while patch 3 implements support for passing the segment

[RFC PATCH v2 01/10] udp: implement complete book-keeping for encap_needed

2018-10-19 Thread Paolo Abeni
The *encap_needed static keys are enabled by UDP tunnels and several UDP encapsulations type, but they are never turned off. This can cause unneeded overall performance degradation for systems where such features are used transiently. This patch introduces complete book-keeping for such keys,

[RFC PATCH v2 04/10] ip: factor out protocol delivery helper

2018-10-19 Thread Paolo Abeni
So that we can re-use it at the UDP lavel in a later patch Signed-off-by: Paolo Abeni --- net/ipv4/ip_input.c | 73 ++--- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index

[PATCH bpf-next v2 1/2] tools, perf: add and use optimized ring_buffer_{read_head,write_tail} helpers

2018-10-19 Thread Daniel Borkmann
Currently, on x86-64, perf uses LFENCE and MFENCE (rmb() and mb(), respectively) when processing events from the perf ring buffer which is unnecessarily expensive as we can do more lightweight in particular given this is critical fast-path in perf. According to Peter rmb()/mb() were added back

[PATCH bpf-next v2 2/2] bpf, libbpf: use correct barriers in perf ring buffer walk

2018-10-19 Thread Daniel Borkmann
Given libbpf is a generic library and not restricted to x86-64 only, the compiler barrier in bpf_perf_event_read_simple() after fetching the head needs to be replaced with smp_rmb() at minimum. Also, writing out the tail we should use WRITE_ONCE() to avoid store tearing. Now that we have the

[PATCH bpf-next v2 0/2] improve and fix barriers for walking perf ring buffer

2018-10-19 Thread Daniel Borkmann
This set first adds smp_* barrier variants to tools infrastructure and updates perf and libbpf to make use of them. For details, please see individual patches, thanks! Arnaldo, if there are no objections, could this be routed via bpf-next with Acked-by's due to later dependencies in libbpf?

[PATCH 12/17] octeontx2-af: Add LMAC channel info to NIXLF_ALLOC response

2018-10-19 Thread sunil . kovvuri
From: Stanislaw Kardach Add LMAC channel info like Rx/Tx channel base and count to NIXLF_ALLOC mailbox message response. This info is used by NIXLF attached RVU PF/VF to configure SQ's default channel, TL3_TL2_LINKX_CFG and to install MCAM rules in NPC based on matching ingress channel number.

[PATCH 04/17] octeontx2-af: Add NPC KPU profile

2018-10-19 Thread sunil . kovvuri
From: Hao Zheng NPC block is responsible for parsing and forwarding packets to different NIXLFs. NPC has 16 KPU engines (Kangaroo parse engine) and one iKPU which represents pkinds. Each physical port either CGX/LBK is assigned a pkind and upon receiving a packet HW takes that port's pkind and

[PATCH 16/17] octeontx2-af: Support for setting MAC address

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham Added a new mailbox message for a PF/VF to set/update it's NIXLF's MAC address. Also updates unicast NPC MCAM entry with this address as matching DMAC. Signed-off-by: Sunil Goutham --- drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 8 ++-

[PATCH 17/17] octeontx2-af: Support for NIXLF's UCAST/PROMISC/ALLMULTI modes

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham By default NIXLF is set in UCAST mode. This patch adds a new mailbox message which when sent by a RVU PF changes this default mode. When promiscuous mode is needed, the reserved promisc entry for each of RVU PF is setup to match against ingress channel number only, so that

[PATCH 11/17] octeontx2-af: NPC MCAM and LDATA extract minimal configuration

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham This patch adds some minimal configuration for NPC MCAM and LDATA extraction which is sufficient enough to install ucast/bcast/promiscuous forwarding rules. Below is the config done - LDATA extraction config to extract DMAC from pkt to offset 64bit in MCAM search key. - Set

[PATCH 08/17] octeontx2-af: Update bcast list upon NIXLF alloc/free

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham Upon NIXLF ALLOC/FREE, add or remove corresponding PF_FUNC from the broadcast packet replication list of the CGX LMAC mapped RVU PF. Signed-off-by: Sunil Goutham --- .../net/ethernet/marvell/octeontx2/af/rvu_nix.c| 133 + 1 file changed, 133

[PATCH 01/17] octeontx2-af: NIX Tx scheduler queues alloc/free

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham Added support for a PF/VF to allocate or free NIX transmit scheduler queues via mbox. For setting up pkt transmission priorities between queues, the scheduler queues have to be contiguous w.r.t their HW indices. So both contiguous and non-contiguous allocations are supported.

[PATCH 13/17] octeontx2-af: Install ucast and bcast pkt forwarding rules

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham Upon NIXLF_ALLOC install a unicast forwarding rule in NPC MCAM like below - Match pkt DMAC with NIXLF attached PF/VF's MAC address. - Ingress channel - Action is UCAST - Forward to PF_FUNC of this NIXLF And broadcast pkt forwarding rule as - Match L2B bit in MCAM search

[PATCH 05/17] octeontx2-af: Config NPC KPU engines with parser profile

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham This patch configures all 16 KPUs and iKPU (pkinds) with the KPU parser profile defined in npc_profile.h. Each KPU engine has a 128 entry CAM, only CAM entries which are listed in the profile are enabled and rest are left disabled. Also - Memory is allocated for pkind's

[PATCH 09/17] octeontx2-af: Support for VTAG strip and capture

2018-10-19 Thread sunil . kovvuri
From: Vamsi Attunuru Added support for PF/VF drivers to configure NIX to capture and/or strip VLAN tag from ingress packets. Signed-off-by: Vamsi Attunuru Signed-off-by: Sunil Goutham --- drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 35 -

[PATCH 00/17] octeontx2-af: NPC parser and NIX blocks initialization

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham This patchset is a continuation to earlier submitted two patch series to add a new driver for Marvell's OcteonTX2 SOC's Resource virtualization unit (RVU) admin function driver. 1. octeontx2-af: Add RVU Admin Function driver

[PATCH 15/17] octeontx2-af: Support for changing RSS algorithm

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham This patch adds support for a RVU PF/VF to change NIX Rx flowkey algorithm index in NPC RX RSS_ACTION. eg: a ethtool command changing RSS algorithm for a netdev interface would trigger this change in NPC. If PF/VF doesn't specify any MCAM entry index then default UCAST entry

[PATCH 07/17] octeontx2-af: Broadcast packet replication support

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham Allocate memory for mcast/bcast/mirror replication entry contexts, replication buffers (used by HW) and config HW with corresponding memory bases. Added support for installing MCEs via NIX AQ mbox. For now support is restricted to broadcast pkt replication, hence MCE table

[PATCH 06/17] octeontx2-af: Config pkind for CGX mapped PFs

2018-10-19 Thread sunil . kovvuri
From: Geetha sowjanya For each CGX LMAC that is mapped to a RVU PF, allocate a pkind and config the same in CGX. For a received packet at CGX LMAC interface this pkind is used by NPC block to start parsing of packet. Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham ---

[PATCH 10/17] octeontx2-af: Enable packet length and csum validation

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham Config NPC layer info from KPU profile into protocol checker to identify outer L2/IPv4/TCP/UDP headers in a packet. And enable IPv4 checksum validation. L3/L4 and L4 CSUM validation will be enabled by PF/VF drivers by configuring NIX_AF_LF(0..127)_RX_CFG via mbox i.e

[PATCH 03/17] octeontx2-af: Reset NIXLF's Rx/Tx stats

2018-10-19 Thread sunil . kovvuri
From: Vamsi Attunuru This patch adds a new mailbox message to reset a NIXLF's receive and transmit HW stats. Signed-off-by: Vamsi Attunuru Signed-off-by: Sunil Goutham --- drivers/net/ethernet/marvell/octeontx2/af/mbox.h | 3 ++- drivers/net/ethernet/marvell/octeontx2/af/rvu.h| 2 ++

[PATCH 14/17] octeontx2-af: NIX Rx flowkey configuration for RSS

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham Configure NIX RX flowkey algorithm configuration to support RSS (receive side scaling). Currently support for only L3/L4 2-tuple and 4-tuple hash of IPv4/v6/TCP/UDP/SCTP is added. HW supports upto 32 different flowkey algorithms which SW can define, this patch defines 9. NPC

[PATCH 02/17] octeontx2-af: NIX Tx scheduler queue config support

2018-10-19 Thread sunil . kovvuri
From: Sunil Goutham This patch adds support for a PF/VF driver to configure NIX transmit scheduler queues via mbox. Since PF/VF doesn't know the absolute HW index of the NIXLF attached to it, AF traps the register config and overwrites with the correct NIXLF index. HW supports shaping,

Re: [PATCH net-next] octeontx2-af: Remove set but not used variable 'block'

2018-10-19 Thread Sunil Kovvuri
On Fri, Oct 19, 2018 at 6:11 PM YueHaibing wrote: > > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/net/ethernet/marvell/octeontx2/af/rvu_npa.c: In function > 'rvu_npa_init': > drivers/net/ethernet/marvell/octeontx2/af/rvu_npa.c:446:20: warning: > variable 'block' set but not used

[PATCH net-next] octeontx2-af: Remove set but not used variable 'block'

2018-10-19 Thread YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/marvell/octeontx2/af/rvu_npa.c: In function 'rvu_npa_init': drivers/net/ethernet/marvell/octeontx2/af/rvu_npa.c:446:20: warning: variable 'block' set but not used [-Wunused-but-set-variable] It never used since introduction in

[PATCH net-next] igc: Remove set but not used variable 'pci_using_dac'

2018-10-19 Thread YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/intel/igc/igc_main.c: In function 'igc_probe': drivers/net/ethernet/intel/igc/igc_main.c:3535:11: warning: variable 'pci_using_dac' set but not used [-Wunused-but-set-variable] It never used since introduction in commit

  1   2   >