- Gather statistics about failed mbuf+cluster+ng_item allocations.
- Adjust comments and variables names in nfinfo.
This commit is contained in:
parent
77bcc9ce35
commit
35fd572dcb
@ -204,8 +204,7 @@ expire_flow(priv_p priv, item_p *item, struct flow_entry *fle)
|
||||
if (*item == NULL)
|
||||
*item = get_export_dgram(priv);
|
||||
if (*item == NULL) {
|
||||
/* XXX: do stats! */
|
||||
log(LOG_DEBUG, "get_export_dgram failed\n");
|
||||
atomic_add_32(&priv->info.nfinfo_export_failed, 1);
|
||||
uma_zfree_arg(priv->zone, fle, priv);
|
||||
return;
|
||||
}
|
||||
@ -259,7 +258,7 @@ hash_insert(priv_p priv, struct flow_hash_entry *hsh, struct flow_rec *r,
|
||||
|
||||
fle = uma_zalloc_arg(priv->zone, priv, M_NOWAIT);
|
||||
if (fle == NULL) {
|
||||
atomic_add_32(&priv->info.nfinfo_failed, 1);
|
||||
atomic_add_32(&priv->info.nfinfo_alloc_failed, 1);
|
||||
return (ENOMEM);
|
||||
}
|
||||
|
||||
|
@ -54,14 +54,15 @@ enum {
|
||||
|
||||
/* This structure is returned by the NGM_NETFLOW_INFO message */
|
||||
struct ng_netflow_info {
|
||||
uint64_t nfinfo_bytes; /* total number of accounted bytes */
|
||||
uint32_t nfinfo_packets; /* total number of accounted packets */
|
||||
uint32_t nfinfo_used; /* number of used cache records */
|
||||
uint32_t nfinfo_failed; /* number of failed allocations */
|
||||
uint32_t nfinfo_act_exp;
|
||||
uint32_t nfinfo_inact_exp;
|
||||
uint32_t nfinfo_inact_t; /* flow inactive timeout */
|
||||
uint32_t nfinfo_act_t; /* flow active timeout */
|
||||
uint64_t nfinfo_bytes; /* accounted bytes */
|
||||
uint32_t nfinfo_packets; /* accounted packets */
|
||||
uint32_t nfinfo_used; /* used cache records */
|
||||
uint32_t nfinfo_alloc_failed; /* failed allocations */
|
||||
uint32_t nfinfo_export_failed; /* failed exports */
|
||||
uint32_t nfinfo_act_exp; /* active expiries */
|
||||
uint32_t nfinfo_inact_exp; /* inactive expiries */
|
||||
uint32_t nfinfo_inact_t; /* flow inactive timeout */
|
||||
uint32_t nfinfo_act_t; /* flow active timeout */
|
||||
};
|
||||
|
||||
/* This structure is returned by the NGM_NETFLOW_IFINFO message */
|
||||
@ -168,6 +169,7 @@ struct flow_entry {
|
||||
{ "Packets", &ng_parse_uint32_type }, \
|
||||
{ "Records used", &ng_parse_uint32_type },\
|
||||
{ "Failed allocations", &ng_parse_uint32_type },\
|
||||
{ "Failed exports", &ng_parse_uint32_type },\
|
||||
{ "Active expiries", &ng_parse_uint32_type },\
|
||||
{ "Inactive expiries", &ng_parse_uint32_type },\
|
||||
{ "Inactive timeout", &ng_parse_uint32_type },\
|
||||
|
Loading…
Reference in New Issue
Block a user