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 B81B043F12; Fri, 26 Apr 2024 09:50:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20B4C43CA6; Fri, 26 Apr 2024 09:49:13 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2099.outbound.protection.outlook.com [40.107.100.99]) by mails.dpdk.org (Postfix) with ESMTP id 7EC2543CA7 for ; Fri, 26 Apr 2024 09:49:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=duJA3eFC/1ztO8wSD6d7Cy+nhXI8mtPNANur7S2Hbnhyke4BlriCftz6XpxDhEvN2yQFTo2UugYeiPW0SwFn3pHPP13Xp0kLeJ/9ikw7icyTHt0IrJrUFK+SvaE1WtM8rPC3V4dqYZ+KjUc8M55DrgkAHkTeD6/RBwze76W34ZsJyPJ1rfthGxJlphoDRuemnIiO7to+hl6ypSYMb1SwGz57dvaUV95FRjyasNbzpAMg99nnj6JDFDR44ppmWFud6/vPZvcKDUEqrL3iEix/J8hjSjQLbBEfKuJ83W2KTfQ8o0uESTBNtuUq3KAcAOnHzKxx5UfWu2Ff1ntpHY+FqA== 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=924nGm0GtaBdL5nSnBqg/MTlA2wktzOcSbYcml8W2eU=; b=HFjqk0Zsc0sbJPNiqY4pQYqTUq5VsF1KdNXA73onO74d+rPgsNYdSRp3jNXU1a5F57+fZkMj9Pb8/jUVvBugNDVxJCPVL0kwd3AgiX4GjjawZMZj9Ry2b6ZYfJQqxm6XONJ/elWxPV3LXg394sISq/Jl0bXkD0s6GPCdGHLdecHZYdw7HxD31utktMoae94iEFequIw7zf0dryNjClVFT6hqi3prdYsPnmGyd6ifI9KMleJewWe7YkIRBwqwLqZFjLGg1WpPnhFC5ItH/tQLFjbtcCbSI0gaxrvJVfkx7TLkxXtyMiVI4yBOELeb40E76mnU3BSkZUPS8oSP+ZFA9g== 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=924nGm0GtaBdL5nSnBqg/MTlA2wktzOcSbYcml8W2eU=; b=hY4aNB5sWBMMRZiXq02hEkhihYdMtpBDdvgjJdMCA29YxpzCGsHKT4Zpx0I2uAbzT0317QbvE2ZX/8accFS/IkJl/5GguPJx8+PfLQ/uhxt7QaOsPSplAOrNrffLhVrx3ijy8Hxs5Mppa3v7Yb9ZRM0vViq0JZEfhFi97qfQfVM= 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 MN0PR13MB6618.namprd13.prod.outlook.com (2603:10b6:208:4c3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.11; Fri, 26 Apr 2024 07:49:09 +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:49:08 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Xinying Yu , Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH 08/10] vdpa/nfp: recover the ring index on new host Date: Fri, 26 Apr 2024 15:48:29 +0800 Message-Id: <20240426074831.1729792-9-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_|MN0PR13MB6618:EE_ X-MS-Office365-Filtering-Correlation-Id: ef3d5c9c-58dd-4bc1-0f3b-08dc65c55a92 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|366007|376005|52116005|1800799015|38350700005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?1AxF67ruS/rZNon4ANOMT0CmZ4nj1QsI4b7QhDetDrwSZOtzosnGP46Uij2v?= =?us-ascii?Q?YiASaw2lhPykZo1LDYAJ+Fg9ucrB6RJay9dqEUuhx2fBLraI9mS0rZ9lr+BV?= =?us-ascii?Q?DsdoeyL4Z8pXHkNHX6cuAysRmTctIxOPTmHEj73aVpEKweQ7tt5IwKJmK4jJ?= =?us-ascii?Q?mCYkD5EPr9SWar5+FVSm21eUpfy1GHu17Y3pUbg2g9i0JusG986TfFd9jnwk?= =?us-ascii?Q?UF/Ge14X+xBnIPXM+Sx9eqjgdxs5N4o9bx53rH0ebIp0QS+pZ81Hs3lpV8US?= =?us-ascii?Q?M2xzoAFoYevNp4T9m8284WtyqFjFklo1O20x5/EWZQuT0e6cXjZST8y30IYM?= =?us-ascii?Q?xio54B5NY+ar0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ACC9O?= =?us-ascii?Q?iqs5aAVA4wCx4cOKyYotbGIKWCsOGRe2oehy+96D6TzvnyZjE9CpHhmhEQNL?= =?us-ascii?Q?Xc5ahGe3UAS5BJesxIsclCaFLnvfgzq3oSgCmU60or9zSw=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)(366007)(376005)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?RXT6WeJ5fIUhMsJuEeNTqUduzNrwcFZ9cfqNqNwAL5lgmcOc2AbBdna/lhIx?= =?us-ascii?Q?wRpAzL0gKY7cNnVshQO4YD3bOzxhg/G8IvLzlyNc/5Yw6FQDk5MRK8s6/4+2?= =?us-ascii?Q?HyEWtesfQ0ZOmZurN+yLUBwi8bDHusRzrG0ltksuQbLfDGwBX4T23XISCiLW?= =?us-ascii?Q?3dnl29G1IBQEMyE0nb4ifmAieUBJhZyxtzkrypY6g1QzKuBd/MrZPtw7AMlR?= =?us-ascii?Q?y4IEqNnakA6Pd73bA8CELyMf5txmn5VdGNKCo9MiPkxdT70unZycmVUptrJP?= =?us-ascii?Q?/ut9uXr7Yw6PdmrCAVbb1rroElURp/ExPkLaAP+O0GfIBfMEgfT7cv3EylCQ?= =?us-ascii?Q?X4M8QswVYl8ISbLR/G6dIscj4lZRx63zpsvUMNXwS4bB0E0PzZTC7AuaerEN?= =?us-ascii?Q?YomMyspm1xxWvCwFrD/C/5qlDxzCKwaYe+JlJgJKZobwsFtk66jIIoQdGfhS?= =?us-ascii?Q?SHdsaPv91pro9inXT+Ol+4JyUmZ5SlduOWAhGDB04LEGX99aEnFR6R85pPN5?= =?us-ascii?Q?qvK7oVXAFyZfJ0y2tMu8wQ1RXC54y3iK5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Q?+6Ojh6wPgBpnUp+5bYfFHtK43i+wqMtAmEPM+c2BR0TWJaIyv9TA67XpduT1?= =?us-ascii?Q?I3jURbmylyOGCTmoCUq7UqhUdGUC5xf2sZb+TsXr3HhVnsr6XSI75JHP3xs6?= =?us-ascii?Q?bJFWye1HXWDaZhibR+e4/XI2WjLCnGIQGYfk4xhXCEvson0ys9QtLN6QIWtQ?= =?us-ascii?Q?3Q=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef3d5c9c-58dd-4bc1-0f3b-08dc65c55a92 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:49:08.5395 (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: fARzM9LlaTHhATwWCx76dHOc7MsbQ6RfebEWdwIRXsU5ozAOhTEm5OPBy+ggCKDwBBXuolq8UXSwCuuQyW/5YBRdUmtn7f+yTZCGfmnPGro= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR13MB6618 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 migrate to new host, the vring information was 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 63a69aaf36..8f9aba9519 100644 --- a/drivers/vdpa/nfp/nfp_vdpa_core.c +++ b/drivers/vdpa/nfp/nfp_vdpa_core.c @@ -101,6 +101,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) { @@ -199,6 +209,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