2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-29 13:27:59 +00:00

117 Commits

Author SHA1 Message Date
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
0596e89755 flow: Move functions for dealing with wildcard bit counts to ofp-util.
These functions are really OpenFlow-specific, and they will not be used
directly by the flow code soon, so move them to ofp-util.
2010-11-22 10:09:18 -08:00
Ben Pfaff
44381c1b4e ofp-util: Consistently treat OpenFlow xids as network byte order.
The 'xid' in an ofp_header is not interpreted by the receiver but only by
the sender, so it need not be in any particular byte order.  OVS used to
try to take advantage of this to avoid host/network byte order conversions
for this field.  Older code in OVS, therefore, treats xid as being in host
byte order.  However, as time went on, I forgot that I had introduced this
trick, and so newer code treats xid as being in network byte order.

This commit fixes up the situation by consistently treating xid as being
in network byte order.  I think that this will be less surprising and
easier to remember in the future.

This doesn't fix any actual bugs except that some log messages would have
printed xids in the wrong byte order.
2010-11-17 09:21:09 -08:00
Ben Pfaff
69b6be193f ofp-util: Add OFP_ACTION_ALIGN macro to header.
It seems that this should really be in openflow.h but so far it isn't.
2010-11-15 09:41:41 -08:00
Ben Pfaff
f1defbf96d ofp-util: Make validate_actions() take a struct flow *.
The upcoming support for actions on registers will require the flow to
validate actions, so this commit adds the parameter in advance.  It is
not yet used.
2010-11-09 17:08:09 -08:00
Ben Pfaff
ac51afaf4c ofproto: Refactor handle_packet_out().
An upcoming commit will require the flow to be passed in as part of
OpenFlow action validation, but handle_packet_out() has until now been
structured to make this difficult.  This commit refactors it to better
suit this purpose.
2010-11-09 17:08:09 -08:00
Ben Pfaff
3052b0c5e5 ofproto: Refactor handle_flow_mod().
This breaks this OpenFlow handler into two parts, one responsible
for parsing and constructing OpenFlow messages and one that works
with the flow table.  The latter will be reused in a later commit
that implements the Nicira Extended Match flexible flow match
extension.
2010-11-08 10:43:19 -08:00
Ben Pfaff
0bd0c6606a ofp-util: New functions make_nxmsg(), make_nxmsg_xid().
These functions slightly simplify constructing Nicira vendor extension
messages.
2010-11-05 09:25:38 -07:00
Ben Pfaff
d48a591098 ofp-util: Add macros for composing error codes.
These are useful in static initializers and case labels, where function
calls are not allowed.
2010-11-05 09:25:37 -07:00
Ben Pfaff
61d8d58305 ofp-util.h: Use NX_VENDOR_ID instead of literal numeric constant. 2010-11-05 09:25:37 -07:00
Ben Pfaff
a23aab1fc2 Fix typos in comments. 2010-11-05 09:25:37 -07:00
Ben Pfaff
26c112c241 ofp-util: Add infrastructure for vendor extensions to OpenFlow error codes.
Cross-ported from "wdp" branch.
2010-11-05 09:25:37 -07:00
Ben Pfaff
71ce92352c ofp-util: Add more functions for supporting OpenFlow error codes.
Cross-ported from "wdp" branch.
2010-11-05 09:25:37 -07:00
Ben Pfaff
ae412e7dd8 flow: Get rid of flow_t typedef.
When userspace and the kernel were using the same structure for flows,
flow_t was a useful way to indicate that a structure was really a userspace
flow instead of a kernel one, but now it's better to just write "struct
flow" for consistency, since OVS doesn't use typedefs for structs
elsewhere.

Acked-by: Jesse Gross <jesse@nicira.com>
2010-10-11 13:31:43 -07:00
Ben Pfaff
3f09c339f7 ofproto: Log changes made by flow normalization.
Open vSwitch has always "normalized" flows, that is, zeroed out fields that
are wildcarded or that otherwise cannot affect whether a packet actually
matches the flow.  But until now it has done so silently, which prevents
the authors of controllers from learning what is happening and makes it
less likely that they will update code on their end.  This commit makes
OVS log when normalization changes a flow.

Suggested by partner.
2010-06-28 11:27:02 -07:00
Ben Pfaff
c1c9c9c4b6 Implement QoS framework.
ovs-vswitchd doesn't declare its QoS capabilities in the database yet,
so the controller has to know what they are.  We can add that later.

The linux-htb QoS class has been tested to the extent that I can see that
it sets up the queues I expect when I run "tc qdisc show" and "tc class
show".  I haven't tested that the effects on flows are what we expect them
to be.  I am sure that there will be problems in that area that we will
have to fix.
2010-06-17 15:04:12 -07:00
Ben Pfaff
fa37b408ea vconn: Move OpenFlow utility functions into new file ofp-util.c.
The main purpose of the vconn code is to ship OpenFlow messages across
network connections.  Over time a large number of utility functions related
to OpenFlow messages have also crept into vconn.c, but that's really
logically separate.  This commit breaks those functions out into a new
file.
2010-06-17 10:30:18 -07:00