dpif-netlink: Suppress DPIF_FP_PROBE here instead of in ofproto-dpif.
authorBen Pfaff <blp@nicira.com>
Sat, 11 Jul 2015 15:27:43 +0000 (08:27 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 13 Jul 2015 15:12:59 +0000 (08:12 -0700)
Commit 22b4ccf4f (ofproto-dpif: Don't try to use dpif_probe_feature() with
Windows datapath.) stopped ofproto-dpif from trying to use the DPIF_FP_PROBE
feature of the datapath interface, because it doesn't work with Windows
yet.  However, it was *too* broad--it also stopped ofproto-dpif from
using DPIF_FP_PROBE with the netdev datapath, which still does support
DPIF_FP_PROBE on Windows.  This commit moves disabling DPIF_FP_PROBE a
couple of layers down, to a place where the two datapaths can be easily
distinguished.

Reported-by: Gurucharan Shetty <shettyg@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
lib/dpif-netlink.c
ofproto/ofproto-dpif.c

index 6838def..dd44e3e 100644 (file)
@@ -1595,6 +1595,20 @@ dpif_netlink_operate__(struct dpif_netlink *dpif,
         switch (op->type) {
         case DPIF_OP_FLOW_PUT:
             put = &op->u.flow_put;
+#ifdef _WIN32
+            /* Windows datapath doesn't support DPIF_FP_PROBE yet. */
+            if (put->flags & DPIF_FP_PROBE) {
+                /* Report an error immediately if this is the first operation.
+                 * Otherwise the easiest thing to do is to postpone to the next
+                 * call (when this will be the first operation). */
+                if (i == 0) {
+                    op->error = EINVAL;
+                    return 1;
+                }
+                n_ops = i;
+                break;
+            }
+#endif
             dpif_netlink_init_flow_put(dpif, put, &flow);
             if (put->stats) {
                 flow.nlmsg_flags |= NLM_F_ECHO;
index 0ace36d..8575b1c 100644 (file)
@@ -1010,14 +1010,8 @@ check_recirc(struct dpif_backer *backer)
 
     ofpbuf_use_stack(&key, &keybuf, sizeof keybuf);
     odp_flow_key_from_flow(&key, &flow, NULL, 0, true);
-#ifdef _WIN32
-    /* XXX Force disable of datapath recirculation from userspace until the
-     * dpif_probe_feature is properly implemented in the windows datapath */
-    enable_recirc = false;
-#else
     enable_recirc = dpif_probe_feature(backer->dpif, "recirculation", &key,
                                        NULL);
-#endif
 
     if (enable_recirc) {
         VLOG_INFO("%s: Datapath supports recirculation",
@@ -1051,13 +1045,7 @@ check_ufid(struct dpif_backer *backer)
     odp_flow_key_from_flow(&key, &flow, NULL, 0, true);
     dpif_flow_hash(backer->dpif, key.data, key.size, &ufid);
 
-#ifdef _WIN32
-    /* XXX Force disable of datapath recirculation from userspace until the
-     * dpif_probe_feature is properly implemented in the windows datapath */
-    enable_ufid = false;
-#else
     enable_ufid = dpif_probe_feature(backer->dpif, "UFID", &key, &ufid);
-#endif
 
     if (enable_ufid) {
         VLOG_INFO("%s: Datapath supports unique flow ids",
@@ -1163,11 +1151,6 @@ check_max_mpls_depth(struct dpif_backer *backer)
 
         ofpbuf_use_stack(&key, &keybuf, sizeof keybuf);
         odp_flow_key_from_flow(&key, &flow, NULL, 0, false);
-#ifdef _WIN32
-        /* XXX Force disable of datapath recirculation from userspace until the
-         * dpif_probe_feature is properly implemented in the windows datapath */
-        break;
-#endif
         if (!dpif_probe_feature(backer->dpif, "MPLS", &key, NULL)) {
             break;
         }