sonic-port.yang: add link training support (#10025)

This is part of HLD  Azure/SONiC#925

#### Why I did it
Add link-training support

#### How I did it
Update SONiC YANG for port link-training support

#### Description for the changelog
Add "link_training" to sonic-port.yang

#### Link to config_db schema for YANG module changes

https://github.com/sonic-net/SONiC/wiki/Configuration#port
This commit is contained in:
Dante (Kuo-Jung) Su 2022-05-16 03:52:22 +08:00 committed by GitHub
parent 5eda219bdc
commit 4b581f1e9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 79 additions and 5 deletions

View File

@ -1167,7 +1167,8 @@ optional attributes.
"description": "fortyGigE1/1/1",
"mtu": "9100",
"alias": "fortyGigE1/1/1",
"speed": "40000"
"speed": "40000",
"link_training": "off"
},
"Ethernet1": {
"index": "1",
@ -1176,7 +1177,8 @@ optional attributes.
"mtu": "9100",
"alias": "fortyGigE1/1/2",
"admin_status": "up",
"speed": "40000"
"speed": "40000",
"link_training": "on"
},
"Ethernet63": {
"index": "63",

View File

@ -438,7 +438,8 @@
"index": "0",
"asic_port_name": "Eth0-ASIC1",
"role": "Ext",
"macsec": "test"
"macsec": "test",
"link_training": "off"
},
"Ethernet1": {
"alias": "Eth1/2",
@ -449,7 +450,8 @@
"admin_status": "up",
"autoneg": "on",
"adv_speeds": "100000,50000",
"adv_interface_types": "CR,CR4"
"adv_interface_types": "CR,CR4",
"link_training": "on"
},
"Ethernet2": {
"alias": "Eth1/3",

View File

@ -69,6 +69,17 @@
"desc": "PORT_INVALID_ADVTYPES_TEST_2 must condition failure.",
"eStrKey" : "Must"
},
"PORT_VALID_LINK_TRAINING_TEST_1": {
"desc": "PORT_VALID_LINK_TRAINING_TEST_1 no failure."
},
"PORT_VALID_LINK_TRAINING_TEST_2": {
"desc": "PORT_VALID_LINK_TRAINING_TEST_2 no failure."
},
"PORT_INVALID_LINK_TRAINING_TEST": {
"desc": "PORT_INVALID_LINK_TRAINING_TEST must condition failure.",
"eStrKey" : "Pattern",
"eStr": ["on|off"]
},
"PORT_INVALID_TPID_TEST": {
"desc": "PORT_INVALID_TPID_TEST invalid tpid value failure.",
"eStrKey" : "Pattern",

View File

@ -311,6 +311,57 @@
}
},
"PORT_VALID_LINK_TRAINING_TEST_1": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"tpid": "0x8100",
"link_training": "on"
}
]
}
}
},
"PORT_VALID_LINK_TRAINING_TEST_2": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"tpid": "0x8100",
"link_training": "off"
}
]
}
}
},
"PORT_INVALID_LINK_TRAINING_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"tpid": "0x8100",
"link_training": 0
}
]
}
}
},
"PORT_INVALID_TPID_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {

View File

@ -65,6 +65,14 @@ module sonic-port{
}
}
leaf link_training {
description "Port link training mode";
type string {
pattern "on|off";
}
}
leaf autoneg {
description "Port auto negotiation mode";