patch 'kni: update kernel API to set random MAC address' has been queued to stable release 20.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 18 13:39:31 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/20/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/2bc455ec39e1b2a2d949b926039311966b3317d7

Thanks.

Luca Boccassi

---
>From 2bc455ec39e1b2a2d949b926039311966b3317d7 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at intel.com>
Date: Wed, 3 Nov 2021 12:59:50 +0000
Subject: [PATCH] kni: update kernel API to set random MAC address

[ backported from 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 <ferruh.yigit at intel.com>
---
 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 c8da5805c0..cc5172fefc 100644
--- a/kernel/linux/kni/kni_misc.c
+++ b/kernel/linux/kni/kni_misc.c
@@ -403,11 +403,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.30.2



More information about the stable mailing list