Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MCLAG L2 Scenario] Interface Mac address update fails. system mac of active dut is not same as standby - fixes #19618 #6

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
33e0efd
[submodule] Update submodule sonic-utilities to the latest HEAD autom…
mssonicbld Jul 25, 2024
762a9bf
[submodule] Update submodule sonic-platform-daemons to the latest HEA…
mssonicbld Jul 25, 2024
d9e6ab7
[dhcp_server] Remove invoke of dhcpmon when dhcp_server is enabled (#…
yaqiangz Jul 25, 2024
08f333b
add config_db entries for TELEMETRY|gnmi|save_on_set (#19309)
rlucus Jul 25, 2024
4932a38
Make pmon feature delayed flag as jinja template (#19657)
yejianquan Jul 26, 2024
3df1154
[submodule] Update submodule sonic-utilities to the latest HEAD autom…
mssonicbld Jul 26, 2024
9ece6c6
[submodule] Update submodule sonic-swss to the latest HEAD automatica…
mssonicbld Jul 26, 2024
f528412
[submodule] Update submodule sonic-platform-common to the latest HEAD…
mssonicbld Jul 26, 2024
f29ece8
[sflow]: Enable linux capabilities on sflow container for kernel 6.1.…
vivekrnv Jul 26, 2024
3e3a1b9
[logrotate]: Separated sort and head commands to prevent broken pipe …
assrinivasan Jul 26, 2024
11af27d
Support yang model for buffer pool percentage (#19358)
stephenxs Jul 27, 2024
fee8692
[submodule] Update submodule sonic-utilities to the latest HEAD autom…
mssonicbld Jul 27, 2024
9ed57bc
[submodule] Update submodule sonic-linux-kernel to the latest HEAD au…
mssonicbld Jul 27, 2024
3ff9f4f
[submodule] Update submodule sonic-sairedis to the latest HEAD automa…
mssonicbld Jul 28, 2024
66e491d
[Mellanox] fix sfp eeprom unreadable after switching from SW to FW co…
yuazhe Jul 29, 2024
0213180
[submodule] Update submodule sonic-host-services to the latest HEAD a…
mssonicbld Jul 29, 2024
4a69893
[MCLAG L2 Scenario] Interface Mac address update fails. system mac of…
VladimirKuk Jul 29, 2024
e0d3c66
Merge branch 'sonic-net:master' into MCLAG_L2_Scenario
VladimirKuk Jul 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions files/build_templates/init_cfg.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{%- set features = [("bgp", "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}disabled{% else %}enabled{% endif %}", false, "enabled"),
("database", "always_enabled", false, "always_enabled"),
("lldp", "enabled", true, "enabled"),
("pmon", "enabled", true, "enabled"),
("pmon", "enabled", "{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %}False{% else %}True{% endif %}", "enabled"),
("snmp", "enabled", true, "enabled"),
("swss", "enabled", false, "enabled"),
("syncd", "enabled", false, "enabled")] %}
Expand Down Expand Up @@ -71,7 +71,7 @@
{%- for feature, state, delayed, autorestart in features %}
"{{feature}}": {
"state": "{{state}}",
"delayed" : {{delayed | lower()}},
"delayed" : "{{delayed}}",
{%- if feature in ["lldp"] %}
"has_global_scope": {% raw %}"{% if ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['linecard']) %}False{% else %}True{% endif %}"{% endraw %},
"has_per_asic_scope": {% raw %}"{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}False{% else %}True{% endif %}"{% endraw %},
Expand Down
2 changes: 1 addition & 1 deletion files/image_config/logrotate/rsyslog.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
if [ $USED_KB -lt $THRESHOLD_KB ]; then
break
else
OLDEST_ARCHIVE_FILE=$(find /var/log -type f -printf '%T+ %p\n' | grep -E '.+\.[0-9]+(\.gz)?$' | sort | head -n 1 | awk '{ print $2; }')
OLDEST_ARCHIVE_FILE=$(find /var/log -type f -printf '%T+ %p\n' | grep -E '.+\.[0-9]+(\.gz)?$' | sort | awk 'NR == 1 {print $2}')

if [ -z "$OLDEST_ARCHIVE_FILE" ]; then
logger -p syslog.err -t "logrotate" "No archive file to delete -- potential for filling up /var/log partition!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,16 +499,18 @@ def get_change_event_for_module_host_management_mode(self, timeout):
s.on_event(event)

if s.in_stable_state():
self.sfp_module.SFP.wait_sfp_eeprom_ready([s], 2)
s.fill_change_event(port_dict)
s.refresh_poll_obj(self.poll_obj, self.registered_fds)
else:
logger.log_debug(f'SFP {sfp_index} does not reach stable state, state={s.state}')

ready_sfp_set = wait_ready_task.get_ready_set()
for sfp_index in ready_sfp_set:
s = self._sfp_list[sfp_index]
s.on_event(sfp.EVENT_RESET_DONE)
if s.in_stable_state():
self.sfp_module.SFP.wait_sfp_eeprom_ready([s], 2)
s.fill_change_event(port_dict)
s.refresh_poll_obj(self.poll_obj, self.registered_fds)
else:
Expand Down
18 changes: 17 additions & 1 deletion platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,21 @@ def get_presence(self):
return False
eeprom_raw = self._read_eeprom(0, 1, log_on_error=False)
return eeprom_raw is not None

@classmethod
def wait_sfp_eeprom_ready(cls, sfp_list, wait_time):
not_ready_list = sfp_list

while wait_time > 0:
not_ready_list = [s for s in not_ready_list if s.state == STATE_FW_CONTROL and s._read_eeprom(0, 2,False) is None]
if not_ready_list:
time.sleep(0.1)
wait_time -= 0.1
else:
return

for s in not_ready_list:
logger.log_error(f'SFP {s.sdk_index} eeprom is not ready')

# read eeprom specfic bytes beginning from offset with size as num_bytes
def read_eeprom(self, offset, num_bytes):
Expand Down Expand Up @@ -1723,7 +1738,8 @@ def initialize_sfp_modules(cls, sfp_list):
logger.log_error(f'SFP {index} is not in stable state after initializing, state={s.state}')
logger.log_notice(f'SFP {index} is in state {s.state} after module initialization')


cls.wait_sfp_eeprom_ready(sfp_list, 2)

class RJ45Port(NvidiaSFPCommon):
"""class derived from SFP, representing RJ45 ports"""

Expand Down
2 changes: 1 addition & 1 deletion rules/docker-sflow.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SFLOW_DBG)
endif

$(DOCKER_SFLOW)_CONTAINER_NAME = sflow
$(DOCKER_SFLOW)_RUN_OPT += -t
$(DOCKER_SFLOW)_RUN_OPT += -t --cap-add=NET_ADMIN --cap-add=SYS_ADMIN
$(DOCKER_SFLOW)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_SFLOW)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro
$(DOCKER_SFLOW)_RUN_OPT += -v /host/warmboot:/var/warmboot
Expand Down
22 changes: 4 additions & 18 deletions src/iccpd/src/iccp_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2309,27 +2309,13 @@ void update_vlan_if_mac_on_standby(struct LocalInterface* lif_vlan, int dir)

memset(macaddr, 0, 64);
memset(system_mac, 0, ETHER_ADDR_LEN);
if (lif_vlan->is_l3_proto_enabled == false)
{
if (memcmp(MLACP(csm).remote_system.system_id, null_mac, ETHER_ADDR_LEN) == 0) {
ICCPD_LOG_DEBUG(__FUNCTION__, " remote system_id not initialised.");
return;
}
memcpy(system_mac, MLACP(csm).remote_system.system_id, ETHER_ADDR_LEN);
SET_MAC_STR(macaddr, MLACP(csm).remote_system.system_id);
} else {
if (memcmp(MLACP(csm).system_id, null_mac, ETHER_ADDR_LEN) == 0){
ICCPD_LOG_NOTICE(__FUNCTION__, " system_id not initialised.");
return;
}
memcpy(system_mac, MLACP(csm).system_id, ETHER_ADDR_LEN);
SET_MAC_STR(macaddr, MLACP(csm).system_id);
}

if (memcmp(system_mac, null_mac, ETHER_ADDR_LEN) == 0) {
ICCPD_LOG_NOTICE(__FUNCTION__, " system_id not present.");
if (memcmp(MLACP(csm).remote_system.system_id, null_mac, ETHER_ADDR_LEN) == 0) {
ICCPD_LOG_DEBUG(__FUNCTION__, " remote system_id not initialised.");
return;
}
memcpy(system_mac, MLACP(csm).remote_system.system_id, ETHER_ADDR_LEN);
SET_MAC_STR(macaddr, MLACP(csm).remote_system.system_id);

ICCPD_LOG_DEBUG(__FUNCTION__,
"%s Change the system-id of %s from [%02X:%02X:%02X:%02X:%02X:%02X] to [%02X:%02X:%02X:%02X:%02X:%02X], dir %d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ def refresh_dhcrelay(self, force_kill=False):
self._disable_checkers(checkers_to_be_disabled)

self._start_dhcrelay_process(dhcp_interfaces, dhcp_server_ip, force_kill)
self._start_dhcpmon_process(dhcp_interfaces, force_kill)

# TODO dhcpmon is not ready for count packet for dhcp_server, hence comment invoke it for now
# self._start_dhcpmon_process(dhcp_interfaces, force_kill)

def wait(self):
"""
Expand Down Expand Up @@ -307,7 +309,7 @@ def _start_dhcpmon_process(self, new_dhcp_interfaces, force_kill):
for pid, cmds in pids_cmds.items():
proc = psutil.Process(pid)
if proc.status() == psutil.STATUS_ZOMBIE:
syslog.syslog(syslog.LOG_ERR, "Faild to start dhcpmon process: {}".format(cmds))
syslog.syslog(syslog.LOG_ERR, "Failed to start dhcpmon process: {}".format(cmds))
terminate_proc(proc)
else:
syslog.syslog(syslog.LOG_INFO, "dhcpmon process started successfully, cmds: {}".format(cmds))
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-host-services
2 changes: 1 addition & 1 deletion src/sonic-linux-kernel
2 changes: 1 addition & 1 deletion src/sonic-sairedis
2 changes: 1 addition & 1 deletion src/sonic-swss
7 changes: 5 additions & 2 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ When the system is running in traditional buffer model, the size of all of the b
```

When the system is running in dynamic buffer model, the size of some of the buffer pools can be omitted and will be dynamically calculated.
In this case, A percentage can be configured on a pool, representing how many the available buffer can be allloced to the pool.

```
{
Expand All @@ -584,11 +585,12 @@ When the system is running in dynamic buffer model, the size of some of the buff
},
"egress_lossy_pool": {
"type": "egress",
"mode": "dynamic",
"mode": "dynamic"
},
"ingress_lossless_pool": {
"type": "ingress",
"mode": "dynamic",
"percentage": "80"
}
}
}
Expand Down Expand Up @@ -2332,7 +2334,8 @@ and is listed in this table.
"gnmi": {
"client_auth": "true",
"log_level": "2",
"port": "50051"
"port": "50051",
"save_on_set": "false"
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"size": "12766208",
"type": "egress",
"mode": "dynamic"
},
"ingress_percentage_pool": {
"type": "ingress",
"mode": "dynamic",
"percentage": "90"
}
},
"BUFFER_PROFILE": {
Expand Down Expand Up @@ -351,6 +356,7 @@
},
"DEVICE_METADATA": {
"localhost": {
"buffer_model": "dynamic",
"type": "ToRRouter",
"asic_id": "06:00.0",
"mac": "00:11:22:33:dd:5a",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,23 @@
"BUFFER_POOL_WRONG_SIZE_VALUE": {
"desc": "BUFFER_POOL_WRONG_SIZE_VALUE pattern failure.",
"eStr": "wrong"
},
"BUFFER_POOL_CORRECT_PERCENTAGE_VALUE": {
"desc": "BUFFER_POOL_CORRECT_PERCENTAGE_VALUE no failure."
},
"BUFFER_POOL_CORRECT_LARGE_PERCENTAGE_VALUE": {
"desc": "BUFFER_POOL_CORRECT_PERCENTAGE_VALUE no failure."
},
"BUFFER_POOL_WRONG_PERCENTAGE_NEGATIVE_VALUE": {
"desc": "BUFFER_POOL_WRONG_PERCENTAGE_NEGATIVE_VALUE pattern failure.",
"eStr": "Invalid value"
},
"BUFFER_POOL_WRONG_PERCENTAGE_NOT_A_NUMBER_VALUE": {
"desc": "BUFFER_POOL_WRONG_PERCENTAGE_NOT_A_NUMBER_VALUE pattern failure.",
"eStr": "Invalid value"
},
"BUFFER_POOL_WRONG_PERCENTAGE_VALUE_WITH_SIZE": {
"desc": "BUFFER_POOL_WRONG_PERCENTAGE_VALUE_WITH_SIZE pattern failure.",
"eStr": "Percentage should not be configured along with size"
}
}
4 changes: 4 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/gnmi.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"desc": "TABLE_WITH_INCORRECT_PORT failure.",
"eStrKey": "InvalidValue"
},
"GNMI_TABLE_WITH_INCORRECT_SAVE_ON_SET": {
"desc": "TABLE_WITH_INCORRECT_SAVE_ON_SET failure",
"eStrKey": "InvalidValue"
},
"GNMI_TABLE_WITH_VALID_CONFIG": {
"desc": "TABLE WITH VALID CONFIG."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"desc": "TABLE_WITH_INCORRECT_PORT failure.",
"eStrKey": "InvalidValue"
},
"TELEMETRY_TABLE_WITH_INCORRECT_SAVE_ON_SET": {
"desc": "TABLE_WITH_INCORRECT_SAVE_ON_SET failure",
"eStrKey": "InvalidValue"
},
"TELEMETRY_TABLE_WITH_VALID_CONFIG": {
"desc": "TABLE WITH VALID CONFIG."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,90 @@
]
}
}
},
"BUFFER_POOL_CORRECT_PERCENTAGE_VALUE": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"localhost":{
"buffer_model": "dynamic"
}
}
},
"sonic-buffer-pool:sonic-buffer-pool": {
"sonic-buffer-pool:BUFFER_POOL": {
"BUFFER_POOL_LIST": [
{
"name": "ingress_lossless_pool",
"mode": "dynamic",
"percentage": "99",
"type": "ingress"
}
]
}
}
},
"BUFFER_POOL_CORRECT_LARGE_PERCENTAGE_VALUE": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"localhost":{
"buffer_model": "dynamic"
}
}
},
"sonic-buffer-pool:sonic-buffer-pool": {
"sonic-buffer-pool:BUFFER_POOL": {
"BUFFER_POOL_LIST": [
{
"name": "ingress_lossless_pool",
"mode": "dynamic",
"percentage": "200",
"type": "ingress"
}
]
}
}
},
"BUFFER_POOL_WRONG_PERCENTAGE_NEGATIVE_VALUE": {
"sonic-buffer-pool:sonic-buffer-pool": {
"sonic-buffer-pool:BUFFER_POOL": {
"BUFFER_POOL_LIST": [
{
"name": "ingress_lossless_pool",
"mode": "static",
"percentage": "-10",
"type": "ingress"
}
]
}
}
},
"BUFFER_POOL_WRONG_PERCENTAGE_NOT_A_NUMBER_VALUE": {
"sonic-buffer-pool:sonic-buffer-pool": {
"sonic-buffer-pool:BUFFER_POOL": {
"BUFFER_POOL_LIST": [
{
"name": "ingress_lossless_pool",
"mode": "static",
"percentage": "NaN",
"type": "ingress"
}
]
}
}
},
"BUFFER_POOL_WRONG_PERCENTAGE_VALUE_WITH_SIZE": {
"sonic-buffer-pool:sonic-buffer-pool": {
"sonic-buffer-pool:BUFFER_POOL": {
"BUFFER_POOL_LIST": [
{
"name": "ingress_lossless_pool",
"mode": "static",
"percentage": "90",
"size": "12766208",
"type": "ingress"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@
}
}
},
"GNMI_TABLE_WITH_INCORRECT_SAVE_ON_SET": {
"sonic-gnmi:sonic-gnmi": {
"sonic-gnmi:GNMI": {
"certs": {
"ca_crt": "/etc/sonic/credentials/dsmsroot.cer",
"server_crt": "/etc/sonic/credentials/server.cer",
"server_key": "/etc/sonic/credentials/server.key"
},
"gnmi": {
"client_auth": "true",
"log_level": "2",
"port": "50051",
"save_on_set": "wrong"
}
}
}
},
"GNMI_TABLE_WITH_VALID_CONFIG": {
"sonic-gnmi:sonic-gnmi": {
"sonic-gnmi:GNMI": {
Expand All @@ -58,7 +75,8 @@
"gnmi": {
"client_auth": "true",
"log_level": "2",
"port": "50052"
"port": "50052",
"save_on_set": "false"
}
}
}
Expand Down
Loading