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 89D394573C for ; Mon, 5 Aug 2024 04:13:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BC89402C5; Mon, 5 Aug 2024 04:13:18 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2094.outbound.protection.outlook.com [40.107.243.94]) by mails.dpdk.org (Postfix) with ESMTP id 883BB402CA; Mon, 5 Aug 2024 04:13:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cqLIByV5tVHCbRnjXsMAD9YBHaIxVBid8tt8RaaQYqRZmYMfO7vkXCoGlXSUEBAbF4idFrJ/iHovhFgNQtCzp9LBNZaOzgsgcbpe1cFlIeF9gZXOqqUf/IrV7GbR/s8ksW48N+scKMWmXk+ZQfRrEQLV4uvy//QePJGl1GL5R1XH7j5dDHBg39b5DVWrNnqGwQiNO2HSCuNnv8qxHNUl8+uTGQ4f3dHrkakg7P9mNywmvTjfq8msnaps+N9HIdMTrKOEBElVu16MNhSeSrBvgNhW0P0Lge8M8LNdmYDPi8zFpbn2Oqj8dp4UhW78StK4ZNyEZy2HsuU6QDzwdyH3Vw== 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=YGD0WNjxPTYQI2LMCta7hnIIdK7uTk433A7bhJUYi5s=; b=a3t1ZDlL9X4T3/DRnIggIpcKhIoUDWQa8HLjAGYva3zyoxVnSQD973A7hRe6Zdt3n4PGsyayGvMCB61NI7UF1Dj7N4mj9lQGf/790XXRbEBxI+uckLw1Gic5m3uyZ6crLZP0Gx+AJe6lghSLUSeaq7IpRyqREabmKbA0ONRzjoNUuQXqGBK2SvpKQUoa3MC3BKqq8xFAFMhL+0wNhaoKb44fvHEOZBpayYnKZYSkxF4oGbwtuPpsFVoy2hDddgMP8l3wF+5/Fvd2FHOGgyqkIXwf9NZAUim7FkfRKWm71GKpACPprjwAZVZX/oVhXEDlIYszPwWL8EToDO4qiUWr9w== 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=YGD0WNjxPTYQI2LMCta7hnIIdK7uTk433A7bhJUYi5s=; b=lJustIfzYafKUnJys68HxnvnkZWLFER7oLGZpett0HWYzaK9fPZLr5yhvfoXS9gMQ5Zz1Cs4oGUCHt8yXwvp3Jq+nrFpMfOCwjpNvcUShAeOPy+cDUdsiB6SdCUnV4TpiP5eW8dts6kesdWuzEjtqJHzIjMIIfdAW4p2rhauYL0= 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 SJ0PR13MB5896.namprd13.prod.outlook.com (2603:10b6:a03:43a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Mon, 5 Aug 2024 02:13:13 +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.7828.023; Mon, 5 Aug 2024 02:13:13 +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 , Maxime Coquelin Subject: [PATCH v4 03/11] vdpa/nfp: fix the logic of reconfiguration Date: Mon, 5 Aug 2024 10:12:40 +0800 Message-Id: <20240805021248.1051198-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240805021248.1051198-1-chaoyong.he@corigine.com> References: <20240617062708.2932037-1-chaoyong.he@corigine.com> <20240805021248.1051198-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR01CA0050.prod.exchangelabs.com (2603:10b6:a03:94::27) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SJ0PR13MB5896:EE_ X-MS-Office365-Filtering-Correlation-Id: d0763a4c-eb9e-4121-0124-08dcb4f428b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ZCuec28L4Eqc4kBBDQMTydDpXiK8abZf+t5gUUGz3DpJuHMLHlYOq4ID3BWK?= =?us-ascii?Q?C/C2mgRYtEpA/8VvSOYq6uirSkuihkAA7uh5XEPCabl2fG0CRo7muv92JmUt?= =?us-ascii?Q?6jmnkINgtwnoyJZBiApVgSFXufZgNH+jPopkiQjDT9aFvKZYRAs2FrukfBp8?= =?us-ascii?Q?oEdit0wiP1X12yYPx1Y5nWi7kUqJsQlFAJRR34Bj8O4PFW3vekmWawvkp0Zk?= =?us-ascii?Q?eD7Pe9kMXHN2gilsk1kNR7evPmEupjL8CIyNcjoQrmw853YlU8kTpSrthQ/j?= =?us-ascii?Q?3mQ3lKYEsrfURYqBWIDjanSr8JzQ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?Q?VKOq9I0GYEIQDELN6YnOPyjaaz22SkHdvQKwVgBqnVZ7CNq4M1aVZnYMmkbh?= =?us-ascii?Q?X/50gGLhPPgDc8Leb59g8cZ3uNxp/3eCHXNCN7+3bH/8yCEDHwXKzB1teJLV?= =?us-ascii?Q?jDP2P//mp+UYrVu1L9UEi8P6mXbQB3MPwlgXir0pJCuZqmfUZMhjrih+W5bn?= =?us-ascii?Q?QmhJLMPhXBRTBbkFV0n8E0nF0Mt9sts4llLoRb04rRWMtCofTg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?sInCdYaLm4EsCPx/Z9lwtTib7rvRxs8ug76Knmp/6DOPwt5U+FBVk+qLCBVV?= =?us-ascii?Q?hlsqvuYGQMJT4Z3WRGZYxGGuPWz2pHTg/cZb5zMDjj+fDyHrBfnBp0sN62XZ?= =?us-ascii?Q?qDNjedzTWtpJpnRMXDrK7gihch58E7eMKzjNrNy4eztBdDn2EKHFpa7fVZFa?= =?us-ascii?Q?6AigzijoUcsAEOSAqKbJK/swwoardEC0jdRmYjDVAuNOZRVDlmXWRY3E1iXJ?= =?us-ascii?Q?me8N5wOfsd81cwnhEWGJAIokTbL557GmqCOE/DXh8HYzcLRnjpC3NFvO02ZI?= =?us-ascii?Q?I9giKD+VpSkdu44O1f7MgC1+0jr3Jx5bT8/j/31kXW6hQUPzJT4aFmvCxMiT?= =?us-ascii?Q?/wgbc+4HpBYhmhgBvLTosi3boPbTs8TsLSIV/+5+28/mj9e36IYSs5m7DyzW?= =?us-ascii?Q?m7SRsaTx0jSDeg/t82QvwtCd94nuAoB8LPx/WILVB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sxUWMYC8BfDEE1Gp2tE2LNhNtrHST9BuvJ9imOgmqTS5OUusQkO1NYfq?= =?us-ascii?Q?7cv80BZQzvFCLG+exJpeeCBcBQlmhEx/3cbfcEzePkG0blXIndUCiJtzGi9b?= =?us-ascii?Q?T5uP37hetoURX0iqq7aix8ZYbEOBt0IBOFTkg44flRsWabcNJ5tZDh1sBq0W?= =?us-ascii?Q?f/vBOI/6EH7l3pMZqB7Ek1B+nlzr9jrwYHw1Xkn18+iPUGMlC/773sUw9tuU?= =?us-ascii?Q?u8zOnBPr1Z0rdTgDcd7+kLrOfzVbJWbw4jrk8nCo8haVl1JDEyJhTwxUh1b1?= =?us-ascii?Q?hg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0763a4c-eb9e-4121-0124-08dcb4f428b3 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 02:13:13.0466 (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: hqtFdbd67TxNUsU/xSIaZ0IDFo1cnS+9pGnX5I5E9FD7wMuE1SHA0eS2ZI6sSTpZlckrZi0wiQU0L0jJ1JHtObBqvccvyfLjSnlfwAXAZME= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR13MB5896 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 Reviewed-by: Maxime Coquelin --- 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 69596dd6f5..1b30f81fdb 100644 --- a/drivers/common/nfp/nfp_common_ctrl.h +++ b/drivers/common/nfp/nfp_common_ctrl.h @@ -205,6 +205,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