From patchwork Fri Sep 16 16:26:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 15901 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id E1D158D91; Fri, 16 Sep 2016 18:29:01 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id AB21B2B84 for ; Fri, 16 Sep 2016 18:28:59 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 16 Sep 2016 09:28:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,345,1470726000"; d="scan'208";a="169525828" Received: from sivswdev02.ir.intel.com (HELO localhost.localdomain) ([10.237.217.46]) by fmsmga004.fm.intel.com with ESMTP; 16 Sep 2016 09:28:59 -0700 From: Ferruh Yigit To: dev@dpdk.org Cc: Ferruh Yigit Date: Fri, 16 Sep 2016 17:26:45 +0100 Message-Id: <1474043212-15663-13-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1473954405-7150-1-git-send-email-ferruh.yigit@intel.com> References: <1473954405-7150-1-git-send-email-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v2 12/19] kni: prefer ether_addr_copy to memcpy 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Ferruh Yigit --- lib/librte_eal/linuxapp/kni/compat.h | 4 ++++ lib/librte_eal/linuxapp/kni/kni_misc.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/kni/compat.h b/lib/librte_eal/linuxapp/kni/compat.h index d79d626..9ae50a7 100644 --- a/lib/librte_eal/linuxapp/kni/compat.h +++ b/lib/librte_eal/linuxapp/kni/compat.h @@ -26,6 +26,10 @@ #define HAVE_CHANGE_CARRIER_CB #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) +#define ether_addr_copy(dst, src) memcpy(dst, src, ETH_ALEN) +#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) #define HAVE_IOV_ITER_MSGHDR #endif diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c index 61a387e..53f2dfd 100644 --- a/lib/librte_eal/linuxapp/kni/kni_misc.c +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c @@ -527,7 +527,7 @@ kni_ioctl_create(struct net *net, pci_dev_put(pci); if (kni->lad_dev) - memcpy(net_dev->dev_addr, kni->lad_dev->dev_addr, ETH_ALEN); + ether_addr_copy(net_dev->dev_addr, kni->lad_dev->dev_addr); else /* * Generate random mac address. eth_random_addr() is the newer