From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 1F6611B25A for ; Fri, 20 Oct 2017 16:37:31 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Oct 2017 07:37:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,405,1503385200"; d="scan'208";a="1233188209" Received: from gklab-246-025.igk.intel.com (HELO Sent) ([10.217.246.25]) by fmsmga002.fm.intel.com with SMTP; 20 Oct 2017 07:37:28 -0700 Received: by Sent (sSMTP sendmail emulation); Fri, 20 Oct 2017 16:32:56 +0200 From: Daniel Mrzyglod To: declan.doherty@intel.com Cc: dev@dpdk.org, Daniel Mrzyglod Date: Fri, 20 Oct 2017 16:32:54 +0200 Message-Id: <20171020143254.100505-1-danielx.t.mrzyglod@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH] net/bonding: fix setting default aggregator mode to stable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 14:37:32 -0000 This patch change default aggregator mode to stable when using rte_eth_bond_create() Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes") Signed-off-by: Daniel Mrzyglod --- drivers/net/bonding/rte_eth_bond_pmd.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 3fbc1b123..df20349d7 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2841,6 +2841,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; @@ -2898,6 +2899,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; @@ -3064,7 +3084,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); } -- 2.13.6