DPDK patches and discussions
 help / color / mirror / Atom feed
From: Harold Huang <baymaxhuang@gmail.com>
To: Wisam Monther <wisamm@nvidia.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH] app/flow-perf: replace RTE_BE32/16 with rte_cpu_to_be_32/16 for variables
Date: Mon, 27 Mar 2023 20:32:27 +0800	[thread overview]
Message-ID: <CAHJXk3bhuysQU16gNf9qEDD5Y0Mr6j3MA9LQU6oGuZtth0teYg@mail.gmail.com> (raw)
In-Reply-To: <CH0PR12MB50251FEA4BE7D5DAC9D94892A48B9@CH0PR12MB5025.namprd12.prod.outlook.com>

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 <wisamm@nvidia.com> wrote:
>
> Hi,
>
> > -----Original Message-----
> > From: Harold Huang <baymaxhuang@gmail.com>
> > Sent: Sunday, March 12, 2023 4:00 AM
> > To: dev@dpdk.org
> > Cc: Harold Huang <baymaxhuang@gmail.com>; Wisam Monther
> > <wisamm@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 <baymaxhuang@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.

  reply	other threads:[~2023-03-27 12:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12  2:00 Harold Huang
2023-03-27 10:29 ` Wisam Monther
2023-03-27 12:32   ` Harold Huang [this message]
2023-04-18 11:32     ` Wisam Monther

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=CAHJXk3bhuysQU16gNf9qEDD5Y0Mr6j3MA9LQU6oGuZtth0teYg@mail.gmail.com \
    --to=baymaxhuang@gmail.com \
    --cc=dev@dpdk.org \
    --cc=wisamm@nvidia.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).