All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhu Lingshan <lingshan.zhu@intel.com>
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 <lingshan.zhu@intel.com>,
	stable@vger.kernel.org
Subject: [PATCH V2 07/12] vDPA/ifcvf: decouple config/dev IRQ requester and vectors allocator from the adapter
Date: Fri, 25 Nov 2022 22:57:19 +0800	[thread overview]
Message-ID: <20221125145724.1129962-8-lingshan.zhu@intel.com> (raw)
In-Reply-To: <20221125145724.1129962-1-lingshan.zhu@intel.com>

This commit decouples the config irq requester, the device
shared irq requester and the MSI vectors allocator from
the adapter. So they can be safely invoked since probe
before the adapter is allocated.

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
Cc: stable@vger.kernel.org
---
 drivers/vdpa/ifcvf/ifcvf_main.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
index ee9c22975119..8320bdacace8 100644
--- a/drivers/vdpa/ifcvf/ifcvf_main.c
+++ b/drivers/vdpa/ifcvf/ifcvf_main.c
@@ -132,10 +132,9 @@ static void ifcvf_free_irq(struct ifcvf_hw *vf)
  * It returns the number of allocated vectors, negative
  * return value when fails.
  */
-static int ifcvf_alloc_vectors(struct ifcvf_adapter *adapter)
+static int ifcvf_alloc_vectors(struct ifcvf_hw *vf)
 {
-	struct pci_dev *pdev = adapter->pdev;
-	struct ifcvf_hw *vf = &adapter->vf;
+	struct pci_dev *pdev = vf->pdev;
 	int max_intr, ret;
 
 	/* all queues and config interrupt  */
@@ -222,10 +221,9 @@ static int ifcvf_request_vqs_reused_irq(struct ifcvf_hw *vf)
 	return -EFAULT;
 }
 
-static int ifcvf_request_dev_irq(struct ifcvf_adapter *adapter)
+static int ifcvf_request_dev_irq(struct ifcvf_hw *vf)
 {
-	struct pci_dev *pdev = adapter->pdev;
-	struct ifcvf_hw *vf = &adapter->vf;
+	struct pci_dev *pdev = vf->pdev;
 	int i, vector, ret, irq;
 
 	vector = 0;
@@ -276,10 +274,9 @@ static int ifcvf_request_vq_irq(struct ifcvf_hw *vf)
 	return ret;
 }
 
-static int ifcvf_request_config_irq(struct ifcvf_adapter *adapter)
+static int ifcvf_request_config_irq(struct ifcvf_hw *vf)
 {
-	struct pci_dev *pdev = adapter->pdev;
-	struct ifcvf_hw *vf = &adapter->vf;
+	struct pci_dev *pdev = vf->pdev;
 	int config_vector, ret;
 
 	if (vf->msix_vector_status == MSIX_VECTOR_PER_VQ_AND_CONFIG)
@@ -322,7 +319,7 @@ static int ifcvf_request_irq(struct ifcvf_adapter *adapter)
 	struct ifcvf_hw *vf = &adapter->vf;
 	int nvectors, ret, max_intr;
 
-	nvectors = ifcvf_alloc_vectors(adapter);
+	nvectors = ifcvf_alloc_vectors(vf);
 	if (nvectors <= 0)
 		return -EFAULT;
 
@@ -333,7 +330,7 @@ static int ifcvf_request_irq(struct ifcvf_adapter *adapter)
 
 	if (nvectors == 1) {
 		vf->msix_vector_status = MSIX_VECTOR_DEV_SHARED;
-		ret = ifcvf_request_dev_irq(adapter);
+		ret = ifcvf_request_dev_irq(vf);
 
 		return ret;
 	}
@@ -342,7 +339,7 @@ static int ifcvf_request_irq(struct ifcvf_adapter *adapter)
 	if (ret)
 		return ret;
 
-	ret = ifcvf_request_config_irq(adapter);
+	ret = ifcvf_request_config_irq(vf);
 
 	if (ret)
 		return ret;
-- 
2.31.1


WARNING: multiple messages have this Message-ID (diff)
From: Zhu Lingshan <lingshan.zhu@intel.com>
To: jasowang@redhat.com, mst@redhat.com
Cc: kvm@vger.kernel.org, piotr.uminski@intel.com,
	stable@vger.kernel.org, hang.yuan@intel.com,
	virtualization@lists.linux-foundation.org
Subject: [PATCH V2 07/12] vDPA/ifcvf: decouple config/dev IRQ requester and vectors allocator from the adapter
Date: Fri, 25 Nov 2022 22:57:19 +0800	[thread overview]
Message-ID: <20221125145724.1129962-8-lingshan.zhu@intel.com> (raw)
In-Reply-To: <20221125145724.1129962-1-lingshan.zhu@intel.com>

This commit decouples the config irq requester, the device
shared irq requester and the MSI vectors allocator from
the adapter. So they can be safely invoked since probe
before the adapter is allocated.

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
Cc: stable@vger.kernel.org
---
 drivers/vdpa/ifcvf/ifcvf_main.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
index ee9c22975119..8320bdacace8 100644
--- a/drivers/vdpa/ifcvf/ifcvf_main.c
+++ b/drivers/vdpa/ifcvf/ifcvf_main.c
@@ -132,10 +132,9 @@ static void ifcvf_free_irq(struct ifcvf_hw *vf)
  * It returns the number of allocated vectors, negative
  * return value when fails.
  */
-static int ifcvf_alloc_vectors(struct ifcvf_adapter *adapter)
+static int ifcvf_alloc_vectors(struct ifcvf_hw *vf)
 {
-	struct pci_dev *pdev = adapter->pdev;
-	struct ifcvf_hw *vf = &adapter->vf;
+	struct pci_dev *pdev = vf->pdev;
 	int max_intr, ret;
 
 	/* all queues and config interrupt  */
@@ -222,10 +221,9 @@ static int ifcvf_request_vqs_reused_irq(struct ifcvf_hw *vf)
 	return -EFAULT;
 }
 
-static int ifcvf_request_dev_irq(struct ifcvf_adapter *adapter)
+static int ifcvf_request_dev_irq(struct ifcvf_hw *vf)
 {
-	struct pci_dev *pdev = adapter->pdev;
-	struct ifcvf_hw *vf = &adapter->vf;
+	struct pci_dev *pdev = vf->pdev;
 	int i, vector, ret, irq;
 
 	vector = 0;
@@ -276,10 +274,9 @@ static int ifcvf_request_vq_irq(struct ifcvf_hw *vf)
 	return ret;
 }
 
-static int ifcvf_request_config_irq(struct ifcvf_adapter *adapter)
+static int ifcvf_request_config_irq(struct ifcvf_hw *vf)
 {
-	struct pci_dev *pdev = adapter->pdev;
-	struct ifcvf_hw *vf = &adapter->vf;
+	struct pci_dev *pdev = vf->pdev;
 	int config_vector, ret;
 
 	if (vf->msix_vector_status == MSIX_VECTOR_PER_VQ_AND_CONFIG)
@@ -322,7 +319,7 @@ static int ifcvf_request_irq(struct ifcvf_adapter *adapter)
 	struct ifcvf_hw *vf = &adapter->vf;
 	int nvectors, ret, max_intr;
 
-	nvectors = ifcvf_alloc_vectors(adapter);
+	nvectors = ifcvf_alloc_vectors(vf);
 	if (nvectors <= 0)
 		return -EFAULT;
 
@@ -333,7 +330,7 @@ static int ifcvf_request_irq(struct ifcvf_adapter *adapter)
 
 	if (nvectors == 1) {
 		vf->msix_vector_status = MSIX_VECTOR_DEV_SHARED;
-		ret = ifcvf_request_dev_irq(adapter);
+		ret = ifcvf_request_dev_irq(vf);
 
 		return ret;
 	}
@@ -342,7 +339,7 @@ static int ifcvf_request_irq(struct ifcvf_adapter *adapter)
 	if (ret)
 		return ret;
 
-	ret = ifcvf_request_config_irq(adapter);
+	ret = ifcvf_request_config_irq(vf);
 
 	if (ret)
 		return ret;
-- 
2.31.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2022-11-25 15:06 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 14:57 [PATCH V2 00/12] ifcvf/vDPA implement features provisioning Zhu Lingshan
2022-11-25 14:57 ` Zhu Lingshan
2022-11-25 14:57 ` [PATCH V2 01/12] vDPA/ifcvf: decouple hw features manipulators from the adapter Zhu Lingshan
2022-11-25 14:57   ` Zhu Lingshan
2022-11-25 14:57 ` [PATCH V2 02/12] vDPA/ifcvf: decouple config space ops " Zhu Lingshan
2022-11-25 14:57   ` Zhu Lingshan
2022-11-25 14:57 ` [PATCH V2 03/12] vDPA/ifcvf: alloc the mgmt_dev before " Zhu Lingshan
2022-11-25 14:57   ` Zhu Lingshan
2022-11-25 14:57 ` [PATCH V2 04/12] vDPA/ifcvf: decouple vq IRQ releasers from " Zhu Lingshan
2022-11-25 14:57   ` Zhu Lingshan
2022-11-25 14:57 ` [PATCH V2 05/12] vDPA/ifcvf: decouple config IRQ releaser " Zhu Lingshan
2022-11-25 14:57   ` Zhu Lingshan
2022-11-25 14:57 ` [PATCH V2 06/12] vDPA/ifcvf: decouple vq irq requester " Zhu Lingshan
2022-11-25 14:57   ` Zhu Lingshan
2022-11-25 14:57 ` Zhu Lingshan [this message]
2022-11-25 14:57   ` [PATCH V2 07/12] vDPA/ifcvf: decouple config/dev IRQ requester and vectors allocator " Zhu Lingshan
2022-11-25 14:57 ` [PATCH V2 08/12] vDPA/ifcvf: ifcvf_request_irq works on ifcvf_hw Zhu Lingshan
2022-11-25 14:57   ` Zhu Lingshan
2022-11-25 14:57 ` [PATCH V2 09/12] vDPA/ifcvf: manage ifcvf_hw in the mgmt_dev Zhu Lingshan
2022-11-25 14:57   ` Zhu Lingshan
2022-11-25 14:57 ` [PATCH V2 10/12] vDPA/ifcvf: allocate the adapter in dev_add() Zhu Lingshan
2022-11-25 14:57   ` Zhu Lingshan
2022-11-25 14:57 ` [PATCH V2 11/12] vDPA/ifcvf: retire ifcvf_private_to_vf Zhu Lingshan
2022-11-25 14:57   ` Zhu Lingshan
2022-11-25 14:57 ` [PATCH V2 12/12] vDPA/ifcvf: implement features provisioning Zhu Lingshan
2022-11-25 14:57   ` Zhu Lingshan
2022-12-06  8:25 ` [PATCH V2 00/12] ifcvf/vDPA " Jason Wang
2022-12-06  8:25   ` Jason Wang
2022-12-13  6:57   ` Zhu, Lingshan
2022-12-13  6:57     ` Zhu, Lingshan
2022-12-22  5:44     ` Zhu, Lingshan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221125145724.1129962-8-lingshan.zhu@intel.com \
    --to=lingshan.zhu@intel.com \
    --cc=hang.yuan@intel.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=piotr.uminski@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.