linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] sctp: use inet_recvmsg to support sctp RFS well
@ 2016-07-22 13:25 Xin Long
  2016-07-22 13:34 ` Marcelo Ricardo Leitner
  2016-07-25 17:56 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Xin Long @ 2016-07-22 13:25 UTC (permalink / raw)
  To: network dev, linux-sctp
  Cc: Marcelo Ricardo Leitner, Vlad Yasevich, daniel, davem

Commit 486bdee0134c ("sctp: add support for RPS and RFS")
saves skb->hash into sk->sk_rxhash so that the inet_* can
record it to flow table.

But sctp uses sock_common_recvmsg as .recvmsg instead
of inet_recvmsg, sock_common_recvmsg doesn't invoke
sock_rps_record_flow to record 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.xin@gmail.com>
---
 net/sctp/ipv6.c     | 2 +-
 net/sctp/protocol.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index ae6f1a2..98c383c 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -954,7 +954,7 @@ static const struct proto_ops inet6_seqpacket_ops = {
 	.setsockopt	   = sock_common_setsockopt,
 	.getsockopt	   = sock_common_getsockopt,
 	.sendmsg	   = inet_sendmsg,
-	.recvmsg	   = sock_common_recvmsg,
+	.recvmsg	   = inet_recvmsg,
 	.mmap		   = sock_no_mmap,
 #ifdef CONFIG_COMPAT
 	.compat_setsockopt = compat_sock_common_setsockopt,
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 1adb927..7b523e3 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1028,7 +1028,7 @@ static const struct proto_ops inet_seqpacket_ops = {
 	.setsockopt	   = sock_common_setsockopt, /* IP_SOL IP_OPTION is a problem */
 	.getsockopt	   = sock_common_getsockopt,
 	.sendmsg	   = inet_sendmsg,
-	.recvmsg	   = sock_common_recvmsg,
+	.recvmsg	   = inet_recvmsg,
 	.mmap		   = sock_no_mmap,
 	.sendpage	   = sock_no_sendpage,
 #ifdef CONFIG_COMPAT
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] sctp: use inet_recvmsg to support sctp RFS well
  2016-07-22 13:25 [PATCH net-next] sctp: use inet_recvmsg to support sctp RFS well Xin Long
@ 2016-07-22 13:34 ` Marcelo Ricardo Leitner
  2016-07-25 17:56 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Ricardo Leitner @ 2016-07-22 13:34 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, linux-sctp, Vlad Yasevich, daniel, davem

On Fri, Jul 22, 2016 at 09:25:42PM +0800, Xin Long wrote:
> Commit 486bdee0134c ("sctp: add support for RPS and RFS")
> saves skb->hash into sk->sk_rxhash so that the inet_* can
> record it to flow table.
> 
> But sctp uses sock_common_recvmsg as .recvmsg instead
> of inet_recvmsg, sock_common_recvmsg doesn't invoke
> sock_rps_record_flow to record 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.xin@gmail.com>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

Thanks

> ---
>  net/sctp/ipv6.c     | 2 +-
>  net/sctp/protocol.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
> index ae6f1a2..98c383c 100644
> --- a/net/sctp/ipv6.c
> +++ b/net/sctp/ipv6.c
> @@ -954,7 +954,7 @@ static const struct proto_ops inet6_seqpacket_ops = {
>  	.setsockopt	   = sock_common_setsockopt,
>  	.getsockopt	   = sock_common_getsockopt,
>  	.sendmsg	   = inet_sendmsg,
> -	.recvmsg	   = sock_common_recvmsg,
> +	.recvmsg	   = inet_recvmsg,
>  	.mmap		   = sock_no_mmap,
>  #ifdef CONFIG_COMPAT
>  	.compat_setsockopt = compat_sock_common_setsockopt,
> diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
> index 1adb927..7b523e3 100644
> --- a/net/sctp/protocol.c
> +++ b/net/sctp/protocol.c
> @@ -1028,7 +1028,7 @@ static const struct proto_ops inet_seqpacket_ops = {
>  	.setsockopt	   = sock_common_setsockopt, /* IP_SOL IP_OPTION is a problem */
>  	.getsockopt	   = sock_common_getsockopt,
>  	.sendmsg	   = inet_sendmsg,
> -	.recvmsg	   = sock_common_recvmsg,
> +	.recvmsg	   = inet_recvmsg,
>  	.mmap		   = sock_no_mmap,
>  	.sendpage	   = sock_no_sendpage,
>  #ifdef CONFIG_COMPAT
> -- 
> 2.1.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] sctp: use inet_recvmsg to support sctp RFS well
  2016-07-22 13:25 [PATCH net-next] sctp: use inet_recvmsg to support sctp RFS well Xin Long
  2016-07-22 13:34 ` Marcelo Ricardo Leitner
@ 2016-07-25 17:56 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-07-25 17:56 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, vyasevich, daniel

From: Xin Long <lucien.xin@gmail.com>
Date: Fri, 22 Jul 2016 21:25:42 +0800

> Commit 486bdee0134c ("sctp: add support for RPS and RFS")
> saves skb->hash into sk->sk_rxhash so that the inet_* can
> record it to flow table.
> 
> But sctp uses sock_common_recvmsg as .recvmsg instead
> of inet_recvmsg, sock_common_recvmsg doesn't invoke
> sock_rps_record_flow to record 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.xin@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-25 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-22 13:25 [PATCH net-next] sctp: use inet_recvmsg to support sctp RFS well Xin Long
2016-07-22 13:34 ` Marcelo Ricardo Leitner
2016-07-25 17:56 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).