From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id CEA972C17 for ; Mon, 4 Sep 2017 15:01:29 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2017 06:01:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,474,1498546800"; d="scan'208,217";a="896928804" Received: from rnicolau-mobl.ger.corp.intel.com (HELO [10.237.221.79]) ([10.237.221.79]) by FMSMGA003.fm.intel.com with ESMTP; 04 Sep 2017 06:01:27 -0700 To: Tomasz Kulasek , dev@dpdk.org Cc: declan.doherty@intel.com References: <20170727120027.30416-1-tomaszx.kulasek@intel.com> From: Radu Nicolau Message-ID: <68de484c-d20b-3b09-b2cd-38e848fc2d9c@intel.com> Date: Mon, 4 Sep 2017 14:01:22 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170727120027.30416-1-tomaszx.kulasek@intel.com> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] bonding: fix wrong slaves capacity check 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: Mon, 04 Sep 2017 13:01:31 -0000 On 7/27/2017 1:00 PM, Tomasz Kulasek wrote: > For fortville NIC bond_ethdev_8023ad_flow_verify fails when action queue > index indicates unavailable queue before slaves configuration. > > This fix verifies flow settings for queue 0, which is always available, > and checks if slaves max queue number capacity meets requirements. > > Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control") > > Signed-off-by: Tomasz Kulasek Reviewed-by: Radu Nicolau > --- > drivers/net/bonding/rte_eth_bond_pmd.c | 26 +++++++++++++++++++------- > 1 file changed, 19 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index 8f9a860..ab5ebe0 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -175,12 +175,13 @@ const struct rte_flow_attr flow_attr_8023ad = { > int > bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, > uint8_t slave_port) { > + struct rte_eth_dev_info slave_info; > struct rte_flow_error error; > struct bond_dev_private *internals = (struct bond_dev_private *) > (bond_dev->data->dev_private); > > - struct rte_flow_action_queue lacp_queue_conf = { > - .index = internals->mode4.dedicated_queues.rx_qid, > + const struct rte_flow_action_queue lacp_queue_conf = { > + .index = 0, > }; > > const struct rte_flow_action actions[] = { > @@ -195,8 +196,22 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, > > int ret = rte_flow_validate(slave_port, &flow_attr_8023ad, > flow_item_8023ad, actions, &error); > - if (ret < 0) > + if (ret < 0) { > + RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_verify: %s " > + "(slave_port=%d queue_id=%d)", > + error.message, slave_port, > + internals->mode4.dedicated_queues.rx_qid); > + return -1; > + } > + > + rte_eth_dev_info_get(slave_port, &slave_info); > + if ((slave_info.max_rx_queues < bond_dev->data->nb_rx_queues) || > + (slave_info.max_tx_queues < bond_dev->data->nb_tx_queues)) { > + RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_verify: Slave %d" > + " capabilities doesn't allow to allocate " > + "additional queues", slave_port); > return -1; > + } > > return 0; > } > @@ -206,7 +221,7 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { > struct rte_eth_dev *bond_dev = &rte_eth_devices[port_id]; > struct bond_dev_private *internals = (struct bond_dev_private *) > (bond_dev->data->dev_private); > - struct rte_eth_dev_info bond_info, slave_info; > + struct rte_eth_dev_info bond_info; > uint8_t idx; > > /* Verify if all slaves in bonding supports flow director and */ > @@ -217,9 +232,6 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { > internals->mode4.dedicated_queues.tx_qid = bond_info.nb_tx_queues; > > for (idx = 0; idx < internals->slave_count; idx++) { > - rte_eth_dev_info_get(internals->slaves[idx].port_id, > - &slave_info); > - > if (bond_ethdev_8023ad_flow_verify(bond_dev, > internals->slaves[idx].port_id) != 0) > return -1;