X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fbonding%2Frte_eth_bond_api.c;h=53df9fef1d76207e17b04bd26894e190c3983e3a;hb=281ccccb1a867f48beb6d357fdd73c4949c90121;hp=d473ac24395a607e30a75f7822edd4a69bdb2cf9;hpb=e0665f9809517217c1bd1280f3ef3f387f217fe0;p=dpdk.git diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index d473ac2439..53df9fef1d 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -60,18 +60,14 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev) int valid_bonded_port_id(uint8_t port_id) { - if (!rte_eth_dev_is_valid_port(port_id)) - return -1; - + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return check_for_bonded_ethdev(&rte_eth_devices[port_id]); } int valid_slave_port_id(uint8_t port_id) { - /* Verify that port id's are valid */ - if (!rte_eth_dev_is_valid_port(port_id)) - return -1; + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); /* Verify that port_id refers to a non bonded port */ if (check_for_bonded_ethdev(&rte_eth_devices[port_id]) == 0) @@ -95,7 +91,7 @@ activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) internals->tlb_slaves_order[active_count] = port_id; } - RTE_VERIFY(internals->active_slave_count < + RTE_ASSERT(internals->active_slave_count < (RTE_DIM(internals->active_slaves) - 1)); internals->active_slaves[internals->active_slave_count] = port_id; @@ -134,7 +130,7 @@ deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) sizeof(internals->active_slaves[0])); } - RTE_VERIFY(active_count < RTE_DIM(internals->active_slaves)); + RTE_ASSERT(active_count < RTE_DIM(internals->active_slaves)); internals->active_slave_count = active_count; if (eth_dev->data->dev_started) { @@ -205,7 +201,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) TAILQ_INIT(&(eth_dev->link_intr_cbs)); - eth_dev->data->dev_link.link_status = 0; + eth_dev->data->dev_link.link_status = ETH_LINK_DOWN; eth_dev->data->mac_addrs = rte_zmalloc_socket(name, ETHER_ADDR_LEN, 0, socket_id); @@ -420,7 +416,7 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) if (bonded_eth_dev->data->dev_started) { rte_eth_link_get_nowait(slave_port_id, &link_props); - if (link_props.link_status == 1) { + if (link_props.link_status == ETH_LINK_UP) { if (internals->active_slave_count == 0 && !internals->user_defined_primary_port) bond_ethdev_primary_set(internals,