From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf Date: Sun, 13 Mar 2016 13:01:05 +0100 Message-ID: <3488408.ByHyY3dxP7@xps13> References: <1456821665-21831-1-git-send-email-xutao.sun@intel.com> <1457579162-18170-1-git-send-email-jingjing.wu@intel.com> <1457579162-18170-2-git-send-email-jingjing.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, helin.zhang@intel.com, Jijiang Liu To: Jingjing Wu , xutao.sun@intel.com Return-path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id D10FE2C62 for ; Sun, 13 Mar 2016 13:02:27 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id l68so72873653wml.0 for ; Sun, 13 Mar 2016 05:02:27 -0700 (PDT) In-Reply-To: <1457579162-18170-2-git-send-email-jingjing.wu@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-03-10 11:05, Jingjing Wu: > From: Xutao Sun > > 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()