summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMonendra Singh Kushwaha <kmonendra@marvell.com>2024-07-12 16:28:52 +0530
committerDamjan Marion <dmarion@0xa5.net>2024-08-21 11:52:55 +0000
commit9b6df541e5e2b6a933df66065a7a1c583a57a3ec (patch)
tree02b98c2a6d99f622b3b37533eea6b54d10ec2c3b /src
parent1fb7ae3440feeb6cb1843a4a410110d1e1ebd9fc (diff)
octeon: sync mac address to cgx/rpm table
This patch syncs mac address to cgx/rpm table at initialization, which sets interface in unicast mode. Type: fix Change-Id: Icf64b91ce5c74cc399cad3d3358b951fb2a65297 Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/dev_octeon/port.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/dev_octeon/port.c b/src/plugins/dev_octeon/port.c
index e2402fb9399..68ed1a5886b 100644
--- a/src/plugins/dev_octeon/port.c
+++ b/src/plugins/dev_octeon/port.c
@@ -58,6 +58,7 @@ oct_port_init (vlib_main_t *vm, vnet_dev_port_t *port)
vnet_dev_t *dev = port->dev;
oct_device_t *cd = vnet_dev_get_data (dev);
oct_port_t *cp = vnet_dev_get_port_data (port);
+ u8 mac_addr[PLT_ETHER_ADDR_LEN];
struct roc_nix *nix = cd->nix;
vnet_dev_rv_t rv;
int rrv;
@@ -75,6 +76,22 @@ oct_port_init (vlib_main_t *vm, vnet_dev_port_t *port)
}
cp->lf_allocated = 1;
+ if (!roc_nix_is_vf_or_sdp (nix))
+ {
+ if ((rrv = roc_nix_npc_mac_addr_get (nix, mac_addr)))
+ {
+ oct_port_deinit (vm, port);
+ return oct_roc_err (dev, rrv, "roc_nix_npc_mac_addr_get failed");
+ }
+
+ /* Sync MAC address to CGX/RPM table */
+ if ((rrv = roc_nix_mac_addr_set (nix, mac_addr)))
+ {
+ oct_port_deinit (vm, port);
+ return oct_roc_err (dev, rrv, "roc_nix_mac_addr_set failed");
+ }
+ }
+
if ((rrv = roc_nix_tm_init (nix)))
{
oct_port_deinit (vm, port);