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

Transceiver monitoring HLD #202

Merged
merged 15 commits into from
Jul 6, 2018
Merged

Transceiver monitoring HLD #202

merged 15 commits into from
Jul 6, 2018

Conversation

keboliu
Copy link
Collaborator

@keboliu keboliu commented Jun 1, 2018

Transceiver monitoring HLD

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')

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...

Copy link
Collaborator Author

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.


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:

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

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.

@liatgrozovik
Copy link

liatgrozovik commented Jun 1, 2018 via email


### 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.
Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will add.


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:
Copy link
Contributor

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.

| --- | --- | --- | --- |
| 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 |
Copy link
Contributor

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

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?

Copy link
Collaborator Author

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.

Copy link
Contributor

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

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.

@keboliu keboliu merged commit adccef4 into sonic-net:gh-pages Jul 6, 2018
@reinight
Copy link

reinight commented Jul 6, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants