From: Alok Mishra Date: Mon, 24 Jun 2024 10:56:16 +0000 (+0500) Subject: octeon: fix link down issue X-Git-Tag: v25.02-rc0~135 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=9bff049b84c15813dcd70c03895bc627444778bf;p=vpp.git octeon: fix link down issue An issue is noticed when the link state of the ethernet interface is toggled to down and again brought up. The link status shows "up" in the "show interface", but shows "down" in "show hardware-interface". This issue does not occur when the link is brought up for the first time, but only manifests when the interface is brought down and up again. This happens because the device status and VNET_HW_INTERFACE_FLAG_LINK_UP aren't correctly updated during the port stop, preventing them from being updated during the port start. This patch fixes this issue in the port stop function. Type: fix Fixes: 01fe7ab88e Signed-off-by: Alok Mishra Change-Id: Idbc5a6c31409a3d1c5b19e14a3c9509291175677 --- diff --git a/src/plugins/dev_octeon/port.c b/src/plugins/dev_octeon/port.c index 8ba9041f858..e2402fb9399 100644 --- a/src/plugins/dev_octeon/port.c +++ b/src/plugins/dev_octeon/port.c @@ -393,6 +393,18 @@ oct_port_stop (vlib_main_t *vm, vnet_dev_port_t *port) foreach_vnet_dev_port_tx_queue (q, port) oct_txq_stop (vm, q); + + vnet_dev_port_state_change (vm, port, + (vnet_dev_port_state_changes_t){ + .change.link_state = 1, + .change.link_speed = 1, + .link_speed = 0, + .link_state = 0, + }); + + /* Update the device status */ + cd->status = 0; + cd->speed = 0; } vnet_dev_rv_t