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

59 Commits

Author SHA1 Message Date
Pravin B Shelar
038341d1c1 vswitchd: Fix function prototype of packet_set_ipv6()
Follwoing patch fixes sparse error:
lib/packets.c:643:1: error: symbol 'packet_set_ipv6' redeclared
with different type (originally declared at lib/packets.h:493)
- incompatible argument 6 (different base types)

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2012-11-14 11:43:52 -08:00
Ansis Atteka
bc7a5acdff datapath: add ipv6 'set' action
This patch adds ipv6 set action functionality. It allows to change
traffic class, flow label, hop-limit, ipv6 source and destination
address fields.

Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2012-11-13 13:51:59 +02:00
Isaku Yamahata
3e34fbdd62 OF11: push_vlan support
This implementes push_vlan with 802.1Q.
NOTE: 802.1AD (QinQ) is not supported. It requires another effort.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-10-26 09:49:05 -07:00
Jesse Gross
495fe2648e packets: Add ECN constants.
Upcoming tunnel code will be able to handle ECN encapsulation/
decapsulation in userspace.  This adds the necessary constants for ECN
manipulation.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
2012-09-25 13:56:28 -07:00
Ethan Jackson
7cb57d10a9 packets: Remove redundant RARP header.
Rarp packets had their own header definition in the packets
library.  This doesn't make sense because they have the same packet
format as arps.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-07-26 17:18:13 -07:00
Ben Pfaff
4fba171d21 packets: Add ETH_TYPE_MPLS and ETH_TYPE_MPLS_MCAST.
We need these for OpenFlow 1.1 ofp_match support even if we don't support
MPLS matching (which we don't, yet).

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-12 21:19:16 -07:00
Ben Pfaff
6c99379ed4 packets: Define IPPROTO_SCTP if not provided by <netinet/in.h>.
SUSv3 doesn't require IPPROTO_SCTP so some systems might not provide it.

IPPROTO_SCTP isn't used in the tree yet so this doesn't fix a real bug.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-12 21:19:13 -07:00
Ethan Jackson
2ea838acb2 packets: Rename compose_benign_packet().
The name compose_rarp() more clearly describes what it's doing now.

Requested-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-07 18:24:29 -07:00
Ethan Jackson
38f7147c3e packets: Use RARPs for learning packets.
Traditionally Open vSwitch had used 802.2 SNAP packets to update
upstream switch learning tables when necessary.  This approach had
advantages in that debugging information could be embedded in the
packet helping hapless admins figure out what's going on.  However,
since both qemu and VMware use RARP for this purpose, it seems
appropriate to fall in line with the defacto standard.

Requested-by: Ben Basler <bbasler@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-07 17:25:30 -07:00
Ethan Jackson
05be4e2c6a packets: Generalize reserved RSPAN protocols.
Open vSwitch refuses to mirror certain destination addresses in
addition to those classified by eth_addr_is_reserved().  Looking
through the uses of eth_addr_is_reserved(), one finds that no
callers should be using the additional addresses which mirroring
drops.  This patch folds the additional addresses dropped in the
mirroring code, into the more general eth_addr_is_reserverd()
function.

This patch also changes the implementation in a way that is
slightly less efficient, but much easier to read and extend int he
future.

Bug #11755.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-06 17:43:33 -07:00
Ethan Jackson
3b842fc2f0 packets: Fix eth_addr_equal_except().
It turns out that eth_addr_equal_except() computed the exact
opposite of what it purported to.  It returned true if the two
arguments where *not* equal.  This is extremely confusing, so this
patch changes it.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-06 17:37:46 -07:00
Joe Stringer
3b4d8ad307 packets: Adds ethernet-matching helper functions
With OpenFlow 1.1 requiring arbitrary ethernet match support, it simplifies
other code if we have some extra helper functions. This patch adds
eth_mask_is_exact(mask), eth_addr_bitand(src, mask, dst),
eth_addr_equal_except(a, b, mask) and eth_format_masked(eth, mask, output).

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-29 11:08:11 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Ben Pfaff
7393104d1a dpif: Include TCP flags in "ovs-dpctl dump-flows" output.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-18 20:28:40 -07:00
Ben Pfaff
12113c394a packets: New function packet_get_tcp_flags(), factored out of dpif.
This will acquire a new user in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-15 10:18:10 -08:00
Ethan Jackson
c97664b30f packets: New packet_set_*() helper functions.
This commit pulls code used to modify L3 and L4 header fields
from dp_netdev into the packet library.  An additional user will
be added in a future commit.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-01-10 14:30:15 -08:00
Jesse Gross
c4ccff78ec packet: Match userspace and kernel definition of ICMP header.
Current userspace considers an ICMP header to be 4 bytes consisting
of the type, code, and checksum.  The kernel considers it to be 8
bytes because it also counts the two data fields that contain
type-specific information (and are always present).  Since flow
extract will zero out headers that are not completely present this
means that an ICMP packet that has a header of 5-7 bytes will be
interpreted differently by userspace and kernel.  This fixes the
problem by adopting the kernel's version of the ICMP header in
userspace.

Signed-off-by: Jesse Gross <jesse@nicira.com>
2011-12-27 10:42:30 -08:00
Ben Pfaff
df9b6612b5 flow: Make flow_compose() fake packets slightly more realistic.
This makes flow_extract() happier with TCP packets that this function
produces.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-12-19 14:53:57 -08:00
Ben Pfaff
e22f17535e packets: New function eth_from_hex().
An upcoming commit will add another user.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-12-19 14:53:41 -08:00
Ben Pfaff
f4ebc25ea0 packets: New function eth_pop_vlan(), formerly dp_netdev_pop_vlan().
An upcoming commit will add a new user.
2011-11-23 15:32:37 -08:00
Justin Pettit
fa8223b7fd Support matching IPv6 flow label.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2011-11-09 10:37:55 -08:00
Ben Pfaff
b37e6334fd datapath: Add multicast tunnel support.
Something like this, on two separate vswitches, works to try it out:
    route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
    ovs-vsctl \
        -- add-port br0 gre0 \
        -- set interface gre0 type=gre options:remote_ip=224.0.0.1

Runtime tested on Linux 3.0, build tested on Linux 2.6.18, both i386.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2011-10-24 12:27:36 -07:00
Justin Pettit
f740b8f6a1 packets.h: Fix STP destination MAC address. 2011-10-22 16:16:07 -07:00
Ben Pfaff
aad29cd1a1 packets: Add more utility functions for IPv4 and IPv6 addresses.
We had these functions scattered around the source tree anyway.  packets.h
is a good place to centralize them.

I do plan to introduce some additional callers.
2011-09-13 11:46:08 -07:00
Pravin Shelar
d9065a90b6 datapath: VLAN actions should use push/pop semantics
Currently the kernel vlan actions mirror those used by OpenFlow 1.0.
i.e. MODIFY and STRIP. More flexible approach is to have an action to
push a tag and pop a tag off, so that it can handle multiple levels of vlan
tags. Plus it aligns with newer version of OpenFlow.
        As this patch replaces MODIFY with PUSH semantic, action
mapping done in userpace is fixed accordingly.
        GSO handling for multiple levels of vlan tags is also added as
Jesse suggested before.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2011-09-09 18:13:26 -07:00
Ben Pfaff
3bffc610fa odp-util: New function odp_flow_key_from_string().
This will be used in upcoming commits.
2011-08-08 13:14:01 -07:00
Ben Pfaff
347d48798f packets: Remove unneeded !! from eth_addr_is_local().
There's no value in using !! on an operand of && or || as done here.
2011-07-08 10:47:22 -07:00
Ben Pfaff
d84d4b88d2 Fix incorrect byte order annotations.
These are not actual bugs, just deceptive use of the wrong function or
type.

Found by sparse.
2011-05-16 13:40:47 -07:00
Ethan Jackson
81aee5f901 lacp: Move LACP packet data to lacp header file. 2011-04-19 13:49:35 -07:00
Ben Pfaff
7c66b273a2 packets: New function eth_set_vlan_tci(), from dpif-netdev.
This will soon be used in the upcoming bond library.
2011-04-01 15:52:19 -07:00
Ben Pfaff
5de1bb5cc9 packets: New function snap_compose(); rename compose_packet() for consistency.
The following commit will introduce the first use of snap_compose().
2011-04-01 15:52:19 -07:00
Ethan Jackson
2a899f6e8a packets: Move CFM related packet information to cfm header file. 2011-03-25 13:57:21 -07:00
Ethan Jackson
40f78b38e7 packets: Create new compose_packet() function.
This commit generalizes compose_lacp_packet() into new
compose_packet() function.  This new function will be used to send
CCM messages in future patches.
2011-03-23 13:16:38 -07:00
Ethan Jackson
b0ce40eec4 packets: Rename LACP portid and sysid to port_id and sys_id.
This seems more stylistically consistent with the rest of the
code base and the sys_priority and port_priority in the same
struct.
2011-03-17 12:50:56 -07:00
Ethan Jackson
07a6cf771d packets: create new compose_lacp_pdu() function.
Creates new compose_lacp_pdu() from the old compose_lacp_packet()
function.  This will allow a LACP PDU to be created without
necessarily knowing the Ethernet Source Address required for
generating the packet.  Future patches rely on this functionality.
2011-03-17 12:49:34 -07:00
Ethan Jackson
c25c91fd5e vswitchd: Implement Link Aggregation Control Protocol.
This commit implements LACP, a protocol which allows directly
connected switches to automatically negotiate which links may
participate in bonds.  This commit disables LACP by default.  Once
sufficiently tested, LACP will be enabled in "active" mode on
bonded ports, and "passive" mode on all others.

Bug #4213.
2011-02-03 12:26:58 -08:00
Ethan Jackson
130f6e5faa packets: Add eth_addr_compare_3way function.
This commit adds eth_addr_compare_3way() which behaves like memcmp
for Ethernet addresses.
2011-02-03 12:24:13 -08:00
Ethan Jackson
d5ca4fce0d lib: Correct endianness of packets.h. 2011-02-03 12:24:13 -08:00
Justin Pettit
d31f1109f1 nicira-ext: Support matching IPv6 traffic.
Provides ability to match over IPv6 traffic in the same manner as IPv4.
Currently, the matching fields include:

    - IPv6 source and destination addresses (ipv6_src and ipv6_dst)
    - Traffic Class (nw_tos)
    - Next Header (nw_proto)
    - ICMPv6 Type and Code (icmp_type and icmp_code)
    - TCP and UDP Ports over IPv6 (tp_src and tp_dst)

When defining IPv6 rules, the Nicira Extensible Match (NXM) extension to
OVS must be used.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2011-02-02 12:53:26 -08:00
Justin Pettit
6767a2cce9 lib: Replace IP_TYPE_ references with IPPROTO_.
A few common IP protocol types were defined in "lib/packets.h".  However,
we already assume the existence of <netinet/in.h> which contains a more
exhaustive list and should be available on POSIX systems.
2011-02-02 11:50:17 -08:00
Ben Pfaff
36956a7d33 datapath: Convert odp_flow_key to use Netlink attributes instead.
One of the goals for Open vSwitch is to decouple kernel and userspace
software, so that either one can be upgraded or rolled back independent of
the other.  To do this in full generality, it must be possible to change
the kernel's idea of the flow key separately from the userspace version.
In turn, that means that flow keys must become variable-length.  This
commit makes that change using Netlink attribute sequences.

This commit does not actually make userspace flexible enough to handle
changes in the kernel flow key structure, because userspace doesn't yet
have enough information to do that intelligently.  Upcoming commits will
fix that.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2011-01-27 21:08:35 -08:00
Ethan Jackson
b31bcf60cf ovs: Implement 802.1ag Connectivity Fault Management
This commit implements a subset of the 802.1ag specification for
Connectivity Fault Management (CFM) using Continuity Check Messages
(CCM).  When CFM is configured on an interface CCMs are broadcast
at regular intervals to detect missing or unexpected connectivity.
2010-11-29 14:47:15 -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
26233bb461 datapath: Combine dl_vlan and dl_vlan_pcp.
This allows eliminating padding from odp_flow_key, although actually doing
that is postponed until the next commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2010-10-11 13:31:43 -07:00
Joe Perches
d295e8e97a treewide: Remove trailing whitespace
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-08-30 13:23:08 -07:00
Ben Pfaff
ba186119ca Remove vestigial support for Spanning Tree Protocol.
Open vSwitch has never properly supported IEEE 802.1D Spanning Tree
Protocol (STP), but it has various bits and pieces that claim to support
it.  This commit deletes them, to reduce the amount of dead code in the
tree.  We can always reintroduce it later if it proves to be a good idea.

Bug #1175.
2010-08-13 09:47:27 -07:00
Ben Pfaff
02dd3123a0 Merge "master" into "next". 2010-02-24 13:47:09 -08:00
Ben Pfaff
f119330116 datapath: Set the correct bits for OFPAT_SET_NW_TOS action.
The DSCP bits are the high bits, not the low bits.

Reported-by: Jean Tourrilhes <jt@hpl.hp.com>
2010-02-20 02:22:30 -08:00
Ben Pfaff
33ce24ed46 dpif-netdev: Fix validation of VLAN PCP value in userspace datapath.
Reported-by: Jean Tourrilhes <jt@hpl.hp.com>
2010-02-12 13:55:46 -08:00
Ben Pfaff
c69ee87c10 Merge "master" into "next".
The main change here is the need to update all of the uses of UNUSED in
the next branch to OVS_UNUSED as it is now spelled on "master".
2010-02-11 11:11:23 -08:00