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 8279345459 for ; Fri, 14 Jun 2024 09:02:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 292E7427A7; Fri, 14 Jun 2024 09:02:09 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2128.outbound.protection.outlook.com [40.107.244.128]) by mails.dpdk.org (Postfix) with ESMTP id D399C402C6; Fri, 14 Jun 2024 09:01:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mKppfyX9lKtZQKOPRPMWIosetwv4Phgkfsw7fNGwOImCBkfULu67GTpyMQ1sYq+bykheTkN4v3ThJXqj08tdTBILsAYMUrdqshb45fj9Xz+aXezRrY5GY+QPQl62pifbfzpcb75Vf4y/Ri0qg+9cmYjO4NZzwy+4zsPq3UJm3XVjl4Wa/RxYbmRF+djhC06MtntnPzHK5mB8+42qWivqF3Y5SQ5gTwRnfuivkz5knv1+6CzvR1fehgh7NlTxiJMSaje8BDPoLUjH7Yzxy60JtH4nXRdTEPXjd4B8Ivwt7xUgnUdZB4DZfYt8KGVl8Cj0wm+u5qqbyHHzhWkfR0dewA== 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=i9ZUaiKt7geHsyqW8EqKWqo3x2fgKcIsdboLbooMhs0=; b=R5TpKtKSI9RBk4hOvQiUZhEWFS3qiLBtRrzMx9eZBG1dE1CxJ/2n9dQgKvQ5luq3DboFxikRhvUZ8N0JZIpARASyhID/+p2wIBINQCCynS8nJdXr4UMkVjnQaWyLnysSQ/rESxOfIIAeAZcvEzdL8O17HucC7hl2GJ74NEedOQxY2sYbp5mkRhu83ZXmG6QWBdIA+g2T8KZ0mRyjUaxKCbSFBsEWabqh31BdQCxP6amDr2ywRjOUORsGolOeQhL5b3VFFZ3yV60CHNW65n3P/ka096NmJKNHPK+oUJCHsgz4rTHLRPcUj25JJnS/P3VQZiS3qZi5RTZDGvElkbEjSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=i9ZUaiKt7geHsyqW8EqKWqo3x2fgKcIsdboLbooMhs0=; b=oSKYwIk/1oP8Na/CEEK9T93QbmHJ69XuNJTEGlkDIZ7PbLk01zFAyv2DWeqQpdl/J1pALUDtHK9xEVOKfeCohwHsIKRXiVW1Dh8ul2BRSIcC7fVrQH+vIU5zXNuz5QLmRCJP4cbc89hiqe0XzAlj1lDug6s1tG5s06uwnbcuu1I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by CH2PR13MB3831.namprd13.prod.outlook.com (2603:10b6:610:a3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.25; Fri, 14 Jun 2024 07:01:47 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7677.024; Fri, 14 Jun 2024 07:01:47 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Xinying Yu , chaoyong.he@corigine.com, stable@dpdk.org, Long Wu , Peng Zhang Subject: [PATCH v2 03/11] vdpa/nfp: fix the logic of reconfiguration Date: Fri, 14 Jun 2024 15:01:12 +0800 Message-Id: <20240614070120.2663160-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240614070120.2663160-1-chaoyong.he@corigine.com> References: <20240426074831.1729792-1-chaoyong.he@corigine.com> <20240614070120.2663160-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR06CA0025.namprd06.prod.outlook.com (2603:10b6:a03:d4::38) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CH2PR13MB3831:EE_ X-MS-Office365-Filtering-Correlation-Id: d7cfef8e-bd61-4971-eb6f-08dc8c3fdb46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230035|376009|366011|1800799019|52116009|38350700009; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?q5QdDZMMOlKM/tFxD9qlcc9Ra4mgztumKnhNUhny+dCg0hJK8aMXGvcTSYoC?= =?us-ascii?Q?SfE36VXq/VIAhH6b7MiGJqJt7e5OJhRmxz9LV448hhJ4VjrxP0B92V4e0hrJ?= =?us-ascii?Q?qCWk6nodHW4++GRiE+QHcxXxqihX7Vt9z5DpGGu2nt85Ylfg7jqAWGc4A3IE?= =?us-ascii?Q?dOP9DA/cOtP0sSsaPnTAgj+Gq4Hvr4bQGinN3QsYCb4TyZlvn3GmC7FZvxMe?= =?us-ascii?Q?1CT+YPcwZmcJ4ynltMd/pwxuwm9u7dsZllUsKA1hw9HmKc68Q3vYWXKl0xMm?= =?us-ascii?Q?JAHMxOpwWkMkWgy9AYDE6mzY2sjP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ae3LBKGXEaHFGw0okRZP41WwtUBSQNqSpCxI0CdB1UdEBE6jFCC66qP9oZ?= =?us-ascii?Q?KQqAy9Q3z/LnQ95V5lyNWsaLP9HkHd8sfLgPEs8XEGB9zpQnNyJ52YyryglG?= =?us-ascii?Q?iwtE4WS2s3I/O0k1b3pQzeckECG5UG6gyAKDa4GaeVkamSrDgGtnaEzq4RQQ?= =?us-ascii?Q?NYSi3Ds=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230035)(376009)(366011)(1800799019)(52116009)(38350700009); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vX0W7hiT7i1hKBFmofVDh//gAxEpElfRsXgiBEaVPN5SViqSxQ5uzC3lXYXa?= =?us-ascii?Q?pMri+kvjqJblmUiRVW9yXfhSzxt8fKabvz1b+o4POgvBjwQ4MbTqO3Sa82pj?= =?us-ascii?Q?TFBXUdudfiZUh+GLeqETaVz5fXsGAMA5D59xz791JVaVUifx4427YgPf30Yt?= =?us-ascii?Q?ki9rusGFfvcIV64/vxF6PUZ1PratqQOZBVs8BL8MaxSt7cTJnFRTwSRGRuIj?= =?us-ascii?Q?mz86V8BrRcgWhywdtjGULBk1QqPXgoHIfb6r8AKuBe9L+b0Yam4kWnaUDxLn?= =?us-ascii?Q?2fsFxjaE129pINtEjFpcCtJ99TyQAHD7/E1Eafd3tQ1Bpy0llfli8/UL3R48?= =?us-ascii?Q?h7x5HhZCiqAAaIjHXigJ9SCEZru893gdiQNrgJKPC+Xt/QgQLecPDW4fWh85?= =?us-ascii?Q?EVKctSl9XxXcFfa1PIOtj0+x+2PpecpWjzhmb0peDC2xV5ox/fYOy3MYNhw1?= =?us-ascii?Q?Ll2G09amXdwP92E2fcGjdyjpb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?Q?EsqmczLQkwBSo3TyOHSAV2LoVpBILC2AT/NIo+HmfqRi1ofQeE/6+N+jQh5i?= =?us-ascii?Q?dDaiTeEHB3z5932OuvaWtKdArlrxWKv3Vbc8B9tU/aa6fBSAqy3X3M8UjCt2?= =?us-ascii?Q?1DE3qQ+xDXgQACKwZh2SuD1p/CSDMGH2vJGxfVH8IRp4oHfYkj1VPRVvNb/d?= =?us-ascii?Q?IB2RH481qC+AQqwguInCMo52GVUBRT1YgrCoA2JVAdKhaTWvhEnISzpmTYeq?= =?us-ascii?Q?ng=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7cfef8e-bd61-4971-eb6f-08dc8c3fdb46 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2024 07:01:47.2055 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f7D5pNhYG/574vMsCEOodM3oempMM7u3A7ItG+B8xRv0mhfHM/mxcpDo9rrxrxj8WcIsEOP80W/155u4o/W8FWlMzO6AaAFgyN2oxC1yJnE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR13MB3831 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 From: Xinying Yu The ctrl words of vDPA is located on the extended word, so it should use the 'nfp_ext_reconfig()' rather than 'nfp_reconfig()'. Also replace the misuse of 'NFP_NET_CFG_CTRL_SCATTER' macro with 'NFP_NET_CFG_CTRL_VIRTIO'. Fixes: b47a0373903f ("vdpa/nfp: add datapath update") Cc: chaoyong.he@corigine.com Cc: stable@dpdk.org Signed-off-by: Xinying Yu Reviewed-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/common/nfp/nfp_common_ctrl.h | 1 + drivers/vdpa/nfp/nfp_vdpa_core.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/common/nfp/nfp_common_ctrl.h b/drivers/common/nfp/nfp_common_ctrl.h index 6badf769fc..a0e62b063d 100644 --- a/drivers/common/nfp/nfp_common_ctrl.h +++ b/drivers/common/nfp/nfp_common_ctrl.h @@ -184,6 +184,7 @@ struct nfp_net_fw_ver { #define NFP_NET_CFG_CTRL_IPSEC_LM_LOOKUP (0x1 << 4) /**< SA long match lookup */ #define NFP_NET_CFG_CTRL_MULTI_PF (0x1 << 5) #define NFP_NET_CFG_CTRL_FLOW_STEER (0x1 << 8) /**< Flow Steering */ +#define NFP_NET_CFG_CTRL_VIRTIO (0x1 << 10) /**< Virtio offload */ #define NFP_NET_CFG_CTRL_IN_ORDER (0x1 << 11) /**< Virtio in-order flag */ #define NFP_NET_CFG_CTRL_USO (0x1 << 16) /**< UDP segmentation offload */ diff --git a/drivers/vdpa/nfp/nfp_vdpa_core.c b/drivers/vdpa/nfp/nfp_vdpa_core.c index 291798196c..6d07356581 100644 --- a/drivers/vdpa/nfp/nfp_vdpa_core.c +++ b/drivers/vdpa/nfp/nfp_vdpa_core.c @@ -101,7 +101,7 @@ nfp_vdpa_hw_init(struct nfp_vdpa_hw *vdpa_hw, static uint32_t nfp_vdpa_check_offloads(void) { - return NFP_NET_CFG_CTRL_SCATTER | + return NFP_NET_CFG_CTRL_VIRTIO | NFP_NET_CFG_CTRL_IN_ORDER; } @@ -112,6 +112,7 @@ nfp_vdpa_hw_start(struct nfp_vdpa_hw *vdpa_hw, int ret; uint32_t update; uint32_t new_ctrl; + uint32_t new_ext_ctrl; struct timespec wait_tst; struct nfp_hw *hw = &vdpa_hw->super; uint8_t mac_addr[RTE_ETHER_ADDR_LEN]; @@ -131,8 +132,6 @@ nfp_vdpa_hw_start(struct nfp_vdpa_hw *vdpa_hw, nfp_disable_queues(hw); nfp_enable_queues(hw, NFP_VDPA_MAX_QUEUES, NFP_VDPA_MAX_QUEUES); - new_ctrl = nfp_vdpa_check_offloads(); - nn_cfg_writel(hw, NFP_NET_CFG_MTU, 9216); nn_cfg_writel(hw, NFP_NET_CFG_FLBUFSZ, 10240); @@ -147,8 +146,17 @@ nfp_vdpa_hw_start(struct nfp_vdpa_hw *vdpa_hw, /* Writing new MAC to the specific port BAR address */ nfp_write_mac(hw, (uint8_t *)mac_addr); + new_ext_ctrl = nfp_vdpa_check_offloads(); + + update = NFP_NET_CFG_UPDATE_GEN; + ret = nfp_ext_reconfig(hw, new_ext_ctrl, update); + if (ret != 0) + return -EIO; + + hw->ctrl_ext = new_ext_ctrl; + /* Enable device */ - new_ctrl |= NFP_NET_CFG_CTRL_ENABLE; + new_ctrl = NFP_NET_CFG_CTRL_ENABLE; /* Signal the NIC about the change */ update = NFP_NET_CFG_UPDATE_MACADDR | -- 2.39.1