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 6366B45DB9 for ; Wed, 27 Nov 2024 18:21:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D32C40A6F; Wed, 27 Nov 2024 18:21:46 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 1881D4066C for ; Wed, 27 Nov 2024 18:21:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732728104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=maUsyskDAsygVkC3qO+F+hKxDJr214Wx6K9dFfvfN6E=; b=Zztr8AEiwbR+Hm4RFaOXH1bzTjTOU/XDSv7LT4qRZ8AIV1cHokd5yf2c4sajQ0Wtn+OgEN fX0K2T0ZBUgcT1Nh93DuaA+TSlpS3Q3BsikuxlUIYnTQthUHUi7j7jBCv489H9wkgBq5L+ 1Cm+8VxOzBFfXUtx7/IYWyM0eEusCs0= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-135-3a9xee49NA66Js5FRUfi7w-1; Wed, 27 Nov 2024 12:21:42 -0500 X-MC-Unique: 3a9xee49NA66Js5FRUfi7w-1 X-Mimecast-MFC-AGG-ID: 3a9xee49NA66Js5FRUfi7w Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 543781955F43; Wed, 27 Nov 2024 17:21:41 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.52]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BF8E7300019E; Wed, 27 Nov 2024 17:21:39 +0000 (UTC) From: Kevin Traynor 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 21.11.9 Date: Wed, 27 Nov 2024 17:18:08 +0000 Message-ID: <20241127171916.690404-61-ktraynor@redhat.com> In-Reply-To: <20241127171916.690404-1-ktraynor@redhat.com> References: <20241127171916.690404-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: tUEz1VB4N2rBnf5CXmPXIPgBuH1TCIpVI912BHLEHYg_1732728101 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 21.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/02/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://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/5b7e9e15eea01bff24716066f966bf5f542dfcd9 Thanks. Kevin --- >From 5b7e9e15eea01bff24716066f966bf5f542dfcd9 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 [ 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 | 19 +++++-------------- drivers/net/iavf/iavf_vchnl.c | 1 + 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 4885a86ad3..d32cb3c3a5 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -984,5 +984,5 @@ iavf_dev_start(struct rte_eth_dev *dev) 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; @@ -992,10 +992,10 @@ 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 */ @@ -1015,12 +1015,10 @@ 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; } @@ -1054,11 +1052,4 @@ iavf_dev_stop(struct rte_eth_dev *dev) rte_intr_vec_list_free(intr_handle); - /* 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); diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index d685358ed3..ec36624ce7 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -518,4 +518,5 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF | VIRTCHNL_VF_OFFLOAD_REQ_QUEUES | + VIRTCHNL_VF_OFFLOAD_USO | VIRTCHNL_VF_OFFLOAD_CRC | VIRTCHNL_VF_OFFLOAD_VLAN_V2 | -- 2.47.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-27 17:17:40.180337547 +0000 +++ 0061-net-iavf-preserve-MAC-address-with-i40e-PF-Linux-dri.patch 2024-11-27 17:17:38.240269451 +0000 @@ -1 +1 @@ -From 3d42086def307be853d1e2e5b9d1e76725c3661f Mon Sep 17 00:00:00 2001 +From 5b7e9e15eea01bff24716066f966bf5f542dfcd9 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3d42086def307be853d1e2e5b9d1e76725c3661f ] + @@ -27,2 +28,0 @@ -Cc: stable@dpdk.org - @@ -35 +35 @@ - drivers/net/iavf/iavf_ethdev.c | 22 +++++----------------- + drivers/net/iavf/iavf_ethdev.c | 19 +++++-------------- @@ -37 +37 @@ - 2 files changed, 6 insertions(+), 17 deletions(-) + 2 files changed, 6 insertions(+), 14 deletions(-) @@ -40 +40 @@ -index c200f63b4f..7f80cd6258 100644 +index 4885a86ad3..d32cb3c3a5 100644 @@ -43 +43 @@ -@@ -1045,5 +1045,5 @@ iavf_dev_start(struct rte_eth_dev *dev) +@@ -984,5 +984,5 @@ iavf_dev_start(struct rte_eth_dev *dev) @@ -50 +50 @@ -@@ -1053,10 +1053,10 @@ iavf_dev_start(struct rte_eth_dev *dev) +@@ -992,10 +992,10 @@ iavf_dev_start(struct rte_eth_dev *dev) @@ -63 +63 @@ -@@ -1078,12 +1078,10 @@ iavf_dev_start(struct rte_eth_dev *dev) +@@ -1015,12 +1015,10 @@ iavf_dev_start(struct rte_eth_dev *dev) @@ -78 +78 @@ -@@ -1114,14 +1112,4 @@ iavf_dev_stop(struct rte_eth_dev *dev) +@@ -1054,11 +1052,4 @@ iavf_dev_stop(struct rte_eth_dev *dev) @@ -81,4 +81,2 @@ -- /* 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 mac addrs */ +- iavf_add_del_all_mac_addr(adapter, false); @@ -86,2 +84,2 @@ -- /* remove all multicast addresses */ -- iavf_add_del_mc_addr_list(adapter, vf->mc_addrs, vf->mc_addrs_num, +- /* remove all multicast addresses */ +- iavf_add_del_mc_addr_list(adapter, vf->mc_addrs, vf->mc_addrs_num, @@ -89 +86,0 @@ -- } @@ -94 +91 @@ -index 69420bc9b6..065ab3594c 100644 +index d685358ed3..ec36624ce7 100644 @@ -97,2 +94,2 @@ -@@ -711,4 +711,5 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) - VIRTCHNL_VF_OFFLOAD_FSUB_PF | +@@ -518,4 +518,5 @@ iavf_get_vf_resource(struct iavf_adapter *adapter) + VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF |