ofproto-dpif: Remove useless odp_in_port from subfacet.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto-dpif: Fix a typo

This patch fixes a typo in handle_miss_upcalls() function.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif: Simplify ofproto hit count tracking.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ovs-vswitchd: An option to wait for userspace flow restore to complete.

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>
ovs-ctl.in: Add manager after restoring flows.

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>
ovs-ctl.in: Restore flows with vswitchd packet processing disabled.

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>
INSTALL: Add documentaion for hot upgrades.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
ofproto-dpif.c: Modify vsp_realdev_to_vlandev() function

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>
datapath: fix variable names in comment

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
cfm: Update netdev when changed.

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>
Always use valid ids pointer in dec_ttl_cnt_ids_from_openflow()

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>
bridge.c: Change variable "ofport" type in "struct if_cfg" and "struct iface"

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>
testsuite: make a sed command more portable

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>
ofproto/pktbuf.c: Fix a typo in the comment

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>
Fix misspellings in comments and docs.

Flagged with: https://github.com/lyda/misspell-check
Run with: git ls-files | misspellings -f -

Signed-off-by: Andy Hill <hillad@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
packets: Fix typo in reserved multicast Ethernet addresses.

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>
ofproto-dpif: Do not give stats to rules bypassed by "drop" frag policy.

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>
signals: Use sys_siglist[] instead of strsignal() for thread-safety.

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>
signals: Make signal_name() thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>