-
Notifications
You must be signed in to change notification settings - Fork 86
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
[Multiasic]: Add calculation of interface index for backplane interfaces #68
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,19 +6,26 @@ | |
|
||
|
||
SONIC_ETHERNET_RE_PATTERN = "^Ethernet(\d+)$" | ||
""" | ||
Ethernet-BP refers to BackPlane interfaces | ||
in multi-asic platform. | ||
""" | ||
SONIC_ETHERNET_BP_RE_PATTERN = "^Ethernet-BP(\d+)$" | ||
SONIC_PORTCHANNEL_RE_PATTERN = "^PortChannel(\d+)$" | ||
SONIC_MGMT_PORT_RE_PATTERN = "^eth(\d+)$" | ||
|
||
|
||
class BaseIdx: | ||
ethernet_base_idx = 1 | ||
ethernet_bp_base_idx = 9000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
How do you choose this value? Is 2000 working? #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Chose 9000 as the offset will be large enough and Index does not overlap. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @qiluo-msft , i think 9000 should be a good safe offset value for back-plane instead of a lower value |
||
portchannel_base_idx = 1000 | ||
mgmt_port_base_idx = 10000 | ||
|
||
def get_index(if_name): | ||
""" | ||
OIDs are 1-based, interfaces are 0-based, return the 1-based index | ||
Ethernet N = N + 1 | ||
Ethernet_BP N = N + 9000 | ||
PortChannel N = N + 1000 | ||
eth N = N + 10000 | ||
""" | ||
|
@@ -29,11 +36,13 @@ def get_index_from_str(if_name): | |
""" | ||
OIDs are 1-based, interfaces are 0-based, return the 1-based index | ||
Ethernet N = N + 1 | ||
Ethernet_BP N = N + 9000 | ||
PortChannel N = N + 1000 | ||
eth N = N + 10000 | ||
""" | ||
patterns = { | ||
SONIC_ETHERNET_RE_PATTERN: BaseIdx.ethernet_base_idx, | ||
SONIC_ETHERNET_BP_RE_PATTERN: BaseIdx.ethernet_bp_base_idx, | ||
SONIC_PORTCHANNEL_RE_PATTERN: BaseIdx.portchannel_base_idx, | ||
SONIC_MGMT_PORT_RE_PATTERN: BaseIdx.mgmt_port_base_idx | ||
} | ||
|
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.
Explain in comment what is BP? #Closed
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.
added as per comment