[ovs-dev] [PATCH 2/3] datapath: Add support for 4.2 kernel.

Pravin Shelar pshelar at nicira.com
Thu Sep 17 18:58:45 UTC 2015


On Wed, Sep 16, 2015 at 3:00 PM, Jesse Gross <jesse at nicira.com> wrote:
> On Tue, Sep 15, 2015 at 11:09 AM, Pravin B Shelar <pshelar at nicira.com> wrote:
>> Signed-off-by: Pravin B Shelar <pshelar at nicira.com>
>
> What about this commit?
> openvswitch: allocate nr_node_ids flow_stats instead of num_possible_nodes
>
ok, I will send separate patch.
>> diff --git a/datapath/linux/compat/socket.c b/datapath/linux/compat/socket.c
>> new file mode 100644
>> index 0000000..776f9e2
>> --- /dev/null
>> +++ b/datapath/linux/compat/socket.c
>> +#ifndef HAVE_SOCK_CREATE_KERN_NET
>> +int ovs_sock_create_kern(struct net *net, int family, int type, int protocol, struct socket **res)
>> +{
>> +       int err;
>> +
>> +       err = sock_create_kern(family, type, protocol, res);
>> +       if (err < 0)
>> +               return err;
>> +
>> +       sk_change_net((*res)->sk, net);
>> +       return err;
>> +}
>> +
>> +void ovs_sock_release(struct socket *sock)
>> +{
>> +       sk_release_kernel(sock->sk);
>> +}
>> +#endif
>
> Is there a reason we can't use a macro and then keep the original
> name? I'm also not sure that we need to put this in a new .c file but
> that's more just personal opinion.

I also likes to define it in header but there is issue with it. I need
to call sk_change_net() which is defined in sock.h. I do not want to
include header from different compat header file. I causes all sorts
of header dependencies.
I changed name since it is no longer same API, it also calls sk_change_net().



More information about the dev mailing list