HI, I see all the other RTE_BE32 and RTE_BE16 are used for constant values. I think it is not necessary to fix them:
In app/test-flow-perf/items_gen.c: .hdr.vlan_tci = RTE_BE16(VLAN_VALUE), .hdr.vlan_tci = RTE_BE16(0xffff), ipv4_masks[ti].hdr.src_addr = RTE_BE32(0xffffffff); .protocol = RTE_BE16(RTE_ETHER_TYPE_TEB), .protocol = RTE_BE16(0xffff), .hdr.teid = RTE_BE32(TEID_VALUE), .hdr.teid = RTE_BE32(0xffffffff), .data = RTE_BE32(META_DATA), .data = RTE_BE32(0xffffffff), .data = RTE_BE32(META_DATA), .data = RTE_BE32(0xffffffff), In app/test-flow-perf/actions_gen.c: .data = RTE_BE32(META_DATA), .mask = RTE_BE32(0xffffffff), .data = RTE_BE32(META_DATA), .mask = RTE_BE32(0xffffffff), eth_hdr.ether_type = RTE_BE16(RTE_ETHER_TYPE_VLAN); eth_hdr.ether_type = RTE_BE16(RTE_ETHER_TYPE_IPV4); eth_hdr.ether_type = RTE_BE16(RTE_ETHER_TYPE_IPV6); vlan_hdr.eth_proto = RTE_BE16(RTE_ETHER_TYPE_IPV4); vlan_hdr.eth_proto = RTE_BE16(RTE_ETHER_TYPE_IPV6); udp_hdr.dst_port = RTE_BE16(RTE_VXLAN_DEFAULT_PORT); udp_hdr.dst_port = RTE_BE16(RTE_VXLAN_GPE_UDP_PORT); udp_hdr.dst_port = RTE_BE16(RTE_GENEVE_UDP_PORT); udp_hdr.dst_port = RTE_BE16(RTE_GTPU_UDP_PORT); gre_hdr.proto = RTE_BE16(RTE_ETHER_TYPE_TEB); item_udp.hdr.dst_port = RTE_BE16(RTE_VXLAN_DEFAULT_PORT); On Mon, Mar 27, 2023 at 6:29 PM Wisam Monther <wis...@nvidia.com> wrote: > > Hi, > > > -----Original Message----- > > From: Harold Huang <baymaxhu...@gmail.com> > > Sent: Sunday, March 12, 2023 4:00 AM > > To: dev@dpdk.org > > Cc: Harold Huang <baymaxhu...@gmail.com>; Wisam Monther > > <wis...@nvidia.com> > > Subject: [PATCH] app/flow-perf: replace RTE_BE32/16 with > > rte_cpu_to_be_32/16 for variables > > > > In DPDK, the macros RTE_BE32 or RTE_BE16 are usually used for constant > > values. And functions such as rte_cpu_to_be_32 or > > rte_cpu_to_be_16 are optimized for variables. > > > > Signed-off-by: Harold Huang <baymaxhu...@gmail.com> > > --- > > app/test-flow-perf/actions_gen.c | 28 ++++++++++++++-------------- > > app/test-flow-perf/items_gen.c | 2 +- > > 2 files changed, 15 insertions(+), 15 deletions(-) > > > > Indeed your change is in the correct files and I agree that it's need to be > done, > But you are not doing it for all RTE_BE32 and RTE_BE16 in the app or the same > files > > After quick search I see: > app/test-flow-perf/items_gen.c:12 > app/test-flow-perf/actions_gen.c:29 > > While you are doing the change only for: > app/test-flow-perf/items_gen.c:1 > app/test-flow-perf/actions_gen.c:14 > > Can you please extend your fix for all needed vars. > > BRs, > Wisam Jaddo -- Thanks, Harold.