-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Transceiver monitoring HLD #202
Conversation
This reverts commit 3a60b65.
doc/transceiver-monitor-hld.md
Outdated
header.wd, header.mask, header.cookie, header.len, type_names, | ||
watch_path.decode('utf-8'), filename.decode('utf-8')) | ||
finally: | ||
i.remove_watch(b'/tmp') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this is just an example but looks like remove_watch does not match the add_watch
also /bsp/ is not available in pmon (it will run in pmon, right?) so it is better to use /sys/bus...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we should mount /sys/bus to pmon, will revise the example.
doc/transceiver-monitor-hld.md
Outdated
|
||
Transceiver plug in/out status can be derived from the content of sysfs file like `"/sys/bus/i2c/devices/2-0048/hwmon/hwmon7/qsfp10_status"`, if the content of the file is "good" represent SFP is present, conent change to "not_connected" means SFP plug out. | ||
|
||
To monitor the file change, can introduce python lib [inotify](https://pypi.org/project/inotify/), which can raise notification when target file change. Below is a sample for how to use inotify lib to monitor file change: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here some details are missing. Who will generate events? where it will run? Is it part of Xcvrd or a separate daemon? If not part of Xcvrd - how event will be passed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Andriy. This is the most tricky part. Need more details.
How should we get the list of path to watch for different vendor? and what are the ""good" and "not_connected" value different vendors? How to retrieve them in the platform monitor container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. I think I sent the comment back. I forget to hit the review button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think each vendor have to implement their own API to fetch the watching path list and also the API to judge the status of the transceiver according to the file content. I'll define some API here. maybe the current CLI to show SFP presence is a good example here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Sounds good to me.
Arent the events generated by inotofy and should be in xcvrd?
Best regards,
Liat Grozovik
Sent from my Samsung Galaxy smartphone. Typo is expected, sorry in advance.
-------- Original message --------
From: andriymoroz <[email protected]>
Date: 6/1/18 15:07 (GMT+02:00)
To: Azure/SONiC <[email protected]>
Cc: Subscribed <[email protected]>
Subject: Re: [Azure/SONiC] Transceiver monitoring HLD (#202)
@andriymoroz commented on this pull request.
________________________________
In doc/transceiver-monitor-hld.md<#202 (comment)>:
+### 1.2 Access eeprom from platform container ###
+
+Transceiver information eeprom can be accessed via read files(e.g. /sys/bus/i2c/devices/2-0048/hwmon/hwmon4/qsfp9_eeprom), different vendors may have these files under different folders, these folder need to be mounted to platform container so Xcvrd can access them.
+
+Another potential enhancement to the eeprom reading is to only read the needed parameters out instead of read all of them, this can be achieved by add new API to `SfpUtilBase` which can read desired bytes starting from give offset and parse the bytes to readable format accordingly.
+
+For the convenience of implementation and reduce the time consuming, need to enhance the `SfpUtilBase` class to provide functions to get `eeprom_if_dict` and `eeprom_dom_dict` separately, the intrested values are defined in section 1.1.1 and 1.1.2, we can pick up these values from eeprom by calling the above new API with proper offset and number of bytes.
+
+
+### 1.3 Transceiver plug in/out event ###
+
+Xcvrd need to be triggered by transceiver plug in/out event to refresh the transceiver info table.
+
+Transceiver plug in/out status can be derived from the content of sysfs file like `"/sys/bus/i2c/devices/2-0048/hwmon/hwmon7/qsfp10_status"`, if the content of the file is "good" represent SFP is present, conent change to "not_connected" means SFP plug out.
+
+To monitor the file change, can introduce python lib [inotify](https://pypi.org/project/inotify/), which can raise notification when target file change. Below is a sample for how to use inotify lib to monitor file change:
here some details are missing. Who will generate events? where it will run? Is it part of Xcvrd or a separate daemon? If not part of Xcvrd - how event will be passed?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#202 (review)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AQ8YX0e8XxO8eL3-abI3cDcZL8AyRU1qks5t4S6bgaJpZM4UWhUY>.
|
|
||
### 2.2 New connection to STATE_DB ### | ||
|
||
To get the transceiver and dom sensor status, SNMP agent need to connect to STATE\_DB and fetch information from TRNASCEIVER_TABLE which will be updated by Xcvrd when this is status change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add more details about how SNMP agent should connect to DB? Could it subscribe to the change of Transceiver tables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add.
doc/transceiver-monitor-hld.md
Outdated
|
||
Transceiver plug in/out status can be derived from the content of sysfs file like `"/sys/bus/i2c/devices/2-0048/hwmon/hwmon7/qsfp10_status"`, if the content of the file is "good" represent SFP is present, conent change to "not_connected" means SFP plug out. | ||
|
||
To monitor the file change, can introduce python lib [inotify](https://pypi.org/project/inotify/), which can raise notification when target file change. Below is a sample for how to use inotify lib to monitor file change: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Andriy. This is the most tricky part. Need more details.
How should we get the list of path to watch for different vendor? and what are the ""good" and "not_connected" value different vendors? How to retrieve them in the platform monitor container.
doc/transceiver-monitor-hld.md
Outdated
| --- | --- | --- | --- | | ||
| 1.3.6.1.2.1.47.1.1.1 | entPhysicalTable | | | | ||
| 1.3.6.1.2.1.47.1.1.1.1 | entPhysicalEntry | | | | ||
| 1.3.6.1.2.1.47.1.1.1.1.2. ifindex | entPhysicalDescr | Show interfaces alias | Xcvr for Ethernet29 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ifindex should be replaced with index, which is Ifindex * 1000, as changed in requirement
tx2bias = FLOAT ; tx2 bias in mA | ||
tx3bias = FLOAT ; tx3 bias in mA | ||
tx4bias = FLOAT ; tx4 bias in mA | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add TX power? Or TX bias is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yongcanwang00 this is defined in the requirement doc, I would like to ask the requirement author @hui-ma to comment on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TX bias is from the output of "show interfaces transceiver eeprom" command, It is also the output of some other vendors' snmp output. I think they can be translated into TX power. I need to look for its equation. Do you prefer TX power in the output directly?
ChannelMonitorValues:
RX1Power: -1.1936dBm
RX2Power: -1.1793dBm
RX3Power: -0.9388dBm
RX4Power: -1.0729dBm
TX1Bias: 4.0140mA
TX2Bias: 4.0140mA
TX3Bias: 4.0140mA
TX4Bias: 4.0140mA
ModuleMonitorValues :
Temperature : 1.1111C
Vcc : 0.0000Volts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, TX power is useful. It's helpful to have them both.
If the transceiver is damaged, what will SfpUtil return when Xcrvd pull the info? Is it depends on the vendor's implementation and we don't care about it? |
Transceiver monitoring HLD