Skip to contentSkip to conversation

vhost: add doxygen comment to vDPA header

PATCH Superseded Xiaolong Ye 3 participants 4 messages Oct 10, 2018 – Oct 11, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: add doxygen comment to vDPA header

As APIs in rte_vdpa.h are public, we need to add doxygen comments to all APIs and structures.

---
 doc/api/doxy-api-index.md   |  1 +
 lib/librte_vhost/rte_vdpa.h | 54 +++++++++++++++++++++++++++++++++----
 2 files changed, 50 insertions(+), 5 deletions(-)
doc/api/doxy-api-index.md +1 -0
index 9584ccb4c..a3039d168 100644
@@ -37,6 +37,7 @@ The public API headers are grouped by topics:
   [softnic]            (@ref rte_eth_softnic.h),
   [bond]               (@ref rte_eth_bond.h),
   [vhost]              (@ref rte_vhost.h),
+  [vdpa]               (@ref rte_vdpa.h),
   [KNI]                (@ref rte_kni.h),
   [ixgbe]              (@ref rte_pmd_ixgbe.h),
   [i40e]               (@ref rte_pmd_i40e.h),
lib/librte_vhost/rte_vdpa.h +49 -5

90 lines not on this page · raw message

Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Xiaolong Ye

As APIs in rte_vdpa.h are public, we need to add doxygen comments to all APIs and structures.

---
  doc/api/doxy-api-index.md   |  1 +
  lib/librte_vhost/rte_vdpa.h | 54 +++++++++++++++++++++++++++++++++----
  2 files changed, 50 insertions(+), 5 deletions(-)

Looks good to me:

Thanks,
Maxime

#2 lore raw
In reply to Xiaolong Ye
Quoted 4 lines · Xiaolong Ye

As APIs in rte_vdpa.h are public, we need to add doxygen comments to all APIs and structures.

<...>

lib/librte_vhost/rte_vdpa.h struct rte_vdpa_dev_addr { · line 40

Quoted 10 lines
lib/librte_vhost/rte_vdpa.h +3 -0
@@ -29,6 +32,9 @@ struct rte_vdpa_dev_addr {
 	};
 };
 
+/**
+ * vdpa device operations
+ */
 struct rte_vdpa_dev_ops {
 	/* Get capabilities of this device */
 	int (*get_queue_num)(int did, uint32_t *queue_num);

Can you please document all fields of the structs?
This is part of public API and needs to be documented properly, if possible more detail on struct documentation will be good.

<...>

Quoted 4 lines
lib/librte_vhost/rte_vdpa.h +3 -1
-/* Register a vdpa device, return did if successful, -1 on failure */
+/**
+ * Register a vdpa device
+ *

lib/librte_vhost/rte_vdpa.h struct rte_vdpa_dev_ops { · line 91

Quoted 10 lines
lib/librte_vhost/rte_vdpa.h +7 -0
+ * @param addr
+ *  the vdpa device address
+ * @parm ops
+ *  the vdpa device operations
+ * @return
+ *  device id on success, -1 on failure
+ */
 int __rte_experimental
 rte_vdpa_register_device(struct rte_vdpa_dev_addr *addr,
 		struct rte_vdpa_dev_ops *ops);

For experimental APIs we tend to add following into function comment:
* @warning
* @b EXPERIMENTAL: this API may change without prior notice

Please check lib/librte_member/rte_member.h for samples.

#3 lore raw
Quoted 12 lines · Ferruh Yigit
Quoted 4 lines · Xiaolong Ye

As APIs in rte_vdpa.h are public, we need to add doxygen comments to all APIs and structures.

<...>

Quoted 4 lines
(quoted diff) +0 -0
@@ -29,6 +32,9 @@ struct rte_vdpa_dev_addr {
 	};
 };
 
Quoted 11 lines

lib/librte_vhost/rte_vdpa.h struct rte_vdpa_dev_addr { · line 40

Quoted 6 lines
lib/librte_vhost/rte_vdpa.h +3 -0
+/**
+ * vdpa device operations
+ */
 struct rte_vdpa_dev_ops {
 	/* Get capabilities of this device */
 	int (*get_queue_num)(int did, uint32_t *queue_num);

Can you please document all fields of the structs?
This is part of public API and needs to be documented properly, if possible more detail on struct documentation will be good.

Got it, I'll add more descriptions.

Quoted 21 lines

<...>

Quoted 4 lines
lib/librte_vhost/rte_vdpa.h +3 -1
-/* Register a vdpa device, return did if successful, -1 on failure */
+/**
+ * Register a vdpa device
+ *

lib/librte_vhost/rte_vdpa.h struct rte_vdpa_dev_ops { · line 91

Quoted 10 lines
lib/librte_vhost/rte_vdpa.h +7 -0
+ * @param addr
+ *  the vdpa device address
+ * @parm ops
+ *  the vdpa device operations
+ * @return
+ *  device id on success, -1 on failure
+ */
 int __rte_experimental
 rte_vdpa_register_device(struct rte_vdpa_dev_addr *addr,
 		struct rte_vdpa_dev_ops *ops);

For experimental APIs we tend to add following into function comment:
* @warning
* @b EXPERIMENTAL: this API may change without prior notice

Quoted 1 line

Please check lib/librte_member/rte_member.h for samples.

Got it.

Thanks,
Xiaolong