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 EAFDF45459; Fri, 14 Jun 2024 09:03:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2CB6427D9; Fri, 14 Jun 2024 09:02:18 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2106.outbound.protection.outlook.com [40.107.244.106]) by mails.dpdk.org (Postfix) with ESMTP id 53AD2402C6 for ; Fri, 14 Jun 2024 09:01:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GLLz0gFxNXbwplmxmeGNUZxBsZROwKWPy4sxrbLhFAcQWqcrFyWzLfFeiak1HS4JnuwXzV4aYZfUo1ok5dfU90fGo4ENcjtZ1m1ZDO8eECWoGy3b1gGsVM/VQAgsIrvTXF9VmSLxXtJC4Ezaghm6Kar+Igltc3VRtoTFfeAAyok0OS76LGGO0CGDMV0LP2LDMdDw3rlzulNqS4ouYCj6phRgF4hSt08/f+Sm0gXD4bBKwpch4FM+9zH3ZfPb9Me9ou1EnOOjAtysZ14Z+fRCU5jjQjgDSU8dK6IcOg76F5OJE0W8pVBHPtIj1WJiwpQb7IWfIB9r+O3fXfvX4qfExA== 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=6P769r3RAedlCYEpWzt/FljzpwpILakepdUfCvh6iJk=; b=KXOffmdzZ5yiQQ3yUIpDizL98i1bH+7qK+wNsenR1p1F8ur24ZWnmY1QbD1/FrytVM98Sww2G1cPIhNRk5mcApU+JCfMViIHoTltWddkyaDk+5o/6hHL9maq+ZxqXDgiHVCDZTbo3V/CNQ0XK34kwQo61B/qid6DDmGX6kebNAz1bO/V18TqWoRRgtc4TImHzCCB7PSt3mU5fuXS/mC9KlH5E4ROQwbvYh/gyRuISNbpacpc9OxVFceFZM2Us53/JccnuLb+0C37/nLSp1a317ios4vxRmW9MbOnGbLHDSkgKCH1VlM7IPeIAagdgMqkAkqgzU2NS4C2aH7fxxu1aA== 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=6P769r3RAedlCYEpWzt/FljzpwpILakepdUfCvh6iJk=; b=dwWf6872wyu8+0sd9PJBHvpMYHGPeCgfAI8jzfuhdDgsxTFzQjtnUBZ4cV189T13sAoJSUIchMlrog7v85LYt19gRV4vV1dzIERNV8isa0eNd7OwIQKXVw+MQaE4kFY7W22tx+4P2yEHgH+nGnGYLO5g6O1pqMkCA0lyotkU+O4= 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:57 +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:57 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Xinying Yu , Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH v2 08/11] vdpa/nfp: recover the ring index on new host Date: Fri, 14 Jun 2024 15:01:17 +0800 Message-Id: <20240614070120.2663160-9-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: 29026c86-645d-43a8-c1fb-08dc8c3fe190 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?BKITHSDtWZs4KwH4P4Do4Pv6uz7PPtAoMMGvc64sfVUxYISANT504egEBzh0?= =?us-ascii?Q?w+EM3xnSIWLJxTcjhGzURYtmuKwPCcldfU1wjLmq4utpIs21f4XFAOgdb74Y?= =?us-ascii?Q?5zizMU/hVwjyd+oeHjRAyYLJLSkvpaSX09KJ4xqcwatBOHrRGCqw+gRtsmM7?= =?us-ascii?Q?IYOi3+JEH5Ik905iS9eHZyZ6rahEZ7/1oyvn16aS6eER4HdCL2Dl3q4NqWBE?= =?us-ascii?Q?HyJ1y+Y8e/PivBKcTnD6oebEr8CZoIftvnVzvFgbwHksKdv9UM2ucRKbKPyr?= =?us-ascii?Q?/sfSkbYwSPjbWsgVF6PPFRFTAzpdWJfZtVjGgNmpoI4KQsTVaOPyDO5zzeV8?= =?us-ascii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hQJWYBxWjx7sFS6A4ca?= =?us-ascii?Q?yJN5cC+AgTZUDUV1tiGsMBuNpu9Jc+MJaaUjDRhioiMtvDF3TbTNJCUlEZvl?= =?us-ascii?Q?dI1RYW2gvkocWRdor3idlshB5/7E6odrw8dNbwdgZJNljBvVRYf2uvdJlqty?= =?us-ascii?Q?5TnWLjk=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?vYzMXiQoUm1cDuWzV/zQOaMTVr5ag8BJ9PDVZuuSxPY86IBjwU5ptYiGO6kR?= =?us-ascii?Q?9Snb6mJ/Q3Z9vquLI+55fwVYOw3rFoooZYfq1mXgpY/m2Sh1pCpr99NbuqrC?= =?us-ascii?Q?CjsotFIGnaLfz/egLsk5dj6R47mMyJrrOHkccv8uzf6V2yXioIya34fh1MCY?= =?us-ascii?Q?1kzb5k/HMd/YQbcztvADRIRaQVdOY6PwiDOJS1WbdgQpSIhRNnjS/MY2V8jU?= =?us-ascii?Q?/7gs60PxN6ofg9O74VfCu19Tb1tPv36zNi9IK1PbfoxpbN0UYNPRxdYa0ACX?= =?us-ascii?Q?TFtkuHnWshU44UTLXPDtAf7elMHs1HnpO5KiNu2Jz6WMBNfbJIv96893Kh8G?= =?us-ascii?Q?PYJKjvDGu6Z/hAG2eU/FmtuV9oMYv2hLPrOzc0xCCoUcKmcfb/Mnl9lL7Hpf?= =?us-ascii?Q?QKn+jT/VlEP8FzwNp2yaVkkFNPPjcmaDq221fHgqY3vq4DOA3Df7bxXHCmo3?= =?us-ascii?Q?o6dYEFwz6FBSzdxyWFZlIbdjOn7spAqHLvv3Q0EPbw2A4wRqs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g26/S8s2Wl0VAcxMW8eNAnhf/tiUo/9zs?= =?us-ascii?Q?JuRjsetwgQASONrcfgsT+0eqbpUmf57YNfz2yUjKQC48nD6BwJg+63hIhD4f?= =?us-ascii?Q?PaezPogPOraT17eMIES5fvS8lrAzdGOOCGsiRpZ9xVQQw7+mTU6NhTZSnom8?= =?us-ascii?Q?f/5uLTp4SaeUWQC5gg27Uzz8tlSUzbrwOfEWuaMCxMZMGszYF+j//6PqGid8?= =?us-ascii?Q?VA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29026c86-645d-43a8-c1fb-08dc8c3fe190 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:57.7638 (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: ard6ZbDNNXO2taD7Vv4+540ubinwDRdz6IK6eXf0Bgk/LQhme43YeYcXnzWDNseZgBMu5h53fcNT5mGfzvnpm8VMVsV2ffgeNtks6+qrLOQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR13MB3831 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 After migrating to new host, the vring information is recovered by the value in offset 'NFP_NET_CFG_TX_USED_INDEX' and 'NFP_NET_CFG_RX_USED_INDEX'. Signed-off-by: Xinying Yu Reviewed-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/common/nfp/nfp_common_ctrl.h | 7 +++++-- drivers/vdpa/nfp/nfp_vdpa_core.c | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/common/nfp/nfp_common_ctrl.h b/drivers/common/nfp/nfp_common_ctrl.h index 9311d01590..4b273372a8 100644 --- a/drivers/common/nfp/nfp_common_ctrl.h +++ b/drivers/common/nfp/nfp_common_ctrl.h @@ -193,8 +193,11 @@ struct nfp_net_fw_ver { #define NFP_NET_CFG_CAP_WORD1 0x00a4 -/* 16B reserved for future use (0x00b0 - 0x00c0). */ -#define NFP_NET_CFG_RESERVED 0x00b0 +#define NFP_NET_CFG_TX_USED_INDEX 0x00b0 +#define NFP_NET_CFG_RX_USED_INDEX 0x00b4 + +/* 16B reserved for future use (0x00b8 - 0x0010). */ +#define NFP_NET_CFG_RESERVED 0x00b8 #define NFP_NET_CFG_RESERVED_SZ 0x0010 /* diff --git a/drivers/vdpa/nfp/nfp_vdpa_core.c b/drivers/vdpa/nfp/nfp_vdpa_core.c index 2b609dddc2..d7c48e2490 100644 --- a/drivers/vdpa/nfp/nfp_vdpa_core.c +++ b/drivers/vdpa/nfp/nfp_vdpa_core.c @@ -100,6 +100,16 @@ nfp_vdpa_hw_init(struct nfp_vdpa_hw *vdpa_hw, return 0; } +static void +nfp_vdpa_hw_queue_init(struct nfp_vdpa_hw *vdpa_hw) +{ + /* Distribute ring information to firmware */ + nn_cfg_writel(&vdpa_hw->super, NFP_NET_CFG_TX_USED_INDEX, + vdpa_hw->vring[1].last_used_idx); + nn_cfg_writel(&vdpa_hw->super, NFP_NET_CFG_RX_USED_INDEX, + vdpa_hw->vring[0].last_used_idx); +} + static uint32_t nfp_vdpa_check_offloads(void) { @@ -198,6 +208,9 @@ nfp_vdpa_queue_config(struct nfp_vdpa_hw *vdpa_hw, nn_cfg_writeq(hw, NFP_NET_CFG_RXR_ADDR(2), vdpa_hw->vring[0].used); + if (!relay) + nfp_vdpa_hw_queue_init(vdpa_hw); + rte_wmb(); } -- 2.39.1