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 736724547D; Mon, 17 Jun 2024 08:28:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A44AA41149; Mon, 17 Jun 2024 08:28:00 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2135.outbound.protection.outlook.com [40.107.220.135]) by mails.dpdk.org (Postfix) with ESMTP id 4A3FE40DFD for ; Mon, 17 Jun 2024 08:27:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Em3malTHkIAuzniSjwr9NYrqt/bmCIItGDe+ldwVKtbHu36gBYTI5nF72O6kpTCNqlAKfDCQNaF0qkNaSwekTgzE5p0vhQEmB+65++xV1BwfJaeVsrQeTwqSfOBQb27ycuUdIJQCvtCbS4hfN664lWcfhGiNXA3oSXVlzHTQjTkmwUwN3AoKUyx4BRz0tIxbufIKPrdQ2oaBePqKo5BvCsO7l90nro5FQgVF/HGL+56+Qz/8angOci/hlQI2v9Lj7cmON6BzvnwDKUsUr8/j0fBFuMvSCocWhLwXVcERyJk1EynZBum3TjGP7rbOKl1mtXaqAkvxxv/CndKt1ymBhw== 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=Cbbc4Bs/kJMkfQ7mVMRr3x+o0bY7jvRmVsqdUD3WBsuZhQkMtxNtMUFHGkr35s2HI3sPGV0D8vpirWy6qujUYqXJlzN88yfaTkS3SGzdYwuxrb5tsI8Vt0OwxTU8vBgbhNKwhsUk9GfGCEkBgTN+wQC5LXKAs5JBS9MErYd+rVT+YQc/u8E/Oba0CAHADM7Z6m1+vR7HpCvWmwV2X1j6fYFP4SjrwEfUR0zuembld+sty+zu6iXt5d1CerFOrXweBAd9+FDmynZJe0BmxVcr1JvUaHvDCNzbADeiVxkAMMg0OHQKEXRAlJME9OspjqWxCqjyaCfNuVUNMlpSZ77fXg== 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=u1R2+Z8XLEYqIivksPOaQGdFy2cu27/fV4tp5ta3urvnW0CIFSI6PgC2TRmCRJNA+cEcqglnJDkBYVyiHsjW7g3FzmCraEI2u4T3ovJGwczcpKXvyIX9S8fLGoy3M4qXgQtzjyTBioo/6CLk4c7bi+nBq+DV8nMGJM0XxHPIHCQ= 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:58 +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:58 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Xinying Yu , Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH v3 08/11] vdpa/nfp: recover the ring index on new host Date: Mon, 17 Jun 2024 14:27:05 +0800 Message-Id: <20240617062708.2932037-9-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: f13c1c45-03ad-4451-0771-08dc8e96a102 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?OHsjjP62378I+xnQ/QQLDWJorAYRj2m90vU8Oj+M1PRbjHrixkpM/eeP3CVU?= =?us-ascii?Q?Lp0jVGWDZUOuyKRzhEQ5WYghpPPG8Rxsh9Tz07wgCRBwaoV3mMW2xKxCIMI0?= =?us-ascii?Q?p4Cyk4kdAjTcaAOz7HyJsygtNYjLVBgdrhQcSvL6eW7eE2QFvooB2ADqre7X?= =?us-ascii?Q?s/LHUvltavUvC8PmnsVYSwAkV3Ia8AW/5Z/A1amNncEdismbFro/lygwgN2Y?= =?us-ascii?Q?2bbmZnliC67kXr+LTfyuqMnjJtKyLI0kjX8rgLsOK1DslcZIA6vVnIyuEV8W?= =?us-ascii?Q?+F3GD6N+togEaBOMge9of7TjG7lqg5g1Fa0UJ2lRMf0FS8hyO7b1nqg9gIWN?= =?us-ascii?Q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ZG94Pauozz6eBqk?= =?us-ascii?Q?PwE0uN0cAX630MjSWxJneSGm21L8f6whRnYJtk43Vv0506kfLEt8PWkZPFyk?= =?us-ascii?Q?0JPtdmzgwFY3UA3Z1G2AVkBG3K8ZhgB0R5pXnHZy9SqZ0fOaW0oKHnBwiT6u?= =?us-ascii?Q?6Ndl36g=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?sfLZVW5qDv8P1So9iyVw/Ko+AUA+D6yZzVF0nSNCRETHyRx/D0MuNWAwCbZy?= =?us-ascii?Q?4Kc+owGKTWvO+wNyRRr9jdtudy1gTww4qNXur3aZ5ZkZr5v3kwNxwhBnCK3M?= =?us-ascii?Q?v4hiqYhYzcdhneUwnIZZLmOJCWX5f4MqCTBq/PUQyVu+WIwzQVNTyZRkkxPN?= =?us-ascii?Q?fYjhIno0K74lh9lRvP4HFIiqFmRuyeEgthKuwkSSASJI0FGZMyI+JYb6LNTb?= =?us-ascii?Q?sKyb9qfy8LrpGX8kqp7Z4IyUMS3l+X0Wc8QTYzUwfnoPdy3mn0qxYe3mvfv6?= =?us-ascii?Q?A1sq8rErMTLqVBt+txyOgw9755S+3oHPIfgDgNBX+G5+M2fTCtQ+aGl0Hcza?= =?us-ascii?Q?WHZ3flVBnaFSIo6U7BiLk5F+nrQFgKt88XyyCvuerd+mz6mSVuNqMHnMFbeW?= =?us-ascii?Q?0dUjLIx+ssXCy4ydQFwKGXBsX+kd4xusKG07PQmIvLl+ufHhSS5SFqNvNpNp?= =?us-ascii?Q?z60s17j5WoSdeYBR3H1F2Zle/8S99Uzo/o/qUWaaM+2bgSC5JxI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bN46ggacSL0/OVcgHtO0xl2uAJLegZ+5sje1x?= =?us-ascii?Q?mu2cDASTN0uMpXEB4GQ8q9eM1CXWvl25Uyc529l2fvznAHTYn396b9S76hhw?= =?us-ascii?Q?HE2yZnSFsToA/RmgIokSjL9oAsokD6pnfpRhsocQZPJxk/9vv23ws5waYKFC?= =?us-ascii?Q?smmVFARCkaa7pG14+GxRc6Z32LYTSEIWhgapZGPnE9G01tLH4oEAGV80uXlQ?= =?us-ascii?Q?jQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: f13c1c45-03ad-4451-0771-08dc8e96a102 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:57.9036 (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: KfAUAkFhARY9IVGx8BtgrSilcWu3ZGyruU2RkCq8E+13VIIF1Ragm9q1IYqc1DfoNUzlJYqcR8Jl0K7ERzxkBOE9FJ82ZtAowEFs4lNitY0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR13MB4106 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