From patchwork Fri Nov 25 14:57:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhu, Lingshan" X-Patchwork-Id: 13056037 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 473D2C4332F for ; Fri, 25 Nov 2022 15:06:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbiKYPGY (ORCPT ); Fri, 25 Nov 2022 10:06:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiKYPGX (ORCPT ); Fri, 25 Nov 2022 10:06:23 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C47572D1C2 for ; Fri, 25 Nov 2022 07:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669388782; x=1700924782; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=PUaEm/rUny2eMarZqMlMmRul7K0V7EvUBPsD7CJuyYU=; b=dbidGUH91xm8r5A4YfITC4wRj8F/TEUp/HsD0HffjCcwkNxWICJFpyq4 O86fVaStTjP+khQ3iS0mGGuZbSP7CDb9s+mxbgvYxZDWGr3+9kdb9PZNG 3BCuTUo2gXui78oWls2iQ8a4Iq2ajRY4sbYDFHMWbGu/pwCXzgfOlM1RC nrtjAqLvm8eUSBqydR17Q5VUsaM8lu4ven+1k/hlv9As4X5frO/8F7wFv dwAaO9gPnlSF+b8h/FLRJ5oMVn9COoMLBUeWprO/mbPBluBgJljAJvfzB UY9iGLx6Pc+wCX2X97Zx0HIl42Yh8iC6/rt9jA41aAyvEWMXH9Y+9mSxD Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10542"; a="302069130" X-IronPort-AV: E=Sophos;i="5.96,193,1665471600"; d="scan'208";a="302069130" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Nov 2022 07:06:22 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10542"; a="593240191" X-IronPort-AV: E=Sophos;i="5.96,193,1665471600"; d="scan'208";a="593240191" Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([10.240.193.73]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Nov 2022 07:06:20 -0800 From: Zhu Lingshan To: jasowang@redhat.com, mst@redhat.com Cc: virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, hang.yuan@intel.com, piotr.uminski@intel.com, Zhu Lingshan Subject: [PATCH V2 00/12] ifcvf/vDPA implement features provisioning Date: Fri, 25 Nov 2022 22:57:12 +0800 Message-Id: <20221125145724.1129962-1-lingshan.zhu@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This series implements features provisioning for ifcvf. By applying this series, we allow userspace to create a vDPA device with selected (management device supported) feature bits and mask out others. Examples: a)The management device supported features: $ vdpa mgmtdev show pci/0000:01:00.5 pci/0000:01:00.5: supported_classes net max_supported_vqs 9 dev_features MTU MAC MRG_RXBUF CTRL_VQ MQ ANY_LAYOUT VERSION_1 ACCESS_PLATFORM b)Provision a vDPA device with all supported features: $ vdpa dev add name vdpa0 mgmtdev pci/0000:01:00.5 $ vdpa/vdpa dev config show vdpa0 vdpa0: mac 00:e8:ca:11:be:05 link up link_announce false max_vq_pairs 4 mtu 1500 negotiated_features MRG_RXBUF CTRL_VQ MQ VERSION_1 ACCESS_PLATFORM c)Provision a vDPA device with a subset of the supported features: $ vdpa dev add name vdpa0 mgmtdev pci/0000:01:00.5 device_features 0x300020020 $ vdpa dev config show vdpa0 mac 00:e8:ca:11:be:05 link up link_announce false negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Please help review Thanks Changes from V1: split original patch 1 ~ patch 3 to small patches that are less than 100 lines, so they can be applied to stalbe kernel(Jason) Zhu Lingshan (12): vDPA/ifcvf: decouple hw features manipulators from the adapter vDPA/ifcvf: decouple config space ops from the adapter vDPA/ifcvf: alloc the mgmt_dev before the adapter vDPA/ifcvf: decouple vq IRQ releasers from the adapter vDPA/ifcvf: decouple config IRQ releaser from the adapter vDPA/ifcvf: decouple vq irq requester from the adapter vDPA/ifcvf: decouple config/dev IRQ requester and vectors allocator from the adapter vDPA/ifcvf: ifcvf_request_irq works on ifcvf_hw vDPA/ifcvf: manage ifcvf_hw in the mgmt_dev vDPA/ifcvf: allocate the adapter in dev_add() vDPA/ifcvf: retire ifcvf_private_to_vf vDPA/ifcvf: implement features provisioning drivers/vdpa/ifcvf/ifcvf_base.c | 32 ++----- drivers/vdpa/ifcvf/ifcvf_base.h | 10 +- drivers/vdpa/ifcvf/ifcvf_main.c | 162 +++++++++++++++----------------- 3 files changed, 91 insertions(+), 113 deletions(-)