[YANG]: Add Yang model support for adding dom_polling to PORT table (#18277) (#18343)

Added YANG related changes for adding `dom_polling` field in PORT table of CONFIG_DB. This field can be set with `config interface transceiver dom PORT_NAME (enable|disable)` CLI.

The `dom_polling` field was added through https://github.com/sonic-net/sonic-utilities/pull/3187. Please refer to this PR for the details on the reason for adding `dom_polling` field.

Added `dom_polling` field to CONFIG_DB PORT table.

Added unit tests for both valid and invalid options for controlling `dom_polling`.
Valid values for for `dom_polling` are `enabled` and `disabled`
Any other value is treated as an invalid value
This commit is contained in:
mihirpat1 2024-03-17 19:56:37 -07:00 committed by GitHub
parent 913fbce911
commit 12dcaf453a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 70 additions and 9 deletions

View File

@ -1634,7 +1634,8 @@ optional attributes.
"speed": "40000",
"link_training": "off",
"laser_freq": "191300",
"tx_power": "-27.3"
"tx_power": "-27.3",
"dom_polling": "enabled"
},
"Ethernet1": {
"index": "1",
@ -1646,7 +1647,8 @@ optional attributes.
"speed": "40000",
"link_training": "on",
"laser_freq": "191300",
"tx_power": "-27.3"
"tx_power": "-27.3",
"dom_polling": "enabled"
},
"Ethernet63": {
"index": "63",
@ -1656,7 +1658,8 @@ optional attributes.
"alias": "fortyGigE1/4/16",
"speed": "40000",
"laser_freq": "191300",
"tx_power": "-27.3"
"tx_power": "-27.3",
"dom_polling": "disabled"
}
}
}
@ -1672,7 +1675,8 @@ optional attributes.
"mtu": "9100",
"alias": "etp1a",
"speed": "100000",
"subport": 1
"subport": 1,
"dom_polling": "enabled"
},
"Ethernet4": {
"admin_status": "up",
@ -1682,7 +1686,8 @@ optional attributes.
"mtu": "9100",
"alias": "etp1b",
"speed": "100000",
"subport": 2
"subport": 2,
"dom_polling": "enabled"
},
}
}

View File

@ -574,7 +574,8 @@
"autoneg": "on",
"adv_speeds": "all",
"adv_interface_types": "all",
"subport" : "0"
"subport" : "0",
"dom_polling":"enabled"
},
"Ethernet3": {
"alias": "Eth1/4",
@ -592,7 +593,8 @@
"speed": "11100",
"tpid": "0x9100",
"admin_status": "up",
"subport": "2"
"subport": "2",
"dom_polling":"enabled"
},
"Ethernet5": {
"alias": "Eth2/2",

View File

@ -128,5 +128,13 @@
"desc": "Out of range subport number",
"eStrKey": "Range",
"eStr": "0..8"
}
},
"PORT_VALID_DOM_POLLING": {
"desc": "PORT_VALID_DOM_POLLING no failure."
},
"PORT_INVALID_DOM_POLLING": {
"desc": "PORT_INVALID_DOM_POLLING invalid condition failure.",
"eStrKey" : "InvalidValue",
"eStr": ["dom_polling"]
}
}

View File

@ -638,5 +638,47 @@
]
}
}
}
},
"PORT_INVALID_DOM_POLLING": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet0",
"alias": "etp1a",
"lanes": "60, 61",
"speed": 100000,
"subport": 1,
"dom_polling": "on"
}
]
}
}
},
"PORT_VALID_DOM_POLLING": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet0",
"alias": "etp1a",
"lanes": "60, 61",
"speed": 100000,
"subport": 1,
"dom_polling": "enabled"
},
{
"name": "Ethernet2",
"alias": "etp1b",
"lanes": "62, 63",
"speed": 100000,
"subport": 2,
"dom_polling": "disabled"
}
]
}
}
}
}

View File

@ -155,6 +155,10 @@ module sonic-port{
}
}
leaf dom_polling {
type stypes:admin_mode;
}
leaf pfc_asym {
type string {
pattern "on|off";