Add an API `ff_get_traffic` to get traffic for QoS or other.

This commit is contained in:
fengbojiang 2023-10-20 11:51:22 +08:00
parent a26eb8eb00
commit 1c44a070ea
3 changed files with 11 additions and 0 deletions

View File

@ -154,6 +154,11 @@ extern int ff_fdisused(int fd);
extern int ff_getmaxfd(void);
/* Get traffic for QoS or other via API.
* The size of buffer must >= siezof(struct ff_traffic_args), now is 32 bytes.
*/
void ff_get_traffic(void *buffer);
/* route api begin */
enum FF_ROUTE_CTL {
FF_ROUTE_ADD,

View File

@ -57,3 +57,4 @@ ff_mbuf_set_vlan_info
ff_zc_mbuf_get
ff_zc_mbuf_write
ff_zc_mbuf_read
ff_get_traffic

View File

@ -1704,6 +1704,11 @@ handle_traffic_msg(struct ff_msg *msg)
msg->result = 0;
}
void ff_get_traffic(void *buffer)
{
*(struct ff_traffic_args *)buffer = ff_traffic;
}
#ifdef FF_KNI
static inline void
handle_knictl_msg(struct ff_msg *msg)