This patch adds a new object called 'struct xlate_cache' which can be
set in 'struct xlate_in', and passed to xlate_actions() to cache the
modules affected by this flow translation. Subsequently, the caller can
pass the xcache to xlate_push_stats() to credit stats and perform side
effects for a lower cost than full flow translation.
These changes are aimed currently at long-lived flows, decreasing the
average dump duration for such flows by 50-80%. This allows more flows
to be supported in the datapath at a given time. Applying these changes
to short-lived flows is left for a later commit.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
---
v2: Acked.
v1: Add caching for fin_timeout action.
Expire netflows on xlate_cache_clear().
Account to bonds using a copy of 'flow' rather than hash.
Always build XC_NORMAL entry (previously only if may_learn is true)
Rename xlate_from_cache()->xlate_push_stats()
Add may_learn parameter to xlate_push_stats()
Tidy up xlate_actions__() mirror/netflow code.
Fold in style fixups.
RFC: First post.
Joe Stringer [Tue, 4 Mar 2014 01:23:12 +0000 (17:23 -0800)]
ofproto: New function ofproto_refresh_rule().
This function checks for a rule in the classifier:
* If the rule exists, reset its modified time.
* If an equivalent rule exists, reset that rule's modified time.
* If no rule exists, re-install the rule and reset its modified time.
* Finally, return the rule that was modified.
This function will be used to ensure that hard timeouts for learnt rules
are refreshed if traffic consistently hits a rule with a learn action in
it. The first user will be the next commit.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
---
v2: Acked.
v1: Ensure rule->modified is updated correctly.
RFC: First post.
Andy Zhou [Wed, 9 Apr 2014 01:42:39 +0000 (18:42 -0700)]
dpif-netdev: Move hash function out of the recirc action, into its own action
Currently recirculation action can optionally compute hash. This patch
adds a hash action that is independent of the recirc action, which
no longer computes hash. For megaflow bond with recirc, the output
to a bond port action will look like:
hash(hash_l4(0)), recirc(<recirc_id>)
Obviously, when a recirculation application that does not depend on
hash value can just use the recirc action alone.
Signed-off-by: Andy Zhou <azhou@nicira.com> Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Acked-by: Pravin B Shelar <pshelar@nicira.com
Andy Zhou [Wed, 16 Apr 2014 15:04:23 +0000 (08:04 -0700)]
ofproto-dpif: xlate should not attribute stats to bond entry when using recirc
When recirculation is used to implement bond, the bond entry stats are
collected from the hidden post recirculation rules. This bug causes
double counting of stats to some strenuous bond entries.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Andy Zhou [Wed, 16 Apr 2014 14:51:02 +0000 (07:51 -0700)]
ofproto/bond: Keep hash entry slave valid.
Bond recirculation needs to refresh the 'hidden rules' from
time to time. Keep hash entry slave valid to prevent those
hidden rules from being removed.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Andy Zhou [Wed, 16 Apr 2014 08:36:59 +0000 (01:36 -0700)]
ofproto/bond: only display hash entries with tx_byptes > 1KB
When recirculation is used to implement bond, all bond entries are
always populated regardless whether there is traffic going through
them or not. This change cuts down the noise when running
'ovs-appctl bond/show', by skipping '0KB' entries.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Alex Wang [Tue, 15 Apr 2014 06:37:10 +0000 (23:37 -0700)]
datapath: Allow each vport to have an array of 'port_id's.
In order to allow handlers directly read upcalls from datapath,
we need to support per-handler netlink socket for each vport in
datapath. This commit makes this happen. Also, it is guaranteed
to be backward compatible with previous branch.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Thomas Graf <tgraf@redhat.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
Joe Stringer [Mon, 14 Apr 2014 18:36:21 +0000 (18:36 +0000)]
ofproto/bond: Protect statistics with writelock.
dcf00ba35a0 (ofproto/bond: Implement bond megaflow using recirculation)
allowed bond_entry statistics to be modified while holding a readlock.
This patch modifies bond_entry_account() to get a writelock before
modifying the statistics and adds thread-safety annotations to these
fields and relevant functions.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Andy Zhou <azhou@nicira.com>¬
Zoltan Kiss [Fri, 11 Apr 2014 16:16:48 +0000 (17:16 +0100)]
datapath: Orphan frags in skb_zerocopy and handle errors
This is the ported version of commit 36d5fe6a with the same name from net-next.
Apart from the small datapath.c changes it adjust the compat layer files as
well. This is the original commit message:
"skb_zerocopy can copy elements of the frags array between skbs, but it doesn't
orphan them. Also, it doesn't handle errors, so this patch takes care of that
as well, and modify the callers accordingly. skb_tx_error() is also added to
the callers so they will signal the failed delivery towards the creator of the
skb."
Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
Ben Pfaff [Fri, 11 Apr 2014 20:05:45 +0000 (13:05 -0700)]
Makefile.am: Fix build hang when .git and Git are present but don't work.
If the .git directory is there, and "git --version" works, but "git
ls-files" fails to print any file names (e.g. perhaps because .git is a
symlink to an inaccessible directory) then the "grep" command in the
thread-safety-check rule would hang forever because it had an empty list
of files and therefore expected to read from stdin. This fixes the problem
by adding the name of an empty file to the command, which is harmless.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
It would seem we should set the 'tunnel.ip_dst' in 'wc' when calling
tnl_port_should_receive(), as it is reading that flow field. However,
since tunnels' datapath port numbers are different from the non-tunnel
ports, and we always unwildcard the 'in_port', we do not need to
unwildcard the 'tunnel.ip_dst' for non-tunneled packets.
Also, 'nw_tos' need not be unwildcarded if it is not examined.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 11 Apr 2014 17:39:20 +0000 (10:39 -0700)]
debian: Better document how to get a kernel module in README.Debian.
This moves existing text from INSTALL.Debian into the README.Debian
installed as part of the openvswitch-switch package, and adds a reference
from the former to the latter.
Reported-by: Brian Candler <b.candler@pobox.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Gurucharan Shetty <gshetty@nicira.com>
Alex Wang [Thu, 3 Apr 2014 17:07:20 +0000 (10:07 -0700)]
ofproto: Use netdev's 'change_seq' to reduce port modification check.
This commit uses the 'change_seq' in 'struct netdev' to determine
whether to update the 'ofport'. This helps eliminate unnecessary
update.
In the experiment of configuring 5K internal port, there is neither
observable configuration overhead nor additional cpu consumption
after configuration finishes. When one internal port state is
flapped every 0.3 second, this commit reduces the cpu utilization
of ovs-vswitchd thread from 40 to 12.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Thu, 3 Apr 2014 16:46:31 +0000 (09:46 -0700)]
netdev-dpdk: Indicate the change of etheraddr and mtu.
This commit makes the netdev-dpdk module signal the change of
etheraddr and mtu by changing the global sequence number and
incrementing its 'change_seq'.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Alex Wang [Thu, 3 Apr 2014 07:17:34 +0000 (00:17 -0700)]
netdev: Add 'change_seq' back to netdev.
This commit can be seen as a partial revert of commit da4a619179d (netdev: Globally track port status changes)
by adding the 'change_seq' to 'struct netdev'.
Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 17 Mar 2014 21:32:16 +0000 (14:32 -0700)]
netflow: Correctly track flow creation time.
'created' is supposed to be the time the flow was created, but it was
getting reset to zero on every expiration, causing the flow start time to
be wonky after the first active expiration on a flow.
Reported-by: Lior Neudorfer <lior@guardicore.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Thu, 10 Apr 2014 04:57:51 +0000 (16:57 +1200)]
SubmittingPatches: Rename to CONTRIBUTING.
This makes the GitHub interface aware of the contribution guidelines,
so it will be displayed to contributors when they submit issues or pull
requests.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Joe Stringer [Wed, 9 Apr 2014 23:14:07 +0000 (11:14 +1200)]
tests/ofproto-dpif: Use vlog to test dpif behaviour.
Previously we made heavy use of the 'ovs-appctl dpif/dump-flows' command
to verify that flows were being installed into the datapath correctly.
However this is sensitive to timing, particularly when the behaviour of
revalidator threads is modified. A common race condition involves flows
being revalidated and deleted before the test script gets a chance to
connect to ovs-vswitchd and dump the datapath flows.
This patch reworks the tests to make use of the vlog facility for dpif,
checking for flow installation and flow dump messages. Most tests are
converted to check for flow installation, which should reduce these race
conditions significantly. For tests that require packet counts, these
will continue to check for flow_dump messages. Race conditions for these
should be reduced but not eliminated.
Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
If the field does not exist, nothing is set. However, we must
unwildcard the bits we used to make the decision, and we need not
unwildcard the field and it's prerequisities, if nothing is set.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Tests: Fix ofproto/trace and expose megaflows when having a set action.
ofproto/trace incorrectly reported the megaflow based on the modified
flow, rather than the original flow key. Now the original flow key is
stored before any modifications and is used for reporting the megaflow.
Also, flow reporting is suppressed only for resubmit flows, so that
the final flow will be printed if it is different from the incoming
flow key.
Test for the megaflow key and mask with flows having set actions.
This helps in verifying the correctness of operation with masked set
actions in the following patches.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Later patches rely on the DSCP and ECN masks to be properly set when
the fields are read. Also, avoid reading nw_tos if tunnel's inner
packet is not IP.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Tue, 8 Apr 2014 18:32:57 +0000 (11:32 -0700)]
dpif-netdev: preserve packet metadata fields across recirculation
If the actions executed during recirculation changed metadata fields,
then any actions after the recirculation returns would see those new
values. Now, all metadata are saved and restored across a recirculation.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Andy Zhou [Tue, 8 Apr 2014 04:49:07 +0000 (21:49 -0700)]
dpif: Wildcard bond output port with recirculation
This patch took advantage of the recirculation infrastructure
introduced in commit adcf00ba35a0, allowing megaflows to be generated
when the flow output to bond ports.
Without recirculation, it is necessary flows output to Bond ports
in balance_tcp mode to unmask all hash fields. With recirculation,
masking of hash fields is no longer required as kernel
now hashes each packet and redirects packets based on the hash value
using recirculation.
This patch removes the masking requirements when recirculation is
in use. Datapaths do not support recirculation are still supported,
but without the benefits of megaflow.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
datapath: supply a dummy err_handler of gre_cisco_protocol to prevent kernel crash
When use gre vport, openvswitch register a gre_cisco_protocol but
does not supply a err_handler with it. The gre_cisco_err() in
net/ipv4/gre_demux.c expect err_handler be provided with the
gre_cisco_protocol implementation, and call ->err_handler() without
existence check, cause the kernel crash.
Ben Pfaff [Tue, 8 Apr 2014 22:39:18 +0000 (15:39 -0700)]
datapath: Fix tracking of flags seen in TCP flows.
Flow statistics need to take into account the TCP flags from the packet
currently being processed (in 'key'), not the TCP flags matched by the
flow found in the kernel flow table (in 'flow').
This bug made the Open vSwitch userspace fin_timeout action have no effect
in many cases.
Bug #1219516. Reported-by: Len Gao <leng@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Andy Zhou [Wed, 5 Mar 2014 23:27:31 +0000 (15:27 -0800)]
ofproto/bond: Implement bond megaflow using recirculation
Infrastructure to enable megaflow support for bond ports using
recirculation. This patch adds the following features:
* Generate RECIRC action when bond can benefit from recirculation.
* Populate post recirculation rules in a hidden table. Currently table 254.
* Uses post recirculation rules for bond rebalancing
* A recirculation implementation in dpif-netdev.
The goal of this patch is to be able to megaflow bond outputs and
thus greatly improve performance. However, this patch does not
actually improve the megaflow generation. It is left for a later commit.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Fri, 4 Apr 2014 20:37:33 +0000 (13:37 -0700)]
tests: Remove problematic but questionably useful part of ovsdb-server test.
The test "ovsdb-server combines updates on backlogged connections" first
checks that ovsdb-server can combine transactions, and then checks that
it can keep them separate. The latter part is hard to force because it
requires making sure that the socket buffer never fills up, and it also
isn't a very useful test (it doesn't check for any kind of correctness).
Therefore, this commit removes it.
Simon Horman [Mon, 7 Apr 2014 16:43:04 +0000 (16:43 +0000)]
ofp-parse: Handle buffer resize when parsing actions
A call to ofpbuf_put() may cause the data of the passed to be resized and
its base address to change. Thus the address returned by ofpbuf_put()
should be used as the base address rather than relying on the base address
prior to ofpbuf_put().
This avoids the following assertion in ofpact_update_len() from failing
when ofpbuf_put() causes a resize in parse_note(), parse_noargs_dec_ttl(),
parse_dec_ttl().
ovs_assert(ofpact == ofpacts->frame);
This restores pointer updates removed by and resolves a regression
introduced by cf3b7538666cd1ef ("ofpbuf: Abstract 'l2' pointer and document
usage conventions.").
Test cases have also been added to exercise this buffer resize in
parse_note(), parse_noargs_dec_ttl(), parse_dec_ttl().
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
YAMAMOTO Takashi [Mon, 31 Mar 2014 06:11:19 +0000 (15:11 +0900)]
ofproto-dpif.at: Wait for the monitor's pidfile disappears where necessary
These tests invokes ovs-ofctl monitor twice or more.
Because "ovs-appctl -t ofctl exit" does not wait for the target
process exit, there are chances to see the pid file from the previous
incarnation.
OVS_APP_EXIT_AND_WAIT macro was provided by Ben Pfaff.
Acked-by: Ben Pfaff <blp@nicira.com> Co-authored-by: Ben Pfaff <blp@nicira.com> Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Ben Pfaff [Sat, 5 Apr 2014 02:26:22 +0000 (19:26 -0700)]
ofp-print: Fix misaligned data access in ofp_print_error_msg().
The body of an OpenFlow error message often contains an inner OpenFlow
message, and when it does, the inner message starts at an odd multiple of 4
bytes from the beginning of the outer message. That means that, on RISC
systems, accessing the inner message directly causes a bus error. This
commit fixes the problem in a way that should make it difficult to recur.
This fixes the failure of tests 643, 645, and 651 on sparc seen here:
https://buildd.debian.org/status/fetch.php?pkg=openvswitch&arch=sparc&ver=2.1.0%2Bgit20140325-1&stamp=1396438624
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Ben Pfaff [Sat, 5 Apr 2014 03:21:15 +0000 (20:21 -0700)]
packets: Fix misaligned data accesses for MPLS and SCTP fields.
The other 32-bit data fields in protocol headers were already using
ovs_16aligned_be32, but MPLS and SCTP had been overlooked. This fixes
the failure of test 681 seen here:
https://buildd.debian.org/status/fetch.php?pkg=openvswitch&arch=sparc&ver=2.1.0%2Bgit20140325-1&stamp=1396438624
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Ben Pfaff [Sat, 5 Apr 2014 17:27:05 +0000 (10:27 -0700)]
dpif-netdev: Unwildcard entire odp_port in dpif_netdev_mask_from_nlattrs().
One case in the dpif_netdev_mask_from_nlattrs() function accidentally
wildcarded only a 16-bit subset of the mask's odp_port. On little-endian
machines this subset was the lower bits, which happened to work out OK,
but on big-endian machines this subset was the upper bits, which doesn't
work and causes a test failure. (The problem was actually visible in the
test expected results on little-endian machines, but we had not noticed.)
This commit unwildcards the whole field, fixing the problem, and updates
the test expected results to match.
This fixes the failure of test 732 seen here:
https://buildd.debian.org/status/fetch.php?pkg=openvswitch&arch=sparc&ver=2.1.0%2Bgit20140325-1&stamp=1396438624
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Ben Pfaff [Thu, 3 Apr 2014 22:27:18 +0000 (15:27 -0700)]
jsonrpc: Return received JSON-RPC messages immediately in jsonrpc_recv().
Until now, jsonrpc_recv() used separate iterations of its loop to receive
data, feed it to the JSON-RPC parser, and return the received message.
This is unnecessarily complicated and can occasionally mean that the
jsonrpc object has received and parsed but not returned a message. This
commit refactors the code to receive data, feed it to the parse, and
return the received message in a single iteration, and simplifies the code
in the process.
Reported-by: Chris Hydon <chydon@aristanetworks.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Simon Horman [Wed, 2 Apr 2014 09:04:27 +0000 (18:04 +0900)]
ofproto: Support OF version-specific table-miss behaviours
OpenFlow 1.1 and 1.2 specify that if a table-miss occurs then the default
behaviour is to forward the packet the controller using a packet-in
message. And until this patch this is the default behaviour that Open
vSwitch uses for all OpenFlow versions.
OpenFlow1.3+ specifies that if a table-miss occurs then the default
behaviour is simply to drop the packet. This patch implements this
behaviour using the following logic:
If a table-miss occurs and the table-miss behaviour for the table
has not been set using a table_mod (in which case it is no longer
the default setting) then:
* Installing a facet in the datapath with a drop action in the
if there are no pre-OF1.3 controllers connected which would receive
an packet_in message.
Note that this covers both the case where there are only OF1.3
controllers and the case where there are no controllers at all.
* Otherwise sent a packet_in message to all pre-OF1.3 controllers.
This covers both the case where there are only pre-OF1.3
controllers and there are both pre-OF1.3 and OF1.3+ controllers.
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
Add support for building the in-tree kernel datapath for
Linux kernels up to 3.13. There were some changes in the
netlink area which required adding new compatibility code
for this layer. Also, some new per-cpu stats initialization
code was added.
It should be an administrator task to bring up devices as they
are configured properly.
Currently, Fedora is deleting the bridges when the interface is
brought down. Therefore, there is no bridge on the next boot and
the initscripts can apply the networking configuration properly
for a new bridge.
However, if the system didn't execute ifdown for some reason, the
bridge is left in the ovsdb and since internal ports are brought
up by default, there is no way for initscripts to known if the
adminitrator has already configured it or not.
ofpbuf: Abstract 'l2' pointer and document usage conventions.
Rename 'l2' to 'frame' and add new ofpbuf_set_frame() and ofpbuf_l2().
ofpbuf_set_frame() alse resets all the layer offsets. ofpbuf_l2()
returns NULL if the packet has no Ethernet header, as indicated either
by unset l3 offset or NULL frame pointer. Callers of ofpbuf_l2() are
supposed to check the return value, unless they can otherwise be sure
that the packet has a valid Ethernet header.
The recent commit 437d0d22 made some assumptions that were not valid
regarding the use of the 'l2' pointer in rconn module and by
compose_rarp(). This is now fixed as follows: rconn now relies on the
fact that once OpenFlow messages are given to rconn for transport, the
frame pointer is no longer needed to refer to the OpenFlow header; and
compose_rarp() now sets the frame pointer and offsets as expected.
In addition to storing network frames, ofpbufs are also used for
handling OpenFlow messages and action lists. lib/ofpbuf.h now has a
comment documenting the current usage conventions and invariants.
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
ofpbuf: Rename trivial _get_ functions without the "get".
Code reads better without the "get", for example "ofpbuf_l3()"
v.s. "ofpbuf_get_l3()". L4 payoad access functions still use the
"get" (e.g., "ofpbuf_get_tcp_payload()").
Andy Zhou [Mon, 31 Mar 2014 20:38:04 +0000 (13:38 -0700)]
unit-test: Improve ovstest user interface
Improve help output. Running without argument now exit with an error
message and an error code. Simplify OVSTEST_REGISTER() since not all
test programs uses sub_commands.
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 2 Apr 2014 15:43:17 +0000 (08:43 -0700)]
jsonrpc-server: Combine notifications when connection becomes backlogged.
Connections that queue up too much data, because they are monitoring a
table that is changing quickly and failing to keep up with the updates,
cause problems with buffer management. Since commit 60533a405b2e
(jsonrpc-server: Disconnect connections that queue too much data.),
ovsdb-server has dealt with them by disconnecting the connection and
letting them start up again with a fresh copy of the database. However,
this is not ideal because of situations where disconnection happens
repeatedly. For example:
- A manager toggles a column back and forth between two or more values
quickly (in which case the data transmitted over the monitoring
connections always increases quickly, without bound).
- A manager repeatedly extends the contents of some column in some row
(in which case the data transmitted over the monitoring connection
grows with O(n**2) in the length of the string).
A better way to deal with this problem is to combine updates when they are
sent to the monitoring connection, if that connection is not keeping up.
In both the above cases, this reduces the data that must be sent to a
manageable amount. This commit implements this new way.
Bug #1211786.
Bug #1221378. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
Connections that queue up too much data, because they are monitoring a
table that is changing quickly and failing to keep up with the updates,
cause problems with buffer management. Since commit 60533a405b2e
(jsonrpc-server: Disconnect connections that queue too much data.),
ovsdb-server has dealt with them by disconnecting the connection and
letting them start up again with a fresh copy of the database. However,
this is not ideal because of situations where disconnection happens
repeatedly. For example:
- A manager toggles a column back and forth between two or more values
quickly (in which case the data transmitted over the monitoring
connections always increases quickly, without bound).
- A manager repeatedly extends the contents of some column in some row
(in which case the data transmitted over the monitoring connection
grows with O(n**2) in the length of the string).
A better way to deal with this problem is to combine updates when they are
sent to the monitoring connection, if that connection is not keeping up.
In both the above cases, this reduces the data that must be sent to a
manageable amount. An upcoming patch implements this new way. This commit
reverts part of the previous solution that disconnects backlogged
connections, since it is no longer useful.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
Connections that queue up too much data, because they are monitoring a
table that is changing quickly and failing to keep up with the updates,
cause problems with buffer management. Since commit 60533a405b2e
(jsonrpc-server: Disconnect connections that queue too much data.),
ovsdb-server has dealt with them by disconnecting the connection and
letting them start up again with a fresh copy of the database. However,
this is not ideal because of situations where disconnection happens
repeatedly. For example:
- A manager toggles a column back and forth between two or more values
quickly (in which case the data transmitted over the monitoring
connections always increases quickly, without bound).
- A manager repeatedly extends the contents of some column in some row
(in which case the data transmitted over the monitoring connection
grows with O(n**2) in the length of the string).
A better way to deal with this problem is to combine updates when they are
sent to the monitoring connection, if that connection is not keeping up.
In both the above cases, this reduces the data that must be sent to a
manageable amount. An upcoming patch implements this new way. This commit
reverts part of the previous solution that disconnects backlogged
connections, since it is no longer useful.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
Connections that queue up too much data, because they are monitoring a
table that is changing quickly and failing to keep up with the updates,
cause problems with buffer management. Since commit 60533a405b2e
(jsonrpc-server: Disconnect connections that queue too much data.),
ovsdb-server has dealt with them by disconnecting the connection and
letting them start up again with a fresh copy of the database. However,
this is not ideal because of situations where disconnection happens
repeatedly. For example:
- A manager toggles a column back and forth between two or more values
quickly (in which case the data transmitted over the monitoring
connections always increases quickly, without bound).
- A manager repeatedly extends the contents of some column in some row
(in which case the data transmitted over the monitoring connection
grows with O(n**2) in the length of the string).
A better way to deal with this problem is to combine updates when they are
sent to the monitoring connection, if that connection is not keeping up.
In both the above cases, this reduces the data that must be sent to a
manageable amount. An upcoming patch implements this new way. This commit
reverts part of the previous solution that disconnects backlogged
connections, since it is no longer useful.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
Connections that queue up too much data, because they are monitoring a
table that is changing quickly and failing to keep up with the updates,
cause problems with buffer management. Since commit 60533a405b2e
(jsonrpc-server: Disconnect connections that queue too much data.),
ovsdb-server has dealt with them by disconnecting the connection and
letting them start up again with a fresh copy of the database. However,
this is not ideal because of situations where disconnection happens
repeatedly. For example:
- A manager toggles a column back and forth between two or more values
quickly (in which case the data transmitted over the monitoring
connections always increases quickly, without bound).
- A manager repeatedly extends the contents of some column in some row
(in which case the data transmitted over the monitoring connection
grows with O(n**2) in the length of the string).
A better way to deal with this problem is to combine updates when they are
sent to the monitoring connection, if that connection is not keeping up.
In both the above cases, this reduces the data that must be sent to a
manageable amount. An upcoming patch implements this new way. This commit
reverts part of the previous solution that disconnects backlogged
connections, since it is no longer useful.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Tue, 1 Apr 2014 21:33:24 +0000 (14:33 -0700)]
ovsdb-server: Send update for _version for changes due to weak ref removal.
When a row was deleted, and that caused the transaction manager to remove
a remaining weak reference to the row, and no other change had been made
to the row in that transaction, and a client was monitoring modifications
of the _version column in the row, then the monitor update for the column
did not include the old contents of the _version column, even though it
should have. This commit fixes the problem.
Probably most clients only look at the new value of the column, if they
monitor _version at all, and this bug is really old, so it's probably
not a serious bug.
Found by inspection.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
Ben Pfaff [Wed, 2 Apr 2014 21:54:51 +0000 (14:54 -0700)]
debian: Allow kmod or module-init-tools for backward compatibility.
Commit d473844693 (debian: Depend on 'kmod' instead of module-init-tools.)
switched from depending on module-init-tools to depending on kmod, which
is the new name of the appropriate package in Debian. Unfortunately,
while kmod is the right name for the latest Debian distribution, it doesn't
have that name in old distributions and thus breaks the build on those.
This commit should work OK in either case, since it allows both names.
Pravin Shelar [Mon, 31 Mar 2014 20:17:24 +0000 (13:17 -0700)]
netdev-dpdk: Remove alloc from packet recv.
On DPDK packet recv, ovs is given pointer to mbuf which has
information about a packet, for example pointer to data and size.
By moving mbuf to ofpbuf we can let dpdk allocate ofpbuf and
pass that to ovs for processing the packet.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>