Skip to content

Commit

Permalink
DP-1.3 Adding required scheduler config before binding it to an Inter…
Browse files Browse the repository at this point in the history
…face (openconfig#2671)

* Fix DP-1.3

* Fix DP-1.3 and remove deviations

* correction

* removing deviations in the script

* fix readme

* fix readme

* fix readme

* update

* correction

* correction

* update
  • Loading branch information
charantejag504 authored and ampattan committed Aug 23, 2024
1 parent 1a992bb commit 75c5cc3
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 6 deletions.
40 changes: 38 additions & 2 deletions feature/qos/tests/qos_ecn_config_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Verify QoS ECN feature configuration.

* ECN
* [TODO] qos/queue-management-profiles/queue-management-profile/wred/uniform/config/min-threshold-percent
* [TODO] qos/queue-management-profiles/queue-management-profile/wred/uniform/config/max-threshold-percent
* [TODO] qos/queue-management-profiles/queue-management-profile/wred/uniform/config/max-threshold-percent
* qos/queue-management-profiles/queue-management-profile/wred/uniform/config/min-threshold
* qos/queue-management-profiles/queue-management-profile/wred/uniform/config/max-threshold
* qos/queue-management-profiles/queue-management-profile/wred/uniform/config/enable-ecn
Expand All @@ -79,7 +79,7 @@ Verify QoS ECN feature configuration.
* ECN

* [TODO] qos/queue-management-profiles/queue-management-profile/wred/uniform/state/min-threshold-percent
* [TODO] qos/queue-management-profiles/queue-management-profile/wred/uniform/state/max-threshold-percent
* [TODO] qos/queue-management-profiles/queue-management-profile/wred/uniform/state/max-threshold-percent
* qos/queue-management-profiles/queue-management-profile/wred/uniform/state/min-threshold
* qos/queue-management-profiles/queue-management-profile/wred/uniform/state/max-threshold
* qos/queue-management-profiles/queue-management-profile/wred/uniform/state/enable-ecn
Expand All @@ -96,3 +96,39 @@ Verify QoS ECN feature configuration.
## platform

* vRX

## OpenConfig Path and RPC Coverage

The below yaml defines the OC paths intended to be covered by this test. OC
paths used for test setup are not listed here.

```yaml
paths:
## Config paths
/qos/queue-management-profiles/queue-management-profile/wred/uniform/config/min-threshold:
/qos/queue-management-profiles/queue-management-profile/wred/uniform/config/max-threshold:
/qos/queue-management-profiles/queue-management-profile/wred/uniform/config/enable-ecn:
/qos/queue-management-profiles/queue-management-profile/wred/uniform/config/weight:
/qos/queue-management-profiles/queue-management-profile/wred/uniform/config/drop:
/qos/queue-management-profiles/queue-management-profile/wred/uniform/config/max-drop-probability-percent:
/qos/interfaces/interface/input/classifiers/classifier/config/name:
/qos/interfaces/interface/output/queues/queue/config/name:
/qos/interfaces/interface/output/queues/queue/config/queue-management-profile:

## State paths:

/qos/queue-management-profiles/queue-management-profile/wred/uniform/state/min-threshold:
/qos/queue-management-profiles/queue-management-profile/wred/uniform/state/max-threshold:
/qos/queue-management-profiles/queue-management-profile/wred/uniform/state/enable-ecn:
/qos/queue-management-profiles/queue-management-profile/wred/uniform/state/weight:
/qos/queue-management-profiles/queue-management-profile/wred/uniform/state/drop:
/qos/queue-management-profiles/queue-management-profile/wred/uniform/state/max-drop-probability-percent:
/qos/interfaces/interface/input/classifiers/classifier/state/name:
/qos/interfaces/interface/output/queues/queue/state/name:
/qos/interfaces/interface/output/queues/queue/state/queue-management-profile:

rpcs:
gnmi:
gNMI.Set:
Replace:
```
4 changes: 0 additions & 4 deletions feature/qos/tests/qos_ecn_config_test/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ platform_exceptions: {
platform: {
vendor: JUNIPER
}
deviations: {
state_path_unsupported: true
drop_weight_leaves_unsupported: true
}
}
platform_exceptions: {
platform: {
Expand Down
76 changes: 76 additions & 0 deletions feature/qos/tests/qos_ecn_config_test/qos_ecn_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,46 +302,114 @@ func testQoSOutputIntfConfig(t *testing.T, q *oc.Qos) {
dp := dut.Port(t, "port2")
queues := netutil.CommonTrafficQueues(t, dut)

ecnConfig := struct {
ecnEnabled bool
dropEnabled bool
minThreshold uint64
maxThreshold uint64
maxDropProbabilityPercent uint8
weight uint32
}{
ecnEnabled: true,
dropEnabled: false,
minThreshold: uint64(80000),
maxThreshold: uint64(80000),
maxDropProbabilityPercent: uint8(100),
weight: uint32(0),
}

queueMgmtProfile := q.GetOrCreateQueueManagementProfile("DropProfile")
queueMgmtProfile.SetName("DropProfile")
wred := queueMgmtProfile.GetOrCreateWred()
uniform := wred.GetOrCreateUniform()
uniform.SetEnableEcn(ecnConfig.ecnEnabled)
uniform.SetDrop(ecnConfig.dropEnabled)
wantMinThreshold := ecnConfig.minThreshold
wantMaxThreshold := ecnConfig.maxThreshold
if deviations.EcnSameMinMaxThresholdUnsupported(dut) {
wantMinThreshold = CiscoMinThreshold
wantMaxThreshold = CiscoMaxThreshold
}
uniform.SetMinThreshold(wantMinThreshold)
uniform.SetMaxThreshold(wantMaxThreshold)
uniform.SetMaxDropProbabilityPercent(ecnConfig.maxDropProbabilityPercent)
if !deviations.QosSetWeightConfigUnsupported(dut) {
uniform.SetWeight(ecnConfig.weight)
}

cases := []struct {
desc string
queueName string
ecnProfile string
scheduler string
sequence uint32
priority oc.E_Scheduler_Priority
inputID string
inputType oc.E_Input_InputType
weight uint64
}{{
desc: "output-interface-BE1",
queueName: queues.BE1,
ecnProfile: "DropProfile",
scheduler: "scheduler",
sequence: uint32(1),
priority: oc.Scheduler_Priority_UNSET,
inputType: oc.Input_InputType_QUEUE,
weight: uint64(1),
}, {
desc: "output-interface-BE0",
queueName: queues.BE0,
ecnProfile: "DropProfile",
scheduler: "scheduler",
sequence: uint32(1),
priority: oc.Scheduler_Priority_UNSET,
inputType: oc.Input_InputType_QUEUE,
weight: uint64(4),
}, {
desc: "output-interface-AF1",
queueName: queues.AF1,
ecnProfile: "DropProfile",
scheduler: "scheduler",
sequence: uint32(1),
priority: oc.Scheduler_Priority_UNSET,
inputType: oc.Input_InputType_QUEUE,
weight: uint64(8),
}, {
desc: "output-interface-AF2",
queueName: queues.AF2,
ecnProfile: "DropProfile",
scheduler: "scheduler",
sequence: uint32(1),
priority: oc.Scheduler_Priority_UNSET,
inputType: oc.Input_InputType_QUEUE,
weight: uint64(16),
}, {
desc: "output-interface-AF3",
queueName: queues.AF3,
ecnProfile: "DropProfile",
scheduler: "scheduler",
sequence: uint32(1),
priority: oc.Scheduler_Priority_UNSET,
inputType: oc.Input_InputType_QUEUE,
weight: uint64(32),
}, {
desc: "output-interface-AF4",
queueName: queues.AF4,
ecnProfile: "DropProfile",
scheduler: "scheduler",
sequence: uint32(0),
priority: oc.Scheduler_Priority_STRICT,
inputType: oc.Input_InputType_QUEUE,
weight: uint64(6),
}, {
desc: "output-interface-NC1",
queueName: queues.NC1,
ecnProfile: "DropProfile",
scheduler: "scheduler",
sequence: uint32(0),
priority: oc.Scheduler_Priority_STRICT,
inputType: oc.Input_InputType_QUEUE,
weight: uint64(7),
}}

i := q.GetOrCreateInterface(dp.Name())
Expand All @@ -366,6 +434,14 @@ func testQoSOutputIntfConfig(t *testing.T, q *oc.Qos) {
for _, tc := range cases {
t.Run(tc.desc, func(t *testing.T) {
qoscfg.SetForwardingGroup(t, dut, q, tc.queueName, tc.queueName)
s := schedulerPolicy.GetOrCreateScheduler(tc.sequence)
s.SetSequence(tc.sequence)
s.SetPriority(tc.priority)
input := s.GetOrCreateInput(tc.queueName)
input.SetId(tc.queueName)
input.SetInputType(tc.inputType)
input.SetQueue(tc.queueName)
input.SetWeight(tc.weight)
output := i.GetOrCreateOutput()
schedulerPolicy := output.GetOrCreateSchedulerPolicy()
schedulerPolicy.SetName(tc.scheduler)
Expand Down

0 comments on commit 75c5cc3

Please sign in to comment.