2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00
Commit Graph

9773 Commits

Author SHA1 Message Date
Gurucharan Shetty
7894385af1 ovs-docker: Enhance documentation to handle pre-programmed interfaces.
Currently, Controllers and CMSes that integrate with Open vSwitch
after following the IntegrationGuide.md, expect to start VMs after
the underlying network infrastructure is ready. I have been asked
a few times on how to handle the same with containers. This commit
provides documentation on one way to achieve it.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
2014-12-15 09:46:49 -08:00
Thomas Graf
acf72f1322 lib: Add test for library usage
This test covers inclusion of public header files and basic usage
of the API such as vlog.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:25 +01:00
Thomas Graf
4a1f523f2d lib: Move vconn.h to <openvswitch/vconn.h>
Also moves definitions for struct vconn and pvconn to the public
header. The provider interface is kept private.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:22 +01:00
Thomas Graf
e6211adce4 lib: Move vlog.h to <openvswitch/vlog.h>
A new function vlog_insert_module() is introduced to avoid using
list_insert() from the vlog.h header.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:19 +01:00
Thomas Graf
55951e15e5 lib: Expose struct ovs_list definition in <openvswitch/list.h>
Expose the struct ovs_list definition in <openvswitch/list.h>. Keep the
list access API private for now.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:16 +01:00
Thomas Graf
ca6ba70092 list: Rename struct list to struct ovs_list
struct list is a common name and can't be used in public headers.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:12 +01:00
Thomas Graf
8c7be52d10 lib: Expose SAT_MUT as OVS_SAT_MUL in <openvswitch/util.h>
Insted of exposing the full sat-math.h API, only the macros
used in headers is exposed through <openvswitch/util.h>

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:08 +01:00
Thomas Graf
d668c4a941 lib: Move token-bucket.h to <openvswitch/token-bucket.h>
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:05 +01:00
Thomas Graf
904e080443 lib: Expose ovs_mutex and ovsthread_once in <openvswitch/thread.h>
This picks the ovs_mutex and ovsthread_once API from lib/ovs-thread.h
and exposes it in <openvswitch/thread.h>.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:01 +01:00
Thomas Graf
8f3676cfce lib: Expose SOURCE_LOCATOR as OVS_SOURCE_LOACATOR
Required to expose headers which depend on SOURCE_LOCATOR

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:14:58 +01:00
Thomas Graf
cab5044987 lib: Move compiler.h to <openvswitch/compiler.h>
The following macros are renamed to avoid conflicts with other headers:
 * WARN_UNUSED_RESULT to OVS_WARN_UNUSED_RESULT
 * PRINTF_FORMAT to OVS_PRINTF_FORMAT
 * NO_RETURN to OVS_NO_RETURN

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:14:47 +01:00
Alex Wang
9a8d2f8c49 ovs-command-completion: Fix unwanted whitespace.
This commit fixes unwanted whitespace in the ovs
bash completion script output.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
2014-12-13 21:47:35 -08:00
Alex Wang
0c7812e5eb recirculation: Do not drop packet when there is no match from
internal table.

In current recirculation implementation, the flow misses (with
'recirc_id' set) are always looked up on the receiving bridge's
internal flow table.  However, the bond port may actually reside
on another bridge which gets connected to the receiving bridge
via patch port.  Since the recirculation rules are pushed to the
other bridge's internal table, the flow lookup on the receiving
bridge will match nothing but the drop rule, causing unexpected
packet drops.

This commit fixes the above bug via keeping lookup the misses
(with 'recirc_id' set) in default table (table 0) and processing
it until reaching the bridge that owns the bond port.  Then,
the misses can hit the post recirculation flows as expected.

VMware-BZ: 1362178

Reported-by: Ansis Atteka <aatteka@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
2014-12-12 21:36:17 -08:00
YAMAMOTO Takashi
bc78679762 ovs-router: Add "ovs/route/lookup" command
This command is useful at least for testing.

Example output:
    % ovs-appctl ovs/route/lookup '10.0.0.1'
    gateway 172.17.0.254
    dev wm0
    %

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2014-12-12 11:55:32 +09:00
Jan Vansteenkiste
2e601425c6 debian: Use ifquery for finding the interfaces in init script.
When using interfaces.d/<foobar>, interfaces are not picked up.
Let ifquery figure out the format of the interfaces files for us.

Signed-off-by: Jan Vansteenkiste <jan@vstone.eu>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-11 17:36:24 -08:00
Shu Shen
3a11fd5b2b ofproto: add support of OFPR_GROUP as packet-in reason for OF1.4+
When the Packet-In message is triggered by a group action, OFPR_GROUP is
passed internally as the reason. The wire_reason() function converts the
reason to OFPR_ACTION if the wire protocol is earlier than OF1.4.

The wire_reason() function also converts other unsupported reasons
(i.e., OFPR_ACTION_SET and OFPR_PACKET_OUT) to OFPR_ACTION if it detects
a wire protocol earlier than OF1.4.

By default reason code OFPR_GROUP for Packet-In will be enabled for
async messages as in ofconn_flush(). Upon a connection being established
with a controller, the protocol version is checked and OFPR_GROUP will
be disabled in async config if the protocol is lower than OF1.4. Any
controller running OF1.4+ is still be able to enable OFPR_GROUP at its
will without being affected by this check.

The patch also includes tests cases for both OF1.3 and OF1.4 to ensure
proper reason code is given for packet-in message triggered by group
action.

Signed-off-by: Shu Shen <shu.shen@radisys.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-11 17:32:48 -08:00
Robert Åkerblom-Andersson
4819e33042 vtep: Add codeblocks for example commands in README.ovs-vtep.md.
Signed-off-by: Robert Åkerblom-Andersson <Robert.nr1@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-11 16:47:36 -08:00
Nithin Raju
1ad44ad455 datapath-windows: return bool from NlFillOvs[Msg/Hdr]
Per review comment, in this patch, we update the return values of
NlFillOvsMsg() and NlFillOvsHdr() from NTSTATUS to BOOLEAN to make them
consistent with the Nl* functions.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-11 16:43:52 -08:00
Nithin Raju
5fc8ea2d6f datapath-windows: refactor BuildReplyMsgFromMsgIn & BuildErrorMsg
In this patch, we consolidate code in Netlink.c.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-11 16:43:35 -08:00
Joe Stringer
9ab0fce179 dpif: Use DPIF_FP_MODIFY for feature probes.
If ovs-vswitchd is killed at the right time, then a probe flow may be
left in the datapath. This commit adds the DPIF_FP_MODIFY flag to
feature probes so that re-creating the same probe flow will not cause an
error.

These flow_put flags were previously changed in commit a7d1bbdcfe
("ofproto-dpif: Use DPIF_FP_CREATE but not DPIF_FP_MODIFY."), despite
the commit message addressing a different case.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-12 12:35:17 +13:00
Joe Stringer
2c85851f8e dpif: Refactor datapath feature detection.
Various functions in ofproto-dpif and dpif-netlink detect support for
features in very similar ways. Refactor their common code to a single
function.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-12 12:35:16 +13:00
Joe Stringer
bff6067904 dpif: Don't initialize output UFID in dpif_flow_get().
The UFID parameter to dpif_flow_get() is optional, but the current
implementation dereferences it to initialize part of the output flow.
This field is filled in by the dpif implementation, so don't initialize
it here.

This does not fix any existing bug because every caller currently passes
in a UFID. The next patch will introduce the first call to
dpif_flow_get() that doesn't provide a UFID, which would break without
this change.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-12 12:34:58 +13:00
YAMAMOTO Takashi
36673528f8 route-table-bsd: Add some DBG logs
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-10 13:38:06 +09:00
YAMAMOTO Takashi
a7701e29b2 route-table-bsd: Provide gateway info
For userspace tunneling.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-10 13:38:03 +09:00
YAMAMOTO Takashi
88ffdc93c8 ovs-router: non-Linux support
Refactor ovs-router so that it can work with non-Linux platforms
at least in some extent, using the existing route-table code as
a fallback.  Known restriction: for such platforms, "ovs/router/show"
command does not show "Cached" kernel routes.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2014-12-10 13:38:01 +09:00
YAMAMOTO Takashi
6595fb00f0 route-table-bsd: Stop caching pid
The cache here doesn't work anymore as the recent
commit b772066ffd
("route-table: Remove Unregister.")
made this function called before daemonizing,
thus with a different pid.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-10 13:37:58 +09:00
Thomas Graf
56a3eb24e7 datapath: Account for already defined NETIF_F_GSO_ENCAP_ALL
Relates-to: f6eec614 ("openvswitch: Enable tunnel GSO for OVS bridge.")
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2014-12-09 17:09:30 -08:00
Thomas Graf
4510f85327 datapath: Mark compatible with kernels up to 3.18.x
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2014-12-09 17:09:28 -08:00
Thomas Graf
0fcc086dc7 datapath: Check if nla_is_last() is available in <net/netlink.h>
nla_is_last() is not available in 3.18, it's only in net-next.
Convert to grep based to check to account for distribution backports.

Fixes: 684b5f ("datapath: Rename last_action() as nla_is_last() and move to netlink.h")
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2014-12-09 17:09:26 -08:00
Eohyung Lee
67ce407f56 ovs-tcpundump: Fix typo in version message.
Signed-off-by: Eohyung Lee <liquidnuker@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-09 08:57:04 -08:00
Ben Pfaff
b43f1bfa1c include/openvswitch/util: Add extern "C" { ... }.
Requested-by: Alan Shieh <ashieh@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
2014-12-08 21:19:39 -08:00
Joe Stringer
4c438b67ee revalidator: Fix access of uninitialized memory.
Commit 64bb477 "dpif: Minimize memory copy for revalidation." introduced
a bug where the corner case of ukey creation (in revalidator threads)
could result in access to uninitialized memory when deleting flows from
the datapath. This could result in OVS aborting or deadlock. Fix it.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-08 17:35:14 -08:00
Jarno Rajahalme
66e1d95523 tests/classifier: Make test work in big-endian systems.
Change a test so that the result will be the same in both
little-endian and big-endian systems by editing the test case so that
only one bit differs.

Reported-by: Mijo Safradin <mijo@linux.vnet.ibm.com>
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-08 10:10:07 -08:00
Ben Pfaff
914624f817 ofp-actions: Support "copy_field" ONF extension to OpenFlow 1.3.
ONF-JIRA: EXT-320
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
2014-12-05 15:14:29 -08:00
Ben Pfaff
232c1e1277 ofp-actions: Add support for ONF extension actions.
Preparation for supporting ONFACT_ET_COPY_FIELD.

ONF-JIRA: EXT-320
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
2014-12-05 15:14:29 -08:00
Ben Pfaff
650763d8a8 ofp-actions: Update "copy_field" to latest OF1.5 draft.
Since my original prototype, the oxm_id_len field was removed and
replaced by 2 bytes of padding.

ONF-JIRA: EXT-320
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
2014-12-05 15:14:29 -08:00
Alex Wang
7631e9bc52 tunnel: Recreate tunnel port only when the netdev status change.
On current master, the 'struct tnl_port' in tunnel module will be
recreated whenever the global connectivity sequence number changes
(e.g. when adding unrelated flow).  This is unnecessary and could
cause drop of tunnel packet if a lookup happens between the removal
and recreate.

This commit fixes the above issue by only checking the netdev's own
sequence number.

Found by code inspection.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
2014-12-05 14:02:53 -08:00
Joe Stringer
ec26264171 ovs-bugtool: Log more detail for dumped flows.
The standard mode for printing flows doesn't always provide the full
range of information that is available, particularly with the UFID
changes. Turn on more detail.

Suggested-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
2014-12-05 13:17:06 -08:00
Thomas Graf
33a58fc69e travis: Only run testsuite for gcc builds
This reduces the total travis build time significantly.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-05 12:36:06 -08:00
Thomas Graf
517f93116b travis: Extended kernel build matrix
When doing test builds, build against the following kernels:
  - KERNEL=3.17.4
  - KERNEL=3.16.7
  - KERNEL=3.14.25
  - KERNEL=3.12.33
  - KERNEL=3.10.61
  - KERNEL=3.4.104
  - KERNEL=2.6.32.64

When doing pure kernel test builds, skip compilation of user space bits.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-05 12:35:08 -08:00
Ben Pfaff
b6fe204d2d FAQ.md: Correct claims about MPLS.
An examination of the source code and the tests shows that the FAQ claimed
more for version 2.3 than was really in there.

Reported-by: null pointer <null.pointer.boom@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
2014-12-05 11:33:57 -08:00
Robert Åkerblom-Andersson
b770275d10 FAQ: Fix formatting for command block.
Signed-off-by: Robert Åkerblom-Andersson <Robert.nr1@gmail.com>
2014-12-05 11:06:13 -08:00
Thomas Graf
a0ddac4bf3 doc: Fix up markdown syntax in tutorial/Tutorial.md
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-05 10:35:48 -08:00
Nithin Raju
65d04c593f datapath-windows: nuke unused code in Flow.c
Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-05 10:30:37 -08:00
Nithin Raju
fa8266a805 datapath-windows: Move Build*Msg() to Netlink.c
Moving the functions that build netlink messages to Netlink.c from
Vport.c

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-05 10:30:20 -08:00
Eitan Eliahu
3100516ad7 datapath-windows: Add PID Number attribute for port notification / Fix logic
[1] User mode OVS expects to have the PID number in the port state
    notification command
[2] Fix logic error-for-Windows-user-mode

Signed-off-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-12-05 10:25:38 -08:00
Ben Pfaff
fa07848939 ofp-actions: Only set defined bits when encoding "load" actions.
Commit 7eb4b1f1d7 ("ofp-actions: Support OF1.5 (draft) masked
Set-Field, merge with reg_load.") introduced a bug in that a set_field
action that set an entire field would be translated incorrectly to
reg_load, if the field being set only occupied a portion of the bytes that
it contains.  For example, an MPLS label is 20 bits but has a 4-byte field,
which meant that a set_field would get translated into a reg_load that
wrote all 32 bits; in turn, the receiver of that reg_load would reject it
because it was attempting to set invalid bits (the top 12 bits).

This commit fixes the problem by omitting invalid bits when encoding a
reg_load action.

Reported-by: Pravin Shelar <pshelar@nicira.com>
Tested-by: Pravin Shelar <pshelar@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2014-12-05 10:13:16 -08:00
Joe Stringer
b2fc6a7447 util: Fix include for htonl().
Commit 526a7c85d1 "util: Add be32_prefix_mask()." added an include for
byte-order.h into util.h, which could cause link failures if users of
libopenvswitch defined their own version of htonll(). Change the
include, as only htonl() is needed and arpa/inet.h provides this.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2014-12-04 16:36:03 -08:00
Joe Stringer
819e3cdec6 cccl: Respect silent flags.
Automake sets $V to tell the compiler whether to print verbose messages
as it compiles or not. Add support for this variable in cccl, allowing
more quiet build output on windows if the build is configured with
--silent or the developer runs make V=0.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
2014-12-04 14:31:48 -08:00
Joe Stringer
5b7278a122 tests: Fix race in async config test.
Occasionally, the testsuite would send the OFPT_SET_ASYNC before
ovs-vswitchd got a chance to send its OFPT_ROLE_REPLY message, causing a
reordering of the testsuite output and a false positive. Give the test
script something extra to do so this is less likely to happen.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
2014-12-04 13:58:48 -08:00