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 EE77343F12; Fri, 26 Apr 2024 09:49:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB62D43C87; Fri, 26 Apr 2024 09:49:00 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2113.outbound.protection.outlook.com [40.107.94.113]) by mails.dpdk.org (Postfix) with ESMTP id F07C443C7F; Fri, 26 Apr 2024 09:48:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CX1HKIbGvtpfaG3HcHT2Dh7mDzWpq2Yfo6hIErzdOb3h8dI/a178c0JU+HoiTHHXjyYlxRdq/v9P19pHLgvFJWSJsimcygtvNXvmWRpyYMoE1YuSjrziP9j2qpbI/2jqNNgyp812TsSCtEn2jUxhZh3IW0z1StnxCUozLQq6nWWe12441pPcNtEO17ZpFUszmmsYNvIZHqhVQCSrRlH7c9sY+IJPwQD9+H3jMWNLv1m9hZlA07jx3xo7KGJ35gW+l2KpEhQdewUUb6uX94rHrj/L5+V5NotyWKfrnPvRzbziZUaN8K8lyhiYi4j7MAt8AyT9+rxzwIem03x+Ivaq6A== 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=YTY/WVf+V0442ecn3lqK67icri8AUxZ9OO4UavpX7/g=; b=VAdZxy1PhWl/j+G0ljmm2KXTkEWWZYN80uGpt4VJIlN1Kk8xiU8qmYBUHmZqz9CGyNfliRAwnVCB1iCdiVwtFKwnrZ2q2fj0n7aVav5D1N/wtDBwUMqCXjH91OzpBSyOlYjec0peC6Y4DIUOet+4WuHEt4uilJbXhBHSr+OHQOPiPf83Dw9p0Rbqd235Gm/0mdsHISoU79v5AIOJk2RbnMaBUvbwy/z4irti2XcyPsweTQnMXBJUJwupxLkCKS476tTDbxjraaAxE3Xu0FfWBh7Up2DgoLmwLUhesbC0OJ7jBuyTRsqTjELVPQx1+uIPs4BJ35lGZzW3VdGgYZYD1Q== 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=YTY/WVf+V0442ecn3lqK67icri8AUxZ9OO4UavpX7/g=; b=CLYKcJM0cMBie8hDEjfTNxKrz8y0Q/ai4oBqSPZ2jseA9kMpGKK09j9PC4rOsWz1IbgeGjcOTGmKC63uDIdLLYNoyfb0xmPSwMF1QbjNR9OnUaJukppF3e19bfVnmnvuu9AQDdM9pPlN+tis9pLxAXJNkBfydGIiBMfomBWXP9k= 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 SN4PR13MB5279.namprd13.prod.outlook.com (2603:10b6:806:206::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.22; Fri, 26 Apr 2024 07:48:58 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ec12:7411:559a:850e]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ec12:7411:559a:850e%5]) with mapi id 15.20.7544.010; Fri, 26 Apr 2024 07:48:58 +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 03/10] vdpa/nfp: fix the logic of reconfiguration Date: Fri, 26 Apr 2024 15:48:24 +0800 Message-Id: <20240426074831.1729792-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240426074831.1729792-1-chaoyong.he@corigine.com> References: <20240426074831.1729792-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR02CA0007.namprd02.prod.outlook.com (2603:10b6:a02:ee::20) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SN4PR13MB5279:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d19a6e1-36b5-45f9-3b8c-08dc65c5545f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|1800799015|366007|376005|38350700005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?s8+WSLehGSiOOBb3MdOGwISDgtLGwXafLo+UBahmMFaoi7gUFS0EdGJOjwrw?= =?us-ascii?Q?1RXJgSc1a8HqVXQy45KPt0tMr5+TcIfzp/2KIrbXKlrLl+ANuAxLRrfh8NHI?= =?us-ascii?Q?+THO5JVQQOH3Hk0rbiwYoxDPSZcMRV/FRNiksgtskt+Gs2XmNiCqK41gvNQi?= =?us-ascii?Q?JFFwAdlFXp9tHIsWw6gzq/tW5EuJIX7IQV1mOmu4haisdZfUpF2AV8VcGjrr?= =?us-ascii?Q?5ty1kMjIo3gwkgxxb+l+CjEbLhXcHzw/BqIpvke5+pHlHzG3n3EnPuc63+NP?= =?us-ascii?Q?UT7RuJSu90w2QQT8V5tuQP1amr9X1+57go5XcRticYWJzZJhXb0K0jQQU36R?= =?us-ascii?Q?kuR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L4w65W9fmLwVSb8Xi?= =?us-ascii?Q?n+BOL1Pp/RNbAVTf9tleIMSU1+pqo5rO4GRsfp8ugqrQXW8Gnzf2YgnspSHW?= =?us-ascii?Q?ULR0i6aBOJnPZ+kG5/yEqiv+1gagAHD6J6hMzV8EaC68eA=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:(13230031)(52116005)(1800799015)(366007)(376005)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?8RT2aDGkLnc+qtsXdt5kERIHtM8Lj3m0VEDlwU4lcWRY8bEGKe3wyM5QFCxy?= =?us-ascii?Q?kA8lTLcOhWFPFKYv8hTLW+PDX7yFW/QM8OEqM4SwvMG1ewtVFoKXwfunmUkd?= =?us-ascii?Q?m7xbsumaGYoYd5WQdQKbBK4Xu/zi0UpVRI0rRMggGfnXE2b8RTqGWw+DutVF?= =?us-ascii?Q?HtAc5Rc5sPO9oVq99/8jG1uTKTKQNQuMU1WA8q7DYe0CseNf+Ab0mlsY30to?= =?us-ascii?Q?FZuJSKW/8AT73NwKzRr3a45Z6Sm6AbTO1GW6UOFOXJoiYk2JLOqF7I5jLlU6?= =?us-ascii?Q?fFfqQArp8yXJZKyu8+Fs/F1b4PBYgWOCzsAdMX8r/RA17SjAiPrlwYa2UN4l?= =?us-ascii?Q?9k9AbTGFrFKgoo/pBQGIW16OX2R1xdqbzGCxT0KMrAiCWA8lo+fW7qPSnCo8?= =?us-ascii?Q?gnjzuezr+z/CP61Y5cucsv1NNxcVr0bF4Z6xTjKFbS3i2TcYoc7YCGrMUQ6G?= =?us-ascii?Q?1MT307ojn9pRhq8LlmOoAG8JjOZfuOHJVOyb8bmVpb4KgyG8O0tmh0pZdl2V?= =?us-ascii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NqXGin4PP/g8FNRH1HPopBP8f?= =?us-ascii?Q?jQ8ovpJK/AYVsuCo3L0FsbtA+53WnkyPAlBl39SEWoW09OHVpw1gcofPORNO?= =?us-ascii?Q?Moak4lK+mrxZFGVKEKtHz4vHWZ+Ap0z7vAAuKQyY5mkfTSVVfYmNFs3+zSKK?= =?us-ascii?Q?bg1C/w6jXq/kMGk1GDYfvO2vE0VFnN341/N1/qx+E2SMnQS3nDXrlcJUD7b1?= =?us-ascii?Q?6A=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d19a6e1-36b5-45f9-3b8c-08dc65c5545f X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2024 07:48:58.0862 (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: fsHOPYLqPkwlZjBIV1jkQguBkP6Ee8iqd5zrBMOMMXaVTJUcoFQuDX5pF3vN0K51mnuSRkQ3k554qs3rL1cUMYm4prhRcNq9lkaTyRbRa1E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR13MB5279 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Xinying Yu The ctrl words of vDPA is locate on the extend word, so 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