Re: linux-next: build failure after merge of the net-next tree

2017-12-21 Thread Ido Schimmel
Hi Stephen, On Fri, Dec 22, 2017 at 11:45:19AM +1100, Stephen Rothwell wrote: > Hi all, > > After merging the net-next tree, today's linux-next build (arm > multi_v7_defconfig) failed like this: [...] > I have added the following merge fix patch for today (I am guessing > a bit here): > >

[PATCH net 2/2] tipc: fix tipc_mon_delete() oops in tipc_enable_bearer() error path

2017-12-21 Thread Tommi Rantala
Calling tipc_mon_delete() before the monitor has been created will oops. This can happen in tipc_enable_bearer() error path if tipc_disc_create() fails. [ 48.589074] BUG: unable to handle kernel paging request at 1008 [ 48.590266] IP: tipc_mon_delete+0xea/0x270 [tipc] [

[PATCH net 1/2] tipc: error path leak fixes in tipc_enable_bearer()

2017-12-21 Thread Tommi Rantala
Fix memory leak in tipc_enable_bearer() if enable_media() fails, and cleanup with bearer_disable() if tipc_mon_create() fails. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tommi Rantala --- net/tipc/bearer.c |

suspicious RCU usage in net/wireless/util.c:778

2017-12-21 Thread Dominik Brodowski
Dear all, once the (wifi) link becomes ready, the following warning is emitted on mainline (v4.15-rc4-202-gead68f216110) on my notebook: [ 22.770422] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 22.772364] = [ 22.772369] WARNING: suspicious RCU

Re: [PATCH net] RDS: Check cmsg_len before dereferencing CMSG_DATA

2017-12-21 Thread santosh.shilim...@oracle.com
On 12/21/17 8:17 PM, Avinash Repaka wrote: RDS currently doesn't check if the length of the control message is large enough to hold the required data, before dereferencing the control message data. This results in following crash: BUG: KASAN: stack-out-of-bounds in rds_rdma_bytes

Re: BUG: unable to handle kernel NULL pointer dereference in sctp_stream_free

2017-12-21 Thread Xin Long
On Thu, Dec 21, 2017 at 9:13 PM, Marcelo Ricardo Leitner wrote: > On Wed, Dec 20, 2017 at 12:51:01PM -0800, syzbot wrote: > > from the log: > [ 89.451366] FAULT_INJECTION: forcing a failure.^M > [ 89.451366] name failslab, interval 1, probability 0, space 0, > times

Re: [net] Revert "net: core: maybe return -EEXIST in __dev_alloc_name"

2017-12-21 Thread Michael Ellerman
Rasmus Villemoes writes: > On Tue, Dec 19 2017, Michael Ellerman > wrote: >>> From: Johannes Berg >>> >>> This reverts commit d6f295e9def0; some userspace (in the case >> >> This revert seems to have broken

[PATCH net] RDS: Check cmsg_len before dereferencing CMSG_DATA

2017-12-21 Thread Avinash Repaka
RDS currently doesn't check if the length of the control message is large enough to hold the required data, before dereferencing the control message data. This results in following crash: BUG: KASAN: stack-out-of-bounds in rds_rdma_bytes net/rds/send.c:1013 [inline] BUG: KASAN:

Re: [Patch net-next] net_sched: call qdisc_reset() with qdisc lock

2017-12-21 Thread Jakub Kicinski
On Thu, 21 Dec 2017 19:36:51 -0800, John Fastabend wrote: > diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c > index ab497ef..720829e 100644 > --- a/net/sched/sch_generic.c > +++ b/net/sched/sch_generic.c > @@ -1071,7 +1071,8 @@ static bool some_qdisc_is_busy(struct net_device *dev)

[PATCH V5 net-next 16/17] net: hns3: Increase the default depth of bucket for TM shaper

2017-12-21 Thread Peng Li
Burstiness of a flow is determined by the depth of a bucket, When the upper rate of shaper is large, the current depth of a bucket is not enough. The default upper rate of shaper is 100G, so increase the depth of a bucket according to UM. Signed-off-by: Peng Li

[PATCH V5 net-next 11/17] net: hns3: fix for getting auto-negotiation state in hclge_get_autoneg

2017-12-21 Thread Peng Li
From: Fuyun Liang When phy exists, we use the value of phydev.autoneg to represent the auto-negotiation state of hardware. Otherwise, we use the value of mac.autoneg to represent it. This patch fixes for getting a error value of auto-negotiation state in

[PATCH V5 net-next 06/17] net: hns3: add a mask initialization for mac_vlan table

2017-12-21 Thread Peng Li
This patch sets vlan masked, in order to avoid the received packets being filtered. Signed-off-by: Peng Li Signed-off-by: Jian Shen --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 10 ++ .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c

[PATCH V5 net-next 08/17] net: hns3: add ethtool related offload command

2017-12-21 Thread Peng Li
This patch adds offload command related to "ethtool -K". Signed-off-by: Peng Li Signed-off-by: Jian Shen --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 3 +++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 16

[PATCH V5 net-next 01/17] net: hns3: add support to query tqps number

2017-12-21 Thread Peng Li
This patch adds the support to query tqps number for PF driver by using ehtool -l command. Signed-off-by: Peng Li Signed-off-by: Mingguang Qu --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 ++

[PATCH V5 net-next 09/17] net: hns3: add handling vlan tag offload in bd

2017-12-21 Thread Peng Li
This patch deals with the vlan tag information between sk_buff and rx/tx bd. Signed-off-by: Peng Li Signed-off-by: Jian Shen --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 83 +++-- 1 file changed, 78 insertions(+), 5

[PATCH V5 net-next 07/17] net: hns3: add vlan offload config command

2017-12-21 Thread Peng Li
This patch adds vlan offload config commands, initializes the rules of tx/rx vlan tag handle for hw. Signed-off-by: Peng Li Signed-off-by: Jian Shen --- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 45 ++

[PATCH V5 net-next 04/17] net: hns3: free the ring_data structrue when change tqps

2017-12-21 Thread Peng Li
This patch fixes a memory leak problems in change tqps process, the function hns3_uninit_all_ring and hns3_init_all_ring may be called many times. Signed-off-by: Peng Li Signed-off-by: Mingguang Qu ---

[PATCH V5 net-next 15/17] net: hns3: add support for querying advertised pause frame by ethtool ethx

2017-12-21 Thread Peng Li
This patch adds support for querying advertised pause frame by using ethtool command(ethtool ethx). Fixes: 496d03e960ae ("net: hns3: Add Ethtool support to HNS3 driver") Signed-off-by: Peng Li Signed-off-by: Fuyun Liang ---

[PATCH V5 net-next 17/17] net: hns3: change TM sched mode to TC-based mode when SRIOV enabled

2017-12-21 Thread Peng Li
TC-based sched mode supports SRIOV enabled and SRIOV disabled. This patch change the TM sched mode to TC-based mode in initialization process. Fixes: cc9bb43ab394 ("net: hns3: Add tc-based TM support for sriov enabled port") Signed-off-by: Peng Li ---

[PATCH V5 net-next 03/17] net: hns3: change the returned tqp number by ethtool -x

2017-12-21 Thread Peng Li
This patch modifies the return data of get_rxnfc, it will return the current handle's rss_size but not the total tqp number. because the tc_size has been change to the log2 of roundup power of two of rss_size. Signed-off-by: Peng Li Signed-off-by: Mingguang Qu

[PATCH V5 net-next 14/17] net: hns3: add Asym Pause support to phy default features

2017-12-21 Thread Peng Li
From: Fuyun Liang commit c4fb2cdf575d ("net: hns3: fix a bug for phy supported feature initialization") adds default supported features for phy, but our hardware also supports Asym Pause. This patch adds Asym Pause support to phy default features to prevent Asym Pause can

[PATCH V5 net-next 10/17] net: hns3: cleanup mac auto-negotiation state query

2017-12-21 Thread Peng Li
From: Fuyun Liang When checking whether auto-negotiation is on, driver only needs to check the value of mac.autoneg(SW) directly, and does not need to query it from hardware. Because this value is always synchronized with the auto-negotiation state of hardware. This

[PATCH V5 net-next 00/17] add some features and fix some bugs for HNS3 driver

2017-12-21 Thread Peng Li
This patchset adds some new feature support and fixes some bugs: [Patch 1/17 - 5/17] add the support to modify/query the tqp number through ethtool -L/l command, and also fix some related bugs for change tqp number. [Patch 6/17 - 9-17] add support vlan tag offload on tx& direction for pf, and fix

[PATCH V5 net-next 05/17] net: hns3: get rss_size_max from configuration but not hardcode

2017-12-21 Thread Peng Li
Add configuration for rss_size_max in hdev but not hardcode it. Signed-off-by: Peng Li Signed-off-by: Mingguang Qu --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 2 ++ drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6

[PATCH V5 net-next 02/17] net: hns3: add support to modify tqps number

2017-12-21 Thread Peng Li
This patch adds the support to change tqps number for PF driver by using ehtool -L command. Signed-off-by: Peng Li Signed-off-by: Mingguang Qu --- drivers/net/ethernet/hisilicon/hns3/hnae3.h| 3 +

[PATCH V5 net-next 13/17] net: hns3: add support to update flow control settings after autoneg

2017-12-21 Thread Peng Li
When auto-negotiation is enabled, the MAC flow control settings is based on the flow control negotiation result. And it should be configured after a valid link has been established. This patch adds support to update flow control settings after auto-negotiation has completed. Signed-off-by: Peng

[PATCH V5 net-next 12/17] net: hns3: add support for set_pauseparam

2017-12-21 Thread Peng Li
This patch adds set_pauseparam support for ethtool cmd. Signed-off-by: Peng Li Signed-off-by: Fuyun Liang --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 13 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 83

Re: correctness of BPF stack size checking logic for multi-function programs?

2017-12-21 Thread Alexei Starovoitov
On Fri, Dec 22, 2017 at 02:14:45AM +0100, Jann Horn wrote: > Hi! > > I saw the recently-added support for multiple functions in a single > program in BPF. I've stumbled over something that looks like it might > be a bug; I haven't verified it yet, but I thought I should give you a > heads-up

Re: [Patch net-next] net_sched: call qdisc_reset() with qdisc lock

2017-12-21 Thread John Fastabend
On 12/21/2017 04:03 PM, Cong Wang wrote: > qdisc_reset() should always be called with qdisc spinlock > and with BH disabled, otherwise qdisc ->reset() could race > with TX BH. > hmm I don't see how this fixes the issue. pfifo_fast is no longer using the qdisc lock so that doesn't help. And it is

[PATCHv2 net] l2tp: fix missing print session offset info

2017-12-21 Thread Hangbin Liu
Fixes: 309795f4bec ("l2tp: Add netlink control API for L2TP") Reported-by: Jianlin Shi Signed-off-by: Hangbin Liu --- net/l2tp/l2tp_netlink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c index

Re: [PATCH net] l2tp: fix missing print session offset info

2017-12-21 Thread Hangbin Liu
On Thu, Dec 21, 2017 at 03:08:36PM -0500, David Miller wrote: > From: Hangbin Liu > Date: Thu, 21 Dec 2017 14:45:30 +0800 > > > + (session->offset && > > +nla_put_u16(skb, L2TP_ATTR_OFFSET, session->offset) || > > It really discourages people from reviewing

Re: [Patch net-next] net_sched: remove the unsafe __skb_array_empty()

2017-12-21 Thread John Fastabend
On 12/21/2017 04:03 PM, Cong Wang wrote: > __skb_array_empty() is only safe if array is never resized. > pfifo_fast_dequeue() is called in TX BH context and without > qdisc lock, so even after we disable BH on ->reset() path > we can still race with other CPU's. > > Fixes: c5ad119fb6c0 ("net:

[PATCH net-next v5 5/6] net: dccp: Add DCCP sendmsg trace event

2017-12-21 Thread Masami Hiramatsu
Add DCCP sendmsg trace event (dccp/dccp_probe) for replacing dccpprobe. User can trace this event via ftrace or perftools. Signed-off-by: Masami Hiramatsu --- Changes in v5 - Fix to add local directory to include for trace.h. Thanks Steven! --- net/dccp/Makefile |

[PATCH net-next v5 6/6] net: dccp: Remove dccpprobe module

2017-12-21 Thread Masami Hiramatsu
Remove DCCP probe module since jprobe has been deprecated. That function is now replaced by dccp/dccp_probe trace-event. You can use it via ftrace or perftools. Signed-off-by: Masami Hiramatsu --- Changes in v5: - Fix a conflict with previous change in Makefile. ---

[PATCH net-next v5 4/6] net: sctp: Remove debug SCTP probe module

2017-12-21 Thread Masami Hiramatsu
Remove SCTP probe module since jprobe has been deprecated. That function is now replaced by sctp/sctp_probe and sctp/sctp_probe_path trace-events. You can use it via ftrace or perftools. Signed-off-by: Masami Hiramatsu --- net/sctp/Kconfig | 12 --- net/sctp/Makefile |

[PATCH net-next v5 3/6] net: sctp: Add SCTP ACK tracking trace event

2017-12-21 Thread Masami Hiramatsu
Add SCTP ACK tracking trace event to trace the changes of SCTP association state in response to incoming packets. It is used for debugging SCTP congestion control algorithms, and will replace sctp_probe module. Note that this event a bit tricky. Since this consists of 2 events (sctp_probe and

[PATCH net-next v5 2/6] net: tcp: Remove TCP probe module

2017-12-21 Thread Masami Hiramatsu
Remove TCP probe module since jprobe has been deprecated. That function is now replaced by tcp/tcp_probe trace-event. You can use it via ftrace or perftools. Signed-off-by: Masami Hiramatsu --- net/Kconfig | 17 --- net/ipv4/Makefile|1

[PATCH net-next v5 1/6] net: tcp: Add trace events for TCP congestion window tracing

2017-12-21 Thread Masami Hiramatsu
This adds an event to trace TCP stat variables with slightly intrusive trace-event. This uses ftrace/perf event log buffer to trace those state, no needs to prepare own ring-buffer, nor custom user apps. User can use ftrace to trace this event as below; # cd /sys/kernel/debug/tracing # echo

[PATCH net-next v5 0/6] net: tcp: sctp: dccp: Replace jprobe usage with trace events

2017-12-21 Thread Masami Hiramatsu
Hi, This series is v5 of the replacement of jprobe usage with trace events. This version is rebased on net-next, fixes a build warning and moves a temporal variable definition in a block. Previous version is here; https://www.spinics.net/lists/netdev/msg473482.html Changes from v4: [5/6]: Fix

Re: [PATCH net-next v4.1 5/6] net: dccp: Add DCCP sendmsg trace event

2017-12-21 Thread Masami Hiramatsu
On Thu, 21 Dec 2017 11:08:05 -0500 Steven Rostedt wrote: > On Thu, 21 Dec 2017 10:57:36 -0500 (EST) > David Miller wrote: > > > When you fix any part of a patch series, you must always repost the > > entire series from scratch, not just the patch(s)

[PATCH v2 bpf-next 09/11] bpf: Add BPF_SOCK_OPS_RETRANS_CB

2017-12-21 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a retransmission. Two arguments are used; one for the sequence number and other for the number of segments retransmitted. Does not include syn-ack retransmissions. New op: BPF_SOCK_OPS_RETRANS_CB. Signed-off-by: Lawrence Brakmo

[PATCH v2 bpf-next 11/11] bpf: add selftest for tcpbpf

2017-12-21 Thread Lawrence Brakmo
Added a selftest for tcpbpf (sock_ops) that checks that the appropriate callbacks occured and that it can access tcp_sock fields and that their values are correct. Run with command: ./test_tcpbpf_user Signed-off-by: Lawrence Brakmo --- tools/include/uapi/linux/bpf.h

[PATCH v2 bpf-next 03/11] bpf: Add write access to tcp_sock and sock fields

2017-12-21 Thread Lawrence Brakmo
This patch adds a macro, SOCK_OPS_SET_FIELD, for writing to struct tcp_sock or struct sock fields. This required adding a new field "temp" to struct bpf_sock_ops_kern for temporary storage that is used by sock_ops_convert_ctx_access. It is used to store and recover the contents of a register, so

[PATCH v2 bpf-next 06/11] bpf: Add sock_ops RTO callback

2017-12-21 Thread Lawrence Brakmo
Adds an optional call to sock_ops BPF program based on whether the BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. The BPF program is passed 2 arguments: icsk_retransmits and whether the RTO has expired. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 5 +

[PATCH v2 bpf-next 07/11] bpf: Add support for reading sk_state and more

2017-12-21 Thread Lawrence Brakmo
Add support for reading many more tcp_sock fields state,same as sk->sk_state rtt_min same as sk->rtt_min.s[0].v (current rtt_min) snd_ssthresh rcv_nxt snd_nxt snd_una mss_cache ecn_flags rate_delivered rate_interval_us packets_out retrans_out total_retrans

[PATCH v2 bpf-next 05/11] bpf: Adds field bpf_sock_ops_flags to tcp_sock

2017-12-21 Thread Lawrence Brakmo
Adds field bpf_sock_ops_flags to tcp_sock and bpf_sock_ops. Its primary use is to determine if there should be calls to sock_ops bpf program at various points in the TCP code. The field is initialized to zero, disabling the calls. A sock_ops BPF program can set, per connection and as necessary,

[PATCH v2 bpf-next 10/11] bpf: Add BPF_SOCK_OPS_STATE_CB

2017-12-21 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a TCP state change. Two arguments are used; one for the old state and another for the new state. New op: BPF_SOCK_OPS_STATE_CB. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 4

[PATCH v2 bpf-next 01/11] bpf: Make SOCK_OPS_GET_TCP size independent

2017-12-21 Thread Lawrence Brakmo
Make SOCK_OPS_GET_TCP helper macro size independent (before only worked with 4-byte fields. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index

[PATCH v2 bpf-next 02/11] bpf: Make SOCK_OPS_GET_TCP struct independent

2017-12-21 Thread Lawrence Brakmo
Changed SOCK_OPS_GET_TCP to SOCK_OPS_GET_FIELD and added 2 arguments so now it can also work with struct sock fields. The first argument is the name of the field in the bpf_sock_ops struct, the 2nd argument is the name of the field in the OBJ struct. Previous: SOCK_OPS_GET_TCP(FIELD_NAME) New:

[PATCH v2 bpf-next 04/11] bpf: Support passing args to sock_ops bpf function

2017-12-21 Thread Lawrence Brakmo
Adds support for passing up to 4 arguments to sock_ops bpf functions. It reusues the reply union, so the bpf_sock_ops structures are not increased in size. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 1 + include/net/tcp.h| 64

[PATCH v2 bpf-next 00/11]

2017-12-21 Thread Lawrence Brakmo
This patchset adds support for: - direct R or R/W access to many tcp_sock fields - passing up to 4 arguments to sock_ops BPF functions - tcp_sock field bpf_sock_ops_flags for controlling callbacks - optionally calling sock_ops BPF program when RTO fires - optionally calling sock_ops BPF program

[PATCH v2 bpf-next 08/11] bpf: Add sock_ops R/W access to tclass & sk_txhash

2017-12-21 Thread Lawrence Brakmo
Adds direct R/W access to sk_txhash and access to tclass for ipv6 flows through getsockopt and setsockopt. Sample usage for tclass: bpf_getsockopt(skops, SOL_IPV6, IPV6_TCLASS, , sizeof(v)) where skops is a pointer to the ctx (struct bpf_sock_ops). Signed-off-by: Lawrence Brakmo

correctness of BPF stack size checking logic for multi-function programs?

2017-12-21 Thread Jann Horn
Hi! I saw the recently-added support for multiple functions in a single program in BPF. I've stumbled over something that looks like it might be a bug; I haven't verified it yet, but I thought I should give you a heads-up before this lands in a release in case I'm right. If I'm wrong, it might be

[PATCH] tcp: make function tcp_recv_timestamp static

2017-12-21 Thread Colin King
From: Colin Ian King The function tcp_recv_timestamp is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'tcp_recv_timestamp' was not declared. Should it be static? Signed-off-by: Colin Ian King

linux-next: build failure after merge of the net-next tree

2017-12-21 Thread Stephen Rothwell
Hi all, After merging the net-next tree, today's linux-next build (arm multi_v7_defconfig) failed like this: net/ipv6/route.c: In function 'inet6_rtm_getroute': net/ipv6/route.c:4324:25: error: 'struct dst_entry' has no member named 'from' if (fibmatch && rt->dst.from) {

Re: [PATCH bpf-next] samples/bpf: adjust rlimit RLIMIT_MEMLOCK for sampleip

2017-12-21 Thread Daniel Borkmann
On 12/21/2017 10:49 AM, Prashant Bhole wrote: > The default memlock rlimit is 64KB, which causes failure in > creating a map > > For example: > test@test# ./sampleip > failed to create a map: 1 Operation not permitted > ERROR: loading BPF program (errno 1): > Try: ulimit -l unlimited > >

Re: [PATCH bpf-next 0/11] bpf: more sock_ops callbacks

2017-12-21 Thread Lawrence Brakmo
Daniel, Dam, by mistake I copied the “consists of the following pachtes” from the previous bpf branch commit. I will send a corrected patch set in a few minutes. Thanks, - Lawrence On 12/21/17, 4:03 PM, "Daniel Borkmann" wrote: On 12/20/2017 10:16 PM, Lawrence

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

2017-12-21 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the net-next tree got a conflict in: kernel/bpf/verifier.c between commit: 0c17d1d2c619 ("bpf: fix incorrect tracking of register size truncation") from the net tree and commits: f4d7e40a5b71 ("bpf: introduce function calls (verification)")

[Patch net-next] net_sched: call qdisc_reset() with qdisc lock

2017-12-21 Thread Cong Wang
qdisc_reset() should always be called with qdisc spinlock and with BH disabled, otherwise qdisc ->reset() could race with TX BH. Fixes: 7bbde83b1860 ("net: sched: drop qdisc_reset from dev_graft_qdisc") Reported-by: Jakub Kicinski Cc: John Fastabend

[Patch net-next] net_sched: remove the unsafe __skb_array_empty()

2017-12-21 Thread Cong Wang
__skb_array_empty() is only safe if array is never resized. pfifo_fast_dequeue() is called in TX BH context and without qdisc lock, so even after we disable BH on ->reset() path we can still race with other CPU's. Fixes: c5ad119fb6c0 ("net: sched: pfifo_fast use skb_array") Reported-by: Jakub

Re: [PATCH bpf-next 0/11] bpf: more sock_ops callbacks

2017-12-21 Thread Daniel Borkmann
On 12/20/2017 10:16 PM, Lawrence Brakmo wrote: > This patchset adds support for: > > - direct R or R/W access to many tcp_sock fields > - passing up to 4 arguments to sock_ops BPF functions > - tcp_sock field bpf_sock_ops_flags for controlling callbacks > - optionally calling sock_ops BPF program

Re: [PATCH bpf] selftests/bpf: fix Makefile for passing LLC to the command line

2017-12-21 Thread Daniel Borkmann
On 12/21/2017 05:52 PM, Jakub Kicinski wrote: > From: Quentin Monnet > > Makefile has a LLC variable that is initialised to "llc", but can > theoretically be overridden from the command line ("make LLC=llc-6.0"). > However, this fails because for LLVM probe check,

[PATCH net-next] net: erspan: remove md NULL check

2017-12-21 Thread William Tu
The 'md' is allocated from 'tun_dst = ip_tun_rx_dst' and since we've checked 'tun_dst', 'md' will never be NULL. The patch removes it at both ipv4 and ipv6 erspan. Fixes: afb4c97d90e6 ("ip6_gre: fix potential memory leak in ip6erspan_rcv") Fixes: 50670b6ee9bc ("ip_gre: fix potential memory leak

Re: pull-request: bpf-next 2017-12-18

2017-12-21 Thread Daniel Borkmann
On 12/21/2017 05:28 PM, David Miller wrote: > From: David Miller > Date: Wed, 20 Dec 2017 16:16:44 -0500 (EST) > >> I think I understand how this new stuff works, I'll take a stab at >> doing the sparc64 JIT bits. > > This patch should do it, please queue up for bpf-next. >

[PATCH net-next v2] enic: add wq clean up budget

2017-12-21 Thread Govindarajulu Varadarajan
In case of tx clean up, we set '-1' as budget. This means clean up until wq is empty or till (1 << 32) pkts are cleaned. Under heavy load this will run for long time and cause "watchdog: BUG: soft lockup - CPU#25 stuck for 21s!" warning. This patch sets wq clean up budget to 256. Signed-off-by:

Re: [PATCH net 1/2] dt-bindings: net: mediatek: add condition to property mediatek,pctl

2017-12-21 Thread Rob Herring
On Wed, Dec 20, 2017 at 05:47:05PM +0800, sean.w...@mediatek.com wrote: > From: Sean Wang > > The property "mediatek,pctl" is only required for SoCs such as MT2701 and > MT7623, so adding a few words for stating the condition. > > Signed-off-by: Sean Wang

[PATCH ipsec-next] xfrm: update the stats documentation

2017-12-21 Thread Shannon Nelson
Add a couple of stats that aren't in the documentation file and rework the top description to be a little more readable. Signed-off-by: Shannon Nelson --- Documentation/networking/xfrm_proc.txt | 20 ++-- 1 file changed, 14 insertions(+), 6

[PATCH net] rtnetlink: fix struct net reference leak

2017-12-21 Thread Craig Gallek
From: Craig Gallek The below referenced commit extended the RTM_GETLINK interface to allow querying by netns id. The netnsid property was previously defined as a signed integer, but this patch assumes that the user always passes a positive integer. syzkaller discovered this

Re: [PATCH net-next] tcp: md5: Handle RCU dereference of md5sig_info

2017-12-21 Thread Christoph Paasch
On Thu, Dec 21, 2017 at 10:29 AM, Mat Martineau wrote: > Dereference tp->md5sig_info in tcp_v4_destroy_sock() the same way it is > done in the adjacent call to tcp_clear_md5_list(). > > Resolves this sparse warning: > > net/ipv4/tcp_ipv4.c:1914:17: warning:

Re: [patch iproute2 v2] tc: add -bs option for batch mode

2017-12-21 Thread David Ahern
On 12/20/17 2:26 AM, Chris Mi wrote: > Currently in tc batch mode, only one command is read from the batch > file and sent to kernel to process. With this patch, we can accumulate > several commands before sending to kernel. The batch size is specified > using option -bs or -batchsize. > > To

Re: RCU callback crashes

2017-12-21 Thread Jakub Kicinski
On Thu, 21 Dec 2017 13:31:01 -0800, Cong Wang wrote: > >629 if (likely(skb)) { > >630 qdisc_qstats_cpu_backlog_dec(qdisc, skb); > >631 qdisc_bstats_cpu_update(qdisc, skb); > >632 qdisc_qstats_cpu_qlen_dec(qdisc); > >

[GIT] Networking

2017-12-21 Thread David Miller
What's a holiday weekend without some networking bug fixes? 1) Fix some eBPF JIT bugs wrt. SKB pointers across helper function calls, from Daniel Borkmann. 2) Fix regression from errata limiting change to marvell PHY driver, from Zhao Qiang. 3) Fix u16 overflow in SCTP, from Xin Long.

Re: RCU callback crashes

2017-12-21 Thread Cong Wang
On Wed, Dec 20, 2017 at 4:50 PM, Jakub Kicinski wrote: > On Wed, 20 Dec 2017 16:41:14 -0800, Jakub Kicinski wrote: >> Just as I hit send... :) but this looks unrelated, "Comm: sshd" - >> so probably from the management interface. >> >> [ 154.604041] >>

Re: [PATCH RFC 00/18] r8169: separate r8168 driver and add experimental phylib support

2017-12-21 Thread Heiner Kallweit
Am 21.12.2017 um 22:16 schrieb David Miller: > From: Heiner Kallweit > Date: Thu, 21 Dec 2017 21:38:11 +0100 > >> This experimental series separates drivers for PCI / PCIE NIC's and >> adds initial phylib support to the separated r8168 driver. > > Thanks for working on

Re: [PATCH RFC 00/18] r8169: separate r8168 driver and add experimental phylib support

2017-12-21 Thread David Miller
From: Heiner Kallweit Date: Thu, 21 Dec 2017 21:38:11 +0100 > This experimental series separates drivers for PCI / PCIE NIC's and > adds initial phylib support to the separated r8168 driver. Thanks for working on this. The RX and TX ring handling is basically going to be

[PATCH bpf-next v2 3/8] bpf: offload: allow netdev to disappear while verifier is running

2017-12-21 Thread Jakub Kicinski
To allow verifier instruction callbacks without any extra locking NETDEV_UNREGISTER notification would wait on a waitqueue for verifier to finish. This design decision was made when rtnl lock was providing all the locking. Use the read/write lock instead and remove the workqueue. Verifier will

[PATCH bpf-next v2 6/8] bpf: offload: report device information for offloaded programs

2017-12-21 Thread Jakub Kicinski
Report to the user ifindex and namespace information of offloaded programs. If device has disappeared return -ENODEV. Specify the namespace using dev/inode combination. CC: Eric W. Biederman Signed-off-by: Jakub Kicinski Reviewed-by:

[PATCH bpf-next v2 8/8] selftests/bpf: test device info reporting for bound progs

2017-12-21 Thread Jakub Kicinski
Check if bound programs report correct device info. Test in local namespace, in remote one, back to the local ns, remove the device and check that information is cleared. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet --

[PATCH bpf-next v2 7/8] tools: bpftool: report device information for offloaded programs

2017-12-21 Thread Jakub Kicinski
Print the just-exposed device information about device to which program is bound. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet --- tools/bpf/bpftool/common.c | 52 ++

[PATCH bpf-next v2 5/8] bpf: offload: free program id when device disappears

2017-12-21 Thread Jakub Kicinski
Bound programs are quite useless after their device disappears. They are simply waiting for reference count to go to zero, don't list them in BPF_PROG_GET_NEXT_ID by freeing their ID early. Note that orphaned offload programs will return -ENODEV on BPF_OBJ_GET_INFO_BY_FD so user will never see ID

[PATCH bpf-next v2 1/8] bpf: offload: don't require rtnl for dev list manipulation

2017-12-21 Thread Jakub Kicinski
We don't need the RTNL lock for all operations on offload state. We only need to hold it around ndo calls. The device offload initialization doesn't require it. The soon-to-come querying of the offload info will only need it partially. We will also be able to remove the waitqueue in following

[PATCH bpf-next v2 0/8] bpf: offload: report device back to user space (take 2)

2017-12-21 Thread Jakub Kicinski
Hi! This series is a redo of reporting offload device information to user space after the first attempt did not take into account name spaces. As requested by Kirill offloads are now protected by an r/w sem. This allows us to remove the workqueue and free the offload state fully when device is

[PATCH bpf-next v2 4/8] bpf: offload: free prog->aux->offload when device disappears

2017-12-21 Thread Jakub Kicinski
All bpf offload operations should now be under bpf_devs_lock, it's safe to free and clear the entire offload structure, not only the netdev pointer. __bpf_prog_offload_destroy() will no longer be called multiple times. Suggested-by: Alexei Starovoitov Signed-off-by: Jakub

[PATCH bpf-next v2 2/8] bpf: offload: don't use prog->aux->offload as boolean

2017-12-21 Thread Jakub Kicinski
We currently use aux->offload to indicate that program is bound to a specific device. This forces us to keep the offload structure around even after the device is gone. Add a bool member to struct bpf_prog_aux to indicate if offload was requested. Suggested-by: Alexei Starovoitov

Re: [PATCH] net: Revert "net_sched: no need to free qdisc in RCU callback"

2017-12-21 Thread Cong Wang
On Thu, Dec 21, 2017 at 12:39 AM, Jiri Pirko wrote: > > Why just moving qdisc_free to rcu is not enough? It would resolve this > issue and also avoid using synchronize net. Something like: If you mean Jakub's issue, apparently not:

Re: [Patch net] net_sched: fix a missing rcu barrier in mini_qdisc_pair_swap()

2017-12-21 Thread Cong Wang
On Thu, Dec 21, 2017 at 11:01 AM, Cong Wang wrote: > On Thu, Dec 21, 2017 at 1:03 AM, Jiri Pirko wrote: >> >> >> But again, we don't we just free qdisc in call_rcu and avoid the >> barrier? > > > Non-sense again. Why qdisc code should be adjusted for

[PATCH RFC 06/18] r8168: remove function rtl8169_rx_missed() being specific to MAC version 01 - 06

2017-12-21 Thread Heiner Kallweit
Function rtl8169_rx_missed() does nothing on MAC versions > 06, therefore remove it. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 23 --- 1 file changed, 23 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168.c

[PATCH RFC 05/18] r8168: remove unneeded callbacks from struct rtl8169_private

2017-12-21 Thread Heiner Kallweit
All supported chips provide a MII interface, therefore some callbacks can be removed from struct rtl8169_private. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 46 +--- 1 file changed, 16 insertions(+), 30

[PATCH RFC 08/18] r8168: add basic phylib support

2017-12-21 Thread Heiner Kallweit
All PHY's of the supported chips are MII-compatible, therefore let phylib do the work. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/Kconfig | 1 + drivers/net/ethernet/realtek/r8168.c | 152 +++ 2 files changed, 120

[PATCH RFC 07/18] r8168: replace 8169 with 8168 in all relevant symbols

2017-12-21 Thread Heiner Kallweit
After separation from the r8169 driver, replace 8169 with 8168 in all relevant symbols. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 1066 +- 1 file changed, 533 insertions(+), 533 deletions(-) diff --git

[PATCH RFC 17/18] r8168: remove use of struct mii_if_info

2017-12-21 Thread Heiner Kallweit
After switching to phylib we don't need most elements of struct mii_if_info any longer. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 37 +++- 1 file changed, 7 insertions(+), 30 deletions(-) diff --git

[PATCH RFC 10/18] r8168: switch to phy_ethtool_get/set_link_ksettings

2017-12-21 Thread Heiner Kallweit
Use phy_ethtool_get/set_link_ksettings instead of open coding these ethtool ops. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 50 +++- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git

[PATCH RFC 09/18] r8168: use genphy_soft_reset instead of open coding the soft reset

2017-12-21 Thread Heiner Kallweit
Use genphy_soft_reset instead of open coding the soft reset. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168.c

[PATCH RFC 15/18] r8168: remove rtl_phy_work and rtl8168_phy_timer

2017-12-21 Thread Heiner Kallweit
Remove further code which is replaced by phylib. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 60 1 file changed, 60 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168.c

[PATCH RFC 16/18] r8168: use phy_read/write in rtl_readphy/writephy helpers

2017-12-21 Thread Heiner Kallweit
Instead of accessing mdio_ops directly use phy_read/write in these helpers. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168.c

[PATCH RFC 04/18] r8168: remove TBI mode support needed for MAC version 01 only

2017-12-21 Thread Heiner Kallweit
Remove TBI mode support needed for MAC version 01 only. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 123 ++- 1 file changed, 6 insertions(+), 117 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168.c

[PATCH RFC 13/18] r8168: replace speed_down with genphy_restart_aneg

2017-12-21 Thread Heiner Kallweit
Dealing with link partner abilities is handled by phylib, so let's just trigger autonegotiation here. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 26 +- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git

[PATCH RFC 11/18] r8168: switch to phy_ethtool_nway_reset

2017-12-21 Thread Heiner Kallweit
Switch to phy_ethtool_nway_reset. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/Kconfig | 1 - drivers/net/ethernet/realtek/r8168.c | 9 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/net/ethernet/realtek/Kconfig

[PATCH RFC 12/18] r8168: switch to phy_mii_ioctl

2017-12-21 Thread Heiner Kallweit
Use phy_mii_ioctl for handling the ioctl's. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 25 +++-- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8168.c

[PATCH RFC 18/18] r8168: use link speed information as maintained by phylib

2017-12-21 Thread Heiner Kallweit
Let's use the speed information as maintained by phylib instead of reading it directly from a register. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8168.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git

  1   2   3   >