Skip to content

[mmu probing] pr05.probe: Add stream manager and buffer occupancy controller#22543

Merged
StormLiangMS merged 2 commits intosonic-net:masterfrom
XuChen-MSFT:xuchen3/mmu_probe/pr05-infrastructure
Mar 25, 2026
Merged

[mmu probing] pr05.probe: Add stream manager and buffer occupancy controller#22543
StormLiangMS merged 2 commits intosonic-net:masterfrom
XuChen-MSFT:xuchen3/mmu_probe/pr05-infrastructure

Conversation

@XuChen-MSFT
Copy link
Copy Markdown
Contributor

@XuChen-MSFT XuChen-MSFT commented Feb 23, 2026

Description of PR

Summary:

Implement infrastructure components for traffic management and buffer control:

Stream Manager:

  • StreamManager: Traffic stream configuration and management
    • Supports 1→N and N→1 traffic patterns
    • Handles port configuration (PortInfo with MAC, IP)
    • Flow configuration (FlowConfig with priority, DSCP)
    • Automatic DMAC determination for traffic routing
    • Stream lifecycle management (add/remove streams)

Buffer Occupancy Controller:

  • BufferOccupancyController: TX state and buffer management
    • Tracks buffer hold/release states across ports
    • Manages transmission enable/disable for buffer occupancy control
    • Supports port group operations
    • State validation and consistency checking
    • Integration with PTF dataplane for TX control

These components provide essential support for probing test execution, enabling precise control over traffic patterns and buffer states.

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
  • 202511

Approach

What is the motivation for this PR?

qos refactoring

How did you do it?

How did you verify/test it?

Any platform specific information?

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

Documentation

relevant PRs:
[mmu probing] pr01.docs: Add MMU threshold probing framework design
[mmu probing] pr02.probe: Add core probing algorithms with essential data structures
[mmu probing] pr03.probe: Add probing executors and executor registry
[mmu probing] pr04.probe: Add observer pattern for metrics tracking
[mmu probing] pr05.probe: Add stream manager and buffer occupancy controller
[mmu probing] pr06.probe: Add base framework and all probing implementations
[mmu probing] pr07.test: Add comprehensive unit tests for probe framework
[mmu probing] pr08.test: Add integration tests for end-to-end probing workflows
[mmu probing] pr09.test: Add production probe test and infrastructure updates

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

yxieca
yxieca previously approved these changes Feb 23, 2026
Copy link
Copy Markdown
Collaborator

@yxieca yxieca left a comment

Choose a reason for hiding this comment

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

Deep review done. Stream manager and buffer occupancy controller look solid; no issues found.

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Implement infrastructure components for traffic management and buffer control:

Stream Manager:
- StreamManager: Traffic stream configuration and management
  - Supports 1→N and N→1 traffic patterns
  - Handles port configuration (PortInfo with MAC, IP)
  - Flow configuration (FlowConfig with priority, DSCP)
  - Automatic DMAC determination for traffic routing
  - Stream lifecycle management (add/remove streams)

Buffer Occupancy Controller:
- BufferOccupancyController: TX state and buffer management
  - Tracks buffer hold/release states across ports
  - Manages transmission enable/disable for buffer occupancy control
  - Supports port group operations
  - State validation and consistency checking
  - Integration with PTF dataplane for TX control

These components provide essential support for probing test execution,
enabling precise control over traffic patterns and buffer states.

Signed-off-by: Xu Chen <[email protected]>
Signed-off-by: Xu Chen <[email protected]>
@XuChen-MSFT XuChen-MSFT force-pushed the xuchen3/mmu_probe/pr05-infrastructure branch from 7227f4e to 1fbf468 Compare March 24, 2026 04:59
@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
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

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

✅ LGTM — Clean infrastructure extraction

Well-designed extraction of traffic management from the monolithic sai_qos_tests.py:

  • StreamManager: Clean flow management with (src, dst, frozen_keys) composite keys. The PortInfo.port_id property with actual_port_id fallback handles LAG scenarios nicely.
  • BufferOccupancyController: The expected/actual tracking with auto-restore is well-thought-out. Design philosophy of "track disabled state (异常) rather than enabled state (正常)" avoids initialization edge cases — good call.
  • determine_traffic_dmac(): Correctly handles dualtor case with def_vlan_mac.

No issues found.

@StormLiangMS StormLiangMS merged commit 7a2bb66 into sonic-net:master Mar 25, 2026
14 checks passed
ravaliyel pushed a commit to ravaliyel/sonic-mgmt that referenced this pull request Mar 27, 2026
…troller (sonic-net#22543)

* probe: Add stream manager and buffer occupancy controller

Implement infrastructure components for traffic management and buffer control:

Stream Manager:
- StreamManager: Traffic stream configuration and management
  - Supports 1→N and N→1 traffic patterns
  - Handles port configuration (PortInfo with MAC, IP)
  - Flow configuration (FlowConfig with priority, DSCP)
  - Automatic DMAC determination for traffic routing
  - Stream lifecycle management (add/remove streams)

Buffer Occupancy Controller:
- BufferOccupancyController: TX state and buffer management
  - Tracks buffer hold/release states across ports
  - Manages transmission enable/disable for buffer occupancy control
  - Supports port group operations
  - State validation and consistency checking
  - Integration with PTF dataplane for TX control

These components provide essential support for probing test execution,
enabling precise control over traffic patterns and buffer states.

Signed-off-by: Xu Chen <[email protected]>

* fix pre-commit errors

Signed-off-by: Xu Chen <[email protected]>

---------

Signed-off-by: Xu Chen <[email protected]>
selldinesh pushed a commit to selldinesh/sonic-mgmt that referenced this pull request Apr 1, 2026
…troller (sonic-net#22543)

* probe: Add stream manager and buffer occupancy controller

Implement infrastructure components for traffic management and buffer control:

Stream Manager:
- StreamManager: Traffic stream configuration and management
  - Supports 1→N and N→1 traffic patterns
  - Handles port configuration (PortInfo with MAC, IP)
  - Flow configuration (FlowConfig with priority, DSCP)
  - Automatic DMAC determination for traffic routing
  - Stream lifecycle management (add/remove streams)

Buffer Occupancy Controller:
- BufferOccupancyController: TX state and buffer management
  - Tracks buffer hold/release states across ports
  - Manages transmission enable/disable for buffer occupancy control
  - Supports port group operations
  - State validation and consistency checking
  - Integration with PTF dataplane for TX control

These components provide essential support for probing test execution,
enabling precise control over traffic patterns and buffer states.

Signed-off-by: Xu Chen <[email protected]>

* fix pre-commit errors

Signed-off-by: Xu Chen <[email protected]>

---------

Signed-off-by: Xu Chen <[email protected]>
Signed-off-by: selldinesh <[email protected]>
albertovillarreal-keys pushed a commit to albertovillarreal-keys/sonic-mgmt that referenced this pull request Apr 3, 2026
…troller (sonic-net#22543)

* probe: Add stream manager and buffer occupancy controller

Implement infrastructure components for traffic management and buffer control:

Stream Manager:
- StreamManager: Traffic stream configuration and management
  - Supports 1→N and N→1 traffic patterns
  - Handles port configuration (PortInfo with MAC, IP)
  - Flow configuration (FlowConfig with priority, DSCP)
  - Automatic DMAC determination for traffic routing
  - Stream lifecycle management (add/remove streams)

Buffer Occupancy Controller:
- BufferOccupancyController: TX state and buffer management
  - Tracks buffer hold/release states across ports
  - Manages transmission enable/disable for buffer occupancy control
  - Supports port group operations
  - State validation and consistency checking
  - Integration with PTF dataplane for TX control

These components provide essential support for probing test execution,
enabling precise control over traffic patterns and buffer states.

Signed-off-by: Xu Chen <[email protected]>

* fix pre-commit errors

Signed-off-by: Xu Chen <[email protected]>

---------

Signed-off-by: Xu Chen <[email protected]>
XuChen-MSFT added a commit that referenced this pull request Apr 10, 2026
…#22541)

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit
easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should
reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:

Implement platform-specific executors and factory pattern for executor
management:

Executor Registry:
- ExecutorRegistry: Factory for environment-specific executor
instantiation Supports 'physical' and 'sim' environments with lazy
loading

Physical Executors:
- PfcXoffProbingExecutor: PFC Xoff detection on physical hardware via
SAI
- IngressDropProbingExecutor: Ingress drop detection on physical
hardware

Simulation Executors:
- SimPfcXoffProbingExecutor: Mock PFC Xoff detection for
unit/integration tests
- SimIngressDropProbingExecutor: Mock ingress drop detection for testing

All executors implement the ProbingExecutorProtocol interface, enabling
algorithm-executor separation and testability through simulation.

Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [x] 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
- [ ] 202511

### Approach
#### What is the motivation for this PR?
qos refactoring
#### How did you do it?
Implemented probing executors using Protocol pattern with
decorator-based registry for environment-specific instantiation.
#### How did you verify/test it?
UT: 446 passed (mock-based executor tests). IT: 75 passed (end-to-end
probing workflows).
#### Any platform specific information?

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

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
relevant PRs:
[[mmu probing] pr01.docs: Add MMU threshold probing framework
design](#22539)
[[mmu probing] pr02.probe: Add core probing algorithms with essential
data structures](#22540)
[[mmu probing] pr03.probe: Add probing executors and executor
registry](#22541)
[[mmu probing] pr04.probe: Add observer pattern for metrics
tracking](#22542)
[[mmu probing] pr05.probe: Add stream manager and buffer occupancy
controller](#22543)
[[mmu probing] pr06.probe: Add base framework and all probing
implementations](#22544)
[[mmu probing] pr07.test: Add comprehensive unit tests for probe
framework](#22545)
[[mmu probing] pr08.test: Add integration tests for end-to-end probing
workflows](#22546)
[[mmu probing] pr09.test: Add production probe test and infrastructure
updates](#22547)

---------

Signed-off-by: Xu Chen <[email protected]>
Co-authored-by: Copilot <[email protected]>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Apr 13, 2026
…troller (sonic-net#22543)

* probe: Add stream manager and buffer occupancy controller

Implement infrastructure components for traffic management and buffer control:

Stream Manager:
- StreamManager: Traffic stream configuration and management
  - Supports 1→N and N→1 traffic patterns
  - Handles port configuration (PortInfo with MAC, IP)
  - Flow configuration (FlowConfig with priority, DSCP)
  - Automatic DMAC determination for traffic routing
  - Stream lifecycle management (add/remove streams)

Buffer Occupancy Controller:
- BufferOccupancyController: TX state and buffer management
  - Tracks buffer hold/release states across ports
  - Manages transmission enable/disable for buffer occupancy control
  - Supports port group operations
  - State validation and consistency checking
  - Integration with PTF dataplane for TX control

These components provide essential support for probing test execution,
enabling precise control over traffic patterns and buffer states.

Signed-off-by: Xu Chen <[email protected]>

* fix pre-commit errors

Signed-off-by: Xu Chen <[email protected]>

---------

Signed-off-by: Xu Chen <[email protected]>
Signed-off-by: opcoder0 <[email protected]>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Apr 13, 2026
…sonic-net#22541)

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit
easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should
reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:

Implement platform-specific executors and factory pattern for executor
management:

Executor Registry:
- ExecutorRegistry: Factory for environment-specific executor
instantiation Supports 'physical' and 'sim' environments with lazy
loading

Physical Executors:
- PfcXoffProbingExecutor: PFC Xoff detection on physical hardware via
SAI
- IngressDropProbingExecutor: Ingress drop detection on physical
hardware

Simulation Executors:
- SimPfcXoffProbingExecutor: Mock PFC Xoff detection for
unit/integration tests
- SimIngressDropProbingExecutor: Mock ingress drop detection for testing

All executors implement the ProbingExecutorProtocol interface, enabling
algorithm-executor separation and testability through simulation.

Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [x] 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
- [ ] 202511

### Approach
#### What is the motivation for this PR?
qos refactoring
#### How did you do it?
Implemented probing executors using Protocol pattern with
decorator-based registry for environment-specific instantiation.
#### How did you verify/test it?
UT: 446 passed (mock-based executor tests). IT: 75 passed (end-to-end
probing workflows).
#### Any platform specific information?

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

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
relevant PRs:
[[mmu probing] pr01.docs: Add MMU threshold probing framework
design](sonic-net#22539)
[[mmu probing] pr02.probe: Add core probing algorithms with essential
data structures](sonic-net#22540)
[[mmu probing] pr03.probe: Add probing executors and executor
registry](sonic-net#22541)
[[mmu probing] pr04.probe: Add observer pattern for metrics
tracking](sonic-net#22542)
[[mmu probing] pr05.probe: Add stream manager and buffer occupancy
controller](sonic-net#22543)
[[mmu probing] pr06.probe: Add base framework and all probing
implementations](sonic-net#22544)
[[mmu probing] pr07.test: Add comprehensive unit tests for probe
framework](sonic-net#22545)
[[mmu probing] pr08.test: Add integration tests for end-to-end probing
workflows](sonic-net#22546)
[[mmu probing] pr09.test: Add production probe test and infrastructure
updates](sonic-net#22547)

---------

Signed-off-by: Xu Chen <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: opcoder0 <[email protected]>
XuChen-MSFT added a commit that referenced this pull request Apr 15, 2026
… updates (#22547)

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit
easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should
reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:

Enable probe framework for production testbed usage with infrastructure
updates and physical hardware test cases.

Infrastructure Updates:

1. tests/conftest.py:
- Add --enable_qos_ptf_pdb option for PTF debugging with pdb breakpoint
- Add --ingress_drop_probing option to switch between PFC/Drop probing
modes

2. tests/ptf_runner.py:
   - Add 'probe' subdirectory support alongside 'py3'
   - Add test_subdir parameter for flexible PTF test location
   - Enable probe tests to run via PTF runner infrastructure

3. tests/qos/qos_sai_base.py (QosSaiBase refactoring):
   - Move replaceNonExistentPortId() from TestQosSai to base class
   - Move updateTestPortIdIp() from TestQosSai to base class
   - Add bufferConfig to dut_qos_maps fixture for all devices
   - Enable probe tests to access buffer configuration
   - Shared utility methods for port ID/IP management

4. tests/qos/test_qos_sai.py:
   - Remove replaceNonExistentPortId() (moved to base)
   - Remove updateTestPortIdIp() (moved to base)
   - Reduce code duplication

Production Test Cases:

5. tests/qos/test_qos_probe.py (NEW - 544 lines):
   - TestQosProbe class for physical testbed probing
   - test_pfc_xoff_probing: PFC Xoff threshold detection on hardware
   - test_ingress_drop_probing: Ingress drop threshold detection
   - test_headroom_pool_probing: Headroom pool size probing
   - Integrates with existing QoS test infrastructure
   - Uses physical executors for real hardware validation
   - Validates probe framework on production testbeds

This PR completes the probe framework integration, enabling threshold
probing tests to run on physical SONiC testbeds alongside existing QoS
tests.

Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] 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
- [ ] 202511

### Approach
#### What is the motivation for this PR?
qos refactoring
#### How did you do it?

#### How did you verify/test it?

#### Any platform specific information?

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

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->

relevant PRs:
[[mmu probing] pr01.docs: Add MMU threshold probing framework
design](#22539)
[[mmu probing] pr02.probe: Add core probing algorithms with essential
data structures](#22540)
[[mmu probing] pr03.probe: Add probing executors and executor
registry](#22541)
[[mmu probing] pr04.probe: Add observer pattern for metrics
tracking](#22542)
[[mmu probing] pr05.probe: Add stream manager and buffer occupancy
controller](#22543)
[[mmu probing] pr06.probe: Add base framework and all probing
implementations](#22544)
[[mmu probing] pr07.test: Add comprehensive unit tests for probe
framework](#22545)
[[mmu probing] pr08.test: Add integration tests for end-to-end probing
workflows](#22546)
[[mmu probing] pr09.test: Add production probe test and infrastructure
updates](#22547)

---------

Signed-off-by: Xu Chen <[email protected]>
Co-authored-by: Copilot <[email protected]>
rraghav-cisco pushed a commit to rraghav-cisco/sonic-mgmt that referenced this pull request Apr 20, 2026
…troller (sonic-net#22543)

* probe: Add stream manager and buffer occupancy controller

Implement infrastructure components for traffic management and buffer control:

Stream Manager:
- StreamManager: Traffic stream configuration and management
  - Supports 1→N and N→1 traffic patterns
  - Handles port configuration (PortInfo with MAC, IP)
  - Flow configuration (FlowConfig with priority, DSCP)
  - Automatic DMAC determination for traffic routing
  - Stream lifecycle management (add/remove streams)

Buffer Occupancy Controller:
- BufferOccupancyController: TX state and buffer management
  - Tracks buffer hold/release states across ports
  - Manages transmission enable/disable for buffer occupancy control
  - Supports port group operations
  - State validation and consistency checking
  - Integration with PTF dataplane for TX control

These components provide essential support for probing test execution,
enabling precise control over traffic patterns and buffer states.

Signed-off-by: Xu Chen <[email protected]>

* fix pre-commit errors

Signed-off-by: Xu Chen <[email protected]>

---------

Signed-off-by: Xu Chen <[email protected]>
Signed-off-by: Raghavendran Ramanathan <[email protected]>
rraghav-cisco pushed a commit to rraghav-cisco/sonic-mgmt that referenced this pull request Apr 20, 2026
…sonic-net#22541)

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit
easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should
reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:

Implement platform-specific executors and factory pattern for executor
management:

Executor Registry:
- ExecutorRegistry: Factory for environment-specific executor
instantiation Supports 'physical' and 'sim' environments with lazy
loading

Physical Executors:
- PfcXoffProbingExecutor: PFC Xoff detection on physical hardware via
SAI
- IngressDropProbingExecutor: Ingress drop detection on physical
hardware

Simulation Executors:
- SimPfcXoffProbingExecutor: Mock PFC Xoff detection for
unit/integration tests
- SimIngressDropProbingExecutor: Mock ingress drop detection for testing

All executors implement the ProbingExecutorProtocol interface, enabling
algorithm-executor separation and testability through simulation.

Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [x] 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
- [ ] 202511

### Approach
#### What is the motivation for this PR?
qos refactoring
#### How did you do it?
Implemented probing executors using Protocol pattern with
decorator-based registry for environment-specific instantiation.
#### How did you verify/test it?
UT: 446 passed (mock-based executor tests). IT: 75 passed (end-to-end
probing workflows).
#### Any platform specific information?

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

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
relevant PRs:
[[mmu probing] pr01.docs: Add MMU threshold probing framework
design](sonic-net#22539)
[[mmu probing] pr02.probe: Add core probing algorithms with essential
data structures](sonic-net#22540)
[[mmu probing] pr03.probe: Add probing executors and executor
registry](sonic-net#22541)
[[mmu probing] pr04.probe: Add observer pattern for metrics
tracking](sonic-net#22542)
[[mmu probing] pr05.probe: Add stream manager and buffer occupancy
controller](sonic-net#22543)
[[mmu probing] pr06.probe: Add base framework and all probing
implementations](sonic-net#22544)
[[mmu probing] pr07.test: Add comprehensive unit tests for probe
framework](sonic-net#22545)
[[mmu probing] pr08.test: Add integration tests for end-to-end probing
workflows](sonic-net#22546)
[[mmu probing] pr09.test: Add production probe test and infrastructure
updates](sonic-net#22547)

---------

Signed-off-by: Xu Chen <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Raghavendran Ramanathan <[email protected]>
rraghav-cisco pushed a commit to rraghav-cisco/sonic-mgmt that referenced this pull request Apr 20, 2026
… updates (sonic-net#22547)

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit
easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should
reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:

Enable probe framework for production testbed usage with infrastructure
updates and physical hardware test cases.

Infrastructure Updates:

1. tests/conftest.py:
- Add --enable_qos_ptf_pdb option for PTF debugging with pdb breakpoint
- Add --ingress_drop_probing option to switch between PFC/Drop probing
modes

2. tests/ptf_runner.py:
   - Add 'probe' subdirectory support alongside 'py3'
   - Add test_subdir parameter for flexible PTF test location
   - Enable probe tests to run via PTF runner infrastructure

3. tests/qos/qos_sai_base.py (QosSaiBase refactoring):
   - Move replaceNonExistentPortId() from TestQosSai to base class
   - Move updateTestPortIdIp() from TestQosSai to base class
   - Add bufferConfig to dut_qos_maps fixture for all devices
   - Enable probe tests to access buffer configuration
   - Shared utility methods for port ID/IP management

4. tests/qos/test_qos_sai.py:
   - Remove replaceNonExistentPortId() (moved to base)
   - Remove updateTestPortIdIp() (moved to base)
   - Reduce code duplication

Production Test Cases:

5. tests/qos/test_qos_probe.py (NEW - 544 lines):
   - TestQosProbe class for physical testbed probing
   - test_pfc_xoff_probing: PFC Xoff threshold detection on hardware
   - test_ingress_drop_probing: Ingress drop threshold detection
   - test_headroom_pool_probing: Headroom pool size probing
   - Integrates with existing QoS test infrastructure
   - Uses physical executors for real hardware validation
   - Validates probe framework on production testbeds

This PR completes the probe framework integration, enabling threshold
probing tests to run on physical SONiC testbeds alongside existing QoS
tests.

Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] 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
- [ ] 202511

### Approach
#### What is the motivation for this PR?
qos refactoring
#### How did you do it?

#### How did you verify/test it?

#### Any platform specific information?

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

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->

relevant PRs:
[[mmu probing] pr01.docs: Add MMU threshold probing framework
design](sonic-net#22539)
[[mmu probing] pr02.probe: Add core probing algorithms with essential
data structures](sonic-net#22540)
[[mmu probing] pr03.probe: Add probing executors and executor
registry](sonic-net#22541)
[[mmu probing] pr04.probe: Add observer pattern for metrics
tracking](sonic-net#22542)
[[mmu probing] pr05.probe: Add stream manager and buffer occupancy
controller](sonic-net#22543)
[[mmu probing] pr06.probe: Add base framework and all probing
implementations](sonic-net#22544)
[[mmu probing] pr07.test: Add comprehensive unit tests for probe
framework](sonic-net#22545)
[[mmu probing] pr08.test: Add integration tests for end-to-end probing
workflows](sonic-net#22546)
[[mmu probing] pr09.test: Add production probe test and infrastructure
updates](sonic-net#22547)

---------

Signed-off-by: Xu Chen <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Raghavendran Ramanathan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants