get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/28731/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 28731,
    "url": "https://patches.dpdk.org/api/patches/28731/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20170914115302.33995-2-jasvinder.singh@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20170914115302.33995-2-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20170914115302.33995-2-jasvinder.singh@intel.com",
    "date": "2017-09-14T11:53:02",
    "name": "[dpdk-dev,v2,2/2] app/testpmd: add CLI for tm mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "617670b6c2ea10a958ff59fa10c1c54167f61a26",
    "submitter": {
        "id": 285,
        "url": "https://patches.dpdk.org/api/people/285/?format=api",
        "name": "Jasvinder Singh",
        "email": "jasvinder.singh@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20170914115302.33995-2-jasvinder.singh@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/28731/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/28731/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B17D81AF03;\n\tThu, 14 Sep 2017 13:41:04 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 1FD7E199A9\n\tfor <dev@dpdk.org>; Thu, 14 Sep 2017 13:41:01 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby orsmga105.jf.intel.com with ESMTP; 14 Sep 2017 04:41:01 -0700",
            "from silpixa00381635.ir.intel.com (HELO\n\tsilpixa00381635.ger.corp.intel.com) ([10.237.222.149])\n\tby orsmga004.jf.intel.com with ESMTP; 14 Sep 2017 04:41:00 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.42,392,1500966000\"; d=\"scan'208\";a=\"128676436\"",
        "From": "Jasvinder Singh <jasvinder.singh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "cristian.dumitrescu@intel.com,\n\tjingjing.wu@intel.com",
        "Date": "Thu, 14 Sep 2017 12:53:02 +0100",
        "Message-Id": "<20170914115302.33995-2-jasvinder.singh@intel.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "In-Reply-To": "<20170914115302.33995-1-jasvinder.singh@intel.com>",
        "References": "<20170822170240.8059-1-jasvinder.singh@intel.com>\n\t<20170914115302.33995-1-jasvinder.singh@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/2] app/testpmd: add CLI for tm mode",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add following CLIs in testpmd application;\n- commands to build hierarchical tree for the QoS Scheduler.\n- commands for runtime update of the hierarchical tree.\n- commands to display TM capability information.\n  (per port, per hierarchy level and per hierarchy node)\n- command to set the packet field mask and offset value for\n  classification.\n- command to set traffic class translation table entry\n- stats collection\n\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\n---\n app/test-pmd/cmdline.c | 2975 ++++++++++++++++++++++++++++++++++++++++++++----\n 1 file changed, 2785 insertions(+), 190 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex cd8c358..cb837ce 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -98,6 +98,19 @@\n #ifdef RTE_LIBRTE_BNXT_PMD\n #include <rte_pmd_bnxt.h>\n #endif\n+\n+#if defined RTE_LIBRTE_PMD_SOFTNIC && defined RTE_LIBRTE_SCHED\n+#define TM_MODE\t\t\t1\n+#else\n+#define TM_MODE\t\t\t0\n+#endif\n+\n+#ifdef TM_MODE\n+#include <rte_sched.h>\n+#include <rte_eth_softnic.h>\n+#include <rte_tm.h>\n+#endif\n+\n #include \"testpmd.h\"\n \n static struct cmdline *testpmd_cl;\n@@ -230,6 +243,23 @@ static void cmd_help_long_parsed(void *parsed_result,\n \n \t\t\t\"clear vf stats (port_id) (vf_id)\\n\"\n \t\t\t\"    Reset a VF's statistics.\\n\\n\"\n+\n+#ifdef TM_MODE\n+\t\t\t\"show port tm cap (port_id)\\n\"\n+\t\t\t\"\tDisplay the port TM capability.\\n\\n\"\n+\n+\t\t\t\"show port tm level cap (port_id) (level_id)\\n\"\n+\t\t\t\"\tDisplay the port TM hierarchical level capability.\\n\\n\"\n+\n+\t\t\t\"show port tm node cap (port_id) (node_id)\\n\"\n+\t\t\t\"\tDisplay the port TM node capability.\\n\\n\"\n+\n+\t\t\t\"show port tm node type (port_id) (node_id)\\n\"\n+\t\t\t\"\tDisplay the port TM node type.\\n\\n\"\n+\n+\t\t\t\"show port tm node stats (port_id) (node_id) (clear)\\n\"\n+\t\t\t\"\tDisplay the port TM node stats.\\n\\n\"\n+#endif\n \t\t);\n \t}\n \n@@ -637,6 +667,61 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"ptype mapping update (port_id) (hw_ptype) (sw_ptype)\\n\"\n \t\t\t\"    Update a ptype mapping item on a port\\n\\n\"\n \n+#ifdef TM_MODE\n+\t\t\t\"add port tm node shaper profile (port_id) (shaper_profile_id)\"\n+\t\t\t\" (tb_rate) (tb_size)\\n\"\n+\t\t\t\"\tAdd port tm node private shaper profile.\\n\\n\"\n+\n+\t\t\t\"del port tm node shaper profile (port_id) (shaper_profile_id)\\n\"\n+\t\t\t\"\tDelete port tm node private shaper profile.\\n\\n\"\n+\n+\t\t\t\"add port tm node shared shaper (port_id) (shared_shaper_id)\"\n+\t\t\t\" (shaper_profile_id)\\n\"\n+\t\t\t\"\tAdd/update port tm node shared shaper.\\n\\n\"\n+\n+\t\t\t\"del port tm node shared shaper (port_id) (shared_shaper_id)\\n\"\n+\t\t\t\"\tDelete port tm node shared shaper.\\n\\n\"\n+\n+\t\t\t\"add port tm node wred profile (port_id) (wred_profile_id)\"\n+\t\t\t\" (color_g) (min_th_g) (max_th_g) (maxp_inv_g) (wq_log2_g)\"\n+\t\t\t\" (color_y) (min_th_y) (max_th_y) (maxp_inv_y) (wq_log2_y)\"\n+\t\t\t\" (color_r) (min_th_r) (max_th_r) (maxp_inv_r) (wq_log2_r)\\n\"\n+\t\t\t\"\tAdd port tm node wred profile.\\n\\n\"\n+\n+\t\t\t\"del port tm node wred profile (port_id) (wred_profile_id)\\n\"\n+\t\t\t\"\tDelete port tm node wred profile.\\n\\n\"\n+\n+\t\t\t\"add port tm nonleaf node shared shaper (port_id) (node_id)\"\n+\t\t\t\" (parent_node_id) (priority) (weight) (level_id)\"\n+\t\t\t\" (shaper_profile_id) (shared_shaper_id) (n_shared_shapers)\"\n+\t\t\t\" (n_sp_priorities)\\n\"\n+\t\t\t\"\tAdd port tm nonleaf node.\\n\\n\"\n+\n+\t\t\t\"add port tm leaf node shared shaper (port_id) (node_id)\"\n+\t\t\t\" (parent_node_id) (priority) (weight) (level_id)\"\n+\t\t\t\" (cman_mode) (wred_profile_id)\\n\"\n+\t\t\t\"\tAdd port tm leaf node.\\n\\n\"\n+\n+\t\t\t\"del port tm node (port_id) (node_id)\\n\"\n+\t\t\t\"\tDelete port tm node.\\n\\n\"\n+\n+#ifdef RTE_SCHED_SUBPORT_TC_OV\n+\t\t\t\"set port tm node parent (port_id) (node_id) (parent_node_id)\"\n+\t\t\t\" (priority) (weight)\\n\"\n+\t\t\t\"\tSet port tm node parent.\\n\\n\"\n+#endif\n+\t\t\t\"set port tm node shaper profile (port_id) (node_id)\"\n+\t\t\t\" (shaper_profile_id)\\n\"\n+\t\t\t\"\tSet port tm node shaper profile.\\n\\n\"\n+\n+\t\t\t\"set port tm pktfield (subport|pipe|tc) (port_id) offset\"\n+\t\t\t\" (offset) mask (mask)\\n\"\n+\t\t\t\"\tSet port tm packet field.\\n\\n\"\n+\n+\t\t\t\"set port tm tc table (port_id) index (tb_index) tc (tc_id)\"\n+\t\t\t\" queue (queue id)\\n\"\n+\t\t\t\"\tSet port tm traffic class table entry.\\n\\n\"\n+#endif\n \t\t\t, list_pkt_forwarding_modes()\n \t\t);\n \t}\n@@ -14185,197 +14270,2707 @@ cmdline_parse_inst_t cmd_load_from_file = {\n \t},\n };\n \n-/* ******************************************************************************** */\n+#ifdef TM_MODE\n \n-/* list of instructions */\n-cmdline_parse_ctx_t main_ctx[] = {\n-\t(cmdline_parse_inst_t *)&cmd_help_brief,\n-\t(cmdline_parse_inst_t *)&cmd_help_long,\n-\t(cmdline_parse_inst_t *)&cmd_quit,\n-\t(cmdline_parse_inst_t *)&cmd_load_from_file,\n-\t(cmdline_parse_inst_t *)&cmd_showport,\n-\t(cmdline_parse_inst_t *)&cmd_showqueue,\n-\t(cmdline_parse_inst_t *)&cmd_showportall,\n-\t(cmdline_parse_inst_t *)&cmd_showcfg,\n-\t(cmdline_parse_inst_t *)&cmd_start,\n-\t(cmdline_parse_inst_t *)&cmd_start_tx_first,\n-\t(cmdline_parse_inst_t *)&cmd_start_tx_first_n,\n-\t(cmdline_parse_inst_t *)&cmd_set_link_up,\n-\t(cmdline_parse_inst_t *)&cmd_set_link_down,\n-\t(cmdline_parse_inst_t *)&cmd_reset,\n-\t(cmdline_parse_inst_t *)&cmd_set_numbers,\n-\t(cmdline_parse_inst_t *)&cmd_set_txpkts,\n-\t(cmdline_parse_inst_t *)&cmd_set_txsplit,\n-\t(cmdline_parse_inst_t *)&cmd_set_fwd_list,\n-\t(cmdline_parse_inst_t *)&cmd_set_fwd_mask,\n-\t(cmdline_parse_inst_t *)&cmd_set_fwd_mode,\n-\t(cmdline_parse_inst_t *)&cmd_set_fwd_retry_mode,\n-\t(cmdline_parse_inst_t *)&cmd_set_burst_tx_retry,\n-\t(cmdline_parse_inst_t *)&cmd_set_promisc_mode_one,\n-\t(cmdline_parse_inst_t *)&cmd_set_promisc_mode_all,\n-\t(cmdline_parse_inst_t *)&cmd_set_allmulti_mode_one,\n-\t(cmdline_parse_inst_t *)&cmd_set_allmulti_mode_all,\n-\t(cmdline_parse_inst_t *)&cmd_set_flush_rx,\n-\t(cmdline_parse_inst_t *)&cmd_set_link_check,\n-\t(cmdline_parse_inst_t *)&cmd_set_bypass_mode,\n-\t(cmdline_parse_inst_t *)&cmd_set_bypass_event,\n-\t(cmdline_parse_inst_t *)&cmd_set_bypass_timeout,\n-\t(cmdline_parse_inst_t *)&cmd_show_bypass_config,\n-#ifdef RTE_LIBRTE_PMD_BOND\n-\t(cmdline_parse_inst_t *) &cmd_set_bonding_mode,\n-\t(cmdline_parse_inst_t *) &cmd_show_bonding_config,\n-\t(cmdline_parse_inst_t *) &cmd_set_bonding_primary,\n-\t(cmdline_parse_inst_t *) &cmd_add_bonding_slave,\n-\t(cmdline_parse_inst_t *) &cmd_remove_bonding_slave,\n-\t(cmdline_parse_inst_t *) &cmd_create_bonded_device,\n-\t(cmdline_parse_inst_t *) &cmd_set_bond_mac_addr,\n-\t(cmdline_parse_inst_t *) &cmd_set_balance_xmit_policy,\n-\t(cmdline_parse_inst_t *) &cmd_set_bond_mon_period,\n-\t(cmdline_parse_inst_t *) &cmd_set_lacp_dedicated_queues,\n-\t(cmdline_parse_inst_t *) &cmd_set_bonding_agg_mode_policy,\n-#endif\n-\t(cmdline_parse_inst_t *)&cmd_vlan_offload,\n-\t(cmdline_parse_inst_t *)&cmd_vlan_tpid,\n-\t(cmdline_parse_inst_t *)&cmd_rx_vlan_filter_all,\n-\t(cmdline_parse_inst_t *)&cmd_rx_vlan_filter,\n-\t(cmdline_parse_inst_t *)&cmd_tx_vlan_set,\n-\t(cmdline_parse_inst_t *)&cmd_tx_vlan_set_qinq,\n-\t(cmdline_parse_inst_t *)&cmd_tx_vlan_reset,\n-\t(cmdline_parse_inst_t *)&cmd_tx_vlan_set_pvid,\n-\t(cmdline_parse_inst_t *)&cmd_csum_set,\n-\t(cmdline_parse_inst_t *)&cmd_csum_show,\n-\t(cmdline_parse_inst_t *)&cmd_csum_tunnel,\n-\t(cmdline_parse_inst_t *)&cmd_tso_set,\n-\t(cmdline_parse_inst_t *)&cmd_tso_show,\n-\t(cmdline_parse_inst_t *)&cmd_tunnel_tso_set,\n-\t(cmdline_parse_inst_t *)&cmd_tunnel_tso_show,\n-\t(cmdline_parse_inst_t *)&cmd_enable_gro,\n-\t(cmdline_parse_inst_t *)&cmd_gro_set,\n-\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set,\n-\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_rx,\n-\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_tx,\n-\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_hw,\n-\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_lw,\n-\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_pt,\n-\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_xon,\n-\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_macfwd,\n-\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_autoneg,\n-\t(cmdline_parse_inst_t *)&cmd_priority_flow_control_set,\n-\t(cmdline_parse_inst_t *)&cmd_config_dcb,\n-\t(cmdline_parse_inst_t *)&cmd_read_reg,\n-\t(cmdline_parse_inst_t *)&cmd_read_reg_bit_field,\n-\t(cmdline_parse_inst_t *)&cmd_read_reg_bit,\n-\t(cmdline_parse_inst_t *)&cmd_write_reg,\n-\t(cmdline_parse_inst_t *)&cmd_write_reg_bit_field,\n-\t(cmdline_parse_inst_t *)&cmd_write_reg_bit,\n-\t(cmdline_parse_inst_t *)&cmd_read_rxd_txd,\n-\t(cmdline_parse_inst_t *)&cmd_stop,\n-\t(cmdline_parse_inst_t *)&cmd_mac_addr,\n-\t(cmdline_parse_inst_t *)&cmd_set_qmap,\n-\t(cmdline_parse_inst_t *)&cmd_operate_port,\n-\t(cmdline_parse_inst_t *)&cmd_operate_specific_port,\n-\t(cmdline_parse_inst_t *)&cmd_operate_attach_port,\n-\t(cmdline_parse_inst_t *)&cmd_operate_detach_port,\n-\t(cmdline_parse_inst_t *)&cmd_config_speed_all,\n-\t(cmdline_parse_inst_t *)&cmd_config_speed_specific,\n-\t(cmdline_parse_inst_t *)&cmd_config_rx_tx,\n-\t(cmdline_parse_inst_t *)&cmd_config_mtu,\n-\t(cmdline_parse_inst_t *)&cmd_config_max_pkt_len,\n-\t(cmdline_parse_inst_t *)&cmd_config_rx_mode_flag,\n-\t(cmdline_parse_inst_t *)&cmd_config_rss,\n-\t(cmdline_parse_inst_t *)&cmd_config_rxtx_queue,\n-\t(cmdline_parse_inst_t *)&cmd_config_txqflags,\n-\t(cmdline_parse_inst_t *)&cmd_config_rss_reta,\n-\t(cmdline_parse_inst_t *)&cmd_showport_reta,\n-\t(cmdline_parse_inst_t *)&cmd_config_burst,\n-\t(cmdline_parse_inst_t *)&cmd_config_thresh,\n-\t(cmdline_parse_inst_t *)&cmd_config_threshold,\n-\t(cmdline_parse_inst_t *)&cmd_set_uc_hash_filter,\n-\t(cmdline_parse_inst_t *)&cmd_set_uc_all_hash_filter,\n-\t(cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_macvlan_filter,\n-\t(cmdline_parse_inst_t *)&cmd_queue_rate_limit,\n-\t(cmdline_parse_inst_t *)&cmd_tunnel_filter,\n-\t(cmdline_parse_inst_t *)&cmd_tunnel_udp_config,\n-\t(cmdline_parse_inst_t *)&cmd_global_config,\n-\t(cmdline_parse_inst_t *)&cmd_set_mirror_mask,\n-\t(cmdline_parse_inst_t *)&cmd_set_mirror_link,\n-\t(cmdline_parse_inst_t *)&cmd_reset_mirror_rule,\n-\t(cmdline_parse_inst_t *)&cmd_showport_rss_hash,\n-\t(cmdline_parse_inst_t *)&cmd_showport_rss_hash_key,\n-\t(cmdline_parse_inst_t *)&cmd_config_rss_hash_key,\n-\t(cmdline_parse_inst_t *)&cmd_dump,\n-\t(cmdline_parse_inst_t *)&cmd_dump_one,\n-\t(cmdline_parse_inst_t *)&cmd_ethertype_filter,\n-\t(cmdline_parse_inst_t *)&cmd_syn_filter,\n-\t(cmdline_parse_inst_t *)&cmd_2tuple_filter,\n-\t(cmdline_parse_inst_t *)&cmd_5tuple_filter,\n-\t(cmdline_parse_inst_t *)&cmd_flex_filter,\n-\t(cmdline_parse_inst_t *)&cmd_add_del_ip_flow_director,\n-\t(cmdline_parse_inst_t *)&cmd_add_del_udp_flow_director,\n-\t(cmdline_parse_inst_t *)&cmd_add_del_sctp_flow_director,\n-\t(cmdline_parse_inst_t *)&cmd_add_del_l2_flow_director,\n-\t(cmdline_parse_inst_t *)&cmd_add_del_mac_vlan_flow_director,\n-\t(cmdline_parse_inst_t *)&cmd_add_del_tunnel_flow_director,\n-\t(cmdline_parse_inst_t *)&cmd_flush_flow_director,\n-\t(cmdline_parse_inst_t *)&cmd_set_flow_director_ip_mask,\n-\t(cmdline_parse_inst_t *)&cmd_set_flow_director_mac_vlan_mask,\n-\t(cmdline_parse_inst_t *)&cmd_set_flow_director_tunnel_mask,\n-\t(cmdline_parse_inst_t *)&cmd_set_flow_director_flex_mask,\n-\t(cmdline_parse_inst_t *)&cmd_set_flow_director_flex_payload,\n-\t(cmdline_parse_inst_t *)&cmd_get_sym_hash_ena_per_port,\n-\t(cmdline_parse_inst_t *)&cmd_set_sym_hash_ena_per_port,\n-\t(cmdline_parse_inst_t *)&cmd_get_hash_global_config,\n-\t(cmdline_parse_inst_t *)&cmd_set_hash_global_config,\n-\t(cmdline_parse_inst_t *)&cmd_set_hash_input_set,\n-\t(cmdline_parse_inst_t *)&cmd_set_fdir_input_set,\n-\t(cmdline_parse_inst_t *)&cmd_flow,\n-\t(cmdline_parse_inst_t *)&cmd_mcast_addr,\n-\t(cmdline_parse_inst_t *)&cmd_config_l2_tunnel_eth_type_all,\n-\t(cmdline_parse_inst_t *)&cmd_config_l2_tunnel_eth_type_specific,\n-\t(cmdline_parse_inst_t *)&cmd_config_l2_tunnel_en_dis_all,\n-\t(cmdline_parse_inst_t *)&cmd_config_l2_tunnel_en_dis_specific,\n-\t(cmdline_parse_inst_t *)&cmd_config_e_tag_insertion_en,\n-\t(cmdline_parse_inst_t *)&cmd_config_e_tag_insertion_dis,\n-\t(cmdline_parse_inst_t *)&cmd_config_e_tag_stripping_en_dis,\n-\t(cmdline_parse_inst_t *)&cmd_config_e_tag_forwarding_en_dis,\n-\t(cmdline_parse_inst_t *)&cmd_config_e_tag_filter_add,\n-\t(cmdline_parse_inst_t *)&cmd_config_e_tag_filter_del,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_vlan_anti_spoof,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_mac_anti_spoof,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_vlan_insert,\n-\t(cmdline_parse_inst_t *)&cmd_set_tx_loopback,\n-\t(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,\n-\t(cmdline_parse_inst_t *)&cmd_set_macsec_offload_on,\n-\t(cmdline_parse_inst_t *)&cmd_set_macsec_offload_off,\n-\t(cmdline_parse_inst_t *)&cmd_set_macsec_sc,\n-\t(cmdline_parse_inst_t *)&cmd_set_macsec_sa,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_traffic,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_rxmode,\n-\t(cmdline_parse_inst_t *)&cmd_vf_rate_limit,\n-\t(cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_promisc,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_allmulti,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_broadcast,\n-\t(cmdline_parse_inst_t *)&cmd_set_vf_vlan_tag,\n-\t(cmdline_parse_inst_t *)&cmd_vf_max_bw,\n-\t(cmdline_parse_inst_t *)&cmd_vf_tc_min_bw,\n-\t(cmdline_parse_inst_t *)&cmd_vf_tc_max_bw,\n-\t(cmdline_parse_inst_t *)&cmd_strict_link_prio,\n-\t(cmdline_parse_inst_t *)&cmd_tc_min_bw,\n-\t(cmdline_parse_inst_t *)&cmd_ddp_add,\n-\t(cmdline_parse_inst_t *)&cmd_ddp_del,\n-\t(cmdline_parse_inst_t *)&cmd_ddp_get_list,\n-\t(cmdline_parse_inst_t *)&cmd_ddp_get_info,\n-\t(cmdline_parse_inst_t *)&cmd_show_vf_stats,\n-\t(cmdline_parse_inst_t *)&cmd_clear_vf_stats,\n-\t(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,\n-\t(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,\n-\t(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,\n-\t(cmdline_parse_inst_t *)&cmd_ptype_mapping_update,\n+/** Display TM Error Message */\n+static void\n+print_err_msg(struct rte_tm_error *error)\n+{\n+\tstatic const char *const errstrlist[] = {\n+\t\t[RTE_TM_ERROR_TYPE_NONE] = \"no error\",\n+\t\t[RTE_TM_ERROR_TYPE_UNSPECIFIED] = \"cause unspecified\",\n+\t\t[RTE_TM_ERROR_TYPE_CAPABILITIES]\n+\t\t\t= \"capability parameter null\",\n+\t\t[RTE_TM_ERROR_TYPE_LEVEL_ID] = \"level id\",\n+\t\t[RTE_TM_ERROR_TYPE_WRED_PROFILE]\n+\t\t\t= \"wred profile null\",\n+\t\t[RTE_TM_ERROR_TYPE_WRED_PROFILE_GREEN] = \"wred profile(green)\",\n+\t\t[RTE_TM_ERROR_TYPE_WRED_PROFILE_YELLOW]\n+\t\t\t= \"wred profile(yellow)\",\n+\t\t[RTE_TM_ERROR_TYPE_WRED_PROFILE_RED] = \"wred profile(red)\",\n+\t\t[RTE_TM_ERROR_TYPE_WRED_PROFILE_ID] = \"wred profile id\",\n+\t\t[RTE_TM_ERROR_TYPE_SHARED_WRED_CONTEXT_ID]\n+\t\t\t= \"shared wred context id\",\n+\t\t[RTE_TM_ERROR_TYPE_SHAPER_PROFILE] = \"shaper profile null\",\n+\t\t[RTE_TM_ERROR_TYPE_SHAPER_PROFILE_COMMITTED_RATE]\n+\t\t\t= \"committed rate field (shaper profile)\",\n+\t\t[RTE_TM_ERROR_TYPE_SHAPER_PROFILE_COMMITTED_SIZE]\n+\t\t\t= \"committed size field (shaper profile)\",\n+\t\t[RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE]\n+\t\t\t= \"peak rate field (shaper profile)\",\n+\t\t[RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE]\n+\t\t\t= \"peak size field (shaper profile)\",\n+\t\t[RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PKT_ADJUST_LEN]\n+\t\t\t= \"packet adjust length field (shaper profile)\",\n+\t\t[RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID] = \"shaper profile id\",\n+\t\t[RTE_TM_ERROR_TYPE_SHARED_SHAPER_ID] = \"shared shaper id\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARENT_NODE_ID] = \"parent node id\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PRIORITY] = \"node priority\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_WEIGHT] = \"node weight\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARAMS] = \"node parameter null\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARAMS_SHAPER_PROFILE_ID]\n+\t\t\t= \"shaper profile id field (node params)\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARAMS_SHARED_SHAPER_ID]\n+\t\t\t= \"shared shaper id field (node params)\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SHARED_SHAPERS]\n+\t\t\t= \"num shared shapers field (node params)\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARAMS_WFQ_WEIGHT_MODE]\n+\t\t\t= \"wfq weght mode field (node params)\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SP_PRIORITIES]\n+\t\t\t= \"num strict priorities field (node params)\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARAMS_CMAN]\n+\t\t\t= \"congestion management mode field (node params)\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARAMS_WRED_PROFILE_ID] =\n+\t\t\t\"wred profile id field (node params)\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARAMS_SHARED_WRED_CONTEXT_ID]\n+\t\t\t= \"shared wred context id field (node params)\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SHARED_WRED_CONTEXTS]\n+\t\t\t= \"num shared wred contexts field (node params)\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_PARAMS_STATS]\n+\t\t\t= \"stats field (node params)\",\n+\t\t[RTE_TM_ERROR_TYPE_NODE_ID] = \"node id\",\n+\t};\n+\n+\tconst char *errstr;\n+\tchar buf[64];\n+\n+\tif ((unsigned int)error->type >= RTE_DIM(errstrlist) ||\n+\t\t!errstrlist[error->type])\n+\t\terrstr = \"unknown type\";\n+\telse\n+\t\terrstr = errstrlist[error->type];\n+\n+\tif (error->cause)\n+\t\tsnprintf(buf, sizeof(buf), \"cause: %p, \", error->cause);\n+\n+\tprintf(\"%s: %s%s (error %d)\\n\", errstr, error->cause ? buf : \"\",\n+\t\terror->message ? error->message : \"(no stated reason)\",\n+\t\terror->type);\n+}\n+\n+/* *** Port TM Capability *** */\n+struct cmd_show_port_tm_cap_result {\n+\tcmdline_fixed_string_t show;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t cap;\n+\tuint8_t port_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_show_port_tm_cap_show =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_cap_result,\n+\t\tshow, \"show\");\n+cmdline_parse_token_string_t cmd_show_port_tm_cap_port =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_cap_result,\n+\t\tport, \"port\");\n+cmdline_parse_token_string_t cmd_show_port_tm_cap_tm =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_cap_result,\n+\t\ttm, \"tm\");\n+cmdline_parse_token_string_t cmd_show_port_tm_cap_cap =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_cap_result,\n+\t\tcap, \"cap\");\n+cmdline_parse_token_num_t cmd_show_port_tm_cap_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_cap_result,\n+\t\t port_id, UINT8);\n+\n+static void cmd_show_port_tm_cap_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_show_port_tm_cap_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_tm_capabilities cap;\n+\tstruct rte_tm_error error;\n+\tuint8_t port_id = res->port_id;\n+\tuint32_t i;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\tmemset(&cap, 0, sizeof(struct rte_tm_capabilities));\n+\tret = rte_tm_capabilities_get(port_id, &cap, &error);\n+\tif (ret) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+\n+\tprintf(\"\\n****   Port TM Capabilities ****\\n\\n\");\n+\tprintf(\"cap.n_nodes_max %u\\n\", cap.n_nodes_max);\n+\tprintf(\"cap.n_levels_max %u\\n\", cap.n_levels_max);\n+\tprintf(\"cap.non_leaf_nodes_identical %d\\n\",\n+\t\tcap.non_leaf_nodes_identical);\n+\tprintf(\"cap.leaf_nodes_identical %d\\n\", cap.leaf_nodes_identical);\n+\tprintf(\"cap.shaper_n_max %u\\n\", cap.shaper_n_max);\n+\tprintf(\"cap.shaper_private_n_max %u\\n\", cap.shaper_private_n_max);\n+\tprintf(\"cap.shaper_private_dual_rate_n_max %d\\n\",\n+\t\tcap.shaper_private_dual_rate_n_max);\n+\tprintf(\"cap.shaper_private_rate_min %lu\\n\",\n+\t\tcap.shaper_private_rate_min);\n+\tprintf(\"cap.shaper_private_rate_max %lu\\n\",\n+\t\tcap.shaper_private_rate_max);\n+\tprintf(\"cap.shaper_shared_n_max %u\\n\", cap.shaper_shared_n_max);\n+\tprintf(\"cap.shaper_shared_n_nodes_per_shaper_max %u\\n\",\n+\t\tcap.shaper_shared_n_nodes_per_shaper_max);\n+\tprintf(\"cap.shaper_shared_n_shapers_per_node_max %u\\n\",\n+\t\tcap.shaper_shared_n_shapers_per_node_max);\n+\tprintf(\"cap.shaper_shared_dual_rate_n_max %u\\n\",\n+\t\tcap.shaper_shared_dual_rate_n_max);\n+\tprintf(\"cap.shaper_shared_rate_min %lu\\n\",\n+\t\tcap.shaper_shared_rate_min);\n+\tprintf(\"cap.shaper_shared_rate_max %lu\\n\",\n+\t\tcap.shaper_shared_rate_max);\n+\tprintf(\"cap.shaper_pkt_length_adjust_min %d\\n\",\n+\t\tcap.shaper_pkt_length_adjust_min);\n+\tprintf(\"cap.shaper_pkt_length_adjust_max %d\\n\",\n+\t\tcap.shaper_pkt_length_adjust_max);\n+\tprintf(\"cap.sched_n_children_max %u\\n\", cap.sched_n_children_max);\n+\tprintf(\"cap.sched_sp_n_priorities_max %u\\n\",\n+\t\tcap.sched_sp_n_priorities_max);\n+\tprintf(\"cap.sched_wfq_n_children_per_group_max %u\\n\",\n+\t\tcap.sched_wfq_n_children_per_group_max);\n+\tprintf(\"cap.sched_wfq_n_groups_max %u\\n\", cap.sched_wfq_n_groups_max);\n+\tprintf(\"cap.sched_wfq_weight_max %u\\n\", cap.sched_wfq_weight_max);\n+\tprintf(\"cap.cman_head_drop_supported %d\\n\",\n+\t\tcap.cman_head_drop_supported);\n+\tprintf(\"cap.cman_wred_context_n_max %u\\n\", cap.cman_wred_context_n_max);\n+\tprintf(\"cap.cman_wred_context_private_n_max %u\\n\",\n+\t\tcap.cman_wred_context_private_n_max);\n+\tprintf(\"cap.cman_wred_context_shared_n_max %u\\n\",\n+\t\tcap.cman_wred_context_shared_n_max);\n+\tprintf(\"cap.cman_wred_context_shared_n_nodes_per_context_max %u\\n\",\n+\t\tcap.cman_wred_context_shared_n_nodes_per_context_max);\n+\tprintf(\"cap.cman_wred_context_shared_n_contexts_per_node_max %u\\n\",\n+\t\tcap.cman_wred_context_shared_n_contexts_per_node_max);\n+\n+\tfor (i = 0; i < RTE_TM_COLORS; i++) {\n+\t\tprintf(\"cap.mark_vlan_dei_supported %d\\n\",\n+\t\t\tcap.mark_vlan_dei_supported[i]);\n+\t\tprintf(\"cap.mark_ip_ecn_tcp_supported %d\\n\",\n+\t\t\tcap.mark_ip_ecn_tcp_supported[i]);\n+\t\tprintf(\"cap.mark_ip_ecn_sctp_supported %d\\n\",\n+\t\t\tcap.mark_ip_ecn_sctp_supported[i]);\n+\t\tprintf(\"cap.mark_ip_dscp_supported %d\\n\",\n+\t\t\tcap.mark_ip_dscp_supported[i]);\n+\t}\n+\n+\tprintf(\"cap.dynamic_update_mask %lu\\n\", cap.dynamic_update_mask);\n+\tprintf(\"cap.stats_mask %lu\\n\", cap.stats_mask);\n+}\n+\n+cmdline_parse_inst_t cmd_show_port_tm_cap = {\n+\t.f = cmd_show_port_tm_cap_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Show Port TM Capabilities\",\n+\t.tokens = {\n+\t\t(void *)&cmd_show_port_tm_cap_show,\n+\t\t(void *)&cmd_show_port_tm_cap_port,\n+\t\t(void *)&cmd_show_port_tm_cap_tm,\n+\t\t(void *)&cmd_show_port_tm_cap_cap,\n+\t\t(void *)&cmd_show_port_tm_cap_port_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Port TM Hierarchical Level Capability *** */\n+struct cmd_show_port_tm_level_cap_result {\n+\tcmdline_fixed_string_t show;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t level;\n+\tcmdline_fixed_string_t cap;\n+\tuint8_t port_id;\n+\tuint32_t level_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_show_port_tm_level_cap_show =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_level_cap_result,\n+\t\tshow, \"show\");\n+cmdline_parse_token_string_t cmd_show_port_tm_level_cap_port =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_level_cap_result,\n+\t\tport, \"port\");\n+cmdline_parse_token_string_t cmd_show_port_tm_level_cap_tm =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_level_cap_result,\n+\t\ttm, \"tm\");\n+cmdline_parse_token_string_t cmd_show_port_tm_level_cap_level =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_level_cap_result,\n+\t\tlevel, \"level\");\n+cmdline_parse_token_string_t cmd_show_port_tm_level_cap_cap =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_level_cap_result,\n+\t\tcap, \"cap\");\n+cmdline_parse_token_num_t cmd_show_port_tm_level_cap_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_level_cap_result,\n+\t\t port_id, UINT8);\n+cmdline_parse_token_num_t cmd_show_port_tm_level_cap_level_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_level_cap_result,\n+\t\t level_id, UINT32);\n+\n+\n+static void cmd_show_port_tm_level_cap_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_show_port_tm_level_cap_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_tm_level_capabilities lcap;\n+\tstruct rte_tm_error error;\n+\tuint8_t port_id = res->port_id;\n+\tint ret, level_id = res->level_id;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\tif ((level_id > 4) || (level_id < 0)) {\n+\t\tprintf(\"  TM hierarchical level invalid !! \");\n+\t\treturn;\n+\t}\n+\n+\tmemset(&lcap, 0, sizeof(struct rte_tm_level_capabilities));\n+\tret = rte_tm_level_capabilities_get(port_id, level_id, &lcap, &error);\n+\tif (ret) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+\tprintf(\"\\n****   Port TM Hierarchy level %u Capability ****\\n\\n\",\n+\t\tlevel_id);\n+\n+\tprintf(\"cap.n_nodes_max %u\\n\", lcap.n_nodes_max);\n+\tprintf(\"cap.n_nodes_nonleaf_max %u\\n\", lcap.n_nodes_nonleaf_max);\n+\tprintf(\"cap.n_nodes_leaf_max %u\\n\", lcap.n_nodes_leaf_max);\n+\tprintf(\"cap.non_leaf_nodes_identical %d\\n\",\n+\t\tlcap.non_leaf_nodes_identical);\n+\tprintf(\"cap.leaf_nodes_identical %d\\n\", lcap.leaf_nodes_identical);\n+\tif (level_id <= 3) {\n+\t\tprintf(\"cap.nonleaf.shaper_private_supported %d\\n\",\n+\t\t\tlcap.nonleaf.shaper_private_supported);\n+\t\tprintf(\"cap.nonleaf.shaper_private_dual_rate_supported %d\\n\",\n+\t\t\tlcap.nonleaf.shaper_private_dual_rate_supported);\n+\t\tprintf(\"cap.nonleaf.shaper_private_rate_min %lu\\n\",\n+\t\t\tlcap.nonleaf.shaper_private_rate_min);\n+\t\tprintf(\"cap.nonleaf.shaper_private_rate_max %lu\\n\",\n+\t\t\tlcap.nonleaf.shaper_private_rate_max);\n+\t\tprintf(\"cap.nonleaf.shaper_shared_n_max %u\\n\",\n+\t\t\tlcap.nonleaf.shaper_shared_n_max);\n+\t\tprintf(\"cap.nonleaf.sched_n_children_max %u\\n\",\n+\t\t\tlcap.nonleaf.sched_n_children_max);\n+\t\tprintf(\"cap.nonleaf.sched_sp_n_priorities_max %u\\n\",\n+\t\t\tlcap.nonleaf.sched_sp_n_priorities_max);\n+\t\tprintf(\"cap.nonleaf.sched_wfq_n_children_per_group_max %u\\n\",\n+\t\t\tlcap.nonleaf.sched_wfq_n_children_per_group_max);\n+\t\tprintf(\"cap.nonleaf.sched_wfq_n_groups_max %u\\n\",\n+\t\t\tlcap.nonleaf.sched_wfq_n_groups_max);\n+\t\tprintf(\"cap.nonleaf.sched_wfq_weight_max %u\\n\",\n+\t\t\tlcap.nonleaf.sched_wfq_weight_max);\n+\t\tprintf(\"cap.nonleaf.stats_mask %lu\\n\", lcap.nonleaf.stats_mask);\n+\t} else {\n+\t\tprintf(\"cap.leaf.shaper_private_supported %d\\n\",\n+\t\t\tlcap.leaf.shaper_private_supported);\n+\t\tprintf(\"cap.leaf.shaper_private_dual_rate_supported %d\\n\",\n+\t\t\tlcap.leaf.shaper_private_dual_rate_supported);\n+\t\tprintf(\"cap.leaf.shaper_private_rate_min %lu\\n\",\n+\t\t\tlcap.leaf.shaper_private_rate_min);\n+\t\tprintf(\"cap.leaf.shaper_private_rate_max %lu\\n\",\n+\t\t\tlcap.leaf.shaper_private_rate_max);\n+\t\tprintf(\"cap.leaf.shaper_shared_n_max %u\\n\",\n+\t\t\tlcap.leaf.shaper_shared_n_max);\n+\t\tprintf(\"cap.leaf.cman_head_drop_supported %d\\n\",\n+\t\t\tlcap.leaf.cman_head_drop_supported);\n+\t\tprintf(\"cap.leaf.cman_wred_context_private_supported %d\\n\",\n+\t\t\tlcap.leaf.cman_wred_context_private_supported);\n+\t\tprintf(\"cap.leaf.cman_wred_context_shared_n_max %u\\n\",\n+\t\t\tlcap.leaf.cman_wred_context_shared_n_max);\n+\t\tprintf(\"cap.leaf.stats_mask %lu\\n\",\n+\t\t\tlcap.leaf.stats_mask);\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_show_port_tm_level_cap = {\n+\t.f = cmd_show_port_tm_level_cap_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Show Port TM Hierarhical level Capabilities\",\n+\t.tokens = {\n+\t\t(void *)&cmd_show_port_tm_level_cap_show,\n+\t\t(void *)&cmd_show_port_tm_level_cap_port,\n+\t\t(void *)&cmd_show_port_tm_level_cap_tm,\n+\t\t(void *)&cmd_show_port_tm_level_cap_level,\n+\t\t(void *)&cmd_show_port_tm_level_cap_cap,\n+\t\t(void *)&cmd_show_port_tm_level_cap_port_id,\n+\t\t(void *)&cmd_show_port_tm_level_cap_level_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Port TM Hierarchy Node Capability *** */\n+struct cmd_show_port_tm_node_cap_result {\n+\tcmdline_fixed_string_t show;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t cap;\n+\tuint8_t port_id;\n+\tuint32_t node_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_show_port_tm_node_cap_show =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_node_cap_result,\n+\t\tshow, \"show\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_cap_port =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_node_cap_result,\n+\t\tport, \"port\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_cap_tm =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_node_cap_result,\n+\t\ttm, \"tm\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_cap_node =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_node_cap_result,\n+\t\tnode, \"node\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_cap_cap =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_show_port_tm_node_cap_result,\n+\t\tcap, \"cap\");\n+cmdline_parse_token_num_t cmd_show_port_tm_node_cap_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_node_cap_result,\n+\t\t port_id, UINT8);\n+cmdline_parse_token_num_t cmd_show_port_tm_node_cap_node_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_node_cap_result,\n+\t\t node_id, UINT32);\n+\n+static void cmd_show_port_tm_node_cap_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_show_port_tm_node_cap_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_tm_node_capabilities ncap;\n+\tstruct rte_tm_error error;\n+\tuint32_t node_id = res->node_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret, is_leaf = 0;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Node id must be valid */\n+\tret = rte_tm_node_type_get(port_id, node_id, &is_leaf, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+\n+\tmemset(&ncap, 0, sizeof(struct rte_tm_node_capabilities));\n+\tret = rte_tm_node_capabilities_get(port_id, node_id, &ncap, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+\tprintf(\"\\n****   Port TM Hierarchy node %u Capability ****\\n\\n\",\n+\t\tnode_id);\n+\tprintf(\"cap.shaper_private_supported %d\\n\",\n+\t\tncap.shaper_private_supported);\n+\tprintf(\"cap.shaper_private_dual_rate_supported %d\\n\",\n+\t\tncap.shaper_private_dual_rate_supported);\n+\tprintf(\"cap.shaper_private_rate_min %lu\\n\",\n+\t\tncap.shaper_private_rate_min);\n+\tprintf(\"cap.shaper_private_rate_max %lu\\n\",\n+\t\tncap.shaper_private_rate_max);\n+\tprintf(\"cap.shaper_shared_n_max %u\\n\",\n+\t\tncap.shaper_shared_n_max);\n+\tif (!is_leaf) {\n+\t\tprintf(\"cap.nonleaf.sched_n_children_max %u\\n\",\n+\t\t\tncap.nonleaf.sched_n_children_max);\n+\t\tprintf(\"cap.nonleaf.sched_sp_n_priorities_max %u\\n\",\n+\t\t\tncap.nonleaf.sched_sp_n_priorities_max);\n+\t\tprintf(\"cap.nonleaf.sched_wfq_n_children_per_group_max %u\\n\",\n+\t\t\tncap.nonleaf.sched_wfq_n_children_per_group_max);\n+\t\tprintf(\"cap.nonleaf.sched_wfq_n_groups_max %u\\n\",\n+\t\t\tncap.nonleaf.sched_wfq_n_groups_max);\n+\t\tprintf(\"cap.nonleaf.sched_wfq_weight_max %u\\n\",\n+\t\t\tncap.nonleaf.sched_wfq_weight_max);\n+\t} else {\n+\t\tprintf(\"cap.leaf.cman_head_drop_supported %d\\n\",\n+\t\t\tncap.leaf.cman_head_drop_supported);\n+\t\tprintf(\"cap.leaf.cman_wred_context_private_supported %d\\n\",\n+\t\t\tncap.leaf.cman_wred_context_private_supported);\n+\t\tprintf(\"cap.leaf.cman_wred_context_shared_n_max %u\\n\",\n+\t\t\tncap.leaf.cman_wred_context_shared_n_max);\n+\t}\n+\tprintf(\"cap.stats_mask %lu\\n\", ncap.stats_mask);\n+}\n+\n+cmdline_parse_inst_t cmd_show_port_tm_node_cap = {\n+\t.f = cmd_show_port_tm_node_cap_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Show Port TM Hierarchy node capabilities\",\n+\t.tokens = {\n+\t\t(void *)&cmd_show_port_tm_node_cap_show,\n+\t\t(void *)&cmd_show_port_tm_node_cap_port,\n+\t\t(void *)&cmd_show_port_tm_node_cap_tm,\n+\t\t(void *)&cmd_show_port_tm_node_cap_node,\n+\t\t(void *)&cmd_show_port_tm_node_cap_cap,\n+\t\t(void *)&cmd_show_port_tm_node_cap_port_id,\n+\t\t(void *)&cmd_show_port_tm_node_cap_node_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Add Port TM Private Shaper Profile *** */\n+struct cmd_add_port_tm_node_shaper_profile_result {\n+\tcmdline_fixed_string_t add;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t shaper;\n+\tcmdline_fixed_string_t profile;\n+\tuint8_t port_id;\n+\tuint32_t shaper_id;\n+\tuint64_t tb_rate;\n+\tuint64_t tb_size;\n+};\n+\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_add =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result, add, \"add\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tport, \"port\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\ttm, \"tm\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tnode, \"node\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_shaper =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tshaper, \"shaper\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shaper_profile_profile =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tprofile, \"profile\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_shaper_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\tshaper_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_tb_rate =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\ttb_rate, UINT64);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shaper_profile_tb_size =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shaper_profile_result,\n+\t\t\ttb_size, UINT64);\n+\n+static void cmd_add_port_tm_node_shaper_profile_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_add_port_tm_node_shaper_profile_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_tm_shaper_params sp;\n+\tstruct rte_tm_error error;\n+\tuint32_t shaper_id = res->shaper_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Private shaper profile params */\n+\tmemset(&sp, 0, sizeof(struct rte_tm_shaper_params));\n+\tsp.peak.rate = res->tb_rate;\n+\tsp.peak.size = res->tb_size;\n+\tsp.pkt_length_adjust = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;\n+\n+\tret = rte_tm_shaper_profile_add(port_id, shaper_id, &sp, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_add_port_tm_node_shaper_profile = {\n+\t.f = cmd_add_port_tm_node_shaper_profile_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Add port tm node private shaper profile\",\n+\t.tokens = {\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_add,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_port,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_tm,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_node,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_shaper,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_profile,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_port_id,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_shaper_id,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_tb_rate,\n+\t\t(void *)&cmd_add_port_tm_node_shaper_profile_tb_size,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Delete Port TM Private Shaper Profile *** */\n+struct cmd_del_port_tm_node_shaper_profile_result {\n+\tcmdline_fixed_string_t del;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t shaper;\n+\tcmdline_fixed_string_t profile;\n+\tuint8_t port_id;\n+\tuint32_t shaper_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_del =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result, del, \"del\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tport, \"port\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tnode, \"node\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_shaper =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tshaper, \"shaper\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shaper_profile_profile =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tprofile, \"profile\");\n+cmdline_parse_token_num_t cmd_del_port_tm_node_shaper_profile_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_del_port_tm_node_shaper_profile_shaper_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shaper_profile_result,\n+\t\t\tshaper_id, UINT32);\n+\n+static void cmd_del_port_tm_node_shaper_profile_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_del_port_tm_node_shaper_profile_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_tm_error error;\n+\tuint32_t shaper_id = res->shaper_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\tret = rte_tm_shaper_profile_delete(port_id, shaper_id, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_del_port_tm_node_shaper_profile = {\n+\t.f = cmd_del_port_tm_node_shaper_profile_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Delete port tm node private shaper profile\",\n+\t.tokens = {\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_del,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_port,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_tm,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_node,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_shaper,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_profile,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_port_id,\n+\t\t(void *)&cmd_del_port_tm_node_shaper_profile_shaper_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Add/Update Port TM shared Shaper *** */\n+struct cmd_add_port_tm_node_shared_shaper_result {\n+\tcmdline_fixed_string_t cmd_type;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t shared;\n+\tcmdline_fixed_string_t shaper;\n+\tuint8_t port_id;\n+\tuint32_t shared_shaper_id;\n+\tuint32_t shaper_profile_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_cmd_type =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tcmd_type, \"add#set\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_shared =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tshared, \"shared\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_shared_shaper_shaper =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tshaper, \"shaper\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shared_shaper_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shared_shaper_shared_shaper_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tshared_shaper_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_shared_shaper_shaper_profile_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_shared_shaper_result,\n+\t\t\tshaper_profile_id, UINT32);\n+\n+static void cmd_add_port_tm_node_shared_shaper_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_add_port_tm_node_shared_shaper_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_tm_error error;\n+\tstruct rte_eth_link link;\n+\tuint32_t shared_shaper_id = res->shared_shaper_id;\n+\tuint32_t shaper_profile_id = res->shaper_profile_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\tmemset(&link, 0, sizeof(link));\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Command type: add */\n+\tif (strcmp(res->cmd_type, \"add\") == 0) {\n+\t\t/* Port link status */\n+\t\trte_eth_link_get_nowait(port_id, &link);\n+\t\tif (link.link_status == ETH_LINK_UP) {\n+\t\t\tprintf(\" Port %u link up (error)\\n\", port_id);\n+\t\t\treturn;\n+\t\t}\n+\n+\t\t/* TM hierarchy status */\n+\t\tif (port->softport.tm.hierarchy_frozen == 1)\n+\t\t\tport->softport.tm.hierarchy_frozen = 0;\n+\t}\n+\n+\t/* Command type: set (update) */\n+\tif (strcmp(res->cmd_type, \"set\") == 0) {\n+\t\t/* TM hierarchy status */\n+\t\tif (port->softport.tm.hierarchy_frozen == 0) {\n+\t\t\tprintf(\" hierarchy not frozen (error)\\n\");\n+\t\t\treturn;\n+\t\t}\n+\n+\t\trte_eth_link_get_nowait(port_id, &link);\n+\t\tif (link.link_status == ETH_LINK_DOWN) {\n+\t\t\tprintf(\" Port %u link down (error)\\n\", port_id);\n+\t\t\treturn;\n+\t\t}\n+\t}\n+\n+\tret = rte_tm_shared_shaper_add_update(port_id, shared_shaper_id,\n+\t\tshaper_profile_id, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_add_port_tm_node_shared_shaper = {\n+\t.f = cmd_add_port_tm_node_shared_shaper_parsed,\n+\t.data = NULL,\n+\t.help_str = \"add/update port tm node shared shaper\",\n+\t.tokens = {\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_cmd_type,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_port,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_tm,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_node,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_shared,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_shaper,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_port_id,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_shared_shaper_id,\n+\t\t(void *)&cmd_add_port_tm_node_shared_shaper_shaper_profile_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Delete Port TM shared Shaper *** */\n+struct cmd_del_port_tm_node_shared_shaper_result {\n+\tcmdline_fixed_string_t del;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t shared;\n+\tcmdline_fixed_string_t shaper;\n+\tuint8_t port_id;\n+\tuint32_t shared_shaper_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_del =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result, del, \"del\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_shared =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result,\n+\t\t\tshared, \"shared\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_shared_shaper_shaper =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result,\n+\t\t\tshaper, \"shaper\");\n+cmdline_parse_token_num_t cmd_del_port_tm_node_shared_shaper_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_del_port_tm_node_shared_shaper_shared_shaper_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_shared_shaper_result,\n+\t\t\tshared_shaper_id, UINT32);\n+\n+static void cmd_del_port_tm_node_shared_shaper_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_del_port_tm_node_shared_shaper_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_tm_error error;\n+\tuint32_t shared_shaper_id = res->shared_shaper_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\tret = rte_tm_shared_shaper_delete(port_id, shared_shaper_id, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_del_port_tm_node_shared_shaper = {\n+\t.f = cmd_del_port_tm_node_shared_shaper_parsed,\n+\t.data = NULL,\n+\t.help_str = \"delete port tm node shared shaper\",\n+\t.tokens = {\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_del,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_port,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_tm,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_node,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_shared,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_shaper,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_port_id,\n+\t\t(void *)&cmd_del_port_tm_node_shared_shaper_shared_shaper_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Add Port TM Node WRED Profile *** */\n+struct cmd_add_port_tm_node_wred_profile_result {\n+\tcmdline_fixed_string_t add;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t wred;\n+\tcmdline_fixed_string_t profile;\n+\tuint8_t port_id;\n+\tuint32_t wred_profile_id;\n+\tcmdline_fixed_string_t color_g;\n+\tuint16_t min_th_g;\n+\tuint16_t max_th_g;\n+\tuint16_t maxp_inv_g;\n+\tuint16_t wq_log2_g;\n+\tcmdline_fixed_string_t color_y;\n+\tuint16_t min_th_y;\n+\tuint16_t max_th_y;\n+\tuint16_t maxp_inv_y;\n+\tuint16_t wq_log2_y;\n+\tcmdline_fixed_string_t color_r;\n+\tuint16_t min_th_r;\n+\tuint16_t max_th_r;\n+\tuint16_t maxp_inv_r;\n+\tuint16_t wq_log2_r;\n+};\n+\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_add =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result, add, \"add\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_wred =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result, wred, \"wred\");\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_profile =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tprofile, \"profile\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wred_profile_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\twred_profile_id, UINT32);\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_g =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tcolor_g, \"G#g\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_g =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmin_th_g, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_g =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmax_th_g, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_g =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmaxp_inv_g, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wq_log2_g =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\twq_log2_g, UINT16);\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_y =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tcolor_y, \"Y#y\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_y =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmin_th_y, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_y =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmax_th_y, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_y =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmaxp_inv_y, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wq_log2_y =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\twq_log2_y, UINT16);\n+cmdline_parse_token_string_t cmd_add_port_tm_node_wred_profile_color_r =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tcolor_r, \"R#r\");\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_min_th_r =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmin_th_r, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_max_th_r =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmax_th_r, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_maxp_inv_r =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\tmaxp_inv_r, UINT16);\n+cmdline_parse_token_num_t cmd_add_port_tm_node_wred_profile_wq_log2_r =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_node_wred_profile_result,\n+\t\t\twq_log2_r, UINT16);\n+\n+\n+static void cmd_add_port_tm_node_wred_profile_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_add_port_tm_node_wred_profile_result *res = parsed_result;\n+\tstruct rte_tm_wred_params wp;\n+\tenum rte_tm_color color;\n+\tstruct rte_port *port;\n+\tstruct rte_tm_error error;\n+\tuint32_t wred_profile_id = res->wred_profile_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\tmemset(&wp, 0, sizeof(struct rte_tm_wred_params));\n+\n+\t/* WRED Params  (Green Color)*/\n+\tif ((strcmp(res->color_g, \"G\") == 0) ||\n+\t\t(strcmp(res->color_g, \"g\") == 0)) {\n+\t\tcolor = RTE_TM_GREEN;\n+\t\twp.red_params[color].min_th = res->min_th_g;\n+\t\twp.red_params[color].max_th = res->max_th_g;\n+\t\twp.red_params[color].maxp_inv = res->maxp_inv_g;\n+\t\twp.red_params[color].wq_log2 = res->wq_log2_g;\n+\t} else {\n+\t\tprintf(\"WRED profile error(G or g for green color)!\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* WRED Params  (Yellow Color)*/\n+\tif ((strcmp(res->color_y, \"Y\") == 0) ||\n+\t\t(strcmp(res->color_y, \"y\") == 0)) {\n+\t\tcolor = RTE_TM_YELLOW;\n+\t\twp.red_params[color].min_th = res->min_th_y;\n+\t\twp.red_params[color].max_th = res->max_th_y;\n+\t\twp.red_params[color].maxp_inv = res->maxp_inv_y;\n+\t\twp.red_params[color].wq_log2 = res->wq_log2_y;\n+\t} else {\n+\t\tprintf(\"WRED profile error(Y or y for yellow color)!\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* WRED Params  (Red Color)*/\n+\tif ((strcmp(res->color_r, \"R\") == 0) ||\n+\t\t(strcmp(res->color_r, \"r\") == 0)) {\n+\t\tcolor = RTE_TM_RED;\n+\t\twp.red_params[color].min_th = res->min_th_r;\n+\t\twp.red_params[color].max_th = res->max_th_r;\n+\t\twp.red_params[color].maxp_inv = res->maxp_inv_r;\n+\t\twp.red_params[color].wq_log2 = res->wq_log2_r;\n+\t} else {\n+\t\tprintf(\"WRED profile error(R or r for red color)!\\n\");\n+\t\treturn;\n+\t}\n+\n+\tret = rte_tm_wred_profile_add(port_id, wred_profile_id, &wp, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_add_port_tm_node_wred_profile = {\n+\t.f = cmd_add_port_tm_node_wred_profile_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Add port tm node wred profile\",\n+\t.tokens = {\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_add,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_port,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_tm,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_node,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_wred,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_profile,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_port_id,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_wred_profile_id,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_color_g,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_min_th_g,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_max_th_g,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_maxp_inv_g,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_wq_log2_g,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_color_y,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_min_th_y,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_max_th_y,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_maxp_inv_y,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_wq_log2_y,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_color_r,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_min_th_r,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_max_th_r,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_maxp_inv_r,\n+\t\t(void *)&cmd_add_port_tm_node_wred_profile_wq_log2_r,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Delete Port TM node WRED Profile *** */\n+struct cmd_del_port_tm_node_wred_profile_result {\n+\tcmdline_fixed_string_t del;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t wred;\n+\tcmdline_fixed_string_t profile;\n+\tuint8_t port_id;\n+\tuint32_t wred_profile_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_del =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result, del, \"del\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_wred =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result, wred, \"wred\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_wred_profile_profile =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result,\n+\t\t\tprofile, \"profile\");\n+cmdline_parse_token_num_t cmd_del_port_tm_node_wred_profile_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_del_port_tm_node_wred_profile_wred_profile_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_wred_profile_result,\n+\t\t\twred_profile_id, UINT32);\n+\n+static void cmd_del_port_tm_node_wred_profile_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_del_port_tm_node_wred_profile_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_tm_error error;\n+\tuint32_t wred_profile_id = res->wred_profile_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\tret = rte_tm_wred_profile_delete(port_id, wred_profile_id, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_del_port_tm_node_wred_profile = {\n+\t.f = cmd_del_port_tm_node_wred_profile_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Delete port tm node wred profile\",\n+\t.tokens = {\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_del,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_port,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_tm,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_node,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_wred,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_profile,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_port_id,\n+\t\t(void *)&cmd_del_port_tm_node_wred_profile_wred_profile_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Add Port TM nonleaf node *** */\n+struct cmd_add_port_tm_nonleaf_node_result {\n+\tcmdline_fixed_string_t add;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t nonleaf;\n+\tcmdline_fixed_string_t node;\n+\tuint8_t port_id;\n+\tuint32_t node_id;\n+\tint32_t parent_node_id;\n+\tuint32_t priority;\n+\tuint32_t weight;\n+\tuint32_t level_id;\n+\tuint32_t shaper_profile_id;\n+\tuint32_t shared_shaper_id;\n+\tuint32_t n_shared_shapers;\n+\tuint32_t n_sp_priorities;\n+};\n+\n+cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_add =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_result, add, \"add\");\n+cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_nonleaf =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_result, nonleaf, \"nonleaf\");\n+cmdline_parse_token_string_t cmd_add_port_tm_nonleaf_node_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_result, node, \"node\");\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_nonleaf_node_result,\n+\t\t port_id, UINT8);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_node_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result,\n+\t\t node_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_parent_node_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result,\n+\t\t parent_node_id, INT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_priority =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result,\n+\t\t priority, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_weight =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result,\n+\t\t weight, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_level_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result,\n+\t\t level_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_shaper_profile_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result,\n+\t\t shaper_profile_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_shared_shaper_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result,\n+\t\t shared_shaper_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_n_shared_shapers =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result,\n+\t\t n_shared_shapers, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_nonleaf_node_n_sp_priorities =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_nonleaf_node_result,\n+\t\t n_sp_priorities, UINT32);\n+\n+static void cmd_add_port_tm_nonleaf_node_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_add_port_tm_nonleaf_node_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_eth_link link;\n+\tstruct rte_tm_error error;\n+\tstruct rte_tm_node_params np;\n+\tuint32_t parent_node_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Port link status */\n+\tmemset(&link, 0, sizeof(link));\n+\trte_eth_link_get_nowait(port_id, &link);\n+\tif (link.link_status == ETH_LINK_UP) {\n+\t\tprintf(\" Port %u link up (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* TM hierarchy status */\n+\tif (port->softport.tm.hierarchy_frozen == 1)\n+\t\tport->softport.tm.hierarchy_frozen = 0;\n+\n+\t/* Node parameters */\n+\tif (res->parent_node_id < 0)\n+\t\tparent_node_id = UINT32_MAX;\n+\telse\n+\t\tparent_node_id = res->parent_node_id;\n+\n+\tmemset(&np, 0, sizeof(struct rte_tm_node_params));\n+\tnp.shaper_profile_id = res->shaper_profile_id;\n+\tnp.n_shared_shapers = res->n_shared_shapers;\n+\tnp.shared_shaper_id = &res->shared_shaper_id;\n+\tnp.nonleaf.n_sp_priorities = res->n_sp_priorities;\n+\tnp.nonleaf.wfq_weight_mode = NULL;\n+\tnp.stats_mask = RTE_TM_STATS_N_PKTS |\n+\t\tRTE_TM_STATS_N_BYTES |\n+\t\tRTE_TM_STATS_N_PKTS_GREEN_DROPPED |\n+\t\tRTE_TM_STATS_N_BYTES_GREEN_DROPPED;\n+\n+\tret = rte_tm_node_add(port_id, res->node_id, parent_node_id,\n+\t\t\t\tres->priority, res->weight, res->level_id,\n+\t\t\t\t&np, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_add_port_tm_nonleaf_node = {\n+\t.f = cmd_add_port_tm_nonleaf_node_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Add port tm nonleaf node\",\n+\t.tokens = {\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_add,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_port,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_tm,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_nonleaf,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_node,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_port_id,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_node_id,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_parent_node_id,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_priority,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_weight,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_level_id,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_shaper_profile_id,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_shared_shaper_id,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_n_shared_shapers,\n+\t\t(void *)&cmd_add_port_tm_nonleaf_node_n_sp_priorities,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Add Port TM leaf node *** */\n+struct cmd_add_port_tm_leaf_node_result {\n+\tcmdline_fixed_string_t add;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t leaf;\n+\tcmdline_fixed_string_t node;\n+\tuint8_t port_id;\n+\tuint32_t node_id;\n+\tint32_t parent_node_id;\n+\tuint32_t priority;\n+\tuint32_t weight;\n+\tuint32_t level_id;\n+\tuint32_t cman_mode;\n+\tuint32_t wred_profile_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_add_port_tm_leaf_node_add =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_leaf_node_result, add, \"add\");\n+cmdline_parse_token_string_t cmd_add_port_tm_leaf_node_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_leaf_node_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_add_port_tm_leaf_node_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_leaf_node_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_add_port_tm_leaf_node_nonleaf =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_leaf_node_result, leaf, \"leaf\");\n+cmdline_parse_token_string_t cmd_add_port_tm_leaf_node_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_tm_leaf_node_result, node, \"node\");\n+cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result,\n+\t\t port_id, UINT8);\n+cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_node_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result,\n+\t\t node_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_parent_node_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result,\n+\t\t parent_node_id, INT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_priority =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result,\n+\t\t priority, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_weight =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result,\n+\t\t weight, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_level_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result,\n+\t\t level_id, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_cman_mode =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result,\n+\t\t cman_mode, UINT32);\n+cmdline_parse_token_num_t cmd_add_port_tm_leaf_node_wred_profile_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_add_port_tm_leaf_node_result,\n+\t\t wred_profile_id, UINT32);\n+\n+static void cmd_add_port_tm_leaf_node_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_add_port_tm_leaf_node_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_eth_link link;\n+\tstruct rte_tm_error error;\n+\tstruct rte_tm_node_params np;\n+\tuint32_t parent_node_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Port link status */\n+\tmemset(&link, 0, sizeof(link));\n+\trte_eth_link_get_nowait(port_id, &link);\n+\tif (link.link_status == ETH_LINK_UP) {\n+\t\tprintf(\" Port %u link up (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* TM hierarchy status */\n+\tif (port->softport.tm.hierarchy_frozen == 1)\n+\t\tport->softport.tm.hierarchy_frozen = 0;\n+\n+\t/* Node parameters */\n+\tif (res->parent_node_id < 0)\n+\t\tparent_node_id = UINT32_MAX;\n+\telse\n+\t\tparent_node_id = res->parent_node_id;\n+\n+\tmemset(&np, 0, sizeof(struct rte_tm_node_params));\n+\tnp.shaper_profile_id = RTE_TM_SHAPER_PROFILE_ID_NONE;\n+\tnp.n_shared_shapers = 0;\n+\tnp.leaf.cman = res->cman_mode;\n+\tnp.leaf.wred.wred_profile_id = res->wred_profile_id;\n+\tnp.stats_mask = RTE_TM_STATS_N_PKTS |\n+\t\tRTE_TM_STATS_N_BYTES |\n+\t\tRTE_TM_STATS_N_PKTS_GREEN_DROPPED |\n+\t\tRTE_TM_STATS_N_BYTES_GREEN_DROPPED |\n+\t\tRTE_TM_STATS_N_PKTS_QUEUED;\n+\n+\tret = rte_tm_node_add(port_id, res->node_id, parent_node_id,\n+\t\t\t\tres->priority, res->weight, res->level_id,\n+\t\t\t\t&np, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_add_port_tm_leaf_node = {\n+\t.f = cmd_add_port_tm_leaf_node_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Add port tm leaf node\",\n+\t.tokens = {\n+\t\t(void *)&cmd_add_port_tm_leaf_node_add,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_port,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_tm,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_nonleaf,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_node,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_port_id,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_node_id,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_parent_node_id,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_priority,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_weight,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_level_id,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_cman_mode,\n+\t\t(void *)&cmd_add_port_tm_leaf_node_wred_profile_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Delete Port TM Node *** */\n+struct cmd_del_port_tm_node_result {\n+\tcmdline_fixed_string_t del;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tuint8_t port_id;\n+\tuint32_t node_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_del_port_tm_node_del =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_result, del, \"del\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_del_port_tm_node_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_del_port_tm_node_result, node, \"node\");\n+cmdline_parse_token_num_t cmd_del_port_tm_node_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_del_port_tm_node_result,\n+\t\t port_id, UINT8);\n+cmdline_parse_token_num_t cmd_del_port_tm_node_node_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_del_port_tm_node_result,\n+\t\tnode_id, UINT32);\n+\n+static void cmd_del_port_tm_node_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_del_port_tm_node_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_eth_link link;\n+\tstruct rte_tm_error error;\n+\tuint32_t node_id = res->node_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Port link status */\n+\tmemset(&link, 0, sizeof(link));\n+\trte_eth_link_get_nowait(port_id, &link);\n+\tif (link.link_status == ETH_LINK_UP) {\n+\t\tprintf(\" Port %u link up (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* TM hierarchy status */\n+\tif (port->softport.tm.hierarchy_frozen == 1)\n+\t\tport->softport.tm.hierarchy_frozen = 0;\n+\n+\tret = rte_tm_node_delete(port_id, node_id, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_del_port_tm_node = {\n+\t.f = cmd_del_port_tm_node_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Delete port tm node\",\n+\t.tokens = {\n+\t\t(void *)&cmd_del_port_tm_node_del,\n+\t\t(void *)&cmd_del_port_tm_node_port,\n+\t\t(void *)&cmd_del_port_tm_node_tm,\n+\t\t(void *)&cmd_del_port_tm_node_node,\n+\t\t(void *)&cmd_del_port_tm_node_port_id,\n+\t\t(void *)&cmd_del_port_tm_node_node_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Show Port TM Node Type *** */\n+struct cmd_show_port_tm_node_type_result {\n+\tcmdline_fixed_string_t show;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t type;\n+\tuint8_t port_id;\n+\tuint32_t node_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_show_port_tm_node_type_show =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_type_result, show, \"show\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_type_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_type_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_type_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_type_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_type_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_type_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_type_type =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_type_result, type, \"type\");\n+cmdline_parse_token_num_t cmd_show_port_tm_node_type_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_type_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_show_port_tm_node_type_node_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_type_result,\n+\t\t\tnode_id, UINT32);\n+\n+static void cmd_show_port_tm_node_type_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_show_port_tm_node_type_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_tm_error error;\n+\tuint32_t node_id = res->node_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret, is_leaf = 0;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\tret = rte_tm_node_type_get(port_id, node_id, &is_leaf, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+\n+\tif (is_leaf == 1)\n+\t\tprintf(\"leaf node\\n\");\n+\telse\n+\t\tprintf(\"nonleaf node\\n\");\n+\n+}\n+\n+cmdline_parse_inst_t cmd_show_port_tm_node_type = {\n+\t.f = cmd_show_port_tm_node_type_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Show port tm node type\",\n+\t.tokens = {\n+\t\t(void *)&cmd_show_port_tm_node_type_show,\n+\t\t(void *)&cmd_show_port_tm_node_type_port,\n+\t\t(void *)&cmd_show_port_tm_node_type_tm,\n+\t\t(void *)&cmd_show_port_tm_node_type_node,\n+\t\t(void *)&cmd_show_port_tm_node_type_type,\n+\t\t(void *)&cmd_show_port_tm_node_type_port_id,\n+\t\t(void *)&cmd_show_port_tm_node_type_node_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Show Port TM Node Statistics *** */\n+struct cmd_show_port_tm_node_stats_result {\n+\tcmdline_fixed_string_t show;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t stats;\n+\tuint8_t port_id;\n+\tuint32_t node_id;\n+\tuint32_t clear;\n+};\n+\n+cmdline_parse_token_string_t cmd_show_port_tm_node_stats_show =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_stats_result, show, \"show\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_stats_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_stats_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_stats_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_stats_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_stats_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_stats_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_show_port_tm_node_stats_stats =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_stats_result, stats, \"stats\");\n+cmdline_parse_token_num_t cmd_show_port_tm_node_stats_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_show_port_tm_node_stats_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_show_port_tm_node_stats_node_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_stats_result,\n+\t\t\tnode_id, UINT32);\n+cmdline_parse_token_num_t cmd_show_port_tm_node_stats_clear =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_show_port_tm_node_stats_result, clear, UINT32);\n+\n+static void cmd_show_port_tm_node_stats_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_show_port_tm_node_stats_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_eth_link link;\n+\tstruct rte_tm_node_stats stats;\n+\tstruct rte_tm_error error;\n+\tuint64_t stats_mask = 0, leaf_stats_mask;\n+\tuint32_t node_id = res->node_id;\n+\tuint32_t clear = res->clear;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* TM hierarchy status */\n+\tif (port->softport.tm.hierarchy_frozen == 0) {\n+\t\tprintf(\" hierarchy not frozen(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Port link status */\n+\tmemset(&link, 0, sizeof(link));\n+\trte_eth_link_get_nowait(port_id, &link);\n+\tif (link.link_status == ETH_LINK_DOWN) {\n+\t\tprintf(\" Port %u link down (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\tmemset(&stats, 0, sizeof(struct rte_tm_node_stats));\n+\tret = rte_tm_node_stats_read(port_id, node_id, &stats,\n+\t\t\t&stats_mask, clear, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+\n+\tleaf_stats_mask = RTE_TM_STATS_N_PKTS |\n+\t\tRTE_TM_STATS_N_BYTES |\n+\t\tRTE_TM_STATS_N_PKTS_GREEN_DROPPED |\n+\t\tRTE_TM_STATS_N_BYTES_GREEN_DROPPED |\n+\t\tRTE_TM_STATS_N_PKTS_QUEUED;\n+\n+\tprintf(\"pkts scheduled from node %lu\\n\", stats.n_pkts);\n+\tprintf(\"bytes scheduled from node %lu\\n\", stats.n_bytes);\n+\tprintf(\"pkts dropped %lu\\n \", stats.leaf.n_pkts_dropped[RTE_TM_GREEN]);\n+\tprintf(\"bytes dropped %lu\\n \",\n+\t\tstats.leaf.n_bytes_dropped[RTE_TM_GREEN]);\n+\n+\tif (stats_mask == leaf_stats_mask)\n+\t\tprintf(\"packets enqueued %lu\\n\", stats.leaf.n_pkts_queued);\n+}\n+\n+cmdline_parse_inst_t cmd_show_port_tm_node_stats = {\n+\t.f = cmd_show_port_tm_node_stats_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Show port tm node stats\",\n+\t.tokens = {\n+\t\t(void *)&cmd_show_port_tm_node_stats_show,\n+\t\t(void *)&cmd_show_port_tm_node_stats_port,\n+\t\t(void *)&cmd_show_port_tm_node_stats_tm,\n+\t\t(void *)&cmd_show_port_tm_node_stats_node,\n+\t\t(void *)&cmd_show_port_tm_node_stats_stats,\n+\t\t(void *)&cmd_show_port_tm_node_stats_port_id,\n+\t\t(void *)&cmd_show_port_tm_node_stats_node_id,\n+\t\t(void *)&cmd_show_port_tm_node_stats_clear,\n+\t\tNULL,\n+\t},\n+};\n+\n+#ifdef RTE_SCHED_SUBPORT_TC_OV\n+/* *** Update Port TM Node Parent *** */\n+struct cmd_set_port_tm_node_parent_result {\n+\tcmdline_fixed_string_t set;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t parent;\n+\tuint8_t port_id;\n+\tuint32_t node_id;\n+\tuint32_t parent_id;\n+\tuint32_t priority;\n+\tuint32_t weight;\n+};\n+\n+cmdline_parse_token_string_t cmd_set_port_tm_node_parent_set =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_parent_result, set, \"set\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_parent_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_parent_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_parent_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_parent_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_parent_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_parent_result, node, \"node\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_parent_parent =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_parent_result, parent, \"parent\");\n+cmdline_parse_token_num_t cmd_set_port_tm_node_parent_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_parent_result, port_id, UINT8);\n+cmdline_parse_token_num_t cmd_set_port_tm_node_parent_node_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_parent_result, node_id, UINT32);\n+cmdline_parse_token_num_t cmd_set_port_tm_node_parent_parent_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_set_port_tm_node_parent_result,\n+\t\tparent_id, UINT32);\n+cmdline_parse_token_num_t cmd_set_port_tm_node_parent_priority =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_set_port_tm_node_parent_result,\n+\t\tpriority, UINT32);\n+cmdline_parse_token_num_t cmd_set_port_tm_node_parent_weight =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_set_port_tm_node_parent_result,\n+\t\tweight, UINT32);\n+\n+static void cmd_set_port_tm_node_parent_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_set_port_tm_node_parent_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_eth_link link;\n+\tstruct rte_tm_error error;\n+\tuint32_t node_id = res->node_id;\n+\tuint32_t parent_id = res->parent_id;\n+\tuint32_t priority = res->priority;\n+\tuint32_t weight = res->weight;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* TM hierarchy status */\n+\tif (port->softport.tm.hierarchy_frozen == 0) {\n+\t\tprintf(\" hierarchy not frozen(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Port link status */\n+\tmemset(&link, 0, sizeof(link));\n+\trte_eth_link_get_nowait(port_id, &link);\n+\tif (link.link_status == ETH_LINK_DOWN) {\n+\t\tprintf(\" Port %u link down (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\tret = rte_tm_node_parent_update(port_id, node_id,\n+\t\tparent_id, priority, weight, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_set_port_tm_node_parent = {\n+\t.f = cmd_set_port_tm_node_parent_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Set port tm node parent\",\n+\t.tokens = {\n+\t\t(void *)&cmd_set_port_tm_node_parent_set,\n+\t\t(void *)&cmd_set_port_tm_node_parent_port,\n+\t\t(void *)&cmd_set_port_tm_node_parent_tm,\n+\t\t(void *)&cmd_set_port_tm_node_parent_node,\n+\t\t(void *)&cmd_set_port_tm_node_parent_parent,\n+\t\t(void *)&cmd_set_port_tm_node_parent_port_id,\n+\t\t(void *)&cmd_set_port_tm_node_parent_node_id,\n+\t\t(void *)&cmd_set_port_tm_node_parent_parent_id,\n+\t\t(void *)&cmd_set_port_tm_node_parent_priority,\n+\t\t(void *)&cmd_set_port_tm_node_parent_weight,\n+\t\tNULL,\n+\t},\n+};\n+#endif\n+\n+/* *** Update Port TM Node Shaper profile *** */\n+struct cmd_set_port_tm_node_shaper_profile_result {\n+\tcmdline_fixed_string_t set;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t node;\n+\tcmdline_fixed_string_t shaper;\n+\tcmdline_fixed_string_t profile;\n+\tuint8_t port_id;\n+\tuint32_t node_id;\n+\tuint32_t shaper_profile_id;\n+};\n+\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_set =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result, set, \"set\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tport, \"port\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_node =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tnode, \"node\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_shaper =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tshaper, \"shaper\");\n+cmdline_parse_token_string_t cmd_set_port_tm_node_shaper_profile_profile =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tprofile, \"profile\");\n+cmdline_parse_token_num_t cmd_set_port_tm_node_shaper_profile_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_set_port_tm_node_shaper_profile_node_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_set_port_tm_node_shaper_profile_result,\n+\t\tnode_id, UINT32);\n+cmdline_parse_token_num_t\n+\tcmd_set_port_tm_node_shaper_shaper_profile_profile_id =\n+\t\tTOKEN_NUM_INITIALIZER(\n+\t\t\tstruct cmd_set_port_tm_node_shaper_profile_result,\n+\t\t\tshaper_profile_id, UINT32);\n+\n+static void cmd_set_port_tm_node_shaper_profile_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_set_port_tm_node_shaper_profile_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_eth_link link;\n+\tstruct rte_tm_error error;\n+\tuint32_t node_id = res->node_id;\n+\tuint32_t shaper_profile_id = res->shaper_profile_id;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* TM hierarchy status */\n+\tif (port->softport.tm.hierarchy_frozen == 0) {\n+\t\tprintf(\" hierarchy not frozen(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Port link status */\n+\tmemset(&link, 0, sizeof(link));\n+\trte_eth_link_get_nowait(port_id, &link);\n+\tif (link.link_status == ETH_LINK_DOWN) {\n+\t\tprintf(\" Port %u link down (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\tret = rte_tm_node_shaper_update(port_id, node_id,\n+\t\tshaper_profile_id, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_set_port_tm_node_shaper_profile = {\n+\t.f = cmd_set_port_tm_node_shaper_profile_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Set port tm node shaper profile\",\n+\t.tokens = {\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_set,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_port,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_tm,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_node,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_shaper,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_profile,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_port_id,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_profile_node_id,\n+\t\t(void *)&cmd_set_port_tm_node_shaper_shaper_profile_profile_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Port TM Hierarchy Commit *** */\n+struct cmd_port_tm_hierarchy_commit_result {\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t hierarchy;\n+\tcmdline_fixed_string_t commit;\n+\tuint8_t port_id;\n+\tuint32_t clean_on_fail;\n+};\n+\n+cmdline_parse_token_string_t cmd_port_tm_hierarchy_commit_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_port_tm_hierarchy_commit_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_port_tm_hierarchy_commit_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_port_tm_hierarchy_commit_result, tm, \"tm\");\n+cmdline_parse_token_string_t cmd_port_tm_hierarchy_commit_hierarchy =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_port_tm_hierarchy_commit_result,\n+\t\t\thierarchy, \"hierarchy\");\n+cmdline_parse_token_string_t cmd_port_tm_hierarchy_commit_commit =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_port_tm_hierarchy_commit_result, commit, \"commit\");\n+cmdline_parse_token_num_t cmd_port_tm_hierarchy_commit_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_port_tm_hierarchy_commit_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_num_t cmd_port_tm_hierarchy_commit_clean_on_fail =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_port_tm_hierarchy_commit_result,\n+\t\t clean_on_fail, UINT32);\n+\n+static void cmd_port_tm_hierarchy_commit_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_port_tm_hierarchy_commit_result *res = parsed_result;\n+\tstruct rte_port *port;\n+\tstruct rte_eth_link link;\n+\tstruct rte_tm_error error;\n+\tuint32_t clean_on_fail = res->clean_on_fail;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tport = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (port->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Port link status */\n+\tmemset(&link, 0, sizeof(link));\n+\trte_eth_link_get_nowait(port_id, &link);\n+\tif (link.link_status == ETH_LINK_UP) {\n+\t\tprintf(\" Port %u link up (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\tret = rte_tm_hierarchy_commit(port_id, clean_on_fail, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+\t/* Set TM hierarchy commit flag */\n+\tport->softport.tm.hierarchy_frozen = 1;\n+}\n+\n+cmdline_parse_inst_t cmd_port_tm_hierarchy_commit = {\n+\t.f = cmd_port_tm_hierarchy_commit_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Set port tm node shaper profile\",\n+\t.tokens = {\n+\t\t(void *)&cmd_port_tm_hierarchy_commit_port,\n+\t\t(void *)&cmd_port_tm_hierarchy_commit_tm,\n+\t\t(void *)&cmd_port_tm_hierarchy_commit_hierarchy,\n+\t\t(void *)&cmd_port_tm_hierarchy_commit_commit,\n+\t\t(void *)&cmd_port_tm_hierarchy_commit_port_id,\n+\t\t(void *)&cmd_port_tm_hierarchy_commit_clean_on_fail,\n+\t\tNULL,\n+\t},\n+};\n+\n+static int\n+port_tm_pktfield_validate_mask(uint64_t mask, uint64_t n)\n+{\n+\tint count = __builtin_popcountll(mask);\n+\tint pos_lead = sizeof(uint64_t) * 8 - __builtin_clzll(mask);\n+\tint pos_trail = __builtin_ctzll(mask);\n+\tint count_expected = __builtin_popcount(n - 1);\n+\n+\t/* Handle the exceptions */\n+\tif (n == 0)\n+\t\treturn -1;\t\t\t/* Error */\n+\n+\tif ((mask == 0) && (n == 1))\n+\t\treturn 0;\t\t\t/* OK */\n+\n+\tif (((mask == 0) && (n != 1)) || ((mask != 0) && (n == 1)))\n+\t\treturn -2;\t\t\t/* Error */\n+\n+\t/* Check that mask is contiguous */\n+\tif ((pos_lead - pos_trail) != count)\n+\t\treturn -3;\t\t\t/* Error */\n+\n+\t/* Check that mask contains the expected number of bits set */\n+\tif (count != count_expected)\n+\t\treturn -4;\t\t\t/* Error */\n+\n+\treturn 0;\t\t\t/* OK */\n+\t}\n+\n+/* *** Set Port TM Packet Fields *** */\n+struct cmd_set_port_tm_pktfield_result {\n+\tcmdline_fixed_string_t set;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t pktfield;\n+\tcmdline_fixed_string_t type;\n+\tuint8_t port_id;\n+\tcmdline_fixed_string_t offset_string;\n+\tuint32_t offset;\n+\tcmdline_fixed_string_t mask_string;\n+\tuint64_t mask;\n+};\n+\n+cmdline_parse_token_string_t cmd_set_port_tm_pktfield_set =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_pktfield_result, set, \"set\");\n+cmdline_parse_token_string_t cmd_set_port_tm_pktfield_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_pktfield_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_set_port_tm_pktfield_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_pktfield_result,\ttm, \"tm\");\n+cmdline_parse_token_string_t cmd_set_port_tm_pktfield_pktfield =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_pktfield_result,\n+\t\t\tpktfield, \"pktfield\");\n+cmdline_parse_token_string_t cmd_set_port_tm_pktfield_type =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_pktfield_result,\n+\t\t\ttype, \"subport#pipe#tc\");\n+cmdline_parse_token_num_t cmd_set_port_tm_pktfield_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_pktfield_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_string_t cmd_set_port_tm_pktfield_offset_string =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_pktfield_result,\n+\t\t\toffset_string, \"offset\");\n+cmdline_parse_token_num_t cmd_set_port_tm_pktfield_offset =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_pktfield_result,\n+\t\t\toffset, UINT32);\n+cmdline_parse_token_string_t cmd_set_port_tm_pktfield_mask_string =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_pktfield_result,\n+\t\t\tmask_string, \"mask\");\n+cmdline_parse_token_num_t cmd_set_port_tm_pktfield_mask =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_pktfield_result,\n+\t\t\tmask, UINT64);\n+\n+static void cmd_set_port_tm_pktfield_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_set_port_tm_pktfield_result *res = parsed_result;\n+\tstruct rte_port *p;\n+\tuint32_t offset = res->offset;\n+\tuint64_t mask = res->mask;\n+\tuint8_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tp = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (p->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Subport */\n+\tif (strcmp(res->type, \"subport\") == 0) {\n+\t\tuint32_t n = p->softport.tm.n_subports_per_port;\n+\n+\t\tret = port_tm_pktfield_validate_mask(mask, n);\n+\t\tif (ret) {\n+\t\t\tprintf(\" invalid subport mask(error %d)\", ret);\n+\t\t\treturn;\n+\t\t}\n+\t\t/* Set packet field */\n+\t\tp->softport.tm.tm_pktfield0_slabpos = offset;\n+\t\tp->softport.tm.tm_pktfield0_slabmask = mask;\n+\t\tp->softport.tm.tm_pktfield0_slabshr = __builtin_ctzll(mask);\n+\t\treturn;\n+\t}\n+\n+\t/* Pipe */\n+\tif (strcmp(res->type, \"pipe\") == 0) {\n+\t\tuint32_t n = p->softport.tm.n_pipes_per_subport;\n+\n+\t\tret = port_tm_pktfield_validate_mask(mask, n);\n+\t\tif (ret) {\n+\t\t\tprintf(\" invalid pipe mask(error %d)\", ret);\n+\t\t\treturn;\n+\t\t}\n+\t\t/* Set packet field */\n+\t\tp->softport.tm.tm_pktfield1_slabpos = offset;\n+\t\tp->softport.tm.tm_pktfield1_slabmask = mask;\n+\t\tp->softport.tm.tm_pktfield1_slabshr = __builtin_ctzll(mask);\n+\t\treturn;\n+\t}\n+\n+\t/* Traffic class */\n+\tif (strcmp(res->type, \"tc\") == 0) {\n+\t\tuint32_t n = RTE_DIM(p->softport.tm.tm_tc_table);\n+\n+\t\tret = port_tm_pktfield_validate_mask(mask, n);\n+\t\tif (ret) {\n+\t\t\tprintf(\" invalid tc mask(error %d)\", ret);\n+\t\t\treturn;\n+\t\t}\n+\t\t/* Set packet field */\n+\t\tp->softport.tm.tm_pktfield1_slabpos = offset;\n+\t\tp->softport.tm.tm_pktfield1_slabmask = mask;\n+\t\tp->softport.tm.tm_pktfield1_slabshr = __builtin_ctzll(mask);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_set_port_tm_pktfield = {\n+\t.f = cmd_set_port_tm_pktfield_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Set port tm pktfield\",\n+\t.tokens = {\n+\t\t(void *)&cmd_set_port_tm_pktfield_set,\n+\t\t(void *)&cmd_set_port_tm_pktfield_port,\n+\t\t(void *)&cmd_set_port_tm_pktfield_tm,\n+\t\t(void *)&cmd_set_port_tm_pktfield_pktfield,\n+\t\t(void *)&cmd_set_port_tm_pktfield_type,\n+\t\t(void *)&cmd_set_port_tm_pktfield_port_id,\n+\t\t(void *)&cmd_set_port_tm_pktfield_offset_string,\n+\t\t(void *)&cmd_set_port_tm_pktfield_offset,\n+\t\t(void *)&cmd_set_port_tm_pktfield_mask_string,\n+\t\t(void *)&cmd_set_port_tm_pktfield_mask,\n+\t\tNULL,\n+\t},\n+};\n+\n+/* *** Set Port TM Traffic Class Table Entry *** */\n+struct cmd_set_port_tm_tc_table_result {\n+\tcmdline_fixed_string_t set;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t tm;\n+\tcmdline_fixed_string_t tc_table;\n+\tuint8_t port_id;\n+\tcmdline_fixed_string_t index_string;\n+\tuint32_t index;\n+\tcmdline_fixed_string_t tc_string;\n+\tuint32_t tc;\n+\tcmdline_fixed_string_t queue_string;\n+\tuint32_t queue;\n+};\n+\n+cmdline_parse_token_string_t cmd_set_port_tm_tc_table_set =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_tc_table_result, set, \"set\");\n+cmdline_parse_token_string_t cmd_set_port_tm_tc_table_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_tc_table_result, port, \"port\");\n+cmdline_parse_token_string_t cmd_set_port_tm_tc_table_tm =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_tc_table_result,\ttm, \"tm\");\n+cmdline_parse_token_string_t cmd_set_port_tm_tc_table_tc_table =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_tc_table_result,\n+\t\t\ttc_table, \"tc table\");\n+cmdline_parse_token_num_t cmd_set_port_tm_tc_table_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_tc_table_result,\n+\t\t\tport_id, UINT8);\n+cmdline_parse_token_string_t cmd_set_port_tm_tc_table_index_string =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_tc_table_result,\n+\t\t\tindex_string, \"index\");\n+cmdline_parse_token_num_t cmd_set_port_tm_tc_table_index =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_tc_table_result,\n+\t\t\tindex, UINT32);\n+cmdline_parse_token_string_t cmd_set_port_tm_tc_table_tc_string =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_tc_table_result,\n+\t\t\ttc_string, \"tc\");\n+cmdline_parse_token_num_t cmd_set_port_tm_tc_table_tc =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_tc_table_result,\n+\t\t\ttc, UINT32);\n+cmdline_parse_token_string_t cmd_set_port_tm_tc_table_queue_string =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_tc_table_result,\n+\t\t\tqueue_string, \"queue\");\n+cmdline_parse_token_num_t cmd_set_port_tm_tc_table_queue =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_set_port_tm_tc_table_result,\n+\t\t\tqueue, UINT32);\n+\n+static void cmd_set_port_tm_tc_table_parsed(void *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_set_port_tm_tc_table_result *res = parsed_result;\n+\tstruct rte_port *p;\n+\tuint32_t tc = res->tc;\n+\tuint32_t index = res->index;\n+\tuint32_t queue = res->queue;\n+\tuint32_t val;\n+\tuint8_t port_id = res->port_id;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tp = &ports[port_id];\n+\n+\t/* Port tm flag */\n+\tif (p->softport.tm_flag == 0) {\n+\t\tprintf(\"  tm not enabled on port %u (error)\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\t/* Forward mode: tm */\n+\tif (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, \"tm\")) {\n+\t\tprintf(\"  tm mode not enabled(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Traffic class table index */\n+\tif (tc >= RTE_DIM(p->softport.tm.tm_tc_table)) {\n+\t\tprintf(\"  invalid traffic class table index(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Traffic class id */\n+\tif (tc >= RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE) {\n+\t\tprintf(\"  invalid traffic class id(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\t/* Traffic class queue */\n+\tif (queue >= RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS) {\n+\t\tprintf(\"  invalid traffic class queue(error)\\n\");\n+\t\treturn;\n+\t}\n+\n+\tval = tc * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + queue;\n+\tp->softport.tm.tm_tc_table[index] = val;\n+}\n+\n+cmdline_parse_inst_t cmd_set_port_tm_tc_table = {\n+\t.f = cmd_set_port_tm_tc_table_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Set port tm TC table entry\",\n+\t.tokens = {\n+\t\t(void *)&cmd_set_port_tm_tc_table_set,\n+\t\t(void *)&cmd_set_port_tm_tc_table_port,\n+\t\t(void *)&cmd_set_port_tm_tc_table_tm,\n+\t\t(void *)&cmd_set_port_tm_tc_table_tc_table,\n+\t\t(void *)&cmd_set_port_tm_tc_table_port_id,\n+\t\t(void *)&cmd_set_port_tm_tc_table_index_string,\n+\t\t(void *)&cmd_set_port_tm_tc_table_index,\n+\t\t(void *)&cmd_set_port_tm_tc_table_tc_string,\n+\t\t(void *)&cmd_set_port_tm_tc_table_tc,\n+\t\t(void *)&cmd_set_port_tm_tc_table_queue_string,\n+\t\t(void *)&cmd_set_port_tm_tc_table_queue,\n+\t\tNULL,\n+\t},\n+};\n+\n+#endif\n+/* *********************************************************************** */\n+\n+/* list of instructions */\n+cmdline_parse_ctx_t main_ctx[] = {\n+\t(cmdline_parse_inst_t *)&cmd_help_brief,\n+\t(cmdline_parse_inst_t *)&cmd_help_long,\n+\t(cmdline_parse_inst_t *)&cmd_quit,\n+\t(cmdline_parse_inst_t *)&cmd_load_from_file,\n+\t(cmdline_parse_inst_t *)&cmd_showport,\n+\t(cmdline_parse_inst_t *)&cmd_showqueue,\n+\t(cmdline_parse_inst_t *)&cmd_showportall,\n+\t(cmdline_parse_inst_t *)&cmd_showcfg,\n+\t(cmdline_parse_inst_t *)&cmd_start,\n+\t(cmdline_parse_inst_t *)&cmd_start_tx_first,\n+\t(cmdline_parse_inst_t *)&cmd_start_tx_first_n,\n+\t(cmdline_parse_inst_t *)&cmd_set_link_up,\n+\t(cmdline_parse_inst_t *)&cmd_set_link_down,\n+\t(cmdline_parse_inst_t *)&cmd_reset,\n+\t(cmdline_parse_inst_t *)&cmd_set_numbers,\n+\t(cmdline_parse_inst_t *)&cmd_set_txpkts,\n+\t(cmdline_parse_inst_t *)&cmd_set_txsplit,\n+\t(cmdline_parse_inst_t *)&cmd_set_fwd_list,\n+\t(cmdline_parse_inst_t *)&cmd_set_fwd_mask,\n+\t(cmdline_parse_inst_t *)&cmd_set_fwd_mode,\n+\t(cmdline_parse_inst_t *)&cmd_set_fwd_retry_mode,\n+\t(cmdline_parse_inst_t *)&cmd_set_burst_tx_retry,\n+\t(cmdline_parse_inst_t *)&cmd_set_promisc_mode_one,\n+\t(cmdline_parse_inst_t *)&cmd_set_promisc_mode_all,\n+\t(cmdline_parse_inst_t *)&cmd_set_allmulti_mode_one,\n+\t(cmdline_parse_inst_t *)&cmd_set_allmulti_mode_all,\n+\t(cmdline_parse_inst_t *)&cmd_set_flush_rx,\n+\t(cmdline_parse_inst_t *)&cmd_set_link_check,\n+\t(cmdline_parse_inst_t *)&cmd_set_bypass_mode,\n+\t(cmdline_parse_inst_t *)&cmd_set_bypass_event,\n+\t(cmdline_parse_inst_t *)&cmd_set_bypass_timeout,\n+\t(cmdline_parse_inst_t *)&cmd_show_bypass_config,\n+#ifdef RTE_LIBRTE_PMD_BOND\n+\t(cmdline_parse_inst_t *) &cmd_set_bonding_mode,\n+\t(cmdline_parse_inst_t *) &cmd_show_bonding_config,\n+\t(cmdline_parse_inst_t *) &cmd_set_bonding_primary,\n+\t(cmdline_parse_inst_t *) &cmd_add_bonding_slave,\n+\t(cmdline_parse_inst_t *) &cmd_remove_bonding_slave,\n+\t(cmdline_parse_inst_t *) &cmd_create_bonded_device,\n+\t(cmdline_parse_inst_t *) &cmd_set_bond_mac_addr,\n+\t(cmdline_parse_inst_t *) &cmd_set_balance_xmit_policy,\n+\t(cmdline_parse_inst_t *) &cmd_set_bond_mon_period,\n+\t(cmdline_parse_inst_t *) &cmd_set_lacp_dedicated_queues,\n+\t(cmdline_parse_inst_t *) &cmd_set_bonding_agg_mode_policy,\n+#endif\n+\t(cmdline_parse_inst_t *)&cmd_vlan_offload,\n+\t(cmdline_parse_inst_t *)&cmd_vlan_tpid,\n+\t(cmdline_parse_inst_t *)&cmd_rx_vlan_filter_all,\n+\t(cmdline_parse_inst_t *)&cmd_rx_vlan_filter,\n+\t(cmdline_parse_inst_t *)&cmd_tx_vlan_set,\n+\t(cmdline_parse_inst_t *)&cmd_tx_vlan_set_qinq,\n+\t(cmdline_parse_inst_t *)&cmd_tx_vlan_reset,\n+\t(cmdline_parse_inst_t *)&cmd_tx_vlan_set_pvid,\n+\t(cmdline_parse_inst_t *)&cmd_csum_set,\n+\t(cmdline_parse_inst_t *)&cmd_csum_show,\n+\t(cmdline_parse_inst_t *)&cmd_csum_tunnel,\n+\t(cmdline_parse_inst_t *)&cmd_tso_set,\n+\t(cmdline_parse_inst_t *)&cmd_tso_show,\n+\t(cmdline_parse_inst_t *)&cmd_tunnel_tso_set,\n+\t(cmdline_parse_inst_t *)&cmd_tunnel_tso_show,\n+\t(cmdline_parse_inst_t *)&cmd_enable_gro,\n+\t(cmdline_parse_inst_t *)&cmd_gro_set,\n+\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set,\n+\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_rx,\n+\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_tx,\n+\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_hw,\n+\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_lw,\n+\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_pt,\n+\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_xon,\n+\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_macfwd,\n+\t(cmdline_parse_inst_t *)&cmd_link_flow_control_set_autoneg,\n+\t(cmdline_parse_inst_t *)&cmd_priority_flow_control_set,\n+\t(cmdline_parse_inst_t *)&cmd_config_dcb,\n+\t(cmdline_parse_inst_t *)&cmd_read_reg,\n+\t(cmdline_parse_inst_t *)&cmd_read_reg_bit_field,\n+\t(cmdline_parse_inst_t *)&cmd_read_reg_bit,\n+\t(cmdline_parse_inst_t *)&cmd_write_reg,\n+\t(cmdline_parse_inst_t *)&cmd_write_reg_bit_field,\n+\t(cmdline_parse_inst_t *)&cmd_write_reg_bit,\n+\t(cmdline_parse_inst_t *)&cmd_read_rxd_txd,\n+\t(cmdline_parse_inst_t *)&cmd_stop,\n+\t(cmdline_parse_inst_t *)&cmd_mac_addr,\n+\t(cmdline_parse_inst_t *)&cmd_set_qmap,\n+\t(cmdline_parse_inst_t *)&cmd_operate_port,\n+\t(cmdline_parse_inst_t *)&cmd_operate_specific_port,\n+\t(cmdline_parse_inst_t *)&cmd_operate_attach_port,\n+\t(cmdline_parse_inst_t *)&cmd_operate_detach_port,\n+\t(cmdline_parse_inst_t *)&cmd_config_speed_all,\n+\t(cmdline_parse_inst_t *)&cmd_config_speed_specific,\n+\t(cmdline_parse_inst_t *)&cmd_config_rx_tx,\n+\t(cmdline_parse_inst_t *)&cmd_config_mtu,\n+\t(cmdline_parse_inst_t *)&cmd_config_max_pkt_len,\n+\t(cmdline_parse_inst_t *)&cmd_config_rx_mode_flag,\n+\t(cmdline_parse_inst_t *)&cmd_config_rss,\n+\t(cmdline_parse_inst_t *)&cmd_config_rxtx_queue,\n+\t(cmdline_parse_inst_t *)&cmd_config_txqflags,\n+\t(cmdline_parse_inst_t *)&cmd_config_rss_reta,\n+\t(cmdline_parse_inst_t *)&cmd_showport_reta,\n+\t(cmdline_parse_inst_t *)&cmd_config_burst,\n+\t(cmdline_parse_inst_t *)&cmd_config_thresh,\n+\t(cmdline_parse_inst_t *)&cmd_config_threshold,\n+\t(cmdline_parse_inst_t *)&cmd_set_uc_hash_filter,\n+\t(cmdline_parse_inst_t *)&cmd_set_uc_all_hash_filter,\n+\t(cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_macvlan_filter,\n+\t(cmdline_parse_inst_t *)&cmd_queue_rate_limit,\n+\t(cmdline_parse_inst_t *)&cmd_tunnel_filter,\n+\t(cmdline_parse_inst_t *)&cmd_tunnel_udp_config,\n+\t(cmdline_parse_inst_t *)&cmd_global_config,\n+\t(cmdline_parse_inst_t *)&cmd_set_mirror_mask,\n+\t(cmdline_parse_inst_t *)&cmd_set_mirror_link,\n+\t(cmdline_parse_inst_t *)&cmd_reset_mirror_rule,\n+\t(cmdline_parse_inst_t *)&cmd_showport_rss_hash,\n+\t(cmdline_parse_inst_t *)&cmd_showport_rss_hash_key,\n+\t(cmdline_parse_inst_t *)&cmd_config_rss_hash_key,\n+\t(cmdline_parse_inst_t *)&cmd_dump,\n+\t(cmdline_parse_inst_t *)&cmd_dump_one,\n+\t(cmdline_parse_inst_t *)&cmd_ethertype_filter,\n+\t(cmdline_parse_inst_t *)&cmd_syn_filter,\n+\t(cmdline_parse_inst_t *)&cmd_2tuple_filter,\n+\t(cmdline_parse_inst_t *)&cmd_5tuple_filter,\n+\t(cmdline_parse_inst_t *)&cmd_flex_filter,\n+\t(cmdline_parse_inst_t *)&cmd_add_del_ip_flow_director,\n+\t(cmdline_parse_inst_t *)&cmd_add_del_udp_flow_director,\n+\t(cmdline_parse_inst_t *)&cmd_add_del_sctp_flow_director,\n+\t(cmdline_parse_inst_t *)&cmd_add_del_l2_flow_director,\n+\t(cmdline_parse_inst_t *)&cmd_add_del_mac_vlan_flow_director,\n+\t(cmdline_parse_inst_t *)&cmd_add_del_tunnel_flow_director,\n+\t(cmdline_parse_inst_t *)&cmd_flush_flow_director,\n+\t(cmdline_parse_inst_t *)&cmd_set_flow_director_ip_mask,\n+\t(cmdline_parse_inst_t *)&cmd_set_flow_director_mac_vlan_mask,\n+\t(cmdline_parse_inst_t *)&cmd_set_flow_director_tunnel_mask,\n+\t(cmdline_parse_inst_t *)&cmd_set_flow_director_flex_mask,\n+\t(cmdline_parse_inst_t *)&cmd_set_flow_director_flex_payload,\n+\t(cmdline_parse_inst_t *)&cmd_get_sym_hash_ena_per_port,\n+\t(cmdline_parse_inst_t *)&cmd_set_sym_hash_ena_per_port,\n+\t(cmdline_parse_inst_t *)&cmd_get_hash_global_config,\n+\t(cmdline_parse_inst_t *)&cmd_set_hash_global_config,\n+\t(cmdline_parse_inst_t *)&cmd_set_hash_input_set,\n+\t(cmdline_parse_inst_t *)&cmd_set_fdir_input_set,\n+\t(cmdline_parse_inst_t *)&cmd_flow,\n+\t(cmdline_parse_inst_t *)&cmd_mcast_addr,\n+\t(cmdline_parse_inst_t *)&cmd_config_l2_tunnel_eth_type_all,\n+\t(cmdline_parse_inst_t *)&cmd_config_l2_tunnel_eth_type_specific,\n+\t(cmdline_parse_inst_t *)&cmd_config_l2_tunnel_en_dis_all,\n+\t(cmdline_parse_inst_t *)&cmd_config_l2_tunnel_en_dis_specific,\n+\t(cmdline_parse_inst_t *)&cmd_config_e_tag_insertion_en,\n+\t(cmdline_parse_inst_t *)&cmd_config_e_tag_insertion_dis,\n+\t(cmdline_parse_inst_t *)&cmd_config_e_tag_stripping_en_dis,\n+\t(cmdline_parse_inst_t *)&cmd_config_e_tag_forwarding_en_dis,\n+\t(cmdline_parse_inst_t *)&cmd_config_e_tag_filter_add,\n+\t(cmdline_parse_inst_t *)&cmd_config_e_tag_filter_del,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_vlan_anti_spoof,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_mac_anti_spoof,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_vlan_insert,\n+\t(cmdline_parse_inst_t *)&cmd_set_tx_loopback,\n+\t(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,\n+\t(cmdline_parse_inst_t *)&cmd_set_macsec_offload_on,\n+\t(cmdline_parse_inst_t *)&cmd_set_macsec_offload_off,\n+\t(cmdline_parse_inst_t *)&cmd_set_macsec_sc,\n+\t(cmdline_parse_inst_t *)&cmd_set_macsec_sa,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_traffic,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_rxmode,\n+\t(cmdline_parse_inst_t *)&cmd_vf_rate_limit,\n+\t(cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_promisc,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_allmulti,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_broadcast,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_vlan_tag,\n+\t(cmdline_parse_inst_t *)&cmd_vf_max_bw,\n+\t(cmdline_parse_inst_t *)&cmd_vf_tc_min_bw,\n+\t(cmdline_parse_inst_t *)&cmd_vf_tc_max_bw,\n+\t(cmdline_parse_inst_t *)&cmd_strict_link_prio,\n+\t(cmdline_parse_inst_t *)&cmd_tc_min_bw,\n+\t(cmdline_parse_inst_t *)&cmd_ddp_add,\n+\t(cmdline_parse_inst_t *)&cmd_ddp_del,\n+\t(cmdline_parse_inst_t *)&cmd_ddp_get_list,\n+\t(cmdline_parse_inst_t *)&cmd_ddp_get_info,\n+\t(cmdline_parse_inst_t *)&cmd_show_vf_stats,\n+\t(cmdline_parse_inst_t *)&cmd_clear_vf_stats,\n+\t(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,\n+\t(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,\n+\t(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,\n+\t(cmdline_parse_inst_t *)&cmd_ptype_mapping_update,\n+#ifdef TM_MODE\n+\t(cmdline_parse_inst_t *)&cmd_show_port_tm_cap,\n+\t(cmdline_parse_inst_t *)&cmd_show_port_tm_level_cap,\n+\t(cmdline_parse_inst_t *)&cmd_show_port_tm_node_cap,\n+\t(cmdline_parse_inst_t *)&cmd_add_port_tm_node_shaper_profile,\n+\t(cmdline_parse_inst_t *)&cmd_del_port_tm_node_shaper_profile,\n+\t(cmdline_parse_inst_t *)&cmd_add_port_tm_node_shared_shaper,\n+\t(cmdline_parse_inst_t *)&cmd_del_port_tm_node_shared_shaper,\n+\t(cmdline_parse_inst_t *)&cmd_add_port_tm_node_wred_profile,\n+\t(cmdline_parse_inst_t *)&cmd_del_port_tm_node_wred_profile,\n+\t(cmdline_parse_inst_t *)&cmd_add_port_tm_nonleaf_node,\n+\t(cmdline_parse_inst_t *)&cmd_add_port_tm_leaf_node,\n+\t(cmdline_parse_inst_t *)&cmd_del_port_tm_node,\n+\t(cmdline_parse_inst_t *)&cmd_show_port_tm_node_type,\n+\t(cmdline_parse_inst_t *)&cmd_show_port_tm_node_stats,\n+#ifdef RTE_SCHED_SUBPORT_TC_OV\n+\t(cmdline_parse_inst_t *)&cmd_set_port_tm_node_parent,\n+#endif\n+\t(cmdline_parse_inst_t *)&cmd_set_port_tm_node_shaper_profile,\n+\t(cmdline_parse_inst_t *)&cmd_port_tm_hierarchy_commit,\n+\t(cmdline_parse_inst_t *)&cmd_set_port_tm_pktfield,\n+\t(cmdline_parse_inst_t *)&cmd_set_port_tm_tc_table,\n+#endif\n \tNULL,\n };\n \n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/2"
    ]
}