update Intel copyright years to 2014
[dpdk.git] / app / test-pmd / cmdline.c
index 4cd0127..062a233 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  * 
- *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
  *   All rights reserved.
  * 
  *   Redistribution and use in source and binary forms, with or without
@@ -233,6 +233,9 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "vlan set strip (on|off) (port_id)\n"
                        "    Set the VLAN strip on a port.\n\n"
 
+                       "vlan set stripq (on|off) (port_id,queue_id)\n"
+                       "    Set the VLAN strip for a queue on a port.\n\n"
+
                        "vlan set filter (on|off) (port_id)\n"
                        "    Set the VLAN filter on a port.\n\n"
 
@@ -312,7 +315,8 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "    Set the allmulti mode on port_id, or all.\n\n"
 
                        "set flow_ctrl rx (on|off) tx (on|off) (high_water)"
-                       " (low_water) (pause_time) (send_xon) (port_id)\n"
+                       " (low_water) (pause_time) (send_xon) mac_ctrl_frame_fwd"
+                        " (on|off) (port_id)\n"
                        "    Set the link flow control parameter on a port.\n\n"
 
                        "set pfc_ctrl rx (on|off) tx (on|off) (high_water)"
@@ -346,8 +350,8 @@ static void cmd_help_long_parsed(void *parsed_result,
                        " to pool 0.\n\n"
 
                        "set port (port_id) mirror-rule (rule_id)"
-                       "(uplink-mirror|downlink-mirror) dst-pool"
-                       "(pool_id) (on|off)\n"
+                       " (uplink-mirror|downlink-mirror) dst-pool"
+                       " (pool_id) (on|off)\n"
                        "   Set uplink or downlink type mirror rule on a port.\n"
                        "   e.g., 'set port 0 mirror-rule 0 uplink-mirror dst-pool"
                        " 0 on' enable mirror income traffic to pool 0.\n\n"
@@ -1279,7 +1283,7 @@ cmdline_parse_inst_t cmd_config_rss_reta = {
        },
 };
 
-/* *** SHOW PORT INFO *** */
+/* *** SHOW PORT RETA INFO *** */
 struct cmd_showport_reta {
        cmdline_fixed_string_t show;
        cmdline_fixed_string_t port;
@@ -2003,8 +2007,10 @@ cmd_vlan_offload_parsed(void *parsed_result,
                uint16_t queue_id = 0;
 
                /* No queue_id, return */
-               if(i + 1 >= len)
+               if(i + 1 >= len) {
+                       printf("must specify (port,queue_id)\n");
                        return;
+               }
                tmp = strtoul(str + i + 1, NULL, 0);
                /* If queue_id greater that what 16-bits can represent, return */
                if(tmp > 0xffff)
@@ -3361,6 +3367,8 @@ struct cmd_link_flow_ctrl_set_result {
        cmdline_fixed_string_t rx_lfc_mode;
        cmdline_fixed_string_t tx;
        cmdline_fixed_string_t tx_lfc_mode;
+       cmdline_fixed_string_t mac_ctrl_frame_fwd;
+       cmdline_fixed_string_t mac_ctrl_frame_fwd_mode;
        uint32_t high_water;
        uint32_t low_water;
        uint16_t pause_time;
@@ -3375,7 +3383,7 @@ cmd_link_flow_ctrl_set_parsed(void *parsed_result,
 {
        struct cmd_link_flow_ctrl_set_result *res = parsed_result;
        struct rte_eth_fc_conf fc_conf;
-       int rx_fc_enable, tx_fc_enable;
+       int rx_fc_enable, tx_fc_enable, mac_ctrl_frame_fwd;
        int ret;
 
        /*
@@ -3390,12 +3398,14 @@ cmd_link_flow_ctrl_set_parsed(void *parsed_result,
 
        rx_fc_enable = (!strcmp(res->rx_lfc_mode, "on")) ? 1 : 0;
        tx_fc_enable = (!strcmp(res->tx_lfc_mode, "on")) ? 1 : 0;
+       mac_ctrl_frame_fwd = (!strcmp(res->mac_ctrl_frame_fwd_mode, "on")) ? 1 : 0;
 
        fc_conf.mode       = rx_tx_onoff_2_lfc_mode[rx_fc_enable][tx_fc_enable];
        fc_conf.high_water = res->high_water;
        fc_conf.low_water  = res->low_water;
        fc_conf.pause_time = res->pause_time;
        fc_conf.send_xon   = res->send_xon;
+       fc_conf.mac_ctrl_frame_fwd = (uint8_t)mac_ctrl_frame_fwd;
 
        ret = rte_eth_dev_flow_ctrl_set(res->port_id, &fc_conf);
        if (ret != 0)
@@ -3432,6 +3442,12 @@ cmdline_parse_token_num_t cmd_lfc_set_pause_time =
 cmdline_parse_token_num_t cmd_lfc_set_send_xon =
        TOKEN_NUM_INITIALIZER(struct cmd_link_flow_ctrl_set_result,
                                send_xon, UINT16);
+cmdline_parse_token_string_t cmd_lfc_set_mac_ctrl_frame_fwd_mode =
+       TOKEN_STRING_INITIALIZER(struct cmd_link_flow_ctrl_set_result,
+                               mac_ctrl_frame_fwd, "mac_ctrl_frame_fwd");
+cmdline_parse_token_string_t cmd_lfc_set_mac_ctrl_frame_fwd =
+       TOKEN_STRING_INITIALIZER(struct cmd_link_flow_ctrl_set_result,
+                               mac_ctrl_frame_fwd_mode, "on#off");
 cmdline_parse_token_num_t cmd_lfc_set_portid =
        TOKEN_NUM_INITIALIZER(struct cmd_link_flow_ctrl_set_result,
                                port_id, UINT8);
@@ -3439,7 +3455,9 @@ cmdline_parse_token_num_t cmd_lfc_set_portid =
 cmdline_parse_inst_t cmd_link_flow_control_set = {
        .f = cmd_link_flow_ctrl_set_parsed,
        .data = NULL,
-       .help_str = "Configure the Ethernet link flow control...",
+       .help_str = "Configure the Ethernet flow control: set flow_ctrl rx on|off \
+tx on|off high_water low_water pause_time send_xon mac_ctrl_frame_fwd on|off \
+port_id",
        .tokens = {
                (void *)&cmd_lfc_set_set,
                (void *)&cmd_lfc_set_flow_ctrl,
@@ -3451,6 +3469,8 @@ cmdline_parse_inst_t cmd_link_flow_control_set = {
                (void *)&cmd_lfc_set_low_water,
                (void *)&cmd_lfc_set_pause_time,
                (void *)&cmd_lfc_set_send_xon,
+               (void *)&cmd_lfc_set_mac_ctrl_frame_fwd_mode,
+               (void *)&cmd_lfc_set_mac_ctrl_frame_fwd,
                (void *)&cmd_lfc_set_portid,
                NULL,
        },