-
-static int
-test_ring_ethdev_create(void)
-{
- int retval;
- printf("Testing ring pmd create\n");
-
- retval = rte_eth_from_rings(NULL, 0, NULL, 0, SOCKET0);
- if (retval < 0) {
- printf("Failure, failed to create zero-sized RXTX ring pmd\n");
- return -1;
- }
-
- retval = rte_eth_from_rings(NULL, 0, NULL, 0, RTE_MAX_NUMA_NODES);
- if (retval >= 0) {
- printf("Failure, can create ring pmd on socket %d\n", RTE_MAX_NUMA_NODES);
- return -1;
- }
-
- retval = rte_eth_from_rings(NULL, 1, &r2, 1, SOCKET0);
- if (retval >= 0) {
- printf("Failure, can create pmd with null rx rings\n");
- return -1;
- }
-
- retval = rte_eth_from_rings(r1, 1, NULL, 1, SOCKET0);
- if (retval >= 0) {
- printf("Failure, can create pmd with null tx rings\n");
- return -1;
- }
-
- retval = rte_eth_from_rings(&nullring, 1, r1, 2, SOCKET0);
- if (retval < 0) {
- printf("Failure, failed to create TX-only ring pmd\n");
- return -1;
- }
-
- retval = rte_eth_from_rings(r1, 1, &nullring, 1, SOCKET0);
- if (retval < 0) {
- printf("Failure, failed to create RX-only ring pmd\n");
- return -1;
- }
-
- retval = rte_eth_from_rings(&r2, 1, &r2, 1, SOCKET0);
- if (retval < 0) {
- printf("Failure, failed to create RXTX ring pmd\n");
- return -1;
- }
-
- return 0;
-}
-