[v3,02/15] vhost: add vdpa ops for blk device

Message ID 1643425417-215270-3-git-send-email-andy.pei@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Maxime Coquelin
Headers
Series add virtio_blk device support to vdpa/ifc |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Pei, Andy Jan. 29, 2022, 3:03 a.m. UTC
  Get_config and set_config are necessary ops for blk device.
Add get_config and set_config ops to vdpa ops.

Signed-off-by: Andy Pei <andy.pei@intel.com>
---
 lib/vhost/vdpa_driver.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Comments

Maxime Coquelin March 22, 2022, 9:12 a.m. UTC | #1
On 1/29/22 04:03, Andy Pei wrote:
> Get_config and set_config are necessary ops for blk device.
> Add get_config and set_config ops to vdpa ops.
> 
> Signed-off-by: Andy Pei <andy.pei@intel.com>
> ---
>   lib/vhost/vdpa_driver.h | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/vhost/vdpa_driver.h b/lib/vhost/vdpa_driver.h
> index fc2d6ac..9a23db9 100644
> --- a/lib/vhost/vdpa_driver.h
> +++ b/lib/vhost/vdpa_driver.h
> @@ -65,8 +65,12 @@ struct rte_vdpa_dev_ops {
>   	/** Reset statistics of the queue */
>   	int (*reset_stats)(struct rte_vdpa_device *dev, int qid);
>   
> -	/** Reserved for future extension */
> -	void *reserved[2];
> +	/** Get the device configuration space */
> +	int (*get_config)(int vid, uint8_t *config, uint32_t len);
> +
> +	/** Set the device configuration space */
> +	int (*set_config)(int vid, uint8_t *config, uint32_t offset,
> +		      uint32_t size, uint32_t flags);
>   };
>   
>   /**

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  

Patch

diff --git a/lib/vhost/vdpa_driver.h b/lib/vhost/vdpa_driver.h
index fc2d6ac..9a23db9 100644
--- a/lib/vhost/vdpa_driver.h
+++ b/lib/vhost/vdpa_driver.h
@@ -65,8 +65,12 @@  struct rte_vdpa_dev_ops {
 	/** Reset statistics of the queue */
 	int (*reset_stats)(struct rte_vdpa_device *dev, int qid);
 
-	/** Reserved for future extension */
-	void *reserved[2];
+	/** Get the device configuration space */
+	int (*get_config)(int vid, uint8_t *config, uint32_t len);
+
+	/** Set the device configuration space */
+	int (*set_config)(int vid, uint8_t *config, uint32_t offset,
+		      uint32_t size, uint32_t flags);
 };
 
 /**