Skip to content

How to Use Mellanox SDK Debug Utilities

Kebo Liu edited this page Mar 28, 2018 · 1 revision

Revision

Rev Date Author Change Description
0.1 Liu Kebo Initial version

Mellanox SDK Debug Utilities

Mellanox SDK provides a set of debug utilities which are written in python, you can find them inside the syncd container.

They are under the /usr/bin folder of the container.

root@sonic:/home/admin# docker exec -it syncd bash
root@sonic:/usr/bin# ls sx_* -l
-rwxr-xr-x 1 root root    3445 Mar 23 16:16 sx_api_bridge_dump.py
-rwxr-xr-x 1 root root    8632 Mar 23 16:16 sx_api_bridge_iter_get.py
-rwxr-xr-x 1 root root   20471 Mar 23 16:16 sx_api_bridge_lag_redirect.py
-rwxr-xr-x 1 root root   10786 Mar 23 16:16 sx_api_bridge_vport.py
-rwxr-xr-x 1 root root    2759 Mar 23 16:16 sx_api_cos_default_prio.py
-rwxr-xr-x 1 root root    7939 Mar 23 16:16 sx_api_cos_ets.py
-rwxr-xr-x 1 root root   18616 Mar 23 16:16 sx_api_cos_port_buff_type.py
-rwxr-xr-x 1 root root    3794 Mar 23 16:16 sx_api_cos_port_ptp_params.py
-rwxr-xr-x 1 root root   22068 Mar 23 16:16 sx_api_cos_port_shared_buff_type.py
-rwxr-xr-x 1 root root    5078 Mar 23 16:16 sx_api_cos_redecn.py
-rwxr-xr-x 1 root root   32702 Mar 23 16:16 sx_api_cos_sb.py
-rwxr-xr-x 1 root root    1493 Mar 23 16:16 sx_api_cos_sb_buff_stat.py
-rwxr-xr-x 1 root root   14384 Mar 23 16:16 sx_api_cos_sb_delete_all.py
-rwxr-xr-x 1 root root   25167 Mar 23 16:16 sx_api_cos_sb_get0.py
-rwxr-xr-x 1 root root    5179 Mar 23 16:16 sx_api_cos_sb_per_port_mc_set.py
-rwxr-xr-x 1 root root    1451 Mar 23 16:16 sx_api_cos_sb_pool_list_get.py
-rwxr-xr-x 1 root root   16226 Mar 23 16:16 sx_api_cos_sb_statistics.py
-rwxr-xr-x 1 root root   15608 Mar 23 16:16 sx_api_cos_shared_buffers_dump.py
-rwxr-xr-x 1 root root   15069 Mar 23 16:16 sx_api_cos_trust_port.py
-rwxr-xr-x 1 root root   19601 Mar 23 16:16 sx_api_cos_trust_port_both.py
-rwxr-xr-x 1 root root   15182 Mar 23 16:16 sx_api_cos_trust_port_l2.py
-rwxr-xr-x 1 root root   15009 Mar 23 16:16 sx_api_cos_trust_port_l3.py
-rwxr-xr-x 1 root root    1028 Mar 23 16:16 sx_api_dbg_generate_dump.py
-rwxr-xr-x 1 root root    4746 Mar 23 16:16 sx_api_fdb.py
-rwxr-xr-x 1 root root    5143 Mar 23 16:16 sx_api_fdb_dump.py
-rwxr-xr-x 1 root root   59971 Mar 23 16:16 sx_api_fdb_igmp_v3.py
-rwxr-xr-x 1 root root    3117 Mar 23 16:16 sx_api_fdb_mc_ctrl.py
-rwxr-xr-x 1 root root   16956 Mar 23 16:16 sx_api_fdb_mc_mac_iter_get.py
-rwxr-xr-x 1 root root    1020 Mar 23 16:16 sx_api_fdb_mc_set.py
-rwxr-xr-x 1 root root   19836 Mar 23 16:16 sx_api_flex_acl.py
-rwxr-xr-x 1 root root   64470 Mar 23 16:16 sx_api_flex_acl_dump.py
-rwxr-xr-x 1 root root    3062 Mar 23 16:16 sx_api_flex_acl_key_attr_get.py
-rwxr-xr-x 1 root root    9013 Mar 23 16:16 sx_api_flex_acl_ranges.py
-rwxr-xr-x 1 root root   13592 Mar 23 16:16 sx_api_flow_counter.py
-rwxr-xr-x 1 root root    2293 Mar 23 16:16 sx_api_host_ifc_dump.py
-rwxr-xr-x 1 root root   11900 Mar 23 16:16 sx_api_host_ifc_policer.py
-rwxr-xr-x 1 root root   12732 Mar 23 16:16 sx_api_host_ifc_port_vlan_trap_id_register_get.py
-rwxr-xr-x 1 root root    5461 Mar 23 16:16 sx_api_host_ifc_trap.py
-rwxr-xr-x 1 root root    5801 Mar 23 16:16 sx_api_host_ifc_trap_filter_get.py
-rwxr-xr-x 1 root root    8239 Mar 23 16:16 sx_api_host_ifc_trap_group_iter_get.py
-rwxr-xr-x 1 root root    8930 Mar 23 16:16 sx_api_host_ifc_trap_id_register_get.py
-rwxr-xr-x 1 root root    6296 Mar 23 16:16 sx_api_host_ifc_trap_recv.py
-rwxr-xr-x 1 root root    7006 Mar 23 16:16 sx_api_lag.py
-rwxr-xr-x 1 root root    7605 Mar 23 16:16 sx_api_lag_dump.py
-rwxr-xr-x 1 root root   11595 Mar 23 16:16 sx_api_lag_mstp.py
-rwxr-xr-x 1 root root    8810 Mar 23 16:16 sx_api_lag_port_group_iter_get.py
-rwxr-xr-x 1 root root   10735 Mar 23 16:16 sx_api_lag_redirect.py
-rwxr-xr-x 1 root root   18473 Mar 23 16:16 sx_api_mc_router.py
-rwxr-xr-x 1 root root   41530 Mar 23 16:16 sx_api_mpls.py
-rwxr-xr-x 1 root root    2614 Mar 23 16:16 sx_api_mstp.py
-rwxr-xr-x 1 root root    3203 Mar 23 16:16 sx_api_port.py
-rwxr-xr-x 1 root root    9552 Mar 23 16:16 sx_api_port_counter_dump.py
-rwxr-xr-x 1 root root    9141 Mar 23 16:16 sx_api_port_counter_dump_all.py
-rwxr-xr-x 1 root root    4775 Mar 23 16:16 sx_api_port_speed_get.py
-rwxr-xr-x 1 root root    2705 Mar 23 16:16 sx_api_port_speed_set_100G.py
-rwxr-xr-x 1 root root    2806 Mar 23 16:16 sx_api_port_speed_set_10G.py
-rwxr-xr-x 1 root root    2697 Mar 23 16:16 sx_api_port_speed_set_25G.py
-rwxr-xr-x 1 root root    2738 Mar 23 16:16 sx_api_port_speed_set_40G.py
-rwxr-xr-x 1 root root    2700 Mar 23 16:16 sx_api_port_speed_set_50G.py
-rwxr-xr-x 1 root root    2632 Mar 23 16:16 sx_api_port_speed_set_56G.py
-rwxr-xr-x 1 root root    9755 Mar 23 16:16 sx_api_port_storm_control.py
-rwxr-xr-x 1 root root    5799 Mar 23 16:16 sx_api_ports_dump.py
-rwxr-xr-x 1 root root    4021 Mar 23 16:16 sx_api_resource_manager.py
-rwxr-xr-x 1 root root    7590 Mar 23 16:16 sx_api_resource_manager_apis.py
-rwxr-xr-x 1 root root    1785 Mar 23 16:16 sx_api_resource_manager_dump_all.py
-rwxr-xr-x 1 root root   64383 Mar 23 16:16 sx_api_router.py
-rwxr-xr-x 1 root root    8896 Mar 23 16:16 sx_api_router_ecmp_dump.py
-rwxr-xr-x 1 root root    7950 Mar 23 16:16 sx_api_router_ecmp_iter_get.py
-rwxr-xr-x 1 root root   23131 Mar 23 16:16 sx_api_router_flow_counter.py
-rwxr-xr-x 1 root root    5744 Mar 23 16:16 sx_api_router_interface_dump_all.py
-rwxr-xr-x 1 root root    3799 Mar 23 16:16 sx_api_router_neigh_dump.py
-rwxr-xr-x 1 root root    6627 Mar 23 16:16 sx_api_router_uc_routes_dump_all.py
-rwxr-xr-x 1 root root    3049 Mar 23 16:16 sx_api_router_virtual_routers_dump_all.py
-rwxr-xr-x 1 root root    8767 Mar 23 16:16 sx_api_sflow_lag_port.py
-rwxr-xr-x 1 root root   13145 Mar 23 16:16 sx_api_sflow_operations.py
-rwxr-xr-x 1 root root    5220 Mar 23 16:16 sx_api_sflow_port.py
-rwxr-xr-x 1 root root   20483 Mar 23 16:16 sx_api_span.py
-rwxr-xr-x 1 root root   15408 Mar 23 16:16 sx_api_span_dump.py
-rwxr-xr-x 1 root root   25242 Mar 23 16:16 sx_api_span_egress_mirror.py
-rwxr-xr-x 1 root root   17387 Mar 23 16:16 sx_api_tele.py
-rwxr-xr-x 1 root root    1207 Mar 23 16:16 sx_api_transaction_mode_set.py
-rwxr-xr-x 1 root root   35886 Mar 23 16:16 sx_api_tunneling.py
-rwxr-xr-x 1 root root   86070 Mar 23 16:16 sx_api_tunneling_vxlan.py
-rwxr-xr-x 1 root root   22816 Mar 23 16:16 sx_api_vlag_mstp
-rwxr-xr-x 1 root root   12268 Mar 23 16:16 sx_api_vlag_mstp.py
-rwxr-xr-x 1 root root    5509 Mar 23 16:16 sx_api_vlan.py
-rwxr-xr-x 1 root root    5289 Mar 23 16:16 sx_api_vlan_dump.py
-rwxr-xr-x 1 root root    1330 Mar 23 16:16 sx_api_vlan_get_all_vlans_ports.py
-rwxr-xr-x 1 root root    3489 Mar 23 16:16 sx_api_vlan_multi_set.py
-rwxr-xr-x 1 root root    2387 Mar 23 16:16 sx_api_vlan_qinq_dump.py
-rwxr-xr-x 1 root root   60384 Mar 23 16:07 sx_player
-rwxr-xr-x 1 root root     751 Mar 25 09:22 sx_player_start.sh
-rwxr-xr-x 1 root root   18720 Mar 23 16:16 sx_ptp_device_start
-rwxr-xr-x 1 root root    6128 Mar 23 16:07 sx_sdk
-rwxr-xr-x 1 root root 1037075 Mar 23 16:16 sx_tags

You can run these scripts directly in the container to dump some information or issue some configuration directly to the SDK.

For example, with script "sx_api_ports_dump.py" you can dump the ports information from SDK:

root@sonic:/usr/bin# sx_api_ports_dump.py 
=================================================================================================================
|  log_port|local_port|label_port|       mtu| admin_s|  oper_s|       module_s|  pvid|     oper_speed|  fec_mode|
=================================================================================================================
|   0x10100|         1|        33|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10200|         2|        34|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10300|         3|        35|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10400|         4|        36|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10500|         5|        37|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10600|         6|        38|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10700|         7|        39|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10800|         8|        40|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10900|         9|        41|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10a00|        10|        42|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10b00|        11|        43|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10c00|        12|        44|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10d00|        13|        45|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10e00|        14|        46|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x10f00|        15|        47|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x11000|        16|        48|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x11100|        17|        49|      9238|    DOWN|    DOWN|        PLUGGED|     1|            N/A|      None|
|   0x11300|        19|        50|      9238|    DOWN|    DOWN|        PLUGGED|     1|            N/A|      None|
|   0x11500|        21|        51|      9238|    DOWN|    DOWN|        PLUGGED|     1|            N/A|      None|
|   0x11700|        23|        52|      9238|    DOWN|    DOWN|        PLUGGED|     1|            N/A|      None|
|   0x11900|        25|        53|      9238|    DOWN|    DOWN|        PLUGGED|     1|            N/A|      None|
|   0x11b00|        27|        54|      9238|    DOWN|    DOWN|      UNPLUGGED|     1|            N/A|      None|
|   0x11d00|        29|        55|      9238|    DOWN|    DOWN|        PLUGGED|     1|            N/A|      None|
|   0x11f00|        31|        56|      9238|    DOWN|    DOWN|        PLUGGED|     1|            N/A|      None|
|   0x12100|        33|        29|      9122|      UP|      UP|        PLUGGED|     1|        25GB_CR|        FC|
|   0x12200|        34|        30|      9122|      UP|      UP|        PLUGGED|     1|        25GB_CR|        FC|
|   0x12300|        35|        31|      9122|      UP|      UP|        PLUGGED|     1|        25GB_CR|        FC|
|   0x12400|        36|        32|      9122|      UP|      UP|        PLUGGED|     1|        25GB_CR|        FC|
|   0x12500|        37|        25|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x12600|        38|        26|      9238|    DOWN|    DOWN|        PLUGGED|     1|            N/A|      None|
|   0x12700|        39|        27|      9238|    DOWN|    DOWN|        PLUGGED|     1|            N/A|      None|
|   0x12800|        40|        28|      9238|    DOWN|    DOWN|        PLUGGED|     1|            N/A|      None|
|   0x12900|        41|        21|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x12a00|        42|        22|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x12b00|        43|        23|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x12c00|        44|        24|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x12d00|        45|        17|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x12e00|        46|        18|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x12f00|        47|        19|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13000|        48|        20|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13100|        49|        13|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13200|        50|        14|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13300|        51|        15|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13400|        52|        16|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13500|        53|         9|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13600|        54|        10|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13700|        55|        11|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13800|        56|        12|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13900|        57|         5|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13a00|        58|         6|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13b00|        59|         7|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13c00|        60|         8|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13d00|        61|         1|      9238|    DOWN|    DOWN|        PLUGGED|     1|            N/A|      None|
|   0x13e00|        62|         2|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x13f00|        63|         3|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
|   0x14000|        64|         4|      9122|      UP|      UP|        PLUGGED|  1000|        25GB_CR|        FC|
=================================================================================================================
Clone this wiki locally