bench: Fix an LFSR init issue and minor comments
authorAlex Pyrgiotis <apyrgio@grnet.gr>
Mon, 3 Jun 2013 10:35:48 +0000 (13:35 +0300)
committerFilippos Giannakos <philipgian@grnet.gr>
Thu, 18 Jul 2013 10:02:47 +0000 (13:02 +0300)
If bench is requested to issue only one request, the LFSR initialization
fails. Since LFSR is not needed in this case, we simply switch to
sequential pattern for this request.

xseg/peers/user/bench-xseg.c
xseg/peers/user/bench-xseg.h

index 02d80b7..e103a44 100644 (file)
@@ -353,6 +353,9 @@ reseed:
        }
        create_id(seed);
 
+       if (prefs->status->max == 1)
+               SET_FLAG(PATTERN, prefs->flags, PATTERN_SEQ);
+
        if (GET_FLAG(PATTERN, prefs->flags) == PATTERN_RAND) {
                prefs->lfsr = malloc(sizeof(struct bench_lfsr));
                if (!prefs->lfsr) {
index 6e70705..33b51f0 100644 (file)
@@ -59,7 +59,7 @@
 
 /*
  * Pattern type occupies 1st flag bit.
- * If 1, it's sequential, if 0, it's random.
+ * If 0, it's sequential, if 1, it's random.
  */
 #define PATTERN_FLAG_POS 0
 #define PATTERN_BITMASK 1
@@ -87,7 +87,7 @@
 
 /* Progress bar option occupies 6th flag bit */
 #define PROGRESS_FLAG_POS 5
-#define PROGRESS_BITMASK 1     /* i.e. "11" in binary form */
+#define PROGRESS_BITMASK 1
 #define PROGRESS_NO 0
 #define PROGRESS_YES 1