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

The user framework module complies with s3ip sysfs specification #12894

Merged
merged 2 commits into from
Dec 14, 2022

Conversation

tianshangfei
Copy link
Contributor

@tianshangfei tianshangfei commented Nov 30, 2022

Signed-off-by: tianshangfei tian_shangfei@163.com

Why I did it

The user framework module complies with s3ip sysfs specification

How I did it

1、 create a s3ip_sysfs service
2、 the s3ip_sysfs service call the “s3ip_sysfs_tool.sh” to install kernel module and run s3ip_load.py
3、 s3ip_load.py will parse the s3ip_sysfs_conf.json configuration file and create /sys_switch/ directory

How to verify it

A demo driver base on this framework will display the sysfs node which conforms to the s3ip sysfs specification

Which release branch to backport (provide reason below if selected)

The s3ip framework

  • 202211

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: tianshangfei <tian_shangfei@163.com>
@adyeung
Copy link
Collaborator

adyeung commented Nov 30, 2022

@FuzailBrcm pls help review

"path": "/sys_switch/temp_sensor",
"type" : "path",
"value" : "/sys/s3ip/temp_sensor",
"description": "温度传感器信息"
Copy link
Contributor

Choose a reason for hiding this comment

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

These descriptions are being shown in Mandarin. Can you change it to english pls?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, it has been modified

"description": "ONIE EEPROM"
},
{
"path": "/sys_switch/fan",
Copy link
Contributor

Choose a reason for hiding this comment

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

What if a platform drivers are already loaded and path to read fan_speed is
/sys/bus/i2c/devices/x-00y/fan<>_input

How can we mention this in the JSON file? Can you give an example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The example you want is shown below,
{
"path": "/sys_switch/fan/fan1/motor0/speed",
"type" : "path",
"value" : "/sys/bus/i2c/devices/x-00y/fan<>_input",
"description": "the motor0 of fan1 speed information"
},

@FuzailBrcm
Copy link
Contributor

Generally speaking, is it possible to link (via softlinks) the S3IP framework SysFS to the SysFS created by the BSP drivers? If yes, how?

Signed-off-by: tianshangfei <tian_shangfei@163.com>
@tianshangfei
Copy link
Contributor Author

Generally speaking, is it possible to link (via softlinks) the S3IP framework SysFS to the SysFS created by the BSP drivers? If yes, how?

Ok. For example, if the LED driver is based on the kernel framework of S3IP, the framework will automatically create the path /sys/s3ip/sysled.
The S3IP specification requires the path to be /sys_switch/sysled. Use the following configuration files. The user framework of S3IP will assist create soft connections from /sys/s3ip/sysled to /sys_switch/sysled.
{
"path": "/sys_switch/sysled",
"type" : "path",
"value" : "/sys/s3ip/sysled",
"description": "SYS LED information"
},

The kernel framework helps you create legitimate hardware information attributes.
The user framework helps you reuse the sysfs path and create the soft link, ultimately creating a directory structure that meets the requirements of the S3IP specification

Copy link
Contributor

@FuzailBrcm FuzailBrcm left a comment

Choose a reason for hiding this comment

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

Changes look good to me

@StormLiangMS StormLiangMS merged commit f7d80e6 into sonic-net:master Dec 14, 2022
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Jan 1, 2023
…ic-net#12894)

Why I did it
The user framework module complies with s3ip sysfs specification

How I did it
1、 create a s3ip_sysfs service
2、 the s3ip_sysfs service call the “s3ip_sysfs_tool.sh” to install kernel module and run s3ip_load.py
3、 s3ip_load.py will parse the s3ip_sysfs_conf.json configuration file and create /sys_switch/ directory

How to verify it
A demo driver base on this framework will display the sysfs node wich conform to the s3ip sysfs specification
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202211: #13215

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

Successfully merging this pull request may close these issues.

5 participants