Skip to content

[action] [PR:18758] [dualtor-io] fix dualtor sniffer start slow issue#18783

Merged
mssonicbld merged 1 commit intosonic-net:202505from
mssonicbld:cherry/202505/18758
Jun 4, 2025
Merged

[action] [PR:18758] [dualtor-io] fix dualtor sniffer start slow issue#18783
mssonicbld merged 1 commit intosonic-net:202505from
mssonicbld:cherry/202505/18758

Conversation

@mssonicbld
Copy link
Collaborator

Description of PR

Summary:
Fixes # (issue)

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?

Fix the dualtor io failure:

> pytest_assert(len(failures) == 0, '\n' + '\n'.join(failures))
E Failed:
E Traffic on server 192.168.0.2 was disrupted prior to test start, missing 1 packets from the start of the packet flow
E Traffic on server 192.168.0.4 was disrupted prior to test start, missing 1 packets from the start of the packet flow
E Traffic on server 192.168.0.6 was disrupted prior to test start, missing 1 packets from the start of the packet flow

The issue is introduced by PR #18299.
The reason is that, the dualtor sniffer now listens to all dataplane interfaces on ptf (with prefix eth); for topo like dualtor-120, it has 128 dataplane interfaces, dualtor sniffer takes up to 10+ seconds to setup 128 sockets for those interfaces, which can takes up to 10+ seconds.

Signed-off-by: Longxiang Lyu lolv@microsoft.com

How did you do it?

As now scapy defaults to listen on conf.iface (on ptf, it is mgmt) and it will use socket.bind to bind to it, let's replace socket.bind with a dummy NOOP function, so the packet socket created will not listen to conf.iface anymore and it will capture packets from all interfaces.

How did you verify/test it?

On dualtor-120:

dualtor_io/test_normal_op.py::test_normal_op_downstream_upper_tor[active-standby] PASSED [100%]

========================================================================================================== 1 passed, 1 deselected, 2 warnings in 443.91s (0:07:23) ===========================================================================================================

Any platform specific information?

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

Documentation

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@mssonicbld
Copy link
Collaborator Author

Original PR: #18758

@yejianquan
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit b404b8c into sonic-net:202505 Jun 4, 2025
17 checks passed
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.

3 participants