public inbox for virtualization@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Zhu Lingshan <lingshan.zhu@intel.com>, mst@redhat.com
Cc: virtualization@lists.linux-foundation.org
Subject: Re: [PATCH 3/5] retire ifcvf_start_datapath and ifcvf_add_status
Date: Wed, 26 Apr 2023 12:04:56 +0800	[thread overview]
Message-ID: <acc427b5-6f22-9792-b3d8-cc8fb10fe30e@redhat.com> (raw)
In-Reply-To: <20230331204854.20082-4-lingshan.zhu@intel.com>


在 2023/4/1 04:48, Zhu Lingshan 写道:
> Rather than former lazy-initialization mechanism,
> now the virtqueue operations and driver_features related
> ops access the virtio registers directly to take
> immediate actions. So ifcvf_start_datapath() should
> retire.
>
> ifcvf_add_status() is retierd because we should not change
> device status by a vendor driver's decision, this driver should
> only set device status which is from virito drivers
> upon vdpa_ops.set_status()
>
> Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>


Acked-by: Jason Wang <jasowang@redhat.com>

Thanks


> ---
>   drivers/vdpa/ifcvf/ifcvf_base.c | 19 -------------------
>   drivers/vdpa/ifcvf/ifcvf_base.h |  1 -
>   drivers/vdpa/ifcvf/ifcvf_main.c | 23 -----------------------
>   3 files changed, 43 deletions(-)
>
> diff --git a/drivers/vdpa/ifcvf/ifcvf_base.c b/drivers/vdpa/ifcvf/ifcvf_base.c
> index 546e923bcd16..79e313c5e10e 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_base.c
> +++ b/drivers/vdpa/ifcvf/ifcvf_base.c
> @@ -178,15 +178,6 @@ void ifcvf_reset(struct ifcvf_hw *hw)
>   	ifcvf_get_status(hw);
>   }
>   
> -static void ifcvf_add_status(struct ifcvf_hw *hw, u8 status)
> -{
> -	if (status != 0)
> -		status |= ifcvf_get_status(hw);
> -
> -	ifcvf_set_status(hw, status);
> -	ifcvf_get_status(hw);
> -}
> -
>   u64 ifcvf_get_hw_features(struct ifcvf_hw *hw)
>   {
>   	struct virtio_pci_common_cfg __iomem *cfg = hw->common_cfg;
> @@ -387,16 +378,6 @@ static void ifcvf_hw_disable(struct ifcvf_hw *hw)
>   	}
>   }
>   
> -int ifcvf_start_hw(struct ifcvf_hw *hw)
> -{
> -	ifcvf_add_status(hw, VIRTIO_CONFIG_S_ACKNOWLEDGE);
> -	ifcvf_add_status(hw, VIRTIO_CONFIG_S_DRIVER);
> -
> -	ifcvf_add_status(hw, VIRTIO_CONFIG_S_DRIVER_OK);
> -
> -	return 0;
> -}
> -
>   void ifcvf_stop_hw(struct ifcvf_hw *hw)
>   {
>   	ifcvf_hw_disable(hw);
> diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf/ifcvf_base.h
> index cb19196c3ece..d34d3bc0dbf4 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_base.h
> +++ b/drivers/vdpa/ifcvf/ifcvf_base.h
> @@ -110,7 +110,6 @@ struct ifcvf_vdpa_mgmt_dev {
>   };
>   
>   int ifcvf_init_hw(struct ifcvf_hw *hw, struct pci_dev *dev);
> -int ifcvf_start_hw(struct ifcvf_hw *hw);
>   void ifcvf_stop_hw(struct ifcvf_hw *hw);
>   void ifcvf_notify_queue(struct ifcvf_hw *hw, u16 qid);
>   void ifcvf_read_dev_config(struct ifcvf_hw *hw, u64 offset,
> diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
> index 4588484bd53d..968687159e44 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_main.c
> +++ b/drivers/vdpa/ifcvf/ifcvf_main.c
> @@ -346,22 +346,6 @@ static int ifcvf_request_irq(struct ifcvf_hw *vf)
>   	return 0;
>   }
>   
> -static int ifcvf_start_datapath(struct ifcvf_adapter *adapter)
> -{
> -	struct ifcvf_hw *vf = adapter->vf;
> -	u8 status;
> -	int ret;
> -
> -	ret = ifcvf_start_hw(vf);
> -	if (ret < 0) {
> -		status = ifcvf_get_status(vf);
> -		status |= VIRTIO_CONFIG_S_FAILED;
> -		ifcvf_set_status(vf, status);
> -	}
> -
> -	return ret;
> -}
> -
>   static int ifcvf_stop_datapath(struct ifcvf_adapter *adapter)
>   {
>   	struct ifcvf_hw *vf = adapter->vf;
> @@ -452,13 +436,11 @@ static u8 ifcvf_vdpa_get_status(struct vdpa_device *vdpa_dev)
>   
>   static void ifcvf_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status)
>   {
> -	struct ifcvf_adapter *adapter;
>   	struct ifcvf_hw *vf;
>   	u8 status_old;
>   	int ret;
>   
>   	vf  = vdpa_to_vf(vdpa_dev);
> -	adapter = vdpa_to_adapter(vdpa_dev);
>   	status_old = ifcvf_get_status(vf);
>   
>   	if (status_old == status)
> @@ -473,11 +455,6 @@ static void ifcvf_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status)
>   			ifcvf_set_status(vf, status);
>   			return;
>   		}
> -
> -		if (ifcvf_start_datapath(adapter) < 0)
> -			IFCVF_ERR(adapter->pdev,
> -				  "Failed to set ifcvf vdpa  status %u\n",
> -				  status);
>   	}
>   
>   	ifcvf_set_status(vf, status);

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

  reply	other threads:[~2023-04-26  4:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 20:48 [PATCH 0/5] vDPA/ifcvf: implement immediate initialization mechanism Zhu Lingshan
2023-03-31 20:48 ` [PATCH 1/5] virt queue ops take immediate actions Zhu Lingshan
2023-04-26  3:39   ` Jason Wang
2023-04-27  8:02     ` Zhu, Lingshan
2023-03-31 20:48 ` [PATCH 2/5] get_driver_features from virito registers Zhu Lingshan
2023-04-24  4:50   ` Michael S. Tsirkin
2023-04-24  7:24     ` Zhu, Lingshan
2023-04-26  4:02   ` Jason Wang
2023-04-27  8:28     ` Zhu, Lingshan
2023-03-31 20:48 ` [PATCH 3/5] retire ifcvf_start_datapath and ifcvf_add_status Zhu Lingshan
2023-04-26  4:04   ` Jason Wang [this message]
2023-03-31 20:48 ` [PATCH 4/5] synchronize irqs in the reset routine Zhu Lingshan
2023-04-26  5:06   ` Jason Wang
2023-04-27  9:07     ` Zhu, Lingshan
2023-03-31 20:48 ` [PATCH 5/5] a vendor driver should not set _CONFIG_S_FAILED Zhu Lingshan
2023-04-26  5:10   ` Jason Wang
2023-04-03  5:28 ` [PATCH 0/5] vDPA/ifcvf: implement immediate initialization mechanism Jason Wang
2023-04-03 10:10   ` Zhu, Lingshan
2023-04-20  9:17     ` Zhu, Lingshan
2023-04-24  3:50       ` Jason Wang
2023-04-24  4:52         ` Michael S. Tsirkin
2023-04-24  5:20           ` Jason Wang
2023-04-24  9:53             ` Michael S. Tsirkin
2023-04-24  4:51 ` Michael S. Tsirkin
2023-04-24  7:25   ` 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=acc427b5-6f22-9792-b3d8-cc8fb10fe30e@redhat.com \
    --to=jasowang@redhat.com \
    --cc=lingshan.zhu@intel.com \
    --cc=mst@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox