[PATCH net-next] sctp: remove the old ttl expires policy

2016-10-07 Thread Xin Long
expires_at and check the expires in sctp_check_abandoned. Note that asoc->prsctp_enable is set by default, so users can't feel any difference even if they use the old expires api in userspace. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 1 - net/sct

[PATCH net-next] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements

2016-10-07 Thread Xin Long
ecking chunk->sent_count is greater than 1. This patch is to remove resent from sctp_chunk and reuse sent_count to avoid retransmitted chunks for RTT measurements. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 2 +- net/sctp/output.c | 3 ++- net/

[PATCH net] sctp: fix the issue sctp_diag uses lock_sock in rcu_read_lock

2016-09-28 Thread Xin Long
ump it. Then it will traverse the list again to get the next one until all sctp socks are dumped. For sctp_diag_dump_one, it fixes this issue by holding asoc and moving cb() out of rcu_read_lock in sctp_transport_lookup_process. Fixes: 8f840e47f190 ("sctp: add the sctp_diag.c file") Signed-off-by: Xin

[PATCHv3 net 0/3] sctp: a bunch of fixes for prsctp polices

2016-09-28 Thread Xin Long
This patchset is to fix 2 issues for prsctp polices: 1. patch 1 and 2 fix "netperf-Throughput_Mbps -37.2% regression" issue when overloading the CPU. 2. patch 3 fix "prsctp polices should check both sides' prsctp_capable, instead of only local side". Xin Lo

[PATCHv3 net 3/3] sctp: change to check peer prsctp_capable when using prsctp polices

2016-09-28 Thread Xin Long
to check if prsctp is enabled on both side, instead of asoc->prsctp_enable, as asoc's peer.prsctp_capable is set only when local and peer both enable prsctp. Fixes: a6c2f792873a ("sctp: implement prsctp TTL policy") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/c

[PATCHv3 net 1/3] sctp: move sent_count to the memory hole in sctp_chunk

2016-09-28 Thread Xin Long
73a ("sctp: implement prsctp TTL policy") Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index ce93c4b..4f097f5 100

[PATCHv3 net 2/3] sctp: remove prsctp_param from sctp_chunk

2016-09-28 Thread Xin Long
xpires_at time. This one also fixes the "netperf-Throughput_Mbps -37.2% regression" issue. Fixes: a6c2f792873a ("sctp: implement prsctp TTL policy") Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 7 --- net/sctp/chunk.c

Re: [PATCHv2 net 0/5] sctp: some fixes of prsctp polices

2016-09-28 Thread Xin Long
> > That doesn't matter. This happens all the time. > > The way you handle this is you submit patch #1 targetting 'net' and > wait for it to get into 'net' and propagate into 'net-next'. When > that happens you can submit patches #2-5 as a second patch series > targetting 'net-next'. Thanks,

Re: [PATCHv2 net 0/5] sctp: some fixes of prsctp polices

2016-09-28 Thread Xin Long
> >> This patchset is to improve some codes about prsctp polices, and also >> to fix some issues. >> >> v1->v2: >> - wrap the check of chunk->sent_count in a macro: >> sctp_chunk_retransmitted in patch 2/5. > > This series is a mix of bug fixes (patch #1) which should be targetting > 'net'

[PATCHv2 net 0/5] sctp: some fixes of prsctp polices

2016-09-28 Thread Xin Long
This patchset is to improve some codes about prsctp polices, and also to fix some issues. v1->v2: - wrap the check of chunk->sent_count in a macro: sctp_chunk_retransmitted in patch 2/5. Xin Long (5): sctp: move sent_count to the memory hole in sctp_chunk sctp: reuse sent

[PATCHv2 net 1/5] sctp: move sent_count to the memory hole in sctp_chunk

2016-09-28 Thread Xin Long
73a ("sctp: implement prsctp TTL policy") Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index ce93c4b..4f097f5 100

[PATCHv2 net 4/5] sctp: change to check peer prsctp_capable when using prsctp polices

2016-09-28 Thread Xin Long
to check if prsctp is enabled on both side, instead of asoc->prsctp_enable, as asoc's peer.prsctp_capable is set only when local and peer both enable prsctp. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/chunk.c| 4 ++-- net/sctp/outqueue.c | 8 2 files changed,

[PATCHv2 net 2/5] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements

2016-09-28 Thread Xin Long
ecking chunk->sent_count is greater than 1. This patch is to remove resent from sctp_chunk and reuse sent_count to avoid retransmitted chunks for RTT measurements. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 2 +- net/sctp/output.c | 3 ++- net/

[PATCHv2 net 3/5] sctp: remove prsctp_param from sctp_chunk

2016-09-28 Thread Xin Long
xpires_at time. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 7 --- net/sctp/chunk.c | 9 +++-- net/sctp/outqueue.c| 4 ++-- net/sctp/sm_make_chunk.c | 15 --- 4 files changed, 9 insertions(+), 26 deletions(-) diff

[PATCHv2 net 5/5] sctp: remove the old ttl expires policy

2016-09-28 Thread Xin Long
expires_at and check the expires in sctp_check_abandoned. Note that asoc->prsctp_enable is set by default, so users can't feel any difference even if they use the old expires api in userspace. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 1 - net/sct

Re: [PATCH net 2/5] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements

2016-09-27 Thread Xin Long
> > Maybe wrap this in a macro? i.e.: > #define chunk_retransmitted(chunk) (chunk->sent_count > 1) > > For readability? > That's a nice suggestion. chunk->sent_count == 1 is confusing there for reading. will improve it in v2. Thanks.

[PATCH net 4/5] sctp: change to check peer prsctp_capable when using prsctp polices

2016-09-26 Thread Xin Long
to check if prsctp is enabled on both side, instead of asoc->prsctp_enable, as asoc's peer.prsctp_capable is set only when local and peer both enable prsctp. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/chunk.c| 4 ++-- net/sctp/outqueue.c | 8 2 files changed,

[PATCH net 5/5] sctp: remove the old ttl expires policy

2016-09-26 Thread Xin Long
expires_at and check the expires in sctp_check_abandoned. Note that asoc->prsctp_enable is set by default, so users can't feel any difference even if they use the old expires api in userspace. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 1 - net/sct

[PATCH net 3/5] sctp: remove prsctp_param from sctp_chunk

2016-09-26 Thread Xin Long
xpires_at time. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 7 --- net/sctp/chunk.c | 9 +++-- net/sctp/outqueue.c| 4 ++-- net/sctp/sm_make_chunk.c | 15 --- 4 files changed, 9 insertions(+), 26 deletions(-) diff

[PATCH net 2/5] sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements

2016-09-26 Thread Xin Long
ecking chunk->sent_count is greater than 1. This patch is to remove resent from sctp_chunk and reuse sent_count to avoid retransmitted chunks for RTT measurements. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 1 - net/sctp/output.c | 3 ++- net/

[PATCH net 1/5] sctp: move sent_count to the memory hole in sctp_chunk

2016-09-26 Thread Xin Long
73a ("sctp: implement prsctp TTL policy") Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index ce93c4b..4f097f5 100

[PATCH net 0/5] sctp: some fixes of prsctp polices

2016-09-26 Thread Xin Long
This patchset is to improve some codes about prsctp polices, and also to fix some issues. Xin Long (5): sctp: move sent_count to the memory hole in sctp_chunk sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements sctp: remove prsctp_param from sctp_chunk sctp

[PATCHv2 net 5/6] sctp: make sctp_outq_flush/tail/uncork return void

2016-09-13 Thread Xin Long
sctp_outq_flush return value is meaningless now, this patch is to make sctp_outq_flush return void, as well as sctp_outq_fail and sctp_outq_uncork. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 4 ++-- net/sctp/outqueue.c| 19 +++---

[PATCHv2 net 6/6] sctp: not return ENOMEM err back in sctp_packet_transmit

2016-09-13 Thread Xin Long
, it also cleans up sctp_packet_transmit's err path, and fixes some issues in err path: - It didn't free the head skb in nomem: path. - No need to check nskb in no_route: path. - It should goto err: path if alloc_skb fails for head. - Not all the NOMEMs should free nskb. Signed-off-by: Xin Long

[PATCHv2 net 3/6] sctp: free msg->chunks when sctp_primitive_SEND return err

2016-09-13 Thread Xin Long
g_free to free the chunks of current msg. Fixes: 8b570dc9f7b6 ("sctp: only drop the reference on the datamsg after sending a msg") Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 1 + net/sctp/chunk.c | 13 + net/sctp/o

[PATCHv2 net 4/6] sctp: save transmit error to sk_err in sctp_outq_flush

2016-09-13 Thread Xin Long
value. Eventually, sctp_wait_for_* would check for it. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/output.c | 3 ++- net/sctp/outqueue.c | 21 - 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/net/sctp/output.c b/net/sctp/output.c

[PATCHv2 net 2/6] sctp: do not return the transmit err back to sctp_sendmsg

2016-09-13 Thread Xin Long
, and not return the transmit err back to sctp_sendmsg Fixes: 8b570dc9f7b6 ("sctp: only drop the reference on the datamsg after sending a msg") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sm_sideeffect.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-)

[PATCHv2 net 1/6] sctp: remove the unnecessary state check in sctp_outq_tail

2016-09-13 Thread Xin Long
by timer events, the event's processes still need to acquire lock_sock first. It means no others CMDs can be enqueue into side effect list before CMD_SEND_MSG to change asoc->state, so it's safe to remove it. This patch is to remove redundant asoc->state check from sctp_outq_tail. Signed-off-by: Xi

[PATCHv2 net 0/6] sctp: fix the transmit err process

2016-09-13 Thread Xin Long
of by retransmit. v1->v2: - add more details to the changelog in patch 1/6 - add Fixes: tag in patch 2/6, 3/6 - also revert 69b5777f2e57 in patch 3/6 Xin Long (6): sctp: remove the unnecessary state check in sctp_outq_tail sctp: do not return the transmit err back to sctp_sendmsg sctp: free

Re: [PATCH net 1/6] sctp: remove the unnecessary state check in sctp_outq_tail

2016-09-13 Thread Xin Long
> > I also don't see an issue with this patch, btw. > > Xin, you may want to add more/such details to the changelog, specially > about the timer versus primitive handling. > OK, I will post v2 of this patchset.

Re: [PATCH net] sctp: hold the transport before using it in sctp_hash_cmp

2016-09-10 Thread Xin Long
> > Please add more detail to the commit message and add a proper > "Fixes: " tag right before your signoff. OK, will repost v2

[PATCHv2 net] sctp: hold the transport before using it in sctp_hash_cmp

2016-09-10 Thread Xin Long
ransport_hold, in which it checks the refcnt first, holds it if it's not 0. Fixes: 4f0087812648 ("sctp: apply rhashtable api to send/recv path") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/input.c | 27 +-- 1 file changed, 17 insertions(+), 10 d

Re: [PATCH net 1/6] sctp: remove the unnecessary state check in sctp_outq_tail

2016-09-09 Thread Xin Long
> I don't know, I still don't feel safe about it. I agree the socket lock keeps > the state from changing during a single transmission, which makes the use case > you are focused on correct. ok, :-) > > That said, have you considered the retransmit case? That is to say, if you > queue and flush

Re: [PATCH net] sctp: hold the transport before using it in sctp_hash_cmp

2016-09-09 Thread Xin Long
>> > What path does this occur in? __sctp_lookup_association takes a hold on the > asoc, and that function is protected by the rcu_read_lock, so I'm not sure how > you get into a situation in which the asoc can be deleted while the lookup is > occuring. > yes that function is protected by the

Re: [PATCH net 1/6] sctp: remove the unnecessary state check in sctp_outq_tail

2016-09-09 Thread Xin Long
>> > Its not enough to just look at the paths where outq_tail is called, because > the outq_tail function is checking a state variable that can update > asynchronously in the side effect processing queue. Look at any one of the > timer functions. Those all fire asynchronous to the outq list, but

Re: [PATCH net 1/6] sctp: remove the unnecessary state check in sctp_outq_tail

2016-09-08 Thread Xin Long
>> Data Chunks are only sent by sctp_primitive_SEND, in which sctp checks >> the asoc's state through statetable before calling sctp_outq_tail. So >> there's no need to do it again in sctp_outq_tail. >> >> This patch is to remove it from sctp_outq_tail. >>

Re: [PATCH net] sctp: hold the transport before using it in sctp_hash_cmp

2016-09-08 Thread Xin Long
>> Now sctp uses the transport without holding it in sctp_hash_cmp, >> it can cause a use-after-free panic. As after it get transport from >> hashtable, another CPU may free it, then the members it accesses >> may be unavailable memory. > > How old is this bug? I think since: $ git describe

[PATCH net] sctp: identify chunks that need to be fragmented at IP level

2016-09-08 Thread Xin Long
From: Marcelo Ricardo Leitner Previously, without GSO, it was easy to identify it: if the chunk didn't fit and there was no data chunk in the packet yet, we could fragment at IP level. So if there was an auth chunk and we were bundling a big data chunk, it would

[PATCH net] sctp: hold the transport before using it in sctp_hash_cmp

2016-09-08 Thread Xin Long
first, holds it if it's not 0. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/input.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/net/sctp/input.c b/net/sctp/input.c index 69444d3..1555fb8 100644 --- a/net/sctp/input.c +++

[PATCH net 6/6] sctp: not return ENOMEM err back in sctp_packet_transmit

2016-09-08 Thread Xin Long
, it also cleans up sctp_packet_transmit's err path, and fixes some issues in err path: - It didn't free the head skb in nomem: path. - No need to check nskb in no_route: path. - It should goto err: path if alloc_skb fails for head. - Not all the NOMEMs should free nskb. Signed-off-by: Xin Long

[PATCH net 5/6] sctp: make sctp_outq_flush/tail/uncork return void

2016-09-08 Thread Xin Long
sctp_outq_flush return value is meaningless now, this patch is to make sctp_outq_flush return void, as well as sctp_outq_fail and sctp_outq_uncork. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 4 ++-- net/sctp/outqueue.c| 19 +++---

[PATCH net 4/6] sctp: save transmit error to sk_err in sctp_outq_flush

2016-09-08 Thread Xin Long
value. Eventually, sctp_wait_for_* would check for it. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/output.c | 3 ++- net/sctp/outqueue.c | 21 - 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/net/sctp/output.c b/net/sctp/output.c

[PATCH net 3/6] sctp: free msg->chunks when sctp_primitive_SEND return err

2016-09-08 Thread Xin Long
ert commit 1cd4d5c4326a ("sctp: remove the unused sctp_datamsg_free()") and commit 8b570dc9f7b6 ("sctp: only drop the reference on the datamsg after sending a msg"), to use sctp_datamsg_free to free the chunks of current msg. Signed-off-by: Xin Long <lucien@gmail.com>

[PATCH net 1/6] sctp: remove the unnecessary state check in sctp_outq_tail

2016-09-08 Thread Xin Long
Data Chunks are only sent by sctp_primitive_SEND, in which sctp checks the asoc's state through statetable before calling sctp_outq_tail. So there's no need to do it again in sctp_outq_tail. This patch is to remove it from sctp_outq_tail. Signed-off-by: Xin Long <lucien@gmail.com> --

[PATCH net 0/6] sctp: fix the transmit err process

2016-09-08 Thread Xin Long
of by retransmit. Xin Long (6): sctp: remove the unnecessary state check in sctp_outq_tail sctp: do not return the transmit err back to sctp_sendmsg sctp: free msg->chunks when sctp_primitive_SEND return err sctp: save transmit error to sk_err in sctp_outq_flush sctp: make sctp_outq_flush/tail/unc

[PATCH net 2/6] sctp: do not return the transmit err back to sctp_sendmsg

2016-09-08 Thread Xin Long
, and not return the transmit err back to sctp_sendmsg Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sm_sideeffect.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 12d4519..cf6e4f0 100644 --- a/ne

[PATCH net] veth: sctp: add NETIF_F_SCTP_CRC to device features

2016-08-24 Thread Xin Long
Li Shuang <tjlishu...@yeah.net> Signed-off-by: Xin Long <lucien@gmail.com> --- drivers/net/veth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index f37a6e6..4bda502 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c @@ -

Re: [PATCH net 2/2] sctp: not copying duplicate addrs to the assoc's bind address list

2016-08-24 Thread Xin Long
> Or add a refcnt to its members. > NETDEV_UP, it gets a ++ if it's already there > NETDEV_DOWN, it gets a -- and cleans it up if it reaches 0 > And the rest probably could stay the same. > Yes, it could also avoid the issue of amounts of duplicate addrs. or add a nic index variable to its

Re: [PATCH net 2/2] sctp: not copying duplicate addrs to the assoc's bind address list

2016-08-23 Thread Xin Long
>> > Ah, I see what you're doing. Ok, this makes some sense, at least on the >> > receive >> > side, when you get a cookie unpacked and modify the remote peers address >> > list, >> > it makes sense to check for duplicates. On the local side however, I >> > would, >> > instead of checking it

Re: [PATCH net] sctp: fix overrun in sctp_diag_dump_one()

2016-08-23 Thread Xin Long
6; > > paddr.v6.sin6_port = req->id.idiag_dport; > - memcpy(_addr, req->id.idiag_dst, 64); > + memcpy(_addr, req->id.idiag_dst, > + sizeof(paddr.v6.sin6_addr)); > paddr.v6.sin6_family = AF_INET6; > } > > -- > 2.5.5 > Reviewed-by: Xin Long <lucien@gmail.com>

Re: [PATCH net 2/2] sctp: not copying duplicate addrs to the assoc's bind address list

2016-08-20 Thread Xin Long
> Ah, I see what you're doing. Ok, this makes some sense, at least on the > receive > side, when you get a cookie unpacked and modify the remote peers address list, > it makes sense to check for duplicates. On the local side however, I would, > instead of checking it when the list gets copied,

Re: [PATCH net 2/2] sctp: not copying duplicate addrs to the assoc's bind address list

2016-08-19 Thread Xin Long
> Under what valid use case will multiple interfaces have the same network > address? > Hi, Neil. I'm not sure the specific valid use case. The point is, do we trust the sctp global addr list has no duplicate address ? In one of users' computer, he found hundreds of duplicate addresses in

[PATCH net 1/2] sctp: reduce indent level in sctp_copy_local_addr_list

2016-08-19 Thread Xin Long
This patch is to reduce indent level by using continue when the addr is not allowed, and also drop end_copy by using break. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/protocol.c | 37 +++-- 1 file changed, 19 insertions(+), 18 deletions(-)

[PATCH net 0/2] sctp: not copying duplicate addrs to the assoc's bind address list

2016-08-19 Thread Xin Long
Patch 1/2 is to fix some indent level. Given that we have kernels out there with this issue, patch 2/2 also fix sctp_raw_to_bind_addrs. Xin Long (2): sctp: reduce indent level in sctp_copy_local_addr_list sctp: not copying duplicate addrs to the assoc's bind address list net/sctp

[PATCH net 2/2] sctp: not copying duplicate addrs to the assoc's bind address list

2016-08-19 Thread Xin Long
From: Xin Long <l...@redhat.com> sctp.local_addr_list is a global address list that is supposed to include all the local addresses. sctp updates this list according to NETDEV_UP/ NETDEV_DOWN notifications. However, if multiple NICs have the same address, the global list will have dup

Re: [PATCH net] sctp: fix a success return may hide an error

2016-08-17 Thread Xin Long
>> > If letting the application see ENOMEM errors, and sctp has to drop this >> > chunk, instead of retransmiting the ENOMEM chunk, but the ENOMEM >> > chunk may not be the chunk from current msg, as it flush all the queue. >> > even if users get an ENOMEM error, they may re-send a chunk that is

Re: [PATCH iproute2] ip route: restore_handler should check tb[RTA_PREFSRC] for local networks

2016-08-16 Thread Xin Long
Hi, Stephen any update on this ?

Re: [PATCH net] sctp: fix a success return may hide an error

2016-08-16 Thread Xin Long
>> > This err returns back to sctp_sendmsg, there sctp will abort asoc. > > That's not right I think. sctp_sendmsg will only free the asoc if it was > created to send that specific chunk. And in this case, this change > should have no effect as it can't have sctp_outq_flush() touching > several

Re: [PATCH net] sctp: fix a success return may hide an error

2016-08-16 Thread Xin Long
>> >> [1] >> Both sctp_outq_flush_rtx and sctp_packet_transmit can ONLY >> return one error (-ENOMEM), as sctp_outq_flush_rtx also calls >> sctp_packet_transmit. > > What is the effect of the error? > If it is 'just' equivalent to a lost ethernet packet (and the skb (etc) > is freed) then the

Re: [PATCH net] sctp: fix a success return may hide an error

2016-08-13 Thread Xin Long
> > This style of error handling is dangerous. The first error can be > lost. > > For example, if sctp_outq_flush_rtx() earlier in this function returns > an error, it will be lost if any invocation of the function > sctp_packet_transmit() at the end function signals an error. > > I think you

[PATCH net] sctp: fix a success return may hide an error

2016-08-11 Thread Xin Long
this by keeping the old error until the new error returns from sctp_packet_transmit. Did TAHI test against this fix, no regression is found. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/outqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sctp/outqueue.c

[PATCH iproute2] ip route: restore_handler should check tb[RTA_PREFSRC] for local networks

2016-08-07 Thread Xin Long
again as a local network. This patch is to add tb[RTA_PREFSRC] check when restoring local networks. Fixes: 74af8dd9620e ("ip route: restore route entries in correct order") Signed-off-by: Xin Long <lucien@gmail.com> --- ip/iproute.c | 2 +- 1 file changed, 1 insertion(+), 1 d

[PATCH net] sctp: use event->chunk when it's valid

2016-08-07 Thread Xin Long
patch didn't really work. This patch is to move the event->chunk initialization before calling sctp_ulpevent_receive_data() so that it uses event->chunk when it's valid. Fixes: 52253db924d1 ("sctp: also point GSO head_skb to the sk when it's available") Signed-off-by: Xin Long &

Re: [PATCH v2 1/3] sctp: Export struct sctp_info to userspace

2016-08-04 Thread Xin Long
On Thu, Aug 4, 2016 at 5:27 PM, Phil Sutter wrote: > On Thu, Aug 04, 2016 at 09:13:03AM +, David Laight wrote: >> From: Phil Sutter >> > Sent: 03 August 2016 22:23 >> > This is required to correctly interpret INET_DIAG_INFO messages exported >> > by sctp_diag module. >> ... >> >

Re: [PATCH 2/3] sctp_diag: export timer value only if it is active

2016-07-31 Thread Xin Long
> > I'll look into this next week. One early question: Does the above mean > we are printing the primary path's timer value for every assoc? If so, > shouldn't we do that for just the EP or the primary path's assoc even? > Nope, we can't say "the primary path's assoc". Every assoc has their own

Re: [PATCH 2/3] sctp_diag: export timer value only if it is active

2016-07-30 Thread Xin Long
>> diff --git a/net/sctp/sctp_diag.c b/net/sctp/sctp_diag.c >> index f69edcf219e51..0ad6033a7330c 100644 >> --- a/net/sctp/sctp_diag.c >> +++ b/net/sctp/sctp_diag.c >> @@ -40,10 +40,12 @@ static void inet_diag_msg_sctpasoc_fill(struct >> inet_diag_msg *r, >> } >> >> r->idiag_state =

[PATCH net] sctp: change to use TCP_CLOSE_WAIT as SCTP_SS_CLOSING

2016-07-30 Thread Xin Long
in lksctp-tools and ran sctp codnomicon fuzzer tests against this patch, no regression or failure found. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/sctp/constants.h b/inclu

[PATCH net] sctp: allow receiving msg when TCP-style sk is in CLOSED state

2016-07-30 Thread Xin Long
sg returns directly if sk state is CLOSED. This patch is to add CLOSED state check in sctp_recvmsg to allow reading data from TCP-style sk with CLOSED state as what TCP does. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH net] sctp: allow delivering notifications after receiving SHUTDOWN

2016-07-30 Thread Xin Long
. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/ulpqueue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c index ec166d2..877e550 100644 --- a/net/sctp/ulpqueue.c +++ b/net/sctp/ulpqueue.c @@ -204,

[PATCH net] sctp: fix the issue sctp requeue auth chunk incorrectly

2016-07-29 Thread Xin Long
ng the MAC in sctp_auth_calculate_hmac(), as the incorrect offset of the auth chunk in skb->data. This fix is to requeue it by using packet->auth. Fixes: f1533cce60d1 ("sctp: fix panic when sending auth chunks") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/output.c | 3 ++- 1

[PATCH net-next] sctp: use inet_recvmsg to support sctp RFS well

2016-07-22 Thread Xin Long
the flow. It may cause that the receiver has no chances to record the flow if it doesn't send msg or poll the socket. So this patch fixes it by using inet_recvmsg as .recvmsg in sctp. Fixes: 486bdee0134c ("sctp: add support for RPS and RFS") Signed-off-by: Xin Long <lucien@gmail.com&

[PATCH net-next] sctp: support ipv6 nonlocal bind

2016-07-22 Thread Xin Long
This patch makes sctp support ipv6 nonlocal bind by adding sp->inet.freebind and net->ipv6.sysctl.ip_nonlocal_bind check in sctp_v6_available as what sctp did to support ipv4 nonlocal bind (commit cdac4e077489). Reported-by: Shijoe George <spanj...@redhat.com> Signed-off-by: Xin

[PATCH iproute2] ip route: restore route entries in correct order

2016-07-12 Thread Xin Long
ording to the following conditions, to make sure every entry can be restored successfully. 1. !gw && (!fib_prefsrc || fib_prefsrc == cfg->fc_dst) 2. !gw && (fib_prefsrc != cfg->fc_dst) 3. gw Signed-off-by: Xin Long <lucien@gm

Re: [PATCH net-next 0/6] sctp: implement rfc7496 in sctp

2016-07-09 Thread Xin Long
On Sat, Jul 9, 2016 at 7:47 PM, Xin Long <lucien@gmail.com> wrote: > This patchset implements "Additional Policies for the Partially Reliable > Stream Control Transmission Protocol Extension" described on RFC7496. > > The Partially Reliable SCTP (PR-SCTP) e

[PATCH net-next 3/6] sctp: add SCTP_PR_ASSOC_STATUS on sctp sockopt

2016-07-09 Thread Xin Long
, it needs rfc6525 to be implemented. As the prsctp statistics for each stream has to be based on per stream statistics, we will delay it until rfc6525 is done in linux. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 3 +++ include/uapi/linux/sctp.h

[PATCH net-next 5/6] sctp: implement prsctp RTX policy

2016-07-09 Thread Xin Long
TTL policy, if RTX policy is enabled, msg->expire_at won't work. Then in sctp_chunk_abandoned, this patch checks if chunk->sent_count is bigger than chunk->prsctp_param to abandon this chunk. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/chunk.c

[PATCH net-next 4/6] sctp: implement prsctp TTL policy

2016-07-09 Thread Xin Long
es_at. So if prsctp_enable or TTL policy is not enabled, msg->expires_at still works as before. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 10 ++ net/sctp/chunk.c | 20 +--- net/sctp/output.c | 2 ++ net/sc

[PATCH net-next 2/6] sctp: add SCTP_DEFAULT_PRINFO into sctp sockopt

2016-07-09 Thread Xin Long
of the default params. In this patch, we will use 5-8bit of sp/asoc->default_flags to store prsctp policies, and reuse asoc->default_timetolive to store their values. It means if we enable and set prsctp policy, prior ttl timeout in sctp will not work any more. Signed-off-by: Xin Long <lucien@

[PATCH net-next 6/6] sctp: implement prsctp PRIO policy

2016-07-09 Thread Xin Long
ee chunks from out_queue in right order until the abandon+free size > msg_len - sctp_wfree. For the abandon size, we have to wait until it sends FORWARD TSN, receives the sack and the chunks are really freed. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h

[PATCH net-next 0/6] sctp: implement rfc7496 in sctp

2016-07-09 Thread Xin Long
Patch 4-6 implement these 3 policies one by one. Xin Long (6): sctp: add SCTP_PR_SUPPORTED on sctp sockopt sctp: add SCTP_DEFAULT_PRINFO into sctp sockopt sctp: add SCTP_PR_ASSOC_STATUS on sctp sockopt sctp: implement prsctp TTL policy sctp: implement prsctp RTX policy sctp: implemen

[PATCH net-next 1/6] sctp: add SCTP_PR_SUPPORTED on sctp sockopt

2016-07-09 Thread Xin Long
t;prsctp_enable will be initialized with ep->prsctp_enable. We can also modify it's value through sockopt SCTP_PR_SUPPORTED. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/structs.h | 6 ++-- include/uapi/linux/sctp.h | 1 + net/sctp/associola.c | 1 +

Re: [PATCH] ip route: timeout for routes has to be set in seconds

2016-06-29 Thread Xin Long
h1 expires 10 > $ ./ip/ip -6 r > 2002::/64 dev veth1 metric 1024 linkdown expires 996sec pref medium > > Cc: Xin Long <lucien@gmail.com> > Cc: Hangbin Liu <liuhang...@gmail.com> > Cc: Stephen Hemminger <shemm...@brocade.com> > Fixes: 68eede250500 ("

[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>

[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

[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

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-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-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-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

[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

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

[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

[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

Re: [Intel-wired-lan] [PATCH next-queue] ixgbe: netdev->vlan_features shouldn't have the vlan related flag

2016-05-18 Thread Xin Long
On Wed, May 18, 2016 at 11:07 PM, Alexander Duyck <alexander.du...@gmail.com> wrote: > On Wed, May 18, 2016 at 1:55 AM, Xin Long <lucien@gmail.com> wrote: >> vlan_features is used to set the vlan_dev->features when we create >> a vlan device. it shouldn't ha

[PATCH next-queue] ixgbe: netdev->vlan_features shouldn't have the vlan related flag

2016-05-18 Thread Xin Long
->features' vlan related flags behind using features to set netdev->vlan_features. Signed-off-by: Xin Long <lucien@gmail.com> --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel

<    5   6   7   8   9   10   11   12   >