Skip to content

Commit

Permalink
Adding deviation for rate class unsupport option for the ETH channel …
Browse files Browse the repository at this point in the history
…configuration (openconfig#3660)

* add deviation for ETH channal rate class non-supported. Arista device does not support this yet

* bug fix for channel definition in the interface.go file

* Revert "add deviation for ETH channal rate class non-supported. Arista device does not support this yet"

This reverts commit b1af1fc.

* Arista device is not supporting ETH channel rate class yet. Adding this deviation.

* adding a new PMD typeof PMD_400GBASE_ZR_PLUS for the functional testing

* adding new testbed topology for new optics PMD 400G ZR plus

* Update interface.go

* updated metadata.pb.go file

* Arista device is not supporting ETH channel rate class yet. Adding this deviation.

* adding newly introduced deviation of unsupported rate class to the tests

* removing folder of tmp

* removing empty file called values

* add deviation for ETH channal rate class non-supported. Arista device does not support this yet

* bug fix for channel definition in the interface.go file

* Revert "add deviation for ETH channal rate class non-supported. Arista device does not support this yet"

This reverts commit b1af1fc.

* Arista device is not supporting ETH channel rate class yet. Adding this deviation.

* adding a new PMD typeof PMD_400GBASE_ZR_PLUS for the functional testing

* adding new testbed topology for new optics PMD 400G ZR plus

* Update interface.go

* updated metadata.pb.go file

* fixed metadata.pb.go

---------

Co-authored-by: Pramod Maurya <[email protected]>
Co-authored-by: Yiwen Hu <[email protected]>
  • Loading branch information
3 people authored and ampattan committed Jan 17, 2025
1 parent 2cbb6d4 commit 3c40a0a
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ platform_exceptions: {
interface_enabled: true
default_network_instance: "default"
missing_port_to_optical_channel_component_mapping: true
channel_assignment_rate_class_parameters_unsupported: true
}
}
platform_exceptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ platform_exceptions: {
interface_enabled: true
default_network_instance: "default"
missing_port_to_optical_channel_component_mapping: true
channel_assignment_rate_class_parameters_unsupported: true
}
}
platform_exceptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ platform_exceptions: {
}
deviations: {
default_network_instance: "default"
channel_assignment_rate_class_parameters_unsupported: true
}
}
platform_exceptions: {
Expand Down
36 changes: 14 additions & 22 deletions internal/cfgplugins/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,36 +140,28 @@ func ConfigETHChannel(t *testing.T, dut *ondatra.DUTDevice, interfaceName, trans
Transceiver: ygot.String(transceiverName),
}
}
var assignment = map[uint32]*oc.TerminalDevice_Channel_Assignment{}
var assignment = map[uint32]*oc.TerminalDevice_Channel_Assignment{
0: {
Index: ygot.Uint32(0),
LogicalChannel: ygot.Uint32(otnIndex),
Description: ygot.String("ETH to OTN"),
Allocation: ygot.Float64(400),
AssignmentType: oc.Assignment_AssignmentType_LOGICAL_CHANNEL,
},
}
if deviations.EthChannelAssignmentCiscoNumbering(dut) {
assignment = map[uint32]*oc.TerminalDevice_Channel_Assignment{
0: {
Index: ygot.Uint32(1),
LogicalChannel: ygot.Uint32(otnIndex),
Description: ygot.String("ETH to OTN"),
Allocation: ygot.Float64(400),
AssignmentType: oc.Assignment_AssignmentType_LOGICAL_CHANNEL,
},
}
} else {
assignment = map[uint32]*oc.TerminalDevice_Channel_Assignment{
0: {
Index: ygot.Uint32(0),
LogicalChannel: ygot.Uint32(otnIndex),
Description: ygot.String("ETH to OTN"),
Allocation: ygot.Float64(400),
AssignmentType: oc.Assignment_AssignmentType_LOGICAL_CHANNEL,
},
}
assignment[0].Index = ygot.Uint32(1)
}
channel := &oc.TerminalDevice_Channel{
var channel = &oc.TerminalDevice_Channel{
Description: ygot.String("ETH Logical Channel"),
Index: ygot.Uint32(ethIndex),
LogicalChannelType: oc.TransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE_PROT_ETHERNET,
TribProtocol: oc.TransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_400GE,
RateClass: oc.TransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_400G,
Ingress: ingress,
Assignment: assignment,
}
if !deviations.ChannelRateClassParametersUnsupported(dut) {
channel.RateClass = oc.TransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_400G
}
gnmi.Replace(t, dut, gnmi.OC().TerminalDevice().Channel(ethIndex).Config(), channel)
}
5 changes: 5 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1292,3 +1292,8 @@ func DefaultBgpInstanceName(dut *ondatra.DUTDevice) string {
}
return "DEFAULT"
}

// ChannelRateClassParametersUnsupported returns true if channel rate class parameters are unsupported
func ChannelRateClassParametersUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetChannelAssignmentRateClassParametersUnsupported()
}
3 changes: 3 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ message Metadata {
TESTBED_DUT_DUT_ATE_2LINKS = 6;
TESTBED_DUT_ATE_8LINKS = 7;
TESTBED_DUT_400ZR = 8;
TESTBED_DUT_400ZR_PLUS = 9;
}
// Testbed on which the test is intended to run.
Testbed testbed = 4;
Expand Down Expand Up @@ -686,6 +687,8 @@ message Metadata {
// Cisco: b/388983709
// default bgp instance name is used to set bgp instance name value other than DEFAULT
string default_bgp_instance_name = 246;
// Arista does not support ETHChannel rate-class
bool channel_assignment_rate_class_parameters_unsupported = 247;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 90, 97, 55, 89, 19, 36, 35, 40, 173;
Expand Down
45 changes: 33 additions & 12 deletions proto/metadata_go_proto/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions topologies/dut_400zr_plus.testbed
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# proto-file: github.com/openconfig/ondatra/blob/main/proto/testbed.proto
# proto-message: ondatra.Testbed

# 1 DUT, 2 port, 400ZR_PLUS optics

duts {
id: "dut"
ports {
id: "port1"
speed: S_400GB
pmd: PMD_400GBASE_ZR_PLUS
}
ports {
id: "port2"
speed: S_400GB
pmd: PMD_400GBASE_ZR_PLUS
}
}

links {
a: "dut:port1"
b: "dut:port2"
}

0 comments on commit 3c40a0a

Please sign in to comment.