From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 89387A0C41; Tue, 22 Jun 2021 11:26:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4549E410E9; Tue, 22 Jun 2021 11:26:21 +0200 (CEST) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.176.14]) by mails.dpdk.org (Postfix) with ESMTP id 9608C410E8 for ; Tue, 22 Jun 2021 11:26:20 +0200 (CEST) Received: from dpdk-test7.liberouter.org ([IPv6:2001:718:800:ff00:d97f:a151:83a2:7c4f]) (authenticated bits=0) by eva.fit.vutbr.cz (8.16.1/8.16.1) with ESMTPSA id 15M9Ps4k054017 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 22 Jun 2021 11:26:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stud.fit.vutbr.cz; s=studfit; t=1624353978; bh=ma5HQNoj3dA5aDshTkpqG+72Wd+fz7DGFtsVRsq31D0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ru6usjFhqJ+6OUFHuZg8Ucz7eUTFud1kzJcYTda760TXO2d4g+6nSAp61kPajKUbR v1JK55X7k/HqWMJ8zvvw2ZbXiBL13eg5YU4nWG2Z2GBVBVpsh/6RHI9kPGtNvufOm8 sOBqUb4pb0Eazli5cFNlghAntcVvPVsk4asVE9lY= From: Martin Havlik To: xhavli56@stud.fit.vutbr.cz, Chas Williams , "Min Hu (Connor)" Cc: dev@dpdk.org, Jan Viktorin Date: Tue, 22 Jun 2021 11:25:30 +0200 Message-Id: <20210622092531.73112-4-xhavli56@stud.fit.vutbr.cz> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210622092531.73112-1-xhavli56@stud.fit.vutbr.cz> References: <20210622092531.73112-1-xhavli56@stud.fit.vutbr.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 3/3] net/bonding: start ethdev prior to setting 8023ad flow X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When dedicated queues are enabled, mlx5 PMD fails to install RTE Flows if the underlying ethdev is not started: bond_ethdev_8023ad_flow_set(267) - bond_ethdev_8023ad_flow_set: port not started (slave_port=0 queue_id=1) Signed-off-by: Martin Havlik Cc: Jan Viktorin --- drivers/net/bonding/rte_eth_bond_pmd.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index a6755661c..fea3bc537 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1818,25 +1818,35 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, rte_flow_destroy(slave_eth_dev->data->port_id, internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id], &flow_error); + } + /* Start device */ + errval = rte_eth_dev_start(slave_eth_dev->data->port_id); + if (errval != 0) { + RTE_BOND_LOG(ERR, "rte_eth_dev_start: port=%u, err (%d)", + slave_eth_dev->data->port_id, errval); + return -1; + } + + if (internals->mode == BONDING_MODE_8023AD && + internals->mode4.dedicated_queues.enabled == 1) { errval = bond_ethdev_8023ad_flow_set(bonded_eth_dev, slave_eth_dev->data->port_id); if (errval != 0) { RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_set: port=%d, err (%d)", slave_eth_dev->data->port_id, errval); + + errval = rte_eth_dev_stop(slave_eth_dev->data->port_id); + if (errval < 0) { + RTE_BOND_LOG(ERR, + "rte_eth_dev_stop: port=%d, err (%d)", + slave_eth_dev->data->port_id, errval); + } return errval; } } - /* Start device */ - errval = rte_eth_dev_start(slave_eth_dev->data->port_id); - if (errval != 0) { - RTE_BOND_LOG(ERR, "rte_eth_dev_start: port=%u, err (%d)", - slave_eth_dev->data->port_id, errval); - return -1; - } - /* If RSS is enabled for bonding, synchronize RETA */ if (bonded_eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS) { int i; -- 2.27.0