[ovs-dev] [PATCH v4 10/28] datapath: compat: Update udp_sock_create

Jesse Gross jesse at kernel.org
Fri Jul 8 02:16:15 UTC 2016


On Thu, Jul 7, 2016 at 7:13 PM, Jesse Gross <jesse at kernel.org> wrote:
> On Thu, Jul 7, 2016 at 5:23 PM, Pravin B Shelar <pshelar at ovn.org> wrote:
>> diff --git a/datapath/linux/compat/include/linux/udp.h b/datapath/linux/compat/include/linux/udp.h
>> new file mode 100644
>> index 0000000..31ae022
>> --- /dev/null
>> +++ b/datapath/linux/compat/include/linux/udp.h
>> @@ -0,0 +1,33 @@
>> +#ifndef __LINUX_UDP_WRAPPER_H
>> +#define __LINUX_UDP_WRAPPER_H  1
>> +
>> +#include_next <linux/udp.h>
>> +#include <linux/ipv6.h>
>> +
>> +#ifndef HAVE_NO_CHECK6_TX
>> +static inline void udp_set_no_check6_tx(struct sock *sk, bool val)
>> +{
>> +#ifdef HAVE_SK_NO_CHECK_TX
>> +       sk->sk_no_check_tx = val;
>> +#else
>> +       /* since netwroking stack is not checking for zero UDP checksum
>> +        * check it in OVS module. */
>> +       #define OVS_CHECK_UDP_TUNNEL_ZERO_CSUM
>> +#endif
>> +}
>> +
>> +static inline void udp_set_no_check6_rx(struct sock *sk, bool val)
>> +{
>> +#ifdef HAVE_SK_NO_CHECK_TX
>> +       sk->sk_no_check_rx = val;
>> +#endif
>> +}
>> +#endif
>
> I guess it probably makes more sense to #define
> OVS_CHECK_UDP_TUNNEL_ZERO_CSUM in udp_set_no_check6_rx() since it is
> receive side issue, though functionally it doesn't make a difference.
>
>> diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
>> index d45125d..3776990 100644
>> --- a/datapath/linux/compat/vxlan.c
>> +++ b/datapath/linux/compat/vxlan.c
>> @@ -850,6 +850,13 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb,
>>                 oip6 = ipv6_hdr(skb);
>>                 saddr.sin6.sin6_addr = oip6->saddr;
>>                 saddr.sa.sa_family = AF_INET6;
>> +#ifdef OVS_CHECK_UDP_TUNNEL_ZERO_CSUM
>> +               if (!udp_hdr(skb)->check &&
>> +                   !(vs->flags & VXLAN_F_UDP_ZERO_CSUM6_RX)) {
>> +                       udp6_csum_zero_error(skb);
>> +                       goto drop;
>> +               }
>> +#endif
>>  #endif
>
> Do we need a version of this for Geneve as well?

OK - I see that it actually came in later in the big resync patch.



More information about the dev mailing list