[ovs-dev] [PATCH] datapath: add skb mark matching and set action

Ansis Atteka aatteka at nicira.com
Thu Nov 15 17:02:39 UTC 2012


On Wed, Nov 14, 2012 at 1:48 AM, Jesse Gross <jesse at nicira.com> wrote:
> On Tue, Nov 13, 2012 at 9:52 AM, Ansis Atteka <aatteka at nicira.com> wrote:
>>
>> diff --git a/datapath/actions.c b/datapath/actions.c
>> index 76c9823..5da4b74 100644
>> --- a/datapath/actions.c
>> +++ b/datapath/actions.c
>> @@ -435,6 +435,10 @@ static int execute_set_action(struct sk_buff *skb,
>>                 skb->priority = nla_get_u32(nested_attr);
>>                 break;
>>
>> +       case OVS_KEY_ATTR_SKB_MARK:
>> +               skb->mark = nla_get_u32(nested_attr);
>
>
> One other thing that I forgot - skb->mark used to be called nfmark (before
> 2.6.20) and in that case only existed if CONFIG_NETFILTER was defined so we
> should handle that case as well.  If it doesn't exist then on the match we
> can treat it as zero and if someone tries to use an action then we should
> deny it on flow setup.

Currently lowest supported kernel version is 2.6.18. Perhaps it is
worth to bump it up to 2.6.20?

I guess this skb mark get/set compatibility code should go into
skbuff.h, right? With "denying flow on setup" do you mean to return
-EINVAL in validate_set() (if there is skb mark set action, but kernel
does not support netfilter marks)?



More information about the dev mailing list