summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry van Haaren <harry.van.haaren@intel.com>2019-03-27 18:45:46 +0000
committerJerin Jacob <jerinj@marvell.com>2019-04-02 06:40:47 +0530
commitea7ce1fea821d4068a746658d55d89865d92b67c (patch)
tree889b29377bdedcc7b7253385b6fccdcd0cca4bf8
parent0f14193534a0fd684a2691f9b86a4655418f3c60 (diff)
downloaddpdk-next-eventdev-ea7ce1fea821d4068a746658d55d89865d92b67c.zip
dpdk-next-eventdev-ea7ce1fea821d4068a746658d55d89865d92b67c.tar.gz
dpdk-next-eventdev-ea7ce1fea821d4068a746658d55d89865d92b67c.tar.xz
event/sw: fix selftest enqueue return value checks
This patch fixes a number of instances of the same return value mis-check, where previously we checked for a negative return value as error, however the API returns an unsigned integer, so these return value checks are invalid. The rte_event_enqueue_burst() API returns the number of events enqueued, so in order to identify the error case, we must check for != the number of intended enqueues. Fixes: cd1a9e3eab55 ("test/eventdev: add SW tests for load balancing") Cc: stable@dpdk.org Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
-rw-r--r--drivers/event/sw/sw_evdev_selftest.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c
index d00d5de..38c21fa 100644
--- a/drivers/event/sw/sw_evdev_selftest.c
+++ b/drivers/event/sw/sw_evdev_selftest.c
@@ -385,7 +385,7 @@ run_prio_packet_test(struct test *t)
.mbuf = arp
};
err = rte_event_enqueue_burst(evdev, t->port[0], &ev, 1);
- if (err < 0) {
+ if (err != 1) {
printf("%d: error failed to enqueue\n", __LINE__);
return -1;
}
@@ -477,7 +477,7 @@ test_single_directed_packet(struct test *t)
/* generate pkt and enqueue */
err = rte_event_enqueue_burst(evdev, rx_enq, &ev, 1);
- if (err < 0) {
+ if (err != 1) {
printf("%d: error failed to enqueue\n", __LINE__);
return -1;
}
@@ -546,7 +546,7 @@ test_directed_forward_credits(struct test *t)
for (i = 0; i < 1000; i++) {
err = rte_event_enqueue_burst(evdev, 0, &ev, 1);
- if (err < 0) {
+ if (err != 1) {
printf("%d: error failed to enqueue\n", __LINE__);
return -1;
}
@@ -707,7 +707,7 @@ burst_packets(struct test *t)
};
/* generate pkt and enqueue */
err = rte_event_enqueue_burst(evdev, t->port[rx_port], &ev, 1);
- if (err < 0) {
+ if (err != 1) {
printf("%d: Failed to enqueue\n", __LINE__);
return -1;
}
@@ -795,7 +795,7 @@ abuse_inflights(struct test *t)
/* Enqueue op only */
err = rte_event_enqueue_burst(evdev, t->port[rx_enq], &release_ev, 1);
- if (err < 0) {
+ if (err != 1) {
printf("%d: Failed to enqueue\n", __LINE__);
return -1;
}
@@ -2026,7 +2026,7 @@ load_balancing(struct test *t)
};
/* generate pkt and enqueue */
err = rte_event_enqueue_burst(evdev, t->port[rx_enq], &ev, 1);
- if (err < 0) {
+ if (err != 1) {
printf("%d: Failed to enqueue\n", __LINE__);
return -1;
}
@@ -2125,7 +2125,7 @@ load_balancing_history(struct test *t)
}
arp->hash.rss = flows1[i];
err = rte_event_enqueue_burst(evdev, t->port[rx_enq], &ev, 1);
- if (err < 0) {
+ if (err != 1) {
printf("%d: Failed to enqueue\n", __LINE__);
return -1;
}
@@ -2175,7 +2175,7 @@ load_balancing_history(struct test *t)
arp->hash.rss = flows2[i];
err = rte_event_enqueue_burst(evdev, t->port[rx_enq], &ev, 1);
- if (err < 0) {
+ if (err != 1) {
printf("%d: Failed to enqueue\n", __LINE__);
return -1;
}
@@ -2285,7 +2285,7 @@ invalid_qid(struct test *t)
};
/* generate pkt and enqueue */
err = rte_event_enqueue_burst(evdev, t->port[rx_enq], &ev, 1);
- if (err < 0) {
+ if (err != 1) {
printf("%d: Failed to enqueue\n", __LINE__);
return -1;
}
@@ -2372,7 +2372,7 @@ single_packet(struct test *t)
arp->seqn = MAGIC_SEQN;
err = rte_event_enqueue_burst(evdev, t->port[rx_enq], &ev, 1);
- if (err < 0) {
+ if (err != 1) {
printf("%d: Failed to enqueue\n", __LINE__);
return -1;
}
@@ -2416,7 +2416,7 @@ single_packet(struct test *t)
rte_pktmbuf_free(ev.mbuf);
err = rte_event_enqueue_burst(evdev, t->port[wrk_enq], &release_ev, 1);
- if (err < 0) {
+ if (err != 1) {
printf("%d: Failed to enqueue\n", __LINE__);
return -1;
}