Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5859034d authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NETFILTER]: x_tables: add RATEEST target



Add new rate estimator target (using gen_estimator). In combination with
the rateest match (next patch) this can be used for load-based multipath
routing.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cb76c6a5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ header-y += xt_DSCP.h
header-y += xt_MARK.h
header-y += xt_NFLOG.h
header-y += xt_NFQUEUE.h
header-y += xt_RATEEST.h
header-y += xt_SECMARK.h
header-y += xt_TCPMSS.h
header-y += xt_comment.h
+11 −0
Original line number Diff line number Diff line
#ifndef _XT_RATEEST_TARGET_H
#define _XT_RATEEST_TARGET_H

struct xt_rateest_target_info {
	char			name[IFNAMSIZ];
	int8_t			interval;
	u_int8_t		ewma_log;
	struct xt_rateest	*est __attribute__((aligned(8)));
};

#endif /* _XT_RATEEST_TARGET_H */
+17 −0
Original line number Diff line number Diff line
#ifndef _XT_RATEEST_H
#define _XT_RATEEST_H

struct xt_rateest {
	struct hlist_node		list;
	char				name[IFNAMSIZ];
	unsigned int			refcnt;
	spinlock_t			lock;
	struct gnet_estimator		params;
	struct gnet_stats_rate_est	rstats;
	struct gnet_stats_basic		bstats;
};

extern struct xt_rateest *xt_rateest_lookup(const char *name);
extern void xt_rateest_put(struct xt_rateest *est);

#endif /* _XT_RATEEST_H */
+10 −0
Original line number Diff line number Diff line
@@ -357,6 +357,16 @@ config NETFILTER_XT_TARGET_NOTRACK
	  If you want to compile it as a module, say M here and read
	  <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.

config NETFILTER_XT_TARGET_RATEEST
	tristate '"RATEEST" target support'
	depends on NETFILTER_XTABLES
	help
	  This option adds a `RATEEST' target, which allows to measure
	  rates similar to TC estimators. The `rateest' match can be
	  used to match on the measured rates.

	  To compile it as a module, choose M here.  If unsure, say N.

config NETFILTER_XT_TARGET_TRACE
	tristate  '"TRACE" target support'
	depends on NETFILTER_XTABLES
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_MARK) += xt_MARK.o
obj-$(CONFIG_NETFILTER_XT_TARGET_NFLOG) += xt_NFLOG.o
obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o
obj-$(CONFIG_NETFILTER_XT_TARGET_NOTRACK) += xt_NOTRACK.o
obj-$(CONFIG_NETFILTER_XT_TARGET_RATEEST) += xt_RATEEST.o
obj-$(CONFIG_NETFILTER_XT_TARGET_SECMARK) += xt_SECMARK.o
obj-$(CONFIG_NETFILTER_XT_TARGET_TCPMSS) += xt_TCPMSS.o
obj-$(CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP) += xt_TCPOPTSTRIP.o
Loading