From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1D74542808; Mon, 27 Mar 2023 14:32:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EFF4940EE1; Mon, 27 Mar 2023 14:32:40 +0200 (CEST) Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) by mails.dpdk.org (Postfix) with ESMTP id 43B0840ED8 for ; Mon, 27 Mar 2023 14:32:39 +0200 (CEST) Received: by mail-oi1-f181.google.com with SMTP id y184so6184654oiy.8 for ; Mon, 27 Mar 2023 05:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679920358; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Tn+JfnwP0gkQ/7A4tRyth9fE97is4SJh5RYPc1Ga7Kg=; b=dfzcHa6sYkGCtEOas3c8D6dzeMQpeIz4mS8xgYmsChYnihHcJSUupR0qixKob6pUOa Vbyxk0InPJq/DJje3/3b3g4jOk/EevkLryMgNyjNCY7iSrDMtFjkReMZQ8kGAWWqtmO/ +U4AIJ1CMA8OK19M7TvDBzraR/taKSn6igj6SDH/6WppyvNoP/Pe/mNVTwu66WIH2qZq 5QArml2gCTvHu4kIH5mBm5iWgISInOj5xTWNSfL8LuDWYkXZRYYxMipbPvYF6FwDHaNS K6pRYmOqKebiR0rrpe002umdQgmR3U/x9oeKkLHPTHJhHv9kevm4BQXXN+351IvL8dhF Dnfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679920358; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tn+JfnwP0gkQ/7A4tRyth9fE97is4SJh5RYPc1Ga7Kg=; b=zSGBHG4J2mVe9chtPdbTtORgCoWwKGS7F3VIKupam38dERRPJBPBp+StorCtF7GX4d sM1hLTPNfW7/ErOLdvST45qjLlAvIXUGhhmnHmumSXWZkbLT7+NdWT2azWEHYyxzcBKS Hann3Kfu9VfZJv332vnv5t92YOj60q44HoI3M1lLxv+FxmKm83qK/D5nxENWUmnuNvP3 Hzp7BX3Gdq3owrhYhXhDqwCoaqxmz2zs78lbRYlhdGp8SPLPtDq1QuH7XiRvrv1nPXWX TjfMX4POObV2fmgbUFY011BTSNafdZbUXXc61NqUN6Wt27RWh2xt/rQbrsu0qrAkNccN ZuSQ== X-Gm-Message-State: AO0yUKWFrAFaSIRkpv652r41/Gqfi7w7xL5a4/3ciRDrXcg+Qg1pJjVl wuS1BaVlIb01f/uv9cJQVaMbnQT38wNx/UXbIfE= X-Google-Smtp-Source: AK7set86bq+4g9bQEmsUZ7ZUGqzu8I5seSMEhKIUDDqTbRFXpRCwSnvrkFYwj8MnnsPGeYbZFXbE22MoCGvEfQw7kQ8= X-Received: by 2002:aca:bbd7:0:b0:387:2586:17bd with SMTP id l206-20020acabbd7000000b00387258617bdmr2875276oif.6.1679920358379; Mon, 27 Mar 2023 05:32:38 -0700 (PDT) MIME-Version: 1.0 References: <20230312020009.288-1-baymaxhuang@gmail.com> In-Reply-To: From: Harold Huang Date: Mon, 27 Mar 2023 20:32:27 +0800 Message-ID: Subject: Re: [PATCH] app/flow-perf: replace RTE_BE32/16 with rte_cpu_to_be_32/16 for variables To: Wisam Monther Cc: "dev@dpdk.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 =3D RTE_BE16(VLAN_VALUE), .hdr.vlan_tci =3D RTE_BE16(0xffff), ipv4_masks[ti].hdr.src_addr =3D RTE_BE32(0xffffffff); .protocol =3D RTE_BE16(RTE_ETHER_TYPE_TEB), .protocol =3D RTE_BE16(0xffff), .hdr.teid =3D RTE_BE32(TEID_VALUE), .hdr.teid =3D RTE_BE32(0xffffffff), .data =3D RTE_BE32(META_DATA), .data =3D RTE_BE32(0xffffffff), .data =3D RTE_BE32(META_DATA), .data =3D RTE_BE32(0xffffffff), In app/test-flow-perf/actions_gen.c: .data =3D RTE_BE32(META_DATA), .mask =3D RTE_BE32(0xffffffff), .data =3D RTE_BE32(META_DATA), .mask =3D RTE_BE32(0xffffffff), eth_hdr.ether_type =3D RTE_BE16(RTE_ETHER_TYPE_VLAN); eth_hdr.ether_type =3D RTE_BE16(RTE_ETHER_TYPE_IPV4); eth_hdr.ether_type =3D RTE_BE16(RTE_ETHER_TYPE_IPV6); vlan_hdr.eth_proto =3D RTE_BE16(RTE_ETHER_TYPE_IPV4); vlan_hdr.eth_proto =3D RTE_BE16(RTE_ETHER_TYPE_IPV6); udp_hdr.dst_port =3D RTE_BE16(RTE_VXLAN_DEFAULT_PORT); udp_hdr.dst_port =3D RTE_BE16(RTE_VXLAN_GPE_UDP_PORT); udp_hdr.dst_port =3D RTE_BE16(RTE_GENEVE_UDP_PORT); udp_hdr.dst_port =3D RTE_BE16(RTE_GTPU_UDP_PORT); gre_hdr.proto =3D RTE_BE16(RTE_ETHER_TYPE_TEB); item_udp.hdr.dst_port =3D RTE_BE16(RTE_VXLAN_DEFAULT_PORT); On Mon, Mar 27, 2023 at 6:29=E2=80=AFPM Wisam Monther w= rote: > > Hi, > > > -----Original Message----- > > From: Harold Huang > > Sent: Sunday, March 12, 2023 4:00 AM > > To: dev@dpdk.org > > Cc: Harold Huang ; Wisam Monther > > > > 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 > > --- > > 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 --=20 Thanks, Harold.