Skip to content

[AS9716-32D] Fix port index start from 1 #8426

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
# name lanes alias index speed
Ethernet0 73,74,75,76,77,78,79,80 fourHundredGigE1 0 400000
Ethernet8 65,66,67,68,69,70,71,72 fourHundredGigE2 1 400000
Ethernet16 81,82,83,84,85,86,87,88 fourHundredGigE3 2 400000
Ethernet24 89,90,91,92,93,94,95,96 fourHundredGigE4 3 400000
Ethernet32 97,98,99,100,101,102,103,104 fourHundredGigE5 4 400000
Ethernet40 105,106,107,108,109,110,111,112 fourHundredGigE6 5 400000
Ethernet48 113,114,115,116,117,118,119,120 fourHundredGigE7 6 400000
Ethernet56 121,122,123,124,125,126,127,128 fourHundredGigE8 7 400000
Ethernet64 41,42,43,44,45,46,47,48 fourHundredGigE9 8 400000
Ethernet72 33,34,35,36,37,38,39,40 fourHundredGigE10 9 400000
Ethernet80 49,50,51,52,53,54,55,56 fourHundredGigE11 10 400000
Ethernet88 57,58,59,60,61,62,63,64 fourHundredGigE12 11 400000
Ethernet96 129,130,131,132,133,134,135,136 fourHundredGigE13 12 400000
Ethernet104 137,138,139,140,141,142,143,144 fourHundredGigE14 13 400000
Ethernet112 145,146,147,148,149,150,151,152 fourHundredGigE15 14 400000
Ethernet120 153,154,155,156,157,158,159,160 fourHundredGigE16 15 400000
Ethernet128 169,170,171,172,173,174,175,176 fourHundredGigE17 16 400000
Ethernet136 161,162,163,164,165,166,167,168 fourHundredGigE18 17 400000
Ethernet144 177,178,179,180,181,182,183,184 fourHundredGigE19 18 400000
Ethernet152 185,186,187,188,189,190,191,192 fourHundredGigE20 19 400000
Ethernet160 1,2,3,4,5,6,7,8 fourHundredGigE21 20 400000
Ethernet168 9,10,11,12,13,14,15,16 fourHundredGigE22 21 400000
Ethernet176 17,18,19,20,21,22,23,24 fourHundredGigE23 22 400000
Ethernet184 25,26,27,28,29,30,31,32 fourHundredGigE24 23 400000
Ethernet192 201,202,203,204,205,206,207,208 fourHundredGigE25 24 400000
Ethernet200 193,194,195,196,197,198,199,200 fourHundredGigE26 25 400000
Ethernet208 217,218,219,220,221,222,223,224 fourHundredGigE27 26 400000
Ethernet216 209,210,211,212,213,214,215,216 fourHundredGigE28 27 400000
Ethernet224 233,234,235,236,237,238,239,240 fourHundredGigE29 28 400000
Ethernet232 225,226,227,228,229,230,231,232 fourHundredGigE30 29 400000
Ethernet240 249,250,251,252,253,254,255,256 fourHundredGigE31 30 400000
Ethernet248 241,242,243,244,245,246,247,248 fourHundredGigE32 31 400000
Ethernet0 73,74,75,76,77,78,79,80 fourHundredGigE1 1 400000
Ethernet8 65,66,67,68,69,70,71,72 fourHundredGigE2 2 400000
Ethernet16 81,82,83,84,85,86,87,88 fourHundredGigE3 3 400000
Ethernet24 89,90,91,92,93,94,95,96 fourHundredGigE4 4 400000
Ethernet32 97,98,99,100,101,102,103,104 fourHundredGigE5 5 400000
Ethernet40 105,106,107,108,109,110,111,112 fourHundredGigE6 6 400000
Ethernet48 113,114,115,116,117,118,119,120 fourHundredGigE7 7 400000
Ethernet56 121,122,123,124,125,126,127,128 fourHundredGigE8 8 400000
Ethernet64 41,42,43,44,45,46,47,48 fourHundredGigE9 9 400000
Ethernet72 33,34,35,36,37,38,39,40 fourHundredGigE10 10 400000
Ethernet80 49,50,51,52,53,54,55,56 fourHundredGigE11 11 400000
Ethernet88 57,58,59,60,61,62,63,64 fourHundredGigE12 12 400000
Ethernet96 129,130,131,132,133,134,135,136 fourHundredGigE13 13 400000
Ethernet104 137,138,139,140,141,142,143,144 fourHundredGigE14 14 400000
Ethernet112 145,146,147,148,149,150,151,152 fourHundredGigE15 15 400000
Ethernet120 153,154,155,156,157,158,159,160 fourHundredGigE16 16 400000
Ethernet128 169,170,171,172,173,174,175,176 fourHundredGigE17 17 400000
Ethernet136 161,162,163,164,165,166,167,168 fourHundredGigE18 18 400000
Ethernet144 177,178,179,180,181,182,183,184 fourHundredGigE19 19 400000
Ethernet152 185,186,187,188,189,190,191,192 fourHundredGigE20 20 400000
Ethernet160 1,2,3,4,5,6,7,8 fourHundredGigE21 21 400000
Ethernet168 9,10,11,12,13,14,15,16 fourHundredGigE22 22 400000
Ethernet176 17,18,19,20,21,22,23,24 fourHundredGigE23 23 400000
Ethernet184 25,26,27,28,29,30,31,32 fourHundredGigE24 24 400000
Ethernet192 201,202,203,204,205,206,207,208 fourHundredGigE25 25 400000
Ethernet200 193,194,195,196,197,198,199,200 fourHundredGigE26 26 400000
Ethernet208 217,218,219,220,221,222,223,224 fourHundredGigE27 27 400000
Ethernet216 209,210,211,212,213,214,215,216 fourHundredGigE28 28 400000
Ethernet224 233,234,235,236,237,238,239,240 fourHundredGigE29 29 400000
Ethernet232 225,226,227,228,229,230,231,232 fourHundredGigE30 30 400000
Ethernet240 249,250,251,252,253,254,255,256 fourHundredGigE31 31 400000
Ethernet248 241,242,243,244,245,246,247,248 fourHundredGigE32 32 400000
Ethernet256 257 tenGigE33 33 10000
Ethernet257 258 tenGigE34 34 10000
88 changes: 44 additions & 44 deletions device/accton/x86_64-accton_as9716_32d-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class SfpUtil(SfpUtilBase):
"""Platform-specific SfpUtil class"""

PORT_START = 0
PORT_END = 33
PORT_START = 1
PORT_END = 34
PORTS_IN_BLOCK = 34

BASE_OOM_PATH = "/sys/bus/i2c/devices/{0}-0050/"
Expand All @@ -29,40 +29,40 @@ class SfpUtil(SfpUtilBase):

_port_to_eeprom_mapping = {}
_port_to_i2c_mapping = {
0: [1, 25],
1: [2, 26],
2: [3, 27],
3: [4, 28],
4: [5, 29],
5: [6, 30],
6: [7, 31],
7: [8, 32],
8: [9, 33],
9: [10, 34],
10: [11, 35],
11: [12, 36],
12: [13, 37],
13: [14, 38],
14: [15, 39],
15: [16, 40],
16: [17, 41],
17: [18, 42],
18: [19, 43],
19: [20, 44],
20: [21, 45],
21: [22, 46],
22: [23, 47],
23: [24, 48],
24: [25, 49],
25: [26, 50],
26: [27, 51],
27: [28, 52],
28: [29, 53],
29: [30, 54],
30: [31, 55],
31: [32, 56],
32: [33, 57],
33: [34, 58],
1: 25,
2: 26,
3: 27,
4: 28,
5: 29,
6: 30,
7: 31,
8: 32,
9: 33,
10: 34,
11: 35,
12: 36,
13: 37,
14: 38,
15: 39,
16: 40,
17: 41,
18: 42,
19: 43,
20: 44,
21: 45,
22: 46,
23: 47,
24: 48,
25: 49,
26: 50,
27: 51,
28: 52,
29: 53,
30: 54,
31: 55,
32: 56,
33: 57,
34: 58,
}

@property
Expand All @@ -84,9 +84,9 @@ def port_to_eeprom_mapping(self):
def __init__(self):
eeprom_path = self.BASE_OOM_PATH + "eeprom"

for x in range(0, self.port_end+1):
for x in range(self.port_start, self.port_end+1):
self.port_to_eeprom_mapping[x] = eeprom_path.format(
self._port_to_i2c_mapping[x][1]
self._port_to_i2c_mapping[x]
)

SfpUtilBase.__init__(self)
Expand All @@ -95,10 +95,10 @@ def get_presence(self, port_num):
# Check for invalid port_num
if port_num < self.port_start or port_num > self.port_end:
return False
if port_num < 16:
present_path = self.BASE_CPLD1_PATH + "module_present_" + str(port_num+1)
if port_num <= 16:
present_path = self.BASE_CPLD1_PATH + "module_present_" + str(port_num)
else:
present_path = self.BASE_CPLD2_PATH + "module_present_" + str(port_num+1)
present_path = self.BASE_CPLD2_PATH + "module_present_" + str(port_num)
self.__port_to_is_present = present_path

content = "0"
Expand Down Expand Up @@ -181,7 +181,7 @@ def reset(self, port_num):
if port_num < self.port_start or port_num > self.port_end:
return False

if port_num < 16:
if port_num <= 16:
mod_rst_path = self.BASE_CPLD1_PATH + "module_reset_" + str(port_num+1)
else:
mod_rst_path = self.BASE_CPLD2_PATH + "module_reset_" + str(port_num+1)
Expand All @@ -208,8 +208,8 @@ def get_cpld_interrupt(self):
else:
cpld_i2c_path = self.BASE_CPLD2_PATH + "cpld_intr_" + str(i+1)

start_i = (i*8)
end_i = (i*8+8)
start_i = (i*8)+1
end_i = (i*8+8)+1
try:
val_file = open(cpld_i2c_path)
except IOError as e:
Expand Down