Skip to content

Commit

Permalink
power: make channel message functions public
Browse files Browse the repository at this point in the history
[ upstream commit 4d3892d ]

Move the 2 public functions into rte_power_guest_channel.h

Fixes: 210c383 ("power: packet format for vm power management")
Fixes: cd0d554 ("power: vm communication channels in guest")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  • Loading branch information
bruce-richardson authored and bluca committed Feb 4, 2021
1 parent 74d0a5d commit 0823ac5
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 40 deletions.
40 changes: 0 additions & 40 deletions lib/librte_power/guest_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,6 @@ 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
* from the host endpoint.
Expand All @@ -103,30 +87,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
}
Expand Down
50 changes: 50 additions & 0 deletions lib/librte_power/rte_power_guest_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,56 @@ struct channel_packet_caps_list {
uint8_t num_vcpu;
};

/**
* @internal
*
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
*
* 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
* Use channel specific to this lcore_id.
*
* @return
* - 0 on success.
* - Negative on error.
*/
__rte_experimental
int rte_power_guest_channel_send_msg(struct channel_packet *pkt,
unsigned int lcore_id);

/**
* @internal
*
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
*
* 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
* Use channel specific to this 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
}
Expand Down
4 changes: 4 additions & 0 deletions lib/librte_power/version.map
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ EXPERIMENTAL {
rte_power_guest_channel_receive_msg;
rte_power_poll_stat_fetch;
rte_power_poll_stat_update;

# added in 21.02
rte_power_guest_channel_receive_msg;
rte_power_guest_channel_send_msg;
};

0 comments on commit 0823ac5

Please sign in to comment.