[PATCHv2 net-next 5/6] sctp: merge the seq_start/next/exits in remaddrs and assocs

2016-04-08 Thread Xin Long
In sctp proc, these three functions in remaddrs and assocs are the same. we should merge them into one. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/proc.c | 45 + 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/ne

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

2016-04-08 Thread Xin Long
This one will implement all the interface of inet_diag, inet_diag_handler. which includes sctp_diag_dump, sctp_diag_dump_one and sctp_diag_get_info. It will work as a modules, and register inet_diag_handler when loading. Signed-off-by: Xin Long <lucien@gmail.com> --- include/uapi

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

2016-04-08 Thread Xin Long
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 get them, and export it to sctp_diag.ko. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h| 65 + inclu

[PATCHv2 net-next 0/6] sctp: support sctp_diag in kernel

2016-04-08 Thread Xin Long
show them in tree format easily. Besides, this patchset also simplifies sctp proc codes, cause it has some similar codes with sctp diag in sctp transport traversal. v1->v2: 1. inet_diag_get_handler needs to return it as const. 2. merge 5/7 into 2/7 of v1. Xin Long (6): sctp: add sctp_i

[PATCHv2 net-next 2/6] sctp: export some apis or variables for sctp_diag and reuse some for proc

2016-04-08 Thread Xin Long
the similar situation to traversal transport. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h | 13 + net/sctp/proc.c | 80 +++ net/sctp/socket.c | 124 3 files change

[PATCHv2 net-next 6/6] sctp: fix some rhashtable functions using in sctp proc/diag

2016-04-08 Thread Xin Long
will use 'iter->start_fail' to decide if we will call rhashtable_walk_stop/exit. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/proc.c | 7 ++- net/sctp/socket.c | 15 ++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/net/sctp/proc.c b

[PATCHv2 net-next 3/6] sctp: export some functions for sctp_diag in inet_diag

2016-04-08 Thread Xin Long
inet_diag_msg_common_fill is used to fill the diag msg common info, we need to use it in sctp_diag as well, so export it. We also add inet_diag_get_handler() to access inet_diag_table in sctp diag. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/inet_diag.c | 9 -

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

2016-04-10 Thread Xin Long
On Sat, Apr 9, 2016 at 11:16 PM, Jamal Hadi Salim <j...@mojatatu.com> wrote: > Appreciate these patches. Finally some love for sctp. > Small comment below: > > > On 16-04-09 12:53 AM, Xin Long wrote: >> >> sctp_diag will dump some important details of sctp's

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:23 PM, Nikolay Aleksandrov <niko...@cumulusnetworks.com> wrote: > On 03/16/2016 02:34 PM, Xin Long wrote: >> Now when we change the attributes of bridge or br_port by netlink, >> a relevant netlink notification will be sent, but if we change them

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:49 PM, Nikolay Aleksandrov <niko...@cumulusnetworks.com> wrote: > On 03/16/2016 03:45 PM, Xin Long wrote: >> do you think it''s redundant if we add a notification in bridge >> fdb_flush to keep >> consistence with port fdb_flush? >&g

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

2016-03-19 Thread Xin Long
On Wed, Mar 16, 2016 at 10:14 PM, Nikolay Aleksandrov <niko...@cumulusnetworks.com> wrote: > On 03/16/2016 02:34 PM, Xin Long wrote: >> Now when we change the attributes of bridge or br_port by netlink, >> a relevant netlink notification will be sent, but if we change them

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

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 ioctl. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_ioctl.

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

2016-03-19 Thread Xin Long
On Wed, Mar 16, 2016 at 10:30 PM, Nikolay Aleksandrov <niko...@cumulusnetworks.com> wrote: > On 03/16/2016 02:34 PM, Xin Long wrote: >> This patchset is used to support sending rntl info to user in some places, >> and ensure that whenever those attributes change int

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

2016-03-19 Thread Xin Long
can call it in a common one. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_sysfs_br.c | 17 - net/bridge/br_vlan.c | 30 +- 2 files changed, 13 insertions(+), 34 deletions(-) diff --git a/net/bridge/br_sysfs_br.c b/net/

Re: [PATCH net] sctp: use gfp insteaad of GFP_NOWAIT in idr_alloc_cyclic when sctp_assoc_set_id

2016-03-07 Thread Xin Long
On Mon, Mar 7, 2016 at 7:21 AM, Eric Dumazet wrote: > What is the problem of being not able to allocate memory at this point ? > Now I think about it again, this patch cannot work, because of: __sctp_connect() sctp_assoc_set_id(asoc, GFP_KERNEL) thanks, Eric > If

[PATCHv2 net] bridge: a netlink notification should be sent whenever those attributes change

2016-03-07 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. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_ioctl.c

Re: [PATCHv2 net] bridge: a netlink notification should be sent whenever those attributes change

2016-03-08 Thread Xin Long
On Tue, Mar 8, 2016 at 5:44 PM, Nikolay Aleksandrov <niko...@cumulusnetworks.com> wrote: > On 03/08/2016 04:27 AM, Xin Long wrote: >> Now when we change the attributes of bridge or br_port by netlink, >> a relevant netlink notification will be sent, but if we change them

Re: [PATCH net] sctp: use gfp insteaad of GFP_NOWAIT in idr_alloc_cyclic when sctp_assoc_set_id

2016-03-05 Thread Xin Long
On Sun, Mar 6, 2016 at 12:42 AM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On sam., 2016-03-05 at 23:59 +0800, Xin Long wrote: > > Are you sure idr_alloc(... GFP_KERNEL) makes sense inside spin_lock_bh() > section ? > > idr_alloc() has : > > might_sleep_if(gf

Re: [PATCH net] bridge: a netlink notification should be sent whenever those attributes change

2016-03-05 Thread Xin Long
On Sun, Mar 6, 2016 at 3:43 AM, Nikolay Aleksandrov <niko...@cumulusnetworks.com> wrote: > On 03/05/2016 03:44 PM, Xin Long wrote: > > See the comment above dev_ifsioc: > /* > * Perform the SIOCxIFxxx calls, inside rtnl_lock() > */ > static int dev_ifsioc(struct

[PATCH net] bridge: a netlink notification should be sent whenever those attributes change

2016-03-03 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. Signed-off-by: Xin Long <lucien@gmail.com> --- net/bridge/br_ioctl.c

[PATCH net] sctp: use gfp insteaad of GFP_NOWAIT in idr_alloc_cyclic when sctp_assoc_set_id

2016-03-05 Thread Xin Long
: idr_layer_cache, object size: 2112, buffer size: 2112, default order: 3, min order: 0 [ 2570.989683] node 0: slabs: 839, objs: 11829, free: 0 Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/associola.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ne

Re: [PATCH net] bridge: a netlink notification should be sent whenever those attributes change

2016-03-05 Thread Xin Long
On Thu, Mar 3, 2016 at 8:29 PM, Nikolay Aleksandrov wrote: > > This is incorrect because you don't have rtnl here, bridge device sysfs > options take care of rtnl only on per-option basis and they obtain and > release it themselves, so you won't have rtnl held when

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

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

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

2016-04-04 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.

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

2016-04-04 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/

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

2016-04-04 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 | 18 +- net/

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

2016-04-04 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 +++

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

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

[PATCH net-next 5/7] sctp: reuse the some transport traversal functions in proc

2016-04-04 Thread Xin Long
There are some transport traversal functions for sctp_diag, we can also use it for sctp_proc. cause they have the similar situation to traversal transport. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/proc.c | 80 +

[PATCH net-next 7/7] sctp: fix some rhashtable functions using in sctp proc/diag

2016-04-04 Thread Xin Long
will use 'iter->start_fail' to decide if we will call rhashtable_walk_stop/exit. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/proc.c | 7 ++- net/sctp/socket.c | 15 ++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/net/sctp/proc.c b

[PATCH net-next 6/7] sctp: merge the seq_start/next/exits in remaddrs and assocs

2016-04-04 Thread Xin Long
In sctp proc, these three functions in remaddrs and assocs are the same. we should merge them into one. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/proc.c | 45 + 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/ne

[PATCH net-next 4/7] sctp: add the sctp_diag.c file

2016-04-04 Thread Xin Long
This one will implement all the interface of inet_diag, inet_diag_handler. which includes sctp_diag_dump, sctp_diag_dump_one and sctp_diag_get_info. It will work as a modules, and register inet_diag_handler when loading. Signed-off-by: Xin Long <lucien@gmail.com> --- include/uapi

[PATCH net-next 2/7] sctp: export some apis or variables for sctp_diag

2016-04-04 Thread Xin Long
For some main variables in sctp.ko, we couldn't export it to other modules, so we have to define some api to access them. It will include sctp transport and endpoint's traversal. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h | 13 + net/sctp/so

[PATCH net-next 1/7] sctp: add sctp_info dump api for sctp_diag

2016-04-04 Thread Xin Long
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 get them, and export it to sctp_diag.ko. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h| 65 + inclu

[PATCH net-next 0/7] sctp: support sctp_diag in kernel

2016-04-04 Thread Xin Long
show them in tree format easily. Besides, this patchset also simplifies sctp proc codes, cause it has some similar codes with sctp diag in sctp transport traversal. Xin Long (7): sctp: add sctp_info dump api for sctp_diag sctp: export some apis or variables for sctp_diag sctp: export some

[PATCH net-next 3/7] sctp: export some functions for sctp_diag in inet_diag

2016-04-04 Thread Xin Long
inet_diag_msg_common_fill is used to fill the diag msg common info, we need to use it in sctp_diag as well, so export it. We also add inet_diag_get_handler() to access inet_diag_table in sctp diag. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/inet_diag.c | 9 -

Re: [PATCH net] team: team should sync the port's uc/mc addrs when add a port

2016-03-29 Thread Xin Long
On Tue, Mar 29, 2016 at 12:56 PM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > On Mon, Mar 28, 2016 at 9:42 AM, Xin Long <lucien@gmail.com> wrote: >> There is an issue when we use mavtap over team: >> When we replug nic links from team0, the real nics's mc list wi

[PATCH net] team: team should sync the port's uc/mc addrs when add a port

2016-03-28 Thread Xin Long
in bond_enslave(). We will fix this issue on team by adding the port's uc/mc addrs sync in team_port_add. Signed-off-by: Xin Long <lucien@gmail.com> --- drivers/net/team/team.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 2

[PATCHv2 net] team: team should sync the port's uc/mc addrs when add a port

2016-03-29 Thread Xin Long
in bond_enslave(). We will fix this issue on team by adding the port's uc/mc addrs sync in team_port_add. Signed-off-by: Xin Long <lucien@gmail.com> --- drivers/net/team/team.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 2

[PATCHv3 net-next 3/6] sctp: export some functions for sctp_diag in inet_diag

2016-04-14 Thread Xin Long
ore. cause all the functions in it are in sctp_diag.ko, we just call them in sctp_diag.ko. - add inet_diag_msg_attrs_fill to make codes clear. Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/inet_diag.c | 67 1 file ch

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

2016-04-14 Thread Xin Long
soc->base.sk. - change mem[SK_MEMINFO_WMEM_ALLOC] to asoc->sndbuf_used for asoc dump when asoc->ep->sndbuf_policy is set. don't use INET_DIAG_MEMINFO attr any more. Signed-off-by: Xin Long <lucien@gmail.com> --- include/uapi/linux/inet_diag.h | 2 + net/sctp/Kconfig

[PATCHv3 net-next 2/6] sctp: export some apis or variables for sctp_diag and reuse some for proc

2016-04-14 Thread Xin Long
the similar situation to traversal transport. v2->v3: - rhashtable_walk_init need the parameter gfp, because of recent upstrem update Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h | 13 + net/sctp/proc.c | 81 +++ net/sctp

[PATCHv3 net-next 6/6] sctp: fix some rhashtable functions using in sctp proc/diag

2016-04-14 Thread Xin Long
will use 'iter->start_fail' to decide if we will call rhashtable_walk_stop/exit. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/proc.c | 7 ++- net/sctp/socket.c | 15 ++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/net/sctp/proc.c b

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

2016-04-14 Thread Xin Long
fix the holes in struct sctp_info with __reserved* field. because sctp_diag is a new feature, and sctp_info is just for now, it may be changed in the future. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h| 67 ++ include/net/sc

[PATCHv3 net-next 0/6] sctp: support sctp_diag in kernel

2016-04-14 Thread Xin Long
ements and fixes in patch 1-4, see the details in each patch's comment. Xin Long (6): sctp: add sctp_info dump api for sctp_diag sctp: export some apis or variables for sctp_diag and reuse some for proc sctp: export some functions for sctp_diag in inet_diag sctp: add the sctp_diag.c file

[PATCHv3 net-next 5/6] sctp: merge the seq_start/next/exits in remaddrs and assocs

2016-04-14 Thread Xin Long
In sctp proc, these three functions in remaddrs and assocs are the same. we should merge them into one. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/proc.c | 45 + 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/ne

[PATCH net-next] sctp: sctp_diag should fill RMEM_ALLOC with asoc->rmem_alloc when rcvbuf_policy is set

2016-04-24 Thread Xin Long
For sctp assoc, when rcvbuf_policy is set, it will has it's own rmem_alloc, when we dump asoc info in sctp_diag, we should use that value on RMEM_ALLOC as well, just like WMEM_ALLOC. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/sctp_diag.c | 6 +- 1 file changed, 5 inse

[PATCH net] driver: ixgbevf: ixgbevf_write/read_posted_mbx should use IXGBE_ERR_MBX to initialize ret_val

2016-05-12 Thread Xin Long
err with IXGBE_ERR_MBX, instead of -IXGBE_ERR_MBX. With this fix, the other functions that called it also can work well, cause they only care about if err is 0 or not. Signed-off-by: Xin Long <lucien@gmail.com> --- drivers/net/ethernet/intel/ixgbevf/mbx.c | 4 ++-- 1 file changed, 2 inse

[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

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

[PATCHv3 net-next] net: use jiffies_to_msecs to replace EXPIRES_IN_MS in inet/sctp_diag

2016-04-19 Thread Xin Long
EXPIRES_IN_MS macro comes from net/ipv4/inet_diag.c and dates back to before jiffies_to_msecs() has been introduced. Now we can remove it and use jiffies_to_msecs(). Signed-off-by: Xin Long <lucien@gmail.com> --- net/ipv4/inet_diag.c | 12 ++-- net/sctp/sctp_diag.c | 6 ++-

Re: [PATCHv3 net-next] net: use jiffies_to_msecs to replace EXPIRES_IN_MS in inet/sctp_diag

2016-04-19 Thread Xin Long
On Tue, Apr 19, 2016 at 8:25 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > On Tue, 2016-04-19 at 15:10 +0800, Xin Long wrote: >> EXPIRES_IN_MS macro comes from net/ipv4/inet_diag.c and dates >> back to before jiffies_to_msecs() has been introduced. >> >

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

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 =

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

[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

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 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 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] 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 ("

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

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

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

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-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: avoid BUG_ON on sctp_wait_for_sndbuf

2017-02-07 Thread Xin Long
place. > > Acked-by: Alexander Popov <alex.po...@linux.com> > Signed-off-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> > --- > Please consider this to -stable. Thanks > Reviewed-by: Xin Long <lucien@gmail.com> > net/sctp/socket.c | 3 ++- >

[PATCH net] sctp: check af before verify address in sctp_addr_id2transport

2017-02-07 Thread Xin Long
L and NULL pointer dereference will be caused by af->sockaddr_len. This patch is to fix it by returning NULL if af variable is NULL. Fixes: 6f29a1306131 ("sctp: sctp_addr_id2transport should verify the addr before looking up assoc") Signed-off-by: Xin Long <lucien@gmail.com&g

Re: net/sctp: GPF in sctp_addr_id2transport

2017-02-07 Thread Xin Long
On Tue, Feb 7, 2017 at 7:09 PM, Marcelo Ricardo Leitner wrote: > On Tue, Feb 07, 2017 at 10:42:38AM +0100, Dmitry Vyukov wrote: >> Hello, >> >> The following program triggers GPF in sctp_addr_id2transport: >> >> // autogenerated by syzkaller

[PATCHv6 net-next 2/6] sctp: streams should be recovered when it fails to send request.

2017-02-08 Thread Xin Long
r SSN Reset Request Parameter") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/stream.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/net/sctp/stream.c b/net/sctp/stream.c index 13d5e07..6a686e3 100644 --- a/net/sctp/stream.c +++ b/n

[PATCHv6 net-next 4/6] sctp: implement sender-side procedures for SSN/TSN Reset Request Parameter

2017-02-08 Thread Xin Long
This patch is to implement Sender-Side Procedures for the SSN/TSN Reset Request Parameter descibed in rfc6525 section 5.1.4. It is also to add sockopt SCTP_RESET_ASSOC in rfc6525 section 6.3.3 for users. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h

[PATCHv6 net-next 5/6] sctp: add support for generating stream reconf add incoming/outgoing streams request chunk

2017-02-08 Thread Xin Long
This patch is to define Add Incoming/Outgoing Streams Request Parameter described in rfc6525 section 4.5 and 4.6. They can be in one same chunk trunk as rfc6525 section 3.1-7 describes, so make them in one function. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h

[PATCHv6 net-next 0/6] sctp: add sender-side procedures for stream reconf asoc reset and add streams

2017-02-08 Thread Xin Long
ove ksize check in patch 6/6, as ksize check is acutally used in krealloc already. Xin Long (6): sctp: drop unnecessary __packed from some stream reconf structures sctp: streams should be recovered when it fails to send request. sctp: add support for generating stream reconf ssn/tsn reset re

[PATCHv6 net-next 1/6] sctp: drop unnecessary __packed from some stream reconf structures

2017-02-08 Thread Xin Long
commit 85c727b59483 ("sctp: drop __packed from almost all SCTP structures") has removed __packed from almost all SCTP structures. But there still are three structures where it should be dropped. This patch is to remove it from some stream reconf structures. Signed-off-by: Xin Lo

[PATCHv6 net-next 3/6] sctp: add support for generating stream reconf ssn/tsn reset request chunk

2017-02-08 Thread Xin Long
This patch is to define SSN/TSN Reset Request Parameter described in rfc6525 section 4.3. It's also to drop some unnecessary __packed in include/linux/sctp.h. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 5 + include/net/sctp/sm.h| 2 ++ ne

[PATCHv6 net-next 6/6] sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter

2017-02-08 Thread Xin Long
This patch is to implement Sender-Side Procedures for the Add Outgoing and Incoming Streams Request Parameter described in rfc6525 section 5.1.5-5.1.6. It is also to add sockopt SCTP_ADD_STREAMS in rfc6525 section 6.3.4 for users. Signed-off-by: Xin Long <lucien@gmail.com> --- inclu

[PATCH net-next] sctp: process fwd tsn chunk only when prsctp is enabled

2017-02-03 Thread Xin Long
This patch is to check if asoc->peer.prsctp_capable is set before processing fwd tsn chunk, if not, it will return an ERROR to the peer, just as rfc3758 section 3.3.1 demands. Reported-by: Julian Cordes <julian.cor...@gmail.com> Signed-off-by: Xin Long <lucien@gmail.com>

[PATCHv5 net-next 2/5] sctp: add support for generating stream reconf ssn/tsn reset request chunk

2017-01-21 Thread Xin Long
This patch is to define SSN/TSN Reset Request Parameter described in rfc6525 section 4.3. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h | 5 + include/net/sctp/sm.h| 2 ++ net/sctp/sm_make_chunk.c | 29 + 3 files chang

[PATCHv5 net-next 0/5] sctp: add sender-side procedures for stream reconf asoc reset and add streams

2017-01-21 Thread Xin Long
est issue. - doing actual work only when request is sent successfully. - reduce some indents in sctp_send_add_streams. v4->v5: - close streams before sending request and recover them when sending fails in patch 1/5 and patch 3/5 Xin Long (5): sctp: streams should be recovered w

[PATCHv5 net-next 3/5] sctp: implement sender-side procedures for SSN/TSN Reset Request Parameter

2017-01-21 Thread Xin Long
This patch is to implement Sender-Side Procedures for the SSN/TSN Reset Request Parameter descibed in rfc6525 section 5.1.4. It is also to add sockopt SCTP_RESET_ASSOC in rfc6525 section 6.3.3 for users. Signed-off-by: Xin Long <lucien@gmail.com> --- include/net/sctp/sctp.h

[PATCHv5 net-next 5/5] sctp: implement sender-side procedures for Add Incoming/Outgoing Streams Request Parameter

2017-01-21 Thread Xin Long
This patch is to implement Sender-Side Procedures for the Add Outgoing and Incoming Streams Request Parameter described in rfc6525 section 5.1.5-5.1.6. It is also to add sockopt SCTP_ADD_STREAMS in rfc6525 section 6.3.4 for users. Signed-off-by: Xin Long <lucien@gmail.com> --- inclu

[PATCHv5 net-next 4/5] sctp: add support for generating stream reconf add incoming/outgoing streams request chunk

2017-01-21 Thread Xin Long
This patch is to define Add Incoming/Outgoing Streams Request Parameter described in rfc6525 section 4.5 and 4.6. They can be in one same chunk trunk as rfc6525 section 3.1-7 describes, so make them in one function. Signed-off-by: Xin Long <lucien@gmail.com> --- include/linux/sctp.h

[PATCHv5 net-next 1/5] sctp: streams should be recovered when it fails to send request.

2017-01-21 Thread Xin Long
r SSN Reset Request Parameter") Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/stream.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/net/sctp/stream.c b/net/sctp/stream.c index 13d5e07..6a686e3 100644 --- a/net/sctp/stream.c +++ b/n

Re: [PATCH][V3][net-next] net: sctp: fix array overrun read on sctp_timer_tbl

2017-01-24 Thread Xin Long
t; and suggesting the build time sanity check. > > Fixes CoverityScan CID#1397639 ("Out-of-bounds read") > > Fixes: 7b9438de0cd4 ("sctp: add stream reconf timer") > Signed-off-by: Colin Ian King <colin.k...@canonical.com> Reviewed-by: Xin Long <lucien@gmail.com>

[PATCH net] sctp: sctp gso should set feature with NETIF_F_SG when calling skb_segment

2017-01-23 Thread Xin Long
to fix it by setting features param with NETIF_F_SG when calling skb_segment so that it can go the right branch to process the skb's frag_list. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sctp/offl

[PATCH net] sctp: sctp_addr_id2transport should verify the addr before looking up assoc

2017-01-23 Thread Xin Long
assoc by address. This patch is to fix it by calling sctp_verify_addr in which it can do this conversion before calling sctp_endpoint_lookup_assoc, just like what sctp_sendmsg and __sctp_connect do for the address from users. Signed-off-by: Xin Long <lucien@gmail.com> --- net/sctp/so

Re: [PATCH net] sctp: sctp_addr_id2transport should verify the addr before looking up assoc

2017-01-25 Thread Xin Long
On Wed, Jan 25, 2017 at 11:27 PM, Vladislav Yasevich <vyasev...@gmail.com> wrote: > On Tue, Jan 24, 2017 at 1:01 AM, Xin Long <lucien@gmail.com> wrote: >> >> sctp_addr_id2transport is a function for sockopt to look up assoc by >> address. As the address is from

<    1   2   3   4   5   6   7   8   9   10   >