'spec's and 'mask's should be printed in a same byte order.

Fixes: daf90186e291 ("netdev-dpdk: add debug for rte flow patterns")
Signed-off-by: Ilya Maximets <i.maxim...@samsung.com>
---
 lib/netdev-rte-offloads.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/netdev-rte-offloads.c b/lib/netdev-rte-offloads.c
index b945b3243..e9ab08624 100644
--- a/lib/netdev-rte-offloads.c
+++ b/lib/netdev-rte-offloads.c
@@ -146,7 +146,7 @@ dump_flow_pattern(struct rte_flow_item *item)
                           "type=0x%04"PRIx16"\n",
                           ETH_ADDR_BYTES_ARGS(eth_mask->src.addr_bytes),
                           ETH_ADDR_BYTES_ARGS(eth_mask->dst.addr_bytes),
-                          eth_mask->type);
+                          ntohs(eth_mask->type));
         } else {
             ds_put_cstr(&s, "  Mask = null\n");
         }
@@ -224,8 +224,8 @@ dump_flow_pattern(struct rte_flow_item *item)
             ds_put_format(&s,
                           "  Mask: src_port=0x%"PRIx16
                           ", dst_port=0x%"PRIx16"\n",
-                          udp_mask->hdr.src_port,
-                          udp_mask->hdr.dst_port);
+                          ntohs(udp_mask->hdr.src_port),
+                          ntohs(udp_mask->hdr.dst_port));
         } else {
             ds_put_cstr(&s, "  Mask = null\n");
         }
@@ -248,8 +248,8 @@ dump_flow_pattern(struct rte_flow_item *item)
             ds_put_format(&s,
                           "  Mask: src_port=0x%"PRIx16
                           ", dst_port=0x%"PRIx16"\n",
-                          sctp_mask->hdr.src_port,
-                          sctp_mask->hdr.dst_port);
+                          ntohs(sctp_mask->hdr.src_port),
+                          ntohs(sctp_mask->hdr.dst_port));
         } else {
             ds_put_cstr(&s, "  Mask = null\n");
         }
@@ -299,8 +299,8 @@ dump_flow_pattern(struct rte_flow_item *item)
             ds_put_format(&s,
                           "  Mask: src_port=%"PRIx16", dst_port=%"PRIx16
                           ", data_off=0x%"PRIx8", tcp_flags=0x%"PRIx8"\n",
-                          tcp_mask->hdr.src_port,
-                          tcp_mask->hdr.dst_port,
+                          ntohs(tcp_mask->hdr.src_port),
+                          ntohs(tcp_mask->hdr.dst_port),
                           tcp_mask->hdr.data_off,
                           tcp_mask->hdr.tcp_flags);
         } else {
-- 
2.17.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to