Re: [PATCH net] sctp: frag_point sanity check

2018-12-04 Thread Marcelo Ricardo Leitner
On Tue, Dec 04, 2018 at 03:56:33PM -0500, Neil Horman wrote: > On Tue, Dec 04, 2018 at 05:52:02PM -0200, Marcelo Ricardo Leitner wrote: > > On Tue, Dec 04, 2018 at 02:39:46PM -0500, Neil Horman wrote: > > > On Tue, Dec 04, 2018 at 08:27:41PM +0100, Jakub Audykowicz wrote: &

Re: [PATCH net] sctp: frag_point sanity check

2018-12-04 Thread Marcelo Ricardo Leitner
On Tue, Dec 04, 2018 at 02:39:46PM -0500, Neil Horman wrote: > On Tue, Dec 04, 2018 at 08:27:41PM +0100, Jakub Audykowicz wrote: > > If for some reason an association's fragmentation point is zero, > > sctp_datamsg_from_user will try to endlessly try to divide a message > > into zero-sized chunks.

Re: [PATCH net] sctp: always set frag_point on pmtu change

2018-12-04 Thread Marcelo Ricardo Leitner
On Tue, Dec 04, 2018 at 07:51:54PM +0100, Jakub Audykowicz wrote: ... > Thanks, I've taken your remarks into account and ended up with this > simple solution: LGTM! Thanks > > diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h > index ab9242e51d9e..3487686f2cf5 100644 > ---

Re: [PATCH net] sctp: always set frag_point on pmtu change

2018-12-04 Thread Marcelo Ricardo Leitner
On Tue, Dec 04, 2018 at 06:00:51PM +0100, Jakub Audykowicz wrote: ... > OK, let's forget about that "if" :) > Coming back to the sanity check, I came up with something like below, > based on the code from sctp_setsockopt_maxseg, like you mentioned. > I may have overcomplicated things since I

Re: [PATCH net] sctp: kfree_rcu asoc

2018-11-30 Thread Marcelo Ricardo Leitner
m > Suggested-by: Neil Horman > Signed-off-by: Xin Long Phew :-) Acked-by: Marcelo Ricardo Leitner > --- > include/net/sctp/structs.h | 2 ++ > net/sctp/associola.c | 2 +- > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/include/net/sc

Re: [PATCHv2 net] sctp: hold transport before accessing its asoc in sctp_epaddr_lookup_transport

2018-11-30 Thread Marcelo Ricardo Leitner
On Fri, Nov 30, 2018 at 09:05:06AM -0500, Neil Horman wrote: > On Fri, Nov 30, 2018 at 11:33:15AM -0200, Marcelo Ricardo Leitner wrote: > > On Fri, Nov 30, 2018 at 07:32:36AM -0500, Neil Horman wrote: > > > On Fri, Nov 30, 2018 at 02:04:16PM +0900, Xin Long wrote: > > >

Re: [PATCHv2 net] sctp: hold transport before accessing its asoc in sctp_epaddr_lookup_transport

2018-11-30 Thread Marcelo Ricardo Leitner
On Fri, Nov 30, 2018 at 07:32:36AM -0500, Neil Horman wrote: > On Fri, Nov 30, 2018 at 02:04:16PM +0900, Xin Long wrote: > > On Fri, Nov 30, 2018 at 5:52 AM Neil Horman wrote: > > > > > > On Thu, Nov 29, 2018 at 02:44:07PM +0800, Xin Long wrote: > > > > Without holding transport to dereference

Re: [PATCHv2 net] sctp: hold transport before accessing its asoc in sctp_epaddr_lookup_transport

2018-11-30 Thread Marcelo Ricardo Leitner
b1923158...@syzkaller.appspotmail.com > Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner > --- > net/sctp/input.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/net/sctp/input.c b/net/sctp/input.c > index 5c36a99..ce735

Re: [PATCHv2 net] sctp: hold transport before accessing its asoc in sctp_hash_transport

2018-11-30 Thread Marcelo Ricardo Leitner
cause a noticeable latency on inserting > a transport. Yet it's not in a datapath. > > v1->v2: > - improve the changelog. > > Fixes: cd2b70875058 ("sctp: check duplicate node before inserting a new > transport") > Reported-by: syzbot+0b05d8aa7cb185107...@sy

Re: [PATCH net] sctp: hold transport before accessing its asoc in sctp_hash_transport

2018-11-28 Thread Marcelo Ricardo Leitner
On Wed, Nov 28, 2018 at 06:36:45PM +0900, Xin Long wrote: > On Thu, Nov 22, 2018 at 2:53 AM Marcelo Ricardo Leitner > wrote: > > > > On Wed, Nov 21, 2018 at 03:47:33PM +0900, Xin Long wrote: > > > On Wed, Nov 21, 2018 at 9:46 AM Marcelo Ricardo Leitner > > > w

Re: [PATCH net] sctp: always set frag_point on pmtu change

2018-11-28 Thread Marcelo Ricardo Leitner
On Wed, Nov 28, 2018 at 12:08:38AM -0200, Marcelo Ricardo Leitner wrote: > On Tue, Nov 27, 2018 at 11:18:02PM +0100, Jakub Audykowicz wrote: > > On 2018-11-19 08:20, Xin Long wrote: > > > > > On Mon, Nov 19, 2018 at 5:49 AM Jakub Audykowicz > > > wrote: > &

Re: [PATCH net] sctp: always set frag_point on pmtu change

2018-11-27 Thread Marcelo Ricardo Leitner
On Tue, Nov 27, 2018 at 11:18:02PM +0100, Jakub Audykowicz wrote: > On 2018-11-19 08:20, Xin Long wrote: > > > On Mon, Nov 19, 2018 at 5:49 AM Jakub Audykowicz > > wrote: > >> Calling send on a connected SCTP socket results in kernel panic if > >> spp_pathmtu was configured manually before an

Re: [PATCHv2 net] sctp: update frag_point when stream_interleave is set

2018-11-27 Thread Marcelo Ricardo Leitner
oc_update_frag_point") > Reported-by: Jakub Audykowicz > Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner > --- > net/sctp/associola.c | 7 --- > net/sctp/sm_make_chunk.c | 3 +++ > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff

Re: [PATCH net-next,v3 00/12] add flow_rule infrastructure

2018-11-26 Thread Marcelo Ricardo Leitner
On Mon, Nov 26, 2018 at 08:33:36PM +0100, Pablo Neira Ayuso wrote: > Hi Marcelo, Hello! > > On Thu, Nov 22, 2018 at 07:08:32PM -0200, Marcelo Ricardo Leitner wrote: > > On Thu, Nov 22, 2018 at 02:22:20PM -0200, Marcelo Ricardo Leitner wrote: > > > On Wed, Nov 21, 2018 at

Re: [PATCH net] sctp: update frag_point when stream_interleave is set

2018-11-26 Thread Marcelo Ricardo Leitner
On Mon, Nov 26, 2018 at 10:16:50PM +0900, Xin Long wrote: > On Mon, Nov 26, 2018 at 9:29 PM Marcelo Ricardo Leitner > wrote: > > > > On Mon, Nov 26, 2018 at 05:02:11PM +0800, Xin Long wrote: > > > sctp_assoc_update_frag_point() should be called whenever asoc->pathmt

Re: [PATCH net] sctp: update frag_point when stream_interleave is set

2018-11-26 Thread Marcelo Ricardo Leitner
On Mon, Nov 26, 2018 at 05:02:11PM +0800, Xin Long wrote: > sctp_assoc_update_frag_point() should be called whenever asoc->pathmtu > changes, but we missed one place in sctp_association_init(). It would > cause frag_point is zero when sending data. > > As says in Jakub's reproducer, if

Re: [PATCH net] sctp: increase sk_wmem_alloc when head->truesize is increased

2018-11-26 Thread Marcelo Ricardo Leitner
uesize in > sctp_packet_transmit") > Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner > --- > net/sctp/output.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/net/sctp/output.c b/net/sctp/output.c > index b0e74a3..025f48e 100644 > ---

Re: [PATCH net-next,v3 00/12] add flow_rule infrastructure

2018-11-22 Thread Marcelo Ricardo Leitner
On Thu, Nov 22, 2018 at 02:22:20PM -0200, Marcelo Ricardo Leitner wrote: > On Wed, Nov 21, 2018 at 03:51:20AM +0100, Pablo Neira Ayuso wrote: > > Hi, > > > > This patchset is the third iteration [1] [2] [3] to introduce a kernel > > intermediate (IR) to express ACL ha

Re: [PATCH net-next,v3 12/12] qede: use ethtool_rx_flow_rule() to remove duplicated parser code

2018-11-22 Thread Marcelo Ricardo Leitner
On Wed, Nov 21, 2018 at 03:51:32AM +0100, Pablo Neira Ayuso wrote: ... > static int > qede_parse_flower_attr(struct qede_dev *edev, __be16 proto, > -struct tc_cls_flower_offload *f, > -struct qede_arfs_tuple *tuple) > +struct flow_rule

Re: [PATCH net-next,v3 04/12] cls_api: add translator to flow_action representation

2018-11-22 Thread Marcelo Ricardo Leitner
On Wed, Nov 21, 2018 at 03:51:24AM +0100, Pablo Neira Ayuso wrote: ... > +int tc_setup_flow_action(struct flow_action *flow_action, > + const struct tcf_exts *exts) > +{ > + const struct tc_action *act; > + int i, j, k; > + > + if (!exts) > + return 0;

Re: [PATCH net-next,v3 00/12] add flow_rule infrastructure

2018-11-22 Thread Marcelo Ricardo Leitner
On Wed, Nov 21, 2018 at 03:51:20AM +0100, Pablo Neira Ayuso wrote: > Hi, > > This patchset is the third iteration [1] [2] [3] to introduce a kernel > intermediate (IR) to express ACL hardware offloads. On v2 cover letter you had: """ However, cost of this layer is very small, adding 1 million

Re: [PATCH net-next,v3 04/12] cls_api: add translator to flow_action representation

2018-11-21 Thread Marcelo Ricardo Leitner
On Wed, Nov 21, 2018 at 03:51:24AM +0100, Pablo Neira Ayuso wrote: > This patch implements a new function to translate from native TC action > to the new flow_action representation. Moreover, this patch also updates > cls_flower to use this new function. > > Signed-off-by: Pablo Neira Ayuso >

Re: [PATCH net] sctp: hold transport before accessing its asoc in sctp_hash_transport

2018-11-21 Thread Marcelo Ricardo Leitner
On Wed, Nov 21, 2018 at 08:27:21AM -0500, Neil Horman wrote: > On Tue, Nov 20, 2018 at 10:46:26PM -0200, Marcelo Ricardo Leitner wrote: > > On Tue, Nov 20, 2018 at 07:52:48AM -0500, Neil Horman wrote: > > > On Tue, Nov 20, 2018 at 07:09:16PM +0800, Xin Long wrote: > > &g

Re: [PATCH net] sctp: hold transport before accessing its asoc in sctp_hash_transport

2018-11-21 Thread Marcelo Ricardo Leitner
On Wed, Nov 21, 2018 at 03:47:33PM +0900, Xin Long wrote: > On Wed, Nov 21, 2018 at 9:46 AM Marcelo Ricardo Leitner > wrote: > > > > On Tue, Nov 20, 2018 at 07:52:48AM -0500, Neil Horman wrote: > > > On Tue, Nov 20, 2018 at 07:09:16PM +0800, Xin Long wrote: >

Re: [PATCH net] sctp: count sk_wmem_alloc by skb truesize in sctp_packet_transmit

2018-11-20 Thread Marcelo Ricardo Leitner
On Mon, Nov 19, 2018 at 12:39:55PM -0800, David Miller wrote: > From: Xin Long > Date: Sun, 18 Nov 2018 15:07:38 +0800 > > > Now sctp increases sk_wmem_alloc by 1 when doing set_owner_w for the > > skb allocked in sctp_packet_transmit and decreases by 1 when freeing > > this skb. > > > > But

Re: [PATCH net] sctp: hold transport before accessing its asoc in sctp_hash_transport

2018-11-20 Thread Marcelo Ricardo Leitner
On Tue, Nov 20, 2018 at 07:52:48AM -0500, Neil Horman wrote: > On Tue, Nov 20, 2018 at 07:09:16PM +0800, Xin Long wrote: > > In sctp_hash_transport, it dereferences a transport's asoc only under > > rcu_read_lock. Without holding the transport, its asoc could be freed > > already, which leads to a

Re: [PATCH net] sctp: not allow to set asoc prsctp_enable by sockopt

2018-11-18 Thread Marcelo Ricardo Leitner
On Sun, Nov 18, 2018 at 04:02:25PM +0900, Xin Long wrote: > On Sat, Nov 17, 2018 at 12:12 AM Neil Horman wrote: > > > > On Thu, Nov 15, 2018 at 09:41:01PM -0200, Marcelo Ricardo Leitner wrote: > > > [ re-sending, without html this time ] > > > > > &g

Re: [PATCH net] sctp: not allow to set asoc prsctp_enable by sockopt

2018-11-15 Thread Marcelo Ricardo Leitner
On Thu, Nov 15, 2018 at 04:43:10PM -0500, Neil Horman wrote: > On Thu, Nov 15, 2018 at 03:22:21PM -0200, Marcelo Ricardo Leitner wrote: > > On Thu, Nov 15, 2018 at 07:14:28PM +0800, Xin Long wrote: > > > As rfc7496#section4.5 says about SCTP_PR_SUPPORTED: > > > > &g

Re: [PATCH net] sctp: not allow to set asoc prsctp_enable by sockopt

2018-11-15 Thread Marcelo Ricardo Leitner
On Thu, Nov 15, 2018 at 07:14:28PM +0800, Xin Long wrote: > As rfc7496#section4.5 says about SCTP_PR_SUPPORTED: > >This socket option allows the enabling or disabling of the >negotiation of PR-SCTP support for future associations. For existing >associations, it allows one to query

Re: [PATCH net-next 0/3] sctp: add support for sk_reuseport

2018-10-22 Thread Marcelo Ricardo Leitner
On Sun, Oct 21, 2018 at 12:43:35PM +0800, Xin Long wrote: > sctp sk_reuseport allows multiple socks to listen on the same port and > addresses, as long as these socks have the same uid. This works pretty > much as TCP/UDP does, the only difference is that sctp is multi-homing > and all the

Re: [PATCH net-next 1/3] sctp: do reuseport_select_sock in __sctp_rcv_lookup_endpoint

2018-10-22 Thread Marcelo Ricardo Leitner
On Sun, Oct 21, 2018 at 12:43:36PM +0800, Xin Long wrote: > This is a part of sk_reuseport support for sctp, and it selects a > sock by the hashkey of lport, paddr and dport by default. It will > work until sk_reuseport support is added in sctp_get_port_local() > in the next patch. > >

Re: [PATCH net-next 2/3] sctp: add sock_reuseport for the sock in __sctp_hash_endpoint

2018-10-22 Thread Marcelo Ricardo Leitner
On Sun, Oct 21, 2018 at 12:43:37PM +0800, Xin Long wrote: > This is a part of sk_reuseport support for sctp. It defines a helper > sctp_bind_addrs_check() to check if the bind_addrs in two socks are > matched. It will add sock_reuseport if they are completely matched, > and return err if they are

Re: [PATCH net] sctp: fix the data size calculation in sctp_data_size

2018-10-17 Thread Marcelo Ricardo Leitner
") > Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner > --- > include/net/sctp/sm.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h > index 5ef1bad..9e3d327 100644 > --- a/include/net

Re: [PATCH net] sctp: not free the new asoc when sctp_wait_for_connect returns err

2018-10-17 Thread Marcelo Ricardo Leitner
ror, they will know the packet hasn't been > sent. And it also makes sense to not free asoc because waiting > connect fails, like the second call for sctp_wait_for_connect in > sctp_sendmsg_to_asoc. > > Fixes: 668c9beb9020 ("sctp: implement assign_number for > sctp_stream_interleave

[PATCH net] sctp: fix race on sctp_id2asoc

2018-10-16 Thread Marcelo Ricardo Leitner
bot+c7dd55d7aec49d48e...@syzkaller.appspotmail.com Acked-by: Dmitry Vyukov Signed-off-by: Marcelo Ricardo Leitner --- net/sctp/socket.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index f73e9d38d5ba734d7ee3347e4015fd30d355b

Re: [PATCH net] sctp: use the pmtu from the icmp packet to update transport pathmtu

2018-10-15 Thread Marcelo Ricardo Leitner
ansport. It is not worth traversing all asocs to check > pmtu_pending. So unlike tcp, sctp does this in tx path, for which > mtu_info needs to be atomic_t. > > Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner > --- > include/net/sctp/structs.h | 2 ++ > net/sct

Re: [RFC 4/5] netlink: prepare validate extack setting for recursion

2018-09-20 Thread Marcelo Ricardo Leitner
On Thu, Sep 20, 2018 at 10:14:10AM +0200, Johannes Berg wrote: > Anyway - we got into this discussion because of all the extra recursion > stuff I was adding. With the change suggested by David we don't need > that now at all, so I guess it'd be better to propose a patch if you (or > perhaps I

Re: [PATCH net] sctp: update dst pmtu with the correct daddr

2018-09-20 Thread Marcelo Ricardo Leitner
transport, and update it back > after it's done. > > The issue has existed since route exceptions introduction. > > Fixes: 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions.") > Reported-by: ian.per...@dialogic.com > Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Le

Re: [RFC 4/5] netlink: prepare validate extack setting for recursion

2018-09-19 Thread Marcelo Ricardo Leitner
On Wed, Sep 19, 2018 at 09:19:31PM +0200, Johannes Berg wrote: > On Wed, 2018-09-19 at 15:46 -0300, Marcelo Ricardo Leitner wrote: > > > > NL_SET_ERR_MSG(extack, "warning: deprecated command"); > > > err = nla_parse(..., extack); > > > if (err

Re: [RFC 4/5] netlink: prepare validate extack setting for recursion

2018-09-19 Thread Marcelo Ricardo Leitner
On Wed, Sep 19, 2018 at 11:25:17AM +0200, Johannes Berg wrote: > On Wed, 2018-09-19 at 00:37 -0300, Marcelo Ricardo Leitner wrote: > > > Did you consider indicating the message level, and only overwrite the > > message that is already in there if the new message level

Re: [RFC 4/5] netlink: prepare validate extack setting for recursion

2018-09-18 Thread Marcelo Ricardo Leitner
On Tue, Sep 18, 2018 at 03:12:11PM +0200, Johannes Berg wrote: > From: Johannes Berg > > In one of my previous patches in this area I introduced code > to pass out just the error message to store in the extack, for > use in NLA_REJECT. > > Change this code now to set both the error message and

Re: [PATCH v2 2/2] netlink: add ethernet address policy types

2018-09-17 Thread Marcelo Ricardo Leitner
NLA_POLICY_ETH_ADDR (new strict policy) and > NLA_POLICY_ETH_ADDR_COMPAT (compatible policy with warning); > these are used like this: > > static const struct nla_policy [...] = { > [NL_ATTR_NAME] = NLA_POLICY_ETH_ADDR, > ... > }; > > Signed-off-by: Johannes

Re: [PATCH v2 1/2] netlink: add NLA_REJECT policy type

2018-09-17 Thread Marcelo Ricardo Leitner
> > The specific case I have in mind now is a shared nested attribute > containing request/response data, and it would be pointless and > potentially confusing to have userspace include response data in > the messages that actually contain a request. > > Signed-off-by:

Re: [PATCH net 0/2] sctp: two fixes for spp_ipv6_flowlabel and spp_dscp sockopts

2018-09-03 Thread Marcelo Ricardo Leitner
raverse asoc trans list if non-ipv6 trans exists for > ipv6_flowlabel > > net/sctp/socket.c | 34 +++--- > 1 file changed, 19 insertions(+), 15 deletions(-) Series Acked-by: Marcelo Ricardo Leitner

Re: phys_port_id in switchdev mode?

2018-09-03 Thread Marcelo Ricardo Leitner
On Sat, Sep 01, 2018 at 01:34:12PM +0200, Jakub Kicinski wrote: > On Fri, 31 Aug 2018 17:13:22 -0300, Marcelo Ricardo Leitner wrote: > > On Tue, Aug 28, 2018 at 08:43:51PM +0200, Jakub Kicinski wrote: > > > Ugh, CC: netdev.. > > > > > > On Tue, 28 Aug 2018

Re: phys_port_id in switchdev mode?

2018-08-31 Thread Marcelo Ricardo Leitner
On Tue, Aug 28, 2018 at 08:43:51PM +0200, Jakub Kicinski wrote: > Ugh, CC: netdev.. > > On Tue, 28 Aug 2018 20:05:39 +0200, Jakub Kicinski wrote: > > Hi! > > > > I wonder if we can use phys_port_id in switchdev to group together > > interfaces of a single PCI PF? Here is the problem: On

Re: [PATCH net] sctp: remove useless start_fail from sctp_ht_iter in proc

2018-08-27 Thread Marcelo Ricardo Leitner
hashtable_walk_start to return > void") > Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner > --- > net/sctp/proc.c | 4 > 1 file changed, 4 deletions(-) > > diff --git a/net/sctp/proc.c b/net/sctp/proc.c > index 4d6f1c8..a644292 100644 > --- a/net/sc

Re: [PATCH net] sctp: hold transport before accessing its asoc in sctp_transport_get_next

2018-08-27 Thread Marcelo Ricardo Leitner
2a0c9aa6a85c6d...@syzkaller.appspotmail.com > Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner > --- > net/sctp/proc.c | 4 > net/sctp/socket.c | 22 +++--- > 2 files changed, 15 insertions(+), 11 deletions(-) > > diff --git a/net/sctp/proc

Re: [PATCH v2 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-08-10 Thread Marcelo Ricardo Leitner
On Fri, Aug 10, 2018 at 08:03:51PM +0300, Konstantin Khorenko wrote: > On 08/09/2018 11:43 AM, Konstantin Khorenko wrote: > > On 08/04/2018 02:36 AM, Marcelo Ricardo Leitner wrote: > > > On Fri, Aug 03, 2018 at 07:21:00PM +0300, Konstantin Khorenko wrote: > > > ...

Re: [PATCH v2 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-08-08 Thread Marcelo Ricardo Leitner
On Mon, Aug 06, 2018 at 09:34:05AM +, David Laight wrote: > From: Michael Tuexen > > Sent: 03 August 2018 21:57 > ... > > >> Given how useless SCTP streams are, does anything actually use > > >> more than about 4? > > > > > > Maybe Michael can help us with that. I'm also curious now. > > In

Re: [PATCH net-next 13/14] net: core: add new/replace rate estimator lock parameter

2018-08-08 Thread Marcelo Ricardo Leitner
On Wed, Aug 08, 2018 at 03:30:41PM +0300, Vlad Buslov wrote: > On Wed 08 Aug 2018 at 01:37, Marcelo Ricardo Leitner > wrote: > > On Mon, Aug 06, 2018 at 09:54:24AM +0300, Vlad Buslov wrote: > >> Extend rate estimator 'new' and 'replace' APIs with additional spinlock >

Re: [PATCH net-next 13/14] net: core: add new/replace rate estimator lock parameter

2018-08-07 Thread Marcelo Ricardo Leitner
On Mon, Aug 06, 2018 at 09:54:24AM +0300, Vlad Buslov wrote: > Extend rate estimator 'new' and 'replace' APIs with additional spinlock > parameter to be used by rtnl-unlocked actions to protect rate_est pointer > from concurrent modification. I'm wondering if this additional parameter is really

Re: [PATCH v2 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-08-03 Thread Marcelo Ricardo Leitner
On Fri, Aug 03, 2018 at 07:21:00PM +0300, Konstantin Khorenko wrote: ... > Performance results: > > * Kernel: v4.18-rc6 - stock and with 2 patches from Oleg (earlier in this > thread) > * Node: CPU (8 cores): Intel(R) Xeon(R) CPU E31230 @ 3.20GHz > RAM: 32 Gb >

Re: [PATCH v2 1/2] net/sctp: Make wrappers for accessing in/out streams

2018-08-03 Thread Marcelo Ricardo Leitner
On Fri, Aug 03, 2018 at 07:21:01PM +0300, Konstantin Khorenko wrote: > This patch introduces wrappers for accessing in/out streams indirectly. > This will enable to replace physically contiguous memory arrays > of streams with flexible arrays (or maybe any other appropriate > mechanism) which do

Re: [PATCH v2 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-08-03 Thread Marcelo Ricardo Leitner
On Fri, Aug 03, 2018 at 04:43:28PM +, David Laight wrote: > From: Konstantin Khorenko > > Sent: 03 August 2018 17:21 > > > > Each SCTP association can have up to 65535 input and output streams. > > For each stream type an array of sctp_stream_in or sctp_stream_out > > structures is allocated

Re: [PATCH net-next v4 1/4] net/sched: user-space can't set unknown tcfa_action values

2018-07-26 Thread Marcelo Ricardo Leitner
Hi, On Thu, Jul 26, 2018 at 04:34:57PM +0200, Paolo Abeni wrote: ... > @@ -895,6 +904,14 @@ struct tc_action *tcf_action_init_1(struct net *net, > struct tcf_proto *tp, > } > } > > + if (!tcf_action_valid(a->tcfa_action)) { > + net_warn_ratelimited("invalid

Re: [PATCH net-next v3 3/5] tc/act: remove unneeded RCU lock in action callback

2018-07-25 Thread Marcelo Ricardo Leitner
On Wed, Jul 25, 2018 at 07:59:48AM -0400, Jamal Hadi Salim wrote: > On 24/07/18 04:06 PM, Paolo Abeni wrote: > > Each lockless action currently does its own RCU locking in ->act(). > > This is allows using plain RCU accessor, even if the context > > is really RCU BH. > > > > This change drops the

Re: [PATCH net-next v3 4/5] net/tc: introduce TC_ACT_REINJECT.

2018-07-25 Thread Marcelo Ricardo Leitner
On Wed, Jul 25, 2018 at 09:48:16AM -0700, Cong Wang wrote: > On Wed, Jul 25, 2018 at 5:27 AM Jamal Hadi Salim wrote: > > > > Those changes were there from the beginning (above patch did > > not introduce them). > > IIRC, the reason was to distinguish between policy intended > > drops and drops

Re: [PATCH net-next 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-07-24 Thread Marcelo Ricardo Leitner
On Tue, Jul 24, 2018 at 06:35:35PM +0300, Konstantin Khorenko wrote: > Hi Marcelo, > > pity to abandon Oleg's attempt to avoid high order allocations and use > flex_array instead, so i tried to do the performance measurements with > options you kindly suggested. Nice, thanks! ... > As we can

Re: [PATCH v3 net-next] net/sched: add skbprio scheduler

2018-07-13 Thread Marcelo Ricardo Leitner
On Fri, Jul 13, 2018 at 11:17:18AM -0700, Cong Wang wrote: ... > > > > > Isn't the whole point of sch_prio offloading the queueing to > > > > > each class? If you need a limit, there is one for each child > > > > > qdisc if you use for example pfifo or bfifo (depending on you > > > > > want to

Re: [PATCH v3 net-next] net/sched: add skbprio scheduler

2018-07-13 Thread Marcelo Ricardo Leitner
On Fri, Jul 13, 2018 at 11:26:28AM -0700, Cong Wang wrote: > On Fri, Jul 13, 2018 at 6:04 AM Marcelo Ricardo Leitner > wrote: > > > > On Thu, Jul 12, 2018 at 11:05:45PM -0700, Cong Wang wrote: > > > On Wed, Jul 11, 2018 at 12:33 PM Marcelo Ricardo Leitner > > >

Re: [PATCH v3 net-next] net/sched: add skbprio scheduler

2018-07-13 Thread Marcelo Ricardo Leitner
On Thu, Jul 12, 2018 at 11:05:45PM -0700, Cong Wang wrote: > On Wed, Jul 11, 2018 at 12:33 PM Marcelo Ricardo Leitner > wrote: > > > > On Tue, Jul 10, 2018 at 07:25:53PM -0700, Cong Wang wrote: > > > On Mon, Jul 9, 2018 at 2:40 PM Marcelo Ricardo Leitner > > >

Re: [PATCH v3 net-next] net/sched: add skbprio scheduler

2018-07-13 Thread Marcelo Ricardo Leitner
On Thu, Jul 12, 2018 at 10:07:30PM -0700, Cong Wang wrote: > On Wed, Jul 11, 2018 at 11:37 AM Marcelo Ricardo Leitner > wrote: > > > > On Tue, Jul 10, 2018 at 07:32:43PM -0700, Cong Wang wrote: > > > On Mon, Jul 9, 2018 at 12:53 PM Marcelo Ricardo Leitner > > >

Re: [PATCH iproute2-next v2] net:sched: add action inheritdsfield to skbedit

2018-07-12 Thread Marcelo Ricardo Leitner
On Thu, Jul 12, 2018 at 12:09:26PM -0400, Qiaobin Fu wrote: > @@ -156,6 +162,9 @@ parse_skbedit(struct action_util *a, int *argc_p, char > ***argv_p, int tca_id, > if (flags & SKBEDIT_F_PTYPE) > addattr_l(n, MAX_MSG, TCA_SKBEDIT_PTYPE, > ,

Re: [PATCH net-next] net: sched: fix unprotected access to rcu cookie pointer

2018-07-11 Thread Marcelo Ricardo Leitner
On Mon, Jul 09, 2018 at 11:44:38PM +0300, Vlad Buslov wrote: > > On Mon 09 Jul 2018 at 20:34, Marcelo Ricardo Leitner > wrote: > > On Mon, Jul 09, 2018 at 08:26:47PM +0300, Vlad Buslov wrote: > >> Fix action attribute size calculation function to take rcu read lock an

Re: [PATCH v3 net-next] net/sched: add skbprio scheduler

2018-07-11 Thread Marcelo Ricardo Leitner
On Tue, Jul 10, 2018 at 07:25:53PM -0700, Cong Wang wrote: > On Mon, Jul 9, 2018 at 2:40 PM Marcelo Ricardo Leitner > wrote: > > > > On Mon, Jul 09, 2018 at 05:03:31PM -0400, Michel Machado wrote: > > >Changing TC_PRIO_MAX from 15 to 63 risks breaking ba

Re: [PATCH v3 net-next] net/sched: add skbprio scheduler

2018-07-11 Thread Marcelo Ricardo Leitner
On Tue, Jul 10, 2018 at 07:32:43PM -0700, Cong Wang wrote: > On Mon, Jul 9, 2018 at 12:53 PM Marcelo Ricardo Leitner > wrote: > > > > On Mon, Jul 09, 2018 at 02:18:33PM -0400, Michel Machado wrote: > > > > > >2. sch_prio.c does not have a global limit on th

Re: [PATCH v3 net-next] net/sched: add skbprio scheduler

2018-07-10 Thread Marcelo Ricardo Leitner
On Tue, Jul 10, 2018 at 10:03:22AM -0400, Michel Machado wrote: ... > > You can get 64 different priorities by stacking sch_prio, btw. And if > > you implement drop_from_tail() as part of Qdisc, you can even get it > > working for this cascading case too. > >A solution would be to add another

Re: [PATCH v3 net-next] net/sched: add skbprio scheduler

2018-07-09 Thread Marcelo Ricardo Leitner
On Mon, Jul 09, 2018 at 05:03:31PM -0400, Michel Machado wrote: > On 07/09/2018 03:53 PM, Marcelo Ricardo Leitner wrote: > > On Mon, Jul 09, 2018 at 02:18:33PM -0400, Michel Machado wrote: > > > On 07/09/2018 11:44 AM, Marcelo Ricardo Leitner wrote: > > > > On Sat, Ju

Re: [PATCH net-next] net: sched: fix unprotected access to rcu cookie pointer

2018-07-09 Thread Marcelo Ricardo Leitner
On Mon, Jul 09, 2018 at 08:26:47PM +0300, Vlad Buslov wrote: > Fix action attribute size calculation function to take rcu read lock and > access act_cookie pointer with rcu dereference. > > Fixes: eec94fdb0480 ("net: sched: use rcu for action cookie update") > Reported-by

Re: [PATCH v3 net-next] net/sched: add skbprio scheduler

2018-07-09 Thread Marcelo Ricardo Leitner
On Mon, Jul 09, 2018 at 02:18:33PM -0400, Michel Machado wrote: > On 07/09/2018 11:44 AM, Marcelo Ricardo Leitner wrote: > > On Sat, Jul 07, 2018 at 03:43:55PM +0530, Nishanth Devarajan wrote: > > > net/sched: add skbprio scheduer > > > > > > Skbprio (SKB Prio

Re: [PATCH v3 net-next] net/sched: add skbprio scheduler

2018-07-09 Thread Marcelo Ricardo Leitner
On Sat, Jul 07, 2018 at 03:43:55PM +0530, Nishanth Devarajan wrote: > net/sched: add skbprio scheduer > > Skbprio (SKB Priority Queue) is a queueing discipline that prioritizes packets > according to their skb->priority field. Under congestion, already-enqueued > lower > priority packets will be

Re: [net-next:master 464/475] net/sched/act_api.c:71:15: sparse: incorrect type in initializer (different address spaces)

2018-07-09 Thread Marcelo Ricardo Leitner
As I pointed out inthe other thread, Dave fixed these: > >> net/sched/act_api.c:71:15: sparse: incorrect type in initializer > >> (different address spaces) @@expected struct tc_cookie [noderef] > >> *__ret @@got [noderef] *__ret @@ >net/sched/act_api.c:71:15:expected struct

Re: [PATCH] net: sched: Fix warnings from xchg() on RCU'd cookie pointer.

2018-07-09 Thread Marcelo Ricardo Leitner
On Sun, Jul 08, 2018 at 05:03:58PM +0900, David Miller wrote: > > The kbuild test robot reports: > > >> net/sched/act_api.c:71:15: sparse: incorrect type in initializer > >> (different address spaces) @@expected struct tc_cookie [noderef] > >> *__ret @@got [noderef] *__ret @@ >

Re: [PATCHv2 net] sctp: fix the issue that pathmtu may be set lower than MINSEGMENT

2018-07-03 Thread Marcelo Ricardo Leitner
070 ("sctp: fix the handling of ICMP Frag Needed for too > small MTUs") > Reported-by: syzbot+f0d9d7cba052f9344...@syzkaller.appspotmail.com > Suggested-by: Marcelo Ricardo Leitner > Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner > --- > net/sctp/transport.c | 2 +-

Re: [PATCHv2 net-next 0/5] sctp: fully support for dscp and flowlabel per transport

2018-07-02 Thread Marcelo Ricardo Leitner
g flowlabel when adding a transport > sctp: check for ipv6_pinfo legal sndflow with flowlabel in > sctp_v6_get_dst Series Acked-by: Marcelo Ricardo Leitner

Re: [PATCH net] sctp: fix the issue that pathmtu may be set lower than MINSEGMENT

2018-07-02 Thread Marcelo Ricardo Leitner
On Mon, Jul 02, 2018 at 07:45:12AM -0400, Neil Horman wrote: > On Mon, Jul 02, 2018 at 02:51:16PM +0800, Xin Long wrote: > > After commit b6c5734db070 ("sctp: fix the handling of ICMP Frag Needed > > for too small MTUs"), sctp_transport_update_pmtu would refetch pathmtu > > from the dst and set it

Re: [PATCH net-next 3/5] sctp: add spp_ipv6_flowlabel and spp_dscp for sctp_paddrparams

2018-06-25 Thread Marcelo Ricardo Leitner
Hi, On Tue, Jun 26, 2018 at 01:12:00AM +0900, 吉藤英明 wrote: > Hi, > > 2018-06-25 22:03 GMT+09:00 Marcelo Ricardo Leitner > : > > On Mon, Jun 25, 2018 at 07:28:47AM -0400, Neil Horman wrote: > >> On Mon, Jun 25, 2018 at 04:31:26PM +0900, David Miller wrote: > >>

Re: [PATCHv2 net-next] sctp: add support for SCTP_REUSE_PORT sockopt

2018-06-25 Thread Marcelo Ricardo Leitner
On Mon, Jun 25, 2018 at 10:06:46AM +0800, Xin Long wrote: > This feature is actually already supported by sk->sk_reuse which can be > set by socket level opt SO_REUSEADDR. But it's not working exactly as > RFC6458 demands in section 8.1.27, like: > > - This option only supports one-to-one style

Re: [PATCH net-next 3/5] sctp: add spp_ipv6_flowlabel and spp_dscp for sctp_paddrparams

2018-06-25 Thread Marcelo Ricardo Leitner
On Mon, Jun 25, 2018 at 07:28:47AM -0400, Neil Horman wrote: > On Mon, Jun 25, 2018 at 04:31:26PM +0900, David Miller wrote: > > From: Xin Long > > Date: Mon, 25 Jun 2018 10:14:35 +0800 > > > > > struct sctp_paddrparams { > > > @@ -773,6 +775,8 @@ struct sctp_paddrparams { > > > __u32

Re: [PATCH v4 net-next] net:sched: add action inheritdsfield to skbedit

2018-06-20 Thread Marcelo Ricardo Leitner
On Wed, Jun 20, 2018 at 07:02:41PM +0200, Davide Caratti wrote: ... > > I agree that we should update the drop counter, but given that > > you're already converting the stats to be per-cpu counters, whatever we > > add now will be just symbolic since you're going to change it anyway. It

[PATCH net] sctp: fix erroneous inc of snmp SctpFragUsrMsgs

2018-06-20 Thread Marcelo Ricardo Leitner
actor sctp_datamsg_from_user") Signed-off-by: Marcelo Ricardo Leitner --- net/sctp/chunk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c index 79daa98208c391c780440144d69bc7be875c3476..bfb9f812e2ef9fa605b08dc1f534781573c3abf8 100644 --- a/net/sctp/chu

Re: [PATCH v4 net-next] net:sched: add action inheritdsfield to skbedit

2018-06-20 Thread Marcelo Ricardo Leitner
han the expected ones. > > *Allow dumping the pure flags. > > Original idea by Jamal Hadi Salim > > Signed-off-by: Qiaobin Fu > Reviewed-by: Michel Machado Reviewed-by: Marcelo Ricardo Leitner > --- > > Note that the motivation for this patch is found in the fo

Re: [PATCH net-next] sctp: define sctp_packet_gso_append to build GSO frames

2018-06-13 Thread Marcelo Ricardo Leitner
other patch. But it may take time, as sctp's GSO > frames may have different size. skb_segment() can only split it > into the frags with the same size, which would break the border > of sctp chunks. > > Signed-off-by: Xin Long I cannot test it, but it looks good to me.

Re: problems with SCTP GSO

2018-06-12 Thread Marcelo Ricardo Leitner
On Tue, Jun 12, 2018 at 02:05:06PM -0300, Marcelo Ricardo Leitner wrote: > On Mon, Jun 11, 2018 at 08:29:05PM -0700, David Miller wrote: > > > > I would like to bring up some problems with the current GSO > > implementation in SCTP. > > > > The most important f

Re: problems with SCTP GSO

2018-06-12 Thread Marcelo Ricardo Leitner
On Mon, Jun 11, 2018 at 08:29:05PM -0700, David Miller wrote: > > I would like to bring up some problems with the current GSO > implementation in SCTP. > > The most important for me right now is that SCTP uses > "skb_gro_receive()" to build "GSO" frames :-( > > Really it just ends up using the

Re: [PATCH v3 net-next] net:sched: add action inheritdsfield to skbedit

2018-06-09 Thread Marcelo Ricardo Leitner
On Sat, Jun 09, 2018 at 10:35:48PM +, Fu, Qiaobin wrote: ... > @@ -73,6 +100,7 @@ static int tcf_skbedit_init(struct net *net, struct nlattr > *nla, > struct tc_skbedit *parm; > struct tcf_skbedit *d; > u32 flags = 0, *priority = NULL, *mark = NULL, *mask = NULL; > + u64

Re: [PATCH net] sctp: not allow to set rto_min with a value below 200 msecs

2018-05-29 Thread Marcelo Ricardo Leitner
On Wed, May 30, 2018 at 01:45:08AM +0800, Xin Long wrote: > If we're counting on max_t to fix this CPU stuck. It should not that > matter if min rto < the value causing that stuck. Yes but putting a floor to rto_{min,max} now is to protect the rtx timer now, not the heartbeat one. > > > > >

Re: [PATCH net] sctp: not allow to set rto_min with a value below 200 msecs

2018-05-29 Thread Marcelo Ricardo Leitner
On Tue, May 29, 2018 at 12:03:46PM -0400, Neal Cardwell wrote: > On Tue, May 29, 2018 at 11:45 AM Marcelo Ricardo Leitner < > marcelo.leit...@gmail.com> wrote: > > - patch2 - fix rtx attack vector > >- Add the floor value to rto_min to HZ/20 (which fits the values >

Re: [PATCH net] sctp: not allow to set rto_min with a value below 200 msecs

2018-05-29 Thread Marcelo Ricardo Leitner
On Tue, May 29, 2018 at 03:06:06PM +0200, Michael Tuexen wrote: > > On 29. May 2018, at 13:41, Neil Horman wrote: > > > > On Mon, May 28, 2018 at 04:43:15PM -0300, Marcelo Ricardo Leitner wrote: > >> On Sat, May 26, 2018 at 09:01:00PM -0400, Neil Horman wrote: > >

Re: [PATCH v3 02/11] net: sched: change type of reference and bind counters

2018-05-28 Thread Marcelo Ricardo Leitner
d-off-by: Vlad Buslov > Signed-off-by: Jiri Pirko Reviewed-by: Marcelo Ricardo Leitner > --- > include/net/act_api.h | 5 +++-- > net/sched/act_api.c| 32 ++-- > net/sched/act_bpf.c| 4 ++-- > net/sched/act_connmark.c | 4

Re: [PATCH v3 05/11] net: sched: implement action API that deletes action by index

2018-05-28 Thread Marcelo Ricardo Leitner
On Mon, May 28, 2018 at 12:17:23AM +0300, Vlad Buslov wrote: > Implement new action API function that atomically finds and deletes action > from idr by index. Intended to be used by lockless actions that do not rely > on rtnl lock. > > Signed-off-by: Vlad Buslov Reviewed-by:

Re: [PATCH v3 04/11] net: sched: always take reference to action

2018-05-28 Thread Marcelo Ricardo Leitner
oth logically and to preserver current API behavior). > Subtract temporal reference when dumping action to userspace using existing > tca_get_fill function arguments. > > Signed-off-by: Vlad Buslov Reviewed-by: Marcelo Ricardo Leitner > --- > Changes from V1 to V2: > - Mak

Re: [PATCH v3 07/11] net: sched: implement reference counted action release

2018-05-28 Thread Marcelo Ricardo Leitner
ed-off-by: Vlad Buslov Reviewed-by: Marcelo Ricardo Leitner > --- > Changes from V1 to V2: > - Removed redundant actions ops lookup during delete. > - Assume all actions have delete implemented and don't check for it > explicitly. > - Rearrange variable definitions i

Re: [PATCH v3 03/11] net: sched: implement unlocked action init API

2018-05-28 Thread Marcelo Ricardo Leitner
slov Reviewed-by: Marcelo Ricardo Leitner > --- > Changes from V1 to V2: > - Rename "unlocked" to "rtnl_held" for clarity. > > include/net/act_api.h | 6 -- > net/sched/act_api.c| 18 +++--- > net/sched/act_bpf.c|

Re: [PATCH v3 08/11] net: sched: don't release reference on action overwrite

2018-05-28 Thread Marcelo Ricardo Leitner
hat action could be deleted concurrently. > > Change action init behavior to always take reference to action before > returning successfully, in order to protect from concurrent deletion. > > Signed-off-by: Vlad Buslov Reviewed-by: Marcelo Ricardo Leitner > --- > Changes from

Re: [PATCH v3 01/11] net: sched: use rcu for action cookie update

2018-05-28 Thread Marcelo Ricardo Leitner
On Mon, May 28, 2018 at 12:17:19AM +0300, Vlad Buslov wrote: > Implement functions to atomically update and free action cookie > using rcu mechanism. > > Signed-off-by: Vlad Buslov > Signed-off-by: Jiri Pirko Reviewed-by: Marcelo Ricardo Leitner > --- > inclu

Re: [PATCH v3 06/11] net: sched: add 'delete' function to action ops

2018-05-28 Thread Marcelo Ricardo Leitner
rtnl lock. Use action API function that atomically deletes action > only if it is still in action idr. This implementation prevents concurrent > threads from deleting same action twice. > > Signed-off-by: Vlad Buslov Reviewed-by: Marcelo Ricardo Leitner > --- > Changes from V1 t

Re: [PATCH v3 09/11] net: sched: use reference counting action init

2018-05-28 Thread Marcelo Ricardo Leitner
tion is done. At this point action becomes accessible for concurrent > modifications, so user must always hold reference to it. > > Implement helper put list function to atomically release list of actions > after action API init code is done using them. > > Signed-off-by: Vlad Buslov

Re: [PATCH v3 10/11] net: sched: atomically check-allocate action

2018-05-28 Thread Marcelo Ricardo Leitner
insert new action to idr using this > API. > > Signed-off-by: Vlad Buslov Reviewed-by: Marcelo Ricardo Leitner > --- > Changes from V1 to V2: > - Remove unique idr insertion function. Change original idr insert to do > the same thing. > - Refactor action check-alloc code

  1   2   3   4   5   6   7   8   9   10   >