net/nfp: fix device start/stop for VFs

Message ID 20190102152149.25501-1-alejandro.lucero@netronome.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • net/nfp: fix device start/stop for VFs
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Alejandro Lucero Jan. 2, 2019, 3:21 p.m.
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 <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

Comments

Ferruh Yigit Jan. 8, 2019, 3:46 p.m. | #1
On 1/2/2019 3:21 PM, Alejandro Lucero wrote:
> 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 <alejandro.lucero@netronome.com>

Applied to dpdk-next-net/master, thanks.

Patch

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. */