The return value of rte_eth_macaddr_get() was changed from void to int.
Update the usage of the functions according to the new return type.
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
if (ret < 0)
rte_exit(EXIT_FAILURE, "dev start failed\n");
if (ret < 0)
rte_exit(EXIT_FAILURE, "dev start failed\n");
- rte_eth_macaddr_get(port_id, &addr);
+ ret = rte_eth_macaddr_get(port_id, &addr);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE, "macaddr get failed\n");
+
printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8
" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n",
port_id,
printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8
" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n",
port_id,
/* Display the port MAC address. */
struct rte_ether_addr addr;
/* Display the port MAC address. */
struct rte_ether_addr addr;
- rte_eth_macaddr_get(port, &addr);
+ retval = rte_eth_macaddr_get(port, &addr);
+ if (retval < 0)
+ return retval;
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
(unsigned int)port,
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
(unsigned int)port,
/* Display the port MAC address. */
struct rte_ether_addr addr;
/* Display the port MAC address. */
struct rte_ether_addr addr;
- rte_eth_macaddr_get(port, &addr);
+ retval = rte_eth_macaddr_get(port, &addr);
+ if (retval < 0)
+ return retval;
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
(unsigned int)port,
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
(unsigned int)port,
mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] =
test_params->bonded_slave_count-1;
mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] =
test_params->bonded_slave_count-1;
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(
test_params->slave_port_ids[test_params->bonded_slave_count-1],
test_params->slave_port_ids[test_params->bonded_slave_count-1],
+ &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[test_params->bonded_slave_count-1]);
TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)),
"bonded port mac address not set to that of primary port\n");
TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)),
"bonded port mac address not set to that of primary port\n");
expected_mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = i;
/* Check primary slave MAC */
expected_mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = i;
/* Check primary slave MAC */
- rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[i]);
TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port mac address not set to that of primary port\n");
/* Check bonded MAC */
TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port mac address not set to that of primary port\n");
/* Check bonded MAC */
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&read_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port mac address not set to that of primary port\n");
TEST_ASSERT_SUCCESS(memcmp(&read_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port mac address not set to that of primary port\n");
/* Check other slaves MACs */
for (j = 0; j < 4; j++) {
if (j != i) {
/* Check other slaves MACs */
for (j = 0; j < 4; j++) {
if (j != i) {
- rte_eth_macaddr_get(test_params->slave_port_ids[j],
- &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[j],
+ &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[j]);
TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port mac address not set to that of primary "
TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port mac address not set to that of primary "
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)),
"bonded port mac address not set to that of primary port");
/* Check other slaves MACs */
for (i = 0; i < 4; i++) {
TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)),
"bonded port mac address not set to that of primary port");
/* Check other slaves MACs */
for (i = 0; i < 4; i++) {
- rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[i]);
TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port mac address not set to that of primary port");
TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port mac address not set to that of primary port");
- rte_eth_macaddr_get(bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port mac address not as expected");
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port mac address not as expected");
- rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 0 mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 0 mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
- rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 1 mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100;
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 1 mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100;
- rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ slave_port_ids[2]);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 2 mac address not as expected");
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 2 mac address not as expected");
"Failed to start bonded pmd eth device %d.",
bonded_port_id);
"Failed to start bonded pmd eth device %d.",
bonded_port_id);
- rte_eth_macaddr_get(bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100;
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100;
- rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 0 mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 0 mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
- rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 1 mac address not as expected");
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 1 mac address not as expected");
- rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ slave_port_ids[2]);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 2 mac address not as expected");
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 2 mac address not as expected");
slave_count, 0);
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100;
slave_count, 0);
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100;
- rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 0 mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 0 mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
- rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 1 mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100;
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 1 mac address not as expected");
slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100;
- rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ slave_port_ids[2]);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 2 mac address not as expected");
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 2 mac address not as expected");
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0);
- rte_eth_macaddr_get(test_params->slave_port_ids[2], &expected_mac_addr_2);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[2], &expected_mac_addr_2),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[2]);
/* Initialize bonded device with 4 slaves in round robin mode */
TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
/* Initialize bonded device with 4 slaves in round robin mode */
TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
/* Verify that all MACs are the same as first slave added to bonded dev */
for (i = 0; i < test_params->bonded_slave_count; i++) {
/* Verify that all MACs are the same as first slave added to bonded dev */
for (i = 0; i < test_params->bonded_slave_count; i++) {
- rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[i]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->bonded_port_id, test_params->slave_port_ids[i]);
for (i = 0; i < test_params->bonded_slave_count; i++) {
test_params->bonded_port_id, test_params->slave_port_ids[i]);
for (i = 0; i < test_params->bonded_slave_count; i++) {
- rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[i]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address has changed to that of primary"
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address has changed to that of primary"
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start bonded device");
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start bonded device");
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(
memcmp(&expected_mac_addr_2, &read_mac_addr, sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of new primary port",
test_params->slave_port_ids[i]);
for (i = 0; i < test_params->bonded_slave_count; i++) {
TEST_ASSERT_SUCCESS(
memcmp(&expected_mac_addr_2, &read_mac_addr, sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of new primary port",
test_params->slave_port_ids[i]);
for (i = 0; i < test_params->bonded_slave_count; i++) {
- rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[i]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_2, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of new primary"
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_2, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of new primary"
(struct rte_ether_addr *)bonded_mac),
"Failed to set MAC");
(struct rte_ether_addr *)bonded_mac),
"Failed to set MAC");
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of new primary port",
test_params->slave_port_ids[i]);
for (i = 0; i < test_params->bonded_slave_count; i++) {
TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of new primary port",
test_params->slave_port_ids[i]);
for (i = 0; i < test_params->bonded_slave_count; i++) {
- rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[i]);
TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)), "slave port (%d) mac address not set to"
" that of new primary port\n", test_params->slave_port_ids[i]);
TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)), "slave port (%d) mac address not set to"
" that of new primary port\n", test_params->slave_port_ids[i]);
struct rte_ether_addr read_mac_addr;
struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1;
struct rte_ether_addr read_mac_addr;
struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1;
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
/* Initialize bonded device with 2 slaves in active backup mode */
TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
/* Initialize bonded device with 2 slaves in active backup mode */
TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
/* Verify that bonded MACs is that of first slave and that the other slave
* MAC hasn't been changed */
/* Verify that bonded MACs is that of first slave and that the other slave
* MAC hasn't been changed */
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
"Failed to set bonded port (%d) primary port to (%d)",
test_params->bonded_port_id, test_params->slave_port_ids[1]);
"Failed to set bonded port (%d) primary port to (%d)",
test_params->bonded_port_id, test_params->slave_port_ids[1]);
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start device");
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start device");
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
(struct rte_ether_addr *)bonded_mac),
"failed to set MAC address");
(struct rte_ether_addr *)bonded_mac),
"failed to set MAC address");
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of bonded port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of bonded port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of bonded port",
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of bonded port",
struct rte_ether_addr read_mac_addr;
struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1;
struct rte_ether_addr read_mac_addr;
struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1;
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
/* Initialize bonded device with 2 slaves in active backup mode */
TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
/* Initialize bonded device with 2 slaves in active backup mode */
TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
/* Verify that bonded MACs is that of first slave and that the other slave
* MAC hasn't been changed */
/* Verify that bonded MACs is that of first slave and that the other slave
* MAC hasn't been changed */
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
"Failed to set bonded port (%d) primary port to (%d)\n",
test_params->bonded_port_id, test_params->slave_port_ids[1]);
"Failed to set bonded port (%d) primary port to (%d)\n",
test_params->bonded_port_id, test_params->slave_port_ids[1]);
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start bonded device");
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start bonded device");
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
(struct rte_ether_addr *)bonded_mac),
"failed to set MAC");
(struct rte_ether_addr *)bonded_mac),
"failed to set MAC");
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of bonded port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of bonded port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected\n",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected\n",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of bonded port",
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of bonded port",
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0);
- rte_eth_macaddr_get(test_params->slave_port_ids[2], &expected_mac_addr_1);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[2], &expected_mac_addr_1),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[2]);
/* Initialize bonded device with 4 slaves in round robin mode */
TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
/* Initialize bonded device with 4 slaves in round robin mode */
TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
/* Verify that all MACs are the same as first slave added to bonded
* device */
for (i = 0; i < test_params->bonded_slave_count; i++) {
/* Verify that all MACs are the same as first slave added to bonded
* device */
for (i = 0; i < test_params->bonded_slave_count; i++) {
- rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[i]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->bonded_port_id, test_params->slave_port_ids[i]);
for (i = 0; i < test_params->bonded_slave_count; i++) {
test_params->bonded_port_id, test_params->slave_port_ids[i]);
for (i = 0; i < test_params->bonded_slave_count; i++) {
- rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[i]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address has changed to that of primary "
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address has changed to that of primary "
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start bonded device");
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start bonded device");
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of new primary port",
test_params->slave_port_ids[i]);
for (i = 0; i < test_params->bonded_slave_count; i++) {
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of new primary port",
test_params->slave_port_ids[i]);
for (i = 0; i < test_params->bonded_slave_count; i++) {
- rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[i]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of new primary "
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of new primary "
(struct rte_ether_addr *)bonded_mac),
"Failed to set MAC address");
(struct rte_ether_addr *)bonded_mac),
"Failed to set MAC address");
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of new primary port",
TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of new primary port",
for (i = 0; i < test_params->bonded_slave_count; i++) {
for (i = 0; i < test_params->bonded_slave_count; i++) {
- rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[i]);
TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of new primary "
TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of new primary "
struct rte_ether_addr read_mac_addr;
struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1;
struct rte_ether_addr read_mac_addr;
struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1;
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
/* Initialize bonded device with 2 slaves in active backup mode */
TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
/* Initialize bonded device with 2 slaves in active backup mode */
TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
/* Verify that bonded MACs is that of first slave and that the other slave
* MAC hasn't been changed */
/* Verify that bonded MACs is that of first slave and that the other slave
* MAC hasn't been changed */
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
"Failed to set bonded port (%d) primary port to (%d)",
test_params->bonded_port_id, test_params->slave_port_ids[1]);
"Failed to set bonded port (%d) primary port to (%d)",
test_params->bonded_port_id, test_params->slave_port_ids[1]);
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start device");
TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
"Failed to start device");
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of primary port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of primary port",
(struct rte_ether_addr *)bonded_mac),
"failed to set MAC address");
(struct rte_ether_addr *)bonded_mac),
"failed to set MAC address");
- rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of bonded port",
test_params->bonded_port_id);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"bonded port (%d) mac address not set to that of bonded port",
test_params->bonded_port_id);
- rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
test_params->slave_port_ids[0]);
TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not as expected",
test_params->slave_port_ids[0]);
- rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr);
+ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
+ "Failed to get mac address (port %d)",
+ test_params->slave_port_ids[1]);
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of bonded port",
TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port (%d) mac address not set to that of bonded port",
add_slave(struct slave_conf *slave, uint8_t start)
{
struct rte_ether_addr addr, addr_check;
add_slave(struct slave_conf *slave, uint8_t start)
{
struct rte_ether_addr addr, addr_check;
/* Some sanity check */
RTE_VERIFY(test_params.slave_ports <= slave &&
/* Some sanity check */
RTE_VERIFY(test_params.slave_ports <= slave &&
"Failed to start slave %u", slave->port_id);
}
"Failed to start slave %u", slave->port_id);
}
- rte_eth_macaddr_get(slave->port_id, &addr_check);
+ retval = rte_eth_macaddr_get(slave->port_id, &addr_check);
+ TEST_ASSERT_SUCCESS(retval, "Failed to get slave mac address: %s",
+ strerror(-retval));
TEST_ASSERT_EQUAL(rte_is_same_ether_addr(&addr, &addr_check), 1,
"Slave MAC address is not as expected");
TEST_ASSERT_EQUAL(rte_is_same_ether_addr(&addr, &addr_check), 1,
"Slave MAC address is not as expected");
retval = bond_handshake();
TEST_ASSERT_SUCCESS(retval, "Initial handshake failed");
retval = bond_handshake();
TEST_ASSERT_SUCCESS(retval, "Initial handshake failed");
- rte_eth_macaddr_get(test_params.bonded_port_id, &bonded_mac);
+ retval = rte_eth_macaddr_get(test_params.bonded_port_id, &bonded_mac);
+ TEST_ASSERT_SUCCESS(retval, "Failed to get mac address: %s",
+ strerror(-retval));
rte_ether_addr_copy(&bonded_mac, &dst_mac);
/* Assert that dst address is not bonding address. Do not set the
rte_ether_addr_copy(&bonded_mac, &dst_mac);
/* Assert that dst address is not bonding address. Do not set the
retval = bond_handshake();
TEST_ASSERT_SUCCESS(retval, "Initial handshake failed");
retval = bond_handshake();
TEST_ASSERT_SUCCESS(retval, "Initial handshake failed");
- rte_eth_macaddr_get(test_params.bonded_port_id, &bonded_mac);
-
+ retval = rte_eth_macaddr_get(test_params.bonded_port_id, &bonded_mac);
+ TEST_ASSERT_SUCCESS(retval, "Failed to get mac address: %s",
+ strerror(-retval));
/* Prepare burst */
for (pkts_cnt = 0; pkts_cnt < RTE_DIM(pkts); pkts_cnt++) {
dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = pkts_cnt;
/* Prepare burst */
for (pkts_cnt = 0; pkts_cnt < RTE_DIM(pkts); pkts_cnt++) {
dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = pkts_cnt;
"Cannot configure device: err=%d, port=%d\n",
ret, portid);
"Cannot configure device: err=%d, port=%d\n",
ret, portid);
- rte_eth_macaddr_get(portid, &ports_eth_addr[portid]);
+ ret = rte_eth_macaddr_get(portid, &ports_eth_addr[portid]);
+ if (ret < 0)
+ rte_exit(EXIT_FAILURE,
+ "Cannot get mac address: err=%d, port=%d\n",
+ ret, portid);
+
printf("Port %u ", portid);
print_ethaddr("Address:", &ports_eth_addr[portid]);
printf("\n");
printf("Port %u ", portid);
print_ethaddr("Address:", &ports_eth_addr[portid]);
printf("\n");