[ovs-discuss] How to use group bucket actions with specific controller id? Is it possible?

Ben Pfaff blp at ovn.org
Fri Jun 7 19:37:23 UTC 2019


On Thu, May 16, 2019 at 04:18:32PM +0900, Yoonhee Choi wrote:
> I am implementing network control logic with an open source ryu controller.
> When I search the internet, I can use the controller id in the *T**h**e* *c*
> *o**n**t**r**o**l**l**e**r* *a**c**t**i**o**n *part of ovs-ofctl manual.
> 
> > http://www.openvswitch.org/support/dist-docs/ovs-actions.7.html
> 
> 
> I want to use it with the *group entry*. like below.
> 
> 
> $ ovs-ofctl -O OpenFlow13 add-flow br0
> table=1,priority=100(...etc..),actions=group:1
> $ ovs-ofctl -O OpenFlow13 add-group br0 "group_id=1, type=select,
> bucket=controller(reason=no_match,max_len=65530,id=2)"
> 
> In other words, I want to send packets to the ryu controller with a
> specific controller id through the action buckets in the group entry.

Thanks for the bug report/feature request.  You are right that this does
not currently work.

If you are still interested in this feature, you can try out the
following commit.  If it works for you, then I will apply it to the OVS
repository.

--8<--------------------------cut here-------------------------->8--

From: Ben Pfaff <blp at ovn.org>
Date: Fri, 7 Jun 2019 12:35:12 -0700
Subject: [PATCH] ofp-actions: Allow "controller" action in action sets.

Requested-by: Yoonhee Choi <youni88page at gmail.com>
Requested-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2019-May/048676.html
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 lib/ofp-actions.c   |  4 ++--
 lib/ovs-actions.xml | 14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index 1a24063d087c..615ec23f26e2 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008-2017 Nicira, Inc.
+ * Copyright (c) 2008-2017, 2019 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -7752,6 +7752,7 @@ ofpact_copy(struct ofpbuf *out, const struct ofpact *a)
     FINAL(OFPACT_CT_CLEAR)                      \
     FINAL(OFPACT_RESUBMIT)                      \
     FINAL(OFPACT_OUTPUT)                        \
+    FINAL(OFPACT_CONTROLLER)                    \
     FINAL(OFPACT_GROUP)
 
 enum action_set_class {
@@ -7816,7 +7817,6 @@ action_set_classify(const struct ofpact *a)
     case OFPACT_CLEAR_ACTIONS:
     case OFPACT_CLONE:
     case OFPACT_NAT:
-    case OFPACT_CONTROLLER:
     case OFPACT_ENQUEUE:
     case OFPACT_EXIT:
     case OFPACT_UNROLL_XLATE:
diff --git a/lib/ovs-actions.xml b/lib/ovs-actions.xml
index ab6c0030aa50..77481694e2c2 100644
--- a/lib/ovs-actions.xml
+++ b/lib/ovs-actions.xml
@@ -108,13 +108,13 @@
     </li>
     <li><code>set_queue</code></li>
     <li>
-      <code>group</code>, <code>output</code>, <code>resubmit</code>,
-      <code>ct_clear</code>, or <code>ct</code>.  If more than one of these
-      actions is present, then the one listed earliest above is executed and
-      the others are ignored, regardless of the order in which they were added
-      to the action set.  (If none of these actions is present, the action set
-      has no real effect, because the modified packet is not sent anywhere and
-      thus the modifications are not visible.)
+      <code>group</code>, <code>controller</code>, <code>output</code>,
+      <code>resubmit</code>, <code>ct_clear</code>, or <code>ct</code>.  If
+      more than one of these actions is present, then the one listed earliest
+      above is executed and the others are ignored, regardless of the order in
+      which they were added to the action set.  (If none of these actions is
+      present, the action set has no real effect, because the modified packet
+      is not sent anywhere and thus the modifications are not visible.)
     </li>
   </ol>
 
-- 
2.20.1



More information about the discuss mailing list