All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Jingjing Wu <jingjing.wu@intel.com>, xutao.sun@intel.com
Cc: dev@dpdk.org, helin.zhang@intel.com, Jijiang Liu <jijiang.liu@intel.com>
Subject: Re: [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf
Date: Sun, 13 Mar 2016 13:01:05 +0100	[thread overview]
Message-ID: <3488408.ByHyY3dxP7@xps13> (raw)
In-Reply-To: <1457579162-18170-2-git-send-email-jingjing.wu@intel.com>

2016-03-10 11:05, Jingjing Wu:
> From: Xutao Sun <xutao.sun@intel.com>
> 
> Change the fields of outer_mac and inner_mac in struct
> rte_eth_tunnel_filter_conf from pointer to struct in order to
> keep the code's readability.

It breaks compilation of examples/tep_termination.

> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -6628,8 +6628,10 @@ cmd_tunnel_filter_parsed(void *parsed_result,
>  	struct rte_eth_tunnel_filter_conf tunnel_filter_conf;
>  	int ret = 0;
>  
> -	tunnel_filter_conf.outer_mac = &res->outer_mac;
> -	tunnel_filter_conf.inner_mac = &res->inner_mac;
> +	rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac,
> +			ETHER_ADDR_LEN);
> +	rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac,
> +			ETHER_ADDR_LEN);

Please use ether_addr_copy().

> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -5839,10 +5839,10 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf,
>  	}
>  	pfilter = cld_filter;
>  
> -	(void)rte_memcpy(&pfilter->outer_mac, tunnel_filter->outer_mac,
> -			sizeof(struct ether_addr));
> -	(void)rte_memcpy(&pfilter->inner_mac, tunnel_filter->inner_mac,
> -			sizeof(struct ether_addr));
> +	(void)rte_memcpy(&pfilter->outer_mac, &tunnel_filter->outer_mac,
> +			ETHER_ADDR_LEN);
> +	(void)rte_memcpy(&pfilter->inner_mac, &tunnel_filter->inner_mac,
> +			ETHER_ADDR_LEN);

As already commented in January, please stop this useless return cast.

There is a dedicated function to copy MAC addresses:
	ether_addr_copy()

  reply	other threads:[~2016-03-13 12:02 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-25  7:25 [PATCH 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-01-25  7:25 ` [PATCH 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-01-25  7:25 ` [PATCH 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-01-25  7:25 ` [PATCH 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-01-25  7:25 ` [PATCH 4/4] app/test-pmd: test " Xutao Sun
2016-01-28  7:30 ` [PATCH v2 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-01-28  7:30   ` [PATCH v2 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-01-28  8:21     ` Thomas Monjalon
2016-01-28  9:05       ` Sun, Xutao
2016-01-28  7:30   ` [PATCH v2 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-01-28  7:30   ` [PATCH v2 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-01-28  7:30   ` [PATCH v2 4/4] app/test-pmd: test " Xutao Sun
2016-01-28 10:26   ` [PATCH v3 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-01-28 10:26     ` [PATCH v3 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-01-28 10:26     ` [PATCH v3 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-01-28 10:26     ` [PATCH v3 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-01-28 10:26     ` [PATCH v3 4/4] app/test-pmd: test " Xutao Sun
2016-02-12 13:46       ` De Lara Guarch, Pablo
2016-02-18  7:19         ` Sun, Xutao
2016-02-18  9:58     ` [PATCH v4 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-02-18  9:58       ` [PATCH v4 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-02-18  9:58       ` [PATCH v4 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-02-18  9:58       ` [PATCH v4 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-02-18  9:58       ` [PATCH v4 4/4] app/test-pmd: test " Xutao Sun
2016-02-18 12:16         ` De Lara Guarch, Pablo
2016-02-19  2:40           ` Sun, Xutao
2016-02-19  7:31       ` [PATCH v5 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-02-19  7:31         ` [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-02-25  1:22           ` Wu, Jingjing
2016-02-19  7:31         ` [PATCH v5 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-02-19  7:31         ` [PATCH v5 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-02-25  1:50           ` Wu, Jingjing
2016-02-19  7:31         ` [PATCH v5 4/4] app/test-pmd: test " Xutao Sun
2016-03-01  3:47         ` [PATCH v6 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-03-01  3:47           ` [PATCH v6 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-03-01  8:53             ` Panu Matilainen
2016-03-02  3:10               ` Sun, Xutao
2016-03-02  7:12                 ` Panu Matilainen
2016-03-01  3:47           ` [PATCH v6 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-03-01  3:47           ` [PATCH v6 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-03-01  3:47           ` [PATCH v6 4/4] app/test-pmd: test " Xutao Sun
2016-03-01  8:41           ` [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-03-01  8:41             ` [PATCH v7 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-03-08 23:08               ` Thomas Monjalon
2016-03-08 23:20                 ` Thomas Monjalon
2016-03-01  8:41             ` [PATCH v7 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-03-01  8:41             ` [PATCH v7 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-03-01  8:41             ` [PATCH v7 4/4] app/test-pmd: test " Xutao Sun
2016-03-02  7:04             ` [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Liu, Yong
2016-03-02  7:31             ` Wu, Jingjing
2016-03-10  3:05             ` [PATCH v8 0/4] This patch set adds " Jingjing Wu
2016-03-10  3:05               ` [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf Jingjing Wu
2016-03-13 12:01                 ` Thomas Monjalon [this message]
2016-03-10  3:06               ` [PATCH v8 2/4] lib/ether: add IP in GRE type Jingjing Wu
2016-03-10  3:06               ` [PATCH v8 3/4] driver/i40e: implement tunnel filter for IP in GRE Jingjing Wu
2016-03-10  3:06               ` [PATCH v8 4/4] app/test-pmd: test " Jingjing Wu
2016-03-13 14:18               ` [PATCH v8 0/4] This patch set adds tunnel filter support for IP in GRE on i40e Thomas Monjalon

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=3488408.ByHyY3dxP7@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jijiang.liu@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=xutao.sun@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.