summaryrefslogtreecommitdiffstats
path: root/src/plugins/dev_octeon/port.c
diff options
context:
space:
mode:
authorMonendra Singh Kushwaha <kmonendra@marvell.com>2024-02-23 12:59:47 +0530
committerDamjan Marion <dmarion@0xa5.net>2024-03-05 18:50:36 +0000
commit09c6cae8c819b71f32fa4d657756c063d4549366 (patch)
tree0998fc5be3937cdb1f2c272791743d855bfc8f52 /src/plugins/dev_octeon/port.c
parent3026ffa091ff1fd6a61ac6e2796982796e47f8e8 (diff)
octeon: add support for VF device
This patch adds support for VF and loopback device. Type: feature Change-Id: I1ea92f3a1161851957206300ab921c27290b0305 Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
Diffstat (limited to 'src/plugins/dev_octeon/port.c')
-rw-r--r--src/plugins/dev_octeon/port.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/plugins/dev_octeon/port.c b/src/plugins/dev_octeon/port.c
index f1ae15aadb1..00ad8b9c477 100644
--- a/src/plugins/dev_octeon/port.c
+++ b/src/plugins/dev_octeon/port.c
@@ -10,8 +10,9 @@
#include <dev_octeon/common.h>
#include <vnet/ethernet/ethernet.h>
-#define OCT_FLOW_PREALLOC_SIZE 1
-#define OCT_FLOW_MAX_PRIORITY 7
+#define OCT_FLOW_PREALLOC_SIZE 1
+#define OCT_FLOW_MAX_PRIORITY 7
+#define OCT_ETH_LINK_SPEED_100G 100000 /**< 100 Gbps */
VLIB_REGISTER_LOG_CLASS (oct_log, static) = {
.class_name = "octeon",
@@ -171,9 +172,19 @@ oct_port_poll (vlib_main_t *vm, vnet_dev_port_t *port)
vnet_dev_port_state_changes_t changes = {};
int rrv;
- rrv = roc_nix_mac_link_info_get (nix, &link_info);
- if (rrv)
- return;
+ if (roc_nix_is_lbk (nix))
+ {
+ link_info.status = 1;
+ link_info.full_duplex = 1;
+ link_info.autoneg = 0;
+ link_info.speed = OCT_ETH_LINK_SPEED_100G;
+ }
+ else
+ {
+ rrv = roc_nix_mac_link_info_get (nix, &link_info);
+ if (rrv)
+ return;
+ }
if (cd->status != link_info.status)
{