[ovs-dev] [PATCH v1 09/10] datapath-windows/Flow.c: FLOW_DEL command handler.

Samuel Ghinet sghinet at cloudbasesolutions.com
Thu Sep 25 16:39:04 UTC 2014


Hey Ankur,

A problem I see here with flow delete is that Flow delete requires:
- no attributes (i.e. no "key"): if flow flush is requested
- key only: if a specific flow key is to be deleted.

When / if masks will be allowed for flows, the mask is expected not to exist.

How does the current code behave if the userspace gives it a "flow delete" with actions (which is invalid)? Will it do a flow set then a flow delete?
As about flow flush, I think that by the current implementation it will crash.

Regards,
Sam
________________________________________
Date: Wed, 24 Sep 2014 00:15:43 -0700
From: Ankur Sharma <ankursharma at vmware.com>
To: dev at openvswitch.org
Subject: [ovs-dev] [PATCH v1 09/10] datapath-windows/Flow.c: FLOW_DEL
        command handler.
Message-ID: <1411542944-19374-9-git-send-email-ankursharma at vmware.com>

Registered FLOW_DEL command handler. The same command
handler as FLOW_ADD is good enough to handle FLOW_DEL
case as well with minor changes for checking to action
attribute.
---
 datapath-windows/ovsext/Datapath.c | 5 +++++
 datapath-windows/ovsext/Flow.c     | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c
index 5008aab..5377f09 100644
--- a/datapath-windows/ovsext/Datapath.c
+++ b/datapath-windows/ovsext/Datapath.c
@@ -202,6 +202,11 @@ NETLINK_CMD nlFlowFamilyCmdOps[] = {
       .handler          = OvsFlowNlNewCmdHandler,
       .supportedDevOp   = OVS_TRANSACTION_DEV_OP,
       .validateDpIndex  = FALSE
+    },
+    { .cmd              = OVS_FLOW_CMD_DEL,
+      .handler          = OvsFlowNlNewCmdHandler,
+      .supportedDevOp   = OVS_TRANSACTION_DEV_OP,
+      .validateDpIndex  = FALSE
     }
 };

diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c
index e170de6..b95f69b 100644
--- a/datapath-windows/ovsext/Flow.c
+++ b/datapath-windows/ovsext/Flow.c
@@ -358,8 +358,11 @@ _OvsFlowMapNlToFlowPut(POVS_MESSAGE msgIn, PNL_ATTR keyAttr,
                                 mappedFlow);

     /* Map the action */
-    mappedFlow->actionsLen = NlAttrGetSize(actionAttr);
-    mappedFlow->actions = NlAttrGet(actionAttr);
+    if (actionAttr) {
+        mappedFlow->actionsLen = NlAttrGetSize(actionAttr);
+        mappedFlow->actions = NlAttrGet(actionAttr);
+    }
+
     mappedFlow->dpNo = ovsHdr->dp_ifindex;

     _OvsFlowMapNlToFlowPutFlags(genlMsgHdr, flowAttrClear,
--
1.9.1





More information about the dev mailing list