diff --git a/feature/qos/ate_tests/mixed_sp_wrr_traffic_test/metadata.textproto b/feature/qos/ate_tests/mixed_sp_wrr_traffic_test/metadata.textproto index 8cb261e51c8..d65725e4a2e 100644 --- a/feature/qos/ate_tests/mixed_sp_wrr_traffic_test/metadata.textproto +++ b/feature/qos/ate_tests/mixed_sp_wrr_traffic_test/metadata.textproto @@ -28,8 +28,11 @@ platform_exceptions: { vendor: NOKIA } deviations: { - explicit_interface_ref_definition: true + dequeue_delete_not_counted_as_drops: true + qos_octets: true interface_enabled: true + explicit_port_speed: true + explicit_interface_in_default_vrf: true } } platform_exceptions: { diff --git a/feature/qos/ate_tests/mixed_sp_wrr_traffic_test/mixed_sp_wrr_traffic_test.go b/feature/qos/ate_tests/mixed_sp_wrr_traffic_test/mixed_sp_wrr_traffic_test.go index 07230789e8d..968557676c3 100644 --- a/feature/qos/ate_tests/mixed_sp_wrr_traffic_test/mixed_sp_wrr_traffic_test.go +++ b/feature/qos/ate_tests/mixed_sp_wrr_traffic_test/mixed_sp_wrr_traffic_test.go @@ -661,6 +661,14 @@ func ConfigureDUTIntf(t *testing.T, dut *ondatra.DUTDevice) { a := s.GetOrCreateAddress(intf.ipAddr) a.PrefixLength = ygot.Uint8(intf.prefixLen) gnmi.Replace(t, dut, gnmi.OC().Interface(intf.intfName).Config(), i) + if deviations.ExplicitInterfaceInDefaultVRF(dut) { + fptest.AssignToNetworkInstance(t, dut, intf.intfName, deviations.DefaultNetworkInstance(dut), 0) + } + } + if deviations.ExplicitPortSpeed(dut) { + fptest.SetPortSpeed(t, dp1) + fptest.SetPortSpeed(t, dp2) + fptest.SetPortSpeed(t, dp3) } } @@ -675,42 +683,54 @@ func ConfigureQoS(t *testing.T, dut *ondatra.DUTDevice) { t.Logf("Create qos forwarding groups config") forwardingGroups := []struct { - desc string - queueName string - targetGroup string + desc string + queueName string + targetGroup string + fabricPriority uint8 }{{ - desc: "forwarding-group-BE1", - queueName: queues.BE1, - targetGroup: "target-group-BE1", - }, { - desc: "forwarding-group-BE0", - queueName: queues.BE0, - targetGroup: "target-group-BE0", - }, { - desc: "forwarding-group-AF1", - queueName: queues.AF1, - targetGroup: "target-group-AF1", - }, { - desc: "forwarding-group-AF2", - queueName: queues.AF2, - targetGroup: "target-group-AF2", - }, { - desc: "forwarding-group-AF3", - queueName: queues.AF3, - targetGroup: "target-group-AF3", - }, { - desc: "forwarding-group-AF4", - queueName: queues.AF4, - targetGroup: "target-group-AF4", - }, { - desc: "forwarding-group-NC1", - queueName: queues.NC1, - targetGroup: "target-group-NC1", + desc: "forwarding-group-BE1", + queueName: queues.BE1, + targetGroup: "target-group-BE1", + fabricPriority: 1, + }, { + desc: "forwarding-group-BE0", + queueName: queues.BE0, + targetGroup: "target-group-BE0", + fabricPriority: 2, + }, { + desc: "forwarding-group-AF1", + queueName: queues.AF1, + targetGroup: "target-group-AF1", + fabricPriority: 3, + }, { + desc: "forwarding-group-AF2", + queueName: queues.AF2, + targetGroup: "target-group-AF2", + fabricPriority: 4, + }, { + desc: "forwarding-group-AF3", + queueName: queues.AF3, + targetGroup: "target-group-AF3", + fabricPriority: 5, + }, { + desc: "forwarding-group-AF4", + queueName: queues.AF4, + targetGroup: "target-group-AF4", + fabricPriority: 6, + }, { + desc: "forwarding-group-NC1", + queueName: queues.NC1, + targetGroup: "target-group-NC1", + fabricPriority: 7, }} t.Logf("qos forwarding groups config: %v", forwardingGroups) for _, tc := range forwardingGroups { - qoscfg.SetForwardingGroup(t, dut, q, tc.targetGroup, tc.queueName) + if dut.Vendor() == ondatra.NOKIA { + qoscfg.SetForwardingGroupWithFabricPriority(t, dut, q, tc.targetGroup, tc.queueName, tc.fabricPriority) + } else { + qoscfg.SetForwardingGroup(t, dut, q, tc.targetGroup, tc.queueName) + } } t.Logf("Create qos Classifiers config") @@ -969,7 +989,13 @@ func ConfigureQoS(t *testing.T, dut *ondatra.DUTDevice) { input.SetId(tc.inputID) input.SetInputType(tc.inputType) input.SetQueue(tc.queueName) - input.SetWeight(tc.weight) + if dut.Vendor() == ondatra.NOKIA { + if tc.priority != oc.Scheduler_Priority_STRICT { + input.SetWeight(tc.weight) + } + } else { + input.SetWeight(tc.weight) + } gnmi.Replace(t, dut, gnmi.OC().Qos().Config(), q) } diff --git a/feature/qos/otg_tests/mixed_sp_wrr_traffic_test/metadata.textproto b/feature/qos/otg_tests/mixed_sp_wrr_traffic_test/metadata.textproto index 8cb261e51c8..d65725e4a2e 100644 --- a/feature/qos/otg_tests/mixed_sp_wrr_traffic_test/metadata.textproto +++ b/feature/qos/otg_tests/mixed_sp_wrr_traffic_test/metadata.textproto @@ -28,8 +28,11 @@ platform_exceptions: { vendor: NOKIA } deviations: { - explicit_interface_ref_definition: true + dequeue_delete_not_counted_as_drops: true + qos_octets: true interface_enabled: true + explicit_port_speed: true + explicit_interface_in_default_vrf: true } } platform_exceptions: { diff --git a/feature/qos/otg_tests/mixed_sp_wrr_traffic_test/mixed_sp_wrr_traffic_test.go b/feature/qos/otg_tests/mixed_sp_wrr_traffic_test/mixed_sp_wrr_traffic_test.go index e16efb51f0f..3075d34e41a 100644 --- a/feature/qos/otg_tests/mixed_sp_wrr_traffic_test/mixed_sp_wrr_traffic_test.go +++ b/feature/qos/otg_tests/mixed_sp_wrr_traffic_test/mixed_sp_wrr_traffic_test.go @@ -726,6 +726,14 @@ func ConfigureDUTIntf(t *testing.T, dut *ondatra.DUTDevice) { a := s.GetOrCreateAddress(intf.ipAddr) a.PrefixLength = ygot.Uint8(intf.prefixLen) gnmi.Replace(t, dut, gnmi.OC().Interface(intf.intfName).Config(), i) + if deviations.ExplicitInterfaceInDefaultVRF(dut) { + fptest.AssignToNetworkInstance(t, dut, intf.intfName, deviations.DefaultNetworkInstance(dut), 0) + } + } + if deviations.ExplicitPortSpeed(dut) { + fptest.SetPortSpeed(t, dp1) + fptest.SetPortSpeed(t, dp2) + fptest.SetPortSpeed(t, dp3) } } @@ -740,42 +748,54 @@ func ConfigureQoS(t *testing.T, dut *ondatra.DUTDevice) { t.Logf("Create qos forwarding groups config") forwardingGroups := []struct { - desc string - queueName string - targetGroup string + desc string + queueName string + targetGroup string + fabricPriority uint8 }{{ - desc: "forwarding-group-BE1", - queueName: queues.BE1, - targetGroup: "target-group-BE1", - }, { - desc: "forwarding-group-BE0", - queueName: queues.BE0, - targetGroup: "target-group-BE0", - }, { - desc: "forwarding-group-AF1", - queueName: queues.AF1, - targetGroup: "target-group-AF1", - }, { - desc: "forwarding-group-AF2", - queueName: queues.AF2, - targetGroup: "target-group-AF2", - }, { - desc: "forwarding-group-AF3", - queueName: queues.AF3, - targetGroup: "target-group-AF3", - }, { - desc: "forwarding-group-AF4", - queueName: queues.AF4, - targetGroup: "target-group-AF4", - }, { - desc: "forwarding-group-NC1", - queueName: queues.NC1, - targetGroup: "target-group-NC1", + desc: "forwarding-group-BE1", + queueName: queues.BE1, + targetGroup: "target-group-BE1", + fabricPriority: 1, + }, { + desc: "forwarding-group-BE0", + queueName: queues.BE0, + targetGroup: "target-group-BE0", + fabricPriority: 2, + }, { + desc: "forwarding-group-AF1", + queueName: queues.AF1, + targetGroup: "target-group-AF1", + fabricPriority: 3, + }, { + desc: "forwarding-group-AF2", + queueName: queues.AF2, + targetGroup: "target-group-AF2", + fabricPriority: 4, + }, { + desc: "forwarding-group-AF3", + queueName: queues.AF3, + targetGroup: "target-group-AF3", + fabricPriority: 5, + }, { + desc: "forwarding-group-AF4", + queueName: queues.AF4, + targetGroup: "target-group-AF4", + fabricPriority: 6, + }, { + desc: "forwarding-group-NC1", + queueName: queues.NC1, + targetGroup: "target-group-NC1", + fabricPriority: 7, }} t.Logf("qos forwarding groups config: %v", forwardingGroups) for _, tc := range forwardingGroups { - qoscfg.SetForwardingGroup(t, dut, q, tc.targetGroup, tc.queueName) + if dut.Vendor() == ondatra.NOKIA { + qoscfg.SetForwardingGroupWithFabricPriority(t, dut, q, tc.targetGroup, tc.queueName, tc.fabricPriority) + } else { + qoscfg.SetForwardingGroup(t, dut, q, tc.targetGroup, tc.queueName) + } } t.Logf("Create qos Classifiers config") @@ -1034,7 +1054,13 @@ func ConfigureQoS(t *testing.T, dut *ondatra.DUTDevice) { input.SetId(tc.inputID) input.SetInputType(tc.inputType) input.SetQueue(tc.queueName) - input.SetWeight(tc.weight) + if dut.Vendor() == ondatra.NOKIA { + if tc.priority != oc.Scheduler_Priority_STRICT { + input.SetWeight(tc.weight) + } + } else { + input.SetWeight(tc.weight) + } gnmi.Replace(t, dut, gnmi.OC().Qos().Config(), q) } diff --git a/internal/qoscfg/qoscfg.go b/internal/qoscfg/qoscfg.go index 8d8e294ec17..70eb10c49db 100644 --- a/internal/qoscfg/qoscfg.go +++ b/internal/qoscfg/qoscfg.go @@ -32,6 +32,16 @@ func SetForwardingGroup(t *testing.T, dut *ondatra.DUTDevice, qos *oc.Qos, group gnmi.Replace(t, dut, gnmi.OC().Qos().Config(), qos) } +func SetForwardingGroupWithFabricPriority(t *testing.T, dut *ondatra.DUTDevice, qos *oc.Qos, groupName, queueName string, fabricPriority uint8) { + t.Helper() + + fwdGroup := qos.GetOrCreateForwardingGroup(groupName) + fwdGroup.SetOutputQueue(queueName) + fwdGroup.SetFabricPriority(uint8(fabricPriority)) + qos.GetOrCreateQueue(queueName) + gnmi.Replace(t, dut, gnmi.OC().Qos().Config(), qos) +} + // SetInputClassifier sets an input classifier in the specified QoS config. func SetInputClassifier(t *testing.T, dut *ondatra.DUTDevice, qos *oc.Qos, intfID string, classType oc.E_Input_Classifier_Type, className string) { t.Helper()