Imported Upstream version 17.05.2
[deb_dpdk.git] / drivers / net / bonding / rte_eth_bond_8023ad.c
index 48a50e4..6f7e985 100644 (file)
@@ -435,7 +435,7 @@ periodic_machine(struct bond_dev_private *internals, uint8_t slave_id)
                         * In other case (was fast and now it is slow) just switch
                         * timeout to slow without forcing send of LACP (because standard
                         * say so)*/
-                       if (!is_partner_fast)
+                       if (is_partner_fast)
                                SM_FLAG_SET(port, NTT);
                } else
                        return; /* Nothing changed */
@@ -758,7 +758,7 @@ bond_mode_8023ad_periodic_cb(void *arg)
                uint16_t key;
 
                slave_id = internals->active_slaves[i];
-               rte_eth_link_get(slave_id, &link_info);
+               rte_eth_link_get_nowait(slave_id, &link_info);
                rte_eth_macaddr_get(slave_id, &slave_addr);
 
                if (link_info.link_status != 0) {
@@ -888,8 +888,8 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)
        RTE_ASSERT(port->tx_ring == NULL);
        socket_id = rte_eth_devices[slave_id].data->numa_node;
 
-       element_size = sizeof(struct slow_protocol_frame) + sizeof(struct rte_mbuf)
-                               RTE_PKTMBUF_HEADROOM;
+       element_size = sizeof(struct slow_protocol_frame) +
+                               RTE_PKTMBUF_HEADROOM;
 
        /* The size of the mempool should be at least:
         * the sum of the TX descriptors + BOND_MODE_8023AX_SLAVE_TX_PKTS */
@@ -900,11 +900,10 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)
        }
 
        snprintf(mem_name, RTE_DIM(mem_name), "slave_port%u_pool", slave_id);
-       port->mbuf_pool = rte_mempool_create(mem_name,
-               total_tx_desc, element_size,
-               RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ? 32 : RTE_MEMPOOL_CACHE_MAX_SIZE,
-               sizeof(struct rte_pktmbuf_pool_private), rte_pktmbuf_pool_init,
-               NULL, rte_pktmbuf_init, NULL, socket_id, MEMPOOL_F_NO_SPREAD);
+       port->mbuf_pool = rte_pktmbuf_pool_create(mem_name, total_tx_desc,
+               RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ?
+                       32 : RTE_MEMPOOL_CACHE_MAX_SIZE,
+               0, element_size, socket_id);
 
        /* Any memory allocation failure in initalization is critical because
         * resources can't be free, so reinitialization is impossible. */
@@ -1068,7 +1067,7 @@ bond_mode_8023ad_conf_assign(struct mode8023ad_private *mode4,
 }
 
 static void
-bond_mode_8023ad_setup_v1604(struct rte_eth_dev *dev,
+bond_mode_8023ad_setup_v20(struct rte_eth_dev *dev,
                struct rte_eth_bond_8023ad_conf *conf)
 {
        struct rte_eth_bond_8023ad_conf def_conf;
@@ -1214,7 +1213,7 @@ free_out:
 }
 
 int
-rte_eth_bond_8023ad_conf_get_v1604(uint8_t port_id,
+rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id,
                struct rte_eth_bond_8023ad_conf *conf)
 {
        struct rte_eth_dev *bond_dev;
@@ -1229,7 +1228,7 @@ rte_eth_bond_8023ad_conf_get_v1604(uint8_t port_id,
        bond_mode_8023ad_conf_get(bond_dev, conf);
        return 0;
 }
-VERSION_SYMBOL(rte_eth_bond_8023ad_conf_get, _v1604, 16.04);
+VERSION_SYMBOL(rte_eth_bond_8023ad_conf_get, _v20, 2.0);
 
 int
 rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id,
@@ -1278,7 +1277,7 @@ bond_8023ad_setup_validate(uint8_t port_id,
 }
 
 int
-rte_eth_bond_8023ad_setup_v1604(uint8_t port_id,
+rte_eth_bond_8023ad_setup_v20(uint8_t port_id,
                struct rte_eth_bond_8023ad_conf *conf)
 {
        struct rte_eth_dev *bond_dev;
@@ -1289,11 +1288,11 @@ rte_eth_bond_8023ad_setup_v1604(uint8_t port_id,
                return err;
 
        bond_dev = &rte_eth_devices[port_id];
-       bond_mode_8023ad_setup_v1604(bond_dev, conf);
+       bond_mode_8023ad_setup_v20(bond_dev, conf);
 
        return 0;
 }
-VERSION_SYMBOL(rte_eth_bond_8023ad_setup, _v1604, 16.04);
+VERSION_SYMBOL(rte_eth_bond_8023ad_setup, _v20, 2.0);
 
 int
 rte_eth_bond_8023ad_setup_v1607(uint8_t port_id,