All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/3] Clean up some NFS issues not related to v3 support
@ 2016-08-15 19:42 Joe Hershberger
  2016-08-15 19:42 ` [U-Boot] [PATCH 1/3] net: Stop including NFS overhead in defragment max Joe Hershberger
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Joe Hershberger @ 2016-08-15 19:42 UTC (permalink / raw)
  To: u-boot

There were a few issues with related to NFS that existed previously.
Clean those up before adding v3 support.


Joe Hershberger (3):
  net: Stop including NFS overhead in defragment max
  net: nfs: Remove separate buffer for default name
  net: nfs: Remove unused define

 net/net.c | 10 +---------
 net/nfs.c |  4 +---
 net/nfs.h |  2 --
 3 files changed, 2 insertions(+), 14 deletions(-)

-- 
1.7.11.5

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

* [U-Boot] [PATCH 1/3] net: Stop including NFS overhead in defragment max
  2016-08-15 19:42 [U-Boot] [PATCH 0/3] Clean up some NFS issues not related to v3 support Joe Hershberger
@ 2016-08-15 19:42 ` Joe Hershberger
  2016-08-23  2:28   ` [U-Boot] " Joe Hershberger
  2016-08-15 19:42 ` [U-Boot] [PATCH 2/3] net: nfs: Remove separate buffer for default name Joe Hershberger
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Joe Hershberger @ 2016-08-15 19:42 UTC (permalink / raw)
  To: u-boot

At least on bfin, this "specimen" is actually allocated in the BSS and
wastes lots of memory in already tight memory conditions.

Also, with the introduction of NFSv3 support, this waste got
substantially larger.

Just remove it. If a board needs a specific different defragment size,
that board can override this setting.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
---

 net/net.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/net/net.c b/net/net.c
index 1e1d23d..671d45d 100644
--- a/net/net.c
+++ b/net/net.c
@@ -834,15 +834,7 @@ int net_send_udp_packet(uchar *ether, struct in_addr dest, int dport, int sport,
 #ifndef CONFIG_NET_MAXDEFRAG
 #define CONFIG_NET_MAXDEFRAG 16384
 #endif
-/*
- * MAXDEFRAG, above, is chosen in the config file and  is real data
- * so we need to add the NFS overhead, which is more than TFTP.
- * To use sizeof in the internal unnamed structures, we need a real
- * instance (can't do "sizeof(struct rpc_t.u.reply))", unfortunately).
- * The compiler doesn't complain nor allocates the actual structure
- */
-static struct rpc_t rpc_specimen;
-#define IP_PKTSIZE (CONFIG_NET_MAXDEFRAG + sizeof(rpc_specimen.u.reply))
+#define IP_PKTSIZE (CONFIG_NET_MAXDEFRAG)
 
 #define IP_MAXUDP (IP_PKTSIZE - IP_HDR_SIZE)
 
-- 
1.7.11.5

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

* [U-Boot] [PATCH 2/3] net: nfs: Remove separate buffer for default name
  2016-08-15 19:42 [U-Boot] [PATCH 0/3] Clean up some NFS issues not related to v3 support Joe Hershberger
  2016-08-15 19:42 ` [U-Boot] [PATCH 1/3] net: Stop including NFS overhead in defragment max Joe Hershberger
@ 2016-08-15 19:42 ` Joe Hershberger
  2016-08-23  2:28   ` [U-Boot] " Joe Hershberger
  2016-08-15 19:42 ` [U-Boot] [PATCH 3/3] net: nfs: Remove unused define Joe Hershberger
  2016-08-19 18:54 ` [U-Boot] [PATCH 0/3] Clean up some NFS issues not related to v3 support Joe Hershberger
  3 siblings, 1 reply; 8+ messages in thread
From: Joe Hershberger @ 2016-08-15 19:42 UTC (permalink / raw)
  To: u-boot

There is no reason to store the default filename in a separate buffer
only to immediately copy it to the main name buffer. Just write it there
directly and remove the other buffer.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
---

 net/nfs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/nfs.c b/net/nfs.c
index 4a5a1ab..d7aeef9 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -65,7 +65,6 @@ static int nfs_state;
 #define STATE_READ_REQ			6
 #define STATE_READLINK_REQ		7
 
-static char default_filename[64];
 static char *nfs_filename;
 static char *nfs_path;
 static char nfs_path_buff[2048];
@@ -720,12 +719,11 @@ void nfs_start(void)
 	}
 
 	if (net_boot_file_name[0] == '\0') {
-		sprintf(default_filename, "/nfsroot/%02X%02X%02X%02X.img",
+		sprintf(nfs_path, "/nfsroot/%02X%02X%02X%02X.img",
 			net_ip.s_addr & 0xFF,
 			(net_ip.s_addr >>  8) & 0xFF,
 			(net_ip.s_addr >> 16) & 0xFF,
 			(net_ip.s_addr >> 24) & 0xFF);
-		strcpy(nfs_path, default_filename);
 
 		printf("*** Warning: no boot file name; using '%s'\n",
 		       nfs_path);
-- 
1.7.11.5

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

* [U-Boot] [PATCH 3/3] net: nfs: Remove unused define
  2016-08-15 19:42 [U-Boot] [PATCH 0/3] Clean up some NFS issues not related to v3 support Joe Hershberger
  2016-08-15 19:42 ` [U-Boot] [PATCH 1/3] net: Stop including NFS overhead in defragment max Joe Hershberger
  2016-08-15 19:42 ` [U-Boot] [PATCH 2/3] net: nfs: Remove separate buffer for default name Joe Hershberger
@ 2016-08-15 19:42 ` Joe Hershberger
  2016-08-23  2:28   ` [U-Boot] " Joe Hershberger
  2016-08-19 18:54 ` [U-Boot] [PATCH 0/3] Clean up some NFS issues not related to v3 support Joe Hershberger
  3 siblings, 1 reply; 8+ messages in thread
From: Joe Hershberger @ 2016-08-15 19:42 UTC (permalink / raw)
  To: u-boot

Unreferenced, so remove the noise.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

---

 net/nfs.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/nfs.h b/net/nfs.h
index d69b422..2a1f4db 100644
--- a/net/nfs.h
+++ b/net/nfs.h
@@ -44,8 +44,6 @@
 #define NFS_READ_SIZE 1024 /* biggest power of two that fits Ether frame */
 #endif
 
-#define NFS_MAXLINKDEPTH 16
-
 struct rpc_t {
 	union {
 		uint8_t data[2048];
-- 
1.7.11.5

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

* [U-Boot] [PATCH 0/3] Clean up some NFS issues not related to v3 support
  2016-08-15 19:42 [U-Boot] [PATCH 0/3] Clean up some NFS issues not related to v3 support Joe Hershberger
                   ` (2 preceding siblings ...)
  2016-08-15 19:42 ` [U-Boot] [PATCH 3/3] net: nfs: Remove unused define Joe Hershberger
@ 2016-08-19 18:54 ` Joe Hershberger
  3 siblings, 0 replies; 8+ messages in thread
From: Joe Hershberger @ 2016-08-19 18:54 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 15, 2016 at 2:42 PM, Joe Hershberger <joe.hershberger@ni.com> wrote:
> There were a few issues with related to NFS that existed previously.
> Clean those up before adding v3 support.
>
>
> Joe Hershberger (3):
>   net: Stop including NFS overhead in defragment max
>   net: nfs: Remove separate buffer for default name
>   net: nfs: Remove unused define

Barring any comments on this, I'm going to pull it in next week.

Thanks,
-Joe

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

* [U-Boot] net: Stop including NFS overhead in defragment max
  2016-08-15 19:42 ` [U-Boot] [PATCH 1/3] net: Stop including NFS overhead in defragment max Joe Hershberger
@ 2016-08-23  2:28   ` Joe Hershberger
  0 siblings, 0 replies; 8+ messages in thread
From: Joe Hershberger @ 2016-08-23  2:28 UTC (permalink / raw)
  To: u-boot

Hi Joe,

https://patchwork.ozlabs.org/patch/659396/ was applied to u-boot-net.git.

Thanks!
-Joe

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

* [U-Boot] net: nfs: Remove separate buffer for default name
  2016-08-15 19:42 ` [U-Boot] [PATCH 2/3] net: nfs: Remove separate buffer for default name Joe Hershberger
@ 2016-08-23  2:28   ` Joe Hershberger
  0 siblings, 0 replies; 8+ messages in thread
From: Joe Hershberger @ 2016-08-23  2:28 UTC (permalink / raw)
  To: u-boot

Hi Joe,

https://patchwork.ozlabs.org/patch/659394/ was applied to u-boot-net.git.

Thanks!
-Joe

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

* [U-Boot] net: nfs: Remove unused define
  2016-08-15 19:42 ` [U-Boot] [PATCH 3/3] net: nfs: Remove unused define Joe Hershberger
@ 2016-08-23  2:28   ` Joe Hershberger
  0 siblings, 0 replies; 8+ messages in thread
From: Joe Hershberger @ 2016-08-23  2:28 UTC (permalink / raw)
  To: u-boot

Hi Joe,

https://patchwork.ozlabs.org/patch/659395/ was applied to u-boot-net.git.

Thanks!
-Joe

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

end of thread, other threads:[~2016-08-23  2:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-15 19:42 [U-Boot] [PATCH 0/3] Clean up some NFS issues not related to v3 support Joe Hershberger
2016-08-15 19:42 ` [U-Boot] [PATCH 1/3] net: Stop including NFS overhead in defragment max Joe Hershberger
2016-08-23  2:28   ` [U-Boot] " Joe Hershberger
2016-08-15 19:42 ` [U-Boot] [PATCH 2/3] net: nfs: Remove separate buffer for default name Joe Hershberger
2016-08-23  2:28   ` [U-Boot] " Joe Hershberger
2016-08-15 19:42 ` [U-Boot] [PATCH 3/3] net: nfs: Remove unused define Joe Hershberger
2016-08-23  2:28   ` [U-Boot] " Joe Hershberger
2016-08-19 18:54 ` [U-Boot] [PATCH 0/3] Clean up some NFS issues not related to v3 support Joe Hershberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.