From b1e51c3e5f90220a79166817204a6ee80a7fa4fd Mon Sep 17 00:00:00 2001 From: Anoop Kamath <115578705+AnoopKamath@users.noreply.github.com> Date: Thu, 21 Dec 2023 08:30:49 -0800 Subject: [PATCH] Support 800G ifname in xcvrd (#416) * Support 800G iframe in xcvrd * Add code coverage --- sonic-xcvrd/tests/test_xcvrd.py | 1 + sonic-xcvrd/xcvrd/xcvrd.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sonic-xcvrd/tests/test_xcvrd.py b/sonic-xcvrd/tests/test_xcvrd.py index 9414d805f..d79747710 100644 --- a/sonic-xcvrd/tests/test_xcvrd.py +++ b/sonic-xcvrd/tests/test_xcvrd.py @@ -987,6 +987,7 @@ def get_application(lane): assert task.is_cmis_application_update_required(mock_xcvr_api, app_new, host_lanes_mask) == expected @pytest.mark.parametrize("ifname, expected", [ + ('800G L C2M', 800000), ('400G CR8', 400000), ('200GBASE-CR4 (Clause 136)', 200000), ('100GBASE-CR2 (Clause 136)', 100000), diff --git a/sonic-xcvrd/xcvrd/xcvrd.py b/sonic-xcvrd/xcvrd/xcvrd.py index 319f15678..60b9d8d09 100644 --- a/sonic-xcvrd/xcvrd/xcvrd.py +++ b/sonic-xcvrd/xcvrd/xcvrd.py @@ -155,7 +155,9 @@ def get_interface_speed(ifname): """ # see HOST_ELECTRICAL_INTERFACE of sff8024.py speed = 0 - if '400G' in ifname: + if '800G' in ifname: + speed = 800000 + elif '400G' in ifname: speed = 400000 elif '200G' in ifname: speed = 200000