From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 170E0A0C53; Wed, 3 Nov 2021 13:59:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 982824115A; Wed, 3 Nov 2021 13:59:54 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id B094941149 for ; Wed, 3 Nov 2021 13:59:53 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10156"; a="230207743" X-IronPort-AV: E=Sophos;i="5.87,205,1631602800"; d="scan'208";a="230207743" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2021 05:59:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,205,1631602800"; d="scan'208";a="728919857" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.27]) by fmsmga006.fm.intel.com with ESMTP; 03 Nov 2021 05:59:51 -0700 From: Ferruh Yigit To: dev@dpdk.org Cc: Ferruh Yigit , Thomas Monjalon , Stephen Hemminger Date: Wed, 3 Nov 2021 12:59:50 +0000 Message-Id: <20211103125950.3895442-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] kni: update kernel API to set random MAC address X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Previously used 'random_ether_addr()' API is removed in upstream kernel with commit Commit ba530fea8ca1 ("ethernet: remove random_ether_addr()") Replacement API 'eth_random_addr()' is around since v3.6 [1], so simply switching to this API without any version checks. [1] 0a4dd594982a ("etherdevice: Rename random_ether_addr to eth_random_addr") Signed-off-by: Ferruh Yigit --- kernel/linux/kni/kni_misc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c index 2b464c438113..f4944e1ddf33 100644 --- a/kernel/linux/kni/kni_misc.c +++ b/kernel/linux/kni/kni_misc.c @@ -399,11 +399,8 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num, if (is_valid_ether_addr(dev_info.mac_addr)) memcpy(net_dev->dev_addr, dev_info.mac_addr, ETH_ALEN); else - /* - * Generate random mac address. eth_random_addr() is the - * newer version of generating mac address in kernel. - */ - random_ether_addr(net_dev->dev_addr); + /* Generate random MAC address. */ + eth_random_addr(net_dev->dev_addr); if (dev_info.mtu) net_dev->mtu = dev_info.mtu; -- 2.31.1