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

[mlnx-platform] enhancement for xcvrd implementation on mlnx platform #1937

Merged
merged 2 commits into from
Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
190 changes: 0 additions & 190 deletions device/mellanox/x86_64-mlnx_lssn2700-r0/plugins/sfputil.py

This file was deleted.

7 changes: 7 additions & 0 deletions device/mellanox/x86_64-mlnx_msn2100-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class SfpUtil(SfpUtilBase):
db_sel_object = None
db_sel_tbl = None
state_db = None
sfpd_status_tbl = None

@property
def port_start(self):
Expand Down Expand Up @@ -176,6 +177,12 @@ def get_transceiver_change_event(self, timeout=0):
self.db_sel.addSelectable(self.db_sel_tbl)
self.db_sel_timeout = swsscommon.Select.TIMEOUT
self.db_sel_object = swsscommon.Select.OBJECT
self.sfpd_status_tbl = swsscommon.Table(self.state_db, 'MLNX_SFPD_TASK')

# Check the liveness of mlnx-sfpd, if it failed, return false
keys = self.sfpd_status_tbl.getKeys()
if 'LIVENESS' not in keys:
return False, phy_port_dict

(state, c) = self.db_sel.select(timeout)
if state == self.db_sel_timeout:
Expand Down
9 changes: 8 additions & 1 deletion device/mellanox/x86_64-mlnx_msn2410-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class SfpUtil(SfpUtilBase):
db_sel_object = None
db_sel_tbl = None
state_db = None
sfpd_status_tbl = None

@property
def port_start(self):
Expand All @@ -48,7 +49,7 @@ def port_to_eeprom_mapping(self):
return self._port_to_eeprom_mapping

def __init__(self):
eeprom_path = "/sys/class/i2c-adapter/i2c-2/2-0048/hwmon/hwmon6/qsfp{0}_eeprom"
eeprom_path = "/sys/class/i2c-adapter/i2c-2/2-0048/hwmon/hwmon7/qsfp{0}_eeprom"

for x in range(0, self.port_end + 1):
self._port_to_eeprom_mapping[x] = eeprom_path.format(x + self.EEPROM_OFFSET)
Expand Down Expand Up @@ -177,6 +178,12 @@ def get_transceiver_change_event(self, timeout=0):
self.db_sel.addSelectable(self.db_sel_tbl)
self.db_sel_timeout = swsscommon.Select.TIMEOUT
self.db_sel_object = swsscommon.Select.OBJECT
self.sfpd_status_tbl = swsscommon.Table(self.state_db, 'MLNX_SFPD_TASK')

# Check the liveness of mlnx-sfpd, if it failed, return false
keys = self.sfpd_status_tbl.getKeys()
if 'LIVENESS' not in keys:
return False, phy_port_dict

(state, c) = self.db_sel.select(timeout)
if state == self.db_sel_timeout:
Expand Down
7 changes: 7 additions & 0 deletions device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class SfpUtil(SfpUtilBase):
db_sel_object = None
db_sel_tbl = None
state_db = None
sfpd_status_tbl = None

@property
def port_start(self):
Expand Down Expand Up @@ -176,6 +177,12 @@ def get_transceiver_change_event(self, timeout=0):
self.db_sel.addSelectable(self.db_sel_tbl)
self.db_sel_timeout = swsscommon.Select.TIMEOUT
self.db_sel_object = swsscommon.Select.OBJECT
self.sfpd_status_tbl = swsscommon.Table(self.state_db, 'MLNX_SFPD_TASK')

# Check the liveness of mlnx-sfpd, if it failed, return false
keys = self.sfpd_status_tbl.getKeys()
if 'LIVENESS' not in keys:
return False, phy_port_dict

(state, c) = self.db_sel.select(timeout)
if state == self.db_sel_timeout:
Expand Down
7 changes: 7 additions & 0 deletions device/mellanox/x86_64-mlnx_msn2740-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class SfpUtil(SfpUtilBase):
db_sel_object = None
db_sel_tbl = None
state_db = None
sfpd_status_tbl = None

@property
def port_start(self):
Expand Down Expand Up @@ -176,6 +177,12 @@ def get_transceiver_change_event(self, timeout=0):
self.db_sel.addSelectable(self.db_sel_tbl)
self.db_sel_timeout = swsscommon.Select.TIMEOUT
self.db_sel_object = swsscommon.Select.OBJECT
self.sfpd_status_tbl = swsscommon.Table(self.state_db, 'MLNX_SFPD_TASK')

# Check the liveness of mlnx-sfpd, if it failed, return false
keys = self.sfpd_status_tbl.getKeys()
if 'LIVENESS' not in keys:
return False, phy_port_dict

(state, c) = self.db_sel.select(timeout)
if state == self.db_sel_timeout:
Expand Down