X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbonding%2Frte_eth_bond_pmd.c;h=53d8e98ffbdc2672b0d09fbdb285d1a27a781747;hb=7ff0ec78d0d864478d0e1994e13363079b97fec3;hp=af33529b5e6c836c8b71aef93ec98910aa64abcd;hpb=cd54819d0391d1b61f92cbaa5b268c00ab7e5b66;p=dpdk.git diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index af33529b5e..53d8e98ffb 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2840,6 +2840,7 @@ bond_probe(struct rte_vdev_device *dev) struct rte_kvargs *kvlist; uint8_t bonding_mode, socket_id/*, agg_mode*/; int arg_count, port_id; + uint8_t agg_mode; if (!dev) return -EINVAL; @@ -2897,6 +2898,25 @@ bond_probe(struct rte_vdev_device *dev) internals = rte_eth_devices[port_id].data->dev_private; internals->kvlist = kvlist; + + if (rte_kvargs_count(kvlist, PMD_BOND_AGG_MODE_KVARG) == 1) { + if (rte_kvargs_process(kvlist, + PMD_BOND_AGG_MODE_KVARG, + &bond_ethdev_parse_slave_agg_mode_kvarg, + &agg_mode) != 0) { + RTE_LOG(ERR, EAL, + "Failed to parse agg selection mode for bonded device %s\n", + name); + goto parse_error; + } + + if (internals->mode == BONDING_MODE_8023AD) + rte_eth_bond_8023ad_agg_selection_set(port_id, + agg_mode); + } else { + rte_eth_bond_8023ad_agg_selection_set(port_id, AGG_STABLE); + } + RTE_LOG(INFO, EAL, "Create bonded device %s on port %d in mode %u on " "socket %u.\n", name, port_id, bonding_mode, socket_id); return 0; @@ -3063,7 +3083,6 @@ bond_ethdev_configure(struct rte_eth_dev *dev) name); } if (internals->mode == BONDING_MODE_8023AD) - if (agg_mode != 0) rte_eth_bond_8023ad_agg_selection_set(port_id, agg_mode); }