test/eventdev: fix reconfigure values
authorJerin Jacob <jerin.jacob@caviumnetworks.com>
Fri, 3 Mar 2017 17:27:44 +0000 (22:57 +0530)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Tue, 4 Apr 2017 17:19:25 +0000 (19:19 +0200)
Minimum value of nb_event_ports and/or nb_event_queues
should be one before reconfiguring the event device.

Fixes: f8f9d233ea0e ("test/eventdev: add unit tests")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
test/test/test_eventdev.c

index 042a446..e087af2 100644 (file)
@@ -244,8 +244,8 @@ test_eventdev_configure(void)
 
        /* re-configure */
        devconf_set_default_sane_values(&dev_conf, &info);
-       dev_conf.nb_event_ports = info.max_event_ports/2;
-       dev_conf.nb_event_queues = info.max_event_queues/2;
+       dev_conf.nb_event_ports = RTE_MAX(info.max_event_ports/2, 1);
+       dev_conf.nb_event_queues = RTE_MAX(info.max_event_queues/2, 1);
        ret = rte_event_dev_configure(TEST_DEV_ID, &dev_conf);
        TEST_ASSERT_SUCCESS(ret, "Failed to re configure eventdev");