[U-Boot] [PATCH 0/3] Clean up some NFS issues not related to v3 support

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(-)

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)


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);


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];


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
participants (2)
-
Joe Hershberger
-
Joe Hershberger