Skip to content

Commit c70fbc2

Browse files
ausphamrraghav-cisco
authored andcommitted
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 <austinpham@microsoft.com> Signed-off-by: Raghavendran Ramanathan <rraghav@cisco.com>
1 parent cace970 commit c70fbc2

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
@@ -1845,6 +1845,7 @@ def gen_data_flow_dest_ip(addr, dut=None, intf=None, namespace=None, setup=True)
18451845
if setup:
18461846
cmd = "add"
18471847
asic_arg = ""
1848+
18481849
if namespace is not None:
18491850
asic_arg = f"ip netns exec {namespace}"
18501851
int_arg = ""
@@ -1856,11 +1857,18 @@ def gen_data_flow_dest_ip(addr, dut=None, intf=None, namespace=None, setup=True)
18561857
arp_opt = f"-d {addr}"
18571858

18581859
try:
1859-
dut.shell(f"sudo {asic_arg} arp {int_arg} {arp_opt}")
1860-
dut.shell(
1861-
"{} config route {} prefix {}/32 nexthop {} {}".format(
1862-
asic_arg, cmd, DEST_TO_GATEWAY_MAP[addr]['dest'], addr,
1863-
DEST_TO_GATEWAY_MAP[addr]['intf']))
1860+
if setup:
1861+
dut.shell(f"sudo {asic_arg} arp {int_arg} {arp_opt}")
1862+
dut.shell(
1863+
f"{asic_arg} config route {cmd} prefix {DEST_TO_GATEWAY_MAP[addr]['dest']}/32 nexthop "
1864+
f"{addr} {DEST_TO_GATEWAY_MAP[addr]['intf']}"
1865+
)
1866+
else:
1867+
dut.shell(
1868+
f"{asic_arg} config route {cmd} prefix {DEST_TO_GATEWAY_MAP[addr]['dest']}/32 nexthop "
1869+
f"{addr} {DEST_TO_GATEWAY_MAP[addr]['intf']}"
1870+
)
1871+
dut.shell(f"sudo {asic_arg} arp {int_arg} {arp_opt}")
18641872
except RunAnsibleModuleFail:
18651873
if setup:
18661874
raise

0 commit comments

Comments
 (0)