-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use MAC from EEPROM for PortChannels #1786
Conversation
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}}}') |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
There was a problem hiding this 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.
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. |
There was a problem hiding this 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.
Recreated against master branch |
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>
) 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)
…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>
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