2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 05:47:55 +00:00

13 Commits

Author SHA1 Message Date
Eelco Chaudron
4056ae4875 ofp-flow: Skip flow reply if it exceeds the maximum message size.
Currently, if a flow reply results in a message which exceeds
the maximum reply size, it will assert OVS. This would happen
when OVN uses OpenFlow15 to add large flows, and they get read
using OpenFlow10 with ovs-ofctl.

This patch prevents this and adds a test case to make sure the
code behaves as expected.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2022-01-31 21:11:58 +01:00
Ben Pfaff
0746807054 ofp-flow: Improve error message when cookie cannot be set.
The "cookie" value has two meanings in "ovs-ofctl add-flow", etc.  With
a mask, it indicates a match; without a mask, it indicates that the
cookie should be set.  In some cases, the cookie cannot be set, which may
mean that the user meant to indicate a match.  The error message for this
case was poor; this improves it.

Suggested-by: "Yi Yang (杨燚)-云服务集团" <yangyi01@inspur.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-07-17 11:09:07 -07:00
Ben Pfaff
29718ad49d Remove support for OpenFlow 1.6 (draft).
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>
2019-02-05 09:21:19 -08:00
Ben Pfaff
ae6f7530bf ofp-actions: Split ofpacts_check__() into many functions.
ofpacts_check__() was a huge switch statement with special cases for many
different kinds of actions.  This made it unwieldy and put the special
cases far away from the rest of the code related to a given action.  This
commit refactors the code to avoid the problem.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: Yifeng Sun <pkusunyifeng@gmail.com>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
2018-07-31 13:11:13 -07:00
Ben Pfaff
82d5b337cd ofp-flow: Fix uninitialized data decoding OF1.5 flow stats.
Reported-by: Paul Greenberg
Reported-at: https://github.com/openvswitch/ovs-issues/issues/149
Fixes: c7b02b800615 ("Add support for OpenFlow 1.5 statistics (OXS).")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Darrell Ball <dlu998@gmail.com>
2018-05-23 21:29:21 -07:00
SatyaValli
c7b02b8006 Add support for OpenFlow 1.5 statistics (OXS).
This patch provides implementation Existing flow entry statistics are
redefined as standard OXS(OpenFlow Extensible Statistics) fields for
displaying the arbitrary flow stats.

To support this implementation below messages are newly added

OFPRAW_OFPT15_FLOW_REMOVED,
OFPRAW_OFPST15_AGGREGATE_REQUEST,
OFPRAW_OFPST15_FLOW_REPLY,
OFPRAW_OFPST15_AGGREGATE_REPLY,

The current commit adds support for the new feature in flow statistics
multipart messages, aggregate multipart messages and OXS support for flow
removal message, individual flow description messages.

Signed-off-by: Satya Valli <satyavalli.rama@tcs.com>
Co-authored-by: Lavanya Harivelam <harivelam.lavanya@tcs.com>
Signed-off-by: Lavanya Harivelam <harivelam.lavanya@tcs.com>
Co-authored-by: Surya Muttamsetty <muttamsetty.surya@tcs.com>
Signed-off-by: Surya Muttamsetty <muttamsetty.surya@tcs.com>
Co-authored-by: Manasa Cherukupally <manasa.cherukupally@tcs.com>
Signed-off-by: Manasa Cherukupally <manasa.cherukupally@tcs.com>
Co-authored-by: Pavani Panthagada <p.pavani1@tcs.com>
Signed-off-by: Pavani Panthagada <p.pavani1@tcs.com>
[blp@ovn.org simplified and rewrote much of the code]
Co-authored-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-16 15:29:46 -07:00
Yifeng Sun
4e08f7cdad ofp-flow: minimatch is initialized twice.
It is possible that 'fm->match' gets initialized twice in this function,
which makes the first one leak because its pointer is overwritten by the
second initialization.

This patch fixes this issue.

Fixes: 6a6b7060655e ("ofp-flow: Reduce memory consumption for ofputil_flow_mod, using minimatch.")
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-04-04 14:04:54 -07:00
Ben Pfaff
6a6b706065 ofp-flow: Reduce memory consumption for ofputil_flow_mod, using minimatch.
Until now, struct ofputil_flow_mod, which represents an OpenFlow flow table
modification request, has incorporated a struct match, which made the
overall ofputil_flow_mod about 2.5 kB.  This is OK for a small number of
flows, but absurdly inflates memory requirements when there are hundreds of
thousands of flows.  This commit fixes the problem by changing struct match
to struct minimatch inside ofputil_flow_mod, which reduces its size to
about 100 bytes plus the actual size of the flow match (usually a few dozen
bytes).

This affects memory usage of ovs-ofctl (when it adds a large number of
flows) more than ovs-vswitchd.

Reported-by: Michael Ben-Ami <mbenami@digitalocean.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Armando Migliaccio <armamig@gmail.com>
Tested-by: Armando Migliaccio <armamig@gmail.com>
Reviewed-by: Jan Scheurich <jan.scheurich@ericsson.com>
Tested-by: Jan Scheurich <jan.scheurich@ericsson.com>
Tested-by: Yifeng Sun <pkusunyifeng@gmail.com>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
2018-03-31 11:33:28 -07:00
Ben Pfaff
dfc77282c5 ofp-print: Move much of the printing code into message-specific files.
Until now, the ofp-print code has had a lot of logic specific to
individual messages.  This code is better put with the other code specific
to those messages, so this commit starts to migrate it.

There is more work of a similar type to do, but this is a reasonable start.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
2018-03-14 11:41:22 -07:00
Ben Pfaff
0960a98b77 ofp-flow: Move parse_ofp_flow_mod_str() into correct file.
This function was left behind by accident in the patch that split up
ofp-parse.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
2018-03-14 11:39:25 -07:00
Ben Pfaff
225c33ba64 ofp-protocol: Better abstract changing the protocol used for flow matches.
The previous interface here required the client to understand, to some
extent, the low-level NXFF_* values and the encoding format for the
NXT_SET_FLOW_FORMAT and NXT_SET_FLOW_MOD_TABLE_ID messages.  This commit
changes the interface so that the client only has to understand the
ofputil_protocol type used elsewhere and none of the encoding otherwise.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
2018-03-14 11:29:19 -07:00
Ben Pfaff
0ef2d6ce7f ofp-flow: Fix return value for ofputil_decode_flow_stats_reply().
This function returned errno values for some errors and OFPERR_* values
for others.  The callers all expected OFPERR_* values.  This fixes the
problem.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
2018-02-13 16:24:38 -08:00
Ben Pfaff
0d71302e36 ofp-util, ofp-parse: Break up into many separate modules.
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>
2018-02-13 10:43:13 -08:00