X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_link_bonding_mode4.c;h=f120b2e3be24c487812c9c15c4aacc20fd6cb70f;hb=f0243339496d48e6f5d76e6ef6741d6986b965d0;hp=ff54d7b91c31866f3910a0e4f6498b2804c2cb14;hpb=6fcf85860575b4075a1fc255e7907afe359178b3;p=dpdk.git diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c index ff54d7b91c..f120b2e3be 100644 --- a/app/test/test_link_bonding_mode4.c +++ b/app/test/test_link_bonding_mode4.c @@ -355,7 +355,9 @@ remove_slaves_and_stop_bonded_device(void) uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t i; - rte_eth_dev_stop(test_params.bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params.bonded_port_id), + "Failed to stop bonded port %u", + test_params.bonded_port_id); FOR_EACH_SLAVE(i, slave) remove_slave(slave); @@ -368,7 +370,9 @@ remove_slaves_and_stop_bonded_device(void) test_params.bonded_port_id, retval); FOR_EACH_PORT(i, slave) { - rte_eth_dev_stop(slave->port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(slave->port_id), + "Failed to stop bonded port %u", + slave->port_id); TEST_ASSERT(slave->bonded == 0, "Port id=%u is still marked as enslaved.", slave->port_id); @@ -498,8 +502,8 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt) slow_hdr = rte_pktmbuf_mtod(pkt, struct slow_protocol_frame *); /* Change source address to partner address */ - rte_ether_addr_copy(&parnter_mac_default, &slow_hdr->eth_hdr.s_addr); - slow_hdr->eth_hdr.s_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = + rte_ether_addr_copy(&parnter_mac_default, &slow_hdr->eth_hdr.src_addr); + slow_hdr->eth_hdr.src_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = slave->port_id; lacp = (struct lacpdu *) &slow_hdr->slow_protocol; @@ -585,7 +589,13 @@ bond_get_update_timeout_ms(void) { struct rte_eth_bond_8023ad_conf conf; - rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf); + if (rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf) < 0) { + RTE_LOG(DEBUG, EAL, "Failed to get bonding configuration: " + "%s at %d\n", __func__, __LINE__); + RTE_TEST_TRACE_FAILURE(__FILE__, __LINE__, __func__); + return 0; + } + return conf.update_timeout_ms; } @@ -860,7 +870,7 @@ test_mode4_rx(void) for (i = 0; i < expected_pkts_cnt; i++) { hdr = rte_pktmbuf_mtod(pkts[i], struct rte_ether_hdr *); - cnt[rte_is_same_ether_addr(&hdr->d_addr, + cnt[rte_is_same_ether_addr(&hdr->dst_addr, &bonded_mac)]++; } @@ -908,7 +918,7 @@ test_mode4_rx(void) for (i = 0; i < expected_pkts_cnt; i++) { hdr = rte_pktmbuf_mtod(pkts[i], struct rte_ether_hdr *); - eq_cnt += rte_is_same_ether_addr(&hdr->d_addr, + eq_cnt += rte_is_same_ether_addr(&hdr->dst_addr, &bonded_mac); } @@ -1153,11 +1163,12 @@ init_marker(struct rte_mbuf *pkt, struct slave_conf *slave) /* Copy multicast destination address */ rte_ether_addr_copy(&slow_protocol_mac_addr, - &marker_hdr->eth_hdr.d_addr); + &marker_hdr->eth_hdr.dst_addr); /* Init source address */ - rte_ether_addr_copy(&parnter_mac_default, &marker_hdr->eth_hdr.s_addr); - marker_hdr->eth_hdr.s_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = + rte_ether_addr_copy(&parnter_mac_default, + &marker_hdr->eth_hdr.src_addr); + marker_hdr->eth_hdr.src_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = slave->port_id; marker_hdr->eth_hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW);