File tree Expand file tree Collapse file tree
device/mellanox/x86_64-mlnx_msn2700-r0/plugins Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818PMAOS_ENABLE = 1
1919PMAOS_DISABLE = 2
2020
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 ):
2230 oper_state_p = new_sx_port_oper_state_t_p ()
2331 admin_state_p = new_sx_port_admin_state_t_p ()
2432 module_state_p = new_sx_port_module_state_t_p ()
@@ -48,9 +56,10 @@ def get_log_ports(handle, sfp_module):
4856 log_port_list = []
4957 for i in range (0 , port_cnt ):
5058 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 )
5463
5564 return log_port_list
5665
You can’t perform that action at this time.
0 commit comments