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

This commit is contained in:
fengbojiang 2023-10-20 12:15:55 +08:00
parent 19b67af558
commit 81b0219b09
3 changed files with 12 additions and 0 deletions

View File

@ -153,6 +153,12 @@ 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

@ -1687,6 +1687,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)