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 848024547D for ; Mon, 17 Jun 2024 08:27:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1EB940A6B; Mon, 17 Jun 2024 08:27:49 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2134.outbound.protection.outlook.com [40.107.220.134]) by mails.dpdk.org (Postfix) with ESMTP id D00274067E; Mon, 17 Jun 2024 08:27:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QnC7VkUjSWktWov39Eg6DDRu69O5ia0vJCp7+zgDPTSo+QxS+hgrFZB3FeG9SelFvV6T8SKyECQx0Y1jO1muV3HrzZfh8M/wYAckDfZzSWh5Xx4hgL7zLKH/Q/XxSVDb4gEYKRriZ656BQQFc0qLaJezVbgqkasE8gB9lmoWb15Xqr6x28gd5qOqfx0NZpC1Hvzfzaj+HpMYHY6Uhy8RPzKY7GYjGNzdwQX2LUp8n/T+RANzcHC7ncGcMjtelfnsdubVb9D7RjvN4cNb3QqvyZqM4ZxlMuQywGJq0X+412QX4b8N99JocwSAbne3xH/xF4wSvIByfLgFmi1eEvImKQ== 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=Hg9QF4mxA18j/6DWF/UkCO8HlSH3tFskUuJqFh39ORpYBzmtjTYiTC6ZaH79zLV/kPOLZHxc1B02ZE53AB8L9frYrJ+pLeTBLj47CSlLdJrm8bDZ8kYZ85yze8FU1Ui42E2qKGaUUaxGamGBLuhFfKsrU2cKzfatU4wpQY8CZlbg5xmKaNYUeHvgbYAhD/XPWG7f2lZc5yTY+XKGXbprUcN7r053iHmcmGZDnbioUOka2RFmzoWZX+rLFWij6TpT57KBJ2haG6wANBKYRr9dW69rT9dB+yAUvzJkpxtT529pRIpSh6YPQd44h4DT22yr+kI1V8E0tbqjq5AQgnGb7g== 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=haw2w88VJNtB/TTrdrfz1KO7KheknSNBrv3627yM7eIaZ1NIToMns6Sve4zq/uEevTAAw9u+wUhWdFIHwjlQHgW2Z93hjT0mevWP2x+naB0gMIiCPWpvNF3lZUwmwAgqGNQJGe9dAZnG4FhN9/IwcQ1tQpM+O5dk0koGwo0qkPw= 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 MW3PR13MB4106.namprd13.prod.outlook.com (2603:10b6:303:56::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 06:27:44 +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.030; Mon, 17 Jun 2024 06:27:44 +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 v3 03/11] vdpa/nfp: fix the logic of reconfiguration Date: Mon, 17 Jun 2024 14:27:00 +0800 Message-Id: <20240617062708.2932037-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240617062708.2932037-1-chaoyong.he@corigine.com> References: <20240614070120.2663160-1-chaoyong.he@corigine.com> <20240617062708.2932037-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR04CA0175.apcprd04.prod.outlook.com (2603:1096:4:14::13) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW3PR13MB4106:EE_ X-MS-Office365-Filtering-Correlation-Id: bbadef03-bb0b-483d-d616-08dc8e969923 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|376011|1800799021|52116011|366013|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?pQl2zFFz3Fi4QWEkAaCVUyhPaD0wjC+jCA1eAHf266RmEahGkokWOcImrm3b?= =?us-ascii?Q?wNiDg59eL+/XHZaQKdyfuSzOyMli7C+aUO+hHO4SG7hrPBS9MpmSPrU7R4Ra?= =?us-ascii?Q?iBltZLtGuNLsN3umMrNXSf5CzByU/PN0yX2YVEQmUvXaZ5hHcd76dX6lUnDz?= =?us-ascii?Q?ctjIkIEVSIVnjhtEkUptFvFmHFSGYJmD3h+/5pHWwRcNK3KMDq6YX7zDv+l1?= =?us-ascii?Q?ep8T38akuwGf1g6x7V9DTQaZ4mdQQDKd5J+AUXRjCP7yN1JmVVo1SmE4cRCw?= =?us-ascii?Q?xk6zZEpItNf0X5JWRnXjNAbZZknmAKGkrqDwdD5wNZmcegGJlGu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mqa/Xz5fa+3ycZiZwmZ06EP4p9jPVvLv/1mES7poarWMSV?= =?us-ascii?Q?WNvKqn+84ChtYs79iHstmGGLpdfZLq4E7/aJEr0baAQJ7GOcISWIMXjmf+wH?= =?us-ascii?Q?X2dbyFqJv1i2DYmk8ygVj4bJMGG2YVxDgKSVqo6W6Cqub+tk0WiUBjWjRMKV?= =?us-ascii?Q?D1AKxeU=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:(13230037)(376011)(1800799021)(52116011)(366013)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HA08+vS9k8zpcR/eOZGkjHRuUa2EEFaTN8jMDReyXwZ9SlRv7ImHVeUljZtj?= =?us-ascii?Q?CAVEJ7mi9ulUIPXKQYccigz8hz9qjamS1Z50uBNj2BEEBIZfJMAWLkyVWZyL?= =?us-ascii?Q?Y2cMRbL5bZhrfp1bu//Q3LlY/t15RyhStBPqVQhIbPcJWdoBfrsEU2Q0A1Yd?= =?us-ascii?Q?+9WYLkzh/jg2v+d0JJHcfweyIPARLINjpHeNjOzL1+7QMfuSR7aU47odiLh3?= =?us-ascii?Q?u2eecHHip+Zly8piKJqeCI0m0V27O2I0eqEYpG1CeWUwR+3jR79ZKhfD0YBv?= =?us-ascii?Q?ZCcHLyVb383wVOae3MqQ5ZGw7ey8H0rAFVrVp+6KlSxNw1BEiFKuWlp9F4Xo?= =?us-ascii?Q?1Tt4nE+NHSJh/9SBZ4A67pRbhTiq+L3fr1Sszq0OuOX5Ke0Kz/93a/hjvFk0?= =?us-ascii?Q?Tmc7/jYNApWKdgo944MaQDi4BfzwvX06CyFyJyvb0FTh+ue+U/TuVI6E/TG/?= =?us-ascii?Q?yCv3CoSQgbYxToE0Yohx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CmqyVvJt9CiRvex?= =?us-ascii?Q?FjuoVn9X5wWihN/H2C9qIZfXNSChQGCqI+ciM4PtojTcoTgW3XhVZwEV82Dc?= =?us-ascii?Q?9Amc9cyTM/6I4e419NidOV41g7tjAunlKdYdqIqIXJyBJJq7PX80BWa63SqX?= =?us-ascii?Q?nsedK0RYkVQfiIyZBpoSCeMy4z0f4dDSiAAS57jlByZ5mppWMkddwr4J5b3a?= =?us-ascii?Q?YanhADgPIZ4DNqrdHK0iu41a4rt7okl2CU9I8s4NmTOpF/qLjkeelITDOW5a?= =?us-ascii?Q?5w=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: bbadef03-bb0b-483d-d616-08dc8e969923 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 06:27:44.6833 (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: HrAE0Ne08i3anX+fJFKV4rnm3FuHHwXJGCfVXIN4t++fmQGdDvZyQW+ss2in7o2f+vIfGyqFDFfIAOL17F4TNS4JkJrXYYktMv3cvQQVqEo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR13MB4106 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