Skip to content

Commit e2d7dd5

Browse files
authored
fix: fix arp_update complains missing interface entry for static route (sonic-net#21513)
Fix E 2025 Nov 26 22:08:52.060655 ERR swss2#arp_update[16275]: 178 missing interface entry for static route 20.1.1.1 What is the motivation for this PR? For tear down, we need to remove the route first before the arp. Otherwise swss will throw error How did you do it? How did you verify/test it? MS Only: https://elastictest.org/scheduler/testplan/692f7c4c8a84f286cc565304 Signed-off-by: Austin Pham <[email protected]>
1 parent ded0cdd commit e2d7dd5

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

tests/common/snappi_tests/snappi_fixtures.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,7 @@ def gen_data_flow_dest_ip(addr, dut=None, intf=None, namespace=None, setup=True)
15151515
if setup:
15161516
cmd = "add"
15171517
asic_arg = ""
1518+
15181519
if namespace is not None:
15191520
asic_arg = f"ip netns exec {namespace}"
15201521
int_arg = ""
@@ -1526,11 +1527,18 @@ def gen_data_flow_dest_ip(addr, dut=None, intf=None, namespace=None, setup=True)
15261527
arp_opt = f"-d {addr}"
15271528

15281529
try:
1529-
dut.shell(f"sudo {asic_arg} arp {int_arg} {arp_opt}")
1530-
dut.shell(
1531-
"{} config route {} prefix {}/32 nexthop {} {}".format(
1532-
asic_arg, cmd, DEST_TO_GATEWAY_MAP[addr]['dest'], addr,
1533-
DEST_TO_GATEWAY_MAP[addr]['intf']))
1530+
if setup:
1531+
dut.shell(f"sudo {asic_arg} arp {int_arg} {arp_opt}")
1532+
dut.shell(
1533+
f"{asic_arg} config route {cmd} prefix {DEST_TO_GATEWAY_MAP[addr]['dest']}/32 nexthop "
1534+
f"{addr} {DEST_TO_GATEWAY_MAP[addr]['intf']}"
1535+
)
1536+
else:
1537+
dut.shell(
1538+
f"{asic_arg} config route {cmd} prefix {DEST_TO_GATEWAY_MAP[addr]['dest']}/32 nexthop "
1539+
f"{addr} {DEST_TO_GATEWAY_MAP[addr]['intf']}"
1540+
)
1541+
dut.shell(f"sudo {asic_arg} arp {int_arg} {arp_opt}")
15341542
except RunAnsibleModuleFail:
15351543
if setup:
15361544
raise

0 commit comments

Comments
 (0)