From patchwork Fri Mar 11 10:42:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12777803 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85ED7C433EF for ; Fri, 11 Mar 2022 10:43:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232037AbiCKKoc (ORCPT ); Fri, 11 Mar 2022 05:44:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229865AbiCKKob (ORCPT ); Fri, 11 Mar 2022 05:44:31 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2114.outbound.protection.outlook.com [40.107.237.114]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22463C7E9B for ; Fri, 11 Mar 2022 02:43:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FvWqvlekc6qkItWL96vDg3iEr14MpoRLvmgl8MNjrlfblSKw1hQsF2Y+UjFbcVXfF1QSV4qW+QWzHCGh/x8WIimOQB5/Y1ZUrB9fcQxZ1woRBKrQ3RxzxpJIzl/6BxLVoGEDi0RWgRvtpaAxeL+1TrFj5AdjRiwEKM3II1HvcEnU+8M96gWrc5WgercvD8HDnIiWZU1NRxP0GZZFzbnPWT8RJcMoyjzEO2sm1lilcvTeTccOkEP5bRpr+rqot1ufelt9gJvxp8H21Kp9zmL1uEfoMfIA47uT06L5bnFv1SsHYy+FYaVxXXZQldoxNr60aJViujC9GJYsWByDjGD4IQ== 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=a3lhmXkzKkgOxpX7JenIZ+zcWXaEiGEcfvI34Ut57Hc=; b=Dj7JhAQeuoNDyH1yuq4TQpJPpWasqKiqv50/TdHNm3adY6T86Gb39hCXfl55bUcl5vXvArqqhTsLIBmbrDgWhxkP+n+Rs/og+kj0lOHy0ImnPwx8mOjYC+y1s38TdtNOLfae/M+40N7W1uNxCpILnZzDaAK/YaGVI9CBs0OHWouw6iRBctfoo1NgBQ+eILDGkJkE/Oc9LrZmALZkgrprRKJnMlRGqZA4rAyMJJQyx5RKt1s8/5arZQMeFUxiRd9YUE+4bhTlSGPLZ9ewYIiL/QdpPXxAaLO7xoV6X5rxx/VRiG6AKObI3hnIMolMcglkzQ97Gc7Uy9Zb22/ke/QDUQ== 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=a3lhmXkzKkgOxpX7JenIZ+zcWXaEiGEcfvI34Ut57Hc=; b=XUvcue9D7rH/QdaJwUDJN7XBofnjAipwIbXkK1fXlEb72UZeyIDQCRgPOU/mB8zZ4ZJW+5hsVNU/R4kiWrSOzoWzAbngID5ogMx4Nrl2EY9vwEd499LYz2J/ZL93sQJRTas2FGvSD1YY1BMxqRsCSN6GVXj+7gK9ZsBZ5bXFsIc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by MWHPR13MB1184.namprd13.prod.outlook.com (2603:10b6:300:e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.8; Fri, 11 Mar 2022 10:43:25 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e%2]) with mapi id 15.20.5061.018; Fri, 11 Mar 2022 10:43:25 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 01/11] nfp: remove defines for unused control bits Date: Fri, 11 Mar 2022 11:42:56 +0100 Message-Id: <20220311104306.28357-2-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220311104306.28357-1-simon.horman@corigine.com> References: <20220311104306.28357-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0P190CA0026.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::36) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 871bc5b5-020d-44c3-3bff-08da034bf729 X-MS-TrafficTypeDiagnostic: MWHPR13MB1184:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q39Tn0e7E3T/q3bXFrOOCaLTRGWO6BwQIx9yFlzOkRjs44YuA+tM2rJA91ft8mSJjk6rTA3bTp2j8FIiMzZbk7yY1SgonX65iacuMQF0iDcUqCYPq1KG/GV6jytCIXdbHmMZGC0SY9Ws08jq5DQyEULhdDsIb7LPvbRgpBCJme5x8OKk4ZzA3FN1SSbKeECZxfB8Q2IYT10o0f3JDb6HV2HfP9LWrVLCXW16vtkJzH43IC1FvO0NoAUyLtzgN2VNXziLxZ2y7isduZFp3rUYRU7GqmENkdk7Kasmb4KRlvYoyia0eMRmM8Jrk5QH8t4q6pKrnTrQ/A+9Y8VMGJbOuDN14xqmWq8JuWVJYGPqX5/A8LyQ8DWn3HiadbJpANgsT7m6SUMBXzGSXtpppS5jvA/8VkpHGJjsSejXkgXRvJWyavttGq6KCqslbesfu2cm71iyWwiEHC4157yO5m/XGdD5IXAxOUstlLmeJpv9agbuHhlsxk6/dD1UZ6zCB5UQbXNkPngGiYesRouxQ3kTFJYmRh7DtbNFPp6U89X2Zf0T4j9fhmDn19k4673850PVpE6oL7e7qJQaA45cIvvz+Wa8ThC25lzMw22sy9CoOcRn1pcLM5HDJpj8ll3SYeOgtv1DRWF9dO124v/nCJJNUQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(396003)(376002)(346002)(39840400004)(136003)(36756003)(5660300002)(2906002)(44832011)(66556008)(8936002)(66946007)(6486002)(110136005)(86362001)(316002)(508600001)(6666004)(2616005)(1076003)(186003)(38100700002)(52116002)(6506007)(6512007)(4326008)(8676002)(66476007)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Mck0sA9cpCS2qlypGUH7kJF/KEhk9AuP4uaISRw68iMCuxDj17zuKqEr/C9eqfuTP0SbBwNudxBythEULd916W9qvdbn8JBgZ1cM2rcNc3KKr6BWZI9ShhMJChXHF/sq9kps5dQ/rG12+f/syjk8UaZSsq4KOZFO8abK8Cu7wztO3BwePFW9VXjjarAIPDK059pQA73diiPKio3zj3ZinZRhTUMXh/FVYDdOWqjumqlsWnULMRvVTwbvPUJNyuQWDHMobg1wevwYGxQYfDsJUIbSYEH/VuYpRMRv2nDnHCbdBEg2rB4YVUxKhJkT8uQclcMeWIgR+nwfA7fW5pzTdLvXPmkhAZ8HcUqqTbs70GlrgMSa+28Ckm3dzKyQ/S+ITU4HIdMRsmTYiIUPmxp7KWJO0CNWgjCTL4BsaCFShxPo6xayNAKgD519kJfsSArOWPFzMYwmSvdK3fFCzFKIy/fepiPNnAoFyMzNh9fi/laYGQct8R7diMXNkdhJCJxAuccouDK4nwoA1YPTKBNG1Uz+J/iSqKSTSOCw0GpHP+yX39XC1JyS8Mr6d1HSeh/ljG10KkW4CYpk9uJQGtDFIrr9BTDjl5rmCaZuxzvvlZplX782oON6gkjFhdbGiVoDHL0Es+WZS+pr3hoZlHubS3JnsC4ncygCficGX6fYuUigik5Og3GRcl0oRlOC8bzvFh4JLhueAymMuTFN3qftDboWBshmiYvJMcAffdbeDQG1+GQLwhz0FpGcSE3gKCJOsvsBct/TgK/hIgQfPxQ7/4X//q2Pr6oScEUpzIPO+CITn4wIMg/k4E3RSwJPlDYOh67lXaqYyUwOsJo7OaK5Mlt0KIEzuX49btMOqNJd7hk8H8SOFLoeTEQtsCW3T53QqvXVHMSpNfH3GavXs8QOsyIa5wLd7o3SgD0xWTOnuaNLa7V45sn24P/ylo0NG0F9Tg9simIwSsrdcnEVMxZ9wuKgKNyZNwBnXTzEJRudEm8xM3Af+Im/kc/+klRF42RW67vnPaobwet/iZh6Rx/Yk+r3UZZ+kC1p8YFk8ftaE/cR0/+6i40wTVZjDegWydIxWCnpf57DH0E0k+No5ovtYT0cIOa4KmLMeSZqwH3EB/Hviss+IrAcpRYcPbpYLsKliyRpVEEj6PrwTkPHQdCXrzpqjAVczju3tba0HyqJNz2z0mC4IEyOkH9AAD4FVLT+gzgDRr8UBEFFlHF3LcKRJYi/AlJsJDLl9Hf+2NuE/KesFHam1H5ABgiTs13kyjr4CEzeriG9Q0IPLZXk88Wx1OvV3zMyQXOIXYuieGQ31aKDHYGLiGvrQDw4WGxmsKUXwrcRNZb65M0YkqEnJ/jG1OI/yaPjP4oFv0K75b58Ta21xT1jcmzQxry99ltn+epEgfdg+j+He0ynGu5PUz1UhbiVQAXpZBjv/uGc2DwhpxsTrmQkUNx05+9XumwXb3cqIuH9LEw7Q64Et/rH+eoqB2oBvlDffnhdfORA80qYpS9ob/lOdFOzLzvDjCrc4OJCjJZRRBOpDeGK81/NfgMacg== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 871bc5b5-020d-44c3-3bff-08da034bf729 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 10:43:23.1545 (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: OwPEM7b8ePwkOOQrJWrjF7eeYHaJDSEvy+5GZ9aBQH4h8SC161sPawQQKVl6HvdbeO4GIaNl7WV671qkrs74xB3cJjlVS3uIdcOX4L7pv2k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR13MB1184 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Jakub Kicinski NFP driver ABI contains bits for L2 switching and ring prioritization which were never implemented in initially envisioned form. Remove the defines, and open up the possibility of reclaiming the bits for other uses. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: Fei Qin Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h index 50007cc5b580..33fd32478905 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h @@ -92,7 +92,6 @@ #define NFP_NET_CFG_CTRL_RINGCFG (0x1 << 16) /* Ring runtime changes */ #define NFP_NET_CFG_CTRL_RSS (0x1 << 17) /* RSS (version 1) */ #define NFP_NET_CFG_CTRL_IRQMOD (0x1 << 18) /* Interrupt moderation */ -#define NFP_NET_CFG_CTRL_RINGPRIO (0x1 << 19) /* Ring priorities */ #define NFP_NET_CFG_CTRL_MSIXAUTO (0x1 << 20) /* MSI-X auto-masking */ #define NFP_NET_CFG_CTRL_TXRWB (0x1 << 21) /* Write-back of TX ring*/ #define NFP_NET_CFG_CTRL_VXLAN (0x1 << 24) /* VXLAN tunnel support */ From patchwork Fri Mar 11 10:42:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12777805 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 378B6C433FE for ; Fri, 11 Mar 2022 10:43:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233825AbiCKKog (ORCPT ); Fri, 11 Mar 2022 05:44:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229865AbiCKKod (ORCPT ); Fri, 11 Mar 2022 05:44:33 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2114.outbound.protection.outlook.com [40.107.237.114]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42912114FFF for ; Fri, 11 Mar 2022 02:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E638f1OEdnBCmu+JHoQHYxBQUP0Nn4RlkgrKl4nm6jn5EN6O6kbYVhqIVBkKWkyVBNmDOy3QYDkUncOQR3J1kWJBw0PLDl9EQ8W84cHnpX080hxEHF+18zNIqm9pusQNthphdcdGlo80ZFY1IcD3i6xzjA+eCbFcfrrQXWXXSNyKqQcqWESKxa2H86IJlRKRxWpu/rNvIycyOJWgHlp604rqt95+0rtMUHtaV24aO2pp8shZTTTAPsDpVvfLKI846H47w9ErC5OvHcKx/DloTudYuu/pIIAqCiGxO9nKlu944dhPNtbey+avFrNZF7JaPs8aSqSqacZWX+xbONZEbA== 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=dTrMvmXZciFiJ0meergVtZ3qnpAvTgktw5R6qnSy8lY=; b=BlJGWeIl5lksUbCHOujpATWrqvctH+Q7ncY2kz/xpZEVyKAJDJvXBxiq2BuPrPIuiEMVk/8vGGZ8KgV5jVCUCV6/l4EhF6bTJ7BCfx6oZjLhblCDI2ZNVC3EUY+gXDSuJrnuYtVeeZQ92ZnCPXgcjXd+iCqtmvoKJg80P6/GfDNMSn1WlG6aMAR7r9YiOKviz+/703brUpg0LmgqrVZ6M16uBbmiQHw47jnhY9mlqr55ELREQryzA1MJWYo4C0LewMjYnTwE3tBZB1IGiO+YE6Ip3SwQjw3nZkNDGbpeNamMOo3F6BBTbEOKoIgH3EwAOwt2kAxMrFZndXvpLclHWA== 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=dTrMvmXZciFiJ0meergVtZ3qnpAvTgktw5R6qnSy8lY=; b=DbhEvQG9RBEA7SV98vUN8gKKHPHf2MEWQC5ywFfQzLxYs5ctNa+SYWFpIab+A7ZUpmliMoCthsV0KydS1sBBFnVrSXZftIwVaFPy/5OzOVganC8a4UrfTAtQ3zy4j3PyWAqnw6XdL2icVha9pGJN97B5sLkmc8dRNGdPb92QcHw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by MWHPR13MB1184.namprd13.prod.outlook.com (2603:10b6:300:e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.8; Fri, 11 Mar 2022 10:43:25 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e%2]) with mapi id 15.20.5061.018; Fri, 11 Mar 2022 10:43:25 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 02/11] nfp: remove pessimistic NFP_QCP_MAX_ADD limits Date: Fri, 11 Mar 2022 11:42:57 +0100 Message-Id: <20220311104306.28357-3-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220311104306.28357-1-simon.horman@corigine.com> References: <20220311104306.28357-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0P190CA0026.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::36) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0642eb92-2a88-4b16-bd4e-08da034bf7e5 X-MS-TrafficTypeDiagnostic: MWHPR13MB1184:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AxHfpwucCpOtk1ULtVG8Fg24kcvfiXhwTpKZpnu7j4ONZcvXR1PghEdZvcR1a4iZXjvEnqhUyRNYs5MBFg8eEtywgPEU106sw7r2kbo1uuo44w8Fj5n7wg0SG4Wv/yOWsqsJFJgt58yp7PYi4QBd5kYqIErDOxhG3T5D5jRIb/BJHUEsdHUzpNgEgzZ8mbLKj6DOvol1Ldycb2JX2udmosfK7LO2n1hAIpW6raBGWcDPahTFT3c/HjB/vj6tYKRA3Cl+dyG+MpKqcogkKMYRPk458Ml7mDT2StExGrDCLmbo7ApQt/FKfPx16uOBYayUZW5rpHLBFr2YnjryTKIho7CrHuk8RkcA0oIMeNymkTpbLnqHJHMnYIQsXQZeBYaSwlpdtzSU1f9I+c52v9DmHF88oMevPagh4ErpZ2jRLVQHGmGQrVSfhOBUFv2RghsrSf4GSGvisEscyLl+XIpv/Ln+kdLTwNmshsvK14rlog6buXyksDjMGdc1YE90XAGX8ZQVoP2ExFxzLrK+dlyNTddoXG88Y5eSyAROZeyCHpIieYKaq+H9080ikFQoQPji1pFYLmn1bgIYB6hNWYDxM/jX+hwoaaStZj3Tg7ukssCQVX1JBCh5jjTXJUifddOk2A45Nss4HtmwhywnujycYQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(396003)(376002)(346002)(39840400004)(136003)(36756003)(5660300002)(2906002)(44832011)(66556008)(8936002)(66946007)(6486002)(110136005)(86362001)(316002)(508600001)(6666004)(2616005)(1076003)(186003)(38100700002)(52116002)(6506007)(6512007)(4326008)(8676002)(66476007)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GVw/lzpOw1GhAydnPtHW1JSRcCwZM7LVoiG4zuFnIrt4RrI0uR/b9KPgd8urEuDXY6bcQO67Lx+vMTE2tNZjaQ7zwCg3yLteUxrCeFoiDRVXCVqjw0310ODydtJHFbgQMmlG0FppIwcRs9RW6o7VSMuSVFtLgkujnndbwhlaAgb36BZqLd07ZFL7migqORkmrQogHGBb2qZDj+AoeKcc/4n2bbNhE5YcUXsZG8QHw68F6GfcImgfaajSZLgPT44+x2IzdBdHe5JX/DSXDd5cq6fD/RLUrhBZ2ACWjLRYhFIG5xrwZ3n+rhb/4TKRQ6Ir7okVNhCjghnvfVu8Qpjw0AzCHLINqQZU1azjMqgZUx7GYm37Z36GLFeRvEQC/B1xUFc0EjhbES8GT6eib75tQPKJ51OPrmnUIsmT2fF7PaAPy2dapySa+FaXdqOKTPhOyFvIa+ESGkTOfBQCgX6sS7gFkmUag0Xe0ZIcxu9C5792yVjOf3eoZPnP7EX2WQKQLGoyhmwWi66vG30MHCXdZ6lLouqsii/X177HZQcrhw0kyZFXwsJzuLT1vlznLkQahp/Z8HorwjcyAde9sQ0VA2tx6LX5H+mqKWPPE5VpMXIjZxmluyX6c1Fy4pUbICL63WbH2Wuo5Ashx4UUxsReITrguho86CyZpkrJVbWKyh7v2jn2eeJNN6TjXPtf1BJCCksCtrwYbVcl72U2Ec8yA/vYWcWqOWxizgpP4bPe6YjHvosJ8nP51EIvndtz4/Rjf+vQ4gX2LhGI1kDHQFVAPQjHcKVpFRFgi6NGIaqKqa4Fs7X9m+bO7cOlbXblNFOF6scjCi39YaAmZPAToeute2pwK16PugcSdzDPacoUAJHo7JVIQbdyxl75/0DMpm3ycQj0F03tjEKFYJoYHHVIKDCtexOAUb0nNfhAlEyjLlgNRykDFubHcumHwVMdbxqNpjP3jZsXaxjJWOm07g9yujLL/9SbremKHwRMVAMkb921urnsSdKTb9H/JbkdcQlulZx7JWw7YBcP80qh6rLZqL2QrAuqCp+Bkl/7ZLAL2a2lNpuSbl6XkWj75B02pOc1ck/nWRPCSlc5loPuxthu2zlPHZwZ1KJgHZMurKkAOkwPQJbIXvec2cqraRBhl8bay5dhU2WnyefsiYWRbCRD+NZgv05Yp3EtE47gNp91MJMBFUkwyfdPjODhWiIj4d5os1tH3iAxuh7lZntGoaIFpzq9IEdvJHylrFZ7OhCbnbGo8zs7sScjaakY/MTv4FEqVzDxHdtX5c1wcgh/Jf4RIzpGjfRAomlDAjvacYiGhMS+epI2SpxLFstWujCg+ontDKm+te75Cupt16aF4V5We6G3aDE5B1wocCX7GpVq7AwvvUzIwTV+pMOzfUEM0KtFHn4zmjcb3TppIEIwEAGGuyH66wQQzp8QT7uTlAoO/TKHY9Jrv7lk6YpfEOX4V1am49ITwGuRTOXcSbgYa5LWX/7IOD7Moguwa+BAGBXvi/RsDenZZGlHAbRQauWmhX7/dd3rCxBu2E+wSd29F4gpmA== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0642eb92-2a88-4b16-bd4e-08da034bf7e5 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 10:43:24.3719 (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: HukZPK424GgIryq23xMr/x8q/lVYeaT+K40dC8m7qtEIYZ2MU1HxqoTd6x4ghMeuhkzRShqrHenPKqHlXjkyDu56IWfPY6+qteiOTf0jGfw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR13MB1184 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Christo du Toit Multiple writes cause intermediate pointer values that do not end on complete TX descriptors. The QCP peripheral on the NFP provides a number of access modes. In some access modes, the maximum amount to add must be restricted to a 6bit value. The particular access mode used by _nfp_qcp_ptr_add() has no such restrictions, so the "< NFP_QCP_MAX_ADD" test is unnecessary. Note that trying to add more that the configured ring size in a single add will cause a QCP overflow, caught and handled by the QCP peripheral. Signed-off-by: Christo du Toit Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_net.h | 32 ++------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net.h b/drivers/net/ethernet/netronome/nfp/nfp_net.h index 437a19722fcf..f6b718901831 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net.h +++ b/drivers/net/ethernet/netronome/nfp/nfp_net.h @@ -814,41 +814,15 @@ enum nfp_qcp_ptr { NFP_QCP_WRITE_PTR }; -/* There appear to be an *undocumented* upper limit on the value which - * one can add to a queue and that value is either 0x3f or 0x7f. We - * go with 0x3f as a conservative measure. - */ -#define NFP_QCP_MAX_ADD 0x3f - -static inline void _nfp_qcp_ptr_add(u8 __iomem *q, - enum nfp_qcp_ptr ptr, u32 val) -{ - u32 off; - - if (ptr == NFP_QCP_READ_PTR) - off = NFP_QCP_QUEUE_ADD_RPTR; - else - off = NFP_QCP_QUEUE_ADD_WPTR; - - while (val > NFP_QCP_MAX_ADD) { - writel(NFP_QCP_MAX_ADD, q + off); - val -= NFP_QCP_MAX_ADD; - } - - writel(val, q + off); -} - /** * nfp_qcp_rd_ptr_add() - Add the value to the read pointer of a queue * * @q: Base address for queue structure * @val: Value to add to the queue pointer - * - * If @val is greater than @NFP_QCP_MAX_ADD multiple writes are performed. */ static inline void nfp_qcp_rd_ptr_add(u8 __iomem *q, u32 val) { - _nfp_qcp_ptr_add(q, NFP_QCP_READ_PTR, val); + writel(val, q + NFP_QCP_QUEUE_ADD_RPTR); } /** @@ -856,12 +830,10 @@ static inline void nfp_qcp_rd_ptr_add(u8 __iomem *q, u32 val) * * @q: Base address for queue structure * @val: Value to add to the queue pointer - * - * If @val is greater than @NFP_QCP_MAX_ADD multiple writes are performed. */ static inline void nfp_qcp_wr_ptr_add(u8 __iomem *q, u32 val) { - _nfp_qcp_ptr_add(q, NFP_QCP_WRITE_PTR, val); + writel(val, q + NFP_QCP_QUEUE_ADD_WPTR); } static inline u32 _nfp_qcp_read(u8 __iomem *q, enum nfp_qcp_ptr ptr) From patchwork Fri Mar 11 10:42:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12777804 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47E9AC433EF for ; Fri, 11 Mar 2022 10:43:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233026AbiCKKoe (ORCPT ); Fri, 11 Mar 2022 05:44:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231496AbiCKKob (ORCPT ); Fri, 11 Mar 2022 05:44:31 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2114.outbound.protection.outlook.com [40.107.237.114]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EDD610874C for ; Fri, 11 Mar 2022 02:43:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q89D037yIStqEv/i4Djjyr6ANHluZi02kbh65NCb0YzV3SA4PcuMr63vgyR9VSmcGkXunfzUK9TQhAmqglPRk8gAUg/s405Su49px92VlW/OISigX/6pOjGyH2ht1KL8wH1MH5tU1bO/Ru/r0zA9IrTv9574FtTEKKmNefT1xPxrLkvBqZXE0t0qte0nfMSge3uLOunBD7XwFZZ2CH8EhegYJLrawQ6hoEKKeZj6vD4Ci/ppq9FhxjrZB/DiiU9HzSepDIjM31ScZK5DRZ2CEGLbJf0ASovzGomEdVYtUNBIbGnjiQ7e3oqxeNBtqZF++qxMgYucltB4FaQGAiJlcA== 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=c1uCKr2plZYgxxwQVXFvs1Ljp1lg8TbHvDqDPiNOeWE=; b=kOyIBDzNLEPfaE0O15es/GclOADuU3iSB0ieh0KLQQZgPfvse/aPyev8c6eE6hE3J6mMxfP08+d4f5Z54bwpBM78e0noal06CaauXACrNjLJvipluEstHk5fGbU6RxVKHDYs4WL8O0Afq4oe6G9Jd5q46m0Z1xcFDI6IistW4Cgab7TUOJ3zDYuGM1fdSvV+HuSCBU2DESoIXXzKZj0TIBhS46nbc5FdV3bEmzHCaANR1gerwT8GmcCatnHweK7VGy2kvYTxN/wOb3OO1MZbIoPvA0DJUosclH6B/m4GbqtMBr+pBCiyqQUaWym59RrRzg5Vmd2WiSjGBoNwhIp3/Q== 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=c1uCKr2plZYgxxwQVXFvs1Ljp1lg8TbHvDqDPiNOeWE=; b=aZuUJsaVZhH11G3JzgQf9EsyUez+D4oEVy7v9n2acwNFLHemt37TdZ/kZUX6aibKKDWRq1wKjGlDEKQC91Tlqez6ti+a8lIQsTm3oxcof9S97ArP7NyE+9GKLqwHvV3wMzOoQqXyVQjbURGzC/t8vYJCTNSUlW0oXGx482xpNiw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by MWHPR13MB1184.namprd13.prod.outlook.com (2603:10b6:300:e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.8; Fri, 11 Mar 2022 10:43:26 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e%2]) with mapi id 15.20.5061.018; Fri, 11 Mar 2022 10:43:26 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 03/11] nfp: use PCI_DEVICE_ID_NETRONOME_NFP6000_VF for VFs instead Date: Fri, 11 Mar 2022 11:42:58 +0100 Message-Id: <20220311104306.28357-4-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220311104306.28357-1-simon.horman@corigine.com> References: <20220311104306.28357-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0P190CA0026.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::36) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d40a342d-8de3-4e25-20b8-08da034bf896 X-MS-TrafficTypeDiagnostic: MWHPR13MB1184:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WAT4RcMm1LDL5Y2czXZ9ogsoH0SEV13HxLKFeD0CQIlF/IYDs+HZb+gwtaI4YkLRh+4ecoI+8KUPO70nupWeOM1gX0SwcYGGg9/pVWXj133q5HqRAEfsvb1C6ppdPbdi8+G2GCR8NsRfUiHgrb18eiOKTbFPG3WAstNO67GjljvHUG23WaXweA+zlA6eIiUvI+4lfOMnPP/cM6+DUrRRhiqRP+nl7K6B191VUu2mvYfP4xfjZDQZGkXQkQuGKI3gxo6G7dhtEdz4g31DawPCC0nwT5wOQsP3b/5oWcWTYCh2X04sEE5YoySsiiNb63PuPi7DkRe8zy2Cj0w5zLgrKffZ7XpJKuUi+h6amJC+q7YFQ+AX6kCZKBHoFI3rb8L8snxQ9TeuJhEgIDPEy9rlntntujzL5Bn4TifmzT2hhnD/DomWZf54Ra7uGiAAkoIRdGdpaeoxEUsNDXU2u/rmtPoIMAnVYxVL5e1ICOaSBdfjWfBGrwHdXRbr98zetIUAepv11MyQ2L44gUCpK3lvlL0xrcSqaC2zVVc3eC9kS8ufmbdblXEr8sa8lEFFojuoWVPit5G75YYrbLtz2/xVKMOwGztMH13QczT5h9ZwtvX+yKA9afr9mLz1V6W5PKcs8z83deg7vxv3LpV1aBMY3g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(396003)(376002)(346002)(39840400004)(136003)(36756003)(5660300002)(2906002)(44832011)(66556008)(8936002)(66946007)(6486002)(110136005)(86362001)(316002)(508600001)(6666004)(2616005)(1076003)(186003)(38100700002)(52116002)(6506007)(6512007)(4326008)(8676002)(66476007)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pskGc2e3aVjh3vh32ivuabDP6ZjrJKnhwxOX0GNW+lJBD3hqRLaNV6A4v15hS0G0GcXrqr1Gl4LEhjtWnynLHcX6SaHjl/tm9P80qjuJvM3mbqS0HhqEgJXUHiOx8R0HPyUizc6eqRx6+kD8nDrl8U9SdJRQ8rXnolXkDYrlPjSd1Q4jeMXJWF3hKxRv0RLG8oURu88MZy84CMN5ygjLFi/LQLMZyNVaf8IUs+yV9b3Tf34jOFpA7aXnH+jJFoaEQc/ub0OLn1aI46KiFkS6plcuaWyPRONuMl5R+ybzJsvBYJRJMWeemHlG3y+8TIklSTAqX2w2nijITr1vW8SO6otLH3r/gq7dxoWDNmTiUTUoMfB7pLNFUAOcF9YQyx4SFpkVzNjfFW8Y29Z5w+qXzAoKoa/gR4UEfhcK/EzpbESXn30maOCYZq5lggKC5eBA0MRnEMzmvA0utsVhMrMZ6CDEgy5IWLmOua2p23djkTpvM86Y9lA0b9TvM9+gQVEhJ2hw+h2SNqyGQIYYkIos31c+PYJZm1HM6VbDhPAJuA7HSWJjFj/NH7sJTilPhmhmXTaDAcgtPjB/vb8DnMir0rMOel45qTiu7Y3Q+2a/Og1KfHEJ+VkZQ+jeeii4B0lcFcPqtU9St2IsJ84zshvcv4S0GjYPfWbelYmK6l/XDSZZQP/BKD1Fcc2XuDOjzLx/vL3g20O2OSEWQXfbNmi8gRnxg6n+ctMleHEZOCQVofzGwVD2Lp5MRbpBvyEOuo1M/gCvaplBOLtq9TOltcXdga7LeIhwqpv3h+U2/sLRqrMETQfj/bVihHfttNPZc4ZUx4M86ImXE7PGTKvc69b4peHNdBhDSv8tOj00ags+hpKbsrHTSGRexW3D15SzYiIrB2L/Pt6HkmoejsSHWOsD9jBuhVN/a5/TKTR3LX4nfQPBPEOEs4RZIHwHe3TcRKs654ZC6xcOD5rUcvtknKfb0e2X/DrpYt3Hn4md9s0Pe/nKYIMGBHS2N+ujZLMciU+jY/1uh0GH8QTlfxTgjI4IveCQVR7Ow7fVr1iW1K+0koknc/I9UYa1VV+WuESg4tv/Tg1/4XFnDRML5UIrarQ3TudhCI6CMtm3IpOUhkIAuvR98w7CMyFZV7X8hRDdJu7zNck9JEfPA5C2ixnM8MjgiYee63ibQMmZhUyy4Uqz57nBW+QE1BzAnR5gd3Mazw1iUv83okEDmjRQNnl5njPvAlDvC3R2OmuHOlSj5tHxwH7rujzNVKiCdS4vfPP8P5hbwqmIzbiIRP0K+mUoB4mLf0l9vHFke+c8BoVjHdoq0qKt1NFLMLZNDi0ifaocwmfyQrrN/QEMsMWCy8vWWDNoX13mmG85T1sO2zcC3v3KTCQzvVfy/XtEKfv6kAYL44KpJu0IysmnscueYEYosgS9TlAUHGL73h0uGq4tN4YeRNVO3ArwNTbMZ331Hgm9RiWwIbpCMk7Isq3lX+dFHNMN2DwvHEPEOdTrTN4RaYFmVz2mhEOntRnVsYPUwJB0IjogI6ysiBRIGg/Kc2rvDsFunQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: d40a342d-8de3-4e25-20b8-08da034bf896 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 10:43:25.6708 (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: y2DjADIA22I6lktIwnCSMKF7BhWcb0aMETo+bRKKOexVg8MgrsHhQL+u7pFJD+vqTc0fLPz5QJbYDpH/C7pnSVQ1ddZIqLL/wPt4hGLiRcc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR13MB1184 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Dirk van der Merwe The PCI_DEVICE_ID_NETRONOME_NFP6000_VF is available for use and should be used instead of the PCI_DEVICE_NFP6000VF. Meanwhile, PCI_DEVICE_NFP6000VF PCI ID is removed for not being used. Signed-off-by: Dirk van der Merwe Signed-off-by: Fei Qin Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c index 87f2268b16d6..694152016b25 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c @@ -36,9 +36,8 @@ struct nfp_net_vf { static const char nfp_net_driver_name[] = "nfp_netvf"; -#define PCI_DEVICE_NFP6000VF 0x6003 static const struct pci_device_id nfp_netvf_pci_device_ids[] = { - { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_NFP6000VF, + { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000_VF, PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, PCI_ANY_ID, 0, }, From patchwork Fri Mar 11 10:42:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12777809 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 011ADC433EF for ; Fri, 11 Mar 2022 10:43:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233151AbiCKKor (ORCPT ); Fri, 11 Mar 2022 05:44:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233283AbiCKKof (ORCPT ); Fri, 11 Mar 2022 05:44:35 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2114.outbound.protection.outlook.com [40.107.237.114]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3BD214F298 for ; Fri, 11 Mar 2022 02:43:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j4As+GkEXE3dGP0pWlXzWNYjNqdLCdkEi+qGQUdaBF70Vh3vWo4doxQqOvQ1Pm0TROXHQ+7fC4P1PfXNdWSnAPTFlfvwEL+83USIUh3zPmv2NiyBAWWx2aae5lWOFyyOq4+dXemfElbeyYc/UTgjZH3hQAMAH7jchrd/NijaUSPGEoYf3fnhIIRpym3/jFX4nkXtiztvRIMoFAtmHCBL/0eGG3ka/Qc2nGdwdtOpXpSb8chm3Ut9CCUPGHPyCuOj/OPMa3ijTE8F75UuU6/VU1L8buIFLiPWdkI5r+zFHlkow1F91xX6TSAc71LLuyzs2zR0ZfRFlAdvfo4ucqi3vA== 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=yW8kg8YTKJW8rIQ73R8NAW0qA8Riv4HQ/rsHaMugfUY=; b=PCAjTJtr7ttyKH18Ajl7CIXEe4uBtNss5sFgoG8U5PPZs0Qim6kAtpty1/sL4st6d5+hh+iiU/05qb1m8yg6tXuaaUnu1RBccSlgJEdJz8Ko+y0ouw2KhVv8IsOlAknLBZ+fnZ7dxPN7r+kPwCC9+cEFnX4DOBw+eOJMvEd9OMn+weNQ8xAiyKeRvuFRqhIgldz3g8r0KQlZt6G2xh69NbetMqxn2PvBLfjL++57Xs+qCAlmgLW1fTJJu/vqioe1X9XVir2HYWPbTSq/uqSOljqUlXCpSTn1juoNZHSqUFtJfC328DR5iKgUvTp7EBjHxyIkkHcEFjQwMKn/353BGQ== 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=yW8kg8YTKJW8rIQ73R8NAW0qA8Riv4HQ/rsHaMugfUY=; b=VnbEuEEOMaMs3qMYxcn7NtuqgsYEZQVM2zno75/5108ma+qlSGsFUGVriJeKHRcrKJgBCSXlnBvi7R5TAcCRUDeWOeArZA15TdTTuarhI2S6Ja4MbwROf2Xgw5sXomKOnlQhQTQPwk/I5oP9EKkU+WfuDSyB2Bw9RGm83j33hEI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by MWHPR13MB1184.namprd13.prod.outlook.com (2603:10b6:300:e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.8; Fri, 11 Mar 2022 10:43:27 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e%2]) with mapi id 15.20.5061.018; Fri, 11 Mar 2022 10:43:27 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 04/11] nfp: use PluDevice register for model for non-NFP6000 chips Date: Fri, 11 Mar 2022 11:42:59 +0100 Message-Id: <20220311104306.28357-5-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220311104306.28357-1-simon.horman@corigine.com> References: <20220311104306.28357-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0P190CA0026.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::36) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1fa7a243-5c3a-4e4c-bf11-08da034bf960 X-MS-TrafficTypeDiagnostic: MWHPR13MB1184:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BbzUGsbI0cl28O717nFuKQvoFh4oVEKyOPSsLMhjWb+rsDL4BGrm0tiBzDC5bAZSU9EjmfLGXm6hZ9cmi4/EyqkrxAuFmurtnCsXrA3C+ENR1+4+BCaXqCuqMayHU2zvBeT881bFNGqByC7SdVI2VeUV+aplRRlKU4+BIYbKayu+gvjP6hE93fSTyFBcAI+JjvlUnx4z39B2bd++EeYQrtugecjKgrz08/hf5gbCtqum3GBdiO6NzF5HEcmLDtXe7ep9ZfbU9dGe2V/CWyzUAbvAgVDPMt1aPI/4TyIU++cNmjr16Q9TPgjE7E+PzAD8D76WhYDM7dB6jrgQ75IMG6gCEC9JG8LSsBxKGcQdmbd+decBG7l/CAsVqwOcKIrUjCBSck1g8b/2GDjGXsioWpWhxkQIYgvRPDzqreY5sv68jUqsQRFyosBBwKFCNkPM7fhI5DPX9XmECNVD1GdkcjVo70kYmBEas/D2Ly0n0vPqlOGAA5mPeFtGt72GVPHJdWdQkjPlW2rnDUTUJwYuFozZMAMIlOeXSZnYUdYe48GJp6+PdmXb+YUoA5r7XliEAuY6wujFKuFW09OHGuvHoZeLVN9p+znR8U0cjDlGM7aChA6uYLD7M47mvdQAtGgYWwAkMAHMPmFuSvYKyDlElQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(396003)(376002)(346002)(39840400004)(136003)(36756003)(5660300002)(2906002)(44832011)(66556008)(8936002)(66946007)(6486002)(110136005)(86362001)(316002)(508600001)(6666004)(2616005)(1076003)(186003)(38100700002)(52116002)(6506007)(6512007)(4326008)(8676002)(66476007)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EUKx/ZzlH3iUZeLu0GnkuDgCuUjDCRuKI+wH+t7hm1oPm3XR00irTbXdqW7xwoyM7bRZGiOZ24IqvUWdrwdmGe6Q6A6ckekp9351fGiq7W4KcwNMuQiiUfGgO3iL3pzOUq/oeqIw4D1IG7LkIqPPpzWKaki74eRXpFBRuVemNMeuZSXiCD9iZ9HJXwVB9CtXIJtpdzpc+ox6PCqBQpOgH7fUVlZuQdd0g/fhe8Sq68JqIX1jNOFUuhJ03IFIxBRdoRjmRhFvI7oey1yYj99Gk5Vfh7Yv/Uk52i8JMXpNyXZKhAQgJb51V3LyiQdcK3PKPZoz53yaggSNbBPMRxhjPR5zcS9kRbcFaKKBrMdlM8tSIoF2mFr7vw88BL/JMcBi/doGQ9Up8q2AahBeX2NQyur8XaQK0wIHa6A8o3BumAYnjR5HJ7oy3COAGDDewAmGDZ8gHf9d0WC9Zk/j1NOp2FKhVefTKd9Zi+PyM8xfEAWwQ5uFkcN3LOhpbJ5fiKkeSmbOmkZt4kueD4CXU3WiAcG9nwdWkHDJJec1lkpL1aFY5avUm6Diii4qXYFJJRKb+e/gY+Zn0qWfGxLpQm8XbEg/G8B6n4+L7JNhThKix5vFWezK/3D7MNIVMyWqh+kTHeV3uDVm551Ld93H0IlEegJaDCNnB5SWFl3ka3km9CgbYujh5nOD3mV4303/MH04IG9oumNpMWh7bjXfat+C6jrM+hkcU1698rkF/9tRHnTOp9P55U0aNyKYE5cqdkk60srLi8TFuochYs4mk9UcMtt/yYISIvgcqUpNkLCKAd+dhJ2HMZiy2dgXsNJeobc5ueXOI0vNMdzi2RoJhb+pruxjHFmpeXLVrGchYPCSdT4Yab65YyzOMOi5wqorjweOfOFRbxGF1oM4y6tcKQl++McAqrt276XTOmgmv6csJHJvclJcK7lIVIbuPx+yMyHB24XILC/I19EPoGCVHKJrFZK6ElwtjVyFJi0/Sye+Jv6SUCXw5c2rqoqCQm9J9a60v+BCr/B5YTxdUjEFv1k+hluIZjhQFYEZjOXdooqrvAz8luiei+74YzX+CUtZ2nJoAaa+6lN21LcZLTWgd8hvBMBlGufhaX9iHwJRdCcDmp+dAFgOfnJ2dBCUwd8S03YmL7YdGV5bGW9au/k5vs88SIWm00siGtYsjKwj+MamipDJXo52NLaAsV34iRbtU7vFcfw0B86HIXqdnuZgVtbU9ju73XAaeNmi/VZBYylVfTJAtrVB8lxJ+OjS8RvsKtwGVq1L0cEyDD4rss8b6pgnu05Puvh21C6hAjBvyXLcvGQCtv4G0NVxcjUToF/2IwKGa7QajHsne7qvFw+hz9ltGPtMZkwUuG9iQpvNOe+fVNqFvVQ5llFiurOZgYgkQ0tnZJc+dEk8vQ6m42jB1Itv1Og9uYmWGbIwOItSpDjj5xdKq5O2IQWV2V7bEHCSS+tYRj47N0WrDnjYEetVyVPRzeyGiG4t6PyFLWVPV7mMz+0L8SONuRKWbUra+bsw8lWFK7HWz1zuAl0Q7LEI9642YA== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1fa7a243-5c3a-4e4c-bf11-08da034bf960 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 10:43:26.9050 (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: FQ6HyzsPr98nBC2UzghxZJ/O/VQP/7GbB8HYKdh6PHVr8VGDEmeX8zMJJyDjOXlyd6W3TybKjV96O2fkdkOnWv2ESKwJXP1Ua0dQx6ptlSU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR13MB1184 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Dirk van der Merwe The model number for NFP3800 and newer devices can be completely derived from PluDevice register without subtracting 0x10. Signed-off-by: Dirk van der Merwe Signed-off-by: Fei Qin Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpplib.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpplib.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpplib.c index 85734c6badf5..508ae6b571ca 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpplib.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpplib.c @@ -22,6 +22,7 @@ #include "nfp6000/nfp_xpb.h" /* NFP6000 PL */ +#define NFP_PL_DEVICE_PART_NFP6000 0x6200 #define NFP_PL_DEVICE_ID 0x00000004 #define NFP_PL_DEVICE_ID_MASK GENMASK(7, 0) #define NFP_PL_DEVICE_PART_MASK GENMASK(31, 16) @@ -130,8 +131,12 @@ int nfp_cpp_model_autodetect(struct nfp_cpp *cpp, u32 *model) return err; *model = reg & NFP_PL_DEVICE_MODEL_MASK; - if (*model & NFP_PL_DEVICE_ID_MASK) - *model -= 0x10; + /* Disambiguate the NFP4000/NFP5000/NFP6000 chips */ + if (FIELD_GET(NFP_PL_DEVICE_PART_MASK, reg) == + NFP_PL_DEVICE_PART_NFP6000) { + if (*model & NFP_PL_DEVICE_ID_MASK) + *model -= 0x10; + } return 0; } From patchwork Fri Mar 11 10:43:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12777806 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A0FBC433F5 for ; Fri, 11 Mar 2022 10:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234072AbiCKKoh (ORCPT ); Fri, 11 Mar 2022 05:44:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232482AbiCKKod (ORCPT ); Fri, 11 Mar 2022 05:44:33 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2138.outbound.protection.outlook.com [40.107.244.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 827AB10874C for ; Fri, 11 Mar 2022 02:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YlYh8Myto45W1dWo4PpOA9HsL0Lj5A1vdK3alVMz75r8xb/rClpRKXWseapVVq6ECdmzJvrqfDEJAFH8zJuEQu8iTYNnpqK/CrUq6MyuIyzFtjGTq3Ri0RujAdWTKuydC+oXDBaGAWmpfYolwBEID7cFLVGSTa5BluE1JXltnK4/nPrdLGNSkNR5UPX6tYfllitkKq6Z0A+HIlXvPlY7wAHuRAQJXqka3Dm8eH2JbvUfp7upU62xSYQBujT7dddq/y7q7QT5RTO8ah1dDYoIy41wyj2kclHfq5j/fRagyZltd+frKecsrGyvPmAzQIxADsMFS600v4ezOUpCEVwmnA== 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=tscLeC5XvxjR7Fwl6FV+ko7BYGjnBmXdwRScTasHahA=; b=gGFluoTATER2bx5FuLO4BTKn6GhxzVFLkqRHHdnvoRBZzO2S6dUCTDpNynb1+BH6oDRXVT3GVG3S44Zudz6kPM1WT3ukmZS/IOoleuaJHfnngJgPIMvNksTUFSKxeaUAW4SIZOnLRnEmAjRB+H0tRs3W4kqnRSke/09+tlinsSUvwcO68VjxoPTMA2quDUJqdsocntq6azyTsMXYOU9F3VaXWO0nqevTZPIMElvii2Spr8M6Dq+t1pnghgikocE+2Fn92Z7ReG+woyQu4lofjKnU2N89prnKw6B2o1TCeQ++pLQtTRLu7r8to6RNoyByky+j/EdqiVR1RaXP/tEPrw== 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=tscLeC5XvxjR7Fwl6FV+ko7BYGjnBmXdwRScTasHahA=; b=mUIuHeX+YBPddwjx5yb1yacq7vV9hmpN4BbPcbsDI4QwWMuof053bzmO4xn5wrkzUSfLpj9pJ8mtMZaOPrf84kGOczZtTUCIBtSbUP4VKaqrH5xR7CkbuamJ4kPyr5E0JTK1hidrOKXpV9qJEDS8C5bdnYXWbZpAgMKGzNKWvLc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by CH0PR13MB4748.namprd13.prod.outlook.com (2603:10b6:610:c3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.9; Fri, 11 Mar 2022 10:43:28 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e%2]) with mapi id 15.20.5061.018; Fri, 11 Mar 2022 10:43:28 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 05/11] nfp: sort the device ID tables Date: Fri, 11 Mar 2022 11:43:00 +0100 Message-Id: <20220311104306.28357-6-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220311104306.28357-1-simon.horman@corigine.com> References: <20220311104306.28357-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0P190CA0026.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::36) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e802672-64cc-409a-0ed2-08da034bfa22 X-MS-TrafficTypeDiagnostic: CH0PR13MB4748:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cM49N/FNf4PAWAbXuRG1oQ9lvljUwLCCZnnpkbi+Iafn7KSQzBtfC2lSdk6gZXd7QQQkGGXygJp0di94e4IqdyZmeLxk0FcseGPcZUvtb91Y2zVuXj4k5wpUiF9c8+9Xjo+cmwtQcQ2gJAEhicHc9nLwT/v8Mo6LxuyEmpI33Ose/1gp3RyADjH3MmebyPzW92gSOUjbDUgB6lFiIVhBTlSlY9ktPg3C+ZNc3c3WfI9GxyxfqmE6SdscYK4u/mb4sI2ZIi3F2q2uGu19SXsfHYSImk4wj7Q/brSpZ3/TCttpRUzedni3AHRSnJrbb1elIvdNx+ys6GngAcCrlUwsgIHh+hMgDmlLUwzS3KswyvxCA0H9CusABE5xgsuGwQhFPsKKtKOfEAn1uiAVStUDGQH/SguKNxmITGbqZSZ3LbhO3s5UqJpWNZc1dFsyEW33auti7TexTuSJmyHefZDFambxMnKbx7KTU6lC1HimWxQIsHtYe63C4NeRVf3Kvmks0UAfq4CJ3HY4UcR5XpcRDxffo22dIkfaWE9iowr0Ea7WeSyTDbaX8rrSRflrwZR3q0yk8djHVFqTFF/nh++kZjEaC4CIqZuKJjQuLlfl9J1nCC7KZKdWfSnxfkX2zGgjru9HaXepgJz02SRG2mKHOg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(346002)(376002)(366004)(396003)(136003)(39840400004)(66946007)(66556008)(66476007)(4326008)(316002)(36756003)(8676002)(52116002)(86362001)(6666004)(6512007)(6506007)(5660300002)(508600001)(6486002)(110136005)(8936002)(44832011)(38100700002)(186003)(1076003)(2616005)(2906002)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tzdLUTPLrC1HJX/CRQduX2VwdXuaihxaCJQDl4t7gEZEvsZWlaLaK2W205wHuf/wV/ECMOU/hd4UcN7JY+Swj+2EzkhGjqizzfEKG0WlBdAl/1+H/paZYwcewk1YGi4PiXfafNMAfg1Scyu1Daf3eZCYcMOhdo7ED/7xmxDgbnFvVWM23vExh4nnTKKNZCgIQknrum0PANYzZTVTiwt24mTUQ1+Fy58mlcK80UWZ3GzoiL9JiNOfBWaFBc7AEwdIFxjul5rOGJ1uJChTbG/8b7AMJPHuLMoW4jGRzr01+JOY0kZvAdx3p+u9HPJa+325Z9KS6PSttGVR0GDTLAurRp/sNdcH+s6zMsTzxNVhdyJX09MB64quSoXU65EWGccjBUZ9gx1YeMKGUBKsFa0HVHJBIEpG2Vyk6KaBxJ7kYiOumO4pWFHe/mwNqEirxpJ+oyD76Hl7czvLOn9viIbLr2cVNJcrJWuzx3QHJTkOdFdaJzCVBP0TIjScX8LTxSwqxU3VkTFo9Yc9ee5oekOXbuRk/rbqlioCjwMCmTc3c7HAJNcaNfsSEwS3o74rUQ4UMFrTGBa3L0iIoDzX/YUpVEtPnwG4eZ3SctHh/Ev99TJ1c5/tcbHBdMbIm2b1IioMy5NS8QukYprCoTetXMXYMOir1rZRMdWmZ8aY46qbO8SGsr5uJn7KKadAtia33ZySDtgOBtN0fYaA8jkW+l58Yd+vyQHPA5lQUj08IBv7R80ne8ATeD0/ctGrqgAzVtPpvIPCmpbe5FhbYM6XDaJqS3F8D/unkEV90wcFSTpG0Fy39hCCYVY0TYXdBdrocVLeXixeFzs9aFRMIrue0SgbOzpDVyPE7mzTrhNjJ4yoviwSPArmJcXvYoM4ZZy+zpA81TX0fTcDArrgRxH/IQxirc6/uFrh0AEN2HUjcioLJpMDcVPWgg3wReTNPChN5mLE11uod0SdpveajF59KTMgjA7PXev+NoKi4jiyn/UoMuE6Bz1H4GgtdweyKphfckdVV82F/azp8ndbVB32pBeeMegGpVvzp+bYzlVEfHntCiPdj2FxKj+pq3tmm6XUiDyOOnqteFPEIn1jRqi2UJVmRG70V41TRs1wtaIVj4fdE3jvcYHK8t1q24bFJ/NiauxVC30aPHy6K525cllTXTk7V5Rv5fXN/EgP9awPqs0YMH1XSXsuJPEXTUXK5fzDOxthh9cPcy10tRgPyzPWiEwxbD2lTRjqKq63I9NmOLGv7OUf6mW1DNnJYU3YJO4QRuVXL8eb6wUx9v9wHWyRnSFvrxjbCf6tlRzfqDRYEHkeC7NMXwGxZs8O/3n4h8qi/H8Gx+q/OZ6JSPkgu7yM52++Vwocaum9Kr/ZLRkjccB0DCDzIwoSLwjy+ryPIKvSk/A7P7JBb7fv05NYS6jXVkFWccNTkYCIB41UfmEYiYgaaS+QgDa+B61lGGq+UtcXuauXredV2wMtKFqNmurWGjTEzRQncrnweIzkNq6IKuZPC9FZ5Cql9I5tkbYKnbVu/Kqb9Q+rzU3w2DPUixdCTLbblg== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e802672-64cc-409a-0ed2-08da034bfa22 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 10:43:28.2968 (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: 6JpxvU9UOi46OKEvm/EeBm9OQTrgGCyRVfE088gSOhO/H76wHQ3ZN2v6w//jhoQGGdOPKuCnDW8D0Ec7h1iJzJoG3szXSjlDNVDicBTQLnA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR13MB4748 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Jakub Kicinski Make sure the device ID tables are in ascending order. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c index bb3b8a7f6c5d..8f2458cd7e0a 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c @@ -32,7 +32,7 @@ static const char nfp_driver_name[] = "nfp"; static const struct pci_device_id nfp_pci_device_ids[] = { - { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000, + { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP4000, PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, PCI_ANY_ID, 0, }, @@ -40,7 +40,7 @@ static const struct pci_device_id nfp_pci_device_ids[] = { PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, PCI_ANY_ID, 0, }, - { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP4000, + { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000, PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, PCI_ANY_ID, 0, }, From patchwork Fri Mar 11 10:43:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12777808 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29502C433F5 for ; Fri, 11 Mar 2022 10:43:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236041AbiCKKoq (ORCPT ); Fri, 11 Mar 2022 05:44:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233151AbiCKKof (ORCPT ); Fri, 11 Mar 2022 05:44:35 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2138.outbound.protection.outlook.com [40.107.244.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5EE114F282 for ; Fri, 11 Mar 2022 02:43:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fXkNkD2tQEyr8ZvE7V/Dcei/WyhTomhx8pioq0I1BXgn9Zm1xHPuhy2Zo8NrrIjDmuKQI64yxWaz0kjQpdiVbf9BZFsHjPO9b+OfGf2yTkcOzP8V6hJ1L7Xt12ZnEoQAvSLYVXipoXua7RpN+eEa2G0K38tTBUcTs1PZXgASLJ1FSb3Vi4lGOOLkKYu4vBhbxBr6pwOlP6nbjTCkO4VD7FjLPvzuox8dJ0/tJDUpWvAdISoD+JNJI700EM/xXb6aQFmwSDNDpASgh7BpiChvwHBvKg6A2yWsWi0NMCIVxlZa/zRj6vZya9NqNgUrzUpfsjjaYX1u06uXq766XLt1RA== 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=zSQxqUppioeK84yAekuRkD8QZMX7pL0aixLVXcMPviU=; b=A5nyIA7qbmloP6YQscMQqQR/FTGEe/1kAonZlfteoqGnzwGkIvY8nOF8bVzGUoLQwP5podt3G5axqwZIDj+0RfyIuEaL/S1CwayTRhGc6KuDW+JmupkkiEF8JA766vNqTEb1NwBmxAyESE6cEVfSn5rL3XW/PO1GsVA+cRYJD5R90y+7GBsUKwRq150pbn8nwoC48MCtly8k5c+YxVFGpDBIrc7vmY/mtW1tj4g2ACho1yLT533/nf/7lDa/j7Ue1WXA8kQiZbDHKI+yW0CD/p8SURTIS7rHQEb2JbjlviVyelJ63KkXh9s2or8nBCkhi4d3fa3mcL5GbctEBDx5zQ== 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=zSQxqUppioeK84yAekuRkD8QZMX7pL0aixLVXcMPviU=; b=SvnAWERRSJXiXbzrpO7j+P7d4XbdXlRu5y1vMy/ePbMrSXEwZC0an2+yc1ZXZggaysMxy2pKUsGTxE373+W/qPv6/r9oweKdLDLm43jpksl/tIrQ2bhwc9IAV4guLRQORsRfR0AtkfoMh8sg3ZU2EjQDH1DI/DNB6lyVqmMKUds= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by CH0PR13MB4748.namprd13.prod.outlook.com (2603:10b6:610:c3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.9; Fri, 11 Mar 2022 10:43:29 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e%2]) with mapi id 15.20.5061.018; Fri, 11 Mar 2022 10:43:29 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 06/11] nfp: introduce dev_info static chip data Date: Fri, 11 Mar 2022 11:43:01 +0100 Message-Id: <20220311104306.28357-7-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220311104306.28357-1-simon.horman@corigine.com> References: <20220311104306.28357-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0P190CA0026.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::36) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fb1d16f7-f196-4b71-3c6d-08da034bfaf6 X-MS-TrafficTypeDiagnostic: CH0PR13MB4748:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aXUA74TXeSGfH98TA5FaDpszlXcYU4zwC1GYFIRVmaKUNwq8Hd9eLbs0KwDk3rwgABDMw1bYbt6Mpo+T+DJS+c78EIsYipy6hanZddJ6I3plVDJWtvX4S+SZPqaEgFczsyXGpLUWYsclvqVHCa26AnVENI4iv6SlkWWiwzQXxOIMrYpIcc2hgScEfSYSLYf7f6PDvC0HpGzh+V1NEeE+p7dzfKhPz6HtGdDIG0jTSNkmofZvHxIVFjuw74ERGGtXWTjMJDEffnemqIxLjX9q562VD1fc32q9YhmmZkR6rAdw05uztyJ9SuaZGeqRO1oEdFo3vHhxmPrI3y7bo64wXf78F05AyCCqL4+QYLZgiO6JFr1rvWoROLi+CFUkvIJbXRRBxf0qtOblTH8vZvag07atwBAGx7a+IDDU8hozUO2o64z1AjS3km641Q+c1jJcPp/krr6QylpvJ+bZ8hSyBdh/0gj6PA+kq63zNRpswCxfbgUJHThBQ+W1lYw51k94ZPVX3o6/dqAEd7p3xD6RJf0aXjDhqY66kUzgrceWnruU0WtR0GpB/lc1FHH9Xw8BYJ7XoP8u8esHSvfC2iq9+FZQuZPRSZUSQjZp3Y9hQbdktY4kog5U7BOrzXqXaBKqZtKgBH4OK5oiP+h5UZQJBQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(346002)(376002)(366004)(396003)(136003)(39840400004)(66946007)(66556008)(66476007)(4326008)(316002)(36756003)(8676002)(52116002)(86362001)(6666004)(6512007)(6506007)(5660300002)(508600001)(6486002)(110136005)(30864003)(8936002)(44832011)(38100700002)(186003)(1076003)(2616005)(2906002)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3vec1LN8bAepCu1A553M9/QQz037J/mkYoq+/I7tFKH6Euff9nCsHZG2nDIVmLFeJ98SJJ+QmTBwGw0zI52oHdH6OhedTC9/vGqsM1BhoMlGEWP4QcMesxKXYsTx29gNxhidKuGsj9UHsZixLN9GWzKH/dMUf/OeHYIG3hSp9dZCEZw09mknLJf/ZgULohmscfTbTZzXO/vnXFijAU5nxX5r/3QqXBo6rlW4Kj7jkrqoUmMLeHcoVykO7fFZZTvIgohZ6d8Qj/+sU/fUAj0T+nSC1+8vTcdd3IkTUW5UmXEsTokIOUmj0GFmAUJHGpwy0to1rhnplUy6PsOKz/UdO94RMkCB+wy7i9ztyNw5Odkf6YyYfbekYsqXE15ZAze3O0fBToq9AWHKSVMNboV+hlVf7jaNjZJykIba8opgB6f3zTuZ/WOy1kD8fwDfxDreoQB2EIGFJB62qJ41kaR1N1a5Pkgtrv2SpHLQLun/2myBz/ThN2sgdn8xjDiCU1YiiCS0CdIQmzta8yn4i+VF/NgX8p1Lp9vuBarGF5I0hI+9d34KFshdy+IWJ/dzKcmgIpwT/crQ2fLlSeJyQT69TYHMemhKuw+a34Wftan1v3wxUbdodSwocYWQFxVMwNg0rAZF3oei7WGtl/i/teSOztZabjMIoYIfNEHv846QfH3uH7oyKYF1vKW1d8WOffVl7r/xft5CWoPcNQTyJHVSbk3unpJDRs9hIYkWYP3e1kbE02/mk2JAnc2reF1Tj1yIn00DhfRn8mCrOimOAbZP2Z7LF9vSJIa9U4tA/g/LbqCW7faniWkIAJnVGke9yE/20/IMLQqz2HQRXVEjr+FuJ0nAEZHT1fTNvegwJsIME+ADipssS1VdzGkEDCzVDRTK9pEV0eQEfIu6RDvzylPmscXiNwabx4xGS5702FymjHjrQIIVZCjyNNjp4sxoEn4t85CnrKLj7M+sBoQXqSC92HXDKPAlud5SME1NFO5HAIMyWit86/rD8Y5UB1uwmKXv0SMzBe6Nou12pVuNGwXYltW6TpGSfl/wmpn9UgzE90o+wwFi51SLRF7AwGupp0/Gmg/oYUKAUOr5X0IF7kz3yhMdMJ9AOHfDm3/rw24sgwlODq7GQQixD1b1EuyPHv+ZSCTdjFLFJXiujLkq1gkcEIxTED94hcHB6LXb9rIQiowrg4HXT0O9CJTQinEoI0xwDHrz6tAA67R2XD/Gl++N2tMlVHnZTVtlUilXKGlK8CGzGECVtdCmu7nP8dGKrXTzWUPte59o/07NOTg26uCL+t7qDgzcXw7Hu//nr410PEgCTJdTF6Ofr1q3TQoAKvW7CslKr7TJq+NskuLWwbcT8Gn+z3JQ4D7mFgE8czcT/13aCsB0P4yAXfEKxl6eNTLH4YJjH03YZG5ywtRCMoi6tGXVT4KleRIuOBUh1gvE11DIorAEJGLeE5cVLDIv7rvHuqq0nUXfn9GNsSXpw3wlZpxSVpt32QHHsbCWb/wyvpdozLop9WDs7LGuoqteWeHqIYY+P5OhZGCEP7qJCRcUMQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb1d16f7-f196-4b71-3c6d-08da034bfaf6 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 10:43:29.7030 (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: eJQx79T3gwplp+lvAz3qsD5vhP/YIjvxLwXvtiErNHHVPbDai5+RbJwrgUapZbQMY0kKtNQEtx+98e0mCdXU6iUGQsqZWNntgjibHfB2g1E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR13MB4748 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Jakub Kicinski In preparation for supporting new chip add a driver data structure which will hold per-chip-version information such as register offsets. Plumb it through to the relevant functions (nfpcore and nfp_net). For now only a very simple member holding chip names is added, following commits will add more. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/Makefile | 1 + drivers/net/ethernet/netronome/nfp/nfp_main.c | 13 +++++++++---- drivers/net/ethernet/netronome/nfp/nfp_main.h | 2 ++ drivers/net/ethernet/netronome/nfp/nfp_net.h | 6 +++++- .../ethernet/netronome/nfp/nfp_net_common.c | 5 ++++- .../net/ethernet/netronome/nfp/nfp_net_main.c | 3 ++- .../ethernet/netronome/nfp/nfp_netvf_main.c | 9 +++++++-- .../netronome/nfp/nfpcore/nfp6000_pcie.c | 11 ++++++++--- .../netronome/nfp/nfpcore/nfp6000_pcie.h | 3 ++- .../ethernet/netronome/nfp/nfpcore/nfp_dev.c | 10 ++++++++++ .../ethernet/netronome/nfp/nfpcore/nfp_dev.h | 18 ++++++++++++++++++ 11 files changed, 68 insertions(+), 13 deletions(-) create mode 100644 drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c create mode 100644 drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h diff --git a/drivers/net/ethernet/netronome/nfp/Makefile b/drivers/net/ethernet/netronome/nfp/Makefile index 9c72b43c1581..a35a382441d7 100644 --- a/drivers/net/ethernet/netronome/nfp/Makefile +++ b/drivers/net/ethernet/netronome/nfp/Makefile @@ -5,6 +5,7 @@ nfp-objs := \ nfpcore/nfp6000_pcie.o \ nfpcore/nfp_cppcore.o \ nfpcore/nfp_cpplib.o \ + nfpcore/nfp_dev.o \ nfpcore/nfp_hwinfo.o \ nfpcore/nfp_mip.o \ nfpcore/nfp_mutex.o \ diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c index 8f2458cd7e0a..aca49552f2f5 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c @@ -19,6 +19,7 @@ #include "nfpcore/nfp.h" #include "nfpcore/nfp_cpp.h" +#include "nfpcore/nfp_dev.h" #include "nfpcore/nfp_nffw.h" #include "nfpcore/nfp_nsp.h" @@ -34,15 +35,15 @@ static const char nfp_driver_name[] = "nfp"; static const struct pci_device_id nfp_pci_device_ids[] = { { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP4000, PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, - PCI_ANY_ID, 0, + PCI_ANY_ID, 0, NFP_DEV_NFP6000, }, { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP5000, PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, - PCI_ANY_ID, 0, + PCI_ANY_ID, 0, NFP_DEV_NFP6000, }, { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000, PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, - PCI_ANY_ID, 0, + PCI_ANY_ID, 0, NFP_DEV_NFP6000, }, { 0, } /* Required last entry. */ }; @@ -667,6 +668,7 @@ static int nfp_pf_find_rtsyms(struct nfp_pf *pf) static int nfp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) { + const struct nfp_dev_info *dev_info; struct devlink *devlink; struct nfp_pf *pf; int err; @@ -675,6 +677,8 @@ static int nfp_pci_probe(struct pci_dev *pdev, pdev->device == PCI_DEVICE_ID_NETRONOME_NFP6000_VF) dev_warn(&pdev->dev, "Binding NFP VF device to the NFP PF driver, the VF driver is called 'nfp_netvf'\n"); + dev_info = &nfp_dev_info[pci_id->driver_data]; + err = pci_enable_device(pdev); if (err < 0) return err; @@ -703,6 +707,7 @@ static int nfp_pci_probe(struct pci_dev *pdev, mutex_init(&pf->lock); pci_set_drvdata(pdev, pf); pf->pdev = pdev; + pf->dev_info = dev_info; pf->wq = alloc_workqueue("nfp-%s", 0, 2, pci_name(pdev)); if (!pf->wq) { @@ -710,7 +715,7 @@ static int nfp_pci_probe(struct pci_dev *pdev, goto err_pci_priv_unset; } - pf->cpp = nfp_cpp_from_nfp6000_pcie(pdev); + pf->cpp = nfp_cpp_from_nfp6000_pcie(pdev, dev_info); if (IS_ERR(pf->cpp)) { err = PTR_ERR(pf->cpp); goto err_disable_msix; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.h b/drivers/net/ethernet/netronome/nfp/nfp_main.h index a7dede946a33..9c72a0ad18ea 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_main.h +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.h @@ -48,6 +48,7 @@ struct nfp_dumpspec { /** * struct nfp_pf - NFP PF-specific device structure * @pdev: Backpointer to PCI device + * @dev_info: NFP ASIC params * @cpp: Pointer to the CPP handle * @app: Pointer to the APP handle * @data_vnic_bar: Pointer to the CPP area for the data vNICs' BARs @@ -88,6 +89,7 @@ struct nfp_dumpspec { */ struct nfp_pf { struct pci_dev *pdev; + const struct nfp_dev_info *dev_info; struct nfp_cpp *cpp; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net.h b/drivers/net/ethernet/netronome/nfp/nfp_net.h index f6b718901831..9fc931084bbf 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net.h +++ b/drivers/net/ethernet/netronome/nfp/nfp_net.h @@ -105,6 +105,7 @@ /* Forward declarations */ struct nfp_cpp; +struct nfp_dev_info; struct nfp_eth_table_port; struct nfp_net; struct nfp_net_r_vector; @@ -571,6 +572,7 @@ struct nfp_net_dp { /** * struct nfp_net - NFP network device structure * @dp: Datapath structure + * @dev_info: NFP ASIC params * @id: vNIC id within the PF (0 for VFs) * @fw_ver: Firmware version * @cap: Capabilities advertised by the Firmware @@ -644,6 +646,7 @@ struct nfp_net_dp { struct nfp_net { struct nfp_net_dp dp; + const struct nfp_dev_info *dev_info; struct nfp_net_fw_version fw_ver; u32 id; @@ -942,7 +945,8 @@ void nfp_net_get_fw_version(struct nfp_net_fw_version *fw_ver, void __iomem *ctrl_bar); struct nfp_net * -nfp_net_alloc(struct pci_dev *pdev, void __iomem *ctrl_bar, bool needs_netdev, +nfp_net_alloc(struct pci_dev *pdev, const struct nfp_dev_info *dev_info, + void __iomem *ctrl_bar, bool needs_netdev, unsigned int max_tx_rings, unsigned int max_rx_rings); void nfp_net_free(struct nfp_net *nn); diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index 67a87fdf7564..5d993772c1d9 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -3962,6 +3962,7 @@ void nfp_net_info(struct nfp_net *nn) /** * nfp_net_alloc() - Allocate netdev and related structure * @pdev: PCI device + * @dev_info: NFP ASIC params * @ctrl_bar: PCI IOMEM with vNIC config memory * @needs_netdev: Whether to allocate a netdev for this vNIC * @max_tx_rings: Maximum number of TX rings supported by device @@ -3974,7 +3975,8 @@ void nfp_net_info(struct nfp_net *nn) * Return: NFP Net device structure, or ERR_PTR on error. */ struct nfp_net * -nfp_net_alloc(struct pci_dev *pdev, void __iomem *ctrl_bar, bool needs_netdev, +nfp_net_alloc(struct pci_dev *pdev, const struct nfp_dev_info *dev_info, + void __iomem *ctrl_bar, bool needs_netdev, unsigned int max_tx_rings, unsigned int max_rx_rings) { struct nfp_net *nn; @@ -3999,6 +4001,7 @@ nfp_net_alloc(struct pci_dev *pdev, void __iomem *ctrl_bar, bool needs_netdev, nn->dp.dev = &pdev->dev; nn->dp.ctrl_bar = ctrl_bar; + nn->dev_info = dev_info; nn->pdev = pdev; nn->max_tx_rings = max_tx_rings; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c index 751f76cd4f79..8934d5418b1a 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c @@ -22,6 +22,7 @@ #include "nfpcore/nfp.h" #include "nfpcore/nfp_cpp.h" +#include "nfpcore/nfp_dev.h" #include "nfpcore/nfp_nffw.h" #include "nfpcore/nfp_nsp.h" #include "nfpcore/nfp6000_pcie.h" @@ -116,7 +117,7 @@ nfp_net_pf_alloc_vnic(struct nfp_pf *pf, bool needs_netdev, n_rx_rings = readl(ctrl_bar + NFP_NET_CFG_MAX_RXRINGS); /* Allocate and initialise the vNIC */ - nn = nfp_net_alloc(pf->pdev, ctrl_bar, needs_netdev, + nn = nfp_net_alloc(pf->pdev, pf->dev_info, ctrl_bar, needs_netdev, n_tx_rings, n_rx_rings); if (IS_ERR(nn)) return nn; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c index 694152016b25..a9e05ef7d644 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c @@ -13,6 +13,7 @@ #include #include +#include "nfpcore/nfp_dev.h" #include "nfp_net_ctrl.h" #include "nfp_net.h" #include "nfp_main.h" @@ -39,7 +40,7 @@ static const char nfp_net_driver_name[] = "nfp_netvf"; static const struct pci_device_id nfp_netvf_pci_device_ids[] = { { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000_VF, PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, - PCI_ANY_ID, 0, + PCI_ANY_ID, 0, NFP_DEV_NFP6000, }, { 0, } /* Required last entry. */ }; @@ -64,6 +65,7 @@ static void nfp_netvf_get_mac_addr(struct nfp_net *nn) static int nfp_netvf_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) { + const struct nfp_dev_info *dev_info; struct nfp_net_fw_version fw_ver; int max_tx_rings, max_rx_rings; u32 tx_bar_off, rx_bar_off; @@ -77,6 +79,8 @@ static int nfp_netvf_pci_probe(struct pci_dev *pdev, int stride; int err; + dev_info = &nfp_dev_info[pci_id->driver_data]; + vf = kzalloc(sizeof(*vf), GFP_KERNEL); if (!vf) return -ENOMEM; @@ -171,7 +175,8 @@ static int nfp_netvf_pci_probe(struct pci_dev *pdev, rx_bar_off = NFP_PCIE_QUEUE(startq); /* Allocate and initialise the netdev */ - nn = nfp_net_alloc(pdev, ctrl_bar, true, max_tx_rings, max_rx_rings); + nn = nfp_net_alloc(pdev, dev_info, ctrl_bar, true, + max_tx_rings, max_rx_rings); if (IS_ERR(nn)) { err = PTR_ERR(nn); goto err_ctrl_unmap; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c index 252fe06f58aa..aa8122f751ae 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c @@ -28,6 +28,7 @@ #include #include "nfp_cpp.h" +#include "nfp_dev.h" #include "nfp6000/nfp6000.h" @@ -145,6 +146,7 @@ struct nfp_bar { struct nfp6000_pcie { struct pci_dev *pdev; struct device *dev; + const struct nfp_dev_info *dev_info; /* PCI BAR management */ spinlock_t bar_lock; /* Protect the PCI2CPP BAR cache */ @@ -1306,18 +1308,20 @@ static const struct nfp_cpp_operations nfp6000_pcie_ops = { /** * nfp_cpp_from_nfp6000_pcie() - Build a NFP CPP bus from a NFP6000 PCI device * @pdev: NFP6000 PCI device + * @dev_info: NFP ASIC params * * Return: NFP CPP handle */ -struct nfp_cpp *nfp_cpp_from_nfp6000_pcie(struct pci_dev *pdev) +struct nfp_cpp * +nfp_cpp_from_nfp6000_pcie(struct pci_dev *pdev, const struct nfp_dev_info *dev_info) { struct nfp6000_pcie *nfp; u16 interface; int err; /* Finished with card initialization. */ - dev_info(&pdev->dev, - "Netronome Flow Processor NFP4000/NFP5000/NFP6000 PCIe Card Probe\n"); + dev_info(&pdev->dev, "Netronome Flow Processor %s PCIe Card Probe\n", + dev_info->chip_names); pcie_print_link_status(pdev); nfp = kzalloc(sizeof(*nfp), GFP_KERNEL); @@ -1328,6 +1332,7 @@ struct nfp_cpp *nfp_cpp_from_nfp6000_pcie(struct pci_dev *pdev) nfp->dev = &pdev->dev; nfp->pdev = pdev; + nfp->dev_info = dev_info; init_waitqueue_head(&nfp->bar_waiters); spin_lock_init(&nfp->bar_lock); diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.h b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.h index 6d1bffa6eac6..097660b673db 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.h +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.h @@ -11,6 +11,7 @@ #include "nfp_cpp.h" -struct nfp_cpp *nfp_cpp_from_nfp6000_pcie(struct pci_dev *pdev); +struct nfp_cpp * +nfp_cpp_from_nfp6000_pcie(struct pci_dev *pdev, const struct nfp_dev_info *dev_info); #endif /* NFP6000_PCIE_H */ diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c new file mode 100644 index 000000000000..6069d1818725 --- /dev/null +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +/* Copyright (C) 2019 Netronome Systems, Inc. */ + +#include "nfp_dev.h" + +const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT] = { + [NFP_DEV_NFP6000] = { + .chip_names = "NFP4000/NFP5000/NFP6000", + }, +}; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h new file mode 100644 index 000000000000..514aa081022f --- /dev/null +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* Copyright (C) 2019 Netronome Systems, Inc. */ + +#ifndef _NFP_DEV_H_ +#define _NFP_DEV_H_ + +enum nfp_dev_id { + NFP_DEV_NFP6000, + NFP_DEV_CNT, +}; + +struct nfp_dev_info { + const char *chip_names; +}; + +extern const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT]; + +#endif From patchwork Fri Mar 11 10:43:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12777811 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21DDEC433EF for ; Fri, 11 Mar 2022 10:43:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233505AbiCKKos (ORCPT ); Fri, 11 Mar 2022 05:44:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234534AbiCKKok (ORCPT ); Fri, 11 Mar 2022 05:44:40 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2138.outbound.protection.outlook.com [40.107.244.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 290E8156C7C for ; Fri, 11 Mar 2022 02:43:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H2ENpbhrCYD4DvNFcSCIXpGc5sVYsTQJ5Tj5uHCkEPXQ3wiaQCz30sieZ8MJ1eDWruFBq14q4HhjPUAdiNuiQWW1qHJ6vhNG04cPidXJgtYR//E3pp4Tu1+XGwczTuY9rXQusmibEe5WptCbF2rahKd2Bq+NQeWSFgLG8pIrD3TQMaFQZFLcRDpnM3ghR6oZrcER06/vUwJQ+b2GNxZJp2qM75iiKSlv2DK2Dv4VwEYk2jMN8EwYJ23tSMD/oFwVLIzXReqd+QK5Qw5NFgzBJhdrJyVk2H/fMSP+zazfGQInvGI2L+n0i3xhSh3LoMKzTh0LW0ASFabZ4MfcL38s3A== 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=lAXe8/Fr9qAUZFkJpwyJ7FNqN9dvhUx/pHipRTHIs5s=; b=cVYO+LzYLJyDJXDxEJiG/ZP1f2Jw01PyZQnMwT5Zc3xIcdP+pgp3pyqZq+vX2th5sVrwx5NUCE03QGnmq2l3UrWNGFji50CbwfKBExgUtFObIbhIxQ9EO0i+2aYl+3fosqW9sBEAcF9whi8sr4FwMxxhmGzAFaoWKhf/m1kri3tlp4MsFoMF03wSnV+7YAB7mqAKamIbXmBCpp9jvFiRLr+09YLOLbungfMyfQ5Zjar+gJCe+4+MxumOp3i6RUAVCyqPDaSxApby2BjfwF+V44xZaq+7uBrTM6iPU/bJo+naNTmJYOYV3UqOfTwgNQeFxDxWgOpgoqJ1PXZtr2BOWg== 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=lAXe8/Fr9qAUZFkJpwyJ7FNqN9dvhUx/pHipRTHIs5s=; b=Mi+mDxz5qnODBr5fj/oifZXInuF/RUxyprAg42/tl5k/i7c9JZyPjrJSvZYflKYw2VOmwR14P4DS53EAeVsZWL0ksrXFfjJrqljPLtAGH8sbMO0PUQRWQiQEtvNCZd8312uC5c9r9mWOYuwCNiKaBEhYX54+xFSVwDnqH+x9CFw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by CH0PR13MB4748.namprd13.prod.outlook.com (2603:10b6:610:c3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.9; Fri, 11 Mar 2022 10:43:31 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e%2]) with mapi id 15.20.5061.018; Fri, 11 Mar 2022 10:43:31 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 07/11] nfp: use dev_info for PCIe config space BAR offsets Date: Fri, 11 Mar 2022 11:43:02 +0100 Message-Id: <20220311104306.28357-8-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220311104306.28357-1-simon.horman@corigine.com> References: <20220311104306.28357-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0P190CA0026.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::36) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7916230e-56ba-413d-fba2-08da034bfc05 X-MS-TrafficTypeDiagnostic: CH0PR13MB4748:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KqFyztwVTyJlHQsSwlU6JYlqAERGf2CYI3FTNxn1g+lqoh6UAm8LC8Hwts8s5VTqb+guDHNBnzyGtwiawHwIF45dglzmU3VTtWZWcnxiStWdAYzVidu/Qn5pg9iOtJxj4WH/IgQcwblLYv29dkc8V1v8NGir8e7SzNW3XAA767T8U3dTnQmebLBdcAoyq4yOSWiM5E5f51doa2Z/ZL60dqVJ+jEoC0uFN+wqTYkuInItDcrwdN6ndeYZHSPMdLMHLarh94h3LZ2HAfNzEXXuAfGZF3mm8H7a2wE2YS0lwIiVidAvrTRl5UnyUuhiXiDtCDVlHhRi42qCrPBKKvvuY2hfXdpAfV+xqbEKZRwQQdKWl+/Y08hCPj9v2Yp+fvsFQClR/6iR6HCkcW0GJku1Lzbdedttqhl5OntV/Hyh9AzQlFgB1aWxs3u8n11UHqnHAOrqAIsMPxFR/JR1YSnf5QhldP72HLLmFf1uLGg8vqzSGSXngNRjiB1lHC0+gQuMh6smzmaw2yV2ykLMnh0CTtKDRQ8TvdmfaEK+a3V/EZZq83abevCmnG3wJZyNxfSvcgZsKZxDPIzEdjqDGWxhz9cP2f59jaA+QrNwmWYKvmiB4QJZEcxsA8zYJP03f7hzk057XOZxg6rA6d8UaPGd1g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(346002)(376002)(366004)(396003)(136003)(39840400004)(66946007)(66556008)(66476007)(4326008)(316002)(36756003)(8676002)(52116002)(86362001)(6666004)(6512007)(6506007)(5660300002)(508600001)(6486002)(110136005)(8936002)(44832011)(38100700002)(186003)(1076003)(2616005)(2906002)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qBxwrrqimCmDfL799vUIXLo8cO8Rx1sNWYSKpP58XsYF4airmjjoPkd99kNHvgGnmm7GJm1G2OfwBiMy5iAw6cENwKbLd/OzgrVvrlU+ujg9EptbduPqoiTNnaRlIZUfhiIz74uzgLDeYQBP9ViMxskT83lHRMY6conhxc8dxwTaZ3OpuTsiJ6j3E/VLEq6ZWE0+cDFDKU5DKjNQOjO2nDSuOjuoPn3tammM5RL0LwRD+Wojyh/wZyVLvznWndY1L4NAUtgrcN1KM+o9tcSdb6wb4WHDp285hwzf9e7/4zhpg0pcT+ipiFQ3ITPtM/CowQYEfZ4D1V4+m4lU0uyRkJw5jwJ5fPnCyX1Hw3XtHTas0s1L5XJQkXl71cvq8h6eN8y+7jDrFKSapELO1DWPkukzGfTPIaeJgpEFb1iVk1YUWGNzacWwIaFAxXhggCA3mkbBXf0tmWxHbNuV++wavH8hUM15WSrFFH7jESRCAfaUGJI8BUcEFrHYhdVQfzZGPWTbH61fUPcLipS78aZ4NQVSv3krORsOtDxcgVgdlXpVhudEVDDt18ENE6PRLPzyf917Ql41Lhyl0hDSiFsjNnKHHchHFfg9YDtagqdnc8YZQA/d7jZgb9+bSkOcEpTOlwqG41+5gjC5BpZsolZ+H/kYT9hT5KDnMcJzjvzkNSbOGKeIuoXmqye4wyRSfIdHntmbtRYPXs/gCmJucKjZ489HIGCYHx9fd+EsfbA8Ucyf1iKvSTrTDnozM/53Q2iUWfJ3rAbByA2uQIX3Ktb4HuxpJX9wn8LO521y+XJTMZPsHqQumIImfaUxQ5d5mex3Llh2tBNIKBQ3YBRF0D678UKa3/dEVKxTNFFq64kUIqgLrGdQd/33SgSqVFPeqtTnuoPT/ZOdvlHReIpL117XvOEkzhlHcW61sA6HcTpuCAwiomyH8/DaTa1mkqdlib6FdZCbFMpvHCTsJFTM4TUK+7//sYpqQYcuJO5X1wGiKOpiRCWKySyD2QaSFVk3WEv8znou1mM3LAWsKqyypPvRyO2nuBYnezysFSkNKeOyNJEUqdtIKjFdm98l6YutkX1CYJjSLBk9fFmbmdFbegSLHVNMvaHo2BK+gJYbG2jvysRbFk+ddywly0JcSyBcFQm14HHgt6DPFxFuUpgGcGKt1WeBh0T9tDNYXHbz3f/Q6IqFiny5XYCp+cR99VVsBg2v5FGrqgOLivJG3y6Tk/PnIjO/D2y5qZbLOCQDx4mWM9A78XvyG3YUza60Mw4dInJsW8h1YV3s7XXRBMCOCLoUAJRR2ESSg/LfBolEUG9h232K6LXQsgb2YzV4TJRlDW2JtJM2UGKeoimQWCc/xJgEhSO+DUvz9NvzUgLk41NPGt2tD2rKKx3M0aDF9enh/QJnMY2MhsUnjapa8EvIp0Sq/3UmTg2dvlLe9WU3S+ddlUA4Ohi2hPMlouGcsc2STVSDv+I4KiNrGBN8Ksuk4C6tYTM4SI1xYzdNqGYeLtS/vPVrqcacHK8wB9l8RIBABBSwk3UdA8Lt4wp2eiHQR9zxxw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7916230e-56ba-413d-fba2-08da034bfc05 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 10:43:31.2977 (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: Vfd7nlhpECaq6UyFjd99Pbag485Q32j10N0oxoz9Y8KTL93Vap7zNMJrw/jMbKcETKFm5UKeNj7TV7t9onnjY8XAZ9FkZ2rfNImyuA5jLi0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR13MB4748 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Jakub Kicinski NFP3800 uses a different PCIe configuration to CPP expansion BAR offsets. We don't need to differentiate between the NFP4000, NFP5000 and NFP6000 since they all use the same offsets. Signed-off-by: Dirk van der Merwe Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman --- .../netronome/nfp/nfpcore/nfp6000_pcie.c | 18 ++++++------------ .../ethernet/netronome/nfp/nfpcore/nfp_dev.c | 2 ++ .../ethernet/netronome/nfp/nfpcore/nfp_dev.h | 4 ++++ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c index aa8122f751ae..0d1d39edbbae 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c @@ -101,11 +101,7 @@ #define NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(bar, x) ((x) << ((bar)->bitsize - 4)) #define NFP_PCIE_P2C_GENERAL_SIZE(bar) (1 << ((bar)->bitsize - 4)) -#define NFP_PCIE_CFG_BAR_PCIETOCPPEXPANSIONBAR(bar, slot) \ - (0x400 + ((bar) * 8 + (slot)) * 4) - -#define NFP_PCIE_CPP_BAR_PCIETOCPPEXPANSIONBAR(bar, slot) \ - (((bar) * 8 + (slot)) * 4) +#define NFP_PCIE_P2C_EXPBAR_OFFSET(bar_index) ((bar_index) * 4) /* The number of explicit BARs to reserve. * Minimum is 0, maximum is 4 on the NFP6000. @@ -271,19 +267,16 @@ compute_bar(const struct nfp6000_pcie *nfp, const struct nfp_bar *bar, static int nfp6000_bar_write(struct nfp6000_pcie *nfp, struct nfp_bar *bar, u32 newcfg) { - int base, slot; - int xbar; + unsigned int xbar; - base = bar->index >> 3; - slot = bar->index & 7; + xbar = NFP_PCIE_P2C_EXPBAR_OFFSET(bar->index); if (nfp->iomem.csr) { - xbar = NFP_PCIE_CPP_BAR_PCIETOCPPEXPANSIONBAR(base, slot); writel(newcfg, nfp->iomem.csr + xbar); /* Readback to ensure BAR is flushed */ readl(nfp->iomem.csr + xbar); } else { - xbar = NFP_PCIE_CFG_BAR_PCIETOCPPEXPANSIONBAR(base, slot); + xbar += nfp->dev_info->pcie_cfg_expbar_offset; pci_write_config_dword(nfp->pdev, xbar, newcfg); } @@ -624,7 +617,8 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface) nfp6000_bar_write(nfp, bar, barcfg_msix_general); - nfp->expl.data = bar->iomem + NFP_PCIE_SRAM + 0x1000; + nfp->expl.data = bar->iomem + NFP_PCIE_SRAM + + nfp->dev_info->pcie_expl_offset; switch (nfp->pdev->device) { case PCI_DEVICE_ID_NETRONOME_NFP3800: diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c index 6069d1818725..b3fb09c2732f 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c @@ -6,5 +6,7 @@ const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT] = { [NFP_DEV_NFP6000] = { .chip_names = "NFP4000/NFP5000/NFP6000", + .pcie_cfg_expbar_offset = 0x0400, + .pcie_expl_offset = 0x1000, }, }; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h index 514aa081022f..18ca8ac68fec 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h @@ -4,6 +4,8 @@ #ifndef _NFP_DEV_H_ #define _NFP_DEV_H_ +#include + enum nfp_dev_id { NFP_DEV_NFP6000, NFP_DEV_CNT, @@ -11,6 +13,8 @@ enum nfp_dev_id { struct nfp_dev_info { const char *chip_names; + u32 pcie_cfg_expbar_offset; + u32 pcie_expl_offset; }; extern const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT]; From patchwork Fri Mar 11 10:43:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12777810 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E2C6C433FE for ; Fri, 11 Mar 2022 10:43:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235893AbiCKKor (ORCPT ); Fri, 11 Mar 2022 05:44:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234785AbiCKKok (ORCPT ); Fri, 11 Mar 2022 05:44:40 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2122.outbound.protection.outlook.com [40.107.237.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63DAD18A7AC for ; Fri, 11 Mar 2022 02:43:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k0VBbE9AHoB3D4DzrjTk30IgXMjYFU77Dvh6WJSH6DTz155exot0k+4D9MeoQY8Ol/6tnmbckw/PTQpIsHYEiOd6n1ejXkJpRMi+HisvvwlkQKB6taMiOUoLgyuNv3Qq4t+IcyuJ5b80OMHM6dIlfBXoW7J4QGOlh6gZ+fD6IN0vg53Pn8tIMPAv5K399eQulfd1QjC+eLX/G/wI+/112U/jnd7URVAr2UPb3fcdrmCH35Zf9m1iZcdiPbnq4H5F6h4GLVzXi/WaSPed+7gF1OAmLgKAyAnQNWYmgQll/tKGeij5uR0MGftPlKUbgDdrTcTYnvQnZg1AJ1Vgz06gnw== 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=boBxymxqzmJWQFMIazO1q1FjmJbmER7VMmyOpEKLXc4=; b=aRXwAOPeSJGG/nTin8SRb7Kyzfs0NeSn17s1i4qvIW0oQng6lJA+mTBYJiuQ6zbNsJ6dkYHJNw9n/Lso3jYM+zC0Nzf0IJYfH/fwCZBSutDwzcF5ku+JXs6kvouUHkr4Y/vuzJd+bvss8FZ0JPQzTq+VdINAYXpLdvKmOJET86JCYGLe+YrikIK7jwtw64MrhyQEReOyQZhWblQusDZ5E3F+t8P7dhJ+/AbSUcfoG9SyVhCabKPa5shb+ONAI57UWayZubnl6FehqKcOhj0Q2ZnhAH39JVff035kkhEbFyH2yByCtc00e8JXUq3B+Y2J5TE/BYo3jt/EEgcV3WJDJQ== 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=boBxymxqzmJWQFMIazO1q1FjmJbmER7VMmyOpEKLXc4=; b=VKZ8UVZAWn14do0I9CyJe4sQkCwnS6UieLeZRxCpFtJSJaLtZF3o/X9L0XwbFMqj4fHoKfTcAuFsRA8zLycEEygLu+2VjpRlsV7tu6FinDEoAdE6PgkAv32nI356eXms0yf3th1GgDV2NQeXJ38oHD1FiUqEGKuMblYnk6tuVEQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by MWHPR13MB1184.namprd13.prod.outlook.com (2603:10b6:300:e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.8; Fri, 11 Mar 2022 10:43:32 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e%2]) with mapi id 15.20.5061.018; Fri, 11 Mar 2022 10:43:32 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 08/11] nfp: use dev_info for the DMA mask Date: Fri, 11 Mar 2022 11:43:03 +0100 Message-Id: <20220311104306.28357-9-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220311104306.28357-1-simon.horman@corigine.com> References: <20220311104306.28357-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0P190CA0026.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::36) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 01f1cbdf-0a1c-4398-83ea-08da034bfcbb X-MS-TrafficTypeDiagnostic: MWHPR13MB1184:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fz1lhxpvF6epq841QOvqdHJqP/MjP6fPsnr+NXtTAA5+vNuj0aHW/xvMbCAUTgMT6kf+sZ4otqinZQDegCNQnceC2sRZjTOg+ierAnyJA33ly4XOdNt/GxFYM1RGtfClgvj9ClS0hlNBy7oUmPrH5IEDuBRUfs7Zn4WKS21Ca0J+tRLCnaQT301GBSe5EGdxnzxews+GLCfhWwjsC54bIVOqbT8GZJZvj/wS3LNYY4u94Y61aQ4rnJCwkFK2nwtHscUEqwAgbRayXb/1/f6QmU6muYju0osCPyOaXzupSidWUgAHKTJqN7OqmbymkpGE5VHWlP0ZcR2WnfC2eSyUO83bq3aX7hbpyxchgfj0c2XucDBOC+Iw9qBVxQrUiZS1dhfp0NJ8a7I2RF1k8wn9LNtvW0Bs34p3DYCUnOl/H59UjffjS82GTcBnonHlmLUjBcXMW94LEvDtCkEZFz7hrQILQapbl5ryR0AUYzTwb9rfai6vzUlpGUGzS+kIVWg85HDRFa1MGV3a0TNIV3mwMl39amD9Jvcbc7Vvt0RsLhmdV7tlhaqiXrQCFFs9NaK58vYFiPw3+vri83vbM8ctsRji1PDeK0d1L4zf4c0GFCU2oT3tcQ/VPZAosBwKflg8LFjf0I+dIwtsGWW3wUg3Ew== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(396003)(376002)(346002)(39840400004)(136003)(36756003)(5660300002)(2906002)(44832011)(66556008)(8936002)(66946007)(6486002)(110136005)(86362001)(316002)(508600001)(6666004)(2616005)(1076003)(186003)(38100700002)(52116002)(6506007)(6512007)(4326008)(8676002)(66476007)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pJwl8/Nvxt6isaay+U77xGz6VK+7kuc6FHyZu8Exwd0Q26CIrNGMnv1QuX4kUC/hx82tYXZYjBB5RhbE6cNvRdFArAOwWXkiOPllz/2uiK25vNpPEvrKGStqK8/vN1wKxuItakuXtJ0agzoBbWCrri++wqf2PsWcsLrK7+qVupO5QEaEvduWdFVaWZ8nmVO9OLP7Vyf5XJXIrLnTExy/ZEKI7XRdV/jJnBpZQAJskraCp9GuR3CVSZDU6kDvWrGk6vXVXDaI4byy2j6qh0VuPLkbhtuXMZSDGn+sWsIHQdqIaNs3c055a1gUBdBqhsy4NPmBXLAErd7IT5dHsuaLlSVUKyvfGXtPaw1EXUzhOwh2aDCFOErRGGoD3QdCt8rGgIErfi0OIDbMlZ0g2mbLjuyEoGohUkyrHJ1+HhcFBHTzaiyfUy8xoIus2T4BwqgNb6aEWoQ2JcRAcU5j/YK9znSEKQwnrD1GYDj7ZjN5+iMyI/7YzwJTnjv+XYh38aHlsjIOiOkS5PthO9nLw00NzNIJB2pMuARmBF/0AH1axLbAJOgSv/37cUqIA+yaz7WBmpU45vKMsLd8Lu4CmyFKUFkfLAlQ1yBtmNDD5fkymF2Mm9tTxujz4H202C4C1NJvnew1iRKw9oYYVW3NUGL4T3gZaJ8hWvOsqaK3tlMA8AqD5FmRAiBhk0fX/E4Fg8JAqxPJT6+gOL8EX/IbTUQhvyC5IQb/kIV5xupLt28Kvys7Aa4RCwOiEAc34YPFkJlZNR35VZcmPlrpfIoyqol3odGiJExcN/5fPianrn35CyUwKsyAC/okRrpQnnOa+5ceojDJ6f9dOuKvZQ1e8tGFpy5LrtQQUvmNaGR7XqnIkgRepxChDOA+4/dZ03pl9WgBqk14MNrIDPLLqsePaRBK6hAs2qiLr1F+DpXAvtown6JfcXdX6tM3E9ZbTUhQOqLEqGmgIKPBpIQ2giTS4sOE3yp8yErK/S8t6Y0drP0g3W3wqbJtV/FLOZWP3UaoJi2QVyfebnfIY+n2Q15gS++pN1Qu2g+s2Qzy7vI16nbFQowmsfVTtTr8TjJR9Al6PAgcOA3yOYrQLimXdh/NWDtuPEkYE7ochDCvaue/XivsAJcVd9ui7WaPPZQHvqA5g5NXT3d2WK/2ZyVseyV8hNWJ5kGW4zVRz/OrJuIrhpeZO6PQ6I1Bk4iX8bCl2eTG3aUjfOeI2hj/Y7DdXTN16bKbkWYI2AcuCwSaU5Zn3PlNgdZDhywxiy06Lx7Az6VJ1ogkSNe+Zlw9BthII05fMvB8r8X/PmKgrZO9TVlsptyQJ5si7OUqaLueO4R6KI56UM4FnfnP4baZ8+AKC2BUQNwEqjf0emmrIHnytHzK94uvagsFbjiGDb9/uWZtFeHZrp5QdnaudvDpUXMYnoZtRFL/jpf5Rz7Ijr/pCuzZAJPdWoBV6VERuJaC40+2MmO1wNSz0MbW9ZzJvIRy/xwS2PrQz/TsMOzeKb2Hm/q5hIw+dR15mGY9GOFvrEF9l4e53IQtlXUqEileK40pn7/17tHMsQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01f1cbdf-0a1c-4398-83ea-08da034bfcbb X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 10:43:32.4705 (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: mEbqKPD7pYIxwQVOFIHza7iyecl6kNNV0tywADS7tnYo0+r1Fivv6/fw9rc6FxiHCVuNcJpgrH+43S2uZJwoiNMQcRRM8XVwy+4CEgxHuuc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR13MB1184 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Jakub Kicinski In preparation for new chips instead of defines use dev_info constants to store DMA mask length. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_main.c | 3 +-- drivers/net/ethernet/netronome/nfp/nfp_net.h | 3 --- drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c | 3 +-- drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c | 3 +++ drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h | 1 + 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c index aca49552f2f5..dd135ac8b1a3 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c @@ -685,8 +685,7 @@ static int nfp_pci_probe(struct pci_dev *pdev, pci_set_master(pdev); - err = dma_set_mask_and_coherent(&pdev->dev, - DMA_BIT_MASK(NFP_NET_MAX_DMA_BITS)); + err = dma_set_mask_and_coherent(&pdev->dev, dev_info->dma_mask); if (err) goto err_pci_disable; diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net.h b/drivers/net/ethernet/netronome/nfp/nfp_net.h index 9fc931084bbf..232e0a622ee7 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net.h +++ b/drivers/net/ethernet/netronome/nfp/nfp_net.h @@ -63,9 +63,6 @@ #define NFP_NET_Q0_BAR 2 #define NFP_NET_Q1_BAR 4 /* OBSOLETE */ -/* Max bits in DMA address */ -#define NFP_NET_MAX_DMA_BITS 40 - /* Default size for MTU and freelist buffer sizes */ #define NFP_NET_DEFAULT_MTU 1500U diff --git a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c index a9e05ef7d644..1ac2a1d97c18 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c @@ -98,8 +98,7 @@ static int nfp_netvf_pci_probe(struct pci_dev *pdev, pci_set_master(pdev); - err = dma_set_mask_and_coherent(&pdev->dev, - DMA_BIT_MASK(NFP_NET_MAX_DMA_BITS)); + err = dma_set_mask_and_coherent(&pdev->dev, dev_info->dma_mask); if (err) goto err_pci_regions; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c index b3fb09c2732f..5a8be13a5596 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c @@ -1,10 +1,13 @@ // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) /* Copyright (C) 2019 Netronome Systems, Inc. */ +#include + #include "nfp_dev.h" const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT] = { [NFP_DEV_NFP6000] = { + .dma_mask = DMA_BIT_MASK(40), .chip_names = "NFP4000/NFP5000/NFP6000", .pcie_cfg_expbar_offset = 0x0400, .pcie_expl_offset = 0x1000, diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h index 18ca8ac68fec..ea61156c2075 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h @@ -12,6 +12,7 @@ enum nfp_dev_id { }; struct nfp_dev_info { + u64 dma_mask; const char *chip_names; u32 pcie_cfg_expbar_offset; u32 pcie_expl_offset; From patchwork Fri Mar 11 10:43:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12777812 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8886C4332F for ; Fri, 11 Mar 2022 10:43:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236111AbiCKKou (ORCPT ); Fri, 11 Mar 2022 05:44:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235596AbiCKKoq (ORCPT ); Fri, 11 Mar 2022 05:44:46 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2138.outbound.protection.outlook.com [40.107.244.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23772198D39 for ; Fri, 11 Mar 2022 02:43:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lgSPTlziyJG3udlP1TCNWjxl1OtN03hP/4x21GlGAaqsq8UNzgygG/CFNnAh2rj/7QbljNQFHjgC2QDMPaTfuMXyLzoaMNQBIeyDvPwinndZEXDOuQedpi6njUT6exscpG0o7mcHBvqEy7IKqYjGwFVFWegEWyWLp4dbt2xqo1UwYLUBR/Kt4OIRjP6TG0NeUzXYJzSWJH9cjwlwKR4p4QdYREyf6DDx1nd/I3tMc7ZRrsM0vA/vMz3vox/dycz0HL1FWhAGRqFRK2KRpmEU+mzktIC9qBhyeEhoswSa7gNb6cLHpp7MZu5MekHgKa8Cbw9wMUURPuwJtp2wJwPldA== 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=64vSt+OJHnIIGgaOlY9Hx954rCfhppIH89wyKFkxpjo=; b=CLVesyHWjXAJg6LGuhEm3PA0b2jStynB00ft4+B+jd2nT0emY5w6G4+rUUXpLlqbg9ONPPtA1WPQbxTKX+mb3q53JEigho/jW/n28QGCK5SaFFhBr16UmBafxP/imggg0patCADFuvtJZwqDo2W7J/tdAU75DUya65dPcNTqs6w1Nl52b/4XkhngSCjIVTNYYt+KzuCtuE6VZBoW6y6ZWw46HN07NeVSH8dq/+XjQjHUuFjUyfLdVA8ywM9k6VesnIcEn6zeHHy4m7YU3oMeZWnZFo+LRueHWihZ5NqDWVmba7TEnQAJlT3whRnSqNvzNOIFxgaMEValf1S74jBgeg== 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=64vSt+OJHnIIGgaOlY9Hx954rCfhppIH89wyKFkxpjo=; b=RcwOHCgyq3p63qlDNhf7B2yHRrfW3vuZyg21neAPby6adlppPbLiZuwcV7wBfVUQ41H4u5Y9zMj5r3ROCwg0IPh49qhB88aFujWM73BGwJNr9i8FbBErwNuFT/wu4RGF4bwuUp1fv/W+tt+aHULYcrruiFsfYNBDUOrCHxW7goY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by CH0PR13MB4748.namprd13.prod.outlook.com (2603:10b6:610:c3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.9; Fri, 11 Mar 2022 10:43:33 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e%2]) with mapi id 15.20.5061.018; Fri, 11 Mar 2022 10:43:33 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 09/11] nfp: parametrize QCP offset/size using dev_info Date: Fri, 11 Mar 2022 11:43:04 +0100 Message-Id: <20220311104306.28357-10-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220311104306.28357-1-simon.horman@corigine.com> References: <20220311104306.28357-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0P190CA0026.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::36) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ce33d45-b197-4dd0-3fb2-08da034bfd73 X-MS-TrafficTypeDiagnostic: CH0PR13MB4748:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JEcIozWDF93R1wAw5sWmarQmnRwWYhGU5mlpzc1+FrFWofTf9FM40ztKUmepQM5MvpM4J5Tn6TILiWIF789q0FmEB2nHy67epsBg7Es8Vy+eZ2IHPB4vLjpFiZvsMsWA4feGNLj9y4RD19B9+1AOhnP7Cv/TVZ0zs5H5iUQcDs4uvAO2991akONCailorYxhKB57KAppvv7XZlSWgiaDjj5Ow8Sl9LLfeez69t3tNUYo1qCu8jd26IeFJP/FsVuupGz3bKAB5GL3ixbfmiCK9JP+x1DBLTkeyo4zsH8iHlz1+pxV/cLLfnC++ffSeqSu6QP6UBZv+yS10MLvWtSKViJjU/WNjTfU0nVtrxALEQtAGaS/uaFoHbfKEUviCLrz55M1xKXsxHaImt2LGJpNjvUatQ8BuVsncsD8lfkgSlvRp7HA/9lqvI/TumMr6meX4vZQi/6URXGGpMdEUeDBYEE7X96f1x7ZK6KkRgF2ef5GiQUzWL6tqIRFp6J017shWetJMJMAcn0HWOjgpFOijxMvBJkCcRDqUKRZBOsF2B55dayBzBAovh9rNPyf5Gx4KwdTLtmZtE+cjp1FFnvbZLnjueITF7MfHJl0/3j6Z8YE+8fYjshZJUgx61EB9sFlaCH000ilK2K/pBWApPeGRg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(346002)(376002)(366004)(396003)(136003)(39840400004)(66946007)(66556008)(66476007)(4326008)(316002)(36756003)(8676002)(52116002)(86362001)(6666004)(6512007)(6506007)(5660300002)(508600001)(6486002)(110136005)(8936002)(44832011)(38100700002)(186003)(1076003)(2616005)(2906002)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VV9mKIR+TK3d41Xuo8GU5NCcKh0C7J1SeUMgAvgMfixzs9+BL1XL1GpAQE/wW40LZVewROhCLaPZS9DxrLZYumVkOUm5nxXFjq6cD0vNasDHxy6a8ArG1CSt5QX6L1Wgg8u89kEzxhwgXAtqX0biaY+FIcVlY5YAL4TtqDozrDrDBs0LNXFoiMklK6heWxCQPTQgKKdPuWfYD3NoLh443mfDxXshc1W4t9W94lnsEGlQptihYnLhSd9EwJrYbyc0ba/HQP0LdaHi+kfJoGYXd2W4sieNHUV6X5DdpeRQUtLQ3zt8R5sJaatBIs78FFH+bsdl2NGs7TJPPFigDFx/exZyrkXWiaytxGpFMq2ywo/KRSj+5pphIX7fiyJARrvEFCDubKhy8MgQVS5ufEZ7DWQEXwuA+OraAPQ/7YGj88jneSkxyU5+915TtJ1L1pVYewU5RMt64Dbw10hAZjN3b0/Qjh2WGV8Bfmj6fdLHkScJPtYBRqGci735BSJnPbS6hatp0xOgyMYpzMi6HYUB2jwT2bfX7CMGlP0PNK+fTzp7PnskEJwZL9a0z9VK6oT0YAFCetSRUe1m6vSlyu13vMhnsruFmjPBgJqQ5bo8gPWbO9WxIIOhdy2nf2A1I6/HE2O5E3pX4XxkuefBRRZkClvR8gAC0OkS+Xm9Luy2yUY9BZLyHlnOkoMlyHyWfY2aoTxuAJ39WsxKgT85xX1XBOgBalmIJfQDhK2BWe9AkT+KwYlkCIVDhMkdHUD4oAFVDK6jbXmAplWJCFMqjs8uYaDJZSEM6OkTJKkOmt3vDY7LX5rqRFV96KvXYeVOVzOyibhDlMNEbB6/cha8P+lysfqcg91ZkO1DL2kqZw4euaA2iQM+XmZi0Fq7L7To9Hi3uKBtgs+uOfDqvFXY4s1bLawDwRSxiTtqf8SU2ChG6KGdZXg2KUxNyiZ9G0bVdNsu5INWyt2I6ikTSuR5Y6cSl2PClaAFLw6I51WPvzXnCZLvEVvvvU9OkEnio9XWsDkx24VXfXakITV0ONcFvSivzQI9p+GUDpYHZsLXiXj+pd3Cyg4jYRhcoApnaWhVa7ymX2UBNceSh4Gtd9YJrxns956lqAThiTkiLKC9Z3IMtdKeoHpuRvQotoQNzvXiFz8lGkTxxC759YNlhIdL6a1e1KqRCZiHbB8whyNIHuo75nQBcndslow4PmOO4OBgZCTuoFZJd2lI/+0VKjYQRBOWAmTyEVxddesZQoPIELp1jvJXpnHH/u/BnBa9JWSumTTJk2XIrcAq0BI92lPmLAcbUbAVH8+rPaAONTcoHeZU3JXgVM/iFf+77C5qJegF2AATyEg7ZYFhLCxHlkqL1+RtwgiACxr4DSyborg4WN/bNqsEBPII/euX1P/tq+aOmBqQtF/Qj5PfeZZzsXLvmy2BUX5qXipypSLsi8debaymN8qGsvyo6bLfnvIlqWJqYuMK8aral2ICunqdD0r7AjVxiokH04JSTAPDThqK5gcPFRq6CKU2nhHPV37yUakEAmB8uBbYdTxSDLekAu5zNQ+NWw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ce33d45-b197-4dd0-3fb2-08da034bfd73 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 10:43:33.6902 (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: 8ucfqiwvBEyEhJ0cQJHYKp/H07ywKi0AysGDv+flg0Wy5T4Zi59BLoHF6H1kxa41Y9dHtmNNbnKwwn3So2ccLtKwVbZVUPtovBsgEPfEYbw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR13MB4748 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Jakub Kicinski The queue controller (QCP) is accessed based on a device specific offset. The NFP3800 device also supports more queues. Furthermore, the NFP3800 VFs also access the QCP differently to how the NFP6000 VFs accesses it, though still indirectly. Fortunately, we can remove the offset all together for both VF types. This is safe for NFP6000 VFs since the offset was effectively a wrap around and only used for convenience to have it set the same as the NFP6000 PF. Use nfp_dev_info to store queue controller parameters. Signed-off-by: Dirk van der Merwe Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_net.h | 6 ++---- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 7 +++++++ drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 5 +++-- drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c | 6 +++--- drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c | 10 ++++++++++ drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h | 7 +++++++ 6 files changed, 32 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net.h b/drivers/net/ethernet/netronome/nfp/nfp_net.h index 232e0a622ee7..5ae15046e585 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net.h +++ b/drivers/net/ethernet/netronome/nfp/nfp_net.h @@ -796,7 +796,6 @@ static inline void nn_pci_flush(struct nfp_net *nn) * either add to a pointer or to read the pointer value. */ #define NFP_QCP_QUEUE_ADDR_SZ 0x800 -#define NFP_QCP_QUEUE_AREA_SZ 0x80000 #define NFP_QCP_QUEUE_OFF(_x) ((_x) * NFP_QCP_QUEUE_ADDR_SZ) #define NFP_QCP_QUEUE_ADD_RPTR 0x0000 #define NFP_QCP_QUEUE_ADD_WPTR 0x0004 @@ -805,9 +804,6 @@ static inline void nn_pci_flush(struct nfp_net *nn) #define NFP_QCP_QUEUE_STS_HI 0x000c #define NFP_QCP_QUEUE_STS_HI_WRITEPTR_mask 0x3ffff -/* The offset of a QCP queues in the PCIe Target */ -#define NFP_PCIE_QUEUE(_q) (0x80000 + (NFP_QCP_QUEUE_ADDR_SZ * ((_q) & 0xff))) - /* nfp_qcp_ptr - Read or Write Pointer of a queue */ enum nfp_qcp_ptr { NFP_QCP_READ_PTR = 0, @@ -876,6 +872,8 @@ static inline u32 nfp_qcp_wr_ptr_read(u8 __iomem *q) return _nfp_qcp_read(q, NFP_QCP_WRITE_PTR); } +u32 nfp_qcp_queue_offset(const struct nfp_dev_info *dev_info, u16 queue); + static inline bool nfp_net_is_data_vnic(struct nfp_net *nn) { WARN_ON_ONCE(!nn->dp.netdev && nn->port); diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index 5d993772c1d9..ef8645b77e79 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -40,6 +40,7 @@ #include #include +#include "nfpcore/nfp_dev.h" #include "nfpcore/nfp_nsp.h" #include "ccm.h" #include "nfp_app.h" @@ -65,6 +66,12 @@ void nfp_net_get_fw_version(struct nfp_net_fw_version *fw_ver, put_unaligned_le32(reg, fw_ver); } +u32 nfp_qcp_queue_offset(const struct nfp_dev_info *dev_info, u16 queue) +{ + queue &= dev_info->qc_idx_mask; + return dev_info->qc_addr_offset + NFP_QCP_QUEUE_ADDR_SZ * queue; +} + static dma_addr_t nfp_net_dma_map_rx(struct nfp_net_dp *dp, void *frag) { return dma_map_single_attrs(dp->dev, frag + NFP_NET_RX_BUF_HEADROOM, diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c index 8934d5418b1a..a18b99c93ab3 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c @@ -496,8 +496,9 @@ static int nfp_net_pci_map_mem(struct nfp_pf *pf) } cpp_id = NFP_CPP_ISLAND_ID(0, NFP_CPP_ACTION_RW, 0, 0); - mem = nfp_cpp_map_area(pf->cpp, "net.qc", cpp_id, NFP_PCIE_QUEUE(0), - NFP_QCP_QUEUE_AREA_SZ, &pf->qc_area); + mem = nfp_cpp_map_area(pf->cpp, "net.qc", cpp_id, + nfp_qcp_queue_offset(pf->dev_info, 0), + pf->dev_info->qc_area_sz, &pf->qc_area); if (IS_ERR(mem)) { nfp_err(pf->cpp, "Failed to map Queue Controller area.\n"); err = PTR_ERR(mem); diff --git a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c index 1ac2a1d97c18..db4301f8cd85 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c @@ -40,7 +40,7 @@ static const char nfp_net_driver_name[] = "nfp_netvf"; static const struct pci_device_id nfp_netvf_pci_device_ids[] = { { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000_VF, PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, - PCI_ANY_ID, 0, NFP_DEV_NFP6000, + PCI_ANY_ID, 0, NFP_DEV_NFP6000_VF, }, { 0, } /* Required last entry. */ }; @@ -169,9 +169,9 @@ static int nfp_netvf_pci_probe(struct pci_dev *pdev, } startq = readl(ctrl_bar + NFP_NET_CFG_START_TXQ); - tx_bar_off = NFP_PCIE_QUEUE(startq); + tx_bar_off = nfp_qcp_queue_offset(dev_info, startq); startq = readl(ctrl_bar + NFP_NET_CFG_START_RXQ); - rx_bar_off = NFP_PCIE_QUEUE(startq); + rx_bar_off = nfp_qcp_queue_offset(dev_info, startq); /* Allocate and initialise the netdev */ nn = nfp_net_alloc(pdev, dev_info, ctrl_bar, true, diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c index 5a8be13a5596..368c6a08d887 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c @@ -2,14 +2,24 @@ /* Copyright (C) 2019 Netronome Systems, Inc. */ #include +#include #include "nfp_dev.h" const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT] = { [NFP_DEV_NFP6000] = { .dma_mask = DMA_BIT_MASK(40), + .qc_idx_mask = GENMASK(7, 0), + .qc_addr_offset = 0x80000, + .chip_names = "NFP4000/NFP5000/NFP6000", .pcie_cfg_expbar_offset = 0x0400, .pcie_expl_offset = 0x1000, + .qc_area_sz = 0x80000, + }, + [NFP_DEV_NFP6000_VF] = { + .dma_mask = DMA_BIT_MASK(40), + .qc_idx_mask = GENMASK(7, 0), + .qc_addr_offset = 0, }, }; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h index ea61156c2075..4152be0f8b01 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h @@ -8,14 +8,21 @@ enum nfp_dev_id { NFP_DEV_NFP6000, + NFP_DEV_NFP6000_VF, NFP_DEV_CNT, }; struct nfp_dev_info { + /* Required fields */ u64 dma_mask; + u32 qc_idx_mask; + u32 qc_addr_offset; + + /* PF-only fields */ const char *chip_names; u32 pcie_cfg_expbar_offset; u32 pcie_expl_offset; + u32 qc_area_sz; }; extern const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT]; From patchwork Fri Mar 11 10:43:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12777813 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCCEDC433F5 for ; Fri, 11 Mar 2022 10:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236341AbiCKKou (ORCPT ); Fri, 11 Mar 2022 05:44:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235845AbiCKKoq (ORCPT ); Fri, 11 Mar 2022 05:44:46 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2138.outbound.protection.outlook.com [40.107.244.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A128E1BBF5F for ; Fri, 11 Mar 2022 02:43:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fsXCqnoNeudZN3UsAlHlGJ+0eYXucp3xk1qPD2QPZ/3y+PIdKNfnYOReNa0FUSlJ2nHwpMn85VLB0+QxMqgr131lmCtuRXOjLPtuBGte7RthOssTPYXnn2h9ytVNTqxSqhgTcWmUq6nYMIBchJUAMznVXrgUREsyrgUcxiz1MSVpUid0AwDw0I1Xhtk9NOPQ8aVLPTmu/W+A3Cx/ioKpk5An2lgxsgJNI6AxBSpp1PMe/ts3Nj9OZdLyVOu0efristopu/3M1XaZ+RcooOKhLvpsW9+2cYm7wwFuDYzExH6isPukDn9/5KKAJMWo09iCw8gR/OABia2MQ86MXhsQdA== 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=QU+esHQ3+6E/hvVYxBXC1Q4lQVmlreq1ogGAgxVLIx4=; b=FnmsjeNSmStHjQWq1DxXypZU4HnrsIHAVsknhEwE+tsveVhJH/Bv+PE+UJ8F55FIgkDyopmRfB1HRuhppwElR77hks9cp7yapjUFdElkZKNGpASKhcfNyQqzXXEql5vch//kuy3tXe95HGBYYaxgZtevQtBmxAOwiFNinVSupB4SX/cxWKBZ8JJY3A1fLJOHl0l1wFH6P+iQ3mr++ySamyx4LnPzjs73/Plz+ro8CKiUGftDh9nDBxaHxtLTreZAXAzEQ4XFueWGETnWjCUhOXIvO2tfLKX4IdxpZACQKgx6nab4z/oaI4BaIJpayouUopNMPeqAyLB0QoKftS0BmQ== 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=QU+esHQ3+6E/hvVYxBXC1Q4lQVmlreq1ogGAgxVLIx4=; b=lWGaAC75NS+DMLzUPH/9yJvy19YHy3ZYt/ANqpvuWeXHs6RaRqFPz4QZO22t0LWDromg873ccO92u9tRov+tS5u3AOmMiXzrkx5oxQ1aeWPOOwYxEOC9Bf+j0HQ3ITN84rrCwTJrwwBxxyYEBVF0jXpwCH9c2EorOjEECv334mA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by CH0PR13MB4748.namprd13.prod.outlook.com (2603:10b6:610:c3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.9; Fri, 11 Mar 2022 10:43:35 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e%2]) with mapi id 15.20.5061.018; Fri, 11 Mar 2022 10:43:35 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 10/11] nfp: take chip version into account for ring sizes Date: Fri, 11 Mar 2022 11:43:05 +0100 Message-Id: <20220311104306.28357-11-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220311104306.28357-1-simon.horman@corigine.com> References: <20220311104306.28357-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0P190CA0026.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::36) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c7a2021d-8726-40cb-1126-08da034bfe2d X-MS-TrafficTypeDiagnostic: CH0PR13MB4748:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n+FHFxgM0HYZOYwxtxW4IdSaM0t1QW5RqUbE0NODg0n+7eSjhggWSD1nBUH169W71PZw9pwcaCejVELxkGrevUW+1ET1HGEso/52AiU4hCs4L56W+OyycRu3nQ1e7WnKVLvd0KIF0WJGC+Oc9WLFGHUnGjNaSk3YKoNEUkKx1JCzn+AzxTS8SKb4UDnAPmNJyh8CHlEPXOxhHgW/LR7Mn4BLEnQK3TkIarg7QYbRjSzsz2pRR/fh3imqjpDGbHppdwKt5JYSkf+5Kyg7enate/KdGA9t8AgnugDRCYlCwnaHFXsP2n/gzVKAHY5RYJMU9QWIBygoSO6KR+TpiroSSNmZz5jF/KylHisJCMUQ+PopSbCF9rbhlXXlGQbWT74FwCT0PuUCIyp/ko006M2ORvR2VjrojrrZaG/7/N9lX61rLXeKeyPdFELJ510LfUeR7jIu/N+qHqwH9KQJasJeX+3uIyKHQ8qntlxEuZjdWVnT64En3l90nQ8l26+ZqoFofga8zAmwGK3DAGxtbIm8YXe2s4hF1BkOmIJI9WNeF77TRZcBQuxGYEuP50E+uihL3av47YLjf/Fk39xNQljFVSpfbAjmKtIMQW++zc4PGs95377upfL1ILZCvEB0x0DwuFyuOPcxr656ia7ZcbEfzQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(346002)(376002)(366004)(396003)(136003)(39840400004)(66946007)(66556008)(66476007)(4326008)(316002)(36756003)(8676002)(52116002)(86362001)(6666004)(6512007)(6506007)(5660300002)(508600001)(6486002)(110136005)(8936002)(44832011)(38100700002)(186003)(1076003)(2616005)(15650500001)(2906002)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cM4OijPgHjARIrJZ1r6O6OrTdnUgiV1IbweaEDZIJExPS27ihhgnU4QTlPF3yAzIQ3VKLWG1iFKJk60vRbTWk7zRFYywS0edcMCnHYzP0lJpnl+kcV+cAZebIKxGjkC9/rI63bEMVFJ7SCwXQWbHEDk+12VWY0PR9VZxjznpVvIIlJ7KhP4llKI5/40aGDr9FDHcBcWPMfXhNfqY5G3eR+zxhRjQpUbP/VI9GyzQT2f77AgJVxtTF4c4z8h+2jvP+fuhlLZuUDoozc0QnJBQ768Th2LC0URemunvXnE1DmHGj4C3aaPl2abaRTKyNUH3cUrPEOzktMCH9G4NRz/sBJm1BKXJp9DWPJ3Sv98xlzj61gZJa6Brw3cX6cvOBTEASfpV77rp0+L7JYIQO9oIRiQAs94G3LCTNNczXgwXrCfH4WZc5LSZ0XGL++ctJ6qN1KOvN6U3RDkjDhF70KJngXKPV/xz7pYgq0CI41wfDua9TeVHXPXVbkOVaHMLzlollMiqa4Tvy+58QJ1ofa98IC78OqIGeYdEcst6eHGewl5niZLqsYV2mZ6OxSEwrcoOjGgQTr+u0OvYYjAGvReuWNSswHmQ1JeVqpoei8dCzkEMzj3RMBJIvaAunf/QiJajDx5VEvN4sthumZOSJidepZD/r3BvZgB/EaTwbQhjXUrhURFgx3jkOzVpfHVqvPXK1ZKsqSEWq409D7pkLs0HJAUxdipQPN3obgEqeRJz2d1p40gqfZ2BD3jRmOmiaZ/LlW+MtHu3qCs+n21Ixlmyl9gZUgWfbmjNGqDLpUzFoLmhVPugwRMgAkA4t/l3Q+j+Ax+H9bt+r6YvkmY3gNrMbmpaGUlgYl0YFjt1YbTM40bEpGTFDx2/ifCwzEIqiED++v1GszaHuIfDKy0xmBOAshdG6fduSWBH1aACpHQ2lyfHnTmb4dMYHJDHuUWzHtHuxCVbjj7EAzvbEPVKCvpFF6bYQVtpdnEp00mvNurXWNhCw0Hui6KczHGv9G5fDKe5ji9ECnzOBF/gZ9C/CJ2oGFeWTvN6A02TD2MNBkKu6tE6iFfXXJMYtG6GTZN35BZ/CtsfD59okFCpeL5xhxU24/WQS+iLztbVMe7XMurytfyP1YHesveCq0dUsCZru1ZZRj43Vdg4GtpE1evFVH6+cO3IlkpSH5bbDdCZGWA2T2yc2jZ7iVGIRO8rCUui0XnerUqQLyfx1jNz8FAj6ZQtg70g324bnV83Z4pjHLaAqSUOKV7JFYYGxHMFMYo6O7OHfaR8MzawQ66nm/wHeu8EcSq466heyk3Bq3gHezUwZqLXtRpFtaa7+vTjOk7bjuVCcYgbP0H2wYIIRT/jjDNwZk4gp1vL15RJHT+VspH5iybgsuA+5yrLy2HkUtFkN7C/DV3VJNLWrNCesmhcu4uxloetNciMuYxT0aMc1jkeXJUuTD2r3uRqyFkrq09Y7/I3St+97HlIonPX4Vi1j+a4mBw/N2C1NbWZK9XZCLj5/SPLdL/6cuyIaabAkTeniLvTONOyIA1oBV9m/1JQiIrESw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7a2021d-8726-40cb-1126-08da034bfe2d X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 10:43:35.0174 (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: Nzk8kcr3oat630gmpBKVEWTIXnn54oqfDYa2M0CcQzskpP0rJFVUruHnHTKck/+d2bu+uV3jy5G3wczsHC/ENOUCl8o/8q4WpSJkg+XBQaw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR13MB4748 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Jakub Kicinski NFP3800 has slightly different queue controller range bounds. Use the static chip data instead of defines. This commit still assumes unchanged descriptor format. Later datapath changes will allow adjusting for descriptor accounting. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_net.h | 5 ----- .../net/ethernet/netronome/nfp/nfp_net_ethtool.c | 14 +++++++++----- .../net/ethernet/netronome/nfp/nfpcore/nfp_dev.c | 5 +++++ .../net/ethernet/netronome/nfp/nfpcore/nfp_dev.h | 2 ++ 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net.h b/drivers/net/ethernet/netronome/nfp/nfp_net.h index 5ae15046e585..49b5fcb49aef 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net.h +++ b/drivers/net/ethernet/netronome/nfp/nfp_net.h @@ -82,11 +82,6 @@ NFP_NET_MAX_TX_RINGS : NFP_NET_MAX_RX_RINGS) #define NFP_NET_MAX_IRQS (NFP_NET_NON_Q_VECTORS + NFP_NET_MAX_R_VECS) -#define NFP_NET_MIN_TX_DESCS 256 /* Min. # of Tx descs per ring */ -#define NFP_NET_MIN_RX_DESCS 256 /* Min. # of Rx descs per ring */ -#define NFP_NET_MAX_TX_DESCS (256 * 1024) /* Max. # of Tx descs per ring */ -#define NFP_NET_MAX_RX_DESCS (256 * 1024) /* Max. # of Rx descs per ring */ - #define NFP_NET_TX_DESCS_DEFAULT 4096 /* Default # of Tx descs per ring */ #define NFP_NET_RX_DESCS_DEFAULT 4096 /* Default # of Rx descs per ring */ diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c index e0c27471bcdb..b9abae176793 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c @@ -21,6 +21,7 @@ #include #include "nfpcore/nfp.h" +#include "nfpcore/nfp_dev.h" #include "nfpcore/nfp_nsp.h" #include "nfp_app.h" #include "nfp_main.h" @@ -386,9 +387,10 @@ static void nfp_net_get_ringparam(struct net_device *netdev, struct netlink_ext_ack *extack) { struct nfp_net *nn = netdev_priv(netdev); + u32 qc_max = nn->dev_info->max_qc_size; - ring->rx_max_pending = NFP_NET_MAX_RX_DESCS; - ring->tx_max_pending = NFP_NET_MAX_TX_DESCS; + ring->rx_max_pending = qc_max; + ring->tx_max_pending = qc_max; ring->rx_pending = nn->dp.rxd_cnt; ring->tx_pending = nn->dp.txd_cnt; } @@ -413,18 +415,20 @@ static int nfp_net_set_ringparam(struct net_device *netdev, struct netlink_ext_ack *extack) { struct nfp_net *nn = netdev_priv(netdev); - u32 rxd_cnt, txd_cnt; + u32 qc_min, qc_max, rxd_cnt, txd_cnt; /* We don't have separate queues/rings for small/large frames. */ if (ring->rx_mini_pending || ring->rx_jumbo_pending) return -EINVAL; + qc_min = nn->dev_info->min_qc_size; + qc_max = nn->dev_info->max_qc_size; /* Round up to supported values */ rxd_cnt = roundup_pow_of_two(ring->rx_pending); txd_cnt = roundup_pow_of_two(ring->tx_pending); - if (rxd_cnt < NFP_NET_MIN_RX_DESCS || rxd_cnt > NFP_NET_MAX_RX_DESCS || - txd_cnt < NFP_NET_MIN_TX_DESCS || txd_cnt > NFP_NET_MAX_TX_DESCS) + if (rxd_cnt < qc_min || rxd_cnt > qc_max || + txd_cnt < qc_min || txd_cnt > qc_max) return -EINVAL; if (nn->dp.rxd_cnt == rxd_cnt && nn->dp.txd_cnt == txd_cnt) diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c index 368c6a08d887..0c1ef01f90eb 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c @@ -3,6 +3,7 @@ #include #include +#include #include "nfp_dev.h" @@ -11,6 +12,8 @@ const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT] = { .dma_mask = DMA_BIT_MASK(40), .qc_idx_mask = GENMASK(7, 0), .qc_addr_offset = 0x80000, + .min_qc_size = 256, + .max_qc_size = SZ_256K, .chip_names = "NFP4000/NFP5000/NFP6000", .pcie_cfg_expbar_offset = 0x0400, @@ -21,5 +24,7 @@ const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT] = { .dma_mask = DMA_BIT_MASK(40), .qc_idx_mask = GENMASK(7, 0), .qc_addr_offset = 0, + .min_qc_size = 256, + .max_qc_size = SZ_256K, }, }; diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h index 4152be0f8b01..deadd9b97f9f 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h @@ -17,6 +17,8 @@ struct nfp_dev_info { u64 dma_mask; u32 qc_idx_mask; u32 qc_addr_offset; + u32 min_qc_size; + u32 max_qc_size; /* PF-only fields */ const char *chip_names; From patchwork Fri Mar 11 10:43:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12777814 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96C71C433EF for ; Fri, 11 Mar 2022 10:43:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236354AbiCKKoy (ORCPT ); Fri, 11 Mar 2022 05:44:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235935AbiCKKoq (ORCPT ); Fri, 11 Mar 2022 05:44:46 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2138.outbound.protection.outlook.com [40.107.244.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD30A1C230A for ; Fri, 11 Mar 2022 02:43:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JQh4B8WwkUmCj21hZ3LgXU41i397SufPFF7vaAlc007AsYRVGsYuBe0EbeOqwA8A3LoMePmDgp/wP1RRIAfC0b94OXEIEUr6jxruMfENS10kdAn9z/laiZToFOTy9nfW/WoMk5Ow9rp1rk023Cw66UWYi8yp7z4AL3hbieFQB2WT4lAxhXIR6SggD5PkOuV1W7qqDzs2MHAClKHBFS7UdCav7P9nJIf2D+AXJdBaHXHYQ50LoIc4SnH/WzCMCG4HXFBG7F8T/nZ8kzMEUDlelSYlmEsI0JnKRGZFdyvRfKSplEkByDiwLPNj3NLBzENezYzDNK01zmjBVYI8RSGvzg== 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=kNRXbH4LOengW3x08fIzKlfb8SAEpnQRqwFWlqrb16w=; b=PR6+6G33W/Bdf8N6ONzEe9l79tPznFMICn9aGBNutEZvvTPfMY0vFcuLk6uiQI8OqU/af5eZ5mYvJ+0pErZyjmcZPMIDa8SarTX7wxAAd9noT/btiwD1O0h8HMsD5w8JthyE1HC+Kf+2iLir8ODj4/vvalNzCXA+6IehKX5+HGfKYLfpgfFmR0MTXwxKtkm5J5CFU3qQtVEfMBFz+Mj4qwnsr6ZL2OG5RM3QJ+WsM9j3ozpRvKn7+WHBhpUa5stuyzKkVEfCJO8iMdnAy8b2jk32HG5bESKTlTCD2mG/Jo/ZHiTLxZIkyVuKOMoYytHObX4WWLqq0L8u3cr0LGd+nw== 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=kNRXbH4LOengW3x08fIzKlfb8SAEpnQRqwFWlqrb16w=; b=jJ9sH82jH/7MRaD+NJ22AgOzRVgUxy7iOj2netu++7zhyCNlBFXyN2U0uhOPN3rb2mt6uYRszTUV9lfHHvFAy1Y1+PLuZo7pAQoas/3GdiwzrvGtBU69veSh1qJ7nsBgTO3x2b14V8hAfGQtKrsiR/xRYNREgGNaVfylGnaTbOs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by CH0PR13MB4748.namprd13.prod.outlook.com (2603:10b6:610:c3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.9; Fri, 11 Mar 2022 10:43:36 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::d27:c7d9:8880:a73e%2]) with mapi id 15.20.5061.018; Fri, 11 Mar 2022 10:43:36 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH net-next 11/11] nfp: add support for NFP3800/NFP3803 PCIe devices Date: Fri, 11 Mar 2022 11:43:06 +0100 Message-Id: <20220311104306.28357-12-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220311104306.28357-1-simon.horman@corigine.com> References: <20220311104306.28357-1-simon.horman@corigine.com> X-ClientProxiedBy: AM0P190CA0026.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::36) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0a467a62-ecd4-4d2a-b679-08da034bfef0 X-MS-TrafficTypeDiagnostic: CH0PR13MB4748:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NOTw97aK5Yv9dWdve/PTB3DMQHPu0a05TM+IXFcVsfxLtY0SFz/omVq/nn6hzHlKSgg4PdqgcU3zFlG3R/3e3uHAQJWYx2T/yGJ0pNpDr4Qf2eBEFrTB3X2NPfyoySmqRjPkdNuOyou4nxR7JCIzLezJnWr+qW3lNQNQS8ES3Otxo6jIQkOvv2rh/hg7ryeGckS/tmHRJ/x83InF+qwhFFEm+AtK5JepqvJaoS69c2bNHp3KgEQORWvBwPnXlDT3G07leHrZ7qvrLotybxZZgtyY6qDDPdaLakp3xFWpS/nKeHtKHN0NdbX41i6eIrIoGFdo5TenVhhK0IpWAi1kodZj7pcvq6bvKeGrykgK0FyDC5vChvHBULSJV/OKuCbcvl2caTaQrKokt9iMQj7TM7yWd1jKl+d6CemOCfhsxXzRWRpHGMvTha7zcBHxPafE9q8x6Lx2K5OSQi/paJ30j9VZk6Mf5ikoIJ8OZ2NEbCDuzhxrBUwsfHwflf6YJB+Ae99p8IkBaLOMgb/gtYyF/R/abdx5KZJq37vPXZzGauFTdUvCUKIFvi+L6AE8guFcdLlSsD+ky//HdV1LCCtbMXa3e9MPCdBz7ihVYOOpXRLST4xFf4irl+s3FqkjeQC3a+mP2ZII5avJUVhCvLQGXA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(346002)(376002)(366004)(396003)(136003)(39840400004)(66946007)(66556008)(66476007)(4326008)(316002)(36756003)(8676002)(52116002)(86362001)(6666004)(6512007)(6506007)(5660300002)(508600001)(6486002)(110136005)(8936002)(44832011)(38100700002)(186003)(1076003)(2616005)(2906002)(107886003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: R5qBDc/PureXJrm8cmLgIp5qNvYbhbNFYTRaEkcc9nsRhMwXYPKMVipNUG+uC0JO3JrQcEPgGpI7+8QjeruZvTZUpb7XU751kBy5kR2nLqHq+mOV/ei8CGNXc3cZvtsS5/3vMPCDm4griKkI0ESrUKNzKkjeVdNVtu1Wb3dCKzRRajPuq7crjN+iWetzbaQSCjKBdNtmwpEbSLkg4EEj128yX/LxYRnnD6w9AMV/J/CKFpUDJ/enAl4zdRbhMsW7Ubr6zdLe25qJIDtTGAFn6kmVrZLzfZbUvj0OHWqV7PtdthsxpI+bNoWBU1HZa76fkOtFJft8f9BcZL3UVixz4Bf88PwndK9ceB1g8BeConVhPFXEIOwDS9fuhqNG2Ewgm2C2iO41z0Y5fJLJ2IQQa6xy5G+S1Q9+3nhUamQJT/wV5dDAZXp7P0JCVDeJUVWbcKclHXJPqcswXZEyY3OIPqz5zU/3j4NW5Ehj8cWn1dlxp9ndQExOe/3rGR34vWDN3P35smmIhtUnLLgEc1VPtB8QfQ24uLjV3+EouxCAPgLNGxnRCpuZlHp70u9FWSE3aFIHU1n8Cff3Ut5dRLwry4sO9codzb+N5ZgVuO20TNKWZ8FX6j07P63301BdD9ZW1/Tm8XP2VBknqrzTZsI1FDQweK579ms6PVn0vDcMHDCkMo73MD0X1oijYXdSRRZdlfB6BOxgGBBgCKSV7apcQT9QE5o8+VNEqufevCK5vk+UAtZJDiAwCSu9worirLRzqK9UjQKs+qCYiqch/XIqIxzPQoimt1MeUScO1ODeTygiSnbPmQM9HOd+bdaPXuDW8JeK345l+qKAIEpIWeCFooNLZf10El59pO6p16GIKIzcGGOudExH3XPqbJxk1St2jfu+iI4qShXQd/z1cTg0DHjk2HH7BoJRlicN0Tme5kqslm9xFKfw+NwKJKJmZMhtDdXhE/heRjbp0bKDCwRKKvjQssuwsxDuiHmqro6REdDt3OgkqTldq3XhQPTLpAvSSBZjbDLrPvR382sKUApvjj29ufEREP/AL92VDClmkS3eaAdIhy/PkdEXv4l0d0IbLH+TUUGMX0RzLYQ0uKBQpSxEkSmbjZ7g1bUH8ZLT2c3zTYaqxR2ps1lxv9qzrHPNB3t4FMtjM0gzROiv8FxWxAqKjYBT4CpbH+RMkziRTem6u3nu3VSQ1+1beWcR3oQl9S7j1sO4SZPqTgXzMxioBpYNhQpKImvGcNeE8duftOldwECejrOT87dh7c5Qv9/+HEszXAL8j0ZcxzxOQ00+XtRLBcGDotdJ0PgYXGWrQYGLaTplMSZgXbLojjs/qTvIffWJvtAUPOrWiN4tWU3jOsWH9DOhnmUSfOf6+ZmIA/96OgckmLCzZG+xh/dAmYXKUZuRASGuCjM6KAt/uqH3joadch70PS5RDswsqEAK6Si/cCxJI1oG8fvnfruryG1BBvEg3DUtB5SJhhPm0VlFq7KItonMgiIYUhA8pOCcZi4DOriGgQ9kptzSNK8oKuiYLf8FMIzW2i3NOHe/Y7Ij1g== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a467a62-ecd4-4d2a-b679-08da034bfef0 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 10:43:36.3308 (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: DGOnmoGpc1Z9qaKYcSMNS7Frqvur36kmfMLzwpmvEU2YBPkWcVjs8v4LojkJie9bW6dMSSMj2pSyDf3E3IZn92gEZBT56nkyPGXedhmrlFw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR13MB4748 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Dirk van der Merwe Enable binding the nfp driver to NFP3800 and NFP3803 devices. The PCIE_SRAM offset is different for the NFP3800 device, which also only supports a single explicit group. Changes to Dirk's work: * 48-bit dma addressing is not ready yet. Keep 40-bit dma addressing for NFP3800. Signed-off-by: Dirk van der Merwe Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_main.c | 4 ++++ .../ethernet/netronome/nfp/nfp_netvf_main.c | 4 ++++ .../ethernet/netronome/nfp/nfpcore/nfp_cpp.h | 4 ---- .../ethernet/netronome/nfp/nfpcore/nfp_dev.c | 19 +++++++++++++++++++ .../ethernet/netronome/nfp/nfpcore/nfp_dev.h | 2 ++ include/linux/pci_ids.h | 2 ++ 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c index dd135ac8b1a3..8693f9905fbe 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c @@ -33,6 +33,10 @@ static const char nfp_driver_name[] = "nfp"; static const struct pci_device_id nfp_pci_device_ids[] = { + { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP3800, + PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, + PCI_ANY_ID, 0, NFP_DEV_NFP3800, + }, { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP4000, PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, PCI_ANY_ID, 0, NFP_DEV_NFP6000, diff --git a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c index db4301f8cd85..9ef226c6706e 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c @@ -38,6 +38,10 @@ struct nfp_net_vf { static const char nfp_net_driver_name[] = "nfp_netvf"; static const struct pci_device_id nfp_netvf_pci_device_ids[] = { + { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP3800_VF, + PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, + PCI_ANY_ID, 0, NFP_DEV_NFP3800_VF, + }, { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000_VF, PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID, PCI_ANY_ID, 0, NFP_DEV_NFP6000_VF, diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpp.h b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpp.h index 2dd0f5842873..3d379e937184 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpp.h +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpp.h @@ -32,10 +32,6 @@ #define PCI_64BIT_BAR_COUNT 3 -/* NFP hardware vendor/device ids. - */ -#define PCI_DEVICE_ID_NETRONOME_NFP3800 0x3800 - #define NFP_CPP_NUM_TARGETS 16 /* Max size of area it should be safe to request */ #define NFP_CPP_SAFE_AREA_SIZE SZ_2M diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c index 0c1ef01f90eb..28384d6d1c6f 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c @@ -8,6 +8,25 @@ #include "nfp_dev.h" const struct nfp_dev_info nfp_dev_info[NFP_DEV_CNT] = { + [NFP_DEV_NFP3800] = { + .dma_mask = DMA_BIT_MASK(40), + .qc_idx_mask = GENMASK(8, 0), + .qc_addr_offset = 0x400000, + .min_qc_size = 512, + .max_qc_size = SZ_64K, + + .chip_names = "NFP3800", + .pcie_cfg_expbar_offset = 0x0a00, + .pcie_expl_offset = 0xd000, + .qc_area_sz = 0x100000, + }, + [NFP_DEV_NFP3800_VF] = { + .dma_mask = DMA_BIT_MASK(40), + .qc_idx_mask = GENMASK(8, 0), + .qc_addr_offset = 0, + .min_qc_size = 512, + .max_qc_size = SZ_64K, + }, [NFP_DEV_NFP6000] = { .dma_mask = DMA_BIT_MASK(40), .qc_idx_mask = GENMASK(7, 0), diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h index deadd9b97f9f..d4189869cf7b 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h @@ -7,6 +7,8 @@ #include enum nfp_dev_id { + NFP_DEV_NFP3800, + NFP_DEV_NFP3800_VF, NFP_DEV_NFP6000, NFP_DEV_NFP6000_VF, NFP_DEV_CNT, diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index c7e6f2043c7d..5462c29f0538 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2531,9 +2531,11 @@ #define PCI_VENDOR_ID_HUAWEI 0x19e5 #define PCI_VENDOR_ID_NETRONOME 0x19ee +#define PCI_DEVICE_ID_NETRONOME_NFP3800 0x3800 #define PCI_DEVICE_ID_NETRONOME_NFP4000 0x4000 #define PCI_DEVICE_ID_NETRONOME_NFP5000 0x5000 #define PCI_DEVICE_ID_NETRONOME_NFP6000 0x6000 +#define PCI_DEVICE_ID_NETRONOME_NFP3800_VF 0x3803 #define PCI_DEVICE_ID_NETRONOME_NFP6000_VF 0x6003 #define PCI_VENDOR_ID_QMI 0x1a32