[dpdk-dev] [PATCH v3 1/2] app/testpmd: add VXLAN encap/decap support

Nélio Laranjeiro nelio.laranjeiro at 6wind.com
Tue Jun 19 11:40:25 CEST 2018


On Tue, Jun 19, 2018 at 07:09:28AM +0000, Ori Kam wrote:
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Nelio Laranjeiro
> > Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
> > ---
> >  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


More information about the dev mailing list