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

Edgecore 4630/5835/7326/7816 API2.0 platform support #10053

Merged
merged 47 commits into from
Mar 18, 2022

Conversation

jeffhtgt
Copy link
Contributor

Why I did it

Complete platform changes for AS4630-pe, AS5835-X, AS7326, AS7816 switch models (currently broken in master).

How I did it

Added proper support in sonic-buildimage repo in platform/broadcom/ and device/accton/.

How to verify it

Verified with the following commands:

  • show platform fan
  • show platform psustatus
  • show platform syseeprom
  • show platform temperature
  • show interfaces status
  • show interfaces transceiver eeprom --dom

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Add API2.0 support/fixes for the following Edgecore/Accton switch models:

  • as4630-54pe
  • as5835-54x
  • as7326-56x
  • as7816-64x

Link to config_db schema for YANG module changes

N/A

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

image

Jeff Henning and others added 30 commits November 29, 2021 16:25
- Add missing fan drawer component to sonic_platform
- Remove kernel version specification from Makefile
- Update to 4630 utility
- Fix compile issue with 4630 driver modules (set_fs, get_fs, no longer supported in kernel 5.10)
- Fix SFP info dict key for 7xxx switches
- Fix 7326 driver file using old kernel function
@prgeor
Copy link
Contributor

prgeor commented Feb 22, 2022

@jeffhtgt please use SFP-refactor on your platform similar to this effor:- #10047

@prgeor prgeor self-assigned this Feb 22, 2022
Copy link

@akenliu akenliu left a comment

Choose a reason for hiding this comment

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

I think we should not remove the files about pddf.
These files are running for BRCM's PDDF platform.
Maybe, there is a method for selecting which platform (API-2.0 or PDDF) shall be used during compiling. (I am not sure.)

@jeffhtgt
Copy link
Contributor Author

@prgeor This PR is for API2.0 support. Can you point me to an example for sfp refactor using API2.0 only?

@prgeor
Copy link
Contributor

prgeor commented Feb 23, 2022

@prgeor This PR is for API2.0 support. Can you point me to an example for sfp refactor using API2.0 only?

HLD Doc for SFP-refactor

Check these PRs:-
PR9016
PR10047

@lgtm-com
Copy link

lgtm-com bot commented Feb 28, 2022

This pull request introduces 2 alerts and fixes 6 when merging 06cee0b into afa18e2 - view on LGTM.com

new alerts:

  • 2 for Unused local variable

fixed alerts:

  • 4 for Unused local variable
  • 2 for Unused import

@jeffhtgt
Copy link
Contributor Author

jeffhtgt commented Mar 2, 2022

@prgeor I have not checked in any files yet but I am getting different SFP decode output after the refactoring.

Before refactoring:
Ethernet51: SFP EEPROM detected
CalibrationType: Internally Calibrated
Connector: LC
EncodingCodes: 64B/66B
ExtIdentOfTypeOfTransceiver: GBIC/SFP defined by twowire interface ID
Length50um(UnitsOf10m): 8
Length62.5um(UnitsOfm): 3
LengthCable(UnitsOfm): 0
LengthOM3(UnitsOf10m): 30
LengthSMF(UnitsOf100m): 0
LengthSMFkm-UnitsOfKm: 0
NominalSignallingRate(UnitsOf100Mbd): 103
RateIdentifier: Unspecified
ReceivedPowerMeasurementType: Avg power
TransceiverCodes:
10GEthernetComplianceCode: 10G Base-SR
TypeOfTransceiver: SFP/SFP+/SFP28
VendorDataCode(YYYY-MM-DD Lot): 2021-02-08
VendorName: PROLABS
VendorOUI: 00-00-00
VendorPN: ET5402-SR-C
VendorRev: A1
VendorSN: PRL84D053876
After:
Ethernet51: SFP EEPROM detected
Application Advertisement: N/A
Connector: LC
Encoding: 64B/66B
Extended Identifier: GBIC/SFP defined by two-wire interface ID
Extended RateSelect Compliance: Unknown
Identifier: SFP/SFP+/SFP28
Length OM3(10m): 30.0
Nominal Bit Rate(100Mbs): 103
Specification compliance:
10G Ethernet Compliance: Unknown
ESCON Compliance: Unknown
Ethernet Compliance: Unknown
Fibre Channel Link Length: Unknown
Fibre Channel Speed: Unknown
Fibre Channel Transmission Media: Unknown
Fibre Channel Transmitter Technology: Unknown
Infiniband Compliance: Unknown
SFP+CableTechnology: Unknown
SONET Compliance Codes: Unknown
Vendor Date Code(YYYY-MM-DD Lot): 2021-02-08
Vendor Name: PROLABS
Vendor OUI: 00-00-00
Vendor PN: ET5402-SR-C
Vendor Rev: A1
Vendor SN: PRL84D053876

Is this expected?

@prgeor
Copy link
Contributor

prgeor commented Mar 2, 2022

10G Ethernet Compliance: Unknown
ESCON Compliance: Unknown
Ethernet Compliance: Unknown
Fibre Channel Link Length: Unknown
Fibre Channel Speed: Unknown
Fibre Channel Transmission Media: Unknown
Fibre Channel Transmitter Technology: Unknown
Infiniband Compliance: Unknown
SFP+CableTechnology: Unknown
SONET Compliance Codes: Unknow

@jeffhtgt I can see few 'Unknown' for new fields. can you check the eeprom dump of the sfp? rest looks ok to me.

@jeffhtgt
Copy link
Contributor Author

jeffhtgt commented Mar 2, 2022

@prgeor Dump below. Notice the "before" and "after" output of same SFP with SfpBase (before) and Optoe (after).

root@t9847swta0003:/sys/bus/i2c/devices/20-0050# od -x eeprom
0000000 0403 1007 0000 0000 0000 0600 0067 0000
0000020 0308 1e00 5250 4c4f 4241 2053 2020 2020
0000040 2020 2020 0000 0000 5445 3435 3230 532d
0000060 2d52 2043 2020 2020 3141 2020 5203 3400
0000100 1a00 0000 5250 384c 4434 3530 3833 3837
0000120 2020 2020 3132 3230 3830 2020 f068 3f03
0000140 0000 0000 0000 0000 0000 0000 0000 0000
*
0000200 ffff ffff ffff ffff ffff ffff ffff ffff
*
0000360 ffff ffff ffff ffff 3234 3633 3033 3534
0000400 005a 00f6 0055 00fb cc8d 0474 2887 447a
0000420 4c1d f401 7017 e803 e02e 3c06 1027 cb07
0000440 204e fa00 1027 f501 ffff ffff ffff ffff
0000460 ffff ffff ffff ffff 0000 0000 0000 0000
0000500 0000 0000 803f 0000 0000 0000 0001 0000
0000520 0001 0000 0001 0000 0001 0000 0000 4f00
0000540 eb22 9582 550c be15 0100 ffff ffff ff0a
0000560 4000 2000 4000 ffff ffff ffff ffff 00ff
0000600 0000 0000 0000 0000 0000 0000 0000 0000
*
0001000
root@t9847swta0003:/sys/bus/i2c/devices/20-0050#

@prgeor
Copy link
Contributor

prgeor commented Mar 2, 2022

@prgeor Dump below. Notice the "before" and "after" output of same SFP with SfpBase (before) and Optoe (after).

root@t9847swta0003:/sys/bus/i2c/devices/20-0050# od -x eeprom 0000000 0403 1007 0000 0000 0000 0600 0067 0000 0000020 0308 1e00 5250 4c4f 4241 2053 2020 2020 0000040 2020 2020 0000 0000 5445 3435 3230 532d 0000060 2d52 2043 2020 2020 3141 2020 5203 3400 0000100 1a00 0000 5250 384c 4434 3530 3833 3837 0000120 2020 2020 3132 3230 3830 2020 f068 3f03 0000140 0000 0000 0000 0000 0000 0000 0000 0000 * 0000200 ffff ffff ffff ffff ffff ffff ffff ffff * 0000360 ffff ffff ffff ffff 3234 3633 3033 3534 0000400 005a 00f6 0055 00fb cc8d 0474 2887 447a 0000420 4c1d f401 7017 e803 e02e 3c06 1027 cb07 0000440 204e fa00 1027 f501 ffff ffff ffff ffff 0000460 ffff ffff ffff ffff 0000 0000 0000 0000 0000500 0000 0000 803f 0000 0000 0000 0001 0000 0000520 0001 0000 0001 0000 0001 0000 0000 4f00 0000540 eb22 9582 550c be15 0100 ffff ffff ff0a 0000560 4000 2000 4000 ffff ffff ffff ffff 00ff 0000600 0000 0000 0000 0000 0000 0000 0000 0000 * 0001000 root@t9847swta0003:/sys/bus/i2c/devices/20-0050#

i don't see "before" and "after" labelled. What issue do you see?

@jeffhtgt
Copy link
Contributor Author

jeffhtgt commented Mar 2, 2022

@prgeor I was referring to comment with the decoded/show output. The decode doesn't seem to be happening on some items with the refactored code.

@jeffhtgt
Copy link
Contributor Author

jeffhtgt commented Mar 3, 2022

@prgeor Let me be more specific regarding the output. With SfpBase support these fields are displayed:
Length50um(UnitsOf10m): 8
Length62.5um(UnitsOfm): 3
LengthCable(UnitsOfm): 0
LengthSMF(UnitsOf100m): 0
LengthSMFkm-UnitsOfKm: 0
ReceivedPowerMeasurementType: Avg power
TransceiverCodes:
10GEthernetComplianceCode: 10G Base-SR

With refactoring, these are displayed instead of the above:
Specification compliance:
10G Ethernet Compliance: Unknown
ESCON Compliance: Unknown
Ethernet Compliance: Unknown
Fibre Channel Link Length: Unknown
Fibre Channel Speed: Unknown
Fibre Channel Transmission Media: Unknown
Fibre Channel Transmitter Technology: Unknown
Infiniband Compliance: Unknown
SFP+CableTechnology: Unknown
SONET Compliance Codes: Unknown

If this is expected, I will move onto converting the other 3 switch platforms.

@prgeor
Copy link
Contributor

prgeor commented Mar 3, 2022

@prgeor Let me be more specific regarding the output. With SfpBase support these fields are displayed: Length50um(UnitsOf10m): 8 Length62.5um(UnitsOfm): 3 LengthCable(UnitsOfm): 0 LengthSMF(UnitsOf100m): 0 LengthSMFkm-UnitsOfKm: 0 ReceivedPowerMeasurementType: Avg power TransceiverCodes: 10GEthernetComplianceCode: 10G Base-SR

With refactoring, these are displayed instead of the above: Specification compliance: 10G Ethernet Compliance: Unknown ESCON Compliance: Unknown Ethernet Compliance: Unknown Fibre Channel Link Length: Unknown Fibre Channel Speed: Unknown Fibre Channel Transmission Media: Unknown Fibre Channel Transmitter Technology: Unknown Infiniband Compliance: Unknown SFP+CableTechnology: Unknown SONET Compliance Codes: Unknown

If this is expected, I will move onto converting the other 3 switch platforms.

@jeffhtgt please proceed with sfp-refactor. we can raise bug if any issue.

@jeffhtgt
Copy link
Contributor Author

jeffhtgt commented Mar 3, 2022

@prgeor See new commit. All 4 platforms were tested with new SFP refactoring updates.

@prgeor
Copy link
Contributor

prgeor commented Mar 7, 2022

@jeffhtgt could you resolve the merge conflict?

@jeffhtgt
Copy link
Contributor Author

@prgeor Conflicts fixed.

@lgtm-com
Copy link

lgtm-com bot commented Mar 15, 2022

This pull request introduces 2 alerts and fixes 5 when merging 993c48e into 28f6a51 - view on LGTM.com

new alerts:

  • 2 for Unused local variable

fixed alerts:

  • 3 for Unused local variable
  • 2 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Mar 15, 2022

This pull request fixes 5 alerts when merging 2068e66 into 004dc69 - view on LGTM.com

fixed alerts:

  • 3 for Unused local variable
  • 2 for Unused import

@jeffhtgt
Copy link
Contributor Author

@akenliu @prgeor Can this now be approved? I believe I have made all requested changes.

else:
return False

def get_rx_los(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

why override this? the Sfp-refactor implements this in platform-independent way. get_tx_disable() tx_disable_channel() set_power_override(), get_rx_los()? Why can't sfp-refactor access SFP eeprom in your platofrm?

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 functions I left in also use the platform CPLD. I removed any functions that completely used eeprom only.

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