[PATCH net] sctp: start t5 timer only when peer.rwnd == 0 and in SHUTDOWN_PENDING

2015-08-18 Thread Xin Long
: f8d960524 (sctp: Enforce retransmission limit during shutdown) Signed-off-by: Xin Long lucien@gmail.com --- net/sctp/sm_statefuns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 3ee27b7..7d9380c 100644 --- a/net/sctp

[PATCH net] sctp: donot reset the overall_error_count in SHUTDOWN_RECEIVE state

2015-08-18 Thread Xin Long
commit f8d960524 fix the 0 peer.rwnd issue in SHUTDOWN_PENING state through not reseting the overall_error_count when recevie a heartbeat, but the same issue also exists in SHUTDOWN_RECEIVE state. Fixes: f8d960524 (sctp: Enforce retransmission limit during shutdown) Signed-off-by: Xin Long lucien

[PATCH net v2] sctp: start t5 timer only when peer.rwnd is 0 and local.state is SHUTDOWN_PENDING

2015-08-23 Thread Xin Long
Max.Retrans times, only when B's rwnd == 0 and A's retransmitting beyonds Max.Retrans times, A will start t5 timer, which is also commit f8d960524 means, but it lacks the condition peer.rwnd == 0. Fixes: f8d960524 (sctp: Enforce retransmission limit during shutdown) Signed-off-by: Xin Long lucien

[PATCH net] sctp: asconf's process should verify address parameter is in the beginning

2015-08-24 Thread Xin Long
in sctp_verify_asconf() to check the address parameter is in the beginning, or return false to send abort. Signed-off-by: Xin Long lucien@gmail.com --- net/sctp/sm_make_chunk.c | 8 1 file changed, 8 insertions(+) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 0ee5ca7

[PATCH net] sctp: asconf process should treat multiple address parameter as unrecognized parameter

2015-08-24 Thread Xin Long
parameters as unrecognized parameter and send error cause to peer. Signed-off-by: Xin Long lucien@gmail.com --- net/sctp/sm_make_chunk.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 06320c8..0ee5ca7

[PATCH net] sctp: partial chunk should be drop without sending abort packet

2015-08-24 Thread Xin Long
-by: Xin Long lucien@gmail.com --- net/sctp/inqueue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sctp/inqueue.c b/net/sctp/inqueue.c index 7e8a16c..a22ca57 100644 --- a/net/sctp/inqueue.c +++ b/net/sctp/inqueue.c @@ -183,9 +183,9 @@ struct sctp_chunk *sctp_inq_pop

[RFC PATCH net] sctp: ASCONF-ACK with Unresolvable Address should be sent

2015-07-24 Thread Xin Long
) - ASCONF-ACK (Unresolvable Address) Signed-off-by: Xin Long lucien@gmail.com --- net/sctp/sm_make_chunk.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp

[RFC PATCH net] sctp: ASCONF-ACK with Unresolvable Address should be sent

2015-07-24 Thread Xin Long
) - ASCONF-ACK (Unresolvable Address) Signed-off-by: Xin Long lucien@gmail.com --- net/sctp/sm_make_chunk.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp

[PATCH net] ipv6: fix the incorrect return value of throw route

2015-10-23 Thread Xin Long
The error condition -EAGAIN, which is signaled by throw routes, tells the rules framework to walk on searching for next matches. If the walk ends and we stop walking the rules with the result of a throw route we have to translate the error conditions to -ENETUNREACH. Signed-off-by: Xin Long

[PATCH net] sctp: translate host order to network order when setting a hmacid

2015-11-11 Thread Xin Long
of this condition in sctp_auth_ep_set_hmacs(): if (id > SCTP_AUTH_HMAC_ID_MAX) return -EOPNOTSUPP; so this wasn't working before and thus it won't break compatibility. Signed-off-by: Xin Long <lucien@gmail.com> Signed-off-by: Marcelo Ricardo Leitner <

[PATCH net] ipv6: allow routes to be configured with expire values

2015-11-04 Thread Xin Long
Add the support for adding expire value to routes, requested by Tom Gundersen <t...@jklm.no> for systemd-networkd, and NetworkManager wants it too. add it by using the field rta_expires of rta_cacheinfo Signed-off-by: Xin Long <lucien@gmail.com> Signed-off-by: Hannes Freder

[PATCH net-next] route: fib_validate_source remove the <= RT_SCOPE_HOST test

2015-10-13 Thread Xin Long
commit fe3edf45792a ("ipv4: Remove all RTCF_DIRECTSRC handliing."). Before this commit, we had a tristate: < 0: error 0: ok 1: ok and set RTCF_DIRECTSRC But now we only care about 0 or < 0. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/fib_frontend.c | 14

[PATCH net v3] sctp: donot reset the overall_error_count in SHUTDOWN_RECEIVE state

2015-08-26 Thread Xin Long
during shutdown) Signed-off-by: Xin Long lucien@gmail.com --- net/sctp/sm_sideeffect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index fef2acd..85e6f03 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp

[PATCH net v3] sctp: asconf's process should verify address parameter is in the beginning

2015-08-26 Thread Xin Long
in sctp_verify_asconf() to check the address parameter is in the beginning, or return false to send abort. v2-v3: * put the check in the loop, add the check for multiple address parameters. v1-v2: * put the check behind the params' length verify. Signed-off-by: Xin Long lucien@gmail.com Signed-off

[PATCH net v4] sctp: asconf's process should verify address parameter is in the beginning

2015-08-26 Thread Xin Long
in sctp_verify_asconf() to check the address parameter is in the beginning, or return false to send abort. Signed-off-by: Xin Long lucien@gmail.com Signed-off-by: Vlad Yasevich vyase...@redhat.com --- net/sctp/sm_make_chunk.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net

[PATCH net v2] sctp: ASCONF-ACK with Unresolvable Address should be sent

2015-08-28 Thread Xin Long
) - ASCONF-ACK (Unresolvable Address) Signed-off-by: Xin Long lucien@gmail.com --- net/sctp/sm_make_chunk.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp

[PATCH net v4] sctp: asconf's process should verify address parameter is in the beginning

2015-08-27 Thread Xin Long
in sctp_verify_asconf() to check the address parameter is in the beginning, or return false to send abort. note that this can also detect multiple address parameters, and reject it. Signed-off-by: Xin Long lucien@gmail.com Signed-off-by: Marcelo Ricardo Leitner mleit...@redhat.com --- net/sctp

[PATCH net] sctp: support global vtag assochash and per endpoint s(d)port assochash table

2015-08-31 Thread Xin Long
[.] __memcmp_sse2 ... in client: #perf top 6.79% libc-2.17.so[.] __libc_calloc 6.50% [kernel][k] memcpy 6.35% libc-2.17.so[.] _int_free ... Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h

[PATCH net v2] sctp: asconf's process should verify address parameter is in the beginning

2015-08-25 Thread Xin Long
in sctp_verify_asconf() to check the address parameter is in the beginning, or return false to send abort. v1-v2: * put the check behind the params' length verify. Signed-off-by: Xin Long lucien@gmail.com --- net/sctp/sm_make_chunk.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/net/sctp

[PATCH net] netfilter: remove the nh_scope test in rpfilter_lookup_reverse of ipt_rpfilter

2015-10-04 Thread Xin Long
il. --accept-local option will never be passed. it seems the test is bogus and can be removed to fix this issue. if (dev_match || flags & XT_RPFILTER_LOOSE) return FIB_RES_NH(res).nh_scope <= RT_SCOPE_HOST; ipv6 does not have this issue. Signed-off-by: Xi

[PATCH net-next] ipv6: allow routes to be configured with expire values

2015-12-08 Thread Xin Long
Add the support for adding expire value to routes, requested by Tom Gundersen <t...@jklm.no> for systemd-networkd, and NetworkManager wants it too. add it by using the field rta_expires of rta_cacheinfo Signed-off-by: Xin Long <lucien@gmail.com> Signed-off-by: Hannes Freder

[PATCH net] nftables: use list_for_each_entry_safe_reverse to traversal commit_list in nf_tables_abort

2015-12-07 Thread Xin Long
gt; 'del set trans' -> 'add set trans'. which is opposite with commit_list order. so fix it by rolling back commits with reverse order in nf_tables_abort. Signed-off-by: Xin Long <lucien@gmail.com> --- net/netfilter/nf_tables_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 de

Re: [PATCH net-next] ipv6: allow routes to be configured with expire values

2015-12-09 Thread Xin Long
On Wed, Dec 9, 2015 at 11:56 AM, David Miller <da...@davemloft.net> wrote: > From: Xin Long <lucien@gmail.com> > Date: Tue, 8 Dec 2015 22:37:44 +0800 > >> Add the support for adding expire value to routes, requested by >> Tom Gundersen <t...@jklm.no> f

Re: [PATCH net] nftables: use list_for_each_entry_safe_reverse to traversal commit_list in nf_tables_abort

2015-12-09 Thread Xin Long
ok, the reproducer: 1. #nft delete table foo #nft add table foo #nft list tables #nft list table foo #nft add chain foo bar #nft add chain foo baz #nft add chain foo bok #nft list table foo 2. #nft -f panic.rules --panic.rules--- add rule foo bar ip saddr 127.0.0.1 accept add rule foo bar

Re: [PATCH net] nftables: use list_for_each_entry_safe_reverse to traversal commit_list in nf_tables_abort

2015-12-09 Thread Xin Long
On Wed, Dec 9, 2015 at 10:03 PM, Pablo Neira Ayuso <pa...@netfilter.org> wrote: > On Mon, Dec 07, 2015 at 06:48:07PM +0800, Xin Long wrote: >> when we use 'nft -f' to sumbit rules, it will build multiple rules into >> one netlink skb to send to kernel, kernel will pr

[PATCHv2 net-next] ipv6: allow routes to be configured with expire values

2015-12-09 Thread Xin Long
Add the support for adding expire value to routes, requested by Tom Gundersen <t...@jklm.no> for systemd-networkd, and NetworkManager wants it too. add it by using the field rta_expires of rta_cacheinfo Signed-off-by: Xin Long <lucien@gmail.com> Signed-off-by: Hannes Freder

[PATCH net] sctp: only drop the reference on the datamsg after sending a msg

2015-12-04 Thread Xin Long
, as: - if the chunks weren't queued, this is enough to get them freed. - if they were queued, they will get freed when they finally get out or discarded. Signed-off-by: Xin Long <lucien@gmail.com> Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/socket.c | 6 ++ 1 fil

[PATCH net] sctp: hold the chunks only after the chunk is enqueued in outq

2015-12-04 Thread Xin Long
orphans and will leak. So we fix them by moving sctp_chunk_hold() to sctp_outq_tail(), where we are sure that the chunk is going to get queued. Signed-off-by: Xin Long <lucien@gmail.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/outqueue.c | 1

[PATCH net] sctp: start t5 timer only when peer rwnd is 0 and local state is SHUTDOWN_PENDING

2015-12-04 Thread Xin Long
ding a bit (zero_window_announced) in peer to record if the last rwnd is 0. If it was, zero_window_announced will be set. and use this bit to decide if start t5 timer when local.state is SHUTDOWN_PENDING. Fixes: commit f8d960524328 ("sctp: Enforce retransmission limit during shutdown") Signed-off-

Re: rhashtable: Prevent spurious EBUSY errors on insertion

2015-12-17 Thread Xin Long
On Thu, Dec 17, 2015 at 4:48 PM, Herbert Xu <herb...@gondor.apana.org.au> wrote: > On Thu, Dec 17, 2015 at 04:46:00PM +0800, Xin Long wrote: >> >> sorry for late test, but unfortunately, my case with rhashtalbe still >> return EBUSY. >> I added some debug

Re: rhashtable: Prevent spurious EBUSY errors on insertion

2015-12-17 Thread Xin Long
On Thu, Dec 3, 2015 at 8:41 PM, Herbert Xu wrote: > On Mon, Nov 30, 2015 at 06:18:59PM +0800, Herbert Xu wrote: >> >> OK that's better. I think I see the problem. The test in >> rhashtable_insert_rehash is racy and if two threads both try >> to grow the table one of

[PATCH net] sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close

2015-12-17 Thread Xin Long
(). So if sctp_make_abort_user fails to allocate memory, we should just free the asoc, as there isn't much else that we can do. Signed-off-by: Xin Long <lucien@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/socket.c | 6 +- 1 fil

Re: rhashtable: Prevent spurious EBUSY errors on insertion

2015-12-17 Thread Xin Long
On Thu, Dec 17, 2015 at 5:00 PM, Xin Long <lucien@gmail.com> wrote: > On Thu, Dec 17, 2015 at 4:48 PM, Herbert Xu <herb...@gondor.apana.org.au> > wrote: >> On Thu, Dec 17, 2015 at 04:46:00PM +0800, Xin Long wrote: >>> >>> sorry for late test, but un

Re: rhashtable: Prevent spurious EBUSY errors on insertion

2015-12-18 Thread Xin Long
On Fri, Dec 18, 2015 at 10:26 AM, Herbert Xu <herb...@gondor.apana.org.au> wrote: > On Fri, Dec 18, 2015 at 12:07:08AM +0800, Xin Long wrote: >> >> I'm just wondering, why do not we handle the genuine double rehash >> issue inside rhashtable? i mean it's just a tempo

Re: [PATCHv2 net-next] ipv6: allow routes to be configured with expire values

2015-12-14 Thread Xin Long
> > This is the wrong way to do this. > > Currently we only ever dump rta_cacheinfo values to the user. > > If we use it to set things, we have to completely consider every > member of that structure as potentially having meaning either > intended by the user or choosen by us in the future. > >

Re: [PATCHv2 net-next] ipv6: allow routes to be configured with expire values

2015-12-16 Thread Xin Long
On Tue, Dec 15, 2015 at 3:36 AM, David Miller wrote: > From: Hannes Frederic Sowa > Date: Mon, 14 Dec 2015 18:16:59 +0100 > >> We can easily switch to new attributes. Should we introduce a new >> interface for this? > > Yes. okay, I will repost

[PATCHv3 net-next] ipv6: allow routes to be configured with expire values

2015-12-16 Thread Xin Long
Add the support for adding expire value to routes, requested by Tom Gundersen <t...@jklm.no> for systemd-networkd, and NetworkManager wants it too. implement it by adding the new RTNETLINK attribute RTA_EXPIRES. Signed-off-by: Xin Long <lucien@gmail.com> --- include/uapi/linux

Re: [PATCH net-next 1/5] sctp: add the rhashtable apis for sctp global transport hashtable

2016-01-05 Thread Xin Long
On Thu, Dec 31, 2015 at 1:41 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Wed, Dec 30, 2015 at 11:50:46PM +0800, Xin Long wrote: > ... >> +void sctp_hash_transport(struct sctp_transport *t) >> +{ >> + struct sctp_sockaddr_entry *addr; >

Re: [PATCH net-next 2/5] sctp: apply rhashtable api to send/recv path

2016-01-06 Thread Xin Long
On Wed, Jan 6, 2016 at 3:07 AM, Vlad Yasevich <vyasev...@gmail.com> wrote: > On 12/30/2015 10:50 AM, Xin Long wrote: >> apply lookup apis to two functions, for __sctp_endpoint_lookup_assoc >> and __sctp_lookup_association, it's invoked in the protection of sock >

Re: [PATCH net-next 1/5] sctp: add the rhashtable apis for sctp global transport hashtable

2016-01-06 Thread Xin Long
On Wed, Jan 6, 2016 at 2:38 AM, Vlad Yasevich <vyasev...@gmail.com> wrote: > On 12/30/2015 10:50 AM, Xin Long wrote: >> tranport hashtbale will replace the association hashtable to do the >> lookup for transport, and then get association by t->assoc, rhashtable >> api

[PATCH net-next 4/5] sctp: drop the old assoc hashtable of sctp

2015-12-30 Thread Xin Long
transport hashtable will replace the association hashtable, so association hashtable is not used in sctp any more, so drop the codes about that. Signed-off-by: Xin Long <lucien@gmail.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- include/net/sctp/sc

[PATCH net-next 5/5] sctp: remove the local_bh_disable/enable in sctp_endpoint_lookup_assoc

2015-12-30 Thread Xin Long
sctp_endpoint_lookup_assoc is called in the protection of sock lock there is no need to call local_bh_disable in this function. so remove them. Signed-off-by: Xin Long <lucien@gmail.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sctp/endpoi

[PATCH net-next 3/5] sctp: apply rhashtable api to sctp procfs

2015-12-30 Thread Xin Long
Traversal the transport rhashtable, get the association only once through the condition assoc->peer.primary_path != transport. Signed-off-by: Xin Long <lucien@gmail.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- net/sc

[PATCH net-next 1/5] sctp: add the rhashtable apis for sctp global transport hashtable

2015-12-30 Thread Xin Long
ons: - sctp_transport_hashtable_init - sctp_transport_hashtable_destroy Signed-off-by: Xin Long <lucien@gmail.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> --- include/net/sctp/sctp.h| 11 include/net/sctp/structs.h | 5 ++ net/sctp/input.c

[PATCH net-next 2/5] sctp: apply rhashtable api to send/recv path

2015-12-30 Thread Xin Long
apply lookup apis to two functions, for __sctp_endpoint_lookup_assoc and __sctp_lookup_association, it's invoked in the protection of sock lock, it will be safe, but sctp_lookup_association need to call rcu_read_lock() and to detect the t->dead to protect it. Signed-off-by: Xin Long <

[PATCH net-next 0/5] sctp: use transport hashtable to replace association's with rhashtable

2015-12-30 Thread Xin Long
nel] [k] __memset -- spent time time is 22s, send pkt is 1000 Xin Long (5): sctp: add the rhashtable apis for sctp global transport hashtable sctp: apply rhashtable api to send/recv path sctp: apply rhashtable api to sctp procfs sctp: drop the old assoc hashtable of sctp sctp: rem

Re: [PATCH net] sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close

2015-12-21 Thread Xin Long
On Sat, Dec 19, 2015 at 12:23 AM, Marcelo Ricardo Leitner wrote: > On Fri, Dec 18, 2015 at 09:08:46AM -0500, Vlad Yasevich wrote: >> On 12/17/2015 02:33 PM, Vlad Yasevich wrote: >> > On 12/17/2015 02:01 PM, Marcelo Ricardo Leitner wrote: > ... >> >> There is a check on

[PATCHv2 net] sctp: sctp should release assoc when sctp_make_abort_user return NULL in sctp_close

2015-12-29 Thread Xin Long
rture from our typical NOMEM handling". But then the chunk is NULL (low memory) and the SCTP_CMD_REPLY cmd would dereference the chunk pointer, and system crash. So we should add SCTP_CMD_REPLY cmd only when the chunk is not NULL, just like other places where it adds SCTP_CMD_REPLY cmd. Signed-o

rhashtable: how to deal with that rhashtable_lookup_insert_key return -EBUSY

2015-11-19 Thread Xin Long
when I use rhashtable_lookup_insert_key, sometimes it will return -EBUSY. im not sure if there is a good way to workabout it. or I should just try again and again until it's inserted successfully ? I have seen some use in kernel by now, but it seems that no one consider this issue for their

[PATCHv3 net-next] sctp: sctp should change socket state when shutdown is received

2016-06-09 Thread Xin Long
act information. As an improvement, we will change sk->sk_state when we change asoc->state to SHUTDOWN_RECEIVED, and also do it in sctp_shutdown to keep consistent with sctp_close. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sm_sideeffect.c | 4 +++- net/sctp/socket.c

[PATCHv4 net-next] sctp: sctp should change socket state when shutdown is received

2016-06-09 Thread Xin Long
act information. As an improvement, we will change sk->sk_state when we change asoc->state to SHUTDOWN_RECEIVED, and also do it in sctp_shutdown to keep consistent with sctp_close. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sm_sideeffect.c | 4 +++- net/sctp/socket.c

Re: [PATCHv2 net-next] sctp: sctp should change socket state when shutdown is received

2016-06-07 Thread Xin Long
On Sat, Jun 4, 2016 at 8:22 PM, Marcelo Ricardo Leitner wrote: > > Return error? Please don't. Adam Endrodi asked in May (linux-sctp@) a way to > return the addresses used on such attempts and currently this address > returned by accept() is the only one we can get. [1]

Re: [PATCHv2 net-next] sctp: sctp should change socket state when shutdown is received

2016-06-08 Thread Xin Long
On Tue, Jun 7, 2016 at 8:08 PM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Tue, Jun 07, 2016 at 07:03:55PM +0800, Xin Long wrote: >> On Sat, Jun 4, 2016 at 8:22 PM, Marcelo Ricardo Leitner >> <marcelo.leit...@gmail.com> wrote: >> > >>

Re: [PATCHv2 net-next] sctp: sctp should change socket state when shutdown is received

2016-06-08 Thread Xin Long
On Tue, Jun 7, 2016 at 7:03 PM, Xin Long <lucien@gmail.com> wrote: > On Sat, Jun 4, 2016 at 8:22 PM, Marcelo Ricardo Leitner > > --- a/net/sctp/socket.c > +++ b/net/sctp/socket.c > @@ -7565,10 +7565,12 @@ static void sctp_sock_migrate(struct sock > *o

Re: [PATCHv2 net-next] sctp: sctp should change socket state when shutdown is received

2016-06-04 Thread Xin Long
On Sat, Jun 4, 2016 at 1:49 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Fri, Jun 03, 2016 at 10:42:45PM +0800, Xin Long wrote: >> Now sctp doesn't change socket state upon shutdown reception. It changes >> just the assoc state, even though it

[PATCH net] sctp: sctp_diag should dump sctp socket type

2016-05-25 Thread Xin Long
breaking user API. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 1 + net/sctp/socket.c| 1 + 2 files changed, 2 insertions(+) diff --git a/include/linux/sctp.h b/include/linux/sctp.h index dacb5e7..3a406af 100644 --- a/include/linux/sctp.h +++ b/include/linux/

[PATCH net] sctp: fix double EPs display in sctp_diag

2016-05-25 Thread Xin Long
ser is listing only listening endpoints, because then we are not traversing the transport hash. so we have to check idiag_states there also. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sctp_diag.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/sctp/sctp_diag.c b

[PATCH net-next] sctp: change sk state to CLOSED instead of CLOSING in sctp_sock_migrate

2016-06-15 Thread Xin Long
ctually sk is closed already there. Fixes: commit d46e416c11c8 ("sctp: sctp should change socket state when shutdown is received") Reported-by: Ye Xiaolong <xiaolong...@intel.com> Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 2 +- 1 file changed, 1 inserti

Re: [PATCH -next] sctp: fix error return code in sctp_init()

2016-06-13 Thread Xin Long
goto err_thash_alloc; > > pr_info("Hash tables configured (bind %d/%d)\n", sctp_port_hashsize, > > Acked-by: Xin Long <lucien@gmail.com>

[PATCHv2 net-next] sctp: sctp should change socket state when shutdown is received

2016-06-03 Thread Xin Long
act information. As an improvement, we will change sk->sk_state when we change asoc->state to SHUTDOWN_RECEIVED, and also do it in sctp_shutdown to keep consistent with sctp_close. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sm_sideeffect.c | 4 +++- net/sctp/socket.c

[PATCHv2 net] sctp: sctp_diag should dump sctp socket type

2016-05-29 Thread Xin Long
breaking user API. v1->v2: - move 'sctpi_s_type' field to the end of struct sctp_info, so that it won't cause incompatibility with applications already built. - add __reserved3 in sctp_info to make sure sctp_info is 8-byte alignment. Signed-off-by: Xin Long <lucien@gma

Re: [PATCH net] sctp: sctp_diag should dump sctp socket type

2016-05-27 Thread Xin Long
On Thu, May 26, 2016 at 4:21 AM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Thu, 2016-05-26 at 03:14 +0800, Xin Long wrote: >> Now we cannot distinguish that one sk is a udp or sctp style when >> we use ss to dump sctp_info. it's necessary to dump it as well. >> &

Re: [PATCH net] sctp: sctp_diag should dump sctp socket type

2016-05-27 Thread Xin Long
On Thu, May 26, 2016 at 3:24 AM, David Miller <da...@davemloft.net> wrote: > From: Xin Long <lucien@gmail.com> > Date: Thu, 26 May 2016 03:14:28 +0800 > >> For sctp_diag, ss support is not officially available, thus there >> are no official users of t

Re: [PATCH net-next] sctp: sctp should change socket state when shutdown is received

2016-06-02 Thread Xin Long
On Thu, Jun 2, 2016 at 5:40 AM, Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> wrote: > On Thu, Jun 02, 2016 at 03:38:45AM +0800, Xin Long wrote: >> Now sctp doesn't change socket state upon shutdown reception. It changes >> just the assoc state, even though it

[PATCH net-next] sctp: sctp should change socket state when shutdown is received

2016-06-01 Thread Xin Long
act information. As an improvement, we will change sk->sk_state when we change asoc->state to SHUTDOWN_RECEIVED, and also do it in sctp_shutdown to keep consistent with sctp_close. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sm_sideeffect.c | 4 +++- net/sctp/socket.c

[PATCH net] route: add rcu_read_lock when lookup route and update fnhe in __ip_do_redirect

2016-02-01 Thread Xin Long
h = _RES_NH(res); update_or_create_fnhe(nh, fl4->daddr, new_gw, 0, 0); } Which is not running in rcu_read_lock(), it may update a fnhe that has been freed. So fix it by adding rcu_read_lock() just like other parts. Signed-off-by: Xin Long <lucien@gma

Re: [PATCH net] nftables: use list_for_each_entry_safe_reverse to traversal commit_list in nf_tables_abort

2016-02-01 Thread Xin Long
> > No need to resend. > > Yes, we need this reverse iteration there to handle the 'delete table' > command in the batch. This problem happens since we have > nft_flush_table(). > > Other callsites are artificially restriction deletion of inactive > objects but that should be removed as we already

Re: [PATCH net] route: add rcu_read_lock when lookup route and update fnhe in __ip_do_redirect

2016-02-01 Thread Xin Long
> > But the whole __ip_do_redirect() needs to be called from rcu_read_lock() > already. > > No need to add another rcu_read_lock() around fib_lookup() > > How did you come doing this patch ? Any particular stack dump or > something ? > no, no stack dump was found. by reviewing code, I found it

[PATCH net] sctp: translate network order to host order when users get a hmacid

2016-02-03 Thread Xin Long
es: Commit ed5a377d87dc ("sctp: translate host order to network order when setting a hmacid") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c ind

[PATCH net] sctp: lack the check for ports in sctp_v6_cmp_addr

2016-02-27 Thread Xin Long
addresses. that will make sctp_hash_cmp() cannot work well. so fix it by adding ports comparison in sctp_v6_cmp_addr(). Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/ipv6.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index ec52912..c

[PATCH net] sctp: sctp_remaddr_seq_show use the wrong variable to dump transport info

2016-02-27 Thread Xin Long
: fba4c330c5b9 ("sctp: hold transport before we access t->asoc in sctp proc") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/proc.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/sctp/proc.c b/net/sctp/proc.c index ded7d93..963dffc 100644 --

Re: [PATCH net 0/3] fix the transport dead race check by using atomic_add_unless on refcnt

2016-01-21 Thread Xin Long
On Fri, Jan 22, 2016 at 1:49 AM, Xin Long <lucien@gmail.com> wrote: Fixing a bug that was introduce in rhashtable patchset and a follow-up cleanup that is now possible > Xin Long (3): > sctp: fix the transport dead race check by using atomic_add_unless on > refcnt

[PATCH net 0/3] fix the transport dead race check by using atomic_add_unless on refcnt

2016-01-21 Thread Xin Long
Xin Long (3): sctp: fix the transport dead race check by using atomic_add_unless on refcnt sctp: hold transport before we access t->asoc in sctp proc sctp: remove the dead field of sctp_transport include/net/sctp/structs.h | 5 ++--- net/sctp/input.c |

[PATCH net 3/3] sctp: remove the dead field of sctp_transport

2016-01-21 Thread Xin Long
by sock lock, it's not necessary to check dead, either. also, the timers are cancelled when sctp_transport_free() is called, that it doesn't wait for refcnt to reach 0 to cancel them. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 3 +-- net/sctp/

[PATCH net 1/3] sctp: fix the transport dead race check by using atomic_add_unless on refcnt

2016-01-21 Thread Xin Long
that sctp association is not freed using RCU so we can't use atomic_add_unless() with it as it may just be too late for that either. Fixes: 4f0087812648 ("sctp: apply rhashtable api to send/recv path") Reported-by: Vlad Yasevich <vyasev...@gmail.com> Signed-off-by: Xin Long <lucien

[PATCH net 2/3] sctp: hold transport before we access t->asoc in sctp proc

2016-01-21 Thread Xin Long
entries one by one. That is, now we have to check if the assoc is still a good one, as the transport we got may be being freed. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/proc.c | 8 1 file changed, 8 insertions(+) diff --git a/net/sctp/proc.c b/net/sctp/proc.c

[PATCH net] route: check and remove route cache when we get route

2016-02-18 Thread Xin Long
Since the gc of ipv4 route was removed, the route cached would has no chance to be removed, and even it has been timeout, it still could be used, cause no code to check it's expires. Fix this issue by checking and removing route cache when we get route. Signed-off-by: Xin Long <luc

Re: [PATCH net 1/3] sctp: move rcu_read_lock from __sctp_lookup_association to sctp_lookup_association

2016-02-18 Thread Xin Long
On Thu, Feb 18, 2016 at 12:11 AM, Neil Horman <nhor...@tuxdriver.com> wrote: > On Mon, Feb 15, 2016 at 02:28:03PM +0800, Xin Long wrote: >> __sctp_lookup_association() is only invoked by sctp_v4_err() and >> sctp_rcv(), both which run on the rx BH, and it has been protecte

[PATCH net 0/3] sctp: some cleanups for sctp

2016-02-14 Thread Xin Long
There are some unused function and redundant rcu locks should be removed. Xin Long (3): sctp: move rcu_read_lock from __sctp_lookup_association to sctp_lookup_association sctp: remove rcu_read_lock in sctp_seq_dump_remote_addrs() sctp: remove the unused sctp_datamsg_free() include/net

[PATCH net 2/3] sctp: remove rcu_read_lock in sctp_seq_dump_remote_addrs()

2016-02-14 Thread Xin Long
sctp_seq_dump_remote_addrs is only called by sctp_assocs_seq_show() and it has been protected by rcu_read_lock that is from rhashtable_walk_start(). So we will remove this one. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/proc.c | 2 -- 1 file changed, 2 deletions(-) diff

[PATCH net 1/3] sctp: move rcu_read_lock from __sctp_lookup_association to sctp_lookup_association

2016-02-14 Thread Xin Long
. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sctp/input.c b/net/sctp/input.c index 49d2cc7..21a2d6b 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -937,7 +937,6 @@ static struct sctp_assoc

[PATCH net 3/3] sctp: remove the unused sctp_datamsg_free()

2016-02-14 Thread Xin Long
Since commit 8b570dc9f7b6 ("sctp: only drop the reference on the datamsg after sending a msg") used sctp_datamsg_put in sctp_sendmsg, instead of sctp_datamsg_free, this function has no use in sctp. So we will remove it. Signed-off-by: Xin Long <lucien@gmail.com> ---

Re: [PATCH net] route: add rcu_read_lock when lookup route and update fnhe in __ip_do_redirect

2016-02-01 Thread Xin Long
On Tue, Feb 2, 2016 at 1:49 AM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Tue, 2016-02-02 at 01:16 +0800, Xin Long wrote: > >> no, no stack dump was found. >> by reviewing code, I found it when I cooked another patch. >> >> and the path that

[PATCH net] sctp: fix the transports round robin issue when init is retransmitted

2016-03-09 Thread Xin Long
') Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/associola.c | 2 +- net/sctp/transport.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 2bf8ec9..cd87344 100644 --- a/net/sctp/associola.c +++ b/net/sctp/assoc

Re: [PATCH net-next 5/6] bridge: a netlink notification should be sent when those attributes are changed by br_sysfs_if

2016-03-19 Thread Xin Long
On Wed, Mar 16, 2016 at 10:45 PM, Xin Long <lucien@gmail.com> wrote: > yeah, because port fdb_flush is called by brport_store(), in the > common function. > do you think it''s redundant if we add a notification in bridge > fdb_flush to keep > consistence with port f

[PATCH net-next 1/6] bridge: add rtnl_lock in fdb_flush in br_sysfs_br.c

2016-03-19 Thread Xin Long
In fdb_delete, it will send rtnl msg, so before that, we should hold rtnl_lock in the function that call it in sysfs. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_sysfs_br.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/bridge/br_sysfs_br.c b/net/

[PATCH net-next 2/6] bridge: simplify the forward_delay_store by calling store_bridge_parm

2016-03-19 Thread Xin Long
There are some repetitive codes in forward_delay_store, we can remove them by calling store_bridge_parm. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_sysfs_br.c | 27 ++- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/net/

[PATCH net-next 5/6] bridge: a netlink notification should be sent when those attributes are changed by br_sysfs_if

2016-03-19 Thread Xin Long
notification is sent out to listeners. Also, NetworkManager will use this in the future to listen for out-of-band bridge master attribute updates and incorporate them into the runtime configuration. This patch is used for br_sysfs_if, and we also move br_ifinfo_notify out of store_flag. Signed-off-by: Xin

[PATCH net-next 3/6] bridge: simplify the stp_state_store by calling store_bridge_parm

2016-03-19 Thread Xin Long
There are some repetitive codes in stp_state_store, we can remove them by calling store_bridge_parm. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_sysfs_br.c | 24 +++- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/net/bridge/br_sysf

Re: [PATCHv2 net-next 3/6] bridge: simplify the stp_state_store by calling store_bridge_parm

2016-04-06 Thread Xin Long
On Thu, Apr 7, 2016 at 4:10 AM, David Miller <da...@davemloft.net> wrote: > From: Toshiaki Makita <makita.toshi...@lab.ntt.co.jp> > Date: Tue, 5 Apr 2016 14:08:13 +0900 > >> On 2016/04/05 12:32, Xin Long wrote: >>> There are some repetitive codes in stp

[PATCHv3 net-next 2/6] bridge: simplify the forward_delay_store by calling store_bridge_parm

2016-04-08 Thread Xin Long
There are some repetitive codes in forward_delay_store, we can remove them by calling store_bridge_parm. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_sysfs_br.c | 27 ++- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/net/

[PATCHv3 net-next 5/6] bridge: a netlink notification should be sent when those attributes are changed by br_sysfs_if

2016-04-08 Thread Xin Long
notification is sent out to listeners. Also, NetworkManager will use this in the future to listen for out-of-band bridge master attribute updates and incorporate them into the runtime configuration. This patch is used for br_sysfs_if, and we also move br_ifinfo_notify out of store_flag. Signed-off-by: Xin

[PATCHv3 net-next 1/6] bridge: simplify the flush_store by calling store_bridge_parm

2016-04-08 Thread Xin Long
There are some repetitive codes in flush_store, we can remove them by calling store_bridge_parm, also, it would send rtnl notification after we add it in store_bridge_parm in the following patches. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_sysfs_br.c | 14 +++

[PATCHv3 net-next 6/6] bridge: a netlink notification should be sent when those attributes are changed by ioctl

2016-04-08 Thread Xin Long
notification is sent out to listeners. Also, NetworkManager will use this in the future to listen for out-of-band bridge master attribute updates and incorporate them into the runtime configuration. This patch is used for ioctl. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_ioctl.

[PATCHv3 net-next 3/6] bridge: simplify the stp_state_store by calling store_bridge_parm

2016-04-08 Thread Xin Long
There are some repetitive codes in stp_state_store, we can remove them by calling store_bridge_parm. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_sysfs_br.c | 24 +--- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/net/bridge/br_sysf

[PATCHv3 net-next 0/6] bridge: support sending rntl info when we set attributes through sysfs/ioctl

2016-04-08 Thread Xin Long
e attributes that brctl and sysfs support to set. Xin Long (6): bridge: simplify the flush_store by calling store_bridge_parm bridge: simplify the forward_delay_store by calling store_bridge_parm bridge: simplify the stp_state_store by calling store_bridge_parm bridge: a netlink notification sh

[PATCHv3 net-next 4/6] bridge: a netlink notification should be sent when those attributes are changed by br_sysfs_br

2016-04-08 Thread Xin Long
can call it in a common one. For group_addr_store, we cannot make it use store_bridge_parm, because it's not a string-to-long convert, we will add notification on it individually. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_sysfs_br.c | 21 + net/

Re: [PATCHv2 net-next 1/6] sctp: add sctp_info dump api for sctp_diag

2016-04-09 Thread Xin Long
On Sat, Apr 9, 2016 at 1:16 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Sat, 2016-04-09 at 12:53 +0800, Xin Long wrote: >> sctp_diag will dump some important details of sctp's assoc or ep, we use >> sctp_info to describe them, sctp_get_sctp_info to

Re: [PATCHv2 net-next 4/6] sctp: add the sctp_diag.c file

2016-04-09 Thread Xin Long
On Sat, Apr 9, 2016 at 1:51 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Sat, 2016-04-09 at 12:53 +0800, Xin Long wrote: >> This one will implement all the interface of inet_diag, inet_diag_handler. >> which includes sctp_diag_dump, sctp_diag_dump_one a

Re: [PATCHv2 net-next 1/6] sctp: add sctp_info dump api for sctp_diag

2016-04-09 Thread Xin Long
On Sat, Apr 9, 2016 at 1:19 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Sat, 2016-04-09 at 12:53 +0800, Xin Long wrote: >> sctp_diag will dump some important details of sctp's assoc or ep, we use >> sctp_info to describe them, sctp_get_sctp_info to

  1   2   3   4   5   6   7   8   9   10   >