app/testpmd: update DDP add command parameters
[dpdk.git] / app / test-pmd / cmdline.c
index 58463aa..89b06b8 100644 (file)
@@ -94,6 +94,9 @@
 #ifdef RTE_LIBRTE_I40E_PMD
 #include <rte_pmd_i40e.h>
 #endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+#include <rte_pmd_bnxt.h>
+#endif
 #include "testpmd.h"
 
 static struct cmdline *testpmd_cl;
@@ -218,6 +221,9 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "ddp get list (port_id)\n"
                        "    Get ddp profile info list\n\n"
 
+                       "ddp get info (profile_path)\n"
+                       "    Get ddp profile information.\n\n"
+
                        "show vf stats (port_id) (vf_id)\n"
                        "    Display a VF's statistics.\n\n"
 
@@ -278,18 +284,15 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "set tx loopback (port_id) (on|off)\n"
                        "    Enable or disable tx loopback.\n\n"
 
-#ifdef RTE_LIBRTE_IXGBE_PMD
                        "set all queues drop (port_id) (on|off)\n"
                        "    Set drop enable bit for all queues.\n\n"
 
                        "set vf split drop (port_id) (vf_id) (on|off)\n"
                        "    Set split drop enable bit for a VF from the PF.\n\n"
-#endif
 
                        "set vf mac antispoof (port_id) (vf_id) (on|off).\n"
                        "    Set MAC antispoof for a VF from the PF.\n\n"
 
-#ifdef RTE_LIBRTE_IXGBE_PMD
                        "set macsec offload (port_id) on encrypt (on|off) replay-protect (on|off)\n"
                        "    Enable MACsec offload.\n\n"
 
@@ -301,7 +304,6 @@ static void cmd_help_long_parsed(void *parsed_result,
 
                        "set macsec sa (tx|rx) (port_id) (idx) (an) (pn) (key)\n"
                        "    Configure MACsec secure association (SA).\n\n"
-#endif
 
                        "set vf broadcast (port_id) (vf_id) (on|off)\n"
                        "    Set VF broadcast for a VF from the PF.\n\n"
@@ -601,7 +603,7 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "E-tag set filter del e-tag-id (value) port (port_id)\n"
                        "    Delete an E-tag forwarding filter on a port\n\n"
 
-                       "ddp add (port_id) (profile_path)\n"
+                       "ddp add (port_id) (profile_path[,output_path])\n"
                        "    Load a profile package on a port\n\n"
 
                        "ptype mapping get (port_id) (valid_only)\n"
@@ -903,6 +905,10 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "flow list {port_id} [group {group_id}] [...]\n"
                        "    List existing flow rules sorted by priority,"
                        " filtered by group identifiers.\n\n"
+
+                       "flow isolate {port_id} {boolean}\n"
+                       "    Restrict ingress traffic to the defined"
+                       " flow rules\n\n"
                );
        }
 }
@@ -3921,7 +3927,7 @@ cmd_set_bypass_mode_parsed(void *parsed_result,
        portid_t port_id = res->port_id;
        int32_t rc = -EINVAL;
 
-#ifdef RTE_LIBRTE_IXGBE_BYPASS
+#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS
        uint32_t bypass_mode = RTE_PMD_IXGBE_BYPASS_MODE_NORMAL;
 
        if (!strcmp(res->value, "bypass"))
@@ -3989,7 +3995,7 @@ cmd_set_bypass_event_parsed(void *parsed_result,
        struct cmd_set_bypass_event_result *res = parsed_result;
        portid_t port_id = res->port_id;
 
-#ifdef RTE_LIBRTE_IXGBE_BYPASS
+#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS
        uint32_t bypass_event = RTE_PMD_IXGBE_BYPASS_EVENT_NONE;
        uint32_t bypass_mode = RTE_PMD_IXGBE_BYPASS_MODE_NORMAL;
 
@@ -4094,7 +4100,7 @@ cmd_set_bypass_timeout_parsed(void *parsed_result,
 {
        __rte_unused struct cmd_set_bypass_timeout_result *res = parsed_result;
 
-#ifdef RTE_LIBRTE_IXGBE_BYPASS
+#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS
        if (!strcmp(res->value, "1.5"))
                bypass_timeout = RTE_PMD_IXGBE_BYPASS_TMT_1_5_SEC;
        else if (!strcmp(res->value, "2"))
@@ -4157,7 +4163,7 @@ cmd_show_bypass_config_parsed(void *parsed_result,
        struct cmd_show_bypass_config_result *res = parsed_result;
        portid_t port_id = res->port_id;
        int rc = -EINVAL;
-#ifdef RTE_LIBRTE_IXGBE_BYPASS
+#if defined RTE_LIBRTE_IXGBE_PMD && defined RTE_LIBRTE_IXGBE_BYPASS
        uint32_t event_mode;
        uint32_t bypass_mode;
        uint32_t timeout = bypass_timeout;
@@ -4561,7 +4567,7 @@ static void cmd_add_bonding_slave_parsed(void *parsed_result,
        portid_t master_port_id = res->port_id;
        portid_t slave_port_id = res->slave_id;
 
-       /* Set the primary slave for a bonded device. */
+       /* add the slave for a bonded device. */
        if (0 != rte_eth_bond_slave_add(master_port_id, slave_port_id)) {
                printf("\t Failed to add slave %d to master port = %d.\n",
                                slave_port_id, master_port_id);
@@ -4619,7 +4625,7 @@ static void cmd_remove_bonding_slave_parsed(void *parsed_result,
        portid_t master_port_id = res->port_id;
        portid_t slave_port_id = res->slave_id;
 
-       /* Set the primary slave for a bonded device. */
+       /* remove the slave from a bonded device. */
        if (0 != rte_eth_bond_slave_remove(master_port_id, slave_port_id)) {
                printf("\t Failed to remove slave %d from master port = %d.\n",
                                slave_port_id, master_port_id);
@@ -6735,7 +6741,6 @@ cmdline_parse_inst_t cmd_set_vf_macvlan_filter = {
        },
 };
 
-#ifdef RTE_LIBRTE_IXGBE_PMD
 /* *** CONFIGURE VF TRAFFIC CONTROL *** */
 struct cmd_set_vf_traffic {
        cmdline_fixed_string_t set;
@@ -6814,7 +6819,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
                       __attribute__((unused)) struct cmdline *cl,
                       __attribute__((unused)) void *data)
 {
-       int ret;
+       int ret = -ENOTSUP;
        uint16_t rx_mode = 0;
        struct cmd_set_vf_rxmode *res = parsed_result;
 
@@ -6830,7 +6835,16 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
                        rx_mode |= ETH_VMDQ_ACCEPT_MULTICAST;
        }
 
-       ret = rte_pmd_ixgbe_set_vf_rxmode(res->port_id, res->vf_id, rx_mode, (uint8_t)is_on);
+#ifdef RTE_LIBRTE_IXGBE_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_ixgbe_set_vf_rxmode(res->port_id, res->vf_id,
+                                                 rx_mode, (uint8_t)is_on);
+#endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_bnxt_set_vf_rxmode(res->port_id, res->vf_id,
+                                                rx_mode, (uint8_t)is_on);
+#endif
        if (ret < 0)
                printf("bad VF receive mode parameter, return code = %d \n",
                ret);
@@ -6878,7 +6892,6 @@ cmdline_parse_inst_t cmd_set_vf_rxmode = {
                NULL,
        },
 };
-#endif
 
 /* *** ADD MAC ADDRESS FILTER FOR A VF OF A PORT *** */
 struct cmd_vf_mac_addr_result {
@@ -6976,6 +6989,11 @@ cmd_vf_rx_vlan_filter_parsed(void *parsed_result,
                ret = rte_pmd_i40e_set_vf_vlan_filter(res->port_id,
                                res->vlan_id, res->vf_mask, is_add);
 #endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_bnxt_set_vf_vlan_filter(res->port_id,
+                               res->vlan_id, res->vf_mask, is_add);
+#endif
 
        switch (ret) {
        case 0:
@@ -7101,7 +7119,6 @@ cmdline_parse_inst_t cmd_queue_rate_limit = {
        },
 };
 
-#ifdef RTE_LIBRTE_IXGBE_PMD
 /* *** SET RATE LIMIT FOR A VF OF A PORT *** */
 struct cmd_vf_rate_limit_result {
        cmdline_fixed_string_t set;
@@ -7180,7 +7197,6 @@ cmdline_parse_inst_t cmd_vf_rate_limit = {
                NULL,
        },
 };
-#endif
 
 /* *** ADD TUNNEL FILTER OF A PORT *** */
 struct cmd_tunnel_filter_result {
@@ -11027,6 +11043,11 @@ cmd_set_vf_vlan_anti_spoof_parsed(
                ret = rte_pmd_i40e_set_vf_vlan_anti_spoof(res->port_id,
                                res->vf_id, is_on);
 #endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_bnxt_set_vf_vlan_anti_spoof(res->port_id,
+                               res->vf_id, is_on);
+#endif
 
        switch (ret) {
        case 0:
@@ -11128,6 +11149,11 @@ cmd_set_vf_mac_anti_spoof_parsed(
                ret = rte_pmd_i40e_set_vf_mac_anti_spoof(res->port_id,
                        res->vf_id, is_on);
 #endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_bnxt_set_vf_mac_anti_spoof(res->port_id,
+                       res->vf_id, is_on);
+#endif
 
        switch (ret) {
        case 0:
@@ -11229,6 +11255,11 @@ cmd_set_vf_vlan_stripq_parsed(
                ret = rte_pmd_i40e_set_vf_vlan_stripq(res->port_id,
                        res->vf_id, is_on);
 #endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_bnxt_set_vf_vlan_stripq(res->port_id,
+                       res->vf_id, is_on);
+#endif
 
        switch (ret) {
        case 0:
@@ -11328,6 +11359,11 @@ cmd_set_vf_vlan_insert_parsed(
                ret = rte_pmd_i40e_set_vf_vlan_insert(res->port_id, res->vf_id,
                        res->vlan_id);
 #endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_bnxt_set_vf_vlan_insert(res->port_id, res->vf_id,
+                       res->vlan_id);
+#endif
 
        switch (ret) {
        case 0:
@@ -11417,6 +11453,10 @@ cmd_set_tx_loopback_parsed(
        if (ret == -ENOTSUP)
                ret = rte_pmd_i40e_set_tx_loopback(res->port_id, is_on);
 #endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_bnxt_set_tx_loopback(res->port_id, is_on);
+#endif
 
        switch (ret) {
        case 0:
@@ -11449,7 +11489,6 @@ cmdline_parse_inst_t cmd_set_tx_loopback = {
        },
 };
 
-#ifdef RTE_LIBRTE_IXGBE_PMD
 /* all queues drop enable configuration */
 
 /* Common result structure for all queues drop enable */
@@ -11495,13 +11534,20 @@ cmd_set_all_queues_drop_en_parsed(
        __attribute__((unused)) void *data)
 {
        struct cmd_all_queues_drop_en_result *res = parsed_result;
-       int ret = 0;
+       int ret = -ENOTSUP;
        int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
 
        if (port_id_is_invalid(res->port_id, ENABLED_WARN))
                return;
 
-       ret = rte_pmd_ixgbe_set_all_queues_drop_en(res->port_id, is_on);
+#ifdef RTE_LIBRTE_IXGBE_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_ixgbe_set_all_queues_drop_en(res->port_id, is_on);
+#endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_bnxt_set_all_queues_drop_en(res->port_id, is_on);
+#endif
        switch (ret) {
        case 0:
                break;
@@ -11584,14 +11630,16 @@ cmd_set_vf_split_drop_en_parsed(
        __attribute__((unused)) void *data)
 {
        struct cmd_vf_split_drop_en_result *res = parsed_result;
-       int ret;
+       int ret = -ENOTSUP;
        int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
 
        if (port_id_is_invalid(res->port_id, ENABLED_WARN))
                return;
 
+#ifdef RTE_LIBRTE_IXGBE_PMD
        ret = rte_pmd_ixgbe_set_vf_split_drop_en(res->port_id, res->vf_id,
                        is_on);
+#endif
        switch (ret) {
        case 0:
                break;
@@ -11601,6 +11649,9 @@ cmd_set_vf_split_drop_en_parsed(
        case -ENODEV:
                printf("invalid port_id %d\n", res->port_id);
                break;
+       case -ENOTSUP:
+               printf("not supported on port %d\n", res->port_id);
+               break;
        default:
                printf("programming error: (%s)\n", strerror(-ret));
        }
@@ -11621,7 +11672,6 @@ cmdline_parse_inst_t cmd_set_vf_split_drop_en = {
                NULL,
        },
 };
-#endif
 
 /* vf mac address configuration */
 
@@ -11688,6 +11738,11 @@ cmd_set_vf_mac_addr_parsed(
                ret = rte_pmd_i40e_set_vf_mac_addr(res->port_id, res->vf_id,
                                &res->mac_addr);
 #endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_bnxt_set_vf_mac_addr(res->port_id, res->vf_id,
+                               &res->mac_addr);
+#endif
 
        switch (ret) {
        case 0:
@@ -11722,7 +11777,6 @@ cmdline_parse_inst_t cmd_set_vf_mac_addr = {
        },
 };
 
-#ifdef RTE_LIBRTE_IXGBE_PMD
 /* MACsec configuration */
 
 /* Common result structure for MACsec offload enable */
@@ -11783,7 +11837,7 @@ cmd_set_macsec_offload_on_parsed(
        __attribute__((unused)) void *data)
 {
        struct cmd_macsec_offload_on_result *res = parsed_result;
-       int ret;
+       int ret = -ENOTSUP;
        portid_t port_id = res->port_id;
        int en = (strcmp(res->en_on_off, "on") == 0) ? 1 : 0;
        int rp = (strcmp(res->rp_on_off, "on") == 0) ? 1 : 0;
@@ -11792,7 +11846,11 @@ cmd_set_macsec_offload_on_parsed(
                return;
 
        ports[port_id].tx_ol_flags |= TESTPMD_TX_OFFLOAD_MACSEC;
+#ifdef RTE_LIBRTE_IXGBE_PMD
        ret = rte_pmd_ixgbe_macsec_enable(port_id, en, rp);
+#endif
+       RTE_SET_USED(en);
+       RTE_SET_USED(rp);
 
        switch (ret) {
        case 0:
@@ -11800,6 +11858,9 @@ cmd_set_macsec_offload_on_parsed(
        case -ENODEV:
                printf("invalid port_id %d\n", port_id);
                break;
+       case -ENOTSUP:
+               printf("not supported on port %d\n", port_id);
+               break;
        default:
                printf("programming error: (%s)\n", strerror(-ret));
        }
@@ -11862,14 +11923,16 @@ cmd_set_macsec_offload_off_parsed(
        __attribute__((unused)) void *data)
 {
        struct cmd_macsec_offload_off_result *res = parsed_result;
-       int ret;
+       int ret = -ENOTSUP;
        portid_t port_id = res->port_id;
 
        if (port_id_is_invalid(port_id, ENABLED_WARN))
                return;
 
        ports[port_id].tx_ol_flags &= ~TESTPMD_TX_OFFLOAD_MACSEC;
+#ifdef RTE_LIBRTE_IXGBE_PMD
        ret = rte_pmd_ixgbe_macsec_disable(port_id);
+#endif
 
        switch (ret) {
        case 0:
@@ -11877,6 +11940,9 @@ cmd_set_macsec_offload_off_parsed(
        case -ENODEV:
                printf("invalid port_id %d\n", port_id);
                break;
+       case -ENOTSUP:
+               printf("not supported on port %d\n", port_id);
+               break;
        default:
                printf("programming error: (%s)\n", strerror(-ret));
        }
@@ -11944,20 +12010,27 @@ cmd_set_macsec_sc_parsed(
        __attribute__((unused)) void *data)
 {
        struct cmd_macsec_sc_result *res = parsed_result;
-       int ret;
+       int ret = -ENOTSUP;
        int is_tx = (strcmp(res->tx_rx, "tx") == 0) ? 1 : 0;
 
+#ifdef RTE_LIBRTE_IXGBE_PMD
        ret = is_tx ?
                rte_pmd_ixgbe_macsec_config_txsc(res->port_id,
                                res->mac.addr_bytes) :
                rte_pmd_ixgbe_macsec_config_rxsc(res->port_id,
                                res->mac.addr_bytes, res->pi);
+#endif
+       RTE_SET_USED(is_tx);
+
        switch (ret) {
        case 0:
                break;
        case -ENODEV:
                printf("invalid port_id %d\n", res->port_id);
                break;
+       case -ENOTSUP:
+               printf("not supported on port %d\n", res->port_id);
+               break;
        default:
                printf("programming error: (%s)\n", strerror(-ret));
        }
@@ -12037,7 +12110,7 @@ cmd_set_macsec_sa_parsed(
        __attribute__((unused)) void *data)
 {
        struct cmd_macsec_sa_result *res = parsed_result;
-       int ret;
+       int ret = -ENOTSUP;
        int is_tx = (strcmp(res->tx_rx, "tx") == 0) ? 1 : 0;
        uint8_t key[16] = { 0 };
        uint8_t xdgt0;
@@ -12059,11 +12132,16 @@ cmd_set_macsec_sa_parsed(
                key[i] = (uint8_t) ((xdgt0 * 16) + xdgt1);
        }
 
+#ifdef RTE_LIBRTE_IXGBE_PMD
        ret = is_tx ?
                rte_pmd_ixgbe_macsec_select_txsa(res->port_id,
                        res->idx, res->an, res->pn, key) :
                rte_pmd_ixgbe_macsec_select_rxsa(res->port_id,
                        res->idx, res->an, res->pn, key);
+#endif
+       RTE_SET_USED(is_tx);
+       RTE_SET_USED(key);
+
        switch (ret) {
        case 0:
                break;
@@ -12073,6 +12151,9 @@ cmd_set_macsec_sa_parsed(
        case -ENODEV:
                printf("invalid port_id %d\n", res->port_id);
                break;
+       case -ENOTSUP:
+               printf("not supported on port %d\n", res->port_id);
+               break;
        default:
                printf("programming error: (%s)\n", strerror(-ret));
        }
@@ -12095,7 +12176,6 @@ cmdline_parse_inst_t cmd_set_macsec_sa = {
                NULL,
        },
 };
-#endif
 
 /* VF unicast promiscuous mode configuration */
 
@@ -12875,6 +12955,9 @@ cmd_ddp_add_parsed(
        struct cmd_ddp_add_result *res = parsed_result;
        uint8_t *buff;
        uint32_t size;
+       char *filepath;
+       char *file_fld[2];
+       int file_num;
        int ret = -ENOTSUP;
 
        if (res->port_id > nb_ports) {
@@ -12887,9 +12970,18 @@ cmd_ddp_add_parsed(
                return;
        }
 
-       buff = open_ddp_package_file(res->filepath, &size);
-       if (!buff)
+       filepath = strdup(res->filepath);
+       if (filepath == NULL) {
+               printf("Failed to allocate memory\n");
                return;
+       }
+       file_num = rte_strsplit(filepath, strlen(filepath), file_fld, 2, ',');
+
+       buff = open_ddp_package_file(file_fld[0], &size);
+       if (!buff) {
+               free((void *)filepath);
+               return;
+       }
 
 #ifdef RTE_LIBRTE_I40E_PMD
        if (ret == -ENOTSUP)
@@ -12898,18 +12990,21 @@ cmd_ddp_add_parsed(
                                               RTE_PMD_I40E_PKG_OP_WR_ADD);
 #endif
 
-       if (ret < 0)
-               printf("Failed to load profile.\n");
-       else if (ret > 0)
+       if (ret == -EEXIST)
                printf("Profile has already existed.\n");
+       else if (ret < 0)
+               printf("Failed to load profile.\n");
+       else if (file_num == 2)
+               save_ddp_package_file(file_fld[1], buff, size);
 
        close_ddp_package_file(buff);
+       free((void *)filepath);
 }
 
 cmdline_parse_inst_t cmd_ddp_add = {
        .f = cmd_ddp_add_parsed,
        .data = NULL,
-       .help_str = "ddp add <port_id> <profile_path>",
+       .help_str = "ddp add <port_id> <profile_path[,output_path]>",
        .tokens = {
                (void *)&cmd_ddp_add_ddp,
                (void *)&cmd_ddp_add_add,
@@ -12919,6 +13014,133 @@ cmdline_parse_inst_t cmd_ddp_add = {
        },
 };
 
+/* Get dynamic device personalization profile info */
+struct cmd_ddp_info_result {
+       cmdline_fixed_string_t ddp;
+       cmdline_fixed_string_t get;
+       cmdline_fixed_string_t info;
+       char filepath[];
+};
+
+cmdline_parse_token_string_t cmd_ddp_info_ddp =
+       TOKEN_STRING_INITIALIZER(struct cmd_ddp_info_result, ddp, "ddp");
+cmdline_parse_token_string_t cmd_ddp_info_get =
+       TOKEN_STRING_INITIALIZER(struct cmd_ddp_info_result, get, "get");
+cmdline_parse_token_string_t cmd_ddp_info_info =
+       TOKEN_STRING_INITIALIZER(struct cmd_ddp_info_result, info, "info");
+cmdline_parse_token_string_t cmd_ddp_info_filepath =
+       TOKEN_STRING_INITIALIZER(struct cmd_ddp_info_result, filepath, NULL);
+
+static void
+cmd_ddp_info_parsed(
+       void *parsed_result,
+       __attribute__((unused)) struct cmdline *cl,
+       __attribute__((unused)) void *data)
+{
+       struct cmd_ddp_info_result *res = parsed_result;
+       uint8_t *pkg;
+       uint32_t pkg_size;
+       int ret = -ENOTSUP;
+#ifdef RTE_LIBRTE_I40E_PMD
+       uint32_t i;
+       uint8_t *buff;
+       uint32_t buff_size;
+       struct rte_pmd_i40e_profile_info info;
+       uint32_t dev_num;
+       struct rte_pmd_i40e_ddp_device_id *devs;
+#endif
+
+       pkg = open_ddp_package_file(res->filepath, &pkg_size);
+       if (!pkg)
+               return;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+       ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+                               (uint8_t *)&info, sizeof(info),
+                               RTE_PMD_I40E_PKG_INFO_GLOBAL_HEADER);
+       if (!ret) {
+               printf("Global Track id:       0x%x\n", info.track_id);
+               printf("Global Version:        %d.%d.%d.%d\n",
+                       info.version.major,
+                       info.version.minor,
+                       info.version.update,
+                       info.version.draft);
+               printf("Global Package name:   %s\n\n", info.name);
+       }
+
+       ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+                               (uint8_t *)&info, sizeof(info),
+                               RTE_PMD_I40E_PKG_INFO_HEADER);
+       if (!ret) {
+               printf("i40e Profile Track id: 0x%x\n", info.track_id);
+               printf("i40e Profile Version:  %d.%d.%d.%d\n",
+                       info.version.major,
+                       info.version.minor,
+                       info.version.update,
+                       info.version.draft);
+               printf("i40e Profile name:     %s\n\n", info.name);
+       }
+
+       ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+                               (uint8_t *)&buff_size, sizeof(buff_size),
+                               RTE_PMD_I40E_PKG_INFO_GLOBAL_NOTES_SIZE);
+       if (!ret && buff_size) {
+               buff = (uint8_t *)malloc(buff_size);
+               if (buff) {
+                       ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+                                               buff, buff_size,
+                                               RTE_PMD_I40E_PKG_INFO_GLOBAL_NOTES);
+                       if (!ret)
+                               printf("Package Notes:\n%s\n\n", buff);
+                       free(buff);
+               }
+       }
+
+       ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+                               (uint8_t *)&dev_num, sizeof(dev_num),
+                               RTE_PMD_I40E_PKG_INFO_DEVID_NUM);
+       if (!ret && dev_num) {
+               devs = (struct rte_pmd_i40e_ddp_device_id *)malloc(dev_num *
+                       sizeof(struct rte_pmd_i40e_ddp_device_id));
+               if (devs) {
+                       ret = rte_pmd_i40e_get_ddp_info(pkg, pkg_size,
+                                               (uint8_t *)devs, dev_num *
+                                               sizeof(struct rte_pmd_i40e_ddp_device_id),
+                                               RTE_PMD_I40E_PKG_INFO_DEVID_LIST);
+                       if (!ret) {
+                               printf("List of supported devices:\n");
+                               for (i = 0; i < dev_num; i++) {
+                                       printf("  %04X:%04X %04X:%04X\n",
+                                               devs[i].vendor_dev_id >> 16,
+                                               devs[i].vendor_dev_id & 0xFFFF,
+                                               devs[i].sub_vendor_dev_id >> 16,
+                                               devs[i].sub_vendor_dev_id & 0xFFFF);
+                               }
+                               printf("\n");
+                       }
+                       free(devs);
+               }
+       }
+       ret = 0;
+#endif
+       if (ret == -ENOTSUP)
+               printf("Function not supported in PMD driver\n");
+       close_ddp_package_file(pkg);
+}
+
+cmdline_parse_inst_t cmd_ddp_get_info = {
+       .f = cmd_ddp_info_parsed,
+       .data = NULL,
+       .help_str = "ddp get info <profile_path>",
+       .tokens = {
+               (void *)&cmd_ddp_info_ddp,
+               (void *)&cmd_ddp_info_get,
+               (void *)&cmd_ddp_info_info,
+               (void *)&cmd_ddp_info_filepath,
+               NULL,
+       },
+};
+
 /* Get dynamic device personalization profile info list*/
 #define PROFILE_INFO_SIZE 48
 #define MAX_PROFILE_NUM 16
@@ -13057,9 +13279,16 @@ cmd_show_vf_stats_parsed(
        memset(&stats, 0, sizeof(stats));
 
 #ifdef RTE_LIBRTE_I40E_PMD
-       ret = rte_pmd_i40e_get_vf_stats(res->port_id,
-                                       res->vf_id,
-                                       &stats);
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_i40e_get_vf_stats(res->port_id,
+                                               res->vf_id,
+                                               &stats);
+#endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_bnxt_get_vf_stats(res->port_id,
+                                               res->vf_id,
+                                               &stats);
 #endif
 
        switch (ret) {
@@ -13155,8 +13384,14 @@ cmd_clear_vf_stats_parsed(
                return;
 
 #ifdef RTE_LIBRTE_I40E_PMD
-       ret = rte_pmd_i40e_reset_vf_stats(res->port_id,
-                                         res->vf_id);
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_i40e_reset_vf_stats(res->port_id,
+                                                 res->vf_id);
+#endif
+#ifdef RTE_LIBRTE_BNXT_PMD
+       if (ret == -ENOTSUP)
+               ret = rte_pmd_bnxt_reset_vf_stats(res->port_id,
+                                                 res->vf_id);
 #endif
 
        switch (ret) {
@@ -13737,17 +13972,15 @@ cmdline_parse_ctx_t main_ctx[] = {
        (cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq,
        (cmdline_parse_inst_t *)&cmd_set_vf_vlan_insert,
        (cmdline_parse_inst_t *)&cmd_set_tx_loopback,
-#ifdef RTE_LIBRTE_IXGBE_PMD
        (cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
        (cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
        (cmdline_parse_inst_t *)&cmd_set_macsec_offload_on,
        (cmdline_parse_inst_t *)&cmd_set_macsec_offload_off,
        (cmdline_parse_inst_t *)&cmd_set_macsec_sc,
        (cmdline_parse_inst_t *)&cmd_set_macsec_sa,
-       (cmdline_parse_inst_t *)&cmd_set_vf_rxmode,
        (cmdline_parse_inst_t *)&cmd_set_vf_traffic,
+       (cmdline_parse_inst_t *)&cmd_set_vf_rxmode,
        (cmdline_parse_inst_t *)&cmd_vf_rate_limit,
-#endif
        (cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter,
        (cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
        (cmdline_parse_inst_t *)&cmd_set_vf_promisc,
@@ -13761,6 +13994,7 @@ cmdline_parse_ctx_t main_ctx[] = {
        (cmdline_parse_inst_t *)&cmd_tc_min_bw,
        (cmdline_parse_inst_t *)&cmd_ddp_add,
        (cmdline_parse_inst_t *)&cmd_ddp_get_list,
+       (cmdline_parse_inst_t *)&cmd_ddp_get_info,
        (cmdline_parse_inst_t *)&cmd_show_vf_stats,
        (cmdline_parse_inst_t *)&cmd_clear_vf_stats,
        (cmdline_parse_inst_t *)&cmd_ptype_mapping_get,