From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 78025685D for ; Tue, 24 Jun 2014 15:06:51 +0200 (CEST) Received: by mail-wg0-f48.google.com with SMTP id n12so318056wgh.7 for ; Tue, 24 Jun 2014 06:07:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=9BaLgQhCIyebZR1p2LZ+RU4J9gFvbaifTut1U9/tR+I=; b=LP5RF3YJmZA+kJpIsAYiCx5M76hUVLY7PMFkzhGrTgrQprhc2wV3MssBn3+Iw+/MP4 Itsy6eBazcwD6PHNbLHdqIabdSi4kFiAWRySBMU9VpI0lg250+Q0VDJ+21o6J0UEuH6A ry2pNaoYHPSLqBr3U4h6qbSpbF+dHCdvbRDPlKkt1d2OzZkoD91NSFC4EDP+Qwg++5xS kqqWjLqtk3hM/y4V47+EYUadnQZt/2+9vU4a6rIJ1kdXFlCu1jhN3guMaDZobdUVEv1d 4N7JYpz3n2zSWeNdzuKBygj8HOsHDg7IN2mpqEQHVhahOP3cRs/tPMouPjoW7kE4btos BFrw== X-Gm-Message-State: ALoCoQl9c/DJKB9DamCJCnhwKds0fDN6/WRhg2gApxTP6iMuuekvi4P1CgXGOv+/3MM+lH9BWJgl X-Received: by 10.194.110.100 with SMTP id hz4mr1119255wjb.65.1403615228327; Tue, 24 Jun 2014 06:07:08 -0700 (PDT) Received: from alcyon.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id p3sm496257wjw.13.2014.06.24.06.07.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jun 2014 06:07:07 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Tue, 24 Jun 2014 15:06:51 +0200 Message-Id: <1403615212-26605-3-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1403615212-26605-1-git-send-email-david.marchand@6wind.com> References: <1403615212-26605-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH 2/3] app/testpmd: move parser after flow_ctrl declarations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2014 13:06:52 -0000 Prepare for next commit. Signed-off-by: David Marchand --- app/test-pmd/cmdline.c | 74 ++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 3d2a91a..8b85d4d 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -3823,43 +3823,6 @@ struct cmd_link_flow_ctrl_set_result { uint8_t port_id; }; -static void -cmd_link_flow_ctrl_set_parsed(void *parsed_result, - __attribute__((unused)) struct cmdline *cl, - __attribute__((unused)) void *data) -{ - struct cmd_link_flow_ctrl_set_result *res = parsed_result; - struct rte_eth_fc_conf fc_conf; - int rx_fc_enable, tx_fc_enable, mac_ctrl_frame_fwd; - int ret; - - /* - * Rx on/off, flow control is enabled/disabled on RX side. This can indicate - * the RTE_FC_TX_PAUSE, Transmit pause frame at the Rx side. - * Tx on/off, flow control is enabled/disabled on TX side. This can indicate - * the RTE_FC_RX_PAUSE, Respond to the pause frame at the Tx side. - */ - static enum rte_eth_fc_mode rx_tx_onoff_2_lfc_mode[2][2] = { - {RTE_FC_NONE, RTE_FC_TX_PAUSE}, {RTE_FC_RX_PAUSE, RTE_FC_FULL} - }; - - 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; - fc_conf.autoneg = (!strcmp(res->autoneg, "on")) ? 1 : 0; - - ret = rte_eth_dev_flow_ctrl_set(res->port_id, &fc_conf); - if (ret != 0) - printf("bad flow contrl parameter, return code = %d \n", ret); -} - cmdline_parse_token_string_t cmd_lfc_set_set = TOKEN_STRING_INITIALIZER(struct cmd_link_flow_ctrl_set_result, set, "set"); @@ -3932,6 +3895,43 @@ autoneg on|off port_id", }, }; +static void +cmd_link_flow_ctrl_set_parsed(void *parsed_result, + __attribute__((unused)) struct cmdline *cl, + __attribute__((unused)) void *data) +{ + struct cmd_link_flow_ctrl_set_result *res = parsed_result; + struct rte_eth_fc_conf fc_conf; + int rx_fc_enable, tx_fc_enable, mac_ctrl_frame_fwd; + int ret; + + /* + * Rx on/off, flow control is enabled/disabled on RX side. This can indicate + * the RTE_FC_TX_PAUSE, Transmit pause frame at the Rx side. + * Tx on/off, flow control is enabled/disabled on TX side. This can indicate + * the RTE_FC_RX_PAUSE, Respond to the pause frame at the Tx side. + */ + static enum rte_eth_fc_mode rx_tx_onoff_2_lfc_mode[2][2] = { + {RTE_FC_NONE, RTE_FC_TX_PAUSE}, {RTE_FC_RX_PAUSE, RTE_FC_FULL} + }; + + 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; + fc_conf.autoneg = (!strcmp(res->autoneg, "on")) ? 1 : 0; + + ret = rte_eth_dev_flow_ctrl_set(res->port_id, &fc_conf); + if (ret != 0) + printf("bad flow contrl parameter, return code = %d \n", ret); +} + /* *** SETUP ETHERNET PIRORITY FLOW CONTROL *** */ struct cmd_priority_flow_ctrl_set_result { cmdline_fixed_string_t set; -- 1.7.10.4