Oops... 

You're right Eitan, I will add a separate variable for it and respin the patch.

Alin.

-----Mesaj original-----
De la: Eitan Eliahu [mailto:elia...@vmware.com] 
Trimis: Monday, July 13, 2015 7:42 PM
Către: Alin Serdean; dev@openvswitch.org
Subiect: RE: [PATCH] datapath-windows: Update VXLAN header information

Hi Alin,
Can you please explain why the FilterID is used to maintain the number of 
transmitted bytes?
The FilterID is sent to WFP when we add a filter so the filter can be deleted 
later by specifying this ID.  Once the ID is modified the removal of the filter 
will fail.
I think we want to use as separate variable for it (e.g. STT code).
Thank you,
Eitan

-----Original Message-----
From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Alin Serdean
Sent: Monday, July 13, 2015 8:39 AM
To: dev@openvswitch.org
Subject: [ovs-dev] [PATCH] datapath-windows: Update VXLAN header information

Use tunnel key information on the IP header preceding the VXLAN header.

Signed-off-by: Alin Gabriel Serdean <aserd...@cloudbasesolutions.com>
---
 datapath-windows/ovsext/Vxlan.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/datapath-windows/ovsext/Vxlan.c b/datapath-windows/ovsext/Vxlan.c 
index f43805a..16c80b9 100644
--- a/datapath-windows/ovsext/Vxlan.c
+++ b/datapath-windows/ovsext/Vxlan.c
@@ -15,6 +15,7 @@
  */
 
 #include "precomp.h"
+#include "Atomic.h"
 #include "NetProto.h"
 #include "Switch.h"
 #include "Vport.h"
@@ -263,11 +264,13 @@ OvsDoEncapVxlan(POVS_VPORT_ENTRY vport,
         ipHdr = (IPHdr *)((PCHAR)ethHdr + sizeof *ethHdr);
 
         ipHdr->ihl = sizeof *ipHdr / 4;
-        ipHdr->version = IPV4;
-        ipHdr->tos = 0;
+        ipHdr->version = IPPROTO_IPV4;
+        ipHdr->tos = tunKey->tos;
         ipHdr->tot_len = htons(NET_BUFFER_DATA_LENGTH(curNb) - sizeof *ethHdr);
-        ipHdr->id = 0;
-        ipHdr->frag_off = IP_DF_NBO;
+        ipHdr->id = (uint16)atomic_add64(&vportVxlan->filterID,
+                                         NET_BUFFER_DATA_LENGTH(curNb));
+        ipHdr->frag_off = (tunKey->flags & OVS_TNL_F_DONT_FRAGMENT) ?
+                          IP_DF_NBO : 0;
         ipHdr->ttl = tunKey->ttl ? tunKey->ttl : VXLAN_DEFAULT_TTL;
         ipHdr->protocol = IPPROTO_UDP;
         ASSERT(tunKey->dst == fwdInfo->dstIpAddr); @@ -279,7 +282,7 @@ 
OvsDoEncapVxlan(POVS_VPORT_ENTRY vport,
 
         /* UDP header */
         udpHdr = (UDPHdr *)((PCHAR)ipHdr + sizeof *ipHdr);
-        udpHdr->source = htons(tunKey->flow_hash | 32768);
+        udpHdr->source = htons(tunKey->flow_hash | MAXINT16);
         udpHdr->dest = htons(vportVxlan->dstPort);
         udpHdr->len = htons(NET_BUFFER_DATA_LENGTH(curNb) - headRoom +
                             sizeof *udpHdr + sizeof *vxlanHdr);
--
1.9.5.msysgit.0
_______________________________________________
dev mailing list
dev@openvswitch.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailman_listinfo_dev&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=CWsgHUxi6ExLXY798tmo3LJ4e3geGYp56lkcH-5cLCY&m=Gka-eilVbOezK04WXSr9wUJYN7f8vbr2ZVKTk4ck4eo&s=-IPN21a76q0_LvUuzMjrtWNsLoKW1CQxqCzWu1QlB_A&e=
 
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to