All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com,
	xiyou.wangcong@gmail.com, dsa@cumulusnetworks.com,
	edumazet@google.com, stephen@networkplumber.org,
	alexander.h.duyck@intel.com, simon.horman@netronome.com,
	mlxsw@mellanox.com, alexei.starovoitov@gmail.com
Subject: Re: [patch net-next v2 10/10] net: sched: add termination action to allow goto chain
Date: Tue, 16 May 2017 06:43:19 +0200	[thread overview]
Message-ID: <20170516044319.GA24493@nanopsycho> (raw)
In-Reply-To: <591A0940.2070801@iogearbox.net>

Mon, May 15, 2017 at 10:02:08PM CEST, daniel@iogearbox.net wrote:
>On 05/15/2017 10:38 AM, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@mellanox.com>
>> 
>> Introduce new type of termination action called "goto_chain". This allows
>> user to specify a chain to be processed. This action type is
>> then processed as a return value in tcf_classify loop in similar
>> way as "reclassify" is, only it does not reset to the first filter
>> in chain but rather reset to the first filter of the desired chain.
>> 
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>[...]
>> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
>> index 1112a2b..98cc689 100644
>> --- a/net/sched/cls_api.c
>> +++ b/net/sched/cls_api.c
>> @@ -304,10 +304,14 @@ int tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp,
>>   			continue;
>> 
>>   		err = tp->classify(skb, tp, res);
>> -		if (unlikely(err == TC_ACT_RECLASSIFY && !compat_mode))
>> +		if (err == TC_ACT_RECLASSIFY && !compat_mode) {
>>   			goto reset;
>> -		if (err >= 0)
>> +		} else if (TC_ACT_EXT_CMP(err, TC_ACT_GOTO_CHAIN)) {
>> +			old_tp = res->goto_tp;
>> +			goto reset;
>> +		} else if (err >= 0) {
>>   			return err;
>> +		}
>
>Given this goto chain feature is pretty much only interesting for hw
>offloads, can we move this further away from the sw fast path to not
>add up to the cost per packet? (I doubt anyone is using TC_ACT_RECLASSIFY
>in sw as well ...)

I don't think so. First of all, the whole thing would be broken then in
sw. It is useful to have it in sw, at least for testing reasons.
So I would leave the unlikely and add it to the second check as well.


>
>>   	}
>> 
>>   	return TC_ACT_UNSPEC; /* signal: continue lookup */
>> 

  reply	other threads:[~2017-05-16  4:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15  8:38 [patch net-next v2 00/10] net: sched: introduce multichain support for filters Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 01/10] net: sched: move tc_classify function to cls_api.c Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 02/10] net: sched: introduce tcf block infractructure Jiri Pirko
2017-05-16 12:07   ` Jamal Hadi Salim
2017-05-16 12:23     ` Jiri Pirko
2017-05-16 12:52       ` Jamal Hadi Salim
2017-05-16 13:10         ` Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 03/10] net: sched: rename tcf_destroy_chain helper Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 04/10] net: sched: replace nprio by a bool to make the function more readable Jiri Pirko
2017-05-16 12:09   ` Jamal Hadi Salim
2017-05-16 12:25     ` Jiri Pirko
2017-05-16 12:56       ` Jamal Hadi Salim
2017-05-15  8:38 ` [patch net-next v2 05/10] net: sched: move TC_H_MAJ macro call into tcf_auto_prio Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 06/10] net: sched: introduce helpers to work with filter chains Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 07/10] net: sched: push chain dump to a separate function Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 08/10] net: sched: introduce multichain support for filters Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 09/10] net: sched: push tp down to action init Jiri Pirko
2017-05-15  8:38 ` [patch net-next v2 10/10] net: sched: add termination action to allow goto chain Jiri Pirko
2017-05-15 20:02   ` Daniel Borkmann
2017-05-16  4:43     ` Jiri Pirko [this message]
2017-05-16  7:59       ` Daniel Borkmann
2017-05-16 12:46         ` Jamal Hadi Salim
2017-05-15  8:41 ` [patch iproute2 v2 1/3] tc_filter: add support for chain index Jiri Pirko
2017-05-15  8:41 ` [patch iproute2 v2 2/3] tc: actions: add helpers to parse and print control actions Jiri Pirko
2017-05-15  8:41 ` [patch iproute2 v2 3/3] tc/actions: introduce support for goto chain action Jiri Pirko
2017-05-16 16:20 ` [patch net-next v2 00/10] net: sched: introduce multichain support for filters David Miller
2017-05-16 16:23   ` Jiri Pirko

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=20170516044319.GA24493@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=alexander.h.duyck@intel.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=simon.horman@netronome.com \
    --cc=stephen@networkplumber.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.