DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] vhost: remove deprecated helpers
@ 2022-09-27 11:36 David Marchand
  2022-09-27 11:51 ` Maxime Coquelin
  2022-09-28  4:43 ` Xia, Chenbo
  0 siblings, 2 replies; 4+ messages in thread
From: David Marchand @ 2022-09-27 11:36 UTC (permalink / raw)
  To: dev; +Cc: Maxime Coquelin, Chenbo Xia, Ray Kinsella

Those helpers have been marked as deprecated for a long time and have
documented equivalent helpers.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 doc/guides/rel_notes/release_22_11.rst |  3 ++
 lib/vhost/rte_vhost.h                  | 55 --------------------------
 lib/vhost/version.map                  |  2 -
 lib/vhost/vhost.c                      | 11 ------
 4 files changed, 3 insertions(+), 68 deletions(-)

diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst
index 684bf74596..7f61cdf56a 100644
--- a/doc/guides/rel_notes/release_22_11.rst
+++ b/doc/guides/rel_notes/release_22_11.rst
@@ -204,6 +204,9 @@ API Changes
   Names for the telemetry commands are now similarly limited.
   The parameters for telemetry commands are unaffected by this change.
 
+* vhost: Removed deprecated ``rte_vhost_gpa_to_vva`` and
+  ``rte_vhost_get_queue_num`` helpers.
+
 * raw/ifgpa: The function ``rte_pmd_ifpga_get_pci_bus`` has been removed.
 
 
diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h
index 617425e8d6..bb7d86a432 100644
--- a/lib/vhost/rte_vhost.h
+++ b/lib/vhost/rte_vhost.h
@@ -354,44 +354,6 @@ struct rte_vhost_stat_name {
 /**
  * Convert guest physical address to host virtual address
  *
- * This function is deprecated because unsafe.
- * New rte_vhost_va_from_guest_pa() should be used instead to ensure
- * guest physical ranges are fully and contiguously mapped into
- * process virtual address space.
- *
- * @param mem
- *  the guest memory regions
- * @param gpa
- *  the guest physical address for querying
- * @return
- *  the host virtual address on success, 0 on failure
- */
-__rte_deprecated
-static __rte_always_inline uint64_t
-rte_vhost_gpa_to_vva(struct rte_vhost_memory *mem, uint64_t gpa)
-{
-	struct rte_vhost_mem_region *reg;
-	uint32_t i;
-
-	for (i = 0; i < mem->nregions; i++) {
-		reg = &mem->regions[i];
-		if (gpa >= reg->guest_phys_addr &&
-		    gpa <  reg->guest_phys_addr + reg->size) {
-			return gpa - reg->guest_phys_addr +
-			       reg->host_user_addr;
-		}
-	}
-
-	return 0;
-}
-
-/**
- * Convert guest physical address to host virtual address safely
- *
- * This variant of rte_vhost_gpa_to_vva() takes care all the
- * requested length is mapped and contiguous in process address
- * space.
- *
  * @param mem
  *  the guest memory regions
  * @param gpa
@@ -696,23 +658,6 @@ int rte_vhost_get_mtu(int vid, uint16_t *mtu);
  */
 int rte_vhost_get_numa_node(int vid);
 
-/**
- * @deprecated
- * Get the number of queues the device supports.
- *
- * Note this function is deprecated, as it returns a queue pair number,
- * which is vhost specific. Instead, rte_vhost_get_vring_num should
- * be used.
- *
- * @param vid
- *  vhost device ID
- *
- * @return
- *  The number of queues, 0 on failure
- */
-__rte_deprecated
-uint32_t rte_vhost_get_queue_num(int vid);
-
 /**
  * Get the number of vrings the device supports.
  *
diff --git a/lib/vhost/version.map b/lib/vhost/version.map
index 18574346d5..7a00b65740 100644
--- a/lib/vhost/version.map
+++ b/lib/vhost/version.map
@@ -41,14 +41,12 @@ DPDK_23 {
 	rte_vhost_get_mtu;
 	rte_vhost_get_negotiated_features;
 	rte_vhost_get_numa_node;
-	rte_vhost_get_queue_num;
 	rte_vhost_get_vdpa_device;
 	rte_vhost_get_vhost_ring_inflight;
 	rte_vhost_get_vhost_vring;
 	rte_vhost_get_vring_base;
 	rte_vhost_get_vring_base_from_inflight;
 	rte_vhost_get_vring_num;
-	rte_vhost_gpa_to_vva;
 	rte_vhost_log_used_vring;
 	rte_vhost_log_write;
 	rte_vhost_rx_queue_count;
diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
index aa671f47a3..abf17eb509 100644
--- a/lib/vhost/vhost.c
+++ b/lib/vhost/vhost.c
@@ -859,17 +859,6 @@ rte_vhost_get_numa_node(int vid)
 #endif
 }
 
-uint32_t
-rte_vhost_get_queue_num(int vid)
-{
-	struct virtio_net *dev = get_device(vid);
-
-	if (dev == NULL)
-		return 0;
-
-	return dev->nr_vring / 2;
-}
-
 uint16_t
 rte_vhost_get_vring_num(int vid)
 {
-- 
2.37.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vhost: remove deprecated helpers
  2022-09-27 11:36 [PATCH] vhost: remove deprecated helpers David Marchand
@ 2022-09-27 11:51 ` Maxime Coquelin
  2022-09-28  4:43 ` Xia, Chenbo
  1 sibling, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2022-09-27 11:51 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: Chenbo Xia, Ray Kinsella



On 9/27/22 13:36, David Marchand wrote:
> Those helpers have been marked as deprecated for a long time and have
> documented equivalent helpers.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>   doc/guides/rel_notes/release_22_11.rst |  3 ++
>   lib/vhost/rte_vhost.h                  | 55 --------------------------
>   lib/vhost/version.map                  |  2 -
>   lib/vhost/vhost.c                      | 11 ------
>   4 files changed, 3 insertions(+), 68 deletions(-)
> 

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

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] vhost: remove deprecated helpers
  2022-09-27 11:36 [PATCH] vhost: remove deprecated helpers David Marchand
  2022-09-27 11:51 ` Maxime Coquelin
@ 2022-09-28  4:43 ` Xia, Chenbo
  2022-09-29  8:32   ` Xia, Chenbo
  1 sibling, 1 reply; 4+ messages in thread
From: Xia, Chenbo @ 2022-09-28  4:43 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: Maxime Coquelin, Ray Kinsella

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Tuesday, September 27, 2022 7:36 PM
> To: dev@dpdk.org
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Xia, Chenbo
> <chenbo.xia@intel.com>; Ray Kinsella <mdr@ashroe.eu>
> Subject: [PATCH] vhost: remove deprecated helpers
> 
> Those helpers have been marked as deprecated for a long time and have
> documented equivalent helpers.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  doc/guides/rel_notes/release_22_11.rst |  3 ++
>  lib/vhost/rte_vhost.h                  | 55 --------------------------
>  lib/vhost/version.map                  |  2 -
>  lib/vhost/vhost.c                      | 11 ------
>  4 files changed, 3 insertions(+), 68 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/release_22_11.rst
> b/doc/guides/rel_notes/release_22_11.rst
> index 684bf74596..7f61cdf56a 100644
> --- a/doc/guides/rel_notes/release_22_11.rst
> +++ b/doc/guides/rel_notes/release_22_11.rst
> @@ -204,6 +204,9 @@ API Changes
>    Names for the telemetry commands are now similarly limited.
>    The parameters for telemetry commands are unaffected by this change.
> 
> +* vhost: Removed deprecated ``rte_vhost_gpa_to_vva`` and
> +  ``rte_vhost_get_queue_num`` helpers.
> +
>  * raw/ifgpa: The function ``rte_pmd_ifpga_get_pci_bus`` has been removed.
> 
> 
> diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h
> index 617425e8d6..bb7d86a432 100644
> --- a/lib/vhost/rte_vhost.h
> +++ b/lib/vhost/rte_vhost.h
> @@ -354,44 +354,6 @@ struct rte_vhost_stat_name {
>  /**
>   * Convert guest physical address to host virtual address
>   *
> - * This function is deprecated because unsafe.
> - * New rte_vhost_va_from_guest_pa() should be used instead to ensure
> - * guest physical ranges are fully and contiguously mapped into
> - * process virtual address space.
> - *
> - * @param mem
> - *  the guest memory regions
> - * @param gpa
> - *  the guest physical address for querying
> - * @return
> - *  the host virtual address on success, 0 on failure
> - */
> -__rte_deprecated
> -static __rte_always_inline uint64_t
> -rte_vhost_gpa_to_vva(struct rte_vhost_memory *mem, uint64_t gpa)
> -{
> -	struct rte_vhost_mem_region *reg;
> -	uint32_t i;
> -
> -	for (i = 0; i < mem->nregions; i++) {
> -		reg = &mem->regions[i];
> -		if (gpa >= reg->guest_phys_addr &&
> -		    gpa <  reg->guest_phys_addr + reg->size) {
> -			return gpa - reg->guest_phys_addr +
> -			       reg->host_user_addr;
> -		}
> -	}
> -
> -	return 0;
> -}
> -
> -/**
> - * Convert guest physical address to host virtual address safely
> - *
> - * This variant of rte_vhost_gpa_to_vva() takes care all the
> - * requested length is mapped and contiguous in process address
> - * space.
> - *
>   * @param mem
>   *  the guest memory regions
>   * @param gpa
> @@ -696,23 +658,6 @@ int rte_vhost_get_mtu(int vid, uint16_t *mtu);
>   */
>  int rte_vhost_get_numa_node(int vid);
> 
> -/**
> - * @deprecated
> - * Get the number of queues the device supports.
> - *
> - * Note this function is deprecated, as it returns a queue pair number,
> - * which is vhost specific. Instead, rte_vhost_get_vring_num should
> - * be used.
> - *
> - * @param vid
> - *  vhost device ID
> - *
> - * @return
> - *  The number of queues, 0 on failure
> - */
> -__rte_deprecated
> -uint32_t rte_vhost_get_queue_num(int vid);
> -
>  /**
>   * Get the number of vrings the device supports.
>   *
> diff --git a/lib/vhost/version.map b/lib/vhost/version.map
> index 18574346d5..7a00b65740 100644
> --- a/lib/vhost/version.map
> +++ b/lib/vhost/version.map
> @@ -41,14 +41,12 @@ DPDK_23 {
>  	rte_vhost_get_mtu;
>  	rte_vhost_get_negotiated_features;
>  	rte_vhost_get_numa_node;
> -	rte_vhost_get_queue_num;
>  	rte_vhost_get_vdpa_device;
>  	rte_vhost_get_vhost_ring_inflight;
>  	rte_vhost_get_vhost_vring;
>  	rte_vhost_get_vring_base;
>  	rte_vhost_get_vring_base_from_inflight;
>  	rte_vhost_get_vring_num;
> -	rte_vhost_gpa_to_vva;
>  	rte_vhost_log_used_vring;
>  	rte_vhost_log_write;
>  	rte_vhost_rx_queue_count;
> diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
> index aa671f47a3..abf17eb509 100644
> --- a/lib/vhost/vhost.c
> +++ b/lib/vhost/vhost.c
> @@ -859,17 +859,6 @@ rte_vhost_get_numa_node(int vid)
>  #endif
>  }
> 
> -uint32_t
> -rte_vhost_get_queue_num(int vid)
> -{
> -	struct virtio_net *dev = get_device(vid);
> -
> -	if (dev == NULL)
> -		return 0;
> -
> -	return dev->nr_vring / 2;
> -}
> -
>  uint16_t
>  rte_vhost_get_vring_num(int vid)
>  {
> --
> 2.37.3

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] vhost: remove deprecated helpers
  2022-09-28  4:43 ` Xia, Chenbo
@ 2022-09-29  8:32   ` Xia, Chenbo
  0 siblings, 0 replies; 4+ messages in thread
From: Xia, Chenbo @ 2022-09-29  8:32 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: Maxime Coquelin, Ray Kinsella

> -----Original Message-----
> From: Xia, Chenbo <chenbo.xia@intel.com>
> Sent: Wednesday, September 28, 2022 12:43 PM
> To: David Marchand <david.marchand@redhat.com>; dev@dpdk.org
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Ray Kinsella
> <mdr@ashroe.eu>
> Subject: RE: [PATCH] vhost: remove deprecated helpers
> 
> > -----Original Message-----
> > From: David Marchand <david.marchand@redhat.com>
> > Sent: Tuesday, September 27, 2022 7:36 PM
> > To: dev@dpdk.org
> > Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Xia, Chenbo
> > <chenbo.xia@intel.com>; Ray Kinsella <mdr@ashroe.eu>
> > Subject: [PATCH] vhost: remove deprecated helpers
> >
> > Those helpers have been marked as deprecated for a long time and have
> > documented equivalent helpers.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> >  doc/guides/rel_notes/release_22_11.rst |  3 ++
> >  lib/vhost/rte_vhost.h                  | 55 --------------------------
> >  lib/vhost/version.map                  |  2 -
> >  lib/vhost/vhost.c                      | 11 ------
> >  4 files changed, 3 insertions(+), 68 deletions(-)
> >
> > diff --git a/doc/guides/rel_notes/release_22_11.rst
> > b/doc/guides/rel_notes/release_22_11.rst
> > index 684bf74596..7f61cdf56a 100644
> > --- a/doc/guides/rel_notes/release_22_11.rst
> > +++ b/doc/guides/rel_notes/release_22_11.rst
> > @@ -204,6 +204,9 @@ API Changes
> >    Names for the telemetry commands are now similarly limited.
> >    The parameters for telemetry commands are unaffected by this change.
> >
> > +* vhost: Removed deprecated ``rte_vhost_gpa_to_vva`` and
> > +  ``rte_vhost_get_queue_num`` helpers.
> > +
> >  * raw/ifgpa: The function ``rte_pmd_ifpga_get_pci_bus`` has been
> removed.
> >
> >
> > diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h
> > index 617425e8d6..bb7d86a432 100644
> > --- a/lib/vhost/rte_vhost.h
> > +++ b/lib/vhost/rte_vhost.h
> > @@ -354,44 +354,6 @@ struct rte_vhost_stat_name {
> >  /**
> >   * Convert guest physical address to host virtual address
> >   *
> > - * This function is deprecated because unsafe.
> > - * New rte_vhost_va_from_guest_pa() should be used instead to ensure
> > - * guest physical ranges are fully and contiguously mapped into
> > - * process virtual address space.
> > - *
> > - * @param mem
> > - *  the guest memory regions
> > - * @param gpa
> > - *  the guest physical address for querying
> > - * @return
> > - *  the host virtual address on success, 0 on failure
> > - */
> > -__rte_deprecated
> > -static __rte_always_inline uint64_t
> > -rte_vhost_gpa_to_vva(struct rte_vhost_memory *mem, uint64_t gpa)
> > -{
> > -	struct rte_vhost_mem_region *reg;
> > -	uint32_t i;
> > -
> > -	for (i = 0; i < mem->nregions; i++) {
> > -		reg = &mem->regions[i];
> > -		if (gpa >= reg->guest_phys_addr &&
> > -		    gpa <  reg->guest_phys_addr + reg->size) {
> > -			return gpa - reg->guest_phys_addr +
> > -			       reg->host_user_addr;
> > -		}
> > -	}
> > -
> > -	return 0;
> > -}
> > -
> > -/**
> > - * Convert guest physical address to host virtual address safely
> > - *
> > - * This variant of rte_vhost_gpa_to_vva() takes care all the
> > - * requested length is mapped and contiguous in process address
> > - * space.
> > - *
> >   * @param mem
> >   *  the guest memory regions
> >   * @param gpa
> > @@ -696,23 +658,6 @@ int rte_vhost_get_mtu(int vid, uint16_t *mtu);
> >   */
> >  int rte_vhost_get_numa_node(int vid);
> >
> > -/**
> > - * @deprecated
> > - * Get the number of queues the device supports.
> > - *
> > - * Note this function is deprecated, as it returns a queue pair number,
> > - * which is vhost specific. Instead, rte_vhost_get_vring_num should
> > - * be used.
> > - *
> > - * @param vid
> > - *  vhost device ID
> > - *
> > - * @return
> > - *  The number of queues, 0 on failure
> > - */
> > -__rte_deprecated
> > -uint32_t rte_vhost_get_queue_num(int vid);
> > -
> >  /**
> >   * Get the number of vrings the device supports.
> >   *
> > diff --git a/lib/vhost/version.map b/lib/vhost/version.map
> > index 18574346d5..7a00b65740 100644
> > --- a/lib/vhost/version.map
> > +++ b/lib/vhost/version.map
> > @@ -41,14 +41,12 @@ DPDK_23 {
> >  	rte_vhost_get_mtu;
> >  	rte_vhost_get_negotiated_features;
> >  	rte_vhost_get_numa_node;
> > -	rte_vhost_get_queue_num;
> >  	rte_vhost_get_vdpa_device;
> >  	rte_vhost_get_vhost_ring_inflight;
> >  	rte_vhost_get_vhost_vring;
> >  	rte_vhost_get_vring_base;
> >  	rte_vhost_get_vring_base_from_inflight;
> >  	rte_vhost_get_vring_num;
> > -	rte_vhost_gpa_to_vva;
> >  	rte_vhost_log_used_vring;
> >  	rte_vhost_log_write;
> >  	rte_vhost_rx_queue_count;
> > diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
> > index aa671f47a3..abf17eb509 100644
> > --- a/lib/vhost/vhost.c
> > +++ b/lib/vhost/vhost.c
> > @@ -859,17 +859,6 @@ rte_vhost_get_numa_node(int vid)
> >  #endif
> >  }
> >
> > -uint32_t
> > -rte_vhost_get_queue_num(int vid)
> > -{
> > -	struct virtio_net *dev = get_device(vid);
> > -
> > -	if (dev == NULL)
> > -		return 0;
> > -
> > -	return dev->nr_vring / 2;
> > -}
> > -
> >  uint16_t
> >  rte_vhost_get_vring_num(int vid)
> >  {
> > --
> > 2.37.3
> 
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

Applied to next-virtio/main, thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-29  8:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 11:36 [PATCH] vhost: remove deprecated helpers David Marchand
2022-09-27 11:51 ` Maxime Coquelin
2022-09-28  4:43 ` Xia, Chenbo
2022-09-29  8:32   ` Xia, Chenbo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).