[v2,2/6] power: make channel msg functions public
Checks
Commit Message
From: Bruce Richardson <bruce.richardson@intel.com>
Move the 2 public functions into rte_power_guest_channel.h
Fixes: 210c383e247b ("power: packet format for vm power management")
Fixes: cd0d5547e873 ("power: vm communication channels in guest")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
---
lib/librte_power/guest_channel.h | 40 +---------------------
lib/librte_power/rte_power_guest_channel.h | 40 ++++++++++++++++++++++
2 files changed, 41 insertions(+), 39 deletions(-)
Comments
08/01/2021 15:30, David Hunt:
> From: Bruce Richardson <bruce.richardson@intel.com>
>
> Move the 2 public functions into rte_power_guest_channel.h
[...]
> +/**
> + * Send a message contained in pkt over the Virtio-Serial to the host endpoint.
> + *
> + * @param pkt
> + * Pointer to a populated struct channel_packet
> + *
> + * @param lcore_id
> + * lcore_id.
> + *
> + * @return
> + * - 0 on success.
> + * - Negative on error.
> + */
> +int rte_power_guest_channel_send_msg(struct channel_packet *pkt,
> + unsigned int lcore_id);
> +
> +/**
> + * Receive a message contained in pkt over the Virtio-Serial
> + * from the host endpoint.
> + *
> + * @param pkt
> + * Pointer to channel_packet or
> + * channel_packet_freq_list struct.
> + *
> + * @param pkt_len
> + * Size of expected data packet.
> + *
> + * @param lcore_id
> + * lcore_id.
> + *
> + * @return
> + * - 0 on success.
> + * - Negative on error.
> + */
> +__rte_experimental
> +int
> +rte_power_guest_channel_receive_msg(void *pkt,
> + size_t pkt_len,
> + unsigned int lcore_id);
Why only the second one is experimental?
Given the uncertainty of this API, I think it should be all experimental.
On 19/1/2021 2:31 PM, Thomas Monjalon wrote:
> 08/01/2021 15:30, David Hunt:
>> From: Bruce Richardson <bruce.richardson@intel.com>
>>
>> Move the 2 public functions into rte_power_guest_channel.h
> [...]
>> +/**
>> + * Send a message contained in pkt over the Virtio-Serial to the host endpoint.
>> + *
>> + * @param pkt
>> + * Pointer to a populated struct channel_packet
>> + *
>> + * @param lcore_id
>> + * lcore_id.
>> + *
>> + * @return
>> + * - 0 on success.
>> + * - Negative on error.
>> + */
>> +int rte_power_guest_channel_send_msg(struct channel_packet *pkt,
>> + unsigned int lcore_id);
>> +
>> +/**
>> + * Receive a message contained in pkt over the Virtio-Serial
>> + * from the host endpoint.
>> + *
>> + * @param pkt
>> + * Pointer to channel_packet or
>> + * channel_packet_freq_list struct.
>> + *
>> + * @param pkt_len
>> + * Size of expected data packet.
>> + *
>> + * @param lcore_id
>> + * lcore_id.
>> + *
>> + * @return
>> + * - 0 on success.
>> + * - Negative on error.
>> + */
>> +__rte_experimental
>> +int
>> +rte_power_guest_channel_receive_msg(void *pkt,
>> + size_t pkt_len,
>> + unsigned int lcore_id);
> Why only the second one is experimental?
>
> Given the uncertainty of this API, I think it should be all experimental.
>
Yes Thomas, both should be experimental. I'll fix that in the next version.
Thanks,
Dave.
@@ -65,21 +65,7 @@ void guest_channel_host_disconnect(unsigned int lcore_id);
*/
int guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id);
-/**
- * Send a message contained in pkt over the Virtio-Serial to the host endpoint.
- *
- * @param pkt
- * Pointer to a populated struct channel_packet
- *
- * @param lcore_id
- * lcore_id.
- *
- * @return
- * - 0 on success.
- * - Negative on error.
- */
-int rte_power_guest_channel_send_msg(struct channel_packet *pkt,
- unsigned int lcore_id);
+
/**
* Read a message contained in pkt over the Virtio-Serial
@@ -103,30 +89,6 @@ int power_guest_channel_read_msg(void *pkt,
size_t pkt_len,
unsigned int lcore_id);
-/**
- * Receive a message contained in pkt over the Virtio-Serial
- * from the host endpoint.
- *
- * @param pkt
- * Pointer to channel_packet or
- * channel_packet_freq_list struct.
- *
- * @param pkt_len
- * Size of expected data packet.
- *
- * @param lcore_id
- * lcore_id.
- *
- * @return
- * - 0 on success.
- * - Negative on error.
- */
-__rte_experimental
-int
-rte_power_guest_channel_receive_msg(void *pkt,
- size_t pkt_len,
- unsigned int lcore_id);
-
#ifdef __cplusplus
}
@@ -116,6 +116,46 @@ struct channel_packet_caps_list {
uint8_t num_vcpu;
};
+/**
+ * Send a message contained in pkt over the Virtio-Serial to the host endpoint.
+ *
+ * @param pkt
+ * Pointer to a populated struct channel_packet
+ *
+ * @param lcore_id
+ * lcore_id.
+ *
+ * @return
+ * - 0 on success.
+ * - Negative on error.
+ */
+int rte_power_guest_channel_send_msg(struct channel_packet *pkt,
+ unsigned int lcore_id);
+
+/**
+ * Receive a message contained in pkt over the Virtio-Serial
+ * from the host endpoint.
+ *
+ * @param pkt
+ * Pointer to channel_packet or
+ * channel_packet_freq_list struct.
+ *
+ * @param pkt_len
+ * Size of expected data packet.
+ *
+ * @param lcore_id
+ * lcore_id.
+ *
+ * @return
+ * - 0 on success.
+ * - Negative on error.
+ */
+__rte_experimental
+int
+rte_power_guest_channel_receive_msg(void *pkt,
+ size_t pkt_len,
+ unsigned int lcore_id);
+
#ifdef __cplusplus
}