* [PATCH] net/cnxk: toggle link status for representors
@ 2024-11-14 9:39 Harman Kalra
2025-01-23 15:08 ` [EXTERNAL] " Jerin Jacob
0 siblings, 1 reply; 2+ messages in thread
From: Harman Kalra @ 2024-11-14 9:39 UTC (permalink / raw)
To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
Harman Kalra
Cc: dev
Representor port link status should be toggled based on representee
state i.e. if representee comes up representor link status should be
up while when representee goes down representor port should indicate
the same.
Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
drivers/net/cnxk/cnxk_rep_ops.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/net/cnxk/cnxk_rep_ops.c b/drivers/net/cnxk/cnxk_rep_ops.c
index 888842fa90..c88d28ff72 100644
--- a/drivers/net/cnxk/cnxk_rep_ops.c
+++ b/drivers/net/cnxk/cnxk_rep_ops.c
@@ -80,14 +80,12 @@ cnxk_rep_link_update(struct rte_eth_dev *ethdev, int wait_to_complete)
PLT_SET_USED(wait_to_complete);
memset(&link, 0, sizeof(link));
- if (ethdev->data->dev_started)
+ if (ethdev->data->dev_started) {
link.link_status = RTE_ETH_LINK_UP;
- else
- link.link_status = RTE_ETH_LINK_DOWN;
-
- link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
- link.link_autoneg = RTE_ETH_LINK_FIXED;
- link.link_speed = RTE_ETH_SPEED_NUM_UNKNOWN;
+ link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
+ link.link_autoneg = RTE_ETH_LINK_FIXED;
+ link.link_speed = RTE_ETH_SPEED_NUM_UNKNOWN;
+ }
return rte_eth_linkstatus_set(ethdev, &link);
}
@@ -234,6 +232,7 @@ int
cnxk_rep_dev_start(struct rte_eth_dev *ethdev)
{
struct cnxk_rep_dev *rep_dev = cnxk_rep_pmd_priv(ethdev);
+ struct rte_eth_link link;
int rc = 0, qid;
ethdev->rx_pkt_burst = cnxk_rep_rx_burst;
@@ -278,6 +277,13 @@ cnxk_rep_dev_start(struct rte_eth_dev *ethdev)
rep_dev->parent_dev->repr_cnt.nb_repr_started++;
+ link.link_status = RTE_ETH_LINK_UP;
+ link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX;
+ link.link_autoneg = RTE_ETH_LINK_FIXED;
+ link.link_speed = RTE_ETH_SPEED_NUM_UNKNOWN;
+ rte_eth_linkstatus_set(ethdev, &link);
+ ethdev->data->dev_started = 1;
+
return 0;
fail:
return rc;
@@ -293,6 +299,7 @@ int
cnxk_rep_dev_stop(struct rte_eth_dev *ethdev)
{
struct cnxk_rep_dev *rep_dev = cnxk_rep_pmd_priv(ethdev);
+ struct rte_eth_link link;
ethdev->rx_pkt_burst = cnxk_rep_rx_burst_dummy;
ethdev->tx_pkt_burst = cnxk_rep_tx_burst_dummy;
@@ -300,6 +307,11 @@ cnxk_rep_dev_stop(struct rte_eth_dev *ethdev)
cnxk_rep_tx_queue_stop(ethdev, 0);
rep_dev->parent_dev->repr_cnt.nb_repr_started--;
+ /* Bring down link status internally */
+ memset(&link, 0, sizeof(link));
+ rte_eth_linkstatus_set(ethdev, &link);
+ ethdev->data->dev_started = 0;
+
return 0;
}
--
2.46.0.469.g4590f2e941
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [EXTERNAL] [PATCH] net/cnxk: toggle link status for representors
2024-11-14 9:39 [PATCH] net/cnxk: toggle link status for representors Harman Kalra
@ 2025-01-23 15:08 ` Jerin Jacob
0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2025-01-23 15:08 UTC (permalink / raw)
To: Harman Kalra, Nithin Kumar Dabilpuram, Kiran Kumar Kokkilagadda,
Sunil Kumar Kori, Satha Koteswara Rao Kottidi, Harman Kalra
Cc: dev
[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]
> -----Original Message-----
> From: Harman Kalra <hkalra@marvell.com>
> Sent: Thursday, November 14, 2024 3:09 PM
> To: Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar
> Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori
> <skori@marvell.com>; Satha Koteswara Rao Kottidi
> <skoteshwar@marvell.com>; Harman Kalra <hkalra@marvell.com>
> Cc: dev@dpdk.org
> Subject: [EXTERNAL] [PATCH] net/cnxk: toggle link status for representors
>
> Representor port link status should be toggled based on representee state i. e. if
> representee comes up representor link status should be up while when
> representee goes down representor port should indicate the same. Signed-off-
> by: Harman Kalra
> Representor port link status should be toggled based on representee state i.e. if
> representee comes up representor link status should be up while when
> representee goes down representor port should indicate the same.
>
> Signed-off-by: Harman Kalra <hkalra@marvell.com>
Applied to dpdk-next-net-mrvl/for-main. Thanks
[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 15233 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-23 15:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-14 9:39 [PATCH] net/cnxk: toggle link status for representors Harman Kalra
2025-01-23 15:08 ` [EXTERNAL] " Jerin Jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).