From patchwork Fri Aug 2 09:59:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Peens X-Patchwork-Id: 13751370 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2138.outbound.protection.outlook.com [40.107.237.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C7E81DB45F for ; Fri, 2 Aug 2024 10:00:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.138 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722592804; cv=fail; b=Q2kJm1lnww9AAYIXV2UGBBMLawTp6tLKUuN7+vO7GsNgO71EtHX56ep+EowQp6TLzY4yaqXUQ+7RP3HWncXQVmjRiFjb5dtgxTMmsm4nXh0pcC2VGzWtkf5mR9wD6Rf90PZQwWIV63iEne/mC9VPJqksnD/F7frP5Xe1iD9gCJY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722592804; c=relaxed/simple; bh=c0qMvGYxX6h6OS4E9U3LiMcla1HBgRdSl506sewjY1A=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=ks6m+48w9a8hc5m8l3FxqXLn/ynVU/hRAAARzyKlg7x+iflyfmId9qoGmVWSK+/L6oHcmS9R2EztZOTmGA+YFfjFIp2tGzEOLeNaMMKx2QDGuDVtJgpjB5SsRDLQbh+BlzOuQIAATGbLfkTytdqP70JngY2dhV4mzFP8vggVBSg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=corigine.com; spf=pass smtp.mailfrom=corigine.com; dkim=pass (1024-bit key) header.d=corigine.onmicrosoft.com header.i=@corigine.onmicrosoft.com header.b=uYOVnnKF; arc=fail smtp.client-ip=40.107.237.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=corigine.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=corigine.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=corigine.onmicrosoft.com header.i=@corigine.onmicrosoft.com header.b="uYOVnnKF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uQRlviQGEHO30hR5fRCB649TzAibmgGapwD6HyhmG/T6n2HuNxDQZCx3rD2r+sQDqAEQMjILT969IVV2lFEe5lK2e34uVlLlvmEtPfqf0rDoz/zyUmEQmSAaHSiAaJdepmAEwqT7Q5rxqOscWhph/24w3fgOL/zMacDnvG+XjMB7rW7k5okeYWhhrsa8nAhbjiCaGtHc5YPWhF/DuhrmSWnLs+xKxkW5/Fv0+cs70i/RQoyyeVjL4XYzlbnc0Pv+gyTzrsnb3nDvhEzfCasSUqj+6lgzjhArc+JOUtGwYBIjOzR6zvUxMespjUu+82NBHJHUSeMipCYVRoXHc1xSTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=21LaJpDRfe81lEypjeY6j/SGgTtdEcAvbqPF5cMLZVg=; b=PRLlWsN5NIJB1AG5lv84VMrmpdMixqAlYId8ewSoSWw9PHmpwfz8SLBhdnigB6vuVtWMPNMwDTExE1orESjPGZ1cAYuB9K9IItui6j2rehPdkDrcOwm0d1N/R2sZMzB/k4J8vnHE579H5nwc7Q9LRF1rRdHJ8v+sVIW4Oh2MSx9tQ97oRQmZnV4L4770MEO8n2u+McVM4i5b7DRONB7GwWGOXpuaFsqvZ9t+qL1QUraj3Yu0jOTho7cDuSoqiqgzAV5vXGXUMb000qHWBLPs+czR0sdqCtlzRXn0iH5hU55JnHKqpRZllI4jiSDFgQKMTx2XJfJm3q3c+o/+geDTjQ== 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=21LaJpDRfe81lEypjeY6j/SGgTtdEcAvbqPF5cMLZVg=; b=uYOVnnKFiURv+yCGOOQgaMH2vZwDwYYXe283N9aA1OPIj+yhah/rMpfLg5dyICUEaCgOEes+w6Y4QhSXHg37ER+STr94ANJKlnVOnhG+k9zGOSIDLqOsmb9T9TNE8QF1Kz2IZFVGroax5VbFy0cutUfcfwhMUJoRzSnlhIfOCLU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from BL0PR13MB4403.namprd13.prod.outlook.com (2603:10b6:208:1c4::8) by DS1PR13MB7169.namprd13.prod.outlook.com (2603:10b6:8:215::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Fri, 2 Aug 2024 09:59:58 +0000 Received: from BL0PR13MB4403.namprd13.prod.outlook.com ([fe80::bbcb:1c13:7639:bdc0]) by BL0PR13MB4403.namprd13.prod.outlook.com ([fe80::bbcb:1c13:7639:bdc0%5]) with mapi id 15.20.7828.023; Fri, 2 Aug 2024 09:59:58 +0000 From: Louis Peens To: David Miller , Jakub Kicinski , "Michael S. Tsirkin" , Jason Wang Cc: eperezma@redhat.com, Kyle Xu , netdev@vger.kernel.org, virtualization@lists.linux.dev, oss-drivers@corigine.com Subject: [RFC net-next 0/3] add vDPA driver for nfp devices Date: Fri, 2 Aug 2024 11:59:28 +0200 Message-Id: <20240802095931.24376-1-louis.peens@corigine.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: JNXP275CA0019.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:19::31) To BL0PR13MB4403.namprd13.prod.outlook.com (2603:10b6:208:1c4::8) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR13MB4403:EE_|DS1PR13MB7169:EE_ X-MS-Office365-Filtering-Correlation-Id: 79f19ece-e6c1-40ef-1f83-08dcb2d9de11 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?+FU3Pbt+4fTOm/aGhSKCLDUebx8VZhA?= =?utf-8?q?dWbyk3mjP/Z/0hAICqSbiw+xcSz+5bQypd7KwR+9zXY86dYvaiYy0l+ScLZ0oxXIz?= =?utf-8?q?/q/BYEAXQZVlRcErnyxq8rD/mwEPe88cUDZxoKiUe6qU14+vj5ESRM6Hf3RpA0Lsf?= =?utf-8?q?UKOr4l5V58a4VBu3Sj9fuEn1IViww18X7+4REQY0W4RlIKmp1ySXRerlA6/43qwiZ?= =?utf-8?q?Lwe8x6mlmLA1ST8NV59xdOxaqQBUtVjJrOeYdNgUZVEt577gBy4ggS+ku4dAFSIGU?= =?utf-8?q?4lInzm96mDg1W/Lh8krOSa2KfGr54UMyRnOWDsYMcLp+vKDmbeV91vgdqKlyN1F4F?= =?utf-8?q?DACb1Fegl0HDj8p7uFyLQH/ApBJCiQ2U5JjySN0znOvdsY3K7OVuzfbxHpCqwETWg?= =?utf-8?q?kNqljngTNiInD8uNWrNNUnyA7kLmCi7qEtPxUr73Ra/xVV4vgihRCMoOWWS37BCyO?= =?utf-8?q?7+e2GNxYPQGdzTTv5Sz/GGQWa6KKkPyIOTlwlJbOLxPGE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-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR13MB4403.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(376014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?iXCDJvkTY6ZMd/HvYrK/GHhqRU0W?= =?utf-8?q?/FPxFv/Osg94NWvTIiC3wv3lH/lEEl7t9drJsy2w0R5cBDOpTeyQlCBxAsYMcMaEb?= =?utf-8?q?4QTJHAWYi2j42IPJyonhRejN24TNA8uDAKkzI7BCpx6i8Cr/+JssLzqOkFTBZlG54?= =?utf-8?q?SUJY5EzNVVEP34/WdcOz2PtjtfqNGukcR2UZ7jMgxhK3RPbx8fqOTKP0CdyOCY6sc?= =?utf-8?q?tiodVd6fcxtaHbylImlE5xZFuR//b5DfoDsGV+9lgDCjozCf2OHvebWV0E7FH73ag?= =?utf-8?q?trHN3bxa/YjLRRUEL5wQ4eCuDBXqzibqxshlZZCDhRAUFgpL1ArSv918O22t5k0DD?= =?utf-8?q?ia+3Ou1XzRAb26oXsz+HHw3fmp+oIcpEOedUBF41xTZZCK+1LXkp1so1XZq/0GB18?= =?utf-8?q?hXh5Tjw2iy5N1M5BkUYEg10RpocdfMO0ztInFKbJYyN9DCExLYp/kz17MWXBaQT48?= =?utf-8?q?cTOFmXNQ2tZz9ADfTFOOc0R2Ac3+tqxQ7Yxz0W/75QemCCRkesKnu+Qd/ZZQeFwSa?= =?utf-8?q?1pBJ0nArcPEn9mRu2PXNcG+Z1eXGO7cYOStUtSBmh/86vErncMlVyxTyDMzZdnKiK?= =?utf-8?q?XQx+aJgTkpo0zHQZqQ1fwlY6IoojSwM5XE03D2SxS+AgDkgnmMmh9sMB6l2+fQx3m?= =?utf-8?q?x+kn+JA4WTY8gr1iy+naMCiXwmphpI9yiJvdvQLDz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CYkJyKVCg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79f19ece-e6c1-40ef-1f83-08dcb2d9de11 X-MS-Exchange-CrossTenant-AuthSource: BL0PR13MB4403.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 09:59:58.3899 (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: FetzMww4uPHD+kuCN3O5WmB/45iYTTGvDuFNnvYdmp1bdaHfvfHJL2ymjZKkcn9hesoW9yjpRYWF7E2iQS+kBAYFRpwPYpgwKJrHs2puinI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR13MB7169 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC This is the first foray into upstreaming a vDPA driver for the nfp. Submitting it as RFC initially, since this is touching a new component, not sure if there are potentially any new-to-us requirements this needs to fulfill. We are hoping that this is already in a state to resubmit as PATCH, depending on the feedback this receives. This series starts out by adding the "enable_vnet" parameter to nfp_devlink, to allow setting the device mode. Next the auxiliary bus driver is added, and the VF probe functions are updated to probe the correct driver, based on the 'enable_vnet' setting. Lastly the nfp_vDPA driver is added, initialising resources and adding callbacks in accordance to the kernel vDPA framework. Kyle Xu (3): nfp: add new devlink "enable_vnet" generic device param nfp: initialize NFP VF device according to enable_vnet configuration drivers/vdpa: add NFP devices vDPA driver MAINTAINERS | 1 + drivers/net/ethernet/netronome/Kconfig | 1 + .../ethernet/netronome/nfp/devlink_param.c | 49 ++ drivers/net/ethernet/netronome/nfp/nfp_main.h | 3 + drivers/net/ethernet/netronome/nfp/nfp_net.h | 16 + .../ethernet/netronome/nfp/nfp_net_common.c | 3 + .../net/ethernet/netronome/nfp/nfp_net_ctrl.h | 3 + .../net/ethernet/netronome/nfp/nfp_net_main.c | 10 + .../ethernet/netronome/nfp/nfp_netvf_main.c | 264 ++++-- drivers/vdpa/Kconfig | 10 + drivers/vdpa/Makefile | 1 + drivers/vdpa/netronome/Makefile | 5 + drivers/vdpa/netronome/nfp_vdpa_main.c | 821 ++++++++++++++++++ 13 files changed, 1127 insertions(+), 60 deletions(-) create mode 100644 drivers/vdpa/netronome/Makefile create mode 100644 drivers/vdpa/netronome/nfp_vdpa_main.c