Skip to content

Exclude the DPU ports from the probed active ports in ipfwd/test_nhop_group.py tests#20668

Merged
bingwang-ms merged 1 commit intosonic-net:masterfrom
nikamirrr:fix_active_ip_interfaces_dpu
Sep 23, 2025
Merged

Exclude the DPU ports from the probed active ports in ipfwd/test_nhop_group.py tests#20668
bingwang-ms merged 1 commit intosonic-net:masterfrom
nikamirrr:fix_active_ip_interfaces_dpu

Conversation

@nikamirrr
Copy link
Copy Markdown
Contributor

@nikamirrr nikamirrr commented Sep 16, 2025

Description of PR

Smart switch with the DPUs in the light mode has extra ports that have N/A peer IPs.
Setting the test to ignore those ports when looking for the active switch port.
Port and IP output, DPU ports have N/A as peer IP

root@host:/home/admin# show ip interface
Interface        Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
---------------  --------  -------------------  ------------  --------------  -------------
Ethernet64                 10.0.0.32/31         up/up         ARISTA01T0      10.0.0.33
Ethernet72                 10.0.0.34/31         up/up         ARISTA02T0      10.0.0.35
Ethernet80                 10.0.0.36/31         up/up         ARISTA03T0      10.0.0.37
Ethernet88                 10.0.0.38/31         up/up         ARISTA04T0      10.0.0.39
Ethernet96                 10.0.0.40/31         up/up         ARISTA05T0      10.0.0.41
Ethernet104                10.0.0.42/31         up/up         ARISTA06T0      10.0.0.43
Ethernet112                10.0.0.44/31         up/up         ARISTA07T0      10.0.0.45
Ethernet120                10.0.0.46/31         up/up         ARISTA08T0      10.0.0.47
Ethernet128                10.0.0.48/31         up/up         ARISTA09T0      10.0.0.49
Ethernet136                10.0.0.50/31         up/up         ARISTA10T0      10.0.0.51
Ethernet144                10.0.0.52/31         up/up         ARISTA11T0      10.0.0.53
Ethernet152                10.0.0.54/31         up/up         ARISTA12T0      10.0.0.55
Ethernet160                10.0.0.56/31         up/up         ARISTA13T0      10.0.0.57
Ethernet168                10.0.0.58/31         up/up         ARISTA14T0      10.0.0.59
Ethernet176                10.0.0.60/31         up/up         ARISTA15T0      10.0.0.61
Ethernet184                10.0.0.62/31         up/up         ARISTA16T0      10.0.0.63
Ethernet192                10.0.0.64/31         up/up         ARISTA17T0      10.0.0.65
Ethernet200                10.0.0.66/31         up/up         ARISTA18T0      10.0.0.67
Ethernet208                10.0.0.68/31         up/up         ARISTA19T0      10.0.0.69
Ethernet216                10.0.0.70/31         up/up         ARISTA20T0      10.0.0.71
Ethernet224                18.0.202.0/31        up/up         N/A             N/A
Ethernet232                18.1.202.0/31        up/up         N/A             N/A
Ethernet240                18.2.202.0/31        up/up         N/A             N/A
Ethernet248                18.3.202.0/31        up/up         N/A             N/A
Loopback0                  10.1.0.32/32         up/up         N/A             N/A
PortChannel102             10.0.0.0/31          up/up         ARISTA01T2      10.0.0.1
PortChannel105             10.0.0.4/31          up/up         ARISTA03T2      10.0.0.5
PortChannel108             10.0.0.8/31          up/up         ARISTA05T2      10.0.0.9
PortChannel111             10.0.0.12/31         up/up         ARISTA07T2      10.0.0.13
bridge-midplane            169.254.200.254/24   up/up         N/A             N/A
docker0                    240.127.1.1/24       up/up         N/A             N/A
eth0                       10.210.25.4/22       up/up         N/A             N/A
lo                         127.0.0.1/16         up/up         N/A             N/A
root@host:/home/admin# show chassis module status
  Name             Description    Physical-Slot    Oper-Status    Admin-Status        Serial
------  ----------------------  ---------------  -------------  --------------  ------------
  DPU0  NVIDIA BlueField-3 DPU              N/A         Online              up  MT2428XZ0JVU
  DPU1  NVIDIA BlueField-3 DPU              N/A         Online              up  MT2428XZ0JQT
  DPU2  NVIDIA BlueField-3 DPU              N/A         Online              up  MT2428XZ0JRA
  DPU3  NVIDIA BlueField-3 DPU              N/A         Online              up  MT2428XZ0JTK

 

Summary:
Fixes # (issue): N/A

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Approach

What is the motivation for this PR?

Failing switch tests for the smart switch in the light mode

How did you do it?

Introduced the check to skip ports without a peer IP.

How did you verify/test it?

Re-ran the tests with the updated code. Tests passed

Any platform specific information?

N/A

Supported testbed topology if it's a new test case?

N/A

Documentation

N/A

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nikamirrr
Copy link
Copy Markdown
Contributor Author

@wangxin @xwjiang-ms @roy-sror would you please review and merge if possilbe?

# Ping for some time to get ARP Re-learnt.
# We might have to tune it further if needed.
if (v["admin"] == "up" and v["oper_state"] == "up" and
v["peer_ipv4"] != "N/A" and
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikamirrr can we do this based on port "role" and skip if it is "Dpc"?

Copy link
Copy Markdown
Contributor Author

@nikamirrr nikamirrr Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prabhataravind

This function selects active ip interfaces
def active_ip_interfaces(self, ip_ifs, tbinfo, ns_arg=DEFAULT_NAMESPACE, intf_num="all"):
And the ip_ifs argument is supplied by ip_ifs = self.show_ip_interface()["ansible_facts"]["ip_interfaces"]

That function just parses the output of show ip interfaces and there is no role information for the port
I tried looking at mg_facts = self.get_extended_minigraph_facts(tbinfo, ns_arg) data, but there is no role information either.

Would you please hint where I can find the port role or what would be the best way to refactor?
I have been looking for the least intrusive way to fix the test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikamirrr role is part of config_facts I believe.

Alternatively, once this change from cisco is merged, you can use mg_facts to get role as well.

#20244

@nikamirrr nikamirrr force-pushed the fix_active_ip_interfaces_dpu branch from c38e655 to 3c106e4 Compare September 22, 2025 23:21
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

@prabhataravind prabhataravind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@prabhataravind
Copy link
Copy Markdown
Contributor

@bingwang-ms could you please sign off as well as this is generic sonic code?

@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to msft-202506: Azure/sonic-mgmt.msft#886

opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
…est_nhop_group.py tests (sonic-net#20668)

Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 16, 2025
…est_nhop_group.py tests (sonic-net#20668)

Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
…est_nhop_group.py tests (sonic-net#20668)

Signed-off-by: Aharon Malkin <amalkin@nvidia.com>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
…est_nhop_group.py tests (sonic-net#20668)

Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
yifan-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Jan 14, 2026
…est_nhop_group.py tests (sonic-net#20668)

Signed-off-by: YiFan Wang <yifan@nexthop.ai>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
…est_nhop_group.py tests (sonic-net#20668)

Signed-off-by: Guy Shemesh <gshemesh@nvidia.com>
lakshmi-nexthop pushed a commit to lakshmi-nexthop/sonic-mgmt that referenced this pull request Jan 28, 2026
…est_nhop_group.py tests (sonic-net#20668)

Signed-off-by: Lakshmi Yarramaneni <lakshmi@nexthop.ai>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
…est_nhop_group.py tests (sonic-net#20668)

Signed-off-by: Yael Tzur <ytzur@nvidia.com>
abhishek-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Feb 6, 2026
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants