Please move:

destKey->l2.keyLen = OVS_WIN_TUNNEL_KEY_SIZE + OVS_L2_KEY_SIZE
                         - destKey->l2.offset;

After 
_MapTunAttrToFlowPut(keyAttrs, tunnelAttrs, destKey);

:

$ git diff
diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c
index 02c41b7..49abb86 100644
--- a/datapath-windows/ovsext/Flow.c
+++ b/datapath-windows/ovsext/Flow.c
@@ -1380,6 +1380,10 @@ _MapKeyAttrToFlowPut(PNL_ATTR *keyAttrs,
 {
     _MapTunAttrToFlowPut(keyAttrs, tunnelAttrs, destKey);

+    /* ==== L3 + L4. ==== */
+    destKey->l2.keyLen = OVS_WIN_TUNNEL_KEY_SIZE + OVS_L2_KEY_SIZE
+                         - destKey->l2.offset;
+
     if (keyAttrs[OVS_KEY_ATTR_RECIRC_ID]) {
         destKey->recircId = NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_RECIRC_ID]);
         destKey->l2.keyLen += sizeof(destKey->recircId);
@@ -1413,10 +1417,6 @@ _MapKeyAttrToFlowPut(PNL_ATTR *keyAttrs,
         destKey->l2.vlanTci = NlAttrGetU16(keyAttrs[OVS_KEY_ATTR_VLAN]);
     }

-    /* ==== L3 + L4. ==== */
-    destKey->l2.keyLen = OVS_WIN_TUNNEL_KEY_SIZE + OVS_L2_KEY_SIZE
-                         - destKey->l2.offset;
-
     switch (ntohs(destKey->l2.dlType)) {
     case ETH_TYPE_IPV4: {

Alin.

> -----Mesaj original-----
> De la: dev [mailto:dev-boun...@openvswitch.org] În numele Sairam
> Venugopal
> Trimis: Friday, March 25, 2016 8:42 PM
> Către: dev@openvswitch.org
> Subiect: [ovs-dev] [PATCH] datapath-windows: Remove unnecessary keylen
> computation in Flow.c
> 
> destKey->l2.keylen gets reset after this line. This change
> doesn't help with hash computation and can be removed. This is what
> destKey->l2.keyLen gets set to:
> 
> destKey->l2.keyLen = OVS_WIN_TUNNEL_KEY_SIZE + OVS_L2_KEY_SIZE
>                          - destKey->l2.offset;
> 
> Signed-off-by: Sairam Venugopal <vsai...@vmware.com>
> ---
>  datapath-windows/ovsext/Flow.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/datapath-windows/ovsext/Flow.c b/datapath-
> windows/ovsext/Flow.c index d49697c..004c54a 100644
> --- a/datapath-windows/ovsext/Flow.c
> +++ b/datapath-windows/ovsext/Flow.c
> @@ -1382,12 +1382,10 @@ _MapKeyAttrToFlowPut(PNL_ATTR *keyAttrs,
> 
>      if (keyAttrs[OVS_KEY_ATTR_RECIRC_ID]) {
>          destKey->recircId =
> NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_RECIRC_ID]);
> -        destKey->l2.keyLen += sizeof(destKey->recircId);
>      }
> 
>      if (keyAttrs[OVS_KEY_ATTR_DP_HASH]) {
>          destKey->dpHash =
> NlAttrGetU32(keyAttrs[OVS_KEY_ATTR_DP_HASH]);
> -        destKey->l2.keyLen += sizeof(destKey->dpHash);
>      }
> 
>      /* ===== L2 headers ===== */
> --
> 2.5.0.windows.1
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to