From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=Ny1fN83jD15qjoWG7taJXJynhNgtbpJh0Y6Z8Ay5994=; b=emAco6CKV5Wy1phWZAsuBmsHgc9U7yrGMJhw3HX+Qb8IOKW5oBQYII5Ub/RQsQSOM9 osy7Pmvrn3252Z7PFmXOvbQRrIjAjBthtX5jW8nf661VVf9xJLSTMDXM67buNnDcjocU CfSEMb0FYLF/K/T6PWCwkaq74j7pefxi68rjNnH1aPk6vMz1qu1EOS1jFEhpl4UdFBaI Ys63yp7OA4wArTHMTTt65J3KMEqXA8MMfrWM115jh0dR5IczR3cBkOJQ5dzC7A798/DH wqMtWg5Vi3Kxp+dVajN0fURp+2kjpdObJ5S7+ImNurkaBEr6zHZ65TMZlRZS38X1yR+U iK2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=Ny1fN83jD15qjoWG7taJXJynhNgtbpJh0Y6Z8Ay5994=; b=VOELKx2ncfrNfeH9/3ZeFkOPzgab4uQelYV940Ecp5G1X0rslSgL3GMk9WAbHPC2IE +548U6Mg9G3YZnC2V651Ue219XRv0byXrHhLxmb1Zl1rKOTDunW/pA8ZnjBBM984Pa/o 80Q04+cdV6VU85Ygb3kK7HbVCVhqq7yesJ3GZHfnoOnUbhGaxncte3a98TZfp80XHwws KNyEwpWbdsqDf3gk7ArlmUsuSloDMUoIjqgPu5Lt7xCQ6e87MsrS9gJryXNfKLAdVtOY HfRb8JrRvWb6JMCOwHBLuG6A8FaboVDIGayc1I+eesQAVeUUU0dlJZl9KTnLtc/oqNMX GvUg== X-Gm-Message-State: AD7BkJJFDLpJ+bjzZiaVeIBLNQzvqpoiKk2rm/ltffJfhmRROElQHlhd9srU1AXCKFVVnqmS X-Received: by 10.28.51.74 with SMTP id z71mr12020158wmz.15.1457870547650; Sun, 13 Mar 2016 05:02:27 -0700 (PDT) Received: from xps13.localnet (91.111.75.86.rev.sfr.net. [86.75.111.91]) by smtp.gmail.com with ESMTPSA id et11sm17411033wjc.30.2016.03.13.05.02.26 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 13 Mar 2016 05:02:26 -0700 (PDT) From: Thomas Monjalon To: Jingjing Wu , xutao.sun@intel.com Cc: dev@dpdk.org, helin.zhang@intel.com, Jijiang Liu Date: Sun, 13 Mar 2016 13:01:05 +0100 Message-ID: <3488408.ByHyY3dxP7@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1457579162-18170-2-git-send-email-jingjing.wu@intel.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 12:02:28 -0000 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()