2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-28 12:58:00 +00:00

23 Commits

Author SHA1 Message Date
Ben Pfaff
f393f81e42 ofp-print, ofp-parse: Add support for NXAST_REG_MOVE and NXAST_REG_LOAD. 2010-12-09 11:03:35 -08:00
Ben Pfaff
640c7c945f ovs-ofctl: Fix del-flows command parsing bugs.
"ovs-ofctl del-flows br0" segfaulted because do_flow_mod__() assumed that
it always had a "flow" argument, which is not true for the del-flows
command.

Beyond that, parse_ofp_flow_mod_str() rejected "ovs-ofctl del-flows
br0" because no actions were supplied, even though supplying actions
doesn't make sense for deleting flows.

This commit fixes both problems and adds a simple test that would have
caught both problems.

Bug #4112.
2010-12-09 10:27:08 -08:00
Ben Pfaff
88ca35eed0 ovs-ofctl: Add NXM support. 2010-12-07 13:32:01 -08:00
Ben Pfaff
00b1c62fe8 ofp-parse: Add support for registers.
This updates the ovs-ofctl manpage even though ovs-ofctl doesn't really
support registers yet.
2010-12-07 12:47:42 -08:00
Ben Pfaff
4c5df7f774 ofp-parse: Add support for tun_id.
This updates the ovs-ofctl manpage even though ovs-ofctl doesn't really
support tun_id yet.
2010-12-07 12:47:40 -08:00
Ben Pfaff
66642cb40b nx-match: Implement support for arbitrary VLAN TCI masks.
Since the Nicira Extended Match was specified nicira-ext.h has claimed that
arbitrary masks are allowed, but in fact only certain masks were actually
implemented.  This commit implements general masking for the 802.1Q VLAN
TCI field.
2010-11-23 10:06:28 -08:00
Ben Pfaff
d8ae4d6726 flow: Fully separate flow_wildcards from OpenFlow wildcard bits.
Originally, wildcards were just the OpenFlow OFPFW_* bits.  Then, when
OpenFlow added CIDR masks for IP addresses, struct flow_wildcards was born
with additional members for those masks, derived from the wildcard bits.
Then, when OVS added support for tunnels, we added another bit
NXFW_TUN_ID that coexisted with the OFPFW_*.  Later we added even more bits
that do not appear in the OpenFlow 1.0 match structure at all.  This had
become really confusing, and the difficulties were especially visible in
the long list of invariants in comments on struct flow_wildcards.

This commit cleanly separates the OpenFlow 1.0 wildcard bits from the
bits used inside Open vSwitch, by defining a new set of bits that are
used only internally to Open vSwitch and converting to and from those
wildcard bits at the point where data comes off or goes onto the wire.
It also moves those functions into ofp-util.[ch] since they are only for
dealing with OpenFlow wire protocol now.
2010-11-22 10:11:40 -08:00
Ben Pfaff
844dff325b flow: Remove flow_to/from_match() in favor of cls_rule_to/from_match().
The flow_from_match() and flow_to_match() functions have to deal with most
of the state in a cls_rule anyhow, and this will increase in upcoming
commits, to the point that we might as well just use a cls_rule anyhow.
This commit therefore deletes flow_from_match() and flow_to_match(),
integrating their code into cls_rule_from_match() and the new function
cls_rule_to_match(), respectively.  It also changes each of the functions'
callers to use the new cls_rule_*() function.
2010-11-22 10:10:14 -08:00
Ben Pfaff
bf9712678f util: Add function hexits_value() for parsing multiple hex digits.
Suggested-by: Justin Pettit <jpettit@nicira.com>
2010-11-15 10:18:10 -08:00
Ben Pfaff
96fc46e8fd nicira-ext: New Nicira vendor action NXAST_NOTE.
Our controller group at Nicira has requested a way to annotate flows with
extra information beyond the flow cookie.  The new NXAST_NOTE action
provides such a way.

This new action is somewhat controversial.  Some have suggested that it
should be added another way (either as part of the Nicira Extended Match
or as a new component of the flow_mod and related messages).  Others think
that it has no place in the OpenFlow protocol at all and that an equivalent
should be implemented using the already available features of OVSDB.  So
it is possible that this extension will be deleted and the feature will
be reimplemented some other way (or not at all).

CC: Teemu Koponen <koponen@nicira.com>
CC: Jeremy Stribling <strib@nicira.com>
2010-11-15 09:41:41 -08:00
Ben Pfaff
8050b31d63 ofp-parse: Refactor flow parsing. 2010-11-11 11:01:50 -08:00
Ben Pfaff
049c8dc212 ofp-parse: Generalize parse_ofp_add_flow_str() as parse_ofp_flow_mod_str().
This generalization allows us to delete several lines of code from
ovs-ofctl.c.
2010-11-11 11:01:09 -08:00
Ben Pfaff
d98e600755 vlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.
It's kind of odd for VLOG_DEFINE_THIS_MODULE to supply its own semicolon,
so this commit switches to the more common form.
2010-10-29 09:48:47 -07:00
Ben Pfaff
10a24935c9 xtoxll: Rename "byte-order" since it now include more than xtoxll.
Suggested-by: Justin Pettit <jpettit@nicira.com>
2010-10-29 09:48:47 -07:00
Ethan Jackson
ce5452cf78 lib: ofp-parse segfaults if required argument isn't specified
Running ovs-ofctl add-flow br0 "in_port=3 actions=resubmit" would
segfault instead of reporting an error.
2010-10-11 21:29:22 +00:00
Justin Pettit
eedc0097f4 Add Nicira extension for modifying queue without transmitting
The OpenFlow OFPAT_ENQUEUE action sets a queue id and outputs the packet
in one shot.  There are times in which the queue should be set, but the
output port is not yet known.  This commit adds the NXAST_SET_QUEUE and
NXAST_POP_QUEUE Nicira extension actions to modify the queue
configuration without requiring a port argument.

CC: Jeremy Stribling <strib@nicira.com>
CC: Keith Amidon <keith@nicira.com>
2010-10-02 18:36:10 -07:00
Ben Pfaff
15f1f1b63a ofp-parse: Factor out duplicated code into new functions. 2010-10-01 13:08:33 -07:00
Ben Pfaff
bb98f9b951 ofp-parse: Properly byteswap in_port. 2010-10-01 13:08:33 -07:00
Ben Pfaff
2a022368f4 Avoid shadowing local variable names.
All of these changes avoid using the same name for two local variables
within a same function.  None of them are actual bugs as far as I can tell,
but any of them could be confusing to the casual reader.

The one in lib/ovsdb-idl.c is particularly brilliant: inner and outer
loops both using (different) variables named 'i'.

Found with GCC -Wshadow.
2010-09-20 09:39:54 -07:00
Ben Pfaff
a154533795 ovs-ofctl, ovs-controller: Disable flow idle timeout by default.
Until now, flows set up by ovs-ofctl and by "ovs-controller --with-flows"
by default expired after 60 seconds of inactivity.  This was surprising,
especially in the latter case where one is normally trying to set up
permanent flows.  Even in the former case, however, we can't think of a
good reason that flows added by ovs-ofctl should expire by default.  So
this commit make flows permanent by default.

Reported-by: Michael Mao <mmao@nicira.com>
2010-09-15 15:21:03 -07:00
Ben Pfaff
933df876ff ovs-ofctl: Add support for drop_spoofed_arp action.
Requested-by: Michael Mao <mmao@nicira.com>
2010-09-10 09:17:29 -07:00
Ben Pfaff
5682f72331 ovs-ofctl: Add support for OpenFlow enqueue action. 2010-07-30 16:04:17 -07:00
Justin Pettit
f22716dcca ofp-parse: Break string-to-openflow parsing into library functions
An upcoming commit will add the ability to load OpenFlow rules into
ovs-controller.  Break out string-to-openflow parsing so that
ovs-ofctl and ovs-controller can use the same code.
2010-07-30 00:05:33 -07:00