File tree 1 file changed +13
-4
lines changed
device/mellanox/x86_64-mlnx_msn2700-r0/plugins
1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 18
18
PMAOS_ENABLE = 1
19
19
PMAOS_DISABLE = 2
20
20
21
- def get_port_admin_status_by_log_port (log_port ):
21
+ PORT_TYPE_NVE = 8
22
+ PORT_TYPE_OFFSET = 28
23
+ PORT_TYPE_MASK = 0xF0000000
24
+ NVE_MASK = PORT_TYPE_MASK & (PORT_TYPE_NVE << PORT_TYPE_OFFSET )
25
+
26
+ def is_nve (port ):
27
+ return (port & NVE_MASK ) != 0
28
+
29
+ def is_port_admin_status_up (log_port ):
22
30
oper_state_p = new_sx_port_oper_state_t_p ()
23
31
admin_state_p = new_sx_port_admin_state_t_p ()
24
32
module_state_p = new_sx_port_module_state_t_p ()
@@ -48,9 +56,10 @@ def get_log_ports(handle, sfp_module):
48
56
log_port_list = []
49
57
for i in range (0 , port_cnt ):
50
58
port_attributes = sx_port_attributes_t_arr_getitem (port_attributes_list , i )
51
- if port_attributes .port_mapping .module_port == sfp_module :
52
- if get_port_admin_status_by_log_port (port_attributes .log_port ):
53
- log_port_list .append (port_attributes .log_port )
59
+ if is_nve (int (port_attributes .log_port )) == False \
60
+ and port_attributes .port_mapping .module_port == sfp_module \
61
+ and is_port_admin_status_up (port_attributes .log_port ):
62
+ log_port_list .append (port_attributes .log_port )
54
63
55
64
return log_port_list
56
65
You can’t perform that action at this time.
0 commit comments