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

Use MAC from EEPROM for PortChannels #1786

Closed

Conversation

andriymoroz-mlnx
Copy link
Collaborator

Signed-off-by: Andriy Moroz c_andriym@mellanox.com

- What I did
Updated teams start script to pass MAC from EEPROM to the portchannels config template for Mellanox platforms

- How I did it
updated start.sh which runs on container

- How to verify it
Start SONiC and make sure MACs on PortChannel (and members) are similar to one returned by command
od -vt x1 -An /sys/bus/i2c/devices/8-0051/eeprom | xargs printf "0x%s " | xargs printf "%02x:" | awk 'BEGIN { FS=":"; i=8+1+2+1} {while(i<NF) {type=$i; len=("0x"$(i+1));if(type!="24") {i=i+2+len} else {print substr($0, (i+1)3+1, len3-1); break}}}'

some bits in last byte may differ

Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')

if [ "$SONIC_ASIC_TYPE" == "mellanox" ]; then
MAC_ADDRESS=$(od -vt x1 -An /sys/bus/i2c/devices/8-0051/eeprom | xargs printf "0x%s " | xargs printf "%02x:" | awk 'BEGIN { FS=":"; i=8+1+2+1} {while(i<NF) {type=$i; len=("0x"$(i+1));if(type!="24") {i=i+2+len} else {print substr($0, (i+1)*3+1, len*3-1); break}}}')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider to use python -c to simplify the manipulation.

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, but it was 2 stages shorter before I noticed we do not have hexdump in the containers...

Copy link
Collaborator

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

I would approve consider the critical requirement time. However, code improvement is highly suggested.

@lguohan
Copy link
Collaborator

lguohan commented Jun 13, 2018

I think the PR is incomplete. what about router interface mac address? I do not think it is correct to have same mac for peering router interface.

Copy link
Collaborator

@lguohan lguohan left a comment

Choose a reason for hiding this comment

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

does not seem to be complete.

@andriymoroz-mlnx andriymoroz-mlnx changed the base branch from 201803 to master June 14, 2018 15:17
@andriymoroz-mlnx andriymoroz-mlnx changed the base branch from master to 201803 June 14, 2018 15:17
@andriymoroz-mlnx
Copy link
Collaborator Author

Recreated against master branch
#1793

stephenxs added a commit to stephenxs/sonic-buildimage that referenced this pull request Jun 29, 2021
3226163 [BufferOrch] Don't call SAI API for BUFFER_POOL/PROFILE handling in case the op is DEL and the SAI OID is NULL (sonic-net#1786)
6c88e47 [Dynamic Buffer Calc][Mellanox] Bug fixes and enhancements for the lua plugins for buffer pool calculation and headroom checking (sonic-net#1781)
e86b900 [MPLS] sonic-swss changes for MPLS (sonic-net#1686)
4c8e2b5 [Dynamic Buffer Calc] Avoid creating lossy PG for admin down ports during initialization (sonic-net#1776)
3602124 [VS test stability] Skip flaky test for DPB (sonic-net#1807)
c37cc1c Support for in-band-mgmt via management VRF (sonic-net#1726)
1e3a532 Fix config prompt question issue (sonic-net#1799)

Signed-off-by: Stephen Sun <stephens@nvidia.com>
qiluo-msft pushed a commit that referenced this pull request Aug 31, 2021
)

7041400 [config reload] Call systemctl reset-failed for snmp,telemetry,mgmt-framework services (#1773) (#1786)
399d370 Fix logic in RIF counters print (#1732)
8329544 [vnet_route_check] don't hardcode prefix length of /24 (#1756)
193b028 [neighbor-advertiser] delete the tunnel maps appropriately (#1663)
2c82bcf [neighbor_advertiser] Use existing tunnel if present for creating tunnel mappings (#1589)
8e22960 [202012][Config] Update config command of Kdump. (#1778)
be3e5c6 [show][config] cli refactor for muxcable with abstract class implementation from vendors (#1722) (#1782)
theasianpianist pushed a commit to theasianpianist/sonic-buildimage that referenced this pull request Feb 5, 2022
…ase the op is DEL and the SAI OID is NULL (sonic-net#1786)

- What I did
Don't call SAI API for BUFFER_POOL/PROFILE handling in case the op is DEL and the SAI OID is NULL in order to avoid orchagent from exiting.
We need it only in 202106 or above. In 202012 the orchagent won't exit in such case.

- Why I did it
Handle rare cases which cause SAI error eventually makes orchagent to exit.

- How I verified it
Manually test.

Signed-off-by: Stephen Sun <stephens@nvidia.com>
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.

None yet

3 participants