cc1: warnings being treated as errors
../ofproto/ofproto-dpif.c: In function ‘dpif_show_backer’:
../ofproto/ofproto-dpif.c:8305: error: format ‘%llu’ expects type ‘long
long unsigned int’, but argument 4 has type ‘size_t’
../ofproto/ofproto-dpif.c:8305: error: format ‘%llu’ expects type ‘long
long unsigned int’, but argument 5 has type ‘size_t’
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
Returning a static data buffer makes code more brittle and definitely
not thread-safe, so this commit switches to using a caller-provided
buffer instead.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Returning a static data buffer makes code more brittle and definitely
not thread-safe, so this commit switches to using a caller-provided
buffer instead.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
Some tools do not like text files that lack a trailing new-line. In
particular, Debian's dpkg-source utility complains about a missing new-line
in the file generated by ovsdb-idlc:
dpkg-source: warning: file
openvswitch-1.9.2+git20130605/lib/vswitch-idl.ovsidl has no final
newline (either original or modified version)
This commit fixes the problem.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
In almost all cases, ovs-vswitchd runs with a single datapath, and
therefore a single governor. Therefore, it's usually clear from
context what governor log messages are referring to making the name
redundant. This patch removes it.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Conceptually, a subfacet represents a datapath flow key, and
therefore belongs more to a datapath more than it does to a bridge.
This patch moves the subfacet hmap from 'struct ofproto_dpif' to
'struct dpif_backer', simplifying the code in the process.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
With the single datapath, it no longer makes sense to have a per
ofproto flow eviction threshold. This patch moves the flow
eviction threshold to the Open_vSwitch table making the setting
global, though still treated separately for each ofproto. A future
patch will unify flow eviction on a per datapath basis.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Subfacets being per-datapath entities, their statistics are really
only interesting at per-datapath granularity. This patch moves
them to the dpif_backer and makes some related simplifications.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Before this patch, statistics about subfacet average life span,
and count in the datapath, were calculated over the entire lifetime
of the ofproto. Furthermore, the subfacet lifespan was only
updated when a subfacet was removed from the datapath causing long
lived subfacets to be ignored. It's far more useful to know these
numbers averaged over all subfacets in the recent past. This patch
changes the code to implement an exponentially weighted moving
average updated every time statistics are pulled from the datapath.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
These functions will not have the same useful effect when Open vSwitch
becomes multithreaded, because time_disable_restart() will disable time
advancing for every thread, not just for the thread that calls it.
These functions are no longer used, so this commit removes them.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Returning a static data buffer makes code more brittle and definitely
not thread-safe, so this commit switches to using a caller-provided
buffer instead.
Signed-off-by: Ben Pfaff <blp@nicira.com>
The ports that exist within a dpif have already been translated through
netdev_vport_get_dpif_port(), so there is no value to translating them
again in the interfaces that query or dump ports (and possibly a drawback
if somehow the translation could change).
After this change, dpif-netdev translates port names in just one place,
the port_add path, which makes dpif-netdev act the same way as dpif-linux
in this respect.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
facet_check_consistency() goes to some effort to create informative
error messages, protected by a rate limit, but does not actually
log these messages.
This appears to be an unintended side effect of
4dff909776 ("ofproto-dpif: Move
odp_actions from subfacet to facet."). This patch restores the
logging behaviour present prior to the above commit.
This patch also reverses a changes made by the same commit to use
ds_put_cstr() instead of ds_put_char() in facet_check_consistency().
Cc: Justin Pettit <jpettit@nicira.com>
Cc: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
There is no need to do so because the signal handler does not read or
write 'deadline'.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
The ethertype should always be updated on mpls_pop
as there may be a transition between MPLS unicast (0x8847) and
MPLS multicast (0x8848).
Ben Pfaff tells me that this is consistent with the
behaviour described in EXT-194 of the JIRA bug tracker.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Now that execute_actions() is available it can be used as a generic
replacement for special-case action execution in
execute_controller_action().
As suggested by Jesse Gross.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
The motivation for this is to allow such actions to be honoured
if they are encountered; by the user-space datapath before recirculation;
or by internal processing of actions by ovs-vswitchd before recirculation.
Recirculation will be added by a subsequent patch.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Rename tun_key_from_attr() as odp_tun_key_from_attr() and export it.
This is in preparation for calling this function outside of odp-util.c.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Found a bug that OVS allows goto_table_id to be smaller than (or equal to)
the current table id where the flow resides. It potentially creates an
infinite loop when composing actions for a packet. To fix it, we just let
OVS returns an error message to prevent such flow to be programmed.
Signed-off-by: Jing Ai <jinga@google.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
It appears that the size_t definition was supplied through header leakage
on other platforms after commit eee8089cbe
(signals: Make signal_name() thread-safe.).
Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
strsignal() isn't thread-safe but sys_siglist[] is. Also, according to
the glibc manual, BSD has sys_siglist[] but not strsignal().
Signed-off-by: Ben Pfaff <blp@nicira.com>
When the OFPC_FRAG_DROP policy is in effect, IP fragments are supposed to
be dropped before they reach the flow table. Open vSwitch properly dropped
IP fragments in this case, but still accounted them to the packet and byte
counters for the flow that they would have hit if the OFPC_FRAG_NX_MATCh
policy had been in effect.
Reported-by: love you <thunder.love07@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
The reserved multicast Ethernet addresses begin with 01:80:c2, not
01:08:c2.
Reported-by: Padmanabhan Krishnan <kprad1@yahoo.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
This patch fixes a typo in the comment of the pktbuf_retrieve() function.
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
avoid using some GNU sed extensions, which are not available
eg. on NetBSD's /usr/bin/sed.
while there are other places these extenstions are used in the testsuite,
this instance is new and seems the only one currently being executed
for NetBSD.
Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This patch changes the variable type of "ofport" in "struct if_cfg" and
"struct iface" from int64_t to uint16_t. This is more consistent with
the OpenFlow-1.0 port definition.
Also, before this patch, -1 is used to indicate an unknown port. This
patch uses OFPP_NONE, since "ofport" becomes uint16_t.
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Always update the ids pointer after calling ofpbuf_put()
to ensure that it is valid when accessed.
During testing a case came up where the call to ofpbuf_put() in the
for (i = 0; i < ids->n_controllers; i++) loop would cause the underlying
buffer to be reallocated. This resulted in ids->n_controllers being an
incorrect value, the loop continuing on longer than desired and finally a
segmentation fault.
Reported-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
If ofproto decided to change the netdev of a particular ofport,
cfm_demand mode would improperly continue using the old netdev to
collect stats.
Bug #17583.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Commit 52a90c29 (Implement new "VLAN splinters" feature) passed in OpenFlow
port number to vsp_realdev_to_vlandev() function which asks for datapath port
number.
This patch fixes this bug by making the vsp_realdev_to_vlandev() function
take in and return OpenFlow port number.
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
It has been observed that when we upgrade openvswitch with
thousands of openflow flows already established and there is heavy
traffic going through the switch, restoring flows can take a very
long time (8 minutes in one use case) with CPU running at 100%.
This can make the upgrade very expensive.
This commit starts vswitchd by asking it to wait till flow restore is
finished. Once the flows are restored, it resumes normal operations.
Bug #16086.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Currently we are adding the manager after starting ovs-vswitchd.
Instead, add the manager after flow restore is completed.
Bug #16086.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
While upgrading openvswitch, it helps to restore openflow flows before
starting packet processing. Typically we want to restart openvswitch,
add the openflow flows and then start packet processing.
To do this, we look for the other_config:flow-restore-wait column
in the Open_vSwitch table during startup. If set as true, we disable
receiving packets from the datapath, expiring or flushing flows and
running any periodic ofproto activities. This option does not prevent
the addition and deletion of ports. Once this option is set to false,
we return to normal processing.
An upcoming commit will use this feature in Open vSwitch startup scripts.
Bug #16086.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>