netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr
@ 2014-10-30  9:29 Michele Baldessari
  2014-10-30  9:29 ` [net-next 2/2] sctp: replace seq_printf with seq_puts Michele Baldessari
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Michele Baldessari @ 2014-10-30  9:29 UTC (permalink / raw)
  To: Vlad Yasevich, Neil Horman
  Cc: linux-sctp, netdev, David S. Miller, Michele Baldessari

It is often quite helpful to be able to know the state of a transport
outside of the application itself (for troubleshooting purposes or for
monitoring purposes). Add it under /proc/net/sctp/remaddr.

Signed-off-by: Michele Baldessari <michele@acksyn.org>
---
 net/sctp/proc.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 34229ee7f379..bfb242af06ab 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -417,7 +417,7 @@ static void *sctp_remaddr_seq_start(struct seq_file *seq, loff_t *pos)
 
 	if (*pos == 0)
 		seq_printf(seq, "ADDR ASSOC_ID HB_ACT RTO MAX_PATH_RTX "
-				"REM_ADDR_RTX  START\n");
+				"REM_ADDR_RTX START STATE\n");
 
 	return (void *)pos;
 }
@@ -497,7 +497,13 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
 			 * currently implemented, but we can record it with a
 			 * jiffies marker in a subsequent patch
 			 */
-			seq_printf(seq, "0");
+			seq_printf(seq, "0 ");
+
+			/*
+			 * The current state of this destination. I.e.
+			 * SCTP_ACTIVE, SCTP_INACTIVE, ...
+			 */
+			seq_printf(seq, "%d", tsp->state);
 
 			seq_printf(seq, "\n");
 		}
-- 
2.1.0

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

* [net-next 2/2] sctp: replace seq_printf with seq_puts
  2014-10-30  9:29 [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr Michele Baldessari
@ 2014-10-30  9:29 ` Michele Baldessari
  2014-10-30 10:26   ` Neil Horman
  2014-10-30 23:40   ` David Miller
  2014-10-30 10:24 ` [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr Neil Horman
  2014-10-30 23:40 ` David Miller
  2 siblings, 2 replies; 6+ messages in thread
From: Michele Baldessari @ 2014-10-30  9:29 UTC (permalink / raw)
  To: Vlad Yasevich, Neil Horman
  Cc: linux-sctp, netdev, David S. Miller, Michele Baldessari

Fixes checkpatch warning:
"WARNING: Prefer seq_puts to seq_printf"

Signed-off-by: Michele Baldessari <michele@acksyn.org>
---
 net/sctp/proc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index bfb242af06ab..0697eda5aed8 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -490,14 +490,14 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
 			 * Note: We don't have a way to tally this at the moment
 			 * so lets just leave it as zero for the moment
 			 */
-			seq_printf(seq, "0 ");
+			seq_puts(seq, "0 ");
 
 			/*
 			 * remote address start time (START).  This is also not
 			 * currently implemented, but we can record it with a
 			 * jiffies marker in a subsequent patch
 			 */
-			seq_printf(seq, "0 ");
+			seq_puts(seq, "0 ");
 
 			/*
 			 * The current state of this destination. I.e.
-- 
2.1.0

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

* Re: [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr
  2014-10-30  9:29 [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr Michele Baldessari
  2014-10-30  9:29 ` [net-next 2/2] sctp: replace seq_printf with seq_puts Michele Baldessari
@ 2014-10-30 10:24 ` Neil Horman
  2014-10-30 23:40 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Neil Horman @ 2014-10-30 10:24 UTC (permalink / raw)
  To: Michele Baldessari; +Cc: Vlad Yasevich, linux-sctp, netdev, David S. Miller

On Thu, Oct 30, 2014 at 10:29:15AM +0100, Michele Baldessari wrote:
> It is often quite helpful to be able to know the state of a transport
> outside of the application itself (for troubleshooting purposes or for
> monitoring purposes). Add it under /proc/net/sctp/remaddr.
> 
> Signed-off-by: Michele Baldessari <michele@acksyn.org>
> ---
>  net/sctp/proc.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/proc.c b/net/sctp/proc.c
> index 34229ee7f379..bfb242af06ab 100644
> --- a/net/sctp/proc.c
> +++ b/net/sctp/proc.c
> @@ -417,7 +417,7 @@ static void *sctp_remaddr_seq_start(struct seq_file *seq, loff_t *pos)
>  
>  	if (*pos == 0)
>  		seq_printf(seq, "ADDR ASSOC_ID HB_ACT RTO MAX_PATH_RTX "
> -				"REM_ADDR_RTX  START\n");
> +				"REM_ADDR_RTX START STATE\n");
>  
>  	return (void *)pos;
>  }
> @@ -497,7 +497,13 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
>  			 * currently implemented, but we can record it with a
>  			 * jiffies marker in a subsequent patch
>  			 */
> -			seq_printf(seq, "0");
> +			seq_printf(seq, "0 ");
> +
> +			/*
> +			 * The current state of this destination. I.e.
> +			 * SCTP_ACTIVE, SCTP_INACTIVE, ...
> +			 */
> +			seq_printf(seq, "%d", tsp->state);
>  
>  			seq_printf(seq, "\n");
>  		}
> -- 
> 2.1.0
> 
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>

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

* Re: [net-next 2/2] sctp: replace seq_printf with seq_puts
  2014-10-30  9:29 ` [net-next 2/2] sctp: replace seq_printf with seq_puts Michele Baldessari
@ 2014-10-30 10:26   ` Neil Horman
  2014-10-30 23:40   ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Neil Horman @ 2014-10-30 10:26 UTC (permalink / raw)
  To: Michele Baldessari; +Cc: Vlad Yasevich, linux-sctp, netdev, David S. Miller

On Thu, Oct 30, 2014 at 10:29:16AM +0100, Michele Baldessari wrote:
> Fixes checkpatch warning:
> "WARNING: Prefer seq_puts to seq_printf"
> 
> Signed-off-by: Michele Baldessari <michele@acksyn.org>
> ---
>  net/sctp/proc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/proc.c b/net/sctp/proc.c
> index bfb242af06ab..0697eda5aed8 100644
> --- a/net/sctp/proc.c
> +++ b/net/sctp/proc.c
> @@ -490,14 +490,14 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
>  			 * Note: We don't have a way to tally this at the moment
>  			 * so lets just leave it as zero for the moment
>  			 */
> -			seq_printf(seq, "0 ");
> +			seq_puts(seq, "0 ");
>  
>  			/*
>  			 * remote address start time (START).  This is also not
>  			 * currently implemented, but we can record it with a
>  			 * jiffies marker in a subsequent patch
>  			 */
> -			seq_printf(seq, "0 ");
> +			seq_puts(seq, "0 ");
>  
>  			/*
>  			 * The current state of this destination. I.e.
> -- 
> 2.1.0
> 
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>

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

* Re: [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr
  2014-10-30  9:29 [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr Michele Baldessari
  2014-10-30  9:29 ` [net-next 2/2] sctp: replace seq_printf with seq_puts Michele Baldessari
  2014-10-30 10:24 ` [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr Neil Horman
@ 2014-10-30 23:40 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-10-30 23:40 UTC (permalink / raw)
  To: michele; +Cc: vyasevich, nhorman, linux-sctp, netdev

From: Michele Baldessari <michele@acksyn.org>
Date: Thu, 30 Oct 2014 10:29:15 +0100

> It is often quite helpful to be able to know the state of a transport
> outside of the application itself (for troubleshooting purposes or for
> monitoring purposes). Add it under /proc/net/sctp/remaddr.
> 
> Signed-off-by: Michele Baldessari <michele@acksyn.org>

Applied.

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

* Re: [net-next 2/2] sctp: replace seq_printf with seq_puts
  2014-10-30  9:29 ` [net-next 2/2] sctp: replace seq_printf with seq_puts Michele Baldessari
  2014-10-30 10:26   ` Neil Horman
@ 2014-10-30 23:40   ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2014-10-30 23:40 UTC (permalink / raw)
  To: michele; +Cc: vyasevich, nhorman, linux-sctp, netdev

From: Michele Baldessari <michele@acksyn.org>
Date: Thu, 30 Oct 2014 10:29:16 +0100

> Fixes checkpatch warning:
> "WARNING: Prefer seq_puts to seq_printf"
> 
> Signed-off-by: Michele Baldessari <michele@acksyn.org>

Applied.

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

end of thread, other threads:[~2014-10-30 23:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-30  9:29 [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr Michele Baldessari
2014-10-30  9:29 ` [net-next 2/2] sctp: replace seq_printf with seq_puts Michele Baldessari
2014-10-30 10:26   ` Neil Horman
2014-10-30 23:40   ` David Miller
2014-10-30 10:24 ` [net-next 1/2] sctp: add transport state in /proc/net/sctp/remaddr Neil Horman
2014-10-30 23:40 ` 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).