Skip to content

Commit 3ff0c4d

Browse files
ciju-juniperlguohan
authored andcommitted
[Juniper][QFX5210] Optoe driver for SFP management (#3438)
* Adding platform support for Juniper QFX5210 This switch has 64 QSFP28 (40G/100G) ports, 2 SFP+ (1G/10G) ports on Broadcom Tomahawk II chipset. CPU used in QFX5210-64C-S is Intel Broadwell-DE. The machine has Redundant and hot-swappable Power Supply (1+1) and also has Redundant and hot swappable fans (3+1). Signed-off-by: Ciju Rajan K <[email protected]> * [Juniper][QFX5210] Optoe driver for SFP management This commit implements the following changes - Moving to optoe driver for sfp management - Removing the old sfp driver - Updating the port-config.ini to add the index field - Correction in sfputil.py to incorporate optoe driver - Platform support for 'poweroff' command Signed-off-by: Ciju Rajan K <[email protected]>
1 parent 9179990 commit 3ff0c4d

File tree

6 files changed

+195
-1801
lines changed

6 files changed

+195
-1801
lines changed
Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
# name lanes alias
2-
Ethernet0 73,74,75,76 hundredGigE1
3-
Ethernet4 65,66,67,68 hundredGigE2
4-
Ethernet8 81,82,83,84 hundredGigE3
5-
Ethernet12 89,90,91,92 hundredGigE4
6-
Ethernet16 105,106,107,108 hundredGigE5
7-
Ethernet20 97,98,99,100 hundredGigE6
8-
Ethernet24 113,114,115,116 hundredGigE7
9-
Ethernet28 121,122,123,124 hundredGigE8
10-
Ethernet32 41,42,43,44 hundredGigE9
11-
Ethernet36 33,34,35,36 hundredGigE10
12-
Ethernet40 49,50,51,52 hundredGigE11
13-
Ethernet44 57,58,59,60 hundredGigE12
14-
Ethernet48 137,138,139,140 hundredGigE13
15-
Ethernet52 129,130,131,132 hundredGigE14
16-
Ethernet56 145,146,147,148 hundredGigE15
17-
Ethernet60 153,154,155,156 hundredGigE16
18-
Ethernet64 173,174,175,176 hundredGigE17
19-
Ethernet68 165,166,167,168 hundredGigE18
20-
Ethernet72 181,182,183,184 hundredGigE19
21-
Ethernet76 189,190,191,192 hundredGigE20
22-
Ethernet80 13,14,15,16 hundredGigE21
23-
Ethernet84 5,6,7,8 hundredGigE22
24-
Ethernet88 29,30,31,32 hundredGigE23
25-
Ethernet92 21,22,23,24 hundredGigE24
26-
Ethernet96 205,206,207,208 hundredGigE25
27-
Ethernet100 197,198,199,200 hundredGigE26
28-
Ethernet104 213,214,215,216 hundredGigE27
29-
Ethernet108 221,222,223,224 hundredGigE28
30-
Ethernet112 229,230,231,232 hundredGigE29
31-
Ethernet116 237,238,239,240 hundredGigE30
32-
Ethernet120 245,246,247,248 hundredGigE31
33-
Ethernet124 253,254,255,256 hundredGigE32
34-
Ethernet128 69,70,71,72 hundredGigE33
35-
Ethernet132 77,78,79,80 hundredGigE34
36-
Ethernet136 93,94,95,96 hundredGigE35
37-
Ethernet140 85,86,87,88 hundredGigE36
38-
Ethernet144 101,102,103,104 hundredGigE37
39-
Ethernet148 109,110,111,112 hundredGigE38
40-
Ethernet152 125,126,127,128 hundredGigE39
41-
Ethernet156 117,118,119,120 hundredGigE40
42-
Ethernet160 37,38,39,40 hundredGigE41
43-
Ethernet164 45,46,47,48 hundredGigE42
44-
Ethernet168 61,62,63,64 hundredGigE43
45-
Ethernet172 53,54,55,56 hundredGigE44
46-
Ethernet176 133,134,135,136 hundredGigE45
47-
Ethernet180 141,142,143,144 hundredGigE46
48-
Ethernet184 157,158,159,160 hundredGigE47
49-
Ethernet188 149,150,151,152 hundredGigE48
50-
Ethernet192 161,162,163,164 hundredGigE49
51-
Ethernet196 169,170,171,172 hundredGigE50
52-
Ethernet200 185,186,187,188 hundredGigE51
53-
Ethernet204 177,178,179,180 hundredGigE52
54-
Ethernet208 1,2,3,4 hundredGigE53
55-
Ethernet212 9,10,11,12 hundredGigE54
56-
Ethernet216 25,26,27,28 hundredGigE55
57-
Ethernet220 17,18,19,20 hundredGigE56
58-
Ethernet224 193,194,195,196 hundredGigE57
59-
Ethernet228 201,202,203,204 hundredGigE58
60-
Ethernet232 217,218,219,220 hundredGigE59
61-
Ethernet236 209,210,211,212 hundredGigE60
62-
Ethernet240 225,226,227,228 hundredGigE61
63-
Ethernet244 233,234,235,236 hundredGigE62
64-
Ethernet248 249,250,251,252 hundredGigE63
65-
Ethernet252 241,242,243,244 hundredGigE64
1+
# name lanes alias index speed
2+
Ethernet0 73,74,75,76 hundredGigE1 0 100000
3+
Ethernet4 65,66,67,68 hundredGigE2 1 100000
4+
Ethernet8 81,82,83,84 hundredGigE3 2 100000
5+
Ethernet12 89,90,91,92 hundredGigE4 3 100000
6+
Ethernet16 105,106,107,108 hundredGigE5 4 100000
7+
Ethernet20 97,98,99,100 hundredGigE6 5 100000
8+
Ethernet24 113,114,115,116 hundredGigE7 6 100000
9+
Ethernet28 121,122,123,124 hundredGigE8 7 100000
10+
Ethernet32 41,42,43,44 hundredGigE9 8 100000
11+
Ethernet36 33,34,35,36 hundredGigE10 9 100000
12+
Ethernet40 49,50,51,52 hundredGigE11 10 100000
13+
Ethernet44 57,58,59,60 hundredGigE12 11 100000
14+
Ethernet48 137,138,139,140 hundredGigE13 12 100000
15+
Ethernet52 129,130,131,132 hundredGigE14 13 100000
16+
Ethernet56 145,146,147,148 hundredGigE15 14 100000
17+
Ethernet60 153,154,155,156 hundredGigE16 15 100000
18+
Ethernet64 173,174,175,176 hundredGigE17 16 100000
19+
Ethernet68 165,166,167,168 hundredGigE18 17 100000
20+
Ethernet72 181,182,183,184 hundredGigE19 18 100000
21+
Ethernet76 189,190,191,192 hundredGigE20 19 100000
22+
Ethernet80 13,14,15,16 hundredGigE21 20 100000
23+
Ethernet84 5,6,7,8 hundredGigE22 21 100000
24+
Ethernet88 29,30,31,32 hundredGigE23 22 100000
25+
Ethernet92 21,22,23,24 hundredGigE24 23 100000
26+
Ethernet96 205,206,207,208 hundredGigE25 24 100000
27+
Ethernet100 197,198,199,200 hundredGigE26 25 100000
28+
Ethernet104 213,214,215,216 hundredGigE27 26 100000
29+
Ethernet108 221,222,223,224 hundredGigE28 27 100000
30+
Ethernet112 229,230,231,232 hundredGigE29 28 100000
31+
Ethernet116 237,238,239,240 hundredGigE30 29 100000
32+
Ethernet120 245,246,247,248 hundredGigE31 30 100000
33+
Ethernet124 253,254,255,256 hundredGigE32 31 100000
34+
Ethernet128 69,70,71,72 hundredGigE33 32 100000
35+
Ethernet132 77,78,79,80 hundredGigE34 33 100000
36+
Ethernet136 93,94,95,96 hundredGigE35 34 100000
37+
Ethernet140 85,86,87,88 hundredGigE36 35 100000
38+
Ethernet144 101,102,103,104 hundredGigE37 36 100000
39+
Ethernet148 109,110,111,112 hundredGigE38 37 100000
40+
Ethernet152 125,126,127,128 hundredGigE39 38 100000
41+
Ethernet156 117,118,119,120 hundredGigE40 39 100000
42+
Ethernet160 37,38,39,40 hundredGigE41 40 100000
43+
Ethernet164 45,46,47,48 hundredGigE42 41 100000
44+
Ethernet168 61,62,63,64 hundredGigE43 42 100000
45+
Ethernet172 53,54,55,56 hundredGigE44 43 100000
46+
Ethernet176 133,134,135,136 hundredGigE45 44 100000
47+
Ethernet180 141,142,143,144 hundredGigE46 45 100000
48+
Ethernet184 157,158,159,160 hundredGigE47 46 100000
49+
Ethernet188 149,150,151,152 hundredGigE48 47 100000
50+
Ethernet192 161,162,163,164 hundredGigE49 48 100000
51+
Ethernet196 169,170,171,172 hundredGigE50 49 100000
52+
Ethernet200 185,186,187,188 hundredGigE51 50 100000
53+
Ethernet204 177,178,179,180 hundredGigE52 51 100000
54+
Ethernet208 1,2,3,4 hundredGigE53 52 100000
55+
Ethernet212 9,10,11,12 hundredGigE54 53 100000
56+
Ethernet216 25,26,27,28 hundredGigE55 54 100000
57+
Ethernet220 17,18,19,20 hundredGigE56 55 100000
58+
Ethernet224 193,194,195,196 hundredGigE57 56 100000
59+
Ethernet228 201,202,203,204 hundredGigE58 57 100000
60+
Ethernet232 217,218,219,220 hundredGigE59 58 100000
61+
Ethernet236 209,210,211,212 hundredGigE60 59 100000
62+
Ethernet240 225,226,227,228 hundredGigE61 60 100000
63+
Ethernet244 233,234,235,236 hundredGigE62 61 100000
64+
Ethernet248 249,250,251,252 hundredGigE63 62 100000
65+
Ethernet252 241,242,243,244 hundredGigE64 63 100000

device/juniper/x86_64-juniper_qfx5210-r0/plugins/sfputil.py

Lines changed: 76 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -43,146 +43,79 @@ class SfpUtil(SfpUtilBase):
4343
cmd = '/var/run/sfppresence'
4444
_port_to_eeprom_mapping = {}
4545
port_to_i2c_mapping = {
46-
61 : 25,
47-
62 : 26,
48-
63 : 27,
49-
64 : 28,
50-
55 : 29,
51-
56 : 30,
52-
53 : 31,
53-
54 : 32,
54-
9 : 33,
55-
10 : 34,
56-
11 : 35,
57-
12 : 36,
58-
1 : 37,
59-
2 : 38,
60-
3 : 39,
61-
4 : 40,
62-
6 : 41,
63-
5 : 42,
64-
8 : 43,
65-
7 : 44,
66-
13 : 45,
67-
14 : 46,
68-
15 : 47,
69-
16 : 48,
70-
17 : 49,
71-
18 : 50,
72-
19 : 51,
73-
20 : 52,
74-
25 : 53,
75-
26 : 54,
76-
27 : 55,
77-
28 : 56,
78-
29 : 57,
79-
30 : 58,
80-
31 : 59,
81-
32 : 60,
82-
21 : 61,
83-
22 : 62,
84-
23 : 63,
85-
24 : 64,
86-
41 : 65,
87-
42 : 66,
88-
43 : 67,
89-
44 : 68,
90-
33 : 69,
91-
34 : 70,
92-
35 : 71,
93-
36 : 72,
94-
45 : 73,
95-
46 : 74,
96-
47 : 75,
97-
48 : 76,
98-
37 : 77,
99-
38 : 78,
100-
39 : 79,
101-
40 : 80,
102-
57 : 81,
103-
58 : 82,
104-
59 : 83,
105-
60 : 84,
106-
49 : 85,
107-
50 : 86,
108-
51 : 87,
109-
52 : 88,}
110-
111-
port_to_sysfs_map = [
112-
'/sys/bus/i2c/devices/37-0050/sfp_is_present',
113-
'/sys/bus/i2c/devices/38-0050/sfp_is_present',
114-
'/sys/bus/i2c/devices/39-0050/sfp_is_present',
115-
'/sys/bus/i2c/devices/40-0050/sfp_is_present',
116-
'/sys/bus/i2c/devices/42-0050/sfp_is_present',
117-
'/sys/bus/i2c/devices/41-0050/sfp_is_present',
118-
'/sys/bus/i2c/devices/44-0050/sfp_is_present',
119-
'/sys/bus/i2c/devices/43-0050/sfp_is_present',
120-
'/sys/bus/i2c/devices/33-0050/sfp_is_present',
121-
'/sys/bus/i2c/devices/34-0050/sfp_is_present',
122-
'/sys/bus/i2c/devices/35-0050/sfp_is_present',
123-
'/sys/bus/i2c/devices/36-0050/sfp_is_present',
124-
'/sys/bus/i2c/devices/45-0050/sfp_is_present',
125-
'/sys/bus/i2c/devices/46-0050/sfp_is_present',
126-
'/sys/bus/i2c/devices/47-0050/sfp_is_present',
127-
'/sys/bus/i2c/devices/48-0050/sfp_is_present',
128-
'/sys/bus/i2c/devices/49-0050/sfp_is_present',
129-
'/sys/bus/i2c/devices/50-0050/sfp_is_present',
130-
'/sys/bus/i2c/devices/51-0050/sfp_is_present',
131-
'/sys/bus/i2c/devices/52-0050/sfp_is_present',
132-
'/sys/bus/i2c/devices/61-0050/sfp_is_present',
133-
'/sys/bus/i2c/devices/62-0050/sfp_is_present',
134-
'/sys/bus/i2c/devices/63-0050/sfp_is_present',
135-
'/sys/bus/i2c/devices/64-0050/sfp_is_present',
136-
'/sys/bus/i2c/devices/53-0050/sfp_is_present',
137-
'/sys/bus/i2c/devices/54-0050/sfp_is_present',
138-
'/sys/bus/i2c/devices/55-0050/sfp_is_present',
139-
'/sys/bus/i2c/devices/56-0050/sfp_is_present',
140-
'/sys/bus/i2c/devices/57-0050/sfp_is_present',
141-
'/sys/bus/i2c/devices/58-0050/sfp_is_present',
142-
'/sys/bus/i2c/devices/59-0050/sfp_is_present',
143-
'/sys/bus/i2c/devices/60-0050/sfp_is_present',
144-
'/sys/bus/i2c/devices/69-0050/sfp_is_present',
145-
'/sys/bus/i2c/devices/70-0050/sfp_is_present',
146-
'/sys/bus/i2c/devices/71-0050/sfp_is_present',
147-
'/sys/bus/i2c/devices/72-0050/sfp_is_present',
148-
'/sys/bus/i2c/devices/77-0050/sfp_is_present',
149-
'/sys/bus/i2c/devices/78-0050/sfp_is_present',
150-
'/sys/bus/i2c/devices/79-0050/sfp_is_present',
151-
'/sys/bus/i2c/devices/80-0050/sfp_is_present',
152-
'/sys/bus/i2c/devices/65-0050/sfp_is_present',
153-
'/sys/bus/i2c/devices/66-0050/sfp_is_present',
154-
'/sys/bus/i2c/devices/67-0050/sfp_is_present',
155-
'/sys/bus/i2c/devices/68-0050/sfp_is_present',
156-
'/sys/bus/i2c/devices/73-0050/sfp_is_present',
157-
'/sys/bus/i2c/devices/74-0050/sfp_is_present',
158-
'/sys/bus/i2c/devices/75-0050/sfp_is_present',
159-
'/sys/bus/i2c/devices/76-0050/sfp_is_present',
160-
'/sys/bus/i2c/devices/85-0050/sfp_is_present',
161-
'/sys/bus/i2c/devices/86-0050/sfp_is_present',
162-
'/sys/bus/i2c/devices/87-0050/sfp_is_present',
163-
'/sys/bus/i2c/devices/88-0050/sfp_is_present',
164-
'/sys/bus/i2c/devices/31-0050/sfp_is_present',
165-
'/sys/bus/i2c/devices/32-0050/sfp_is_present',
166-
'/sys/bus/i2c/devices/29-0050/sfp_is_present',
167-
'/sys/bus/i2c/devices/30-0050/sfp_is_present',
168-
'/sys/bus/i2c/devices/81-0050/sfp_is_present',
169-
'/sys/bus/i2c/devices/82-0050/sfp_is_present',
170-
'/sys/bus/i2c/devices/83-0050/sfp_is_present',
171-
'/sys/bus/i2c/devices/84-0050/sfp_is_present',
172-
'/sys/bus/i2c/devices/25-0050/sfp_is_present',
173-
'/sys/bus/i2c/devices/26-0050/sfp_is_present',
174-
'/sys/bus/i2c/devices/27-0050/sfp_is_present',
175-
'/sys/bus/i2c/devices/28-0050/sfp_is_present'
176-
177-
]
46+
60 : 25,
47+
61 : 26,
48+
62 : 27,
49+
63 : 28,
50+
54 : 29,
51+
55 : 30,
52+
52 : 31,
53+
53 : 32,
54+
8 : 33,
55+
9 : 34,
56+
10 : 35,
57+
11 : 36,
58+
0 : 37,
59+
1 : 38,
60+
2 : 39,
61+
3 : 40,
62+
5 : 41,
63+
4 : 42,
64+
7 : 43,
65+
6 : 44,
66+
12 : 45,
67+
13 : 46,
68+
14 : 47,
69+
15 : 48,
70+
16 : 49,
71+
17 : 50,
72+
18 : 51,
73+
19 : 52,
74+
24 : 53,
75+
25 : 54,
76+
26 : 55,
77+
27 : 56,
78+
28 : 57,
79+
29 : 58,
80+
30 : 59,
81+
31 : 60,
82+
20 : 61,
83+
21 : 62,
84+
22 : 63,
85+
23 : 64,
86+
40 : 65,
87+
41 : 66,
88+
42 : 67,
89+
43 : 68,
90+
32 : 69,
91+
33 : 70,
92+
34 : 71,
93+
35 : 72,
94+
44 : 73,
95+
45 : 74,
96+
46 : 75,
97+
47 : 76,
98+
36 : 77,
99+
37 : 78,
100+
38 : 79,
101+
39 : 80,
102+
56 : 81,
103+
57 : 82,
104+
58 : 83,
105+
59 : 84,
106+
48 : 85,
107+
49 : 86,
108+
50 : 87,
109+
51 : 88,}
110+
178111
# sys.path.append('/usr/local/bin')
179112
_qsfp_ports = range(0, ports_in_block + 1)
180113

181114

182115
def __init__(self):
183-
eeprom_path = '/sys/bus/i2c/devices/{0}-0050/sfp_eeprom'
184-
for x in range(0, self._port_end + 1):
185-
port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x+1])
116+
eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom'
117+
for x in range(self._port_start, self._port_end + 1):
118+
port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x])
186119
self._port_to_eeprom_mapping[x] = port_eeprom_path
187120
SfpUtilBase.__init__(self)
188121

@@ -210,10 +143,9 @@ def get_presence(self, port_num):
210143
if port_num < self._port_start or port_num > self._port_end:
211144
return False
212145

213-
path = "/sys/bus/i2c/devices/{0}-0050/sfp_is_present"
214-
port_ps = path.format(self.port_to_i2c_mapping[port_num+1])
146+
path = "/sys/bus/i2c/devices/19-0060/module_present_{0}"
147+
port_ps = path.format(port_num + 1)
215148

216-
217149
try:
218150
reg_file = open(port_ps)
219151
except IOError as e:
@@ -278,6 +210,8 @@ def sfp_detect(self):
278210
current_sfp_values = [0] * 64
279211
previous_sfp_values = [0] * 64
280212

213+
path = "/sys/bus/i2c/devices/19-0060/module_present_{0}"
214+
281215
if not os.path.isfile(self.cmd):
282216
pass
283217
else:
@@ -287,9 +221,10 @@ def sfp_detect(self):
287221
previous_sfp_values = self.read_from_file(self.cmd)
288222

289223
# Read the current values from sysfs
290-
for x in range(len(self.port_to_sysfs_map)):
224+
for x in range(self._port_start , self._port_end + 1):
291225
try:
292-
reg_file = open(self.port_to_sysfs_map[x], 'r')
226+
new_path = path.format(x + 1)
227+
reg_file = open(new_path, 'r')
293228
except IOError as e:
294229
print "Error: unable to open file: %s" % str(e)
295230
return False, defl_dict
@@ -305,7 +240,7 @@ def sfp_detect(self):
305240
else:
306241
return False, defl_dict
307242

308-
def get_transceiver_change_event(self):
243+
def get_transceiver_change_event(self, timeout=2000):
309244
time.sleep(3)
310245
return self.sfp_detect()
311246

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
obj-m:=x86-64-juniper-qfx5210-64x-fan.o x86-64-juniper-qfx5210-64x-sfp.o x86-64-juniper-qfx5210-64x-leds.o \
1+
obj-m:=x86-64-juniper-qfx5210-64x-fan.o x86-64-juniper-qfx5210-64x-leds.o \
22
x86-64-juniper-qfx5210-64x-psu.o juniper_i2c_cpld.o ym2651y.o

0 commit comments

Comments
 (0)