From 9b6df541e5e2b6a933df66065a7a1c583a57a3ec Mon Sep 17 00:00:00 2001 From: Monendra Singh Kushwaha Date: Fri, 12 Jul 2024 16:28:52 +0530 Subject: 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 --- src/plugins/dev_octeon/port.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/plugins/dev_octeon') 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); -- cgit 1.2.3-korg