DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Beilei Xing <beilei.xing@intel.com>, jingjing.wu@intel.com
Cc: wenzhuo.lu@intel.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix parsing tunnel filter issue
Date: Tue, 24 Jan 2017 15:17:30 +0000	[thread overview]
Message-ID: <04cedc82-acfa-63ab-c519-e295914e3f3e@intel.com> (raw)
In-Reply-To: <1485225867-116610-1-git-send-email-beilei.xing@intel.com>

On 1/24/2017 2:44 AM, Beilei Xing wrote:
> VNI of VXLAN is parsed wrongly. The root cause is that
> array vni in item VXLAN also uses network byte ordering.
> 
> Fixes: d416530e6358 ("net/i40e: parse tunnel filter")
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
>  drivers/net/i40e/i40e_flow.c | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
> index 76bb332..51b3223 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -1196,6 +1196,20 @@ i40e_check_tenant_id_mask(const uint8_t *mask)
>  	return is_masked;
>  }
>  
> +static uint32_t
> +i40e_flow_set_tenant_id(const uint8_t *vni)
> +{
> +	uint32_t tenant_id;
> +
> +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
> +	tenant_id = (vni[0] << 16) | (vni[1] << 8) | vni[2];
> +#else
> +	tenant_id = vni[0] | (vni[1] << 8) | (vni[2] << 16);
> +#endif

Instead of a new function, will following do the same?:

uint32_t tenant_id_be= 0;
rte_memcpy(((uint8_t *)&tenant_id_be + 1), vxlan_spec->vni, 3)
filter->tenant_id = rte_be_to_cpu(tenant_id_be);

I think it is easier to understand, what do you think?

Thanks,
ferruh

  parent reply	other threads:[~2017-01-24 15:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24  2:44 Beilei Xing
2017-01-24  2:58 ` Lu, Wenzhuo
2017-01-24 15:17 ` Ferruh Yigit [this message]
2017-02-06  1:38   ` Xing, Beilei
2017-02-06  5:29 ` [dpdk-dev] [PATCH v2] " Beilei Xing
2017-02-07 14:12   ` Ferruh Yigit

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=04cedc82-acfa-63ab-c519-e295914e3f3e@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=wenzhuo.lu@intel.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).