Skip to content

Commit

Permalink
Arista device is not supporting ETH channel rate class yet. Adding th…
Browse files Browse the repository at this point in the history
…is deviation.
  • Loading branch information
jianchen-g committed Dec 17, 2024
1 parent 0439ee9 commit dcf02d1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
28 changes: 20 additions & 8 deletions internal/cfgplugins/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,26 @@ func ConfigETHChannel(t *testing.T, dut *ondatra.DUTDevice, interfaceName, trans
},
}
}
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,
var channel *oc.TerminalDevice_Channel
if deviations.ChannelRateClassParametersUnsupported(dut) {
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,
Ingress: ingress,
Assignment: assignment,
}
} else {
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,
}
}
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 @@ -1243,3 +1243,8 @@ func EnableTableConnections(dut *ondatra.DUTDevice) bool {
func NoZeroSuppression(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetNoZeroSuppression()
}

// ChannelRateClassParametersUnsupported returns true if channel rate class parameters are unsupported
func ChannelRateClassParametersUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetChannelAssignmentRateClassParametersUnsupported()
}

0 comments on commit dcf02d1

Please sign in to comment.