[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <85vat7182p.fsf@mojatatu.com>
Date: Sun, 22 Jan 2017 09:29:50 -0500
From: Roman Mashak <mrv@...atatu.com>
To: Jiri Pirko <jiri@...nulli.us>
Cc: netdev@...r.kernel.org, davem@...emloft.net, yotamg@...lanox.com,
idosch@...lanox.com, eladr@...lanox.com, nogahf@...lanox.com,
ogerlitz@...lanox.com, jhs@...atatu.com, geert+renesas@...der.be,
stephen@...workplumber.org, xiyou.wangcong@...il.com,
linux@...ck-us.net, roopa@...ulusnetworks.com,
john.fastabend@...il.com, simon.horman@...ronome.com
Subject: Re: [patch net-next 2/4] net/sched: Introduce sample tc action
Jiri Pirko <jiri@...nulli.us> writes:
> From: Yotam Gigi <yotamg@...lanox.com>
>
> This action allows the user to sample traffic matched by tc classifier.
> The sampling consists of choosing packets randomly and sampling them using
> the psample module. The user can configure the psample group number, the
> sampling rate and the packet's truncation (to save kernel-user traffic).
>
[skip]
> diff --git a/include/uapi/linux/tc_act/tc_sample.h b/include/uapi/linux/tc_act/tc_sample.h
> new file mode 100644
> index 0000000..21378bc
> --- /dev/null
> +++ b/include/uapi/linux/tc_act/tc_sample.h
> @@ -0,0 +1,26 @@
> +#ifndef __LINUX_TC_SAMPLE_H
> +#define __LINUX_TC_SAMPLE_H
> +
> +#include <linux/types.h>
> +#include <linux/pkt_cls.h>
> +#include <linux/if_ether.h>
> +
> +#define TCA_ACT_SAMPLE 26
> +
> +struct tc_sample {
> + tc_gen;
> +};
> +
> +enum {
> + TCA_SAMPLE_UNSPEC,
> + TCA_SAMPLE_PARMS,
> + TCA_SAMPLE_TM,
> + TCA_SAMPLE_RATE,
> + TCA_SAMPLE_TRUNC_SIZE,
> + TCA_SAMPLE_PSAMPLE_GROUP,
> + TCA_SAMPLE_PAD,
> + __TCA_SAMPLE_MAX
> +};
Most of action implementations define TCA_X_TM attribute as 1,
and TCA_X_PARMS as 2 followed by action specific tlvs, it is better to
adhere this style in newly designed actions.
[skip]
--
Roman Mashak
Powered by blists - more mailing lists