Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
gen_estimator.c File Reference
#include <asm/uaccess.h>
#include <linux/bitops.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/jiffies.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/in.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/rtnetlink.h>
#include <linux/init.h>
#include <linux/rbtree.h>
#include <linux/slab.h>
#include <net/sock.h>
#include <net/gen_stats.h>

Go to the source code of this file.

Data Structures

struct  gen_estimator
 
struct  gen_estimator_head
 

Macros

#define EST_MAX_INTERVAL   5
 

Functions

int gen_new_estimator (struct gnet_stats_basic_packed *bstats, struct gnet_stats_rate_est *rate_est, spinlock_t *stats_lock, struct nlattr *opt)
 
 EXPORT_SYMBOL (gen_new_estimator)
 
void gen_kill_estimator (struct gnet_stats_basic_packed *bstats, struct gnet_stats_rate_est *rate_est)
 
 EXPORT_SYMBOL (gen_kill_estimator)
 
int gen_replace_estimator (struct gnet_stats_basic_packed *bstats, struct gnet_stats_rate_est *rate_est, spinlock_t *stats_lock, struct nlattr *opt)
 
 EXPORT_SYMBOL (gen_replace_estimator)
 
bool gen_estimator_active (const struct gnet_stats_basic_packed *bstats, const struct gnet_stats_rate_est *rate_est)
 
 EXPORT_SYMBOL (gen_estimator_active)
 

Macro Definition Documentation

#define EST_MAX_INTERVAL   5

Definition at line 79 of file gen_estimator.c.

Function Documentation

EXPORT_SYMBOL ( gen_new_estimator  )
EXPORT_SYMBOL ( gen_kill_estimator  )
EXPORT_SYMBOL ( gen_replace_estimator  )
EXPORT_SYMBOL ( gen_estimator_active  )
bool gen_estimator_active ( const struct gnet_stats_basic_packed bstats,
const struct gnet_stats_rate_est rate_est 
)

gen_estimator_active - test if estimator is currently in use : basic statistics : rate estimator statistics

Returns true if estimator is active, and false if not.

Definition at line 308 of file gen_estimator.c.

void gen_kill_estimator ( struct gnet_stats_basic_packed bstats,
struct gnet_stats_rate_est rate_est 
)

gen_kill_estimator - remove a rate estimator : basic statistics : rate estimator statistics

Removes the rate estimator specified by &bstats and &rate_est.

Note : Caller should respect an RCU grace period before freeing stats_lock

Definition at line 260 of file gen_estimator.c.

int gen_new_estimator ( struct gnet_stats_basic_packed bstats,
struct gnet_stats_rate_est rate_est,
spinlock_t stats_lock,
struct nlattr opt 
)

gen_new_estimator - create a new rate estimator : basic statistics : rate estimator statistics : statistics lock : rate estimator configuration TLV

Creates a new rate estimator with &bstats as source and &rate_est as destination. A new timer with the interval specified in the configuration TLV is created. Upon each interval, the latest statistics will be read from &bstats and the estimated rate will be stored in &rate_est with the statistics lock grabed during this period.

Returns 0 on success or a negative error code.

Definition at line 205 of file gen_estimator.c.

int gen_replace_estimator ( struct gnet_stats_basic_packed bstats,
struct gnet_stats_rate_est rate_est,
spinlock_t stats_lock,
struct nlattr opt 
)

gen_replace_estimator - replace rate estimator configuration : basic statistics : rate estimator statistics : statistics lock : rate estimator configuration TLV

Replaces the configuration of a rate estimator by calling gen_kill_estimator() and gen_new_estimator().

Returns 0 on success or a negative error code.

Definition at line 292 of file gen_estimator.c.