Skip to content

Commit 3abd4c7

Browse files
author
Jostar Yang
committed
Fix LGTM and port index error
1 parent 08168dc commit 3abd4c7

File tree

4 files changed

+135
-137
lines changed

4 files changed

+135
-137
lines changed
Lines changed: 128 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,129 @@
11
# name lanes alias index
2-
Ethernet1 5,6 onehundredGigE1 0
3-
Ethernet2 7,8 onehundredGigE2 1
4-
Ethernet3 1,2 onehundredGigE3 2
5-
Ethernet4 3,4 onehundredGigE4 3
6-
Ethernet5 37,38 onehundredGigE5 4
7-
Ethernet6 39,40 onehundredGigE6 5
8-
Ethernet7 33,34 onehundredGigE7 6
9-
Ethernet8 35,36 onehundredGigE8 7
10-
Ethernet9 69,70 onehundredGigE9 8
11-
Ethernet10 71,72 onehundredGigE10 9
12-
Ethernet11 65,66 onehundredGigE11 10
13-
Ethernet12 67,68 onehundredGigE12 11
14-
Ethernet13 101,102 onehundredGigE13 12
15-
Ethernet14 103,104 onehundredGigE14 13
16-
Ethernet15 97,98 onehundredGigE15 14
17-
Ethernet16 99,100 onehundredGigE16 15
18-
Ethernet17 13,14 onehundredGigE17 16
19-
Ethernet18 15,16 onehundredGigE18 17
20-
Ethernet19 9,10 onehundredGigE19 18
21-
Ethernet20 11,12 onehundredGigE20 19
22-
Ethernet21 45,46 onehundredGigE21 20
23-
Ethernet22 47,48 onehundredGigE22 21
24-
Ethernet23 41,42 onehundredGigE23 22
25-
Ethernet24 43,44 onehundredGigE24 23
26-
Ethernet25 77,78 onehundredGigE25 24
27-
Ethernet26 79,80 onehundredGigE26 25
28-
Ethernet27 73,74 onehundredGigE27 26
29-
Ethernet28 75,76 onehundredGigE28 27
30-
Ethernet29 109,110 onehundredGigE29 28
31-
Ethernet30 111,112 onehundredGigE30 29
32-
Ethernet31 105,106 onehundredGigE31 30
33-
Ethernet32 107,108 onehundredGigE32 31
34-
Ethernet33 21,22 onehundredGigE33 32
35-
Ethernet34 23,24 onehundredGigE34 33
36-
Ethernet35 17,18 onehundredGigE35 34
37-
Ethernet36 19,20 onehundredGigE36 35
38-
Ethernet37 53,54 onehundredGigE37 36
39-
Ethernet38 55,56 onehundredGigE38 37
40-
Ethernet39 49,50 onehundredGigE39 38
41-
Ethernet40 51,52 onehundredGigE40 39
42-
Ethernet41 85,86 onehundredGigE41 40
43-
Ethernet42 87,88 onehundredGigE42 41
44-
Ethernet43 81,82 onehundredGigE43 42
45-
Ethernet44 83,84 onehundredGigE44 43
46-
Ethernet45 117,118 onehundredGigE45 44
47-
Ethernet46 119,120 onehundredGigE46 45
48-
Ethernet47 113,114 onehundredGigE47 46
49-
Ethernet48 115,116 onehundredGigE48 47
50-
Ethernet49 29,30 onehundredGigE49 48
51-
Ethernet50 31,32 onehundredGigE50 49
52-
Ethernet51 25,26 onehundredGigE51 50
53-
Ethernet52 27,28 onehundredGigE52 51
54-
Ethernet53 61,62 onehundredGigE53 52
55-
Ethernet54 63,64 onehundredGigE54 53
56-
Ethernet55 57,58 onehundredGigE55 54
57-
Ethernet56 59,60 onehundredGigE56 55
58-
Ethernet57 93,94 onehundredGigE57 56
59-
Ethernet58 95,96 onehundredGigE58 57
60-
Ethernet59 89,90 onehundredGigE59 58
61-
Ethernet60 91,92 onehundredGigE60 59
62-
Ethernet61 125,126 onehundredGigE61 60
63-
Ethernet62 127,128 onehundredGigE62 61
64-
Ethernet63 121,122 onehundredGigE63 62
65-
Ethernet64 123,124 onehundredGigE64 63
66-
Ethernet65 133,134 onehundredGigE65 64
67-
Ethernet66 135,136 onehundredGigE66 65
68-
Ethernet67 129,130 onehundredGigE67 66
69-
Ethernet68 131,132 onehundredGigE68 67
70-
Ethernet69 165,166 onehundredGigE69 68
71-
Ethernet70 167,168 onehundredGigE70 69
72-
Ethernet71 161,162 onehundredGigE71 70
73-
Ethernet72 163,164 onehundredGigE72 71
74-
Ethernet73 197,198 onehundredGigE73 72
75-
Ethernet74 199,200 onehundredGigE74 73
76-
Ethernet75 193,194 onehundredGigE75 74
77-
Ethernet76 195,196 onehundredGigE76 75
78-
Ethernet77 229,230 onehundredGigE77 76
79-
Ethernet78 231,232 onehundredGigE78 77
80-
Ethernet79 225,226 onehundredGigE79 78
81-
Ethernet80 227,228 onehundredGigE80 79
82-
Ethernet81 141,142 onehundredGigE81 80
83-
Ethernet82 143,144 onehundredGigE82 81
84-
Ethernet83 137,138 onehundredGigE83 82
85-
Ethernet84 139,140 onehundredGigE84 83
86-
Ethernet85 173,174 onehundredGigE85 84
87-
Ethernet86 175,176 onehundredGigE86 85
88-
Ethernet87 169,170 onehundredGigE87 86
89-
Ethernet88 171,172 onehundredGigE88 87
90-
Ethernet89 205,206 onehundredGigE89 88
91-
Ethernet90 207,208 onehundredGigE90 89
92-
Ethernet91 201,202 onehundredGigE91 90
93-
Ethernet92 203,204 onehundredGigE92 91
94-
Ethernet93 237,238 onehundredGigE93 92
95-
Ethernet94 239,240 onehundredGigE94 93
96-
Ethernet95 233,234 onehundredGigE95 94
97-
Ethernet96 235,236 onehundredGigE96 95
98-
Ethernet97 149,150 onehundredGigE97 96
99-
Ethernet98 151,152 onehundredGigE98 97
100-
Ethernet99 145,146 onehundredGigE99 98
101-
Ethernet100 147,148 onehundredGigE100 99
102-
Ethernet101 181,182 onehundredGigE101 100
103-
Ethernet102 183,184 onehundredGigE102 101
104-
Ethernet103 177,178 onehundredGigE103 102
105-
Ethernet104 179,180 onehundredGigE104 103
106-
Ethernet105 213,214 onehundredGigE105 104
107-
Ethernet106 215,216 onehundredGigE106 105
108-
Ethernet107 209,210 onehundredGigE107 106
109-
Ethernet108 211,212 onehundredGigE108 107
110-
Ethernet109 245,246 onehundredGigE109 108
111-
Ethernet110 247,248 onehundredGigE110 109
112-
Ethernet111 241,242 onehundredGigE111 110
113-
Ethernet112 243,244 onehundredGigE112 111
114-
Ethernet113 157,158 onehundredGigE113 112
115-
Ethernet114 159,160 onehundredGigE114 113
116-
Ethernet115 153,154 onehundredGigE115 114
117-
Ethernet116 155,156 onehundredGigE116 115
118-
Ethernet117 189,190 onehundredGigE117 116
119-
Ethernet118 191,192 onehundredGigE118 117
120-
Ethernet119 185,186 onehundredGigE119 118
121-
Ethernet120 187,188 onehundredGigE120 119
122-
Ethernet121 221,222 onehundredGigE121 120
123-
Ethernet122 223,224 onehundredGigE122 121
124-
Ethernet123 217,218 onehundredGigE123 122
125-
Ethernet124 219,220 onehundredGigE124 123
126-
Ethernet125 253,254 onehundredGigE125 124
127-
Ethernet126 255,256 onehundredGigE126 125
128-
Ethernet127 249,250 onehundredGigE127 126
129-
Ethernet128 251,252 onehundredGigE128 127
2+
Ethernet1 5,6 onehundredGigE1 1
3+
Ethernet2 7,8 onehundredGigE2 2
4+
Ethernet3 1,2 onehundredGigE3 3
5+
Ethernet4 3,4 onehundredGigE4 4
6+
Ethernet5 37,38 onehundredGigE5 5
7+
Ethernet6 39,40 onehundredGigE6 6
8+
Ethernet7 33,34 onehundredGigE7 7
9+
Ethernet8 35,36 onehundredGigE8 8
10+
Ethernet9 69,70 onehundredGigE9 9
11+
Ethernet10 71,72 onehundredGigE10 10
12+
Ethernet11 65,66 onehundredGigE11 11
13+
Ethernet12 67,68 onehundredGigE12 12
14+
Ethernet13 101,102 onehundredGigE13 13
15+
Ethernet14 103,104 onehundredGigE14 14
16+
Ethernet15 97,98 onehundredGigE15 15
17+
Ethernet16 99,100 onehundredGigE16 16
18+
Ethernet17 13,14 onehundredGigE17 17
19+
Ethernet18 15,16 onehundredGigE18 18
20+
Ethernet19 9,10 onehundredGigE19 19
21+
Ethernet20 11,12 onehundredGigE20 20
22+
Ethernet21 45,46 onehundredGigE21 21
23+
Ethernet22 47,48 onehundredGigE22 22
24+
Ethernet23 41,42 onehundredGigE23 23
25+
Ethernet24 43,44 onehundredGigE24 24
26+
Ethernet25 77,78 onehundredGigE25 25
27+
Ethernet26 79,80 onehundredGigE26 26
28+
Ethernet27 73,74 onehundredGigE27 27
29+
Ethernet28 75,76 onehundredGigE28 28
30+
Ethernet29 109,110 onehundredGigE29 29
31+
Ethernet30 111,112 onehundredGigE30 30
32+
Ethernet31 105,106 onehundredGigE31 31
33+
Ethernet32 107,108 onehundredGigE32 32
34+
Ethernet33 21,22 onehundredGigE33 33
35+
Ethernet34 23,24 onehundredGigE34 34
36+
Ethernet35 17,18 onehundredGigE35 35
37+
Ethernet36 19,20 onehundredGigE36 36
38+
Ethernet37 53,54 onehundredGigE37 37
39+
Ethernet38 55,56 onehundredGigE38 38
40+
Ethernet39 49,50 onehundredGigE39 39
41+
Ethernet40 51,52 onehundredGigE40 40
42+
Ethernet41 85,86 onehundredGigE41 41
43+
Ethernet42 87,88 onehundredGigE42 42
44+
Ethernet43 81,82 onehundredGigE43 43
45+
Ethernet44 83,84 onehundredGigE44 44
46+
Ethernet45 117,118 onehundredGigE45 45
47+
Ethernet46 119,120 onehundredGigE46 46
48+
Ethernet47 113,114 onehundredGigE47 47
49+
Ethernet48 115,116 onehundredGigE48 48
50+
Ethernet49 29,30 onehundredGigE49 49
51+
Ethernet50 31,32 onehundredGigE50 50
52+
Ethernet51 25,26 onehundredGigE51 51
53+
Ethernet52 27,28 onehundredGigE52 52
54+
Ethernet53 61,62 onehundredGigE53 53
55+
Ethernet54 63,64 onehundredGigE54 54
56+
Ethernet55 57,58 onehundredGigE55 55
57+
Ethernet56 59,60 onehundredGigE56 56
58+
Ethernet57 93,94 onehundredGigE57 57
59+
Ethernet58 95,96 onehundredGigE58 58
60+
Ethernet59 89,90 onehundredGigE59 59
61+
Ethernet60 91,92 onehundredGigE60 60
62+
Ethernet61 125,126 onehundredGigE61 61
63+
Ethernet62 127,128 onehundredGigE62 62
64+
Ethernet63 121,122 onehundredGigE63 63
65+
Ethernet64 123,124 onehundredGigE64 64
66+
Ethernet65 133,134 onehundredGigE65 65
67+
Ethernet66 135,136 onehundredGigE66 66
68+
Ethernet67 129,130 onehundredGigE67 67
69+
Ethernet68 131,132 onehundredGigE68 68
70+
Ethernet69 165,166 onehundredGigE69 69
71+
Ethernet70 167,168 onehundredGigE70 70
72+
Ethernet71 161,162 onehundredGigE71 71
73+
Ethernet72 163,164 onehundredGigE72 72
74+
Ethernet73 197,198 onehundredGigE73 73
75+
Ethernet74 199,200 onehundredGigE74 74
76+
Ethernet75 193,194 onehundredGigE75 75
77+
Ethernet76 195,196 onehundredGigE76 76
78+
Ethernet77 229,230 onehundredGigE77 77
79+
Ethernet78 231,232 onehundredGigE78 78
80+
Ethernet79 225,226 onehundredGigE79 79
81+
Ethernet80 227,228 onehundredGigE80 80
82+
Ethernet81 141,142 onehundredGigE81 81
83+
Ethernet82 143,144 onehundredGigE82 82
84+
Ethernet83 137,138 onehundredGigE83 83
85+
Ethernet84 139,140 onehundredGigE84 84
86+
Ethernet85 173,174 onehundredGigE85 85
87+
Ethernet86 175,176 onehundredGigE86 86
88+
Ethernet87 169,170 onehundredGigE87 87
89+
Ethernet88 171,172 onehundredGigE88 88
90+
Ethernet89 205,206 onehundredGigE89 89
91+
Ethernet90 207,208 onehundredGigE90 90
92+
Ethernet91 201,202 onehundredGigE91 91
93+
Ethernet92 203,204 onehundredGigE92 92
94+
Ethernet93 237,238 onehundredGigE93 93
95+
Ethernet94 239,240 onehundredGigE94 94
96+
Ethernet95 233,234 onehundredGigE95 95
97+
Ethernet96 235,236 onehundredGigE96 96
98+
Ethernet97 149,150 onehundredGigE97 97
99+
Ethernet98 151,152 onehundredGigE98 98
100+
Ethernet99 145,146 onehundredGigE99 99
101+
Ethernet100 147,148 onehundredGigE100 100
102+
Ethernet101 181,182 onehundredGigE101 101
103+
Ethernet102 183,184 onehundredGigE102 102
104+
Ethernet103 177,178 onehundredGigE103 103
105+
Ethernet104 179,180 onehundredGigE104 104
106+
Ethernet105 213,214 onehundredGigE105 105
107+
Ethernet106 215,216 onehundredGigE106 106
108+
Ethernet107 209,210 onehundredGigE107 107
109+
Ethernet108 211,212 onehundredGigE108 108
110+
Ethernet109 245,246 onehundredGigE109 109
111+
Ethernet110 247,248 onehundredGigE110 110
112+
Ethernet111 241,242 onehundredGigE111 111
113+
Ethernet112 243,244 onehundredGigE112 112
114+
Ethernet113 157,158 onehundredGigE113 113
115+
Ethernet114 159,160 onehundredGigE114 114
116+
Ethernet115 153,154 onehundredGigE115 115
117+
Ethernet116 155,156 onehundredGigE116 116
118+
Ethernet117 189,190 onehundredGigE117 117
119+
Ethernet118 191,192 onehundredGigE118 118
120+
Ethernet119 185,186 onehundredGigE119 119
121+
Ethernet120 187,188 onehundredGigE120 120
122+
Ethernet121 221,222 onehundredGigE121 121
123+
Ethernet122 223,224 onehundredGigE122 122
124+
Ethernet123 217,218 onehundredGigE123 123
125+
Ethernet124 219,220 onehundredGigE124 124
126+
Ethernet125 253,254 onehundredGigE125 125
127+
Ethernet126 255,256 onehundredGigE126 126
128+
Ethernet127 249,250 onehundredGigE127 127
129+
Ethernet128 251,252 onehundredGigE128 128

device/accton/x86_64-accton_minipack-r0/sonic_platform/sfp.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,6 @@ class Sfp(SfpBase):
272272
HOST_CHK_CMD = "which systemctl > /dev/null 2>&1"
273273
PLATFORM = "x86_64-accton_minipack-r0"
274274
HWSKU = "Accton-MINIPACK"
275-
#LOCAL_OOM_PATH = "/usr/local/bin/minipack_qsfp/port%d_eeprom"
276-
# port_N is from 0 to 127
277-
278275

279276
def __init__(self, sfp_index=0, sfp_name=None):
280277
self._api_helper=APIHelper()
@@ -284,7 +281,7 @@ def __init__(self, sfp_index=0, sfp_name=None):
284281
self._eeprom_path = self._get_eeprom_path()
285282
#pim = FpgaUtil()
286283
#pim.init_pim_fpga()
287-
self._dom_capability_detect()
284+
#self._dom_capability_detect()
288285

289286
SfpBase.__init__(self)
290287

@@ -552,6 +549,11 @@ def get_transceiver_info(self):
552549
transceiver_info_dict = dict.fromkeys(
553550
info_dict_keys, NULL_VAL)
554551
transceiver_info_dict["specification_compliance"] = '{}'
552+
553+
# If some port is not inserted module when xcvrd do _init_(), it will not get port_type from eeprom.
554+
# So its defaut type is QSFP. But user can insert QSFP-DD to the port later
555+
# So we need to check port before access port eeporm.
556+
self._dom_capability_detect()
555557

556558
# ToDo: OSFP tranceiver info parsing not fully supported.
557559
# in inf8628.py lack of some memory map definition
@@ -1286,7 +1288,7 @@ def get_reset_status(self):
12861288
A Boolean, True if reset enabled, False if disabled
12871289
"""
12881290
if not self.get_presence():
1289-
return True #FPGA SPEC:It is set to 1¡¦s if the corresponding QSFP is not present
1291+
return True #FPGA SPEC:It is set to 1 if the corresponding QSFP is not present
12901292

12911293
pim=FpgaUtil()
12921294
val=pim.get_reset(self.port_num-1)

platform/broadcom/sonic-platform-modules-accton/minipack/classes/fpgautil.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@
1818
# 5/29/2019: Jostar create for minipack
1919
# -----------------------------------------------------------
2020
try:
21-
import sys
2221
import time # this is only being used as part of the example
2322
import fbfpgaio
24-
import re
2523
import time
26-
from select import select
2724

2825
except ImportError as e:
2926
raise ImportError('%s - required module not found' % str(e))

platform/broadcom/sonic-platform-modules-accton/minipack/fpga_setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python
22

3-
import sys
43
from setuptools import setup, Extension
54
os.listdir
65

0 commit comments

Comments
 (0)