netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Zhou <azhou@ovn.org>
To: Pravin Shelar <pshelar@ovn.org>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Joe Stringer <joe@ovn.org>
Subject: Re: [net-next sample action optimization 3/3] openvswitch: Optimize sample action for the clone use cases
Date: Mon, 13 Mar 2017 16:39:08 -0700	[thread overview]
Message-ID: <CABKoBm01ieuSrbhf7yZH9AzZkTNB=kiOAhYTDoinXRtDhQoFoQ@mail.gmail.com> (raw)
In-Reply-To: <CABKoBm14S4QRZCNYqBdfcVXrmvDnf3xrRXbDsBKGsMufdgeXZQ@mail.gmail.com>

>>> -       skb = skb_clone(skb, GFP_ATOMIC);
>>> -       if (!skb)
>>> -               /* Skip the sample action when out of memory. */
>>> -               return 0;
>>> +       if (key) {
>>> +               err = do_execute_actions(dp, skb, key, actions, rem);
>>> +       } else if (!add_deferred_actions(skb, orig, actions, rem)) {
>>>
>> We can refactor this code to avoid duplicate code all actions
>> implementation. This way there could be single function dealing with
>> both defered action and key fifo arrays.
>
> O.K. I will make the change in the next version.

After looking more at it, the sample action and recirc action are different
enough that I don't see clean ways refactor them. For example, recirc
needs to deal with setting recirc_id.  recirc calls
ovs_dp_process_packet, and sample calls do_execute_action.

>> I am not sure if we can put sample or recirc in "may not change flow"
>> actions list. Consider following set of actions:
>> sample(sample(set-IP)),userpsace(),...
>> In this case the userspace action could recieve skb with inconsistent
>> flow due to preceding of set action nested in the sample action.
>
> Good catch.  Will fix.

What's the objection on recirc action? It always works on clone key.

  reply	other threads:[~2017-03-13 23:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-11  0:51 [net-next sample action optimization 0/3] Andy Zhou
2017-03-11  0:51 ` [net-next sample action optimization 1/3] openvswitch: Deferred fifo API change Andy Zhou
2017-03-11  0:51 ` [net-next sample action optimization 2/3] openvswitch: Refactor recirc key allocation Andy Zhou
2017-03-13 20:32   ` Joe Stringer
2017-03-11  0:51 ` [net-next sample action optimization 3/3] openvswitch: Optimize sample action for the clone use cases Andy Zhou
2017-03-13  7:08   ` Pravin Shelar
2017-03-13 20:14     ` Andy Zhou
2017-03-13 23:39       ` Andy Zhou [this message]
2017-03-14  6:20         ` Pravin Shelar
2017-03-14 23:11           ` Andy Zhou
2017-03-14  5:57       ` Pravin Shelar

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='CABKoBm01ieuSrbhf7yZH9AzZkTNB=kiOAhYTDoinXRtDhQoFoQ@mail.gmail.com' \
    --to=azhou@ovn.org \
    --cc=joe@ovn.org \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@ovn.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).