Skip to contentSkip to conversation

net/qede: fix link state configuration

PATCH Applied Rasesh Mody 2 participants 5 messages May 12, 2020 – May 14, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/qede: fix link state configuration

Move link state enable/disable to dev_start() and dev_stop() respectively. This will ensure when devices are stopped, link status will be appropriately shown as down.

Fixes dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")
---
 drivers/net/qede/qede_ethdev.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/qede/qede_ethdev.c +9 -5
index bcd8252d9..9a5847076 100644
@@ -1150,6 +1150,9 @@ static int qede_dev_start(struct rte_eth_dev *eth_dev)
 	if (qede_activate_vport(eth_dev, true))
 		goto err;
 
+	/* Bring-up the link */
+	qede_dev_set_link_state(eth_dev, true);
+
 	/* Update link status */
 	qede_link_update(eth_dev, 0);
 
@@ -1179,6 +1182,12 @@ static void qede_dev_stop(struct rte_eth_dev *eth_dev)
 	 */
 	qede_assign_rxtx_handlers(eth_dev, true);
 
+	/* Bring the link down */
+	qede_dev_set_link_state(eth_dev, false);
+
+	/* Update link status */
+	qede_link_update(eth_dev, 0);
+
 	/* Disable vport */
 	if (qede_activate_vport(eth_dev, false))
 		return;
@@ -1563,8 +1572,6 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev)
 	eth_dev->data->nb_rx_queues = 0;
 	eth_dev->data->nb_tx_queues = 0;
 
-	/* Bring the link down */
-	qede_dev_set_link_state(eth_dev, false);
 	qdev->ops->common->slowpath_stop(edev);
 	qdev->ops->common->remove(edev);
 	rte_intr_disable(&pci_dev->intr_handle);
@@ -2671,9 +2678,6 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
 	eth_dev->dev_ops = (is_vf) ? &qede_eth_vf_dev_ops : &qede_eth_dev_ops;
 
-	/* Bring-up the link */
-	qede_dev_set_link_state(eth_dev, true);
-
 	adapter->num_tx_queues = 0;
 	adapter->num_rx_queues = 0;
 	SLIST_INIT(&adapter->arfs_info.arfs_list_head);
Signature · 1 line
2.18.0
#1 lore raw
Quoted 6 lines · Rasesh Mody

Move link state enable/disable to dev_start() and dev_stop() respectively. This will ensure when devices are stopped, link status will be appropriately shown as down.

Fixes dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")

I assume you need this patch for -rc3.
Please rebase the patch to dpdk-next-net-mrvl and send v2.

log:
git am -3 /tmp/to_merge/net-qede-fix-link-state-configuration

Applying: net/qede: fix link state configuration
error: sha1 information is lacking or useless (drivers/net/qede/qede_ethdev.c).
error: could not build fake ancestor
Patch failed at 0001 net/qede: fix link state configuration
hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort". HEAD is now at a8b8a8631 node: fix arm64 build with old gcc
git am failed /tmp/g//net-qede-fix-link-state-configuration
Wed 13 May 2020 09:51:26 PM IST

Quoted 58 lines
---
 drivers/net/qede/qede_ethdev.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/qede/qede_ethdev.c +9 -6
index bcd8252d9..9a5847076 100644
@@ -1150,6 +1150,9 @@ static int qede_dev_start(struct rte_eth_dev *eth_dev)
        if (qede_activate_vport(eth_dev, true))
                goto err;
 
+       /* Bring-up the link */
+       qede_dev_set_link_state(eth_dev, true);
+
        /* Update link status */
        qede_link_update(eth_dev, 0);
 
@@ -1179,6 +1182,12 @@ static void qede_dev_stop(struct rte_eth_dev *eth_dev)
         */
        qede_assign_rxtx_handlers(eth_dev, true);
 
+       /* Bring the link down */
+       qede_dev_set_link_state(eth_dev, false);
+
+       /* Update link status */
+       qede_link_update(eth_dev, 0);
+
        /* Disable vport */
        if (qede_activate_vport(eth_dev, false))
                return;
@@ -1563,8 +1572,6 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev)
        eth_dev->data->nb_rx_queues = 0;
        eth_dev->data->nb_tx_queues = 0;
 
-       /* Bring the link down */
-       qede_dev_set_link_state(eth_dev, false);
        qdev->ops->common->slowpath_stop(edev);
        qdev->ops->common->remove(edev);
        rte_intr_disable(&pci_dev->intr_handle);
@@ -2671,9 +2678,6 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
        eth_dev->dev_ops = (is_vf) ? &qede_eth_vf_dev_ops : &qede_eth_dev_ops;
 
-       /* Bring-up the link */
-       qede_dev_set_link_state(eth_dev, true);
-
        adapter->num_tx_queues = 0;
        adapter->num_rx_queues = 0;
        SLIST_INIT(&adapter->arfs_info.arfs_list_head);
--

2.18.0

#2 lore raw

Hi Jerin,

Quoted 5 lines

From: Jerin Jacob <[email protected]>
Sent: Wednesday, May 13, 2020 9:25 AM

Quoted 1 line · Rasesh Mody
Quoted 8 lines
Quoted 5 lines

Move link state enable/disable to dev_start() and dev_stop() respectively. This will ensure when devices are stopped, link status will be appropriately shown as down.

Fixes dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")

I assume you need this patch for -rc3.
Please rebase the patch to dpdk-next-net-mrvl and send v2.

Yes, this patch is for -rc3.
This patch had a dependency on https://patches.dpdk.org/patch/69737/.
I've submitted a v2 for this patch, please apply.

Thanks!
-Rasesh

Quoted 81 lines

log:
git am -3 /tmp/to_merge/net-qede-fix-link-state-configuration

Applying: net/qede: fix link state configuration
error: sha1 information is lacking or useless (drivers/net/qede/qede_ethdev.c).
error: could not build fake ancestor
Patch failed at 0001 net/qede: fix link state configuration
hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort". HEAD is now at a8b8a8631 node: fix arm64 build with old gcc git am failed /tmp/g//net-qede-fix-link-state-configuration
Wed 13 May 2020 09:51:26 PM IST

drivers/net/qede/qede_ethdev.c static int qede_dev_start(struct rte_eth_dev

Quoted 14 lines
---
 drivers/net/qede/qede_ethdev.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/net/qede/qede_ethdev.c index bcd8252d9..9a5847076 100644

drivers/net/qede/qede_ethdev.c +0 -0
@@ -1150,6 +1150,9 @@ static int qede_dev_start(struct rte_eth_dev

*eth_dev)

drivers/net/qede/qede_ethdev.c static void qede_dev_stop(struct rte_eth_dev

Quoted 10 lines
drivers/net/qede/qede_ethdev.c +3 -0
        if (qede_activate_vport(eth_dev, true))
                goto err;
 
+       /* Bring-up the link */
+       qede_dev_set_link_state(eth_dev, true);
+
        /* Update link status */
        qede_link_update(eth_dev, 0);
 
@@ -1179,6 +1182,12 @@ static void qede_dev_stop(struct rte_eth_dev

*eth_dev)

drivers/net/qede/qede_ethdev.c static void qede_dev_close(struct rte_eth_dev

Quoted 13 lines
drivers/net/qede/qede_ethdev.c +6 -0
         */
        qede_assign_rxtx_handlers(eth_dev, true);
 
+       /* Bring the link down */
+       qede_dev_set_link_state(eth_dev, false);
+
+       /* Update link status */
+       qede_link_update(eth_dev, 0);
+
        /* Disable vport */
        if (qede_activate_vport(eth_dev, false))
                return;
@@ -1563,8 +1572,6 @@ static void qede_dev_close(struct rte_eth_dev

*eth_dev)

Quoted 23 lines
drivers/net/qede/qede_ethdev.c +0 -5
        eth_dev->data->nb_rx_queues = 0;
        eth_dev->data->nb_tx_queues = 0;
 
-       /* Bring the link down */
-       qede_dev_set_link_state(eth_dev, false);
        qdev->ops->common->slowpath_stop(edev);
        qdev->ops->common->remove(edev);
        rte_intr_disable(&pci_dev->intr_handle);
@@ -2671,9 +2678,6 @@ static int qede_common_dev_init(struct
 rte_eth_dev *eth_dev, bool is_vf)
 
        eth_dev->dev_ops = (is_vf) ? &qede_eth_vf_dev_ops :
 &qede_eth_dev_ops;
 
-       /* Bring-up the link */
-       qede_dev_set_link_state(eth_dev, true);
-
        adapter->num_tx_queues = 0;
        adapter->num_rx_queues = 0;
        SLIST_INIT(&adapter->arfs_info.arfs_list_head);

--
2.18.0

Applied
#3 lore raw
Quoted 12 lines · Rasesh Mody

Hi Jerin,

Quoted 9 lines

From: Jerin Jacob <[email protected]>
Sent: Wednesday, May 13, 2020 9:25 AM

Quoted 5 lines · Rasesh Mody

Move link state enable/disable to dev_start() and dev_stop() respectively. This will ensure when devices are stopped, link status will be appropriately shown as down.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Fixes dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")

I assume you need this patch for -rc3.
Please rebase the patch to dpdk-next-net-mrvl and send v2.

Yes, this patch is for -rc3.
This patch had a dependency on https://patches.dpdk.org/patch/69737/.
I've submitted a v2 for this patch, please apply.

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 85 lines

Thanks!
-Rasesh

Quoted 81 lines

log:
git am -3 /tmp/to_merge/net-qede-fix-link-state-configuration

Applying: net/qede: fix link state configuration
error: sha1 information is lacking or useless (drivers/net/qede/qede_ethdev.c).
error: could not build fake ancestor
Patch failed at 0001 net/qede: fix link state configuration
hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort". HEAD is now at a8b8a8631 node: fix arm64 build with old gcc git am failed /tmp/g//net-qede-fix-link-state-configuration
Wed 13 May 2020 09:51:26 PM IST

drivers/net/qede/qede_ethdev.c static int qede_dev_start(struct rte_eth_dev

Quoted 14 lines
---
 drivers/net/qede/qede_ethdev.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/net/qede/qede_ethdev.c index bcd8252d9..9a5847076 100644

drivers/net/qede/qede_ethdev.c +0 -0
@@ -1150,6 +1150,9 @@ static int qede_dev_start(struct rte_eth_dev

*eth_dev)

drivers/net/qede/qede_ethdev.c static void qede_dev_stop(struct rte_eth_dev

Quoted 10 lines
drivers/net/qede/qede_ethdev.c +3 -0
        if (qede_activate_vport(eth_dev, true))
                goto err;
 
+       /* Bring-up the link */
+       qede_dev_set_link_state(eth_dev, true);
+
        /* Update link status */
        qede_link_update(eth_dev, 0);
 
@@ -1179,6 +1182,12 @@ static void qede_dev_stop(struct rte_eth_dev

*eth_dev)

drivers/net/qede/qede_ethdev.c static void qede_dev_close(struct rte_eth_dev

Quoted 13 lines
drivers/net/qede/qede_ethdev.c +6 -0
         */
        qede_assign_rxtx_handlers(eth_dev, true);
 
+       /* Bring the link down */
+       qede_dev_set_link_state(eth_dev, false);
+
+       /* Update link status */
+       qede_link_update(eth_dev, 0);
+
        /* Disable vport */
        if (qede_activate_vport(eth_dev, false))
                return;
@@ -1563,8 +1572,6 @@ static void qede_dev_close(struct rte_eth_dev

*eth_dev)

Quoted 23 lines
drivers/net/qede/qede_ethdev.c +0 -5
        eth_dev->data->nb_rx_queues = 0;
        eth_dev->data->nb_tx_queues = 0;
 
-       /* Bring the link down */
-       qede_dev_set_link_state(eth_dev, false);
        qdev->ops->common->slowpath_stop(edev);
        qdev->ops->common->remove(edev);
        rte_intr_disable(&pci_dev->intr_handle);
@@ -2671,9 +2678,6 @@ static int qede_common_dev_init(struct
 rte_eth_dev *eth_dev, bool is_vf)
 
        eth_dev->dev_ops = (is_vf) ? &qede_eth_vf_dev_ops :
 &qede_eth_dev_ops;
 
-       /* Bring-up the link */
-       qede_dev_set_link_state(eth_dev, true);
-
        adapter->num_tx_queues = 0;
        adapter->num_rx_queues = 0;
        SLIST_INIT(&adapter->arfs_info.arfs_list_head);

--
2.18.0

#4 lore raw

PATCH v2 1/1 net/qede: fix link state configuration

In reply to Rasesh Mody

Move link state enable/disable to dev_start() and dev_stop() respectively. This will ensure when devices are stopped, link status will be appropriately shown as down.

Fixes dd28bc8c6ef4 ("net/qede: fix VF port creation sequence")
---
 drivers/net/qede/qede_ethdev.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/qede/qede_ethdev.c +9 -5
index e71fa1e6a..0b1fca9ac 100644
@@ -1144,6 +1144,9 @@ static int qede_dev_start(struct rte_eth_dev *eth_dev)
 	if (qede_activate_vport(eth_dev, true))
 		goto err;
 
+	/* Bring-up the link */
+	qede_dev_set_link_state(eth_dev, true);
+
 	/* Update link status */
 	qede_link_update(eth_dev, 0);
 
@@ -1166,6 +1169,12 @@ static void qede_dev_stop(struct rte_eth_dev *eth_dev)
 
 	PMD_INIT_FUNC_TRACE(edev);
 
+	/* Bring the link down */
+	qede_dev_set_link_state(eth_dev, false);
+
+	/* Update link status */
+	qede_link_update(eth_dev, 0);
+
 	/* Disable vport */
 	if (qede_activate_vport(eth_dev, false))
 		return;
@@ -1550,8 +1559,6 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev)
 	eth_dev->data->nb_rx_queues = 0;
 	eth_dev->data->nb_tx_queues = 0;
 
-	/* Bring the link down */
-	qede_dev_set_link_state(eth_dev, false);
 	qdev->ops->common->slowpath_stop(edev);
 	qdev->ops->common->remove(edev);
 	rte_intr_disable(&pci_dev->intr_handle);
@@ -2672,9 +2679,6 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
 	eth_dev->dev_ops = (is_vf) ? &qede_eth_vf_dev_ops : &qede_eth_dev_ops;
 
-	/* Bring-up the link */
-	qede_dev_set_link_state(eth_dev, true);
-
 	adapter->num_tx_queues = 0;
 	adapter->num_rx_queues = 0;
 	SLIST_INIT(&adapter->arfs_info.arfs_list_head);
Signature · 1 line
2.18.0