From patchwork Wed Aug 30 02:14:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 94 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 42CF141FC8; Wed, 30 Aug 2023 04:15:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C907B40277; Wed, 30 Aug 2023 04:15:26 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2125.outbound.protection.outlook.com [40.107.220.125]) by mails.dpdk.org (Postfix) with ESMTP id 2F68640276 for ; Wed, 30 Aug 2023 04:15:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qh5j7P1p6q+gqgaNY3k05jrfcvgN0lSuQz/Cgz9PHFl8i8bQEViYDj3sB4t6fsFE9N305EjXovCLxYyc81wzMJpNOzefAenyeTHk1fmcLoWu4yY/AWpKV05KOrR94LGwAKy8w24BXnWKxt6BHJ4rtZXwkDZcYHm9wh9N1l1pkgSVhlzsLVZmqkw1jxurcklz8Y+vD0oZrAGbNGpprX8ikMdobvuQ1NCh96RneXQ7UzwDIzyF0jQL7F9AX2pAfbwzOxjYXwWcZJ5lst0FlaJPKJUSxn1tGafgiyoGPczjE5gmDGOJL4S2GA/eeTPFcGR5YEu+GDY7UB5c1W1myI1M1Q== 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=4EEFSTPpfaCb2qLAoLAzItnQg1AQTLIdc7U5MdJwRZ4=; b=ENwfpq9c+G0FAB4mGYoFwbnGiSfg3Qrp9kXQloRa09fz9+zL2gjREv4+HNkqZJJvF5g37JgSsL/xHlo9/iSRKc3pk86SQ4nGXPU4vg/YSBRwtlbqfpEfDQboLLbpVtCEs/5L2Dg8zIiBNi+KnVCjSvTX7z+TjofNvErnjt1IQpjJFaMx7sLXHCWvZFjm5KNxq5hPhQtN/BG+3bAO/Mt/VvZ8m+n+IRZssST0Uk6zU4l7hMGB/zilPLcMiALnl926ShfL/PCNVnW0ZIubcSb78MpU3gLaCrRZjVDb6TMTw98wpyLyHLHRSnyzY/fWgwIDCi2h/44nquZ7/suiwnkBew== 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=4EEFSTPpfaCb2qLAoLAzItnQg1AQTLIdc7U5MdJwRZ4=; b=JWxrboL5VXaYBp0dPt4Zh4Tp73VFT9ylfxKoM7gCf4LfgKBWOSkRQWLmbMj9SQEVjJo7LJJvOwuGYElOSdKSApO0ySbLcB0YV1nRh03zCLDzc3kVziw0tYtTwgztLd2m3Fk66kIlGW/LtSkdTLbBCHxXeC0UVa3KRqwxwLnms6Y= 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 SJ0PR13MB5548.namprd13.prod.outlook.com (2603:10b6:a03:421::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.34; Wed, 30 Aug 2023 02:15:21 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::c0f3:c2cc:b5bb:4192]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::c0f3:c2cc:b5bb:4192%4]) with mapi id 15.20.6699.034; Wed, 30 Aug 2023 02:15:21 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v2 00/27] refact the nfpcore module Date: Wed, 30 Aug 2023 10:14:30 +0800 Message-Id: <20230830021457.2064750-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230824110956.1943559-1-chaoyong.he@corigine.com> References: <20230824110956.1943559-1-chaoyong.he@corigine.com> X-ClientProxiedBy: PH0PR07CA0113.namprd07.prod.outlook.com (2603:10b6:510:4::28) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SJ0PR13MB5548:EE_ X-MS-Office365-Filtering-Correlation-Id: 63a39e73-dd95-4e0e-b7af-08dba8fef60a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q8acAn3nxQOva7CoY/mTqLM8XzKa4PrmEw+1aPwqNbr63hMqVyL6EQfAldkHnrtkgGSRIBMy9P8E1cpbB3KDSwrj7fZmQbTQQdkDQ9lblSp5bRs0MfvWhCdlPMi9uOK2ybNv3qjHy94CloOyrs2fUK9NWgfIBp7ny8uSqigczCs++84p8ULcGMuxquEFLDab01C3yDWTuHq9wiYt2KhJaQ3BGjl07XgQnodHm3kT4kNYYMjZy4D7mwdGJGM/YVReYQzU+TLViK9draJjXZivUS5S2SY4tOhvX0PJNho3G36GY4myBwcs+ZH8jtQAlifiwXF7KpLt62qPwhM4wwzGsxCX+5+ZJ/U1G6oextPgcpzrLAGfVjqdXl5dhEYbmBYheGnjfFARJ3sq4d8GC9nMM5OrwISrmkMUSCqlfq/oaJDwPf9ZMIa500JpGG9YLWXblyzmvq4GZ21NqVrIlCrihPo/BT4x1h48Ww3SHcsXWPqoLSamPNyPx+f/6OLrgumhNBK7+PwA5WRuF49k6cF/TWRVhdvah4uCSZVkHF8u4mPPWpHusjWyVPOzog5KIAoqG13CIY2ge5LGxGzNZt4Oh76nAVnBd7+i39lOSpdJvF3Usn2rRZsjbIbMnQmGo2jTHQl1Trqb2fbT4WN8Z7gNhSpFMLVv4YVzF6SDBOu5a0I= 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)(346002)(396003)(136003)(39830400003)(376002)(366004)(1800799009)(451199024)(186009)(44832011)(4326008)(66556008)(6916009)(2906002)(66476007)(36756003)(66946007)(5660300002)(316002)(8936002)(8676002)(41300700001)(6506007)(6486002)(52116002)(1076003)(26005)(107886003)(6512007)(2616005)(38350700002)(38100700002)(478600001)(83380400001)(86362001)(6666004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?S6bOyD/PXCwfsZXZ+r9l57nBYiaW?= =?utf-8?q?XnbzPGAYYIJbHuRFE+G+S6t2/9NpGits5XMJheaj+ETJ/BULoRUWrNWEi+ca3ViDW?= =?utf-8?q?MCg+mCrlRbhgaBem3c0q+oLZfqcheA4cCYzfLrC3o1AWSpDBoRdW09g9kyIfmXBBs?= =?utf-8?q?gU1dXbqq92ziDrVMTRRyWD8Mm/2RIJeR5q7VviRjg74S27zUl1GDKohLiW+0i/5ws?= =?utf-8?q?y6YhB0ltHxABrofKS+HbpY/4VAq7/N173IYoRg+HSevCFGAQB2EfNYj9NHII3lvoA?= =?utf-8?q?VKYrs56MZyzUim9pLXOuZESIgt4xz3tQA/bW6e6d2DGfg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8?q?+RI2mqpjkTFPBmK94fcZqibmQnwuEtFtbm7kcP+21J+BORdaxZp2Id5scTZNibsY+?= =?utf-8?q?YoMT+fhzxoiDtDYcgxJIUGjaJq5yzN4NKkxDcxGd2iBwC0wTeoTEIO0ldDSIs4/5n?= =?utf-8?q?g+6FBR33LWg8bv760djKj8FcuEwvawzMVPtIs+YTo8a0DCzzdRCotTuMauK9bHyzL?= =?utf-8?q?g39+TwYfhzAm4SPwPD4VXEgkmVHVD0khsVqHkaC1jTA/P2YC5hg0MCEVsbj8HhCrx?= =?utf-8?q?Lg4KZtOUHw9wWm4UTo2Je2owLxVBTdNkyy79bwfY6JOdAbFaRHqoRCgbbRk11iTlp?= =?utf-8?q?xkarb+Zgevr0pM1cZyQ1rxc+GtMto6mSqw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63a39e73-dd95-4e0e-b7af-08dba8fef60a X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2023 02:15:21.0377 (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: KVzXRrv7HIHzL3gDB39Fhp9Y009tQp8fSPqdKg0w8xHMGN1tjULwbd0qmVgblET0n91ncbIwgml7PZbT3vV2Z6yuUN5XFSBc7lozaSpoTbQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR13MB5548 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 This patch series aims to: - Make the coding style satisfy with DPDK. - Sync the logic with kernel driver. - Make the sub-module more modular. - Extend the nfp configure BAR from 8 to 24. --- v2: * Fix the compile error in Fodora 37 environment. --- Chaoyong He (27): net/nfp: explicitly compare to null and 0 net/nfp: unify the indent coding style net/nfp: unify the type of integer variable net/nfp: remove the unneeded logic net/nfp: standard the local variable coding style net/nfp: adjust the log statement net/nfp: standard the comment style net/nfp: using the DPDK memory management API net/nfp: standard the blank character net/nfp: unify the guide line of header file net/nfp: rename some parameter and variable net/nfp: refact the hwinfo module net/nfp: refact the nffw module net/nfp: refact the mip module net/nfp: refact the rtsym module net/nfp: refact the resource module net/nfp: refact the target module net/nfp: add a new header file net/nfp: refact the nsp module net/nfp: refact the mutex module net/nfp: rename data field to sync with kernel driver net/nfp: add the dev module net/nfp: add header file for PCIe module net/nfp: refact the cppcore module net/nfp: refact the PCIe module net/nfp: refact the cppcore and PCIe module net/nfp: extend the usage of nfp BAR from 8 to 24 drivers/net/nfp/flower/nfp_flower.c | 14 +- .../net/nfp/flower/nfp_flower_representor.c | 6 +- drivers/net/nfp/meson.build | 3 +- drivers/net/nfp/nfd3/nfp_nfd3_dp.c | 5 +- drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 5 +- drivers/net/nfp/nfp_common.c | 50 +- drivers/net/nfp/nfp_common.h | 52 +- drivers/net/nfp/nfp_cpp_bridge.c | 2 +- drivers/net/nfp/nfp_ethdev.c | 108 +- drivers/net/nfp/nfp_ethdev_vf.c | 17 +- drivers/net/nfp/nfp_rxtx.c | 5 +- drivers/net/nfp/nfp_rxtx.h | 12 - drivers/net/nfp/nfpcore/nfp6000/nfp6000.h | 20 - drivers/net/nfp/nfpcore/nfp6000_pcie.c | 1031 ++++++++++++++++ drivers/net/nfp/nfpcore/nfp6000_pcie.h | 20 + drivers/net/nfp/nfpcore/nfp_cpp.h | 776 +++--------- drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 824 ------------- drivers/net/nfp/nfpcore/nfp_cppcore.c | 1088 +++++++++++------ drivers/net/nfp/nfpcore/nfp_dev.c | 81 ++ drivers/net/nfp/nfpcore/nfp_dev.h | 44 + drivers/net/nfp/nfpcore/nfp_hwinfo.c | 199 ++- drivers/net/nfp/nfpcore/nfp_hwinfo.h | 74 +- drivers/net/nfp/nfpcore/nfp_mip.c | 103 +- drivers/net/nfp/nfpcore/nfp_mip.h | 7 +- drivers/net/nfp/nfpcore/nfp_mutex.c | 383 +++--- drivers/net/nfp/nfpcore/nfp_mutex.h | 25 + drivers/net/nfp/nfpcore/nfp_nffw.c | 207 ++-- drivers/net/nfp/nfpcore/nfp_nffw.h | 66 +- drivers/net/nfp/nfpcore/nfp_nsp.c | 580 ++++++--- drivers/net/nfp/nfpcore/nfp_nsp.h | 336 ++--- drivers/net/nfp/nfpcore/nfp_nsp_cmds.c | 27 +- drivers/net/nfp/nfpcore/nfp_nsp_eth.c | 534 ++++---- drivers/net/nfp/nfpcore/nfp_platform.h | 42 + drivers/net/nfp/nfpcore/nfp_resource.c | 216 ++-- drivers/net/nfp/nfpcore/nfp_resource.h | 36 +- drivers/net/nfp/nfpcore/nfp_rtsym.c | 452 +++++-- drivers/net/nfp/nfpcore/nfp_rtsym.h | 67 +- drivers/net/nfp/nfpcore/nfp_target.c | 9 +- drivers/net/nfp/nfpcore/nfp_target.h | 597 +-------- 39 files changed, 4080 insertions(+), 4043 deletions(-) create mode 100644 drivers/net/nfp/nfpcore/nfp6000_pcie.c create mode 100644 drivers/net/nfp/nfpcore/nfp6000_pcie.h delete mode 100644 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c create mode 100644 drivers/net/nfp/nfpcore/nfp_dev.c create mode 100644 drivers/net/nfp/nfpcore/nfp_dev.h create mode 100644 drivers/net/nfp/nfpcore/nfp_mutex.h create mode 100644 drivers/net/nfp/nfpcore/nfp_platform.h