linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Stringer <joestringer@nicira.com>
To: Pravin Shelar <pshelar@nicira.com>
Cc: netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>, pablo <pablo@netfilter.org>,
	Florian Westphal <fwestpha@redhat.com>,
	Hannes Sowa <hannes@redhat.com>, Thomas Graf <tgraf@suug.ch>,
	Justin Pettit <jpettit@nicira.com>,
	Jesse Gross <jesse@nicira.com>
Subject: Re: [PATCHv4 net-next 09/10] openvswitch: Allow matching on conntrack label
Date: Thu, 20 Aug 2015 12:13:59 -0700	[thread overview]
Message-ID: <CANr6G5xYJaEYsS9u9YZmz=mxEoknHiCp1FxWVtS69YCEbrfYSA@mail.gmail.com> (raw)
In-Reply-To: <CALnjE+qRcS861657sOL8oXU=VsnyiSH4XsO+oukmxoa38NVa-A@mail.gmail.com>

On 20 August 2015 at 08:45, Pravin Shelar <pshelar@nicira.com> wrote:
> On Wed, Aug 19, 2015 at 4:04 PM, Joe Stringer <joestringer@nicira.com> wrote:
>> Thanks for the review,
>>
>> On 19 August 2015 at 14:24, Pravin Shelar <pshelar@nicira.com> wrote:
>>> On Tue, Aug 18, 2015 at 4:39 PM, Joe Stringer <joestringer@nicira.com> wrote:
>>>> Allow matching and setting the conntrack label field. As with ct_mark,
>>>> this is populated by executing the CT action, and is a writable field.
>>>> Specifying a label and optional mask allows the label to be modified,
>>>> which takes effect on the entry found by the lookup of the CT action.
>>>>
>>>> E.g.: actions:ct(zone=1,label=1)
>>>>
>>>> This will perform conntrack lookup in zone 1, then modify the label for
>>>> that entry. The conntrack entry itself must be committed using the
>>>> "commit" flag in the conntrack action flags for this change to persist.
>>>>
>
>>
>>>>         return false;
>>>>  }
>>>> @@ -508,8 +601,12 @@ void ovs_ct_free_action(const struct nlattr *a)
>>>>
>>>>  void ovs_ct_init(struct net *net, struct ovs_ct_perdp_data *data)
>>>>  {
>>>> +       unsigned int n_bits = sizeof(struct ovs_key_ct_label) * BITS_PER_BYTE;
>>>> +
>>>>         data->xt_v4 = !nf_ct_l3proto_try_module_get(PF_INET);
>>>>         data->xt_v6 = !nf_ct_l3proto_try_module_get(PF_INET6);
>>>> +       if (nf_connlabels_get(net, n_bits);
>>>> +               OVS_NLERR(true, "Failed to set connlabel length");
>>>>  }
>>>>
>>> In case of error should we reject conntrack label actions? Otherwise
>>> user will never see any error. But action could drop packets.
>>
>> I suspect that currently errors would be seen from ovs_ct_set_label():
>>
>>>.......if (!cl || cl->words * sizeof(long) < OVS_CT_LABEL_LEN)
>>>.......>.......return -ENOSPC;
>>
>> So, for cmd_execute, userspace would see this. For regular handling,
>> pipeline processing would stop (so, drop).
>>
>> However, I agree it would be more friendly to have the attribute
>> rejected up-front. Just means we'll pass the datapath all the way
>> down:
>> ovs_nla_get_match()
>> --> ovs_key_from_nlattrs()
>> --> metadata_from_nlattrs()
>> --> ovs_ct_verify()

Incidentally, we generally don't have the datapath by this point
(ovs_nla_get_match()). There'd need to be a bit of rearranging in the
ovs_flow_cmd_* functions, which would include holding the locks for
longer. Given that the two most common cases are that either A) The
kernel is configured with connlabel support, and built with support
for at least 128 bits of label, or B) the kernel is configured without
connlabel, and this is handled already in ovs_ct_verify(), I don't
think it's worth making this particular change.

  reply	other threads:[~2015-08-20 19:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18 23:39 [PATCHv4 net-next 00/10] OVS conntrack support Joe Stringer
2015-08-18 23:39 ` [PATCHv4 net-next 01/10] openvswitch: Serialize acts with original netlink len Joe Stringer
2015-08-18 23:39 ` [PATCHv4 net-next 02/10] openvswitch: Move MASKED* macros to datapath.h Joe Stringer
2015-08-18 23:39 ` [PATCHv4 net-next 03/10] ipv6: Export nf_ct_frag6_gather() Joe Stringer
2015-08-18 23:39 ` [PATCHv4 net-next 04/10] dst: Add __skb_dst_copy() variation Joe Stringer
2015-08-18 23:39 ` [PATCHv4 net-next 05/10] openvswitch: Add conntrack action Joe Stringer
2015-08-19 20:30   ` Pravin Shelar
2015-08-20 16:21   ` Thomas Graf
2015-08-18 23:39 ` [PATCHv4 net-next 06/10] openvswitch: Allow matching on conntrack mark Joe Stringer
2015-08-19 20:47   ` Pravin Shelar
2015-08-21  0:41     ` Joe Stringer
2015-08-18 23:39 ` [PATCHv4 net-next 07/10] netfilter: Always export nf_connlabels_replace() Joe Stringer
2015-08-19 20:47   ` Pravin Shelar
2015-08-20 16:22   ` Thomas Graf
2015-08-18 23:39 ` [PATCHv4 net-next 08/10] netfilter: connlabels: Export setting connlabel length Joe Stringer
2015-08-19 20:48   ` Pravin Shelar
2015-08-20 16:23   ` Thomas Graf
2015-08-18 23:39 ` [PATCHv4 net-next 09/10] openvswitch: Allow matching on conntrack label Joe Stringer
2015-08-19 21:24   ` Pravin Shelar
2015-08-19 23:04     ` Joe Stringer
2015-08-20 15:45       ` Pravin Shelar
2015-08-20 19:13         ` Joe Stringer [this message]
2015-08-20 21:01           ` Pravin Shelar
2015-08-21  0:40             ` Joe Stringer
2015-08-18 23:39 ` [PATCHv4 net-next 10/10] openvswitch: Allow attaching helpers to ct action Joe Stringer
2015-08-19 22:57   ` Pravin Shelar
2015-08-21  0:47     ` Joe Stringer
2015-08-21 17:39       ` 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='CANr6G5xYJaEYsS9u9YZmz=mxEoknHiCp1FxWVtS69YCEbrfYSA@mail.gmail.com' \
    --to=joestringer@nicira.com \
    --cc=fwestpha@redhat.com \
    --cc=hannes@redhat.com \
    --cc=jesse@nicira.com \
    --cc=jpettit@nicira.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=pshelar@nicira.com \
    --cc=tgraf@suug.ch \
    /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).