Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into bookworm
  • Loading branch information
zjswhhh committed Mar 13, 2024
2 parents 7b1e4b9 + 86a9ab6 commit 5786647
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 21 deletions.
20 changes: 15 additions & 5 deletions dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,23 @@ dependent_startup_wait_for=rsyslogd:running

{% if not skip_xcvrd %}
[program:xcvrd]
{% if delay_xcvrd %}
command={% if skip_xcvrd_cmis_mgr %} bash -c "sleep 30 && python3 /usr/local/bin/xcvrd --skip_cmis_mgr" {% else %} bash -c "sleep 30 && python3 /usr/local/bin/xcvrd" {% endif %}
{% set base_command = "python3 /usr/local/bin/xcvrd" %}
{% set options = "" -%}

{% else %}
command={% if skip_xcvrd_cmis_mgr %} python3 /usr/local/bin/xcvrd --skip_cmis_mgr {% else %} python3 /usr/local/bin/xcvrd {% endif %}
{% if skip_xcvrd_cmis_mgr %}
{%- set options = options + " --skip_cmis_mgr" %}
{% endif -%}

{% endif %}
{% if enable_xcvrd_sff_mgr %}
{%- set options = options + " --enable_sff_mgr" %}
{% endif -%}

{% if delay_xcvrd %}
{%- set command = "bash -c \"sleep 30 && " ~ base_command ~ options ~ "\"" %}
{% else %}
{%- set command = base_command ~ options %}
{% endif -%}
command={{ command }}
priority=6
autostart=false
autorestart=unexpected
Expand Down
3 changes: 2 additions & 1 deletion files/image_config/kdump/kdump-tools
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ KDUMP_CMDLINE_APPEND="irqpoll nr_cpus=1 nousb systemd.unit=kdump-tools.service a

# Reboot crash kernel on panic
# Enable debug level logging of crash kernel for better visibility
# Set loglevel to reduce verbosity and print only warning conditions
# Disable advanced pcie features
# Disable high precision event timer as on some platforms it is interfering with the kdump operation
# Pass platform identifier string as part of crash kernel command line to be used by the reboot script during kdump
KDUMP_CMDLINE_APPEND="${KDUMP_CMDLINE_APPEND} panic=10 debug hpet=disable pcie_port=compat pci=nommconf sonic_platform=__PLATFORM__"
KDUMP_CMDLINE_APPEND="${KDUMP_CMDLINE_APPEND} panic=10 debug loglevel=4 hpet=disable pcie_port=compat pci=nommconf sonic_platform=__PLATFORM__"

# Use SONiC reboot wrapper script present in /usr/local/bin post kdump
PATH=/usr/local/bin:$PATH
2 changes: 1 addition & 1 deletion src/sonic-config-engine/tests/simple-sample-graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</PeeringSessions>
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:BGPRouterDeclaration>
<a:ASN>1</a:ASN>
<a:ASN>0</a:ASN>
<a:BgpGroups/>
<a:Hostname>BGPMonitor</a:Hostname>
<a:Peers>
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-config-engine/tests/test_cfggen.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def test_minigraph_bgp_mon(self):
output = self.run_script(argument)
self.assertEqual(
utils.to_dict(output.strip()),
utils.to_dict("{'10.20.30.40': {'rrclient': 0, 'name': 'BGPMonitor', 'local_addr': '10.1.0.32', 'nhopself': 0, 'holdtime': '10', 'asn': '1', 'keepalive': '3'}}")
utils.to_dict("{'10.20.30.40': {'rrclient': 0, 'name': 'BGPMonitor', 'local_addr': '10.1.0.32', 'nhopself': 0, 'holdtime': '10', 'asn': '0', 'keepalive': '3'}}")
)

def test_minigraph_bgp_voq_chassis_peer(self):
Expand Down
8 changes: 4 additions & 4 deletions src/sonic-config-engine/tests/test_minigraph_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def test_minigraph_acl_type_bmcdata(self):
}
# TC1: Minigraph contains acl table type BmcData
sample_mx_graph = os.path.join(self.test_dir,'simple-sample-graph-mx.xml')
result = minigraph.parse_xml(sample_mx_graph)
result = minigraph.parse_xml(sample_mx_graph, port_config_file=self.port_config)
self.assertIn('ACL_TABLE_TYPE', result)
self.assertIn('BMCDATA', result['ACL_TABLE_TYPE'])
self.assertIn('BMCDATAV6', result['ACL_TABLE_TYPE'])
Expand All @@ -537,7 +537,7 @@ def test_minigraph_acl_type_bmcdata(self):
self.assertDictEqual(result['ACL_TABLE']['BMC_ACL_NORTHBOUND'], expected_acl_table_bmc_acl_northbound)
self.assertDictEqual(result['ACL_TABLE']['BMC_ACL_NORTHBOUND_V6'], expected_acl_table_bmc_acl_northbound_v6)
# TC2: Minigraph doesn't contain acl table type BmcData
result = minigraph.parse_xml(self.sample_graph)
result = minigraph.parse_xml(self.sample_graph, port_config_file=self.port_config)
self.assertNotIn('ACL_TABLE_TYPE', result)

def test_parse_device_desc_xml_mgmt_interface(self):
Expand All @@ -564,7 +564,7 @@ def test_mgmt_device_disable_counters(self):
mgmt_graphs = ['simple-sample-graph-mx.xml', 'simple-sample-graph-m0.xml']
for graph in mgmt_graphs:
graph_path = os.path.join(self.test_dir, graph)
result = minigraph.parse_xml(graph_path)
result = minigraph.parse_xml(graph_path, port_config_file=self.port_config)
self.assertIn('FLEX_COUNTER_TABLE', result)
for counter in expected_mgmt_disabled_counters:
self.assertIn(counter, result['FLEX_COUNTER_TABLE'])
Expand All @@ -573,5 +573,5 @@ def test_mgmt_device_disable_counters(self):
if counter in result['FLEX_COUNTER_TABLE']:
self.assertDictEqual(result['FLEX_COUNTER_TABLE'][counter], {'FLEX_COUNTER_STATUS': 'enable'})
# TC2: For other minigraph, result should not contain FLEX_COUNTER_TABLE
result = minigraph.parse_xml(self.sample_graph)
result = minigraph.parse_xml(self.sample_graph, port_config_file=self.port_config)
self.assertNotIn('FLEX_COUNTER_TABLE', result)
15 changes: 10 additions & 5 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,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",
Expand All @@ -1819,7 +1820,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",
Expand All @@ -1829,7 +1831,8 @@ optional attributes.
"alias": "fortyGigE1/4/16",
"speed": "40000",
"laser_freq": "191300",
"tx_power": "-27.3"
"tx_power": "-27.3",
"dom_polling": "disabled"
}
}
}
Expand All @@ -1845,7 +1848,8 @@ optional attributes.
"mtu": "9100",
"alias": "etp1a",
"speed": "100000",
"subport": 1
"subport": 1,
"dom_polling": "enabled"
},
"Ethernet4": {
"admin_status": "up",
Expand All @@ -1855,7 +1859,8 @@ optional attributes.
"mtu": "9100",
"alias": "etp1b",
"speed": "100000",
"subport": 2
"subport": 2,
"dom_polling": "enabled"
},
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,8 @@
"adv_speeds": "all",
"adv_interface_types": "all",
"subport" : "0",
"mode":"trunk"
"mode":"trunk",
"dom_polling":"enabled"
},
"Ethernet3": {
"alias": "Eth1/4",
Expand All @@ -625,7 +626,8 @@
"tpid": "0x9100",
"admin_status": "up",
"subport": "2",
"mode":"trunk"
"mode":"trunk",
"dom_polling":"enabled"
},
"Ethernet5": {
"alias": "Eth2/2",
Expand Down
8 changes: 8 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/port.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@
"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"]
},
"PORT_AUTO_FEC_TEST": {
"desc": "PORT_AUTO_FEC_TEST validate auto mode in fec."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,48 @@
}
},

"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"
}
]
}
}
},

"PORT_AUTO_FEC_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
Expand Down
4 changes: 4 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ module sonic-port{
}
}

leaf dom_polling {
type stypes:admin_mode;
}

leaf pfc_asym {
type string {
pattern "on|off";
Expand Down

0 comments on commit 5786647

Please sign in to comment.