/*-
* BSD LICENSE
- *
+ *
* Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
struct rte_eth_link link;
memset(&null_conf, 0, sizeof(struct rte_eth_conf));
-
+
if ((TX_PORT >= RTE_MAX_ETHPORTS) || (RX_PORT >= RTE_MAX_ETHPORTS)\
|| (RXTX_PORT >= RTE_MAX_ETHPORTS)) {
printf(" TX/RX port exceed max eth ports\n");
printf("Testing ring PMD stats reset\n");
rte_eth_stats_reset(RXTX_PORT);
-
+
/* check stats of RXTX port, should all be zero */
rte_eth_stats_get(RXTX_PORT, &stats);
if (stats.ipackets != 0 || stats.opackets != 0 ||
}
rte_eth_stats_reset(RXTX_PORT);
-
+
/* check stats of RXTX port, should all be zero */
rte_eth_stats_get(RXTX_PORT, &stats);
if (stats.ipackets != 0 || stats.opackets != 0 ||
return 0;
}
-static int
+static int
test_pmd_ring_init(void)
{
struct rte_eth_stats stats;
return -1;
}
- if ((rte_eth_rx_queue_setup(RXTX_PORT4, 0, RING_SIZE, SOCKET0, NULL, mp) < 0)
+ if ((rte_eth_rx_queue_setup(RXTX_PORT4, 0, RING_SIZE, SOCKET0, NULL, mp) < 0)
|| (rte_eth_rx_queue_setup(RXTX_PORT5, 0, RING_SIZE, SOCKET0, NULL, mp) < 0)) {
printf("RX queue setup failed\n");
return -1;
}
- if ((rte_eth_dev_start(RXTX_PORT4) < 0)
+ if ((rte_eth_dev_start(RXTX_PORT4) < 0)
|| (rte_eth_dev_start(RXTX_PORT5) < 0)) {
printf("Error starting RXTX port\n");
return -1;
return -1;
}
- if ((rte_eth_rx_queue_setup(RXTX_PORT4, 0, RING_SIZE, SOCKET0, NULL, mp) < 0)
+ if ((rte_eth_rx_queue_setup(RXTX_PORT4, 0, RING_SIZE, SOCKET0, NULL, mp) < 0)
|| (rte_eth_rx_queue_setup(RXTX_PORT5, 0, RING_SIZE, SOCKET0, NULL, mp) < 0)) {
printf("RX queue setup failed\n");
return -1;
}
- if ((rte_eth_dev_start(RXTX_PORT4) < 0)
+ if ((rte_eth_dev_start(RXTX_PORT4) < 0)
|| (rte_eth_dev_start(RXTX_PORT5) < 0)) {
printf("Error starting RXTX port\n");
return -1;
}
-
+
rte_eth_stats_reset(RXTX_PORT4);
rte_eth_stats_reset(RXTX_PORT5);
rte_eth_dev_stop(RXTX_PORT4);
rte_eth_dev_stop(RXTX_PORT5);
-
+
return 0;
}
return -1;
if (test_pmd_ring_pair_attach() < 0)
- return -1;
+ return -1;
return 0;
}