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 308DCA04A3 for ; Fri, 17 Dec 2021 16:54:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2678B40040; Fri, 17 Dec 2021 16:54:23 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 529BF40040 for ; Fri, 17 Dec 2021 16:54:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639756462; x=1671292462; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=ugwcmO8xIQ9gFh5A3kPWiQ0iagzvdYx04huvVtIn+aU=; b=GqLtc8i6hp9x7IbA9bNjahHi83Ifm/1d/bCdVCc2HkcUOdT6GrCtnDhk 1nw4ZpO/mZmoX6xWpM0Lmho/ZNiGz0XJ5W6zVHJCHsQTB6PHL9DbKFtgw OYok8VXcHggYcHhs3wV8NqyVX3UYZBQj01gPoVWfGBk4rJpSOOsl4NvIM UMyyqN5GUqKsXuIVaxvumoctPZCjtRC5br6vkOHtvSrcaypPPHc+7M37j ppBisHVCvxMSfN5IDtD2yjr7mOLArCmWF03GR1PSgPol1bQESi+ZQg9RL bO7p0/pa+Z5xYHWseKaUCyFeP67XfZvEoDS7qTQDpC6yGcMziRLgD73Qi w==; X-IronPort-AV: E=McAfee;i="6200,9189,10201"; a="300550709" X-IronPort-AV: E=Sophos;i="5.88,213,1635231600"; d="scan'208";a="300550709" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2021 07:54:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,213,1635231600"; d="scan'208";a="483254207" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.27]) by orsmga002.jf.intel.com with ESMTP; 17 Dec 2021 07:54:08 -0800 From: Ferruh Yigit To: stable@dpdk.org Subject: [PATCH 19.11] kni: update kernel API to set random MAC address Date: Fri, 17 Dec 2021 15:54:04 +0000 Message-Id: <20211217155404.3259078-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org [ upstream commit e6cbfd9bf30bbc4170fe8c7c04a16d9cf795fb90 ] 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.33.1