DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: "Wei Hu (Xavier)" <huwei013@chinasoftinc.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 2/3] app/testpmd: fix the initial value when setting PFC
Date: Tue, 4 Feb 2020 18:25:12 +0000	[thread overview]
Message-ID: <5e339e58-4500-9086-755e-1615d2a1eafa@intel.com> (raw)
In-Reply-To: <629696ac-7d70-c962-d126-b74b86776605@intel.com>

On 1/28/2020 11:21 AM, Ferruh Yigit wrote:
> On 1/21/2020 11:44 AM, Wei Hu (Xavier) wrote:
>> From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
>>
>> Currently, the initial values of the local structure variable named
>> rx_tx_onoff_2_lfc_mode and rx_tx_onoff_2_pfc_mode are different in the
>> similar part of these two following functions:
>> 	cmd_link_flow_ctrl_set_parsed
>> 	cmd_priority_flow_ctrl_set_parsed
>> 1) The code snippset in cmd_link_flow_ctrl_set_parsed function:
>> 	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}
>> 	};
>>
>> 	if (!cmd || cmd == &cmd_link_flow_control_set_rx)
>> 		rx_fc_en = (!strcmp(res->rx_lfc_mode, "on")) ? 1 : 0;
>> 	if (!cmd || cmd == &cmd_link_flow_control_set_tx)
>> 		tx_fc_en = (!strcmp(res->tx_lfc_mode, "on")) ? 1 : 0;
>>
>> 	fc_conf.mode = rx_tx_onoff_2_lfc_mode[rx_fc_en][tx_fc_en];
>> 	<...>
>> 	ret = rte_eth_dev_flow_ctrl_set(res->port_id, &fc_conf);
>> 	<...>
>> 2) The code snippset in cmd_priority_flow_ctrl_set_parsed function:
>> 	static enum rte_eth_fc_mode rx_tx_onoff_2_pfc_mode[2][2] = {
>> 	    {RTE_FC_NONE, RTE_FC_RX_PAUSE}, {RTE_FC_TX_PAUSE, RTE_FC_FULL}
>> 	};
>>
>> 	rx_fc_enable = (!strncmp(res->rx_pfc_mode, "on",2)) ? 1 : 0;
>> 	tx_fc_enable = (!strncmp(res->tx_pfc_mode, "on",2)) ? 1 : 0;
>> 	pfc_conf.fc.mode =
>> 		 rx_tx_onoff_2_pfc_mode[rx_fc_enable][tx_fc_enable];
>> 	<...>
>> 	ret = rte_eth_dev_priority_flow_ctrl_set(res->port_id, &pfc_conf);
>> 	<...>
>> The initial value of rx_tx_onoff_2_pfc_mode is wrong, it should be the
>> same as rx_tx_onoff_2_lfc_mode.
>>
>> Fixes: 9b53e542e9e1 ("app/testpmd: add priority flow control")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>> Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
>> Signed-off-by: Xuan Li <lixuan47@hisilicon.com>
> 
> Not tested but looks reasonable from the code, it would be nice if someone can
> test it.
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 

Applied to dpdk-next-net/master, thanks.

  reply	other threads:[~2020-02-04 18:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21 11:44 [dpdk-dev] [PATCH 0/3] app/testpmd: fixes for testpmd application Wei Hu (Xavier)
2020-01-21 11:44 ` [dpdk-dev] [PATCH 1/3] app/testpmd: update Rx offload after setting MTU sccessfully Wei Hu (Xavier)
2020-01-28 11:27   ` Ferruh Yigit
2020-02-12  0:25     ` Wei Hu (Xavier)
2020-02-13  1:52       ` Wei Hu (Xavier)
2020-01-21 11:44 ` [dpdk-dev] [PATCH 2/3] app/testpmd: fix the initial value when setting PFC Wei Hu (Xavier)
2020-01-28 11:21   ` Ferruh Yigit
2020-02-04 18:25     ` Ferruh Yigit [this message]
2020-01-21 11:44 ` [dpdk-dev] [PATCH 3/3] app/testpmd: fix uninitialized members " Wei Hu (Xavier)
2020-01-28 11:21   ` Ferruh Yigit
2020-02-04 18:25     ` Ferruh Yigit
2020-02-04 18:24 ` [dpdk-dev] [PATCH 0/3] app/testpmd: fixes for testpmd application Ferruh Yigit

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=5e339e58-4500-9086-755e-1615d2a1eafa@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=huwei013@chinasoftinc.com \
    /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).