Commit 00a3925f authored by Mike Hibler's avatar Mike Hibler

Minor cleanup

parent f5ea8480
...@@ -12,22 +12,28 @@ ...@@ -12,22 +12,28 @@
#include "log.h" #include "log.h"
/* /*
* We operate in terms of this blocksize (in bytes). * Ethernet MTU (1514) - eth header (14) - min UDP/IP (28) - BLOCK msg
* header (24).
*/ */
#define BLOCKSIZE 1024 #define MAXBLOCKSIZE 1448
/* /*
* Each chunk is this many blocks. * Images are broken into chunks which are the standalone unit of decompression
* Chunks are broken into blocks which are the unit of transmission
*/ */
#define CHUNKSIZE 1024 #define CHUNKSIZE 1024
#define BLOCKSIZE 1024
/* /*
* See if we can represent a bitmap of blocks in a single packet. * Make sure we can represent a bitmap of blocks in a single packet.
* If so, then allow partial request messages. * Make sure we can fit a block in a single ethernet MTU.
*/ */
#if (CHUNKSIZE%CHAR_BIT) != 0 || (CHUNKSIZE/CHAR_BIT) > 1450 #if (CHUNKSIZE%CHAR_BIT) != 0 || (CHUNKSIZE/CHAR_BIT) > MAXBLOCKSIZE
#error "Invalid chunk size" #error "Invalid chunk size"
#endif #endif
#if BLOCKSIZE > MAXBLOCKSIZE
#error "Invalid block size"
#endif
/* /*
* Chunk buffers and output write buffers constitute most of the memory * Chunk buffers and output write buffers constitute most of the memory
......
...@@ -1079,8 +1079,8 @@ calcburst(void) ...@@ -1079,8 +1079,8 @@ calcburst(void)
bursts = 0; bursts = 0;
} }
#define LINK_OVERHEAD (14 + 20) /* ethernet (hdr + preamble + gap) */ #define LINK_OVERHEAD (14+4+8+12) /* ethernet (hdr+CRC+preamble+gap) */
#define IP_OVERHEAD (20 + 8) /* UDP + IP hdrs */ #define IP_OVERHEAD (20+8) /* IP + UDP hdrs */
/* /*
* Compute the approximate send rate. Due to typically coarse grained * Compute the approximate send rate. Due to typically coarse grained
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment