git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/bnxt: fix null dereference in session cleanup
[dpdk.git]
/
app
/
test
/
test_reorder.c
diff --git
a/app/test/test_reorder.c
b/app/test/test_reorder.c
index
1c4226d
..
f0714a5
100644
(file)
--- a/
app/test/test_reorder.c
+++ b/
app/test/test_reorder.c
@@
-2,6
+2,8
@@
* Copyright(c) 2010-2014 Intel Corporation
*/
* Copyright(c) 2010-2014 Intel Corporation
*/
+#include "test.h"
+
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
@@
-9,12
+11,20
@@
#include <rte_cycles.h>
#include <rte_errno.h>
#include <rte_mbuf.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 <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)
#define BURST 32
#define REORDER_BUFFER_SIZE 16384
#define NUM_MBUFS (2*REORDER_BUFFER_SIZE)
@@
-208,8
+218,7
@@
test_reorder_insert(void)
exit:
rte_reorder_free(b);
for (i = 0; i < num_bufs; i++) {
exit:
rte_reorder_free(b);
for (i = 0; i < num_bufs; i++) {
- if (bufs[i] != NULL)
- rte_pktmbuf_free(bufs[i]);
+ rte_pktmbuf_free(bufs[i]);
}
return ret;
}
}
return ret;
}
@@
-268,8
+277,7
@@
test_reorder_drain(void)
ret = -1;
goto exit;
}
ret = -1;
goto exit;
}
- if (robufs[0] != NULL)
- rte_pktmbuf_free(robufs[0]);
+ rte_pktmbuf_free(robufs[0]);
/* Insert more packets
* RB[] = {NULL, NULL, NULL, NULL}
/* Insert more packets
* RB[] = {NULL, NULL, NULL, NULL}
@@
-303,8
+311,7
@@
test_reorder_drain(void)
goto exit;
}
for (i = 0; i < 3; i++) {
goto exit;
}
for (i = 0; i < 3; i++) {
- if (robufs[i] != NULL)
- rte_pktmbuf_free(robufs[i]);
+ rte_pktmbuf_free(robufs[i]);
}
/*
}
/*
@@
-322,10
+329,8
@@
test_reorder_drain(void)
exit:
rte_reorder_free(b);
for (i = 0; i < num_bufs; i++) {
exit:
rte_reorder_free(b);
for (i = 0; i < num_bufs; i++) {
- if (bufs[i] != NULL)
- rte_pktmbuf_free(bufs[i]);
- if (robufs[i] != NULL)
- rte_pktmbuf_free(robufs[i]);
+ rte_pktmbuf_free(bufs[i]);
+ rte_pktmbuf_free(robufs[i]);
}
return ret;
}
}
return ret;
}
@@
-390,4
+395,6
@@
test_reorder(void)
return unit_test_suite_runner(&reorder_test_suite);
}
return unit_test_suite_runner(&reorder_test_suite);
}
+#endif /* !RTE_EXEC_ENV_WINDOWS */
+
REGISTER_TEST_COMMAND(reorder_autotest, test_reorder);
REGISTER_TEST_COMMAND(reorder_autotest, test_reorder);