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
fm10k: fix default mac/vlan in switch
[dpdk.git]
/
app
/
test
/
test_table_acl.c
diff --git
a/app/test/test_table_acl.c
b/app/test/test_table_acl.c
index
ad0e6f1
..
e4e9b9c
100644
(file)
--- a/
app/test/test_table_acl.c
+++ b/
app/test/test_table_acl.c
@@
-31,8
+31,6
@@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef RTE_LIBRTE_ACL
-
#include <rte_hexdump.h>
#include "test_table.h"
#include "test_table_acl.h"
#include <rte_hexdump.h>
#include "test_table.h"
#include "test_table_acl.h"
@@
-364,7
+362,7
@@
setup_acl_pipeline(void)
acl_params.n_rules = 1 << 5;
acl_params.n_rule_fields = DIM(ipv4_defs);
acl_params.n_rules = 1 << 5;
acl_params.n_rule_fields = DIM(ipv4_defs);
-
rte_
snprintf(acl_name, sizeof(acl_name), "ACL%d", i);
+ snprintf(acl_name, sizeof(acl_name), "ACL%d", i);
acl_params.name = acl_name;
memcpy(acl_params.field_format, ipv4_defs, sizeof(ipv4_defs));
acl_params.name = acl_name;
memcpy(acl_params.field_format, ipv4_defs, sizeof(ipv4_defs));
@@
-408,7
+406,7
@@
setup_acl_pipeline(void)
parser = parse_cb_ipv4_rule;
for (n = 1; n <= 5; n++) {
parser = parse_cb_ipv4_rule;
for (n = 1; n <= 5; n++) {
-
rte_
snprintf(line, sizeof(line), "%s", lines[n-1]);
+ snprintf(line, sizeof(line), "%s", lines[n-1]);
printf("PARSING [%s]\n", line);
ret = parser(line, &rule_params);
printf("PARSING [%s]\n", line);
ret = parser(line, &rule_params);
@@
-434,7
+432,7
@@
setup_acl_pipeline(void)
/* delete a few rules */
for (n = 2; n <= 3; n++) {
/* delete a few rules */
for (n = 2; n <= 3; n++) {
-
rte_
snprintf(line, sizeof(line), "%s", lines[n-1]);
+ snprintf(line, sizeof(line), "%s", lines[n-1]);
printf("PARSING [%s]\n", line);
ret = parser(line, &rule_params);
printf("PARSING [%s]\n", line);
ret = parser(line, &rule_params);
@@
-461,7
+459,7
@@
setup_acl_pipeline(void)
/* Try to add duplicates */
for (n = 1; n <= 5; n++) {
/* Try to add duplicates */
for (n = 1; n <= 5; n++) {
-
rte_
snprintf(line, sizeof(line), "%s", lines[n-1]);
+ snprintf(line, sizeof(line), "%s", lines[n-1]);
printf("PARSING [%s]\n", line);
ret = parser(line, &rule_params);
printf("PARSING [%s]\n", line);
ret = parser(line, &rule_params);
@@
-515,7
+513,12
@@
test_pipeline_single_filter(int expected_count)
struct rte_mbuf *mbuf;
mbuf = rte_pktmbuf_alloc(pool);
struct rte_mbuf *mbuf;
mbuf = rte_pktmbuf_alloc(pool);
- memset(mbuf->pkt.data, 0x00,
+ if (mbuf == NULL)
+ /* this will cause test failure after cleanup
+ * of already enqueued mbufs, as the mbuf
+ * counts won't match */
+ break;
+ memset(rte_pktmbuf_mtod(mbuf, char *), 0x00,
sizeof(struct ipv4_5tuple));
five_tuple.proto = j;
sizeof(struct ipv4_5tuple));
five_tuple.proto = j;
@@
-524,7
+527,7
@@
test_pipeline_single_filter(int expected_count)
five_tuple.port_src = rte_bswap16(100 + j);
five_tuple.port_dst = rte_bswap16(200 + j);
five_tuple.port_src = rte_bswap16(100 + j);
five_tuple.port_dst = rte_bswap16(200 + j);
- memcpy(
mbuf->pkt.data
, &five_tuple,
+ memcpy(
rte_pktmbuf_mtod(mbuf, char *)
, &five_tuple,
sizeof(struct ipv4_5tuple));
RTE_LOG(INFO, PIPELINE, "%s: Enqueue onto ring %d\n",
__func__, i);
sizeof(struct ipv4_5tuple));
RTE_LOG(INFO, PIPELINE, "%s: Enqueue onto ring %d\n",
__func__, i);
@@
-551,7
+554,8
@@
test_pipeline_single_filter(int expected_count)
printf("Got %d object(s) from ring %d!\n", ret, i);
for (j = 0; j < ret; j++) {
mbuf = (struct rte_mbuf *)objs[j];
printf("Got %d object(s) from ring %d!\n", ret, i);
for (j = 0; j < ret; j++) {
mbuf = (struct rte_mbuf *)objs[j];
- rte_hexdump(stdout, "mbuf", mbuf->pkt.data, 64);
+ rte_hexdump(stdout, "mbuf",
+ rte_pktmbuf_mtod(mbuf, char *), 64);
rte_pktmbuf_free(mbuf);
}
tx_count += ret;
rte_pktmbuf_free(mbuf);
}
tx_count += ret;
@@
-587,5
+591,3
@@
test_table_ACL(void)
return 0;
}
return 0;
}
-
-#endif