DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wei Hu (Xavier)" <huwei013@chinasoftinc.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 3/3] app/testpmd: fix uninitialized members when setting PFC
Date: Tue, 21 Jan 2020 19:44:33 +0800	[thread overview]
Message-ID: <20200121114433.57543-4-huwei013@chinasoftinc.com> (raw)
In-Reply-To: <20200121114433.57543-1-huwei013@chinasoftinc.com>

From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>

Only a part of members in the local structure variable named pfc_conf are
initialized in the function named cmd_priority_flow_ctrl_set_parsed when
typing "set pfc_ctrl..." command, and others are random values. However,
those uninitialized members may cause failure.

This patch adds clearing zero operation before calling the API named
rte_eth_dev_priority_flow_ctrl_set API with pfc_conf as the input
parameter.

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>
---
 app/test-pmd/cmdline.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index a09cb87e1..b6d8ef0f0 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -7090,6 +7090,7 @@ cmd_priority_flow_ctrl_set_parsed(void *parsed_result,
 		{RTE_FC_NONE, RTE_FC_TX_PAUSE}, {RTE_FC_RX_PAUSE, RTE_FC_FULL}
 	};
 
+	memset(&pfc_conf, 0, sizeof(struct rte_eth_pfc_conf));
 	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];
-- 
2.23.0


  parent reply	other threads:[~2020-01-21 11:45 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
2020-01-21 11:44 ` Wei Hu (Xavier) [this message]
2020-01-28 11:21   ` [dpdk-dev] [PATCH 3/3] app/testpmd: fix uninitialized members " 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=20200121114433.57543-4-huwei013@chinasoftinc.com \
    --to=huwei013@chinasoftinc.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).