DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/3] app/testpmd: move parser after flow_ctrl declarations
Date: Tue, 24 Jun 2014 15:06:51 +0200	[thread overview]
Message-ID: <1403615212-26605-3-git-send-email-david.marchand@6wind.com> (raw)
In-Reply-To: <1403615212-26605-1-git-send-email-david.marchand@6wind.com>

Prepare for next commit.

Signed-off-by: David Marchand <david.marchand@6wind.com>
---
 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

  parent reply	other threads:[~2014-06-24 13:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 13:06 [dpdk-dev] [PATCH 0/3] fix flow control in testpmd David Marchand
2014-06-24 13:06 ` [dpdk-dev] [PATCH 1/3] app/testpmd: add missing autoneg field to set flow_ctrl David Marchand
2014-06-24 13:06 ` David Marchand [this message]
2014-06-24 13:06 ` [dpdk-dev] [PATCH 3/3] app/testpmd: allow to set part of flow control parameters David Marchand
2014-06-27  0:59 ` [dpdk-dev] [PATCH 0/3] fix flow control in testpmd Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403615212-26605-3-git-send-email-david.marchand@6wind.com \
    --to=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).