Displaying 18 results from an estimated 18 matches for "ifcvf_reset".
2023 May 08
1
[PATCH V2 4/5] vDPA/ifcvf: synchronize irqs in the reset routine
...(+), 50 deletions(-)
diff --git a/drivers/vdpa/ifcvf/ifcvf_base.c b/drivers/vdpa/ifcvf/ifcvf_base.c
index 79e313c5e10e..1f39290baa38 100644
--- a/drivers/vdpa/ifcvf/ifcvf_base.c
+++ b/drivers/vdpa/ifcvf/ifcvf_base.c
@@ -170,12 +170,9 @@ void ifcvf_set_status(struct ifcvf_hw *hw, u8 status)
void ifcvf_reset(struct ifcvf_hw *hw)
{
- hw->config_cb.callback = NULL;
- hw->config_cb.private = NULL;
-
ifcvf_set_status(hw, 0);
- /* flush set_status, make sure VF is stopped, reset */
- ifcvf_get_status(hw);
+ while (ifcvf_get_status(hw))
+ msleep(1);
}
u64 ifcvf_get_hw_features(struct ifcvf_hw *...
2023 May 24
2
[PATCH V2 4/5] vDPA/ifcvf: synchronize irqs in the reset routine
...-git a/drivers/vdpa/ifcvf/ifcvf_base.c b/drivers/vdpa/ifcvf/ifcvf_base.c
> index 79e313c5e10e..1f39290baa38 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_base.c
> +++ b/drivers/vdpa/ifcvf/ifcvf_base.c
> @@ -170,12 +170,9 @@ void ifcvf_set_status(struct ifcvf_hw *hw, u8 status)
>
> void ifcvf_reset(struct ifcvf_hw *hw)
> {
> - hw->config_cb.callback = NULL;
> - hw->config_cb.private = NULL;
> -
> ifcvf_set_status(hw, 0);
> - /* flush set_status, make sure VF is stopped, reset */
> - ifcvf_get_status(hw);
> + while (ifcvf_get...
2023 Mar 31
7
[PATCH 0/5] vDPA/ifcvf: implement immediate initialization mechanism
Formerly, ifcvf driver has implemented a lazy-initialization mechanism
for the virtqueues and other config space contents,
it would store all configurations that passed down from the userspace,
then load them to the device config space upon DRIVER_OK.
This can not serve live migration, so this series implement an
immediate initialization mechanism, which means rather than the
former store-load
2023 May 08
6
[PATCH V2 0/5] vDPA/ifcvf: implement immediate initialization mechanism
Formerly, ifcvf driver has implemented a lazy-initialization mechanism
for the virtqueues and other config space contents,
it would store all configurations that passed down from the userspace,
then load them to the device config space upon DRIVER_OK.
This can not serve live migration, so this series implement an
immediate initialization mechanism, which means rather than the
former store-load
2019 Nov 08
0
[PATCH 1/2] IFC hardware operation layer
...= ioread8(&hw->common_cfg->config_generation);
> + } while (old_gen != new_gen);
> +
> + return status;
> +}
> +
> +void ifcvf_set_status(struct ifcvf_hw *hw, u8 status)
> +{
> + iowrite8(status, &hw->common_cfg->device_status);
> +}
> +
> +void ifcvf_reset(struct ifcvf_hw *hw)
> +{
> + ifcvf_set_status(hw, 0);
> + 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);
> + ifcv...
2019 Nov 05
1
[PATCH 1/2] IFC hardware operation layer
...= ioread8(&hw->common_cfg->config_generation);
> + } while (old_gen != new_gen);
> +
> + return status;
> +}
> +
> +void ifcvf_set_status(struct ifcvf_hw *hw, u8 status)
> +{
> + iowrite8(status, &hw->common_cfg->device_status);
> +}
> +
> +void ifcvf_reset(struct ifcvf_hw *hw)
> +{
> + ifcvf_set_status(hw, 0);
> + 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);
> + ifcv...
2019 Nov 05
0
[PATCH 1/2] IFC hardware operation layer
...= ioread8(&hw->common_cfg->config_generation);
> + } while (old_gen != new_gen);
> +
> + return status;
> +}
> +
> +void ifcvf_set_status(struct ifcvf_hw *hw, u8 status)
> +{
> + iowrite8(status, &hw->common_cfg->device_status);
> +}
> +
> +void ifcvf_reset(struct ifcvf_hw *hw)
> +{
> + ifcvf_set_status(hw, 0);
> + 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);
> + ifcv...
2019 Nov 06
0
[PATCH 1/2] IFC hardware operation layer
...,
and even it did, it should be called from virtio core.
> + } while (old_gen != new_gen);
> +
> + return status;
> +}
> +
> +void ifcvf_set_status(struct ifcvf_hw *hw, u8 status)
> +{
> + iowrite8(status, &hw->common_cfg->device_status);
> +}
> +
> +void ifcvf_reset(struct ifcvf_hw *hw)
> +{
> + ifcvf_set_status(hw, 0);
> + 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);
> + ifcv...
2020 Apr 26
1
[PATCH 2/2] vdpa: implement config interrupt in IFCVF
...diff --git a/drivers/vdpa/ifcvf/ifcvf_base.c b/drivers/vdpa/ifcvf/ifcvf_base.c
> index b61b06e..c825d99 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_base.c
> +++ b/drivers/vdpa/ifcvf/ifcvf_base.c
> @@ -185,6 +185,9 @@ void ifcvf_set_status(struct ifcvf_hw *hw, u8 status)
>
> void ifcvf_reset(struct ifcvf_hw *hw)
> {
> + hw->config_cb.callback = NULL;
> + hw->config_cb.private = NULL;
> +
> ifcvf_set_status(hw, 0);
> /* flush set_status, make sure VF is stopped, reset */
> ifcvf_get_status(hw);
> diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/dri...
2019 Oct 16
0
[RFC 1/2] vhost: IFC VF hardware operation layer
...fcvf_get_status(struct ifcvf_hw *hw)
> +{
> + return ioread8(&hw->common_cfg->device_status);
> +}
> +
> +static void ifcvf_set_status(struct ifcvf_hw *hw, u8 status)
> +{
> + iowrite8(status, &hw->common_cfg->device_status);
> +}
> +
> +static void ifcvf_reset(struct ifcvf_hw *hw)
> +{
> + ifcvf_set_status(hw, 0);
> +
> + /* flush status write */
> + ifcvf_get_status(hw);
Why this flush is needed?
> + hw->generation++;
> +}
> +
> +static void ifcvf_add_status(struct ifcvf_hw *hw, u8 status)
> +{
> + if (status != 0...
2019 Oct 21
0
[RFC 1/2] vhost: IFC VF hardware operation layer
...&hw->common_cfg->device_status);
>>> +}
>>> +
>>> +static void ifcvf_set_status(struct ifcvf_hw *hw, u8 status)
>>> +{
>>> +??? iowrite8(status, &hw->common_cfg->device_status);
>>> +}
>>> +
>>> +static void ifcvf_reset(struct ifcvf_hw *hw)
>>> +{
>>> +??? ifcvf_set_status(hw, 0);
>>> +
>>> +??? /* flush status write */
>>> +??? ifcvf_get_status(hw);
>>
>>
>> Why this flush is needed?
>
> accoring to PCIE requirements, this get_status() after a s...
2023 May 08
1
[PATCH V2 2/5] vDPA/ifcvf: get_driver_features from virtio registers
...multiplier;
u32 dev_type;
- u64 req_features;
u64 hw_features;
/* provisioned device features */
u64 dev_features;
@@ -122,7 +121,7 @@ u8 ifcvf_get_status(struct ifcvf_hw *hw);
void ifcvf_set_status(struct ifcvf_hw *hw, u8 status);
void io_write64_twopart(u64 val, u32 *lo, u32 *hi);
void ifcvf_reset(struct ifcvf_hw *hw);
-u64 ifcvf_get_features(struct ifcvf_hw *hw);
+u64 ifcvf_get_dev_features(struct ifcvf_hw *hw);
u64 ifcvf_get_hw_features(struct ifcvf_hw *hw);
int ifcvf_verify_min_features(struct ifcvf_hw *hw, u64 features);
u16 ifcvf_get_vq_state(struct ifcvf_hw *hw, u16 qid);
@@ -137,4...
2023 May 08
1
[PATCH V2 1/5] vDPA/ifcvf: virt queue ops take immediate actions
...common_cfg;
+
+ vp_iowrite16(qid, &cfg->queue_select);
+ vp_iowrite16(ready, &cfg->queue_enable);
+}
+
static void ifcvf_hw_disable(struct ifcvf_hw *hw)
{
u32 i;
@@ -366,16 +384,12 @@ static void ifcvf_hw_disable(struct ifcvf_hw *hw)
int ifcvf_start_hw(struct ifcvf_hw *hw)
{
- ifcvf_reset(hw);
ifcvf_add_status(hw, VIRTIO_CONFIG_S_ACKNOWLEDGE);
ifcvf_add_status(hw, VIRTIO_CONFIG_S_DRIVER);
if (ifcvf_config_features(hw) < 0)
return -EINVAL;
- if (ifcvf_hw_enable(hw) < 0)
- return -EINVAL;
-
ifcvf_add_status(hw, VIRTIO_CONFIG_S_DRIVER_OK);
return 0;
diff --git...
2020 Apr 26
0
[PATCH V3 2/2] vdpa: implement config interrupt in IFCVF
...diff --git a/drivers/vdpa/ifcvf/ifcvf_base.c b/drivers/vdpa/ifcvf/ifcvf_base.c
> index b61b06e..c825d99 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_base.c
> +++ b/drivers/vdpa/ifcvf/ifcvf_base.c
> @@ -185,6 +185,9 @@ void ifcvf_set_status(struct ifcvf_hw *hw, u8 status)
>
> void ifcvf_reset(struct ifcvf_hw *hw)
> {
> + hw->config_cb.callback = NULL;
> + hw->config_cb.private = NULL;
> +
> ifcvf_set_status(hw, 0);
> /* flush set_status, make sure VF is stopped, reset */
> ifcvf_get_status(hw);
> diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/dri...
2023 Mar 31
1
[PATCH 3/5] retire ifcvf_start_datapath and ifcvf_add_status
...f/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_...
2019 Nov 06
0
[PATCH 2/2] IFC VDPA layer
...f_stop_datapath(void *private)
> +{
> + struct ifcvf_hw *vf = IFC_PRIVATE_TO_VF(private);
> + int i;
> +
> + for (i = 0; i < IFCVF_MAX_QUEUES; i++)
> + vf->vring[i].cb.callback = NULL;
> +
> + ifcvf_stop_hw(vf);
> +
> + return 0;
> +}
> +
> +static void ifcvf_reset_vring(struct ifcvf_adapter *adapter)
> +{
> + struct ifcvf_hw *vf = IFC_PRIVATE_TO_VF(adapter);
> + struct virtio_pci_common_cfg *cfg;
> + u8 *lm_cfg;
> + int i;
> +
> + cfg = vf->common_cfg;
> + lm_cfg = vf->lm_cfg;
> +
> + for (i = 0; i < IFCVF_MAX_QUEUE_PAI...
2023 Mar 31
2
[PATCH 2/5] get_driver_features from virito registers
...multiplier;
u32 dev_type;
- u64 req_features;
u64 hw_features;
/* provisioned device features */
u64 dev_features;
@@ -122,7 +121,7 @@ u8 ifcvf_get_status(struct ifcvf_hw *hw);
void ifcvf_set_status(struct ifcvf_hw *hw, u8 status);
void io_write64_twopart(u64 val, u32 *lo, u32 *hi);
void ifcvf_reset(struct ifcvf_hw *hw);
-u64 ifcvf_get_features(struct ifcvf_hw *hw);
+u64 ifcvf_get_dev_features(struct ifcvf_hw *hw);
u64 ifcvf_get_hw_features(struct ifcvf_hw *hw);
int ifcvf_verify_min_features(struct ifcvf_hw *hw, u64 features);
u16 ifcvf_get_vq_state(struct ifcvf_hw *hw, u16 qid);
@@ -137,4...
2023 Mar 31
1
[PATCH 1/5] virt queue ops take immediate actions
...common_cfg;
+
+ vp_iowrite16(qid, &cfg->queue_select);
+ vp_iowrite16(ready, &cfg->queue_enable);
+}
+
static void ifcvf_hw_disable(struct ifcvf_hw *hw)
{
u32 i;
@@ -366,16 +384,12 @@ static void ifcvf_hw_disable(struct ifcvf_hw *hw)
int ifcvf_start_hw(struct ifcvf_hw *hw)
{
- ifcvf_reset(hw);
ifcvf_add_status(hw, VIRTIO_CONFIG_S_ACKNOWLEDGE);
ifcvf_add_status(hw, VIRTIO_CONFIG_S_DRIVER);
if (ifcvf_config_features(hw) < 0)
return -EINVAL;
- if (ifcvf_hw_enable(hw) < 0)
- return -EINVAL;
-
ifcvf_add_status(hw, VIRTIO_CONFIG_S_DRIVER_OK);
return 0;
diff --git...