From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Subject: Re: [PATCH v3 1/2] app/testpmd: add VXLAN encap/decap support Date: Tue, 19 Jun 2018 11:40:25 +0200 Message-ID: <20180619094025.7rfomfrqbb7yq335@laranjeiro-vm.dev.6wind.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: "dev@dpdk.org" , Adrien Mazarguil , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , Mohammad Abdul Awal To: Ori Kam Return-path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id E66FA2C15 for ; Tue, 19 Jun 2018 11:40:16 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id l10-v6so19832925wrn.2 for ; Tue, 19 Jun 2018 02:40:16 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Jun 19, 2018 at 07:09:28AM +0000, Ori Kam wrote: > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nelio Laranjeiro > > Signed-off-by: Nelio Laranjeiro > > --- > > app/test-pmd/cmdline.c | 129 ++++++++++++++++++ > > app/test-pmd/cmdline_flow.c | 139 ++++++++++++++++++++ > > app/test-pmd/testpmd.c | 17 +++ > > app/test-pmd/testpmd.h | 17 +++ > > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 13 ++ > > 5 files changed, 315 insertions(+) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > > index 27e2aa8c8..93573606f 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > +static void cmd_set_vxlan_parsed(void *parsed_result, > > + __attribute__((unused)) struct cmdline *cl, > > + __attribute__((unused)) void *data) > > +{ > > + struct cmd_set_vxlan_result *res = parsed_result; > > + uint32_t vni = rte_cpu_to_be_32(res->vni) >> 8; > > Is this also correct in case of big endian system? > I think it will remove part of the vni. > > > + > > + if (strcmp(res->vxlan, "vxlan") == 0) > > + vxlan_encap_conf.select_vlan = 0; > > + else if (strcmp(res->vxlan, "vxlan-with-vlan") == 0) > > + vxlan_encap_conf.select_vlan = 1; > > + if (strcmp(res->ip_version, "ipv4") == 0) > > + vxlan_encap_conf.select_ipv4 = 1; > > + else if (strcmp(res->ip_version, "ipv6") == 0) > > + vxlan_encap_conf.select_ipv4 = 0; > > + else > > + return; > > + memcpy(vxlan_encap_conf.vni, &vni, 3); > > I don't think this line is correct when running on big endian system. Yes, this is wrong, it will be fixed in v4. Thanks, -- Nélio Laranjeiro 6WIND