Maybe I was a bit unclear in my previous comment. See inlined comment.

> -----Mesaj original-----
> De la: dev [mailto:[email protected]] În numele Nithin Raju
> Trimis: Wednesday, June 15, 2016 1:11 AM
> Către: [email protected]
> Subiect: [ovs-dev] [PATCH v3] datapath-windows: use ip proto for tunnel
> port lookup
> 
> In Actions.c, based on the IP Protocol type and L4 port of the outer packet,
> we lookup the tunnel port. The function that made this happen took the
> tunnel type as an argument.
> Semantically, is is better to pass the IP protocol type and let the lookup 
> code
> map IP protocol type to tunnel type.
> 
> In the vport add code, we make sure that we block tunnel port addition if
> there's already a tunnel port that uses the same IP protocol type and L4 port
> number.
> 
> Signed-off-by: Nithin Raju <[email protected]>
> Acked-by: Sairam Venugopal <[email protected]>
> Acked-by: Yin Lin <[email protected]>
> +    LIST_FORALL(head, link) {
> +        vport = CONTAINING_RECORD(link, OVS_VPORT_ENTRY,
> tunnelVportLink);
> +        if (GetPortFromPriv(vport) == dstPort) {
> +            switch (nwProto) {
> +            case IPPROTO_UDP:
> +                if (vport->ovsType != OVS_VPORT_TYPE_VXLAN) {
> +                    continue;
> +                }
> +                break;
> +            case IPPROTO_TCP:
> +                if (vport->ovsType != OVS_VPORT_TYPE_STT) {
> +                    continue;
> +                }
> +                break;
> +            case IPPROTO_GRE:
[Alin Gabriel Serdean: ] break;
> +            default:
[Alin Gabriel Serdean: ] return NULL;
> +                break;
> +            }
> +            return vport;
> +        }
> +    }
> +    return NULL;
> +}
We need to exact match the IP proto. In the case of GRE you will get a valid 
vport although you have an L2 packet with dstPort == 0.
I hope I was clear enough this time, if not I can post a debugging session :).
The rest is all good. 

Alin.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to