public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Roman Mashak <mrv@mojatatu•com>
To: Jiri Pirko <jiri@resnulli•us>
Cc: netdev@vger•kernel.org, davem@davemloft•net, yotamg@mellanox•com,
	idosch@mellanox•com, eladr@mellanox•com, nogahf@mellanox•com,
	ogerlitz@mellanox•com, jhs@mojatatu•com, geert+renesas@glider•be,
	stephen@networkplumber•org, xiyou.wangcong@gmail•com,
	linux@roeck-us•net, roopa@cumulusnetworks•com,
	john.fastabend@gmail•com, simon.horman@netronome•com
Subject: Re: [patch net-next 2/4] net/sched: Introduce sample tc action
Date: Sun, 22 Jan 2017 09:29:50 -0500	[thread overview]
Message-ID: <85vat7182p.fsf@mojatatu.com> (raw)
In-Reply-To: <1485085487-2652-3-git-send-email-jiri@resnulli.us> (Jiri Pirko's message of "Sun, 22 Jan 2017 12:44:45 +0100")

Jiri Pirko <jiri@resnulli•us> writes:

> From: Yotam Gigi <yotamg@mellanox•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

  parent reply	other threads:[~2017-01-22 14:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-22 11:44 [patch net-next 0/4] Add support for offloading packet-sampling Jiri Pirko
2017-01-22 11:44 ` [patch net-next 1/4] net: Introduce psample, a new genetlink channel for packet sampling Jiri Pirko
2017-01-22 13:19   ` Jamal Hadi Salim
2017-01-23 23:57   ` Stephen Hemminger
2017-01-24  6:48     ` Jiri Pirko
2017-01-22 11:44 ` [patch net-next 2/4] net/sched: Introduce sample tc action Jiri Pirko
2017-01-22 13:16   ` Jamal Hadi Salim
2017-01-22 13:28     ` Yotam Gigi
2017-01-22 14:29   ` Roman Mashak [this message]
2017-01-22 11:44 ` [patch net-next 3/4] mlxsw: reg: add the Monitoring Packet Sampling Configuration Register Jiri Pirko
2017-01-22 11:44 ` [patch net-next 4/4] mlxsw: spectrum: Add packet sample offloading support Jiri Pirko
2017-01-22 12:04   ` Ido Schimmel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85vat7182p.fsf@mojatatu.com \
    --to=mrv@mojatatu$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eladr@mellanox$(echo .)com \
    --cc=geert+renesas@glider$(echo .)be \
    --cc=idosch@mellanox$(echo .)com \
    --cc=jhs@mojatatu$(echo .)com \
    --cc=jiri@resnulli$(echo .)us \
    --cc=john.fastabend@gmail$(echo .)com \
    --cc=linux@roeck-us$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nogahf@mellanox$(echo .)com \
    --cc=ogerlitz@mellanox$(echo .)com \
    --cc=roopa@cumulusnetworks$(echo .)com \
    --cc=simon.horman@netronome$(echo .)com \
    --cc=stephen@networkplumber$(echo .)org \
    --cc=xiyou.wangcong@gmail$(echo .)com \
    --cc=yotamg@mellanox$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox