Skip to content

Commit

Permalink
[202205] Add media assignment options to Application Advertisement (s…
Browse files Browse the repository at this point in the history
…onic-net#324) (sonic-net#329)

- Description
Add media assignment options to Application Advertisement

- Motivation and Context
Add media assignment options to Application Advertisement

- How Has This Been Tested?
Manual test
  • Loading branch information
Junchao-Mellanox authored Dec 2, 2022
1 parent b20896c commit 79a36e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions sonic_platform_base/sonic_xcvr/api/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1914,6 +1914,11 @@ def get_application_advertisement(self):
break
buf['host_lane_assignment_options'] = val

key = "{}_{}".format(consts.MEDIA_LANE_ASSIGNMENT_OPTION, app)
val = dic.get(key)
if val is not None:
buf['media_lane_assignment_options'] = val

ret[app] = buf
return ret

Expand Down
4 changes: 3 additions & 1 deletion tests/sonic_xcvr/test_cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,8 @@ def test_get_application_advertisement(self):
consts.MODULE_MEDIA_INTERFACE_SM + "_1": "400GBASE-DR4 (Cl 124)",
consts.MEDIA_LANE_COUNT + "_1": 4,
consts.HOST_LANE_COUNT + "_1": 8,
consts.HOST_LANE_ASSIGNMENT_OPTION + "_1": 0x01
consts.HOST_LANE_ASSIGNMENT_OPTION + "_1": 0x01,
consts.MEDIA_LANE_ASSIGNMENT_OPTION + "_1": 0x02
},
Sff8024.MODULE_MEDIA_TYPE[2]
]
Expand All @@ -2003,6 +2004,7 @@ def test_get_application_advertisement(self):
assert result[1]['host_lane_count'] == 8
assert result[1]['media_lane_count'] == 4
assert result[1]['host_lane_assignment_options'] == 0x01
assert result[1]['media_lane_assignment_options'] == 0x02

def test_get_application_advertisement_non_support(self):
self.api.xcvr_eeprom.read = MagicMock(return_value = None)
Expand Down

0 comments on commit 79a36e2

Please sign in to comment.