public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: Make the netconsole buffer size configurable
@ 2012-07-24 20:10 Joe Hershberger
  2012-07-25 16:07 ` Mike Frysinger
  2012-07-31 16:09 ` [U-Boot] [PATCH v2] " Joe Hershberger
  0 siblings, 2 replies; 4+ messages in thread
From: Joe Hershberger @ 2012-07-24 20:10 UTC (permalink / raw)
  To: u-boot

Allow a board to configure a larger buffer for netconsole, but leave
the default.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
---
 doc/README.NetConsole    |    2 ++
 drivers/net/netconsole.c |   10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/doc/README.NetConsole b/doc/README.NetConsole
index c8bcb90..73543e5 100644
--- a/doc/README.NetConsole
+++ b/doc/README.NetConsole
@@ -6,6 +6,8 @@ serial and network input/output devices by adjusting the 'stdin' and
 set either of these variables to "nc". Input and output can be
 switched independently.
 
+CONFIG_NETCONSOLE_BUFFER_SIZE - Override the default buffer size
+
 We use an environment variable 'ncip' to set the IP address and the
 port of the destination. The format is <ip_addr>:<port>. If <port> is
 omitted, the value of 6666 is used. If the env var doesn't exist, the
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 14243b8..6b4390e 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -28,7 +28,13 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static char input_buffer[512];
+#ifdef CONFIG_NETCONSOLE_BUFFER_SIZE
+#define BUFFER_SIZE CONFIG_NETCONSOLE_BUFFER_SIZE
+#else
+#define BUFFER_SIZE 512
+#endif
+
+static char input_buffer[BUFFER_SIZE];
 static int input_size; /* char count in input buffer */
 static int input_offset; /* offset to valid chars in input buffer */
 static int input_recursion;
@@ -203,7 +209,7 @@ static void nc_puts(const char *s)
 
 	len = strlen(s);
 	while (len) {
-		int send_len = min(len, 512);
+		int send_len = min(len, BUFFER_SIZE);
 		nc_send_packet(s, send_len);
 		len -= send_len;
 		s += send_len;
-- 
1.6.0.2

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

* [U-Boot] [PATCH] net: Make the netconsole buffer size configurable
  2012-07-24 20:10 [U-Boot] [PATCH] net: Make the netconsole buffer size configurable Joe Hershberger
@ 2012-07-25 16:07 ` Mike Frysinger
  2012-07-31 16:09 ` [U-Boot] [PATCH v2] " Joe Hershberger
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2012-07-25 16:07 UTC (permalink / raw)
  To: u-boot

On Tuesday 24 July 2012 16:10:56 Joe Hershberger wrote:
> --- a/drivers/net/netconsole.c
> +++ b/drivers/net/netconsole.c
> 
> -static char input_buffer[512];
> +#ifdef CONFIG_NETCONSOLE_BUFFER_SIZE
> +#define BUFFER_SIZE CONFIG_NETCONSOLE_BUFFER_SIZE
> +#else
> +#define BUFFER_SIZE 512
> +#endif
> +
> +static char input_buffer[BUFFER_SIZE];

#ifndef CONFIG_NETCONSOLE_BUFFER_SIZE
# define CONFIG_NETCONSOLE_BUFFER_SIZE 512
#endif
static char input_buffer[CONFIG_NETCONSOLE_BUFFER_SIZE];

>  	while (len) {
> -		int send_len = min(len, 512);
> +		int send_len = min(len, BUFFER_SIZE);

	int send_len = min(len, sizeof(input_buffer));
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120725/2c9e5b61/attachment.pgp>

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

* [U-Boot] [PATCH v2] net: Make the netconsole buffer size configurable
  2012-07-24 20:10 [U-Boot] [PATCH] net: Make the netconsole buffer size configurable Joe Hershberger
  2012-07-25 16:07 ` Mike Frysinger
@ 2012-07-31 16:09 ` Joe Hershberger
  2012-08-01 16:33   ` Mike Frysinger
  1 sibling, 1 reply; 4+ messages in thread
From: Joe Hershberger @ 2012-07-31 16:09 UTC (permalink / raw)
  To: u-boot

Allow a board to configure a larger buffer for netconsole, but leave
the default.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Mike Frysinger <vapier@gentoo.org>
---
 doc/README.NetConsole    |    2 ++
 drivers/net/netconsole.c |    8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/doc/README.NetConsole b/doc/README.NetConsole
index c8bcb90..73543e5 100644
--- a/doc/README.NetConsole
+++ b/doc/README.NetConsole
@@ -6,6 +6,8 @@ serial and network input/output devices by adjusting the 'stdin' and
 set either of these variables to "nc". Input and output can be
 switched independently.
 
+CONFIG_NETCONSOLE_BUFFER_SIZE - Override the default buffer size
+
 We use an environment variable 'ncip' to set the IP address and the
 port of the destination. The format is <ip_addr>:<port>. If <port> is
 omitted, the value of 6666 is used. If the env var doesn't exist, the
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 14243b8..c68ca4f 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -28,7 +28,11 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static char input_buffer[512];
+#ifndef CONFIG_NETCONSOLE_BUFFER_SIZE
+#define CONFIG_NETCONSOLE_BUFFER_SIZE 512
+#endif
+
+static char input_buffer[CONFIG_NETCONSOLE_BUFFER_SIZE];
 static int input_size; /* char count in input buffer */
 static int input_offset; /* offset to valid chars in input buffer */
 static int input_recursion;
@@ -203,7 +207,7 @@ static void nc_puts(const char *s)
 
 	len = strlen(s);
 	while (len) {
-		int send_len = min(len, 512);
+		int send_len = min(len, sizeof(input_buffer));
 		nc_send_packet(s, send_len);
 		len -= send_len;
 		s += send_len;
-- 
1.6.0.2

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

* [U-Boot] [PATCH v2] net: Make the netconsole buffer size configurable
  2012-07-31 16:09 ` [U-Boot] [PATCH v2] " Joe Hershberger
@ 2012-08-01 16:33   ` Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2012-08-01 16:33 UTC (permalink / raw)
  To: u-boot

Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120801/8d7fd216/attachment.pgp>

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

end of thread, other threads:[~2012-08-01 16:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-24 20:10 [U-Boot] [PATCH] net: Make the netconsole buffer size configurable Joe Hershberger
2012-07-25 16:07 ` Mike Frysinger
2012-07-31 16:09 ` [U-Boot] [PATCH v2] " Joe Hershberger
2012-08-01 16:33   ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox