app/testpmd: fix Tx metadata show command

Message ID 1548170203-49547-1-git-send-email-dekelp@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: fix Tx metadata show command |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Dekel Peled Jan. 22, 2019, 3:16 p.m. UTC
  Function cmd_config_tx_metadata_specific_parsed() takes input value,
applies rte_cpu_to_be_32() on it, and stores it for Tx use.
Function cmd_show_tx_metadata_parsed() displays the stored value as is.

This patch modifies function cmd_show_tx_metadata_parsed(), to apply
rte_be_to_cpu_32() on the stored value before displaying it.

Fixes: c18feafa193c ("app/testpmd: support metadata as flow rule item")
Cc: dekelp@mellanox.com
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit Jan. 23, 2019, 3:08 p.m. UTC | #1
On 1/22/2019 3:16 PM, Dekel Peled wrote:
> Function cmd_config_tx_metadata_specific_parsed() takes input value,
> applies rte_cpu_to_be_32() on it, and stores it for Tx use.
> Function cmd_show_tx_metadata_parsed() displays the stored value as is.
> 
> This patch modifies function cmd_show_tx_metadata_parsed(), to apply
> rte_be_to_cpu_32() on the stored value before displaying it.
> 
> Fixes: c18feafa193c ("app/testpmd: support metadata as flow rule item")
> Cc: dekelp@mellanox.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 3ddc3e0..51704b5 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -18455,7 +18455,7 @@  struct cmd_show_tx_metadata_result {
 	}
 	if (!strcmp(res->cmd_keyword, "tx_metadata")) {
 		printf("Port %u tx_metadata: %u\n", res->cmd_pid,
-				ports[res->cmd_pid].tx_metadata);
+			rte_be_to_cpu_32(ports[res->cmd_pid].tx_metadata));
 	}
 }