* Copyright(c) 2010-2014 Intel Corporation
*/
+#include "test.h"
+
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <rte_cycles.h>
#include <rte_errno.h>
#include <rte_mbuf.h>
+
+#ifdef RTE_EXEC_ENV_WINDOWS
+static int
+test_reorder(void)
+{
+ printf("reorder not supported on Windows, skipping test\n");
+ return TEST_SKIPPED;
+}
+#else
+
#include <rte_reorder.h>
#include <rte_lcore.h>
#include <rte_malloc.h>
-#include "test.h"
-
#define BURST 32
#define REORDER_BUFFER_SIZE 16384
#define NUM_MBUFS (2*REORDER_BUFFER_SIZE)
for (i = 0; i < num_bufs; i++) {
bufs[i] = rte_pktmbuf_alloc(p);
TEST_ASSERT_NOT_NULL(bufs[i], "Packet allocation failed\n");
- bufs[i]->seqn = i;
+ *rte_reorder_seqn(bufs[i]) = i;
}
/* This should fill up order buffer:
bufs[4] = NULL;
/* early packet from current sequence window - full ready buffer */
- bufs[5]->seqn = 2 * size;
+ *rte_reorder_seqn(bufs[5]) = 2 * size;
ret = rte_reorder_insert(b, bufs[5]);
if (!((ret == -1) && (rte_errno == ENOSPC))) {
printf("%s:%d: No error inserting early packet with full ready buffer\n",
bufs[5] = NULL;
/* late packet */
- bufs[6]->seqn = 3 * size;
+ *rte_reorder_seqn(bufs[6]) = 3 * size;
ret = rte_reorder_insert(b, bufs[6]);
if (!((ret == -1) && (rte_errno == ERANGE))) {
printf("%s:%d: No error inserting late packet with seqn:"
for (i = 0; i < num_bufs; i++) {
bufs[i] = rte_pktmbuf_alloc(p);
TEST_ASSERT_NOT_NULL(bufs[i], "Packet allocation failed\n");
- bufs[i]->seqn = i;
+ *rte_reorder_seqn(bufs[i]) = i;
}
/* Insert packet with seqn 1:
return unit_test_suite_runner(&reorder_test_suite);
}
+#endif /* !RTE_EXEC_ENV_WINDOWS */
+
REGISTER_TEST_COMMAND(reorder_autotest, test_reorder);