From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from netronome.com (unknown [217.38.71.146]) by dpdk.org (Postfix) with ESMTP id 75FB31B2AF for ; Wed, 2 Jan 2019 16:21:50 +0100 (CET) Received: from netronome.com (localhost [127.0.0.1]) by netronome.com (8.15.2/8.15.2/Debian-10) with ESMTP id x02FLnqx025548 for ; Wed, 2 Jan 2019 15:21:49 GMT Received: (from root@localhost) by netronome.com (8.15.2/8.15.2/Submit) id x02FLnHM025547 for dev@dpdk.org; Wed, 2 Jan 2019 15:21:49 GMT From: Alejandro Lucero To: dev@dpdk.org Date: Wed, 2 Jan 2019 15:21:49 +0000 Message-Id: <20190102152149.25501-1-alejandro.lucero@netronome.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/nfp: fix device start/stop for VFs 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: Wed, 02 Jan 2019 15:21:50 -0000 Previous commit adding multiprocess support broke VF support. When VFs, the PMD does not set the link up or down. Fixes: ef28aa96e53b ("net/nfp: support multiprocess") Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfp_net.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index ffef97d80..05a44a2a9 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -766,12 +766,14 @@ nfp_net_start(struct rte_eth_dev *dev) goto error; } - if (hw->is_pf && rte_eal_process_type() == RTE_PROC_PRIMARY) - /* Configure the physical port up */ - nfp_eth_set_configured(hw->cpp, hw->pf_port_idx, 1); - else - nfp_eth_set_configured(dev->process_private, - hw->pf_port_idx, 1); + if (hw->is_pf) { + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + /* Configure the physical port up */ + nfp_eth_set_configured(hw->cpp, hw->pf_port_idx, 1); + else + nfp_eth_set_configured(dev->process_private, + hw->pf_port_idx, 1); + } hw->ctrl = new_ctrl; @@ -820,12 +822,14 @@ nfp_net_stop(struct rte_eth_dev *dev) (struct nfp_net_rxq *)dev->data->rx_queues[i]); } - if (hw->is_pf && rte_eal_process_type() == RTE_PROC_PRIMARY) - /* Configure the physical port down */ - nfp_eth_set_configured(hw->cpp, hw->pf_port_idx, 0); - else - nfp_eth_set_configured(dev->process_private, - hw->pf_port_idx, 0); + if (hw->is_pf) { + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + /* Configure the physical port down */ + nfp_eth_set_configured(hw->cpp, hw->pf_port_idx, 0); + else + nfp_eth_set_configured(dev->process_private, + hw->pf_port_idx, 0); + } } /* Reset and stop device. The device can not be restarted. */ -- 2.17.1