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 7E3EDA0543 for ; Tue, 21 Jun 2022 10:13:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 847AC42B86; Tue, 21 Jun 2022 10:13:05 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2069.outbound.protection.outlook.com [40.107.237.69]) by mails.dpdk.org (Postfix) with ESMTP id 82B1F42B6E for ; Tue, 21 Jun 2022 10:13:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=egZVsw52vdNz4ik4Ts6SZEZsDqMgmoFvpr6SsIGNPAYrepzO17yXbRClLCDFkYp0jWto8ROCfIF/BU+7pjruZ3hORq7WXj/BMBjAp0aYILG32nLxQ9Lv04l3vumjAXuAEMKZc6H/FlY6qL8ZBYOLIyf8PLgD7nPkhPVPeWWvgktG8JGgLoFsiCBxvw7iRzA4IivMg2BNwL9Nj+Z+Ed3hsC4bx5JCRYWr1LuN6Dhkjo09Ty/uSqcvghl2CA+kA0RVYRPckX6vXrzRSE9wuO+sBoTAgl2M1iW6XaS2bHY19J3V08S46WsUDSRNzmr1c1/SdEV8oL7C/Na08GwcWpzanw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rfrd0iD7EjK97YUlrQgVbL/TGG+66iytR22ST2AoOEE=; b=GfFX9jJAjfXD6nkoqj9/AzF3koUJYKH/ftuaI0hFlBUhXlgKjajJ2IIUecfqTNpmtZ2Ihi+Qtl2B7Qg32tiTevNhlkQOSHsrMhdf+XDO16TxCTf7A6yEBXKzoR4Wv4aEQ7hwDpTWcqC9YzCCwB60n6Mfh9aE287D7glcf7maAOKop7Te5Mhr68BOKWchWWibcIeFsh5mff62KJgvM6ZUO9JNAb9m3oULgjX1Igk2+cy1/zOL+kyCH4z/3+u8P4VwwdaYLnoTL/2bkiJpcJ+UBWsEPnFcl5kWXb2MASQieTE5oRXpPog67WAaZ944YUdlDu5jNrflnfEt1G4Zp+Lxvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=xilinx.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rfrd0iD7EjK97YUlrQgVbL/TGG+66iytR22ST2AoOEE=; b=iSHU0FRMDLibEOErNaxQrLZwGhmehCpsYZTp35U//owRATtZaBofogw3HA/5v7IsdRYzz94Zl4O9Qm3iFNBcjtlrfJI0ByKbWomcamEY6NScSULalfM8YqY5hSS46Cc6X99+GZrfSf+HWKmu38+dSRiNBfmaNJZ+Adwb8lY6zXvZ0OSLCzGsxqWJFGKeWDXe5FT7VP/oeT2U4qPofqaQpq5hq9PX58mBHvoSY3faLJu4l2j5PDEZ5vLIhTUUfsDomC80yKKXiOAcXYXll6Mtt01hRTBLswjS9qAsXll19gCF1pQghvZwodlckRw5pOSadK3x0amXScBNnV3Kk3MkAQ== Received: from BN9PR03CA0060.namprd03.prod.outlook.com (2603:10b6:408:fb::35) by BL1PR12MB5874.namprd12.prod.outlook.com (2603:10b6:208:396::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.22; Tue, 21 Jun 2022 08:13:02 +0000 Received: from BN8NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fb:cafe::33) by BN9PR03CA0060.outlook.office365.com (2603:10b6:408:fb::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.16 via Frontend Transport; Tue, 21 Jun 2022 08:13:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by BN8NAM11FT020.mail.protection.outlook.com (10.13.176.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:13:01 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:12:55 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 21 Jun 2022 01:12:53 -0700 From: Xueming Li To: Ke Zhang CC: Andrew Rybchenko , Ferruh Yigit , dpdk stable Subject: patch 'kni: use dedicated function to set MAC address' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:02:57 +0300 Message-ID: <20220621080301.2315720-112-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1ec61bb4-6d70-43da-7bb9-08da535ddc63 X-MS-TrafficTypeDiagnostic: BL1PR12MB5874:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ooPcTnLdMqO3uwgO4qVRTHyDAyAqfpWSDZGk9ffFLHWQnQoWmXXlbonItvhT2sAxPnVOt2gE+wiseQfA4aiKjkws/qNLE6BnkcOXg0VRAyTnzumEeSCU5IHn/Vc6mbGkTXHwJASe/MCg2mSnYzmnoKWyHs15h6yJxlmBuU8GzPr8VUonDk7WKGZKVf9wOJ7P9SBVkP38/4Ky/owheSMkS6saXnBEQf7gq7HvmyR/6lzAqMSfD1AmgqEGOG3OSFM45hJozRgg7Rr/It5zvLECP3fyvw08YRibmdfPswZfy2GuoxLkyY8Sb0OEeD1ectBDdzxFSQP3L4BwtK0E7mPMOZGFrYFvhP6El4TDOYscV7T5ljW5IFpXmOWYN/erLF4vVqYcnRzURRAmXh91i+WPvXqkCGy/N7auTCHnC+vESvVZgljgqezXmLR2jETtVD7agxenWkU4sMYvk+KW2D8hE/Qo0OxowWZLdw2Wplu/k5LdG3Ni1wI72AJJ9P0dmcCpqAdDy7tXAmb+qE5vLsUAw7bepzJbyiZZH3krvlEeGAv8pqtG3kn+y9DRo/FFyvRw3JAWCWZtfk4whY16AO4nU5fbApHX4aeos+eBhkcLU9cVxlwsHangezqM6fgcL9p+2wlsIjkxs5CXovrSJymfpd/dIhuuSZSChXsL8PaYw2zqs/Ajz0x5CBHbl++22XUSXlprR/DF9hQnvJJfq9Q1RH3pF6BaOIewxPHMNoqGe+184mUPzlBlfksW0COhgUsuVyrD8UswAt+TGbXpfiMkycqSNBVxTNudr7GqnuKcJLhj8IASnUOM4BnvGpByBklC0PFTQV1q/gBEHSTk1cMuW2BsUEm3EjKx4zR/IXpnMPU= X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(346002)(136003)(396003)(376002)(36840700001)(46966006)(40470700004)(2906002)(7696005)(86362001)(70586007)(8936002)(5660300002)(4326008)(478600001)(8676002)(70206006)(36756003)(966005)(53546011)(26005)(6286002)(40460700003)(6916009)(54906003)(316002)(1076003)(41300700001)(2616005)(36860700001)(336012)(426003)(47076005)(40480700001)(55016003)(82310400005)(81166007)(83380400001)(186003)(16526019)(82740400003)(356005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:13:01.9042 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1ec61bb4-6d70-43da-7bb9-08da535ddc63 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5874 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 Hi, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/23/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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/3590f93137200914516a66452535016088b0cb5f Thanks. Xueming Li --- >From 3590f93137200914516a66452535016088b0cb5f Mon Sep 17 00:00:00 2001 From: Ke Zhang Date: Wed, 8 Jun 2022 15:11:17 +0300 Subject: [PATCH] kni: use dedicated function to set MAC address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit b99bd4a0aacab47165d045a6aeee88ee74744600 ] The warning info: warning: passing argument 1 of ‘memcpy’ discards ‘const’ qualifier from pointer target type Variable dev_addr is done const intentionally in v5.17 to prevent using it directly. See the following Linux kernel changeset for details: commit adeef3e32146 ("net: constify netdev->dev_addr") Used helper function was introduced earlier in v5.15. Fixes: ea6b39b5b847 ("kni: remove ethtool support") Signed-off-by: Ke Zhang Signed-off-by: Andrew Rybchenko Acked-by: Ferruh Yigit --- kernel/linux/kni/compat.h | 4 ++++ kernel/linux/kni/kni_misc.c | 9 +++++++-- kernel/linux/kni/kni_net.c | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h index 0db29a4a6f..3a86d12bbc 100644 --- a/kernel/linux/kni/compat.h +++ b/kernel/linux/kni/compat.h @@ -142,6 +142,10 @@ #define HAVE_TSK_IN_GUP #endif +#if KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE +#define HAVE_ETH_HW_ADDR_SET +#endif + #if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE #define HAVE_NETIF_RX_NI #endif diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c index a6b51fc32f..0df129240b 100644 --- a/kernel/linux/kni/kni_misc.c +++ b/kernel/linux/kni/kni_misc.c @@ -404,11 +404,16 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num, pr_debug("mbuf_size: %u\n", kni->mbuf_size); /* if user has provided a valid mac address */ - if (is_valid_ether_addr(dev_info.mac_addr)) + if (is_valid_ether_addr(dev_info.mac_addr)) { +#ifdef HAVE_ETH_HW_ADDR_SET + eth_hw_addr_set(net_dev, dev_info.mac_addr); +#else memcpy(net_dev->dev_addr, dev_info.mac_addr, ETH_ALEN); - else +#endif + } else { /* Assign random MAC address. */ eth_hw_addr_random(net_dev); + } if (dev_info.mtu) net_dev->mtu = dev_info.mtu; diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c index a8b092b756..09f690bf81 100644 --- a/kernel/linux/kni/kni_net.c +++ b/kernel/linux/kni/kni_net.c @@ -783,7 +783,11 @@ kni_net_set_mac(struct net_device *netdev, void *p) return -EADDRNOTAVAIL; memcpy(req.mac_addr, addr->sa_data, netdev->addr_len); +#ifdef HAVE_ETH_HW_ADDR_SET + eth_hw_addr_set(netdev, addr->sa_data); +#else memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); +#endif ret = kni_net_process_request(netdev, &req); -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:54.148981770 +0800 +++ 0111-kni-use-dedicated-function-to-set-MAC-address.patch 2022-06-21 15:37:49.234451950 +0800 @@ -1 +1 @@ -From b99bd4a0aacab47165d045a6aeee88ee74744600 Mon Sep 17 00:00:00 2001 +From 3590f93137200914516a66452535016088b0cb5f Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit b99bd4a0aacab47165d045a6aeee88ee74744600 ] @@ -21 +23,0 @@ -Cc: stable@dpdk.org @@ -48 +50 @@ -index 4f6dd373a3..0c3a86ee35 100644 +index a6b51fc32f..0df129240b 100644 @@ -51 +53 @@ -@@ -402,11 +402,16 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num, +@@ -404,11 +404,16 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num, @@ -71 +73 @@ -index 41805fcabf..779ee3451a 100644 +index a8b092b756..09f690bf81 100644