[ovs-dev] [PATCH v2 1/7] nsh: datapath support for network service headers

Pritesh Kothari (pritkoth) pritkoth at cisco.com
Fri Mar 7 19:52:40 UTC 2014


Hi Pravin,

>> 
>>                if (type > OVS_TUNNEL_KEY_ATTR_MAX) {
>> @@ -388,11 +390,16 @@ static int ipv4_tun_from_nlattr(const struct nlattr *attr,
>>                case OVS_TUNNEL_KEY_ATTR_CSUM:
>>                        tun_flags |= TUNNEL_CSUM;
>>                        break;
>> +               case OVS_TUNNEL_KEY_ATTR_NSP:
>> +                       nsp = htonl(be32_to_cpu(nla_get_be32(a)) << 8);
>> +                       tun_flags |= TUNNEL_NSP;
>> +                       break;
>>                default:
>>                        return -EINVAL;
>>                }
>>        }
>> 
> I have not looked at entire patch but just noticed this. If you only
> going to support NSP over vxlan only we should check if this packet is
> for vxlan or add support of NSP for all tunneling protocols.

yes actually the check does exists, here is the snippet from around line 445 of the patch:

@@ -68,7 +69,8 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb, __be32 vx_vni)
-	ovs_flow_tun_key_init(&tun_key, iph, key, TUNNEL_KEY);
+	ovs_flow_tun_key_init(&tun_key, iph, key, nsp,
+			      TUNNEL_KEY | TUNNEL_NSP);

so when we receive packet over vxlan with nsp, we flag it.

Regards,
Pritesh


More information about the dev mailing list