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

[mellanox] Implement PSU APIs based on the new platform API #2460

Merged
merged 1 commit into from
Feb 13, 2019

Conversation

kevinwangsk
Copy link
Contributor

Signed-off-by: Kevin Wang [email protected]

- What I did
Based on the new platform API, implement part of the PSU related APIs.Currently, just cover four APIs, get_status(), get_presence(), get_num_psus() and get_psu().
- How I did it
It will be built in a package named sonic_platform which is placed under sonic-buildimage/platform/mellanox/mlnx-platform-api. Pmon container will install the sonic_platform as a python wheel package. It will not break the compilation on the platform which has not implemented this yet.
- How to verify it
Import the sonic_platform package and write some sample script according to the new platform API design doc sonic-net/SONiC#285.
- Description for the changelog

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

@kevinwangsk kevinwangsk force-pushed the psu_new_api branch 2 times, most recently from 5e9a27f to 49cdbe4 Compare January 18, 2019 02:30
# SONIC_PLATFORM_API_PY2 package

SONIC_PLATFORM_API_PY2 = mlnx_platform_api-1.0-py2-none-any.whl
$(SONIC_PLATFORM_API_PY2)_SRC_PATH = $(PLATFORM_PATH)/mlnx-platform-api
Copy link
Contributor

Choose a reason for hiding this comment

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

So the thought here is that each platform vendor can name their Python wheel anything they like as long as it installs a package called "sonic_platform", correct?

Copy link
Contributor Author

@kevinwangsk kevinwangsk Jan 24, 2019

Choose a reason for hiding this comment

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

Yes, correct. Rename the name to "sonic_platform_api" as there is already a python package named "sonic_platform".

def __init__(self):
ChassisBase.__init__(self)
self._psu_list.append(None)
for index in range(1, MLNX_NUM_PSU + 1):
Copy link
Contributor

Choose a reason for hiding this comment

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

I debated changing PSU indexing from being 1-based (like the old plugin API) to being 0-based. The reasoning is that currently PSUs are referenced as 1-based, whereas other components (transceivers, etc.) are 0-based, so I thought of converting everything to 0-based for consistency (because I feel it will be confusing if each component has a different numbering scheme).

However, we can keep PSUs as 1-based if we think it's necessary. If so, we should also modify the comments here and in sonic-platform-common appropriately, because as you can see below, I mention that get_psu() takes a 0-based value. What are your thoughts?

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, just not aware of the discussion you had for this change. I think 0-based makes more sense. :) But we may need to update the design doc to notice the vendors about this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed. I think it makes sense to count all devices with base 0 in this API.

If we think it's more "user-friendly" to display information 1-based to the end user, then we should translate from 0-based to 1-based in the appropriate show commands.

Choose a reason for hiding this comment

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

Is SNMP going to use this same API ? If it is, we might need to consider that SNMP is 1 based for table index.

Copy link
Contributor

Choose a reason for hiding this comment

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

@JohnFanDNI: Yes, SNMP will use this API, much like it currently uses the existing platform API. I believe that was the main reason for using a 1-based index for PSUs in the first place. However, I think it will be better to unify the API and use 0-based indexing for all devices. The SNMP sub-agent will simply need to be modified to add 1 to all PSU indices. Do you see an issue with this? The alternative would be to have to platform API reference all devices using 1-based indexing, which I feel would needlessly complicate the API.

* Implement part of PSU related APIs including get_status(), get_presence()

Signed-off-by: Kevin Wang <[email protected]>
@liat-grozovik
Copy link
Collaborator

@jleveque before we merge this PR just want to clarify that we will have both old and new APIs supported while the daemon will continue using the old APIs.
Do you know what is the plan to have new APIs supported by other vendors so we will be able to do the change in the daemon and remove the old API support. We will reduce maintenance on different code base.

@jleveque
Copy link
Contributor

@liat-grozovik: Yes. We intend for the daemons to continue using the old API until all vendors have provided implementations of the new API, at which point we will refactor the daemons to use the new API and deprecate the old.

@liat-grozovik liat-grozovik merged commit a9d2bf3 into sonic-net:master Feb 13, 2019
yxieca added a commit to yxieca/sonic-buildimage that referenced this pull request Sep 21, 2022
…e submodule head

linkmgrd:
* 05e5f4c 2022-09-20 | [Active-Active] flaky LinkmgrdBootupSequence unit tests (sonic-net#134) (HEAD -> 202205) [Jing Zhang]
* 16fcadf 2022-09-13 | [active-standby] update warmboot reconciliation logic (sonic-net#129) [Jing Zhang]
* e656a87 2022-09-09 | [active-active] shutdown link prober when starting as isolated (sonic-net#130) [Jing Zhang]

uttilities:
yinxi@ying-dev-vm-01:~/src/sonic-202205/src/sonic-utilities$ git hist github/202205..HEAD
* 562188f 2022-09-14 | Use 'default' VRF when VRF name is not provided (sonic-net#2368) (HEAD -> 202205) [Sumukha Tumkur Vani]
* c50ba4f 2022-09-20 | [minigraph] add option to specify golden path in load_minigraph (sonic-net#2350) [jingwenxie]
* cec5ab2 2022-09-20 | [GCU]Remove GCU unique lane check for duplicate lanes platforms (sonic-net#2343) [jingwenxie]
* 8d20771 2022-09-15 | Vnet_route_check Vxlan tunnel route update. (sonic-net#2281) [siqbal1986]

swss:
* 88371f7 2022-09-21 | [ci] Only when test stage succeeded or succeededwithissues, PR run Gcov (sonic-net#2460) (HEAD -> 202205) [Liu Shilong]
* c11dbd7 2022-09-15 | [QoS] Enforce drop probability only for colors whose WRED are enabled (sonic-net#2422) [Stephen Sun]

sairedis:
* 80928dd 2022-09-06 | [lgtm] Add uuid library (sonic-net#1119) (HEAD -> 202205, github/202205) [Kamil Cudnik]
* c147dd0 2022-09-16 | [202205][vslib]: Add SAI_PORT_ATTR_OPER_SPEED get sonic-net#1123 [Ze Gan]

platform-daemon:
* 9cf8adf 2022-09-21 | [ycabled] add notification for gRPC connection state transitions to  IDLE/TRANSIENT_FAILURE (sonic-net#295) (HEAD -> 202205) [vdahiya12]
* 1e07ae3 2022-09-20 | Use get() to fetch default value from dictionary for port admin_status sonic-net#286 [anamehra]
* 157f483 2022-09-15 | [Xcvrd] Soak duplicate events and process only updated interested events (sonic-net#285) [Prince George]

Signed-off-by: Ying Xie <[email protected]>
liat-grozovik pushed a commit that referenced this pull request Sep 22, 2022
…e submodule head (#12149)

linkmgrd:
* 05e5f4c 2022-09-20 | [Active-Active] flaky LinkmgrdBootupSequence unit tests (#134) (HEAD -> 202205) [Jing Zhang]
* 16fcadf 2022-09-13 | [active-standby] update warmboot reconciliation logic (#129) [Jing Zhang]
* e656a87 2022-09-09 | [active-active] shutdown link prober when starting as isolated (#130) [Jing Zhang]

uttilities:
yinxi@ying-dev-vm-01:~/src/sonic-202205/src/sonic-utilities$ git hist github/202205..HEAD
* 562188f 2022-09-14 | Use 'default' VRF when VRF name is not provided (#2368) (HEAD -> 202205) [Sumukha Tumkur Vani]
* c50ba4f 2022-09-20 | [minigraph] add option to specify golden path in load_minigraph (#2350) [jingwenxie]
* cec5ab2 2022-09-20 | [GCU]Remove GCU unique lane check for duplicate lanes platforms (#2343) [jingwenxie]
* 8d20771 2022-09-15 | Vnet_route_check Vxlan tunnel route update. (#2281) [siqbal1986]

swss:
* 88371f7 2022-09-21 | [ci] Only when test stage succeeded or succeededwithissues, PR run Gcov (#2460) (HEAD -> 202205) [Liu Shilong]
* c11dbd7 2022-09-15 | [QoS] Enforce drop probability only for colors whose WRED are enabled (#2422) [Stephen Sun]

sairedis:
* 80928dd 2022-09-06 | [lgtm] Add uuid library (#1119) (HEAD -> 202205, github/202205) [Kamil Cudnik]
* c147dd0 2022-09-16 | [202205][vslib]: Add SAI_PORT_ATTR_OPER_SPEED get #1123 [Ze Gan]

platform-daemon:
* 9cf8adf 2022-09-21 | [ycabled] add notification for gRPC connection state transitions to  IDLE/TRANSIENT_FAILURE (#295) (HEAD -> 202205) [vdahiya12]
* 1e07ae3 2022-09-20 | Use get() to fetch default value from dictionary for port admin_status #286 [anamehra]
* 157f483 2022-09-15 | [Xcvrd] Soak duplicate events and process only updated interested events (#285) [Prince George]

Signed-off-by: Ying Xie <[email protected]>
theasianpianist added a commit to theasianpianist/sonic-buildimage that referenced this pull request Oct 5, 2022
Include:

df92fb7 Improve verbosity level and provide more info in the log (sonic-net#2472)
e81ed20 [intfmgr]: Enable `accept_untracked_na` kernel param (sonic-net#2436)
24d29f1 [orchdaemon]: Fixed sairedis record file rotation (sonic-net#2299)
b8ee07d [build] add missing package libyang-dev in lgtm.yml (sonic-net#2475)
e46dd29 [crm] Fix issue with continues EXCEEDED and CLEAR logs for ACL group/table counters (sonic-net#2463)
b61d24c [doc]: Update README.md (sonic-net#2456)
b9ade5d [orchagent] Fix issue: ip prefix shall be inited even if VRF/VNET is not ready (sonic-net#2461)
f0f1eb4 Revert "[counters] Improve performance by polling only configured ports buffer queue/pg counters (sonic-net#2360)" (sonic-net#2458)
3d757a8 [ci][asan] add DVS tests run with ASAN (sonic-net#2441)
04fbc8e [ci] Only when test stage succeeded or succeededwithissues, PR run Gcov (sonic-net#2460)
7cc035f [orchagent]: Publish identified events via structured-events channel (sonic-net#2446)
efa0f01 [QoS] Enforce drop probability only for colors whose WRED are enabled (sonic-net#2422)
05c5c2f [swss] Replace memset functions (sonic-net#2423)
9ff993d Modified the test file to remove click commands and do the REDIS-DB u… (sonic-net#2264)
9e376af Install libyang in azure pipeline. (sonic-net#2445)
c1eb99a check state_db for po before sending ARP/ND pkts (sonic-net#2444)
43cc486 [portmgr] Fixed the orchagent crash due to late arrival of notif (sonic-net#2431)
b62c716 Enhance orchagent and buffer manager in error handling (sonic-net#2414)
13bda3c [Everflow/ERSPAN] Set correct destination port and mac address when the nexthop is updated for ERSPAN mirror destination (sonic-net#2392)
0ccb315 Revert "[VS Test] Skip failing subport tests (sonic-net#2370)" (sonic-net#2421)
ac8a83f [UT] [Portsyncd] Added Unit Tests for portsyncd (sonic-net#2297)
83a186a Change the log messages in addKernelNeigh/Route from ERROR to INFO (sonic-net#2437)
9c23389 [BFD]Clean up state_db BFD entries on swss restart (sonic-net#2434)
d41aebf EntityBulker SIGSEGV when create_entry attr_count 0 (sonic-net#2224)
f52a7b1 Fix the Fec Mode Setting of gbsyncd (sonic-net#2430)
8cc0a45 [neighsyncd] Enabling ipv4 link local entries for non-dualtor (sonic-net#2427)
5624e87 Revert "[ci][asan] add DVS tests run with ASAN (sonic-net#2363)" (sonic-net#2433)
a26b26a Dynamic port configuration - add port buffer cfg to the port ref counter (sonic-net#2194)
486939a tlm_teamd: Filter portchannel subinterface events from STATE_DB LAG_TABLE (sonic-net#2408)
a4b8992 [counters] Improve performance by polling only configured ports buffer queue/pg counters (sonic-net#2360)
4aaeec9 added support for Xsight platform (sonic-net#2426)
ca9edca [ci][asan] add DVS tests run with ASAN (sonic-net#2363)
dec4570 Handle dual ToR neighbor miss scenario (sonic-net#2151)
9eb4422 Upstream new development on p4orch (sonic-net#2237)
e9be2c0 [lgtm] Fix dependency (sonic-net#2419)
c0168f3 [muxorch] Returning true if nbr in skip_neighbor_ in isNeighborActive() (sonic-net#2415)
cfcf3d8 [macsec]: Set MTU for MACsec (sonic-net#2398)
8346034 Delete Invalid if condition in intfsorch.cpp (sonic-net#2411)

Signed-off-by: Lawrence Lee <[email protected]>
theasianpianist added a commit that referenced this pull request Oct 7, 2022
Include:

df92fb7 Improve verbosity level and provide more info in the log (#2472)
e81ed20 [intfmgr]: Enable `accept_untracked_na` kernel param (#2436)
24d29f1 [orchdaemon]: Fixed sairedis record file rotation (#2299)
b8ee07d [build] add missing package libyang-dev in lgtm.yml (#2475)
e46dd29 [crm] Fix issue with continues EXCEEDED and CLEAR logs for ACL group/table counters (#2463)
b61d24c [doc]: Update README.md (#2456)
b9ade5d [orchagent] Fix issue: ip prefix shall be inited even if VRF/VNET is not ready (#2461)
f0f1eb4 Revert "[counters] Improve performance by polling only configured ports buffer queue/pg counters (#2360)" (#2458)
3d757a8 [ci][asan] add DVS tests run with ASAN (#2441)
04fbc8e [ci] Only when test stage succeeded or succeededwithissues, PR run Gcov (#2460)
7cc035f [orchagent]: Publish identified events via structured-events channel (#2446)
efa0f01 [QoS] Enforce drop probability only for colors whose WRED are enabled (#2422)
05c5c2f [swss] Replace memset functions (#2423)
9ff993d Modified the test file to remove click commands and do the REDIS-DB u… (#2264)
9e376af Install libyang in azure pipeline. (#2445)
c1eb99a check state_db for po before sending ARP/ND pkts (#2444)
43cc486 [portmgr] Fixed the orchagent crash due to late arrival of notif (#2431)
b62c716 Enhance orchagent and buffer manager in error handling (#2414)
13bda3c [Everflow/ERSPAN] Set correct destination port and mac address when the nexthop is updated for ERSPAN mirror destination (#2392)
0ccb315 Revert "[VS Test] Skip failing subport tests (#2370)" (#2421)
ac8a83f [UT] [Portsyncd] Added Unit Tests for portsyncd (#2297)
83a186a Change the log messages in addKernelNeigh/Route from ERROR to INFO (#2437)
9c23389 [BFD]Clean up state_db BFD entries on swss restart (#2434)
d41aebf EntityBulker SIGSEGV when create_entry attr_count 0 (#2224)
f52a7b1 Fix the Fec Mode Setting of gbsyncd (#2430)
8cc0a45 [neighsyncd] Enabling ipv4 link local entries for non-dualtor (#2427)
5624e87 Revert "[ci][asan] add DVS tests run with ASAN (#2363)" (#2433)
a26b26a Dynamic port configuration - add port buffer cfg to the port ref counter (#2194)
486939a tlm_teamd: Filter portchannel subinterface events from STATE_DB LAG_TABLE (#2408)
a4b8992 [counters] Improve performance by polling only configured ports buffer queue/pg counters (#2360)
4aaeec9 added support for Xsight platform (#2426)
ca9edca [ci][asan] add DVS tests run with ASAN (#2363)
dec4570 Handle dual ToR neighbor miss scenario (#2151)
9eb4422 Upstream new development on p4orch (#2237)
e9be2c0 [lgtm] Fix dependency (#2419)
c0168f3 [muxorch] Returning true if nbr in skip_neighbor_ in isNeighborActive() (#2415)
cfcf3d8 [macsec]: Set MTU for MACsec (#2398)
8346034 Delete Invalid if condition in intfsorch.cpp (#2411)

Signed-off-by: Lawrence Lee <[email protected]>
stephenxs added a commit to stephenxs/sonic-buildimage that referenced this pull request Nov 8, 2022
d5a6da31 Do not configure physical attributes on port channels in portconfig (sonic-net#2456)
48ee7722 Change db_migrator major version on master branch from version 3 to 4 (sonic-net#2470)
f3746163 [GCU] Fix JsonPointerFilter bug (sonic-net#2477)
58dbb3e6 YANG Validation for ConfigDB Updates: TACPLUS, TACPLUS_SERVER, AAA, VLAN_SUB_INTERFACE tables + decorated validated_mod_entry (sonic-net#2452)
062f18a0 fix show interface neighbor expected empty issue (sonic-net#2465)
569edf3b Fix display disorder problem of show mirror_session (sonic-net#2447)
daaf0ffc Disable "tag as local" when reboot (sonic-net#2451)
6621120b Fix sudo sfputil show error-status on a multiasic platform issue (sonic-net#2373)
e8b1dcdf Add IP remove warnings for VRF commands (sonic-net#2351)
40cc8e11 [scripts/generate_dump] add information to tech-support file (sonic-net#2357)
8473517e Revert "[config reload]: On dual ToR systems, cache ARP and FDB table (sonic-net#2460)

Signed-off-by: Stephen Sun <[email protected]>
yxieca pushed a commit that referenced this pull request Nov 11, 2022
#12639)

* Advance submodule sonic-utilities

d5a6da31 Do not configure physical attributes on port channels in portconfig (#2456)
48ee7722 Change db_migrator major version on master branch from version 3 to 4 (#2470)
f3746163 [GCU] Fix JsonPointerFilter bug (#2477)
58dbb3e6 YANG Validation for ConfigDB Updates: TACPLUS, TACPLUS_SERVER, AAA, VLAN_SUB_INTERFACE tables + decorated validated_mod_entry (#2452)
062f18a0 fix show interface neighbor expected empty issue (#2465)
569edf3b Fix display disorder problem of show mirror_session (#2447)
daaf0ffc Disable "tag as local" when reboot (#2451)
6621120b Fix sudo sfputil show error-status on a multiasic platform issue (#2373)
e8b1dcdf Add IP remove warnings for VRF commands (#2351)
40cc8e11 [scripts/generate_dump] add information to tech-support file (#2357)
8473517e Revert "[config reload]: On dual ToR systems, cache ARP and FDB table (#2460)

Signed-off-by: Stephen Sun <[email protected]>

* Advance sonic-platform-common

aa86083 Fix issue: rounding float value for txpower and rxpower (#320)
2052a63 Fix issue: copper cable should not display DOM information (#318)
cf4c6af CmisApi::get_application_advertisement catch AttributeError as well (#316)

Signed-off-by: Stephen Sun <[email protected]>

Signed-off-by: Stephen Sun <[email protected]>
tshalvi pushed a commit to tshalvi/sonic-buildimage that referenced this pull request Dec 20, 2022
…ov (sonic-net#2460)

* [ci] Only when test stage succeeded or succeededwithissues, PR run Gcov
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