[ovs-dev] Kernel/Userspace Action Mismatch

Justin Pettit jpettit at nicira.com
Thu Dec 18 19:26:44 UTC 2014


> On Dec 18, 2014, at 10:15 AM, Pravin Shelar <pshelar at nicira.com> wrote:
> 
> On Wed, Dec 17, 2014 at 10:50 PM, Justin Pettit <jpettit at nicira.com> wrote:
>> Hi, Pravin.  I think commit a36de77 (openvswitch: Userspace tunneling.) introduces a problem when new actions are added in the kernel.  This part makes the kernel's idea of actions defined after _TUNNEL_POP different from userspace:
>> 
>> -=-=-=-=-=-=-=-
>> @@ -636,6 +663,10 @@ enum ovs_action_attr {
>>                                       * The data must be zero for the unmasked
>>                                       * bits. */
>> 
>> +#ifndef __KERNEL__
>> +       OVS_ACTION_ATTR_TUNNEL_PUSH,   /* struct ovs_action_push_tnl*/
>> +       OVS_ACTION_ATTR_TUNNEL_POP,    /* u32 port number. */
>> +#endif
>>        __OVS_ACTION_ATTR_MAX
>> };
>> -=-=-=-=-=-=-=-
>> 
>> The problem is that userspace generates these actions for the kernel, so the enums for any new actions are off by two.
>> 
> 
> All new actions should be added before these userspace only actions.
> So that the action ID remains same for userspace and kernel module.

These sort of assumptions should really be documented.  I'll send out a patch.

Long-term, this seems pretty ugly, since Netlink is the interface for more than just Linux and userspace.

--Justin





More information about the dev mailing list