[PATCH net v2] ipvs: Improve robustness to the ipvs sysctl

2019-07-30 Thread hujunwei
From: Junwei Hu The ipvs module parse the user buffer and save it to sysctl, then check if the value is valid. invalid value occurs over a period of time. Here, I add a variable, struct ctl_table tmp, used to read the value from the user buffer, and save only when it is valid. I delete proc_do_sy

net: ipv6: Fix a bug in ndisc_send_ns when netdev only has a global address

2019-07-30 Thread Mark Smith
Hi, I'm not subscribed to the Linux netdev mailing list, so I can't directly reply to the patch email. This patch is not the correct solution to this issue. Per RFC 4291 "IP Version 6 Addressing Architecture", all IPv6 interfaces are required to have Link-Local addresses, so therefore there shou

[patch net-next v2 0/3] net: devlink: Finish network namespace support

2019-07-30 Thread Jiri Pirko
From: Jiri Pirko Devlink from the beginning counts with network namespaces, but the instances has been fixed to init_net. The first patch allows user to move existing devlink instances into namespaces: $ devlink dev netdevsim/netdevsim1 $ ip netns add ns1 $ devlink dev set netdevsim/netdevsim1 n

[patch net-next v2 1/3] net: devlink: allow to change namespaces

2019-07-30 Thread Jiri Pirko
From: Jiri Pirko All devlink instances are created in init_net and stay there for a lifetime. Allow user to be able to move devlink instances into namespaces. Signed-off-by: Jiri Pirko --- v1->v2: - change the check for multiple attributes - add warnon in case there is no attribute passed ---

[patch net-next v2 2/3] net: devlink: export devlink net set/get helpers

2019-07-30 Thread Jiri Pirko
From: Jiri Pirko Allow drivers to set/get net struct for devlink instance. Set is only allowed for newly allocated devlink instance. Signed-off-by: Jiri Pirko --- include/net/devlink.h | 3 +++ net/core/devlink.c| 18 ++ 2 files changed, 17 insertions(+), 4 deletions(-) d

[patch net-next v2 3/3] netdevsim: create devlink and netdev instances in namespace

2019-07-30 Thread Jiri Pirko
From: Jiri Pirko When user does create new netdevsim instance using sysfs bus file, create the devlink instance and related netdev instance in the namespace of the caller. Signed-off-by: Jiri Pirko --- v1->v2: - remove net_namespace.h include and forward decralared net struct - add comment to i

[patch iproute2-next v2 2/2] devlink: add support for network namespace change

2019-07-30 Thread Jiri Pirko
From: Jiri Pirko Signed-off-by: Jiri Pirko --- devlink/devlink.c| 54 +++- include/uapi/linux/devlink.h | 4 +++ man/man8/devlink-dev.8 | 12 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/devlink/devlink.c b/devlink/de

[patch iproute2-next v2 1/2] devlink: introduce cmdline option to switch to a different namespace

2019-07-30 Thread Jiri Pirko
From: Jiri Pirko Signed-off-by: Jiri Pirko --- devlink/devlink.c | 12 ++-- man/man8/devlink.8 | 4 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/devlink/devlink.c b/devlink/devlink.c index d8197ea3a478..9242cc05ad0c 100644 --- a/devlink/devlink.c +++ b/devlink/

Re: net: ipv6: Fix a bug in ndisc_send_ns when netdev only has a global address

2019-07-30 Thread Su Yanjun
在 2019/7/30 16:15, Mark Smith 写道: Hi, I'm not subscribed to the Linux netdev mailing list, so I can't directly reply to the patch email. This patch is not the correct solution to this issue. Per RFC 4291 "IP Version 6 Addressing Architecture", all IPv6 interfaces are required to have Link-Lo

Re: DSA Rate Limiting in 88E6390

2019-07-30 Thread Benjamin Beckmeyer
>> Hi all, >> is there a possibility to set the rate limiting for the 6390 with linux >> tools? >> I've seen that the driver will init all to zero, so rate limiting is >> disabled, >> but there is no solution for it in the ip tool? >> >> The only thing I found for rate limiting is the tc tool,

Re: [RFC PATCH 1/2] gianfar: convert to phylink

2019-07-30 Thread Russell King - ARM Linux admin
On Tue, Jul 30, 2019 at 02:39:58AM +0300, Vladimir Oltean wrote: > To be honest I don't have a complete answer to that question. The > literature recommends writing 0x01a0 to the MII_ADVERTISE (0x4) > register of the MAC PCS for 1000Base-X, and 0x4001 for SGMII. That looks entirely sane for both m

Re: net: ipv6: Fix a bug in ndisc_send_ns when netdev only has a global address

2019-07-30 Thread Mark Smith
Hi Su, On Tue, 30 Jul 2019 at 19:41, Su Yanjun wrote: > > > 在 2019/7/30 16:15, Mark Smith 写道: > > Hi, > > > > I'm not subscribed to the Linux netdev mailing list, so I can't > > directly reply to the patch email. > > > > This patch is not the correct solution to this issue. > > > In linux impl

[PATCH nf] netfilter: nf_tables: map basechain priority to hardware priority

2019-07-30 Thread Pablo Neira Ayuso
This patch maps basechain netfilter priorities from -8192 to 8191 to hardware priority 0xC000 + 1. tcf_auto_prio() uses 0xC000 if the user specifies no priority, then it subtract 1 for each new tcf_proto object. This patch uses the hardware priority range from 0xC000 to 0x for netfilter. Signe

Re: [PATCH nf] netfilter: nf_tables: map basechain priority to hardware priority

2019-07-30 Thread Pablo Neira Ayuso
On Tue, Jul 30, 2019 at 12:54:17PM +0200, Pablo Neira Ayuso wrote: [...] > @@ -180,6 +181,29 @@ static int nft_setup_cb_call(struct nft_base_chain > *basechain, > return 0; > } > > +/* Available priorities for hardware offload range: -8192..8191 */ > +#define NFT_BASECHAIN_OFFLOAD_PRIO_MA

Re: [PATCH nf] netfilter: nf_tables: map basechain priority to hardware priority

2019-07-30 Thread Pablo Neira Ayuso
On Tue, Jul 30, 2019 at 01:18:00PM +0200, Pablo Neira Ayuso wrote: > On Tue, Jul 30, 2019 at 12:54:17PM +0200, Pablo Neira Ayuso wrote: > [...] > > @@ -180,6 +181,29 @@ static int nft_setup_cb_call(struct nft_base_chain > > *basechain, > > return 0; > > } > > > > +/* Available priorities fo

[PATCH net-next] be2net: disable bh with spin_lock in be_process_mcc

2019-07-30 Thread Denis Kirjanov
Signed-off-by: Denis Kirjanov --- drivers/net/ethernet/emulex/benet/be_cmds.c | 4 ++-- drivers/net/ethernet/emulex/benet/be_main.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c ind

[PATCHv2 net-next 1/5] sctp: only copy the available addr data in sctp_transport_init

2019-07-30 Thread Xin Long
'addr' passed to sctp_transport_init is not always a whole size of union sctp_addr, like the path: sctp_sendmsg() -> sctp_sendmsg_new_asoc() -> sctp_assoc_add_peer() -> sctp_transport_new() -> sctp_transport_init() In the next patches, we will also pass the address length of data only to

[PATCHv2 net-next 0/5] sctp: clean up __sctp_connect function

2019-07-30 Thread Xin Long
This patchset is to factor out some common code for sctp_sendmsg_new_asoc() and __sctp_connect() into 2 new functioins. v1->v2: - add the patch 1/5 to avoid a slab-out-of-bounds warning. - add some code comment for the check change in patch 2/5. - remove unused 'addrcnt' as Marcelo noticed i

[PATCHv2 net-next 2/5] sctp: check addr_size with sa_family_t size in __sctp_setsockopt_connectx

2019-07-30 Thread Xin Long
Now __sctp_connect() is called by __sctp_setsockopt_connectx() and sctp_inet_connect(), the latter has done addr_size check with size of sa_family_t. In the next patch to clean up __sctp_connect(), we will remove addr_size check with size of sa_family_t from __sctp_connect() for the 1st address.

[PATCHv2 net-next 3/5] sctp: clean up __sctp_connect

2019-07-30 Thread Xin Long
__sctp_connect is doing quit similar things as sctp_sendmsg_new_asoc. To factor out common functions, this patch is to clean up their code to make them look more similar: 1. create the asoc and add a peer with the 1st addr. 2. add peers with the other addrs into this asoc one by one. while at

[PATCHv2 net-next 5/5] sctp: factor out sctp_connect_add_peer

2019-07-30 Thread Xin Long
In this function factored out from sctp_sendmsg_new_asoc() and __sctp_connect(), it adds a peer with the other addr into the asoc after this asoc is created with the 1st addr. Signed-off-by: Xin Long --- net/sctp/socket.c | 76 +++ 1 file chang

[PATCHv2 net-next 4/5] sctp: factor out sctp_connect_new_asoc

2019-07-30 Thread Xin Long
In this function factored out from sctp_sendmsg_new_asoc() and __sctp_connect(), it creates the asoc and adds a peer with the 1st addr. Signed-off-by: Xin Long --- net/sctp/socket.c | 160 ++ 1 file changed, 76 insertions(+), 84 deletions(-) d

[PATCH] net: usb: pegasus: fix improper read if get_registers() fail

2019-07-30 Thread Denis Kirjanov
get_registers() may fail with -ENOMEM and in this case we can read a garbage from the status variable tmp. Reported-by: syzbot+3499a83b2d062ae40...@syzkaller.appspotmail.com Signed-off-by: Denis Kirjanov --- drivers/net/usb/pegasus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

[PATCH] net: usb: pegasus: fix improper read if get_registers() fail

2019-07-30 Thread Denis Kirjanov
get_registers() may fail with -ENOMEM and in this case we can read a garbage from the status variable tmp. Reported-by: syzbot+3499a83b2d062ae40...@syzkaller.appspotmail.com Signed-off-by: Denis Kirjanov --- drivers/net/usb/pegasus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

Re: DSA Rate Limiting in 88E6390

2019-07-30 Thread Andrew Lunn
> Hi Andrew, > I've searched the netdev mailing list for DSA and traffic, but can't find > anything > about rate limiting till 2016. Do you have a hint, how I can find it? I will try to find it later today. > Do you know if the patchset was for Marvell or maybe for another company? It was anot

Re: net: ipv6: Fix a bug in ndisc_send_ns when netdev only has a global address

2019-07-30 Thread David Ahern
On 7/30/19 4:28 AM, Mark Smith wrote: > Hi Su, > > On Tue, 30 Jul 2019 at 19:41, Su Yanjun wrote: >> >> >> 在 2019/7/30 16:15, Mark Smith 写道: >>> Hi, >>> >>> I'm not subscribed to the Linux netdev mailing list, so I can't >>> directly reply to the patch email. >>> >>> This patch is not the correct

[net-next 1/1] tipc: reduce risk of wakeup queue starvation

2019-07-30 Thread Jon Maloy
In commit 365ad353c256 ("tipc: reduce risk of user starvation during link congestion") we allowed senders to add exactly one list of extra buffers to the link backlog queues during link congestion (aka "oversubscription"). However, the criteria for when to stop adding wakeup messages to the input q

Re: [RFC PATCH 1/2] gianfar: convert to phylink

2019-07-30 Thread Arseny Solokha
> Hi Arseny, > > Nice project! Vladimir, Russell, thanks for your review. I'm on vacation now, so won't fully address your comments in a few weeks: while I can build the code, I won't have access to hardware to test. So it seems this patch will turn into a series where we'll have some cleanup pat

[PATCH v2 0/3 net-next] Finish conversion of skb_frag_t to bio_vec

2019-07-30 Thread Jonathan Lemon
The recent conversion of skb_frag_t to bio_vec did not include skb_frag's page_offset. Add accessor functions for this field, utilize them, and remove the union, restoring the original structure. v2: - rename accessors - follow kdoc conventions Jonathan Lemon (3): linux: Add page_offset ac

[PATCH v2 3/3 net-next] linux: Remove bvec page_offset, use bv_offset

2019-07-30 Thread Jonathan Lemon
Now that page_offset is referenced through accessors, remove the union, and use bv_offset. Signed-off-by: Jonathan Lemon --- include/linux/bvec.h | 5 + include/linux/skbuff.h | 10 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/linux/bvec.h b/include/li

[PATCH v2 1/3 net-next] linux: Add skb_frag_t page_offset accessors

2019-07-30 Thread Jonathan Lemon
Add skb_frag_off(), skb_frag_off_add(), skb_frag_off_set(), and skb_frag_off_copy() accessors for page_offset. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 67 +- 1 file changed, 59 insertions(+), 8 deletions(-) diff --git a/include/linux/sk

[PATCH v2 2/3 net-next] net: Use skb_frag_off accessors

2019-07-30 Thread Jonathan Lemon
Use accessor functions for skb fragment's page_offset instead of direct references, in preparation for bvec conversion. Signed-off-by: Jonathan Lemon --- drivers/atm/eni.c | 2 +- drivers/hsi/clients/ssi_protocol.c| 2 +- drivers/infiniband/hw/hfi1/vnic_

Re: [PATCH net-next] be2net: disable bh with spin_lock in be_process_mcc

2019-07-30 Thread Willem de Bruijn
On Tue, Jul 30, 2019 at 7:33 AM Denis Kirjanov wrote: > > Signed-off-by: Denis Kirjanov This is a partial revert of the previous change to these lines in 2012 in commit 072a9c486004 ("netpoll: revert 6bdb7fe3104 and fix be_poll() instead"). The commit message is empty. Can you give some context

Re: [PATCH net v3] net: neigh: fix multiple neigh timer scheduling

2019-07-30 Thread Lorenzo Bianconi
> > Hello, Hi Julian, sorry for the late reply, I was AFK > > On Sun, 14 Jul 2019, Lorenzo Bianconi wrote: > > > Neigh timer can be scheduled multiple times from userspace adding > > If the garbage comes from ndm_state, why we should create > a patch that just covers the problem?

Re: [net-next 01/13] net/mlx5e: Print a warning when LRO feature is dropped or not allowed

2019-07-30 Thread Willem de Bruijn
On Mon, Jul 29, 2019 at 7:50 PM Saeed Mahameed wrote: > > From: Huy Nguyen > > When user enables LRO via ethtool and if the RQ mode is legacy, > mlx5e_fix_features drops the request without any explanation. > Add netdev_warn to cover this case. > > Fixes: 6c3a823e1e9c ("net/mlx5e: RX, Remove HW L

Re: [net-next 08/13] net/mlx5e: Protect tc flows hashtable with rcu

2019-07-30 Thread Willem de Bruijn
On Mon, Jul 29, 2019 at 7:50 PM Saeed Mahameed wrote: > > From: Vlad Buslov > > In order to remove dependency on rtnl lock, access to tc flows hashtable > must be explicitly protected from concurrent flows removal. > > Extend tc flow structure with rcu to allow concurrent parallel access. Use > r

Re: [net-next 08/13] net/mlx5e: Protect tc flows hashtable with rcu

2019-07-30 Thread Willem de Bruijn
On Tue, Jul 30, 2019 at 12:16 PM Willem de Bruijn wrote: > > On Mon, Jul 29, 2019 at 7:50 PM Saeed Mahameed wrote: > > > > From: Vlad Buslov > > > > In order to remove dependency on rtnl lock, access to tc flows hashtable > > must be explicitly protected from concurrent flows removal. > > > > Ex

[PATCH bpf-next v4 01/11] i40e: simplify Rx buffer recycle

2019-07-30 Thread Kevin Laatz
Currently, the dma, addr and handle are modified when we reuse Rx buffers in zero-copy mode. However, this is not required as the inputs to the function are copies, not the original values themselves. As we use the copies within the function, we can use the original 'old_bi' values directly without

[PATCH bpf-next v4 06/11] ixgbe: modify driver for handling offsets

2019-07-30 Thread Kevin Laatz
With the addition of the unaligned chunks option, we need to make sure we handle the offsets accordingly based on the mode we are currently running in. This patch modifies the driver to appropriately mask the address for each case. Signed-off-by: Kevin Laatz --- v3: - Use new helper function t

[PATCH bpf-next v4 05/11] i40e: modify driver for handling offsets

2019-07-30 Thread Kevin Laatz
With the addition of the unaligned chunks option, we need to make sure we handle the offsets accordingly based on the mode we are currently running in. This patch modifies the driver to appropriately mask the address for each case. Signed-off-by: Bruce Richardson Signed-off-by: Kevin Laatz ---

[PATCH bpf-next v4 04/11] xsk: add support to allow unaligned chunk placement

2019-07-30 Thread Kevin Laatz
Currently, addresses are chunk size aligned. This means, we are very restricted in terms of where we can place chunk within the umem. For example, if we have a chunk size of 2k, then our chunks can only be placed at 0,2k,4k,6k,8k... and so on (ie. every 2k starting from 0). This patch introduces t

[PATCH bpf-next v4 03/11] libbpf: add flags to umem config

2019-07-30 Thread Kevin Laatz
This patch adds a 'flags' field to the umem_config and umem_reg structs. This will allow for more options to be added for configuring umems. The first use for the flags field is to add a flag for unaligned chunks mode. These flags can either be user-provided or filled with a default. Signed-off-b

[PATCH bpf-next v4 02/11] ixgbe: simplify Rx buffer recycle

2019-07-30 Thread Kevin Laatz
Currently, the dma, addr and handle are modified when we reuse Rx buffers in zero-copy mode. However, this is not required as the inputs to the function are copies, not the original values themselves. As we use the copies within the function, we can use the original 'obi' values directly without ha

[PATCH bpf-next v4 00/11] XDP unaligned chunk placement support

2019-07-30 Thread Kevin Laatz
This patch set adds the ability to use unaligned chunks in the XDP umem. Currently, all chunk addresses passed to the umem are masked to be chunk size aligned (max is PAGE_SIZE). This limits where we can place chunks within the umem as well as limiting the packet sizes that are supported. The cha

[PATCH bpf-next v4 07/11] mlx5e: modify driver for handling offsets

2019-07-30 Thread Kevin Laatz
With the addition of the unaligned chunks option, we need to make sure we handle the offsets accordingly based on the mode we are currently running in. This patch modifies the driver to appropriately mask the address for each case. Signed-off-by: Kevin Laatz --- v3: - Use new helper function t

[PATCH bpf-next v4 08/11] samples/bpf: add unaligned chunks mode support to xdpsock

2019-07-30 Thread Kevin Laatz
This patch adds support for the unaligned chunks mode. The addition of the unaligned chunks option will allow users to run the application with more relaxed chunk placement in the XDP umem. Unaligned chunks mode can be used with the '-u' or '--unaligned' command line options. Signed-off-by: Kevin

[PATCH bpf-next v4 09/11] samples/bpf: add buffer recycling for unaligned chunks to xdpsock

2019-07-30 Thread Kevin Laatz
This patch adds buffer recycling support for unaligned buffers. Since we don't mask the addr to 2k at umem_reg in unaligned mode, we need to make sure we give back the correct (original) addr to the fill queue. We achieve this using the new descriptor format and associated masks. The new format use

[PATCH bpf-next v4 11/11] doc/af_xdp: include unaligned chunk case

2019-07-30 Thread Kevin Laatz
The addition of unaligned chunks mode, the documentation needs to be updated to indicate that the incoming addr to the fill ring will only be masked if the user application is run in the aligned chunk mode. This patch also adds a line to explicitly indicate that the incoming addr will not be masked

[PATCH bpf-next v4 10/11] samples/bpf: use hugepages in xdpsock app

2019-07-30 Thread Kevin Laatz
This patch modifies xdpsock to use mmap instead of posix_memalign. With this change, we can use hugepages when running the application in unaligned chunks mode. Using hugepages makes it more likely that we have physically contiguous memory, which supports the unaligned chunk mode better. Signed-of

Re: [patch net-next 3/3] netdevsim: create devlink and netdev instances in namespace

2019-07-30 Thread Jakub Kicinski
On Tue, 30 Jul 2019 08:06:55 +0200, Jiri Pirko wrote: > >> diff --git a/drivers/net/netdevsim/netdevsim.h > >> b/drivers/net/netdevsim/netdevsim.h > >> index 79c05af2a7c0..cdf53d0e0c49 100644 > >> --- a/drivers/net/netdevsim/netdevsim.h > >> +++ b/drivers/net/netdevsim/netdevsim.h > >> @@ -19,6 +1

Re: [PATCH] net: usb: pegasus: fix improper read if get_registers() fail

2019-07-30 Thread David Miller
From: Denis Kirjanov Date: Tue, 30 Jul 2019 15:13:57 +0200 > get_registers() may fail with -ENOMEM and in this > case we can read a garbage from the status variable tmp. > > Reported-by: syzbot+3499a83b2d062ae40...@syzkaller.appspotmail.com > Signed-off-by: Denis Kirjanov Why did you post this

[PATCH bpf-next] selftests/bpf: fix clearing buffered output between tests/subtests

2019-07-30 Thread Andrii Nakryiko
Clear buffered output once test or subtests finishes even if test was successful. Not doing this leads to accumulation of output from previous tests and on first failed tests lots of irrelevant output will be dumped, greatly confusing things. Fixed: 3a516a0a3a7b ("selftests/bpf: add sub-tests supp

Re: [PATCH bpf-next] tools: bpftool: add support for reporting the effective cgroup progs

2019-07-30 Thread Takshak Chahande
Jakub Kicinski wrote on Mon [2019-Jul-29 14:35:38 -0700]: > Takshak said in the original submission: > > With different bpf attach_flags available to attach bpf programs specially > with BPF_F_ALLOW_OVERRIDE and BPF_F_ALLOW_MULTI, the list of effective > bpf-programs available to any sub-cgroups

[PATCH v2 bpf-next] selftests/bpf: fix clearing buffered output between tests/subtests

2019-07-30 Thread Andrii Nakryiko
Clear buffered output once test or subtests finishes even if test was successful. Not doing this leads to accumulation of output from previous tests and on first failed tests lots of irrelevant output will be dumped, greatly confusing things. v1->v2: fix Fixes tag, add more context to patch Fixes

[net 1/1] tipc: fix unitilized skb list crash

2019-07-30 Thread Jon Maloy
Our test suite somtimes provokes the following crash: Description of problem: [ 1092.597234] BUG: unable to handle kernel NULL pointer dereference at 00e8 [ 1092.605072] PGD 0 P4D 0 [ 1092.607620] Oops: [#1] SMP PTI [ 1092.68] CPU: 37 PID: 0 Comm: swapper/37 Kdump: loaded Not

Re: [PATCH] net: usb: pegasus: fix improper read if get_registers() fail

2019-07-30 Thread Denis Kirjanov
On 7/30/19, David Miller wrote: > From: Denis Kirjanov > Date: Tue, 30 Jul 2019 15:13:57 +0200 > >> get_registers() may fail with -ENOMEM and in this >> case we can read a garbage from the status variable tmp. >> >> Reported-by: syzbot+3499a83b2d062ae40...@syzkaller.appspotmail.com >> Signed-off-

Re: [PATCH v4 net-next 08/19] ionic: Add notifyq support

2019-07-30 Thread Shannon Nelson
On 7/24/19 4:21 PM, Saeed Mahameed wrote: On Mon, 2019-07-22 at 14:40 -0700, Shannon Nelson wrote: The AdminQ is fine for sending messages and requests to the NIC, but we also need to have events published from the NIC to the driver. The NotifyQ handles this for us, using the same interrupt as

Re: [PATCH v4 net-next 12/19] ionic: Add async link status check and basic stats

2019-07-30 Thread Shannon Nelson
On 7/24/19 5:04 PM, Saeed Mahameed wrote: On Mon, 2019-07-22 at 14:40 -0700, Shannon Nelson wrote: Add code to handle the link status event, and wire up the basic netdev hardware stats. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 116 ++

Re: [PATCH v4 net-next 09/19] ionic: Add the basic NDO callbacks for netdev support

2019-07-30 Thread Shannon Nelson
On 7/24/19 4:45 PM, Saeed Mahameed wrote: On Mon, 2019-07-22 at 14:40 -0700, Shannon Nelson wrote: Set up the initial NDO structure and callbacks for netdev to use, and register the netdev. This will allow us to do a few basic operations on the device, but no traffic yet. Signed-off-by: Shanno

[PATCH 0/2] tools: bpftool: add net (un)load command to load XDP

2019-07-30 Thread Daniel T. Lee
Currently, bpftool net only supports dumping progs loaded on the interface. To load XDP prog on interface, user must use other tool (eg. iproute2). By this patch, with `bpftool net (un)load`, user can (un)load XDP prog on interface. $ ./bpftool prog ... 208: xdp name xdp_prog1 tag ad

[PATCH 1/2] tools: bpftool: add net load command to load XDP on interface

2019-07-30 Thread Daniel T. Lee
By this commit, using `bpftool net load`, user can load XDP prog on interface. New type of enum 'net_load_type' has been made, as stated at cover-letter, the meaning of 'load' is, prog will be loaded on interface. BPF prog will be loaded through libbpf 'bpf_set_link_xdp_fd'. Signed-off-by: Daniel

[PATCH 2/2] tools: bpftool: add net unload command to unload XDP on interface

2019-07-30 Thread Daniel T. Lee
By this commit, using `bpftool net unload`, the loaded XDP prog can be unloaded. Unloading the BPF prog will be done through libbpf 'bpf_set_link_xdp_fd' with the progfd set to -1. Signed-off-by: Daniel T. Lee --- tools/bpf/bpftool/net.c | 55 - 1 file cha

Re: [PATCH v4 net-next 13/19] ionic: Add initial ethtool support

2019-07-30 Thread Shannon Nelson
On 7/24/19 5:17 PM, Saeed Mahameed wrote: On Mon, 2019-07-22 at 14:40 -0700, Shannon Nelson wrote: Add in the basic ethtool callbacks for device information and control. Signed-off-by: Shannon Nelson --- + + while (test_and_set_bit(LIF_QUEUE_RESET, lif->state)) + usleep_

Re: [net 1/1] tipc: fix unitilized skb list crash

2019-07-30 Thread Xin Long
- Original Message - > Our test suite somtimes provokes the following crash: > > Description of problem: > [ 1092.597234] BUG: unable to handle kernel NULL pointer dereference at > 00e8 > [ 1092.605072] PGD 0 P4D 0 > [ 1092.607620] Oops: [#1] SMP PTI > [ 1092.68] CP

Re: [PATCH nf] netfilter: nf_tables: map basechain priority to hardware priority

2019-07-30 Thread Marcelo Ricardo Leitner
On Tue, Jul 30, 2019 at 12:54:17PM +0200, Pablo Neira Ayuso wrote: > This patch maps basechain netfilter priorities from -8192 to 8191 to > hardware priority 0xC000 + 1. tcf_auto_prio() uses 0xC000 if the user > specifies no priority, then it subtract 1 for each new tcf_proto object. > This patch u

Re: [PATCHv2 net-next 1/5] sctp: only copy the available addr data in sctp_transport_init

2019-07-30 Thread Marcelo Ricardo Leitner
On Tue, Jul 30, 2019 at 08:38:19PM +0800, Xin Long wrote: > 'addr' passed to sctp_transport_init is not always a whole size > of union sctp_addr, like the path: > > sctp_sendmsg() -> > sctp_sendmsg_new_asoc() -> > sctp_assoc_add_peer() -> > sctp_transport_new() -> sctp_transport_init() >

Re: [PATCH net v2] ipvs: Improve robustness to the ipvs sysctl

2019-07-30 Thread Julian Anastasov
Hello, On Tue, 30 Jul 2019, hujunwei wrote: > From: Junwei Hu > > The ipvs module parse the user buffer and save it to sysctl, > then check if the value is valid. invalid value occurs > over a period of time. > Here, I add a variable, struct ctl_table tmp, used to read > the value fro

Re: [PATCHv2 net-next 0/5] sctp: clean up __sctp_connect function

2019-07-30 Thread Marcelo Ricardo Leitner
On Tue, Jul 30, 2019 at 08:38:18PM +0800, Xin Long wrote: > This patchset is to factor out some common code for > sctp_sendmsg_new_asoc() and __sctp_connect() into 2 > new functioins. > > v1->v2: > - add the patch 1/5 to avoid a slab-out-of-bounds warning. > - add some code comment for the che

[PATCH v2 bpf-next 02/12] libbpf: implement BPF CO-RE offset relocation algorithm

2019-07-30 Thread Andrii Nakryiko
This patch implements the core logic for BPF CO-RE offsets relocations. Every instruction that needs to be relocated has corresponding bpf_offset_reloc as part of BTF.ext. Relocations are performed by trying to match recorded "local" relocation spec against potentially many compatible "target" type

[PATCH v2 bpf-next 08/12] selftests/bpf: add CO-RE relocs enum/ptr/func_proto tests

2019-07-30 Thread Andrii Nakryiko
Test CO-RE relocation handling of ints, enums, pointers, func protos, etc. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 36 ++ .../bpf/progs/btf__core_reloc_primitives.c| 3 + ...f__core_reloc_primitives___diff_enum_def.c |

[PATCH v2 bpf-next 07/12] selftests/bpf: add CO-RE relocs array tests

2019-07-30 Thread Andrii Nakryiko
Add tests for various array handling/relocation scenarios. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 41 ++ .../bpf/progs/btf__core_reloc_arrays.c| 3 + .../btf__core_reloc_arrays___diff_arr_dim.c | 3 + ...btf__cor

[PATCH v2 bpf-next 10/12] selftests/bpf: add CO-RE relocs ptr-as-array tests

2019-07-30 Thread Andrii Nakryiko
Add test validating correct relocation handling for cases where pointer to something is used as an array. E.g.: int *ptr = ...; int x = ptr[42]; Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 20 + .../bpf/progs/btf__core_r

[PATCH v2 bpf-next 06/12] selftests/bpf: add CO-RE relocs nesting tests

2019-07-30 Thread Andrii Nakryiko
Add a bunch of test validating correct handling of nested structs/unions. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 39 +++ .../bpf/progs/btf__core_reloc_nesting.c | 3 + .../btf__core_reloc_nesting___anon_embed.c| 3 +

[PATCH v2 bpf-next 00/12] CO-RE offset relocations

2019-07-30 Thread Andrii Nakryiko
This patch set implements central part of CO-RE (Compile Once - Run Everywhere, see [0] and [1] for slides and video): relocating fields offsets. Most of the details are written down as comments to corresponding parts of the code. Patch #1 adds loading of .BTF.ext offset relocations section and ma

[PATCH v2 bpf-next 05/12] selftests/bpf: add CO-RE relocs struct flavors tests

2019-07-30 Thread Andrii Nakryiko
Add tests verifying that BPF program can use various struct/union "flavors" to extract data from the same target struct/union. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 34 ++ .../bpf/progs/btf__core_reloc_flavors.c | 3

[PATCH v2 bpf-next 03/12] selftests/bpf: add BPF_CORE_READ relocatable read macro

2019-07-30 Thread Andrii Nakryiko
Add BPF_CORE_READ macro used in tests to do bpf_core_read(), which automatically captures offset relocation. Signed-off-by: Andrii Nakryiko --- tools/testing/selftests/bpf/bpf_helpers.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tools/testing/selftests/bpf/bpf_helpe

[PATCH v2 bpf-next 09/12] selftests/bpf: add CO-RE relocs modifiers/typedef tests

2019-07-30 Thread Andrii Nakryiko
Add tests validating correct handling of various combinations of typedefs and const/volatile/restrict modifiers. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 27 +++ .../bpf/progs/btf__core_reloc_mods.c | 3 + .../progs/btf_

[PATCH v2 bpf-next 12/12] selftests/bpf: add CO-RE relocs misc tests

2019-07-30 Thread Andrii Nakryiko
Add tests validating few edge-cases of capturing offset relocations. Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/prog_tests/core_reloc.c | 19 ++ .../bpf/progs/btf__core_reloc_misc.c | 4 ++ .../selftests/bpf/progs/core_reloc_types.h| 25 .../bpf/progs/tes

[PATCH v2 bpf-next 11/12] selftests/bpf: add CO-RE relocs ints tests

2019-07-30 Thread Andrii Nakryiko
Add various tests validating handling compatible/incompatible integer types. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 40 +++ .../bpf/progs/btf__core_reloc_ints.c | 3 + .../bpf/progs/btf__core_reloc_ints___bool.c |

[PATCH v2 bpf-next 04/12] selftests/bpf: add CO-RE relocs testing setup

2019-07-30 Thread Andrii Nakryiko
Add CO-RE relocation test runner. Add one simple test validating that libbpf's logic for searching for kernel image and loading BTF out of it works. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu --- .../selftests/bpf/prog_tests/core_reloc.c | 125 ++ .../bpf/progs/test_c

[PATCH v2 bpf-next 01/12] libbpf: add .BTF.ext offset relocation section loading

2019-07-30 Thread Andrii Nakryiko
Add support for BPF CO-RE offset relocations. Add section/record iteration macros for .BTF.ext. These macro are useful for iterating over each .BTF.ext record, either for dumping out contents or later for BPF CO-RE relocation handling. To enable other parts of libbpf to work with .BTF.ext contents

Re: [RFC PATCH net-next 0/3] net: batched receive in GRO path

2019-07-30 Thread Edward Cree
On 24/07/2019 22:49, Edward Cree wrote: > One thing that's causing me some uncertainty: busy_poll_stop() does a >  napi->poll(), which can potentially gro_normal_one() something.  But >  when I tried to put a gro_normal_list() just after that, I ran into >  list corruption because it could race aga

Re: [PATCH 0/2] tools: bpftool: add net (un)load command to load XDP

2019-07-30 Thread Andrii Nakryiko
On Tue, Jul 30, 2019 at 11:48 AM Daniel T. Lee wrote: > > Currently, bpftool net only supports dumping progs loaded on the > interface. To load XDP prog on interface, user must use other tool > (eg. iproute2). By this patch, with `bpftool net (un)load`, user can > (un)load XDP prog on interface. >

Re: [net-next 01/13] net/mlx5e: Print a warning when LRO feature is dropped or not allowed

2019-07-30 Thread Saeed Mahameed
On Tue, 2019-07-30 at 11:52 -0400, Willem de Bruijn wrote: > On Mon, Jul 29, 2019 at 7:50 PM Saeed Mahameed > wrote: > > From: Huy Nguyen > > > > When user enables LRO via ethtool and if the RQ mode is legacy, > > mlx5e_fix_features drops the request without any explanation. > > Add netdev_warn

Re: [net-next 08/13] net/mlx5e: Protect tc flows hashtable with rcu

2019-07-30 Thread Saeed Mahameed
On Tue, 2019-07-30 at 12:37 -0400, Willem de Bruijn wrote: > On Tue, Jul 30, 2019 at 12:16 PM Willem de Bruijn > wrote: > > On Mon, Jul 29, 2019 at 7:50 PM Saeed Mahameed > > wrote: > > > From: Vlad Buslov > > > > > > In order to remove dependency on rtnl lock, access to tc flows > > > hashtabl

Re: [PATCH v2 bpf-next 1/4] bpf: unprivileged BPF access via /dev/bpf

2019-07-30 Thread Andy Lutomirski
On Sat, Jul 27, 2019 at 11:20 AM Song Liu wrote: > > Hi Andy, > > > >>> > >>> Well, yes. sys_bpf() is pretty powerful. > >>> > >>> The goal of /dev/bpf is to enable special users to call sys_bpf(). In > >>> the meanwhile, such users should not take down the whole system easily > >>> by accide

Re: [PATCH v2 bpf-next 1/4] bpf: unprivileged BPF access via /dev/bpf

2019-07-30 Thread Andy Lutomirski
On Mon, Jul 29, 2019 at 10:07 PM Song Liu wrote: > > Hi Andy, > > > On Jul 27, 2019, at 11:20 AM, Song Liu wrote: > > > > Hi Andy, > > > > > > Well, yes. sys_bpf() is pretty powerful. > > The goal of /dev/bpf is to enable special users to call sys_bpf(). In > the mean

Re: [PATCH v2 0/3 net-next] Finish conversion of skb_frag_t to bio_vec

2019-07-30 Thread Jakub Kicinski
On Tue, 30 Jul 2019 07:40:31 -0700, Jonathan Lemon wrote: > The recent conversion of skb_frag_t to bio_vec did not include > skb_frag's page_offset. Add accessor functions for this field, > utilize them, and remove the union, restoring the original structure. Reviewed-by: Jakub Kicinski Thanks!

Re: [PATCH v2 0/3 net-next] Finish conversion of skb_frag_t to bio_vec

2019-07-30 Thread Jens Axboe
On 7/30/19 8:40 AM, Jonathan Lemon wrote: > The recent conversion of skb_frag_t to bio_vec did not include > skb_frag's page_offset. Add accessor functions for this field, > utilize them, and remove the union, restoring the original structure. You can add: Reviewed-by: Jens Axboe Pretty appall

Re: [PATCH bpf-next] tools: bpftool: add support for reporting the effective cgroup progs

2019-07-30 Thread Jakub Kicinski
On Tue, 30 Jul 2019 18:04:53 +, Takshak Chahande wrote: > Jakub Kicinski wrote on Mon [2019-Jul-29 > 14:35:38 -0700]: > > @@ -158,20 +161,30 @@ static int show_attached_bpf_progs(int cgroup_fd, > > enum bpf_attach_type type, > > static int do_show(int argc, char **argv) > > { > > enum

[PATCH bpf-next v2] tools: bpftool: add support for reporting the effective cgroup progs

2019-07-30 Thread Jakub Kicinski
Takshak said in the original submission: With different bpf attach_flags available to attach bpf programs specially with BPF_F_ALLOW_OVERRIDE and BPF_F_ALLOW_MULTI, the list of effective bpf-programs available to any sub-cgroups really needs to be available for easy debugging. Using BPF_F_QUERY_E

Re: [patch net-next 3/3] netdevsim: create devlink and netdev instances in namespace

2019-07-30 Thread Jiri Pirko
Tue, Jul 30, 2019 at 07:14:11PM CEST, jakub.kicin...@netronome.com wrote: >On Tue, 30 Jul 2019 08:06:55 +0200, Jiri Pirko wrote: >> >> diff --git a/drivers/net/netdevsim/netdevsim.h >> >> b/drivers/net/netdevsim/netdevsim.h >> >> index 79c05af2a7c0..cdf53d0e0c49 100644 >> >> --- a/drivers/net/netd

Re: [PATCH] net: usb: pegasus: fix improper read if get_registers() fail

2019-07-30 Thread David Miller
From: Denis Kirjanov Date: Tue, 30 Jul 2019 21:19:46 +0300 > On Tuesday, July 30, 2019, David Miller wrote: > >> From: Denis Kirjanov >> Date: Tue, 30 Jul 2019 15:13:57 +0200 >> >> > get_registers() may fail with -ENOMEM and in this >> > case we can read a garbage from the status variable tmp.

[PATCH net-next] net/tls: prevent skb_orphan() from leaking TLS plain text with offload

2019-07-30 Thread Jakub Kicinski
sk_validate_xmit_skb() and drivers depend on the sk member of struct sk_buff to identify segments requiring encryption. Any operation which removes or does not preserve the original TLS socket such as skb_orphan() or skb_clone() will cause clear text leaks. Make the TCP socket underlying an offloa

Re: [PATCHv2 net-next 0/5] sctp: clean up __sctp_connect function

2019-07-30 Thread David Miller
From: Marcelo Ricardo Leitner Date: Tue, 30 Jul 2019 16:42:31 -0300 > On Tue, Jul 30, 2019 at 08:38:18PM +0800, Xin Long wrote: >> This patchset is to factor out some common code for >> sctp_sendmsg_new_asoc() and __sctp_connect() into 2 >> new functioins. >> >> v1->v2: >> - add the patch 1/5

Re: [PATCH v2 bpf-next 01/12] libbpf: add .BTF.ext offset relocation section loading

2019-07-30 Thread Song Liu
> On Jul 30, 2019, at 12:53 PM, Andrii Nakryiko wrote: > > Add support for BPF CO-RE offset relocations. Add section/record > iteration macros for .BTF.ext. These macro are useful for iterating over > each .BTF.ext record, either for dumping out contents or later for BPF > CO-RE relocation han

Re: [PATCH v2 0/3 net-next] Finish conversion of skb_frag_t to bio_vec

2019-07-30 Thread David Miller
From: Jonathan Lemon Date: Tue, 30 Jul 2019 07:40:31 -0700 > The recent conversion of skb_frag_t to bio_vec did not include > skb_frag's page_offset. Add accessor functions for this field, > utilize them, and remove the union, restoring the original structure. > > v2: > - rename accessors >

Re: [PATCH v2 0/3 net-next] Finish conversion of skb_frag_t to bio_vec

2019-07-30 Thread David Miller
From: Jens Axboe Date: Tue, 30 Jul 2019 20:49:09 + > Pretty appalled to see this abomination: > > net: Convert skb_frag_t to bio_vec > > There are a lot of users of frag->page_offset, so use a union > to avoid converting those users today. > > Signed-off-by: Matthew Wilcox (Oracle) > Sign

Re: [PATCH v2 bpf-next 03/12] selftests/bpf: add BPF_CORE_READ relocatable read macro

2019-07-30 Thread Song Liu
> On Jul 30, 2019, at 12:53 PM, Andrii Nakryiko wrote: > > Add BPF_CORE_READ macro used in tests to do bpf_core_read(), which > automatically captures offset relocation. > > Signed-off-by: Andrii Nakryiko > --- > tools/testing/selftests/bpf/bpf_helpers.h | 19 +++ > 1 file cha

Re: [PATCH v6 51/57] net: Remove dev_err() usage after platform_get_irq()

2019-07-30 Thread David Miller
From: Stephen Boyd Date: Tue, 30 Jul 2019 11:15:51 -0700 > We don't need dev_err() messages when platform_get_irq() fails now that > platform_get_irq() prints an error message itself when something goes > wrong. Let's remove these prints with a simple semantic patch. ... > While we're here, remo

  1   2   >