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 906E045CE3 for ; Mon, 11 Nov 2024 07:39:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 882354067A; Mon, 11 Nov 2024 07:39:49 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2054.outbound.protection.outlook.com [40.107.92.54]) by mails.dpdk.org (Postfix) with ESMTP id 03CC54067A for ; Mon, 11 Nov 2024 07:39:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jBqmx7qqcWkU5vmji5K5w2cSkgSwQSVpPkKT+gxsbOM67mAHYJ1hoVql6BiKlyMUgog1yuEiC5RdSv+2gpxr6f4oq5HukwAjsiFWEIvHYGV9m3Sbdp+GieGTOL/oADLqK3TgMDn7dezvhJhLBwdMce4tiG9Ny07E+ILUMwJ2zIz9OujEsuvIcyZHqrtZ8V4S77qeHDyar62VTDQLA7yucrxMIvI59Ary616GqllVrquekkEVTRRDH3lCKAoHLQE6WXyiDee2kJDPPHd5UU2/WoJar1CFjlsSNBQOsSwvQrlan0Eksp6CBsYb8RVP/q55I2mF66mcSl6BOTFKplQRJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=/0gWGKKxpt7nJ5jlySCkIhCGgS92A2Fj6l2i5df7YQ8=; b=HF97aZE0D+NqMVKo3DLI9bJJh1TDNj65EavDhMf9n2Wtk99weDfizFhkpgQ2waT31mMiEj5W9vusQYW2YdQBVl21YG9MrP7NWN2ot7KAZk2Txk6NHfY0yUYe7TWPfN5DA3G5n0WVh6TNIVzNgkmTcxJ1qYX0XFKpfaR9fNiKi+TmCUhSYoc9UPfxnJHmG11dmO+c1L3/V39A+zFiDpHlCdBky8Qyqpv7pGO2/eAjEofIgvNONNZywmGsFXkRI3ftk1GUGQwb2/8TgAXJAayr5Dpsb3E8TI10HUww8b77rqCfHo/1hcQ+ekY5F0yovnp/qygSX9cunf4n4eIM+Gk2Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.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 (0) 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=/0gWGKKxpt7nJ5jlySCkIhCGgS92A2Fj6l2i5df7YQ8=; b=K3VGX+867iN/ONAq76Ct64Pj6vIkp7L9bgMYd1ptpnngVyp3N9Vth0+I4CdECHKm/yHIjjLvZutCHRJjtjh3/dh3SXVnQngkc8CI2QXiPOYtBvBM1lwg7wjOr6o4N1vWBYrt4FZ37EOtI8ArTcqyPcsitIJBUnSfKZW95Z0YQ2LlRNh2vZuc0t1LCtW55fMzPEWOThpa8GQ2IOY4nw+zDXhpH2LvPE48upeX72L4TBvxV66RSLkZciaFxL6v+390MaqvfrKXg2WHCeloYoyXfsvAHz9sj6ogTQ+fJ9+a+5/B+H6vHfRk5tlYxsS/5ycB3M6g50kh9i/x60xflxo0+A== Received: from SA0PR11CA0079.namprd11.prod.outlook.com (2603:10b6:806:d2::24) by SJ2PR12MB8134.namprd12.prod.outlook.com (2603:10b6:a03:4fa::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.25; Mon, 11 Nov 2024 06:39:43 +0000 Received: from SN1PEPF00026368.namprd02.prod.outlook.com (2603:10b6:806:d2:cafe::e9) by SA0PR11CA0079.outlook.office365.com (2603:10b6:806:d2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.27 via Frontend Transport; Mon, 11 Nov 2024 06:39:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SN1PEPF00026368.mail.protection.outlook.com (10.167.241.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Mon, 11 Nov 2024 06:39:42 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 10 Nov 2024 22:39:32 -0800 Received: from nvidia.com (10.126.231.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.1544.4; Sun, 10 Nov 2024 22:39:29 -0800 From: Xueming Li To: David Marchand CC: , Bruce Richardson , "dpdk stable" Subject: patch 'net/iavf: preserve MAC address with i40e PF Linux driver' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:28:29 +0800 Message-ID: <20241111062847.216344-104-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111062847.216344-1-xuemingl@nvidia.com> References: <20241111062847.216344-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.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-TrafficTypeDiagnostic: SN1PEPF00026368:EE_|SJ2PR12MB8134:EE_ X-MS-Office365-Filtering-Correlation-Id: 0315755d-1790-40c1-2d20-08dd021ba02e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?QqigN/B+2WnMihDIO/bHEBxhBDpOxmyIoatUdOXVtvHOUovMoP8/D/z7P52A?= =?us-ascii?Q?bi0D1Oq6xdrbwSUzmoR4kR8XCPkfxnDDerQagSiRURvRxzTKMappXHzxmGop?= =?us-ascii?Q?f7JDaWRhfJGjyxc8XJZbV3NSRMBxx3qAbSSYG21azVfzcIqHt3cLGjAfF5/z?= =?us-ascii?Q?qKjKOJ74R4D9UMNF2bv/VekY+wX4C/IXCTCxrUa0M4jeCZ9SuKPAlY3g4JIL?= =?us-ascii?Q?VO+u0RZG3fGdXa8jZnP8tNAkv6AK4ELiBV8iLPkVkDkZmLA1MK9hqHVTd4l9?= =?us-ascii?Q?+OWT7Uf0A6FHDW/Vdh7nt20IEZoOGjzCTgg1fDhSIPRmd6GPGPa1KdJANjJn?= =?us-ascii?Q?xJNy12+UUIRr7JljPlU3shQ9GeUmVpbfkmgiMD5v44JVDnODUC7TFl3TQGG9?= =?us-ascii?Q?iTWITa1WBCNiD7cLr4sI98r1P2mPtf/MqqKjH8oCtAgyv67HI2FJl7521M2H?= =?us-ascii?Q?tX8+PLNyP5WhIu/6tMelO9agb5uH4MXKE6Dw0bvTjK18qzsXhtS8mUmzaPqW?= =?us-ascii?Q?WFNP9gzbarJrqNa64QX9rnDxMeMXV/6/2MnJp9XbjWo8UXUtE8vOaKD4XTtt?= =?us-ascii?Q?bntS1kSY7guMabZw5w6yliQjiKJacdGvJmUTn40cZYiQ/CuBTldoZseH9xXq?= =?us-ascii?Q?WjZJSJawAFWOzdvTae2lqRiEFUW5awHCLFqdBBu4VP0RdWDKvxbVY9q+DYqx?= =?us-ascii?Q?uNbvvoWzOS6wlQM4GH3x0HU4DjLITJFF3uSeFMj4vLaGgvkj7g10YXOcDn4g?= =?us-ascii?Q?SSCorJKbMeeW22BdJCsZqfEXQopB1K97/aHj2WuJisOAxG+n6FxUgP4frwkK?= =?us-ascii?Q?m0+WwmUT3yo/MIl/j7wN+hcsTjTE3FCOIjg+Dgw1CVRZWgKyAjPhc0kJ6mjb?= =?us-ascii?Q?xR7pIwPjFh78nuA1Jv65txIsdiwS0n1VQs4fGshTuvNSZUTR3mcj3RWyJx1S?= =?us-ascii?Q?4gQb/Sic/ZZu9CwO4nVkqXaUniOxLSYsCcwGDM+6tVLq4WPXvHaDAJNzeGXD?= =?us-ascii?Q?td7Aym0/s+CeYbkdILx5tNzD+ZMaJ1zeUbwh9IGmORjixJzn+R9QpzcdDnTD?= =?us-ascii?Q?WTMz9hcwRxtluJu6kmFGQ6embDt1CL9scIeucjCqsYJTJX4Swhki8aZvypv0?= =?us-ascii?Q?QrHry9yLFA7gnre8DQZuI7SZ2RS5cjsEEjHWUveZoHp1Er1HhDruJgFFESlF?= =?us-ascii?Q?80xPBsmz+3HS3UzpWVqwya7XNuUIDQlT5ax7rvLlF4h4OFsOm9o8r57fnhyF?= =?us-ascii?Q?i/4mMXtzFDJDDCLBZxpkbRCPRyEHDaSDtPrBVIDjn2zn7MxOQCriPA58ESWr?= =?us-ascii?Q?akacLNDqZuvtStt9Pwby6q175+coSyxSR1mtVbGVzy6S/BybMpbGfE8GfagW?= =?us-ascii?Q?ZOuxtSeOxqZbxT4fwrs3RlrpHhAzOJkjV+IatPDT4xrIl6QHvw=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:39:42.9981 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0315755d-1790-40c1-2d20-08dd021ba02e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00026368.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8134 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 23.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/30/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=819d57cd27c47941913084143eb32d1cb3a8bf20 Thanks. Xueming Li --- >From 819d57cd27c47941913084143eb32d1cb3a8bf20 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Tue, 1 Oct 2024 11:12:54 +0200 Subject: [PATCH] net/iavf: preserve MAC address with i40e PF Linux driver Cc: Xueming Li [ upstream commit 3d42086def307be853d1e2e5b9d1e76725c3661f ] Following two upstream Linux kernel changes (see links), the mac address of a iavf port, serviced by a i40e PF driver, is lost when the DPDK iavf driver probes the port again (which may be triggered at any point of a DPDK application life, like when a reset event is triggered by the PF). A first change results in the mac address of the VF port being reset to 0 during the VIRTCHNL_OP_GET_VF_RESOURCES query. The i40e PF driver change is pretty obscure but the iavf Linux driver does set VIRTCHNL_VF_OFFLOAD_USO. Announcing such a capability in the DPDK driver does not seem to be an issue, so do the same in DPDK to keep the legacy behavior of a fixed mac. Then a second change in the kernel results in the VF mac address being cleared when the VF driver remove its default mac address. Removing (unicast or multicast) mac addresses is not done by the kernel VF driver in general. The reason why the DPDK driver behaves like this is undocumented (and lost because the authors are not active anymore). Aligning DPDK behavior to the upstream kernel driver is safer in any case. Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fed0d9f13266 Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ceb29474bbbc Signed-off-by: David Marchand Acked-by: Bruce Richardson --- drivers/net/iavf/iavf_ethdev.c | 22 +++++----------------- drivers/net/iavf/iavf_vchnl.c | 1 + 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 1a98c7734c..9f3658c48b 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -1033,7 +1033,7 @@ iavf_dev_start(struct rte_eth_dev *dev) if (iavf_configure_queues(adapter, IAVF_CFG_Q_NUM_PER_BUF, index) != 0) { PMD_DRV_LOG(ERR, "configure queues failed"); - goto err_queue; + goto error; } num_queue_pairs -= IAVF_CFG_Q_NUM_PER_BUF; index += IAVF_CFG_Q_NUM_PER_BUF; @@ -1041,12 +1041,12 @@ iavf_dev_start(struct rte_eth_dev *dev) if (iavf_configure_queues(adapter, num_queue_pairs, index) != 0) { PMD_DRV_LOG(ERR, "configure queues failed"); - goto err_queue; + goto error; } if (iavf_config_rx_queues_irqs(dev, intr_handle) != 0) { PMD_DRV_LOG(ERR, "configure irq failed"); - goto err_queue; + goto error; } /* re-enable intr again, because efd assign may change */ if (dev->data->dev_conf.intr_conf.rxq != 0) { @@ -1066,14 +1066,12 @@ iavf_dev_start(struct rte_eth_dev *dev) if (iavf_start_queues(dev) != 0) { PMD_DRV_LOG(ERR, "enable queues failed"); - goto err_mac; + goto error; } return 0; -err_mac: - iavf_add_del_all_mac_addr(adapter, false); -err_queue: +error: return -1; } @@ -1102,16 +1100,6 @@ iavf_dev_stop(struct rte_eth_dev *dev) /* Rx interrupt vector mapping free */ rte_intr_vec_list_free(intr_handle); - /* adminq will be disabled when vf is resetting. */ - if (!vf->in_reset_recovery) { - /* remove all mac addrs */ - iavf_add_del_all_mac_addr(adapter, false); - - /* remove all multicast addresses */ - iavf_add_del_mc_addr_list(adapter, vf->mc_addrs, vf->mc_addrs_num, - false); - } - iavf_stop_queues(dev); adapter->stopped = 1; diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 8ca104c04e..71be87845a 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -710,6 +710,7 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF | VIRTCHNL_VF_OFFLOAD_FSUB_PF | VIRTCHNL_VF_OFFLOAD_REQ_QUEUES | + VIRTCHNL_VF_OFFLOAD_USO | VIRTCHNL_VF_OFFLOAD_CRC | VIRTCHNL_VF_OFFLOAD_VLAN_V2 | VIRTCHNL_VF_LARGE_NUM_QPAIRS | -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:09.886694643 +0800 +++ 0103-net-iavf-preserve-MAC-address-with-i40e-PF-Linux-dri.patch 2024-11-11 14:23:05.292192836 +0800 @@ -1 +1 @@ -From 3d42086def307be853d1e2e5b9d1e76725c3661f Mon Sep 17 00:00:00 2001 +From 819d57cd27c47941913084143eb32d1cb3a8bf20 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 3d42086def307be853d1e2e5b9d1e76725c3661f ] @@ -27,2 +29,0 @@ -Cc: stable@dpdk.org - @@ -40 +41 @@ -index c200f63b4f..7f80cd6258 100644 +index 1a98c7734c..9f3658c48b 100644 @@ -43 +44 @@ -@@ -1044,7 +1044,7 @@ iavf_dev_start(struct rte_eth_dev *dev) +@@ -1033,7 +1033,7 @@ iavf_dev_start(struct rte_eth_dev *dev) @@ -52 +53 @@ -@@ -1052,12 +1052,12 @@ iavf_dev_start(struct rte_eth_dev *dev) +@@ -1041,12 +1041,12 @@ iavf_dev_start(struct rte_eth_dev *dev) @@ -67 +68 @@ -@@ -1077,14 +1077,12 @@ iavf_dev_start(struct rte_eth_dev *dev) +@@ -1066,14 +1066,12 @@ iavf_dev_start(struct rte_eth_dev *dev) @@ -84 +85 @@ -@@ -1113,16 +1111,6 @@ iavf_dev_stop(struct rte_eth_dev *dev) +@@ -1102,16 +1100,6 @@ iavf_dev_stop(struct rte_eth_dev *dev) @@ -102 +103 @@ -index 69420bc9b6..065ab3594c 100644 +index 8ca104c04e..71be87845a 100644