summaryrefslogtreecommitdiff
path: root/lib/ofp-group.c
Commit message (Collapse)AuthorAgeFilesLines
* ofp-group: Use big-enough buffer in ofputil_format_group().Ben Pfaff2021-05-071-1/+1
| | | | | | | | | | | | GCC 11 pointed out that ofputil_group_to_string()'s prototype asks for a buffer with one byte more than supplied. This fixes the problem. This wasn't a buffer overflow because ofputil_group_to_string() honors the buffer size passed in, which was correct. The worst that could happen was truncating the last byte of a group name. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Paolo Valerio <pvalerio@redhat.com>
* ofproto: Add support to watch controller port liveness in fast-failover groupVishal Deep Ajmera2020-03-061-1/+2
| | | | | | | | | | | | | | | | | | | | Currently fast-failover group does not support checking liveness of controller port (OFPP_CONTROLLER). However this feature can be useful for selecting alternate pipeline when controller connection itself is down for e.g. by using local DHCP server to reply for any DHCP request originating from VMs. This patch adds the support for watching controller port liveness in fast- failover group. Controller port is considered live when atleast one of-connection is alive. Example usage: ovs-ofctl add-group br-int 'group_id=1234,type=ff, bucket=watch_port:CONTROLLER,actions:<A>, bucket=watch_port:1,actions:<B> Signed-off-by: Vishal Deep Ajmera <vishal.deep.ajmera@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-ofctl: New testing command "parse-group".Ben Pfaff2019-06-091-1/+4
| | | | | | | This will be used in an upcoming test. Acked-by: Numan Siddique <nusiddiq@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Remove support for OpenFlow 1.6 (draft).Ben Pfaff2019-02-051-8/+2
| | | | | | | | | ONF abandoned the OpenFlow specification, so that OpenFlow 1.6 will never be completed. It did not contain much in the way of useful features, so remove what support Open vSwitch already had. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ofp-group: support to insert bucket with weight value for select typesolomon2019-01-101-3/+5
| | | | | | | | | | | | | | | | | | | | After creating a group with hash select type,then we need to insert a new bucket with weight, But,it fails. Commands are as following: # ovs-ofctl -O OpenFlow15 add-group br0 "group_id=10, type=select, selection_method=hash,fields=tcp_src, bucket=bucket_id=10,weight:99,actions=output:1, bucket=bucket_id=20,weight:199,actions=output:1 " # ovs-ofctl -O OpenFlow15 insert-buckets br0 "group_id=10,type=select command_bucket_id=last,bucket=bucket_id=3,weight=100,actions=output:1" ovs-ofctl: type is not needed # ovs-ofctl -O OpenFlow15 insert-buckets br0 "group_id=10 command_bucket_id=last,bucket=bucket_id=3,weight=100,actions=output:1" ovs-ofctl: Only select groups can have bucket weights. This patch can help us. However, for other types that are not select, the check of the parameters is not strict, but it does not affect their function, because other types do not use this weight parameter. Signed-off-by: solomon <liwei.solomon@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofproto: Handle OpenFlow version mismatch for requestforward with groups.Ben Pfaff2018-09-261-69/+106
| | | | | | | | | | | | | | | OpenFlow 1.4+ supports a feature called requestforward. When a controller enables this feature, the switch sends that controller a copy of other controllers' group and meter modification requests. OpenFlow 1.5 supports some group features not in OpenFlow 1.4. When OVS attempted to forward such requests to an OpenFlow 1.4 controller, it reported an error and exited. This commit fixes the problem by making OVS properly translate the messages to OpenFlow 1.4 format. Reported-by: Pierre Cregut <pierre.cregut@orange.com> Tested-by: Pierre Cregut <pierre.cregut@orange.com> Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-September/047453.html Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofp-group: Fix memory leak in error cases parsing group requests.Ben Pfaff2018-08-171-2/+2
| | | | | Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9424#c4 Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command.Ben Pfaff2018-07-061-2/+2
| | | | | | | | | | | | | | When decoding a group mod, the current code validates the group type and command after the whole group mod has been decoded. The OF1.5 decoder, however, tries to use the type and command earlier, when it might still be invalid. This caused an assertion failure (via OVS_NOT_REACHED). This commit fixes the problem. ovs-vswitchd does not enable support for OpenFlow 1.5 by default. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9249 Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
* ofproto-dpif: Use dp_hash as default selection methodJan Scheurich2018-05-251-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dp_hash selection method for select groups overcomes the scalability problems of the current default selection method which, due to L2-L4 hashing during xlation and un-wildcarding of the hashed fields, basically requires an upcall to the slow path to load-balance every L4 connection. The consequence are an explosion of datapath flows (megaflows degenerate to miniflows) and a limitation of connection setup rate OVS can handle. This commit changes the default selection method to dp_hash, provided the bucket configuration is such that the dp_hash method can accurately represent the bucket weights with up to 64 hash values. Otherwise we stick to original default hash method. We use the new dp_hash algorithm OVS_HASH_L4_SYMMETRIC to maintain the symmetry property of the old default hash method. A controller can explicitly request the old default hash selection method by specifying selection method "hash" with an empty list of fields in the Group properties of the OpenFlow 1.5 Group Mod message. Update the documentation about selection method in the ovs-ovctl man page. Revise and complete the ofproto-dpif unit tests cases for select groups. Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com> Signed-off-by: Nitin Katiyar <nitin.katiyar@ericsson.com> Co-authored-by: Nitin Katiyar <nitin.katiyar@ericsson.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofp-group: Move formatting code for groups into ofp-group.Ben Pfaff2018-05-171-0/+306
| | | | | | | This does a better job of putting related code together. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* Add OpenFlow extensions for group support in OpenFlow 1.0.Ben Pfaff2018-05-171-79/+41
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ofp-group: Require watch_port or watch_group when parsing ff groups.Ben Pfaff2018-05-171-0/+4
| | | | | | | | | | Fast failover buckets must have a watch_port or a watch_group (or both), and ovs-vswitchd enforces this, but the bucket parsing code didn't check it. This meant that when it was omitted, the error messages were harder to understand. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ofp-util, ofp-parse: Break up into many separate modules.Ben Pfaff2018-02-131-0/+2076
ofp-util had been far too large and monolithic for a long time. This commit breaks it up into units that make some logical sense. It also moves the pieces of ofp-parse that were specific to each unit into the relevant unit. Most of this commit is just moving code around. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>