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 6804845A7A for ; Tue, 1 Oct 2024 12:09:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B2FA402DA; Tue, 1 Oct 2024 12:09:10 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 921A64027A; Tue, 1 Oct 2024 12:09:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727777348; x=1759313348; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=Q9OHMKOLOmbLwnx8Pb1GmJ6LQvbPpqnxyzFa9S2wAgE=; b=G8wXfvE9vRZGvbIeu+HeKOjBqsGlH+Wv6ReBPP8eTvIhehH8tii0tB54 FLOT8baKVDOpjfUmM/jXuhwOtU8oCQlH7xxhVanhryeIS4K+4xa86uC7b M7CFW/TslHv5mSG9jcVl9YFj+NonNhTaOs1F4dLac/qqaqn5t3lxpQz+X L4mh5nHumPhHLoRbOQd21mRR411fDljFRcxi+WOyet/mo7cuwp10U6/eO /qTgqkoUW3jxOhqD70OZw4fH7x8avWQRr0frRdhF1nzvXrZ8o6fLxjbC3 FsM3+uaILogky47vkWiy+s6Uw1FglS/Q1vuYj7TDdT9mbvVCfTS3YYUEU Q==; X-CSE-ConnectionGUID: +bwVi/tVR6KQrU9GFDN+uQ== X-CSE-MsgGUID: RWxM6ajnRo2CnOPoVaETag== X-IronPort-AV: E=McAfee;i="6700,10204,11211"; a="49426099" X-IronPort-AV: E=Sophos;i="6.11,167,1725346800"; d="scan'208";a="49426099" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2024 03:09:06 -0700 X-CSE-ConnectionGUID: LC7h4Se6TfqWglIiy3xeeQ== X-CSE-MsgGUID: 3alLtUsfSmCdMliatb072A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,167,1725346800"; d="scan'208";a="73872425" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orviesa006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 01 Oct 2024 03:09:05 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 1 Oct 2024 03:09:04 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 1 Oct 2024 03:09:01 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 1 Oct 2024 03:09:01 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 1 Oct 2024 03:09:01 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 1 Oct 2024 03:09:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qlNb8fbX53g83oyzhKXzeFzdy1UbAposohYCCsPgiqXgtlX7DX5vPzDHMZVLwAx///mOqs6G0dgshUGQf0hXB4L1Z/BlqmR6sayiNONLqyxsvUcAFiXYRzDclgwqvfeT1SOyAaa+6adobPikQA31vrx3VkTLgfn9WoHXGvnTso250jmAJuNBfhc2zxVMG6AUCVYa8X/8Wv0eC+NgSiEcteasNbMmw14Lnojy4BydaXsmJQKbHAZnh85/9kOxhShoF9ts7tgD92LUsKh1W1bKwTb+LjxDHJUscDhK7yIvT1yPjxH0Om8Jz+blrrbveP6rCr1RcYSyZbkDm516Kj8k8A== 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=NBGeOwv5zQk7nI+1NxvPHn7JmbPOX9/snqXcAoT7fJU=; b=d7iejFzQaVZcl8zy3SFFI7NDlipW4XLEZ5RKKBpGMxCd1VTA8QjTiL/ZR8dUfQOKXIbpbLgBVXePCEYYqrESwVZi4s2sfytBStRroPBO+clYqqOzvn3dQJwyFTNAzfVkdr9TtTPKMtiCGzjBh7lhSOoXB1XTPbuiJAE+JxbCn7tJB5WxRX7gr3eQ5OWsS0USPP80kweTqprFR6iSdsivNJMDVXIH0NeijOVQpqusaTQaz0ByQmgnR0FbGX4dF1URRyxt6XqSKZbncyAyk5yz7MLIAMvsjhk1boWsjS2wi0+MF0yLC/JBJLP4GjRuEjrf1sbXb2DrXLIM3vmW8d7ADw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by IA1PR11MB8199.namprd11.prod.outlook.com (2603:10b6:208:455::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.15; Tue, 1 Oct 2024 10:08:37 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%4]) with mapi id 15.20.8026.014; Tue, 1 Oct 2024 10:08:37 +0000 Date: Tue, 1 Oct 2024 11:08:31 +0100 From: Bruce Richardson To: David Marchand CC: , , Jingjing Wu Subject: Re: [PATCH v2] net/iavf: preserve MAC address with i40e PF Linux driver Message-ID: References: <20240919120039.4097053-1-david.marchand@redhat.com> <20241001091254.98540-1-david.marchand@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20241001091254.98540-1-david.marchand@redhat.com> X-ClientProxiedBy: DUZPR01CA0026.eurprd01.prod.exchangelabs.com (2603:10a6:10:46b::20) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|IA1PR11MB8199:EE_ X-MS-Office365-Filtering-Correlation-Id: c88388b7-2894-473e-fd61-08dce2010410 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?EXDKrW0WkqwVKYGkVgdWOxBgmHCusmkhP1kPFxClsZ+js1YNLIoST0iUX22T?= =?us-ascii?Q?8ukhovmB8CXjB5vvqkgEDI6FDidaBqnlW7uibl6KiYksKUZa567zNuk8Pi3M?= =?us-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3+rxMvMfQMqD2jDXpJedd21wnpK?= =?us-ascii?Q?QgwmwFc4IJCPM2MvJw6FVjQ/JK3RtbWbzXD6AEhYRqYa9TF0dvvJZctK5zY5?= =?us-ascii?Q?Olx0KhWlPEtfdRuUkFtL8L8oY6gZuYJdbMcSARtzWfnvB6bshxrtsX1+RZQG?= =?us-ascii?Q?olnc3yH4XEcA/qkiW4Tkhu256JqobxqRu/cYkeWUifSWKcrINKNY2/U3n5iw?= =?us-ascii?Q?aIWtxQexQzznHoSqBUuL4V1QpZnnoc2n5wL6k68uV0rcWC6GpEGsgUoHR2J+?= =?us-ascii?Q?oZRmlbLgWu4A/IdgLaHRWnQBgQ1DE+sSa83kE3CAFyHIf/1Wp+GT6cp9tuMp?= =?us-ascii?Q?kJc=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?8pfve3qJEe+vH2JlMhVNVtKWDVi+VSuh4JSPoaswMOiejd507RlFOWzmdcSk?= =?us-ascii?Q?UbJulmuB6ZrQ5T+lep+bbfJdGdLFCuKLcQP8dc4tFVDYqKrS7MEj3bbvuqkH?= =?us-ascii?Q?jwMVKRpntnkqRTVdMpVB/XwNcS+I9VR5JVPovLbb3pdYRFcSXrcXAFCkv2Gk?= =?us-ascii?Q?3/Y7ow0/YxjuanOld6u+3UkqFgRIYiYaW6i9r5cw/autAlKKrEtunuMhZloa?= =?us-ascii?Q?o4531chvcU0K6TQrIlkvRwEoEsNDUO7xXlid+t4NueEKSERt/xG+OvGJl8tR?= =?us-ascii?Q?WXhjKgdyDMpvdrWtk1hZ+P02kLBbYzKKrzXdlYlABRIROMdFQh0mleE9n9zS?= =?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8dYktFw7t/OtawICDlpPfHnZRl?= =?us-ascii?Q?JQZtll0zu0L/vUwUu9IEUcrE3R8Df1YiLY3J//040vphAtCqrUNqeVkLliiD?= =?us-ascii?Q?iNmI1iGzhwi7SHzH0mC59ufp/uJAa9P7/OgBKX1Bp0V6xHLvW5fWZUmUVTIQ?= =?us-ascii?Q?IR+uYh3/V5mWZl7BvWk9vK3kCkkXpGX4jE6nNJTzFTK2gHAwBK32A9YEZqTN?= =?us-ascii?Q?hQmsxtiHTnv90rF8oBg9cFeWeHfHADbO78ZgBf0/DHv2TntSUEeR+LnZNxbU?= =?us-ascii?Q?mv7eyBpU4/TCCmBaq3k5A9ZvrtRcsLt+z8bCQanUD+Pj1qi5eEpobP9iFmSN?= =?us-ascii?Q?qQCOV71M8tx325miOvudSytzwxFm+N85wokBu5yASg2T5HaPbUEVFceD2Fau?= =?us-ascii?Q?xg=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: c88388b7-2894-473e-fd61-08dce2010410 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2024 10:08:37.2853 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 398BIz8YHr8LPXwtaO/gSUSn3iBFe6ecbq0Qp/8XwMnaXlghQi2htNKd6OzE1OmUAqai/vdazurms1gr0+n3Oo+H6OQo6479MXlU5JouaNc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB8199 X-OriginatorOrg: intel.com 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 On Tue, Oct 01, 2024 at 11:12:54AM +0200, David Marchand wrote: > 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. > One question inline below. /Bruce > Cc: stable@dpdk.org > > 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 > --- > 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 11036bc179..97cdb1cbe0 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -1044,7 +1044,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; > @@ -1052,12 +1052,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) { > @@ -1077,14 +1077,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; > } > > @@ -1113,16 +1111,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); > - } > - Question on this: while I understand we don't want to remove the default mac address, should all other non-default macs not still be removed?