sliver-openvswitch.git
10 years agoxenserver: Add VTEP packaging.
Justin Pettit [Fri, 18 Oct 2013 02:45:09 +0000 (19:45 -0700)]
xenserver: Add VTEP packaging.

Add VTEP files so XenServer build doesn't fail.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agorhel: Add VTEP packaging.
Justin Pettit [Fri, 18 Oct 2013 02:41:08 +0000 (19:41 -0700)]
rhel: Add VTEP packaging.

Add VTEP files so RHEL build doesn't fail.

Bug #20487

Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agovswitchd: Use vswitch-specific variable name in automake.mk.
Justin Pettit [Thu, 17 Oct 2013 21:58:17 +0000 (14:58 -0700)]
vswitchd: Use vswitch-specific variable name in automake.mk.

The variable OVSDB_DOT_DIAGRAM_ARG is describing the vswitch dot file,
so use the name VSWITCH_DOT_DIAGRAM_ARG to prevent confusion in the
generated makefile.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agovtep: Add Debian packaging.
Justin Pettit [Wed, 9 Oct 2013 00:27:12 +0000 (17:27 -0700)]
vtep: Add Debian packaging.

Co-authored-by: David Yang <davidy@vmware.com>
Signed-off-by: David Yang <davidy@vmware.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agovtep: Initial checkin of ovs-vtep.
Justin Pettit [Tue, 8 Oct 2013 23:04:15 +0000 (16:04 -0700)]
vtep: Initial checkin of ovs-vtep.

ovs-vtep is a VTEP emulator that uses Open vSwitch for forwarding.

Co-authored-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agovtep: Add vtep-ctl command.
Justin Pettit [Tue, 8 Oct 2013 22:57:01 +0000 (15:57 -0700)]
vtep: Add vtep-ctl command.

The vtep-ctl command provides a user interface to manipulate the VTEP
OVSDB schema.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agovtep: Initial checkin of vtep schema.
Bruce Davie [Tue, 8 Oct 2013 21:37:51 +0000 (14:37 -0700)]
vtep: Initial checkin of vtep schema.

The hardware VTEP OVSDB schema specifies relations that a VTEP can use
to integrate physical ports into logical switches maintained by a
network virtualization controller such as NVP.

Co-authored-by: Ben Pfaff <blp@nicira.com>
Co-authored-by: Kenneth Duda <kduda@aristanetworks.com>
Co-authored-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Bruce Davie <bdavie@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Kenneth Duda <kduda@aristanetworks.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovsdb-dot: Include arrows by default.
Ben Pfaff [Thu, 20 Dec 2012 19:02:32 +0000 (11:02 -0800)]
ovsdb-dot: Include arrows by default.

When ovsdb-dot generates diagrams for use in the manpages, the dot2pic
postprocessor makes nicer output if the arrowheads are omitted (dot2pic
adds the arrowheads itself).  But for other uses that don't go through
the postprocessor, we generally want the arrowheads.  So this commit adds
an option.  On the principle that the default should be the least
surprising to a naive user, arrowheads are included by default.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoMore accurate wildcarding and fragment handling.
Jarno Rajahalme [Thu, 17 Oct 2013 21:28:20 +0000 (14:28 -0700)]
More accurate wildcarding and fragment handling.

This patch gets rid of the need for having explicit padding in struct
flow as new fields are being added.  flow_wildcards_init_exact(), which
used to set bits in both compiler generated and explicit padding, is
removed.  match_wc_init() is now used instead, which generates the mask
based on a given flow, setting bits only in fields which make sense.

Places where random bits were placed in struct flow have been changed to
only set random bits on fields that are significant in the given context.
This avoids setting padding bits.

- lib/flow:
  - Properly initialize struct flow also in places we used to zero out
    padding before.
  - Add flow_random_hash_fields() used for testing.
  - Remove flow_wildcards_init_exact() to avoid initializing
     masks where compiler generated padding has bits set.
- lib/match.c match_wc_init(): Wildcard transport layer fields for later
  fragments, remove match_init_exact(), which used
  flow_wildcards_init_exact().
- tests/test-flows.c: use match_wc_init() instead of match_init_exact()
- tests/flowgen.pl: generate more accurate packets and flows when
  fragmenting, mark unavailable fields as wildcarded.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovsdb-doc: generate vswitch.[pic|gv] files only if dot tool is available
Ansis Atteka [Fri, 11 Oct 2013 20:17:07 +0000 (13:17 -0700)]
ovsdb-doc: generate vswitch.[pic|gv] files only if dot tool is available

These are auto-generated files, so it would be better not to keep them
inside Open vSwitch repository.

Behaviour before this patch was that if dot tool was not present on
the system, then ovs-vswitchd.conf.db.5 would have used pre-generated
vswitch.pic file that was already checked in the git repository. After
this patch ovs-vswitchd.conf.db.5 will simply not have a dot diagram,
if dot was not present at the time when Open vSwitch was built.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
10 years agoinclude/openflow: Move union ofp_action away from headers.
Jarno Rajahalme [Wed, 16 Oct 2013 23:16:03 +0000 (16:16 -0700)]
include/openflow: Move union ofp_action away from headers.

union ofp_action cannot remain in the OF 1.0 header as it is expanded
to include actions from later versions.  Also, it is not part of the
protocol interface and will be easier to update where it is actually
used.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dpctl: Add a 'filter' option to match wildcarded 'dump-flows'.
Gurucharan Shetty [Sun, 13 Oct 2013 19:44:20 +0000 (12:44 -0700)]
ovs-dpctl: Add a 'filter' option to match wildcarded 'dump-flows'.

With mega-flows, many flows in the kernel datapath are wildcarded.
For someone that is debugging a system and wants to find a particular
flow and its actions, it is a little hard to zero-in on the flow
because some fields are wildcarded.

With the filter='$filter' option, we can now filter on the o/p
of 'ovs-dpctl dump-flows'.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agonx-match: Fix comments.
YAMAMOTO Takashi [Wed, 16 Oct 2013 08:26:19 +0000 (17:26 +0900)]
nx-match: Fix comments.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Fix a comment.
YAMAMOTO Takashi [Wed, 16 Oct 2013 08:26:18 +0000 (17:26 +0900)]
ofp-util: Fix a comment.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-actions: Consistently use helper function.
YAMAMOTO Takashi [Wed, 16 Oct 2013 08:26:17 +0000 (17:26 +0900)]
ofp-actions: Consistently use helper function.

No functional changes.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-parse: Fix padding parsing write-actions.
YAMAMOTO Takashi [Thu, 17 Oct 2013 15:51:23 +0000 (08:51 -0700)]
ofp-parse: Fix padding parsing write-actions.

For longer term, "nested" variants of some ofpact functions
which using ofpbuf->l3 might be desirable.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-actions: Fix some ofpbuf usage problems in write-actions code.
YAMAMOTO Takashi [Thu, 17 Oct 2013 15:51:23 +0000 (08:51 -0700)]
ofp-actions: Fix some ofpbuf usage problems in write-actions code.

This code kept a pointer to data that might have been reallocated.

For longer term, "nested" variants of some ofpact functions
which using ofpbuf->l3 might be desirable.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-monitor: Use heap to order the mport wakeup time.
Alex Wang [Wed, 16 Oct 2013 03:32:34 +0000 (03:32 +0000)]
ofproto-dpif-monitor: Use heap to order the mport wakeup time.

Before this commit, each time ofproto-dpif-monitor thread wakes up,
all monitored ports will be iterated over.  This adds a huge overhead
to the monitor thread.  This commit uses a heap to order the wakeup
time of monitored ports.  So each time the monitor thread is waken up,
it will only iterate those monitored ports that have timed out.

This commit greatly increases the number of monitored interfaces
openvswitch could support.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agocfm: Add cfm_wake_time() function.
Alex Wang [Wed, 16 Oct 2013 03:32:33 +0000 (03:32 +0000)]
cfm: Add cfm_wake_time() function.

This commit adds a new function "cfm_wake_time()" that returns the
next wakeup time associated with the "struct cfm".

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agobfd: Add bfd_wake_time() function.
Alex Wang [Wed, 16 Oct 2013 03:32:32 +0000 (03:32 +0000)]
bfd: Add bfd_wake_time() function.

This commit adds a new function "bfd_wake_time()" that returns the
next wakeup time associated with the "struct bfd".

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoheap: Change type of "priority" in "struct heap".
Alex Wang [Wed, 16 Oct 2013 03:32:31 +0000 (03:32 +0000)]
heap: Change type of "priority" in "struct heap".

This commit changes the variable type of priority in "struct heap"
from uint32_t to uint64_t.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif-monitor: Run ofproto-dpif-monitor in a thread.
Alex Wang [Wed, 16 Oct 2013 03:32:30 +0000 (03:32 +0000)]
ofproto-dpif-monitor: Run ofproto-dpif-monitor in a thread.

This commit moves the ofproto-dpif-monitor module into a
dedicated thread.  This helps eliminate the burden of main
thread having to wake up very frequently for periodic
interface monitoring (bfd, cfm).  Thusly, this commit greatly
increases the number of bfd/cfm sessions that can be supported
by ovs.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agotests: Relax the requirement of bfd tests on timing.
Alex Wang [Wed, 16 Oct 2013 03:32:29 +0000 (03:32 +0000)]
tests: Relax the requirement of bfd tests on timing.

Before this commit, the bfd related tests check the change of
states with very strict timing requirement.  This makes the tests
fragile, especially when ofproto-dpif-monitor module is moved to
its own thread.

Thusly, this commit relaxes the requirement on timing, making the
tests more reliable.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agodatapath: fix vport-netdev unregister
Alexei Starovoitov [Wed, 16 Oct 2013 22:28:23 +0000 (15:28 -0700)]
datapath: fix vport-netdev unregister

The combination of two commits:
commit 8e4e1713e4
("openvswitch: Simplify datapath locking.")
commit 2537b4dd0a
("openvswitch:: link upper device for port devices")

introduced a bug where upper_dev wasn't unlinked upon
netdev_unregister notification

The following steps:

  modprobe openvswitch
  ovs-dpctl add-dp test
  ip tuntap add dev tap1 mode tap
  ovs-dpctl add-if test tap1
  ip tuntap del dev tap1 mode tap

are causing multiple warnings:

[   62.747557] gre: GRE over IPv4 demultiplexor driver
[   62.749579] openvswitch: Open vSwitch switching datapath
[   62.755087] device test entered promiscuous mode
[   62.765911] device tap1 entered promiscuous mode
[   62.766033] IPv6: ADDRCONF(NETDEV_UP): tap1: link is not ready
[   62.769017] ------------[ cut here ]------------
[   62.769022] WARNING: CPU: 1 PID: 3267 at net/core/dev.c:5501 rollback_registered_many+0x20f/0x240()
[   62.769023] Modules linked in: openvswitch gre vxlan ip_tunnel libcrc32c ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_CHECKSUM iptable_mangle ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc vhost_net macvtap macvlan vhost kvm_intel kvm dm_crypt iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi hid_generic mxm_wmi eeepc_wmi asus_wmi sparse_keymap dm_multipath psmouse serio_raw usbhid hid parport_pc ppdev firewire_ohci lpc_ich firewire_core e1000e crc_itu_t binfmt_misc igb dca ptp pps_core mac_hid wmi lp parport i2o_config i2o_block video
[   62.769051] CPU: 1 PID: 3267 Comm: ip Not tainted 3.12.0-rc3+ #60
[   62.769052] Hardware name: System manufacturer System Product Name/P8Z77 WS, BIOS 3007 07/26/2012
[   62.769053]  0000000000000009 ffff8807f25cbd28 ffffffff8175e575 0000000000000006
[   62.769055]  0000000000000000 ffff8807f25cbd68 ffffffff8105314c ffff8807f25cbd58
[   62.769057]  ffff8807f2634000 ffff8807f25cbdc8 ffff8807f25cbd88 ffff8807f25cbdc8
[   62.769059] Call Trace:
[   62.769062]  [<ffffffff8175e575>] dump_stack+0x55/0x76
[   62.769065]  [<ffffffff8105314c>] warn_slowpath_common+0x8c/0xc0
[   62.769067]  [<ffffffff8105319a>] warn_slowpath_null+0x1a/0x20
[   62.769069]  [<ffffffff8162a04f>] rollback_registered_many+0x20f/0x240
[   62.769071]  [<ffffffff8162a101>] rollback_registered+0x31/0x40
[   62.769073]  [<ffffffff8162a488>] unregister_netdevice_queue+0x58/0x90
[   62.769075]  [<ffffffff8154f900>] __tun_detach+0x140/0x340
[   62.769077]  [<ffffffff8154fb36>] tun_chr_close+0x36/0x60
[   62.769080]  [<ffffffff811bddaf>] __fput+0xff/0x260
[   62.769082]  [<ffffffff811bdf5e>] ____fput+0xe/0x10
[   62.769084]  [<ffffffff8107b515>] task_work_run+0xb5/0xe0
[   62.769087]  [<ffffffff810029b9>] do_notify_resume+0x59/0x80
[   62.769089]  [<ffffffff813a41fe>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[   62.769091]  [<ffffffff81770f5a>] int_signal+0x12/0x17
[   62.769093] ---[ end trace 838756c62e156ffb ]---
[   62.769481] ------------[ cut here ]------------
[   62.769485] WARNING: CPU: 1 PID: 92 at fs/sysfs/inode.c:325 sysfs_hash_and_remove+0xa9/0xb0()
[   62.769486] sysfs: can not remove 'master', no directory
[   62.769486] Modules linked in: openvswitch gre vxlan ip_tunnel libcrc32c ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_CHECKSUM iptable_mangle ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc vhost_net macvtap macvlan vhost kvm_intel kvm dm_crypt iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi hid_generic mxm_wmi eeepc_wmi asus_wmi sparse_keymap dm_multipath psmouse serio_raw usbhid hid parport_pc ppdev firewire_ohci lpc_ich firewire_core e1000e crc_itu_t binfmt_misc igb dca ptp pps_core mac_hid wmi lp parport i2o_config i2o_block video
[   62.769514] CPU: 1 PID: 92 Comm: kworker/1:2 Tainted: G        W    3.12.0-rc3+ #60
[   62.769515] Hardware name: System manufacturer System Product Name/P8Z77 WS, BIOS 3007 07/26/2012
[   62.769518] Workqueue: events ovs_dp_notify_wq [openvswitch]
[   62.769519]  0000000000000009 ffff880807ad3ac8 ffffffff8175e575 0000000000000006
[   62.769521]  ffff880807ad3b18 ffff880807ad3b08 ffffffff8105314c ffff880807ad3b28
[   62.769523]  0000000000000000 ffffffff81a87a1f ffff8807f2634000 ffff880037038500
[   62.769525] Call Trace:
[   62.769528]  [<ffffffff8175e575>] dump_stack+0x55/0x76
[   62.769529]  [<ffffffff8105314c>] warn_slowpath_common+0x8c/0xc0
[   62.769531]  [<ffffffff81053236>] warn_slowpath_fmt+0x46/0x50
[   62.769533]  [<ffffffff8123e7e9>] sysfs_hash_and_remove+0xa9/0xb0
[   62.769535]  [<ffffffff81240e96>] sysfs_remove_link+0x26/0x30
[   62.769538]  [<ffffffff81631ef7>] __netdev_adjacent_dev_remove+0xf7/0x150
[   62.769540]  [<ffffffff81632037>] __netdev_adjacent_dev_unlink_lists+0x27/0x50
[   62.769542]  [<ffffffff8163213a>] __netdev_adjacent_dev_unlink_neighbour+0x3a/0x50
[   62.769544]  [<ffffffff8163218d>] netdev_upper_dev_unlink+0x3d/0x140
[   62.769548]  [<ffffffffa033c2db>] netdev_destroy+0x4b/0x80 [openvswitch]
[   62.769550]  [<ffffffffa033b696>] ovs_vport_del+0x46/0x60 [openvswitch]
[   62.769552]  [<ffffffffa0335314>] ovs_dp_detach_port+0x44/0x60 [openvswitch]
[   62.769555]  [<ffffffffa0336574>] ovs_dp_notify_wq+0xb4/0x150 [openvswitch]
[   62.769557]  [<ffffffff81075c28>] process_one_work+0x1d8/0x6a0
[   62.769559]  [<ffffffff81075bc8>] ? process_one_work+0x178/0x6a0
[   62.769562]  [<ffffffff8107659b>] worker_thread+0x11b/0x370
[   62.769564]  [<ffffffff81076480>] ? rescuer_thread+0x350/0x350
[   62.769566]  [<ffffffff8107f44a>] kthread+0xea/0xf0
[   62.769568]  [<ffffffff8107f360>] ? flush_kthread_worker+0x150/0x150
[   62.769570]  [<ffffffff81770bac>] ret_from_fork+0x7c/0xb0
[   62.769572]  [<ffffffff8107f360>] ? flush_kthread_worker+0x150/0x150
[   62.769573] ---[ end trace 838756c62e156ffc ]---
[   62.769574] ------------[ cut here ]------------
[   62.769576] WARNING: CPU: 1 PID: 92 at fs/sysfs/inode.c:325 sysfs_hash_and_remove+0xa9/0xb0()
[   62.769577] sysfs: can not remove 'upper_test', no directory
[   62.769577] Modules linked in: openvswitch gre vxlan ip_tunnel libcrc32c ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_CHECKSUM iptable_mangle ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc vhost_net macvtap macvlan vhost kvm_intel kvm dm_crypt iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi hid_generic mxm_wmi eeepc_wmi asus_wmi sparse_keymap dm_multipath psmouse serio_raw usbhid hid parport_pc ppdev firewire_ohci lpc_ich firewire_core e1000e crc_itu_t binfmt_misc igb dca ptp pps_core mac_hid wmi lp parport i2o_config i2o_block video
[   62.769603] CPU: 1 PID: 92 Comm: kworker/1:2 Tainted: G        W    3.12.0-rc3+ #60
[   62.769604] Hardware name: System manufacturer System Product Name/P8Z77 WS, BIOS 3007 07/26/2012
[   62.769606] Workqueue: events ovs_dp_notify_wq [openvswitch]
[   62.769607]  0000000000000009 ffff880807ad3ac8 ffffffff8175e575 0000000000000006
[   62.769609]  ffff880807ad3b18 ffff880807ad3b08 ffffffff8105314c ffff880807ad3b58
[   62.769611]  0000000000000000 ffff880807ad3bd9 ffff8807f2634000 ffff880037038500
[   62.769613] Call Trace:
[   62.769615]  [<ffffffff8175e575>] dump_stack+0x55/0x76
[   62.769617]  [<ffffffff8105314c>] warn_slowpath_common+0x8c/0xc0
[   62.769619]  [<ffffffff81053236>] warn_slowpath_fmt+0x46/0x50
[   62.769621]  [<ffffffff8123e7e9>] sysfs_hash_and_remove+0xa9/0xb0
[   62.769622]  [<ffffffff81240e96>] sysfs_remove_link+0x26/0x30
[   62.769624]  [<ffffffff81631f22>] __netdev_adjacent_dev_remove+0x122/0x150
[   62.769627]  [<ffffffff81632037>] __netdev_adjacent_dev_unlink_lists+0x27/0x50
[   62.769629]  [<ffffffff8163213a>] __netdev_adjacent_dev_unlink_neighbour+0x3a/0x50
[   62.769631]  [<ffffffff8163218d>] netdev_upper_dev_unlink+0x3d/0x140
[   62.769633]  [<ffffffffa033c2db>] netdev_destroy+0x4b/0x80 [openvswitch]
[   62.769636]  [<ffffffffa033b696>] ovs_vport_del+0x46/0x60 [openvswitch]
[   62.769638]  [<ffffffffa0335314>] ovs_dp_detach_port+0x44/0x60 [openvswitch]
[   62.769640]  [<ffffffffa0336574>] ovs_dp_notify_wq+0xb4/0x150 [openvswitch]
[   62.769642]  [<ffffffff81075c28>] process_one_work+0x1d8/0x6a0
[   62.769644]  [<ffffffff81075bc8>] ? process_one_work+0x178/0x6a0
[   62.769646]  [<ffffffff8107659b>] worker_thread+0x11b/0x370
[   62.769648]  [<ffffffff81076480>] ? rescuer_thread+0x350/0x350
[   62.769650]  [<ffffffff8107f44a>] kthread+0xea/0xf0
[   62.769652]  [<ffffffff8107f360>] ? flush_kthread_worker+0x150/0x150
[   62.769654]  [<ffffffff81770bac>] ret_from_fork+0x7c/0xb0
[   62.769656]  [<ffffffff8107f360>] ? flush_kthread_worker+0x150/0x150
[   62.769657] ---[ end trace 838756c62e156ffd ]---
[   62.769724] device tap1 left promiscuous mode

This patch also affects moving devices between net namespaces.

OVS used to ignore netns move notifications which caused problems.
Like:
  ovs-dpctl add-if test tap1
  ip link set tap1 netns 3512
and then removing tap1 inside the namespace will cause hang on missing dev_put.

With this patch OVS will detach dev upon receiving netns move event.

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agooftest: Update default controller port number to match recent OFTest.
Ben Pfaff [Wed, 16 Oct 2013 16:28:47 +0000 (09:28 -0700)]
oftest: Update default controller port number to match recent OFTest.

Also, document how to work around it if you use an older OFTest.

Reported-by: Simon Horman <horms@verge.net.au>
Reported-by: Lori Jakab <lojakab@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Re-use port numbers of ports that were deleted an hour ago.
Gurucharan Shetty [Mon, 14 Oct 2013 20:36:41 +0000 (13:36 -0700)]
ofproto: Re-use port numbers of ports that were deleted an hour ago.

We have a least recently used algorithm for assigning ofport values
to newly created ports. i.e., when we don't have any unused ofport
numbers, we use ofport numbers from the oldest deleted port.
What this means is that after using ~65000 previously unused ofport
numbers, we will have to go through all of the possible ports
to see which one was least recently used. This will eventually
slow down ofport allocation.

With this commit, any port that was deleted more than an hour ago is
considered never to have been used. So it's ofport number becomes
free to be used.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dpctl-top: in_port field is now the default view
Mark Hamilton [Tue, 8 Oct 2013 20:46:53 +0000 (13:46 -0700)]
ovs-dpctl-top: in_port field is now the default view

This facilitates adding filtering since limiting output based on the in_port
is a natural first step.

Script mode was not changed allowing output to be piped through grep to
filter content.

Signed-off-by: Mark Hamilton <mhamilton@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agonetdev-dummy: Count rx packets regardless of source
Simon Horman [Wed, 16 Oct 2013 10:17:01 +0000 (19:17 +0900)]
netdev-dummy: Count rx packets regardless of source

This alters the way rx packets are accounted for by
counting them when they are processed by netdev_dummy_rx_recv(),
which seems to be a common path used by all received packets.

Previously accounting was done earlier, in netdev_dummy_receive(),
however this does not appear to count packets that are received via
a socket.

This resolves packet counting errors reported by the following
OFtest tests:

port_stats.MultiFlowStats
port_stats.SingleFlowStats
pktact.WildcardPriorityWithDelete
pktact.WildcardPriority

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoOPENFLOW-1.1+: note on table-miss
YAMAMOTO Takashi [Tue, 15 Oct 2013 08:12:22 +0000 (17:12 +0900)]
OPENFLOW-1.1+: note on table-miss

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoAnnounce that ovs-vswitchd is now multi-threaded.
Justin Pettit [Tue, 15 Oct 2013 22:36:40 +0000 (15:36 -0700)]
Announce that ovs-vswitchd is now multi-threaded.

Might be worth mentioning the biggest change in 2.0.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoconnmgr: Always send full packet in packet_in when not buffering.
YAMAMOTO Takashi [Tue, 15 Oct 2013 08:08:30 +0000 (17:08 +0900)]
connmgr: Always send full packet in packet_in when not buffering.

According to the specs, if a packet is not buffered for some reasons,
we should send the entire packet, regardless of max_len.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoSet datapath mask bits when setting a flow field.
Jarno Rajahalme [Tue, 15 Oct 2013 19:40:38 +0000 (12:40 -0700)]
Set datapath mask bits when setting a flow field.

Since at the datapath interface we do not have set actions for
individual fields, but larger sets of fields for a given protocol
layer, the set action will in practice only ever apply to exactly
matched flows for the given protocol layer.  For example, if the
reg_load changes the IP TTL, the corresponding datapath action will
rewrite also the IP addresses and TOS byte.  Since these other field
values may not be explicitly set, they depend on the incoming flow field
values, and are hence all of them are set in the wildcards masks, when
the action is committed to the datapath.  For the rare case, where the
reg_load action does not actually change the value, and no other flow
field values are set (or loaded), the datapath action is skipped, and
no mask bits are set.  Such a datapath flow should, however, be
dependent on the specific field value, so the corresponding wildcard
mask bits must be set, lest the datapath flow be applied to packets
containing some other value in the field and the field value remain
unchanged regardless of the incoming value.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agometa-flow: Add mf_mask_field_and_prereqs().
Jarno Rajahalme [Tue, 15 Oct 2013 19:40:37 +0000 (12:40 -0700)]
meta-flow: Add mf_mask_field_and_prereqs().

Sets mask bits for the given field and its prerequisite fields.
Needed for unwildcarding the proper bits from datapath masks.
Removed old prototype for mf_force_prereqs().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoSet release date for 2.0.0.
Justin Pettit [Tue, 15 Oct 2013 22:04:20 +0000 (15:04 -0700)]
Set release date for 2.0.0.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agovxlan: Optimize vxlan rcv
Pravin B Shelar [Fri, 11 Oct 2013 19:40:13 +0000 (12:40 -0700)]
vxlan: Optimize vxlan rcv

vxlan-udp-recv function lookup vxlan_sock struct on every packet
recv by using udp-port number. we can use sk->sk_user_data to
store vxlan_sock and avoid lookup.

This commit also allows us to get rid of socket hash table.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agotests: fix failure when $PKIDIR contains uuid-like string
YAMAMOTO Takashi [Tue, 15 Oct 2013 14:38:06 +0000 (23:38 +0900)]
tests: fix failure when $PKIDIR contains uuid-like string

this fixes a test failure with my working directory:
    /disks/ea6a5743-ad5f-11e2-9410-08606e7f74e7/git/openvswitch

stop filtering uuid as it's unnecessary for this specific test case.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotests/test-unix-socket.py: abort on an error
YAMAMOTO Takashi [Tue, 15 Oct 2013 14:38:04 +0000 (23:38 +0900)]
tests/test-unix-socket.py: abort on an error

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agolib/meta-flow: Enforce mf_fields array order.
Jarno Rajahalme [Tue, 15 Oct 2013 15:35:39 +0000 (08:35 -0700)]
lib/meta-flow: Enforce mf_fields array order.

The elements of the array must be in the enum order.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotests: Make ovsdb-server add/remove remote test faster and more reliable.
Alex Wang [Tue, 15 Oct 2013 05:12:59 +0000 (22:12 -0700)]
tests: Make ovsdb-server add/remove remote test faster and more reliable.

Until now, the "ovsdb-server/add-remote and remove-remote with --monitor"
test killed ovsdb-server with SIGSEGV twice.  Each time, the "--monitor"
option caused the supervisor process to restart the child, but the second
time it incurred a 10-second delay intended to prevent the daemon from
wasting CPU time by restarting itself and dying again very quickly in a
loop.  This made the test take over 10 seconds to execute.  It also made
it occasionally fail because the OVS_WAIT_UNTIL check waits at most
approximately 10 seconds before it decides that the condition that it is
testing for will never occur.

This commit fixes the problem by breaking the test into two tests, each of
which kills ovsdb-server with SIGSEGV only once.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoAdd support for write-actions
Simon Horman [Fri, 11 Oct 2013 04:23:29 +0000 (13:23 +0900)]
Add support for write-actions

Implementation note:

All actions which modify a field are added to the action set
at the point where "set" actions should be added. In general
modifying a field many times is the same as only modifying it
the last time so the implementation simply adds all set actions to
the action set in the order they are specified. However, this breaks
down if two actions modify different portions of the same field.

Some examples.

1. load acting a subfield
2. mod_vlan_vid, mod_vlan_pcp

If this is considered to be a problem one possible solution would be to
either disallow all set actions other than set_field in write_actions.
Another possible solution is prohibit problematic the actions listed above
in write actions.

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com simplified and edited the code]
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-actions: Make ofpacts_format() caller add "actions=" if it wants it.
Ben Pfaff [Mon, 14 Oct 2013 21:08:20 +0000 (14:08 -0700)]
ofp-actions: Make ofpacts_format() caller add "actions=" if it wants it.

An upcoming caller doesn't want it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Elaborate the comment for odp_flow_format() function.
Gurucharan Shetty [Mon, 14 Oct 2013 15:09:17 +0000 (08:09 -0700)]
odp-util: Elaborate the comment for odp_flow_format() function.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Fix code formatting.
Gurucharan Shetty [Fri, 4 Oct 2013 14:49:13 +0000 (07:49 -0700)]
odp-util: Fix code formatting.

Tabs and spaces got mixed up, making the code harder to read.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agorhel: Option to create tunnel through ifcfg scripts.
Edouard Bourguignon [Mon, 14 Oct 2013 14:25:25 +0000 (07:25 -0700)]
rhel: Option to create tunnel through ifcfg scripts.

Signed-off-by: Edouard Bourguignon <madko@linuxed.net>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Simplify the xlate_send_packet() function.
Alex Wang [Fri, 11 Oct 2013 21:58:36 +0000 (14:58 -0700)]
ofproto-dpif-xlate: Simplify the xlate_send_packet() function.

This commit simplifies the xlate_send_packet() function by calling
ofproto_dpif_execute_actions() function.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Make execute_actions() function non-static.
Alex Wang [Fri, 11 Oct 2013 21:58:35 +0000 (14:58 -0700)]
ofproto-dpif: Make execute_actions() function non-static.

This commit changes the execute_actions() function to non-static
function.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Change comment for execute_actions() function.
Alex Wang [Fri, 11 Oct 2013 21:58:34 +0000 (14:58 -0700)]
ofproto-dpif: Change comment for execute_actions() function.

This commit changes the comment for execute_actions() function,
since the old comment does not apply.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Fix freeing uninitialized "struct ofpbuf".
Alex Wang [Fri, 11 Oct 2013 21:17:13 +0000 (14:17 -0700)]
ofproto-dpif-xlate: Fix freeing uninitialized "struct ofpbuf".

Commit 91d6cd12 (ofproto-dpif: Move send_packet() to
ofproto-dpif-xlate module.) introduced a bug that frees the "struct
ofpbuf" in 'xout' when the struct is not initialized.  This commit
fixes the bug.

Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agorconn: Make thread-safe.
Ben Pfaff [Fri, 11 Oct 2013 17:08:32 +0000 (10:08 -0700)]
rconn: Make thread-safe.

This should make sending OFPT_FLOW_REMOVED and NXST_FLOW_MONITOR safe from
miss handler threads.

Bug #20271.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoconnmgr: Formalize 'ofproto_mutex' as protecting ofconn monitor data.
Ben Pfaff [Fri, 11 Oct 2013 06:11:09 +0000 (23:11 -0700)]
connmgr: Formalize 'ofproto_mutex' as protecting ofconn monitor data.

'ofproto_mutex' has effectively protected the monitor-related members of
struct ofconn since its introduction, but this was not written down or
systematically annotated.  This commit makes it more systematic and fixes
a few issues found using the annotations.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoconnmgr: Use 'ofproto_mutex' to protect ofconns from being destroyed.
Ben Pfaff [Fri, 11 Oct 2013 17:04:32 +0000 (10:04 -0700)]
connmgr: Use 'ofproto_mutex' to protect ofconns from being destroyed.

Code in the ofproto-dpif miss handler threads can currently access
ofconns, sending flow_removed and flow monitor messages due to NXAST_LEARN
actions.  Nothing currently protects those threads from accessing ofconns
that are in the process of being destroyed.  This commit adds protection
'ofproto_mutex', which NXAST_LEARN already takes.

Later patches will address other races that remain.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agorconn: Make rconn_packet_counter thread-safe.
Ben Pfaff [Fri, 13 Sep 2013 22:07:35 +0000 (15:07 -0700)]
rconn: Make rconn_packet_counter thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agomonitor: Fix improper use of stubs.
Ethan Jackson [Fri, 11 Oct 2013 00:52:31 +0000 (17:52 -0700)]
monitor: Fix improper use of stubs.

Stubs must be uninitialized when used in case they allocate memory.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoAdd software switch support for modifying ARP headers in OpenFlow.
Ben Pfaff [Thu, 10 Oct 2013 00:37:30 +0000 (17:37 -0700)]
Add software switch support for modifying ARP headers in OpenFlow.

This support is added through the userspace slow path, because we don't
judge that this is important enough to require permanent support in the
Linux kernel ABI.

Bug #19259.
CC: Teemu Koponen <koponen@nicira.com>
CC: Pankaj Thakkar <thakkar@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif: Support working around actions that a datapath does not support.
Ben Pfaff [Thu, 10 Oct 2013 00:28:05 +0000 (17:28 -0700)]
dpif: Support working around actions that a datapath does not support.

Until now, OVS has expected that the datapath supports all the actions
required by any flow to be installed.  There are at least two reasons why
a datapath might not support a given action:

    - The datapath version is older than the userspace version, and the
      action was introduced after the version of the datapath in use.

    - The action is not considered important enough to implement as part of
      an ABI that must be maintained forever.

This commit adds infrastructure to handle these cases.  It doesn't actually
add any uses; that will come in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Make it possible to combine slow path reasons.
Ben Pfaff [Fri, 20 Sep 2013 19:54:51 +0000 (12:54 -0700)]
odp-util: Make it possible to combine slow path reasons.

It will soon be possible for a single flow to be slow pathed for multiple
reasons.  This commit makes it possible to indicate more than one reason
to slow path a flow.

This commit is logically a revert of commit 98f0520fb2 (odp-util: Make
slow_path_reasons mutually exclusive.) but details have changed.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-execute: Refine signatures for odp_execute_actions() callbacks.
Ben Pfaff [Fri, 20 Sep 2013 19:47:33 +0000 (12:47 -0700)]
odp-execute: Refine signatures for odp_execute_actions() callbacks.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Factor lots of code out into new function execute_actions().
Ben Pfaff [Fri, 20 Sep 2013 20:40:13 +0000 (13:40 -0700)]
ofproto-dpif: Factor lots of code out into new function execute_actions().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Simplify code using execute_odp_actions().
Ben Pfaff [Tue, 8 Oct 2013 22:57:49 +0000 (15:57 -0700)]
ofproto-dpif: Simplify code using execute_odp_actions().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Add undocumented "parse-pcap" command, for testing.
Ben Pfaff [Mon, 23 Sep 2013 17:28:14 +0000 (10:28 -0700)]
ovs-ofctl: Add undocumented "parse-pcap" command, for testing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-dummy: Add pcap feature.
Ben Pfaff [Mon, 23 Sep 2013 17:26:51 +0000 (10:26 -0700)]
netdev-dummy: Add pcap feature.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agopcap-file: Add support for append mode to pcap_open().
Ben Pfaff [Mon, 23 Sep 2013 17:27:10 +0000 (10:27 -0700)]
pcap-file: Add support for append mode to pcap_open().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agopcap-file: Improve error logging.
Ben Pfaff [Mon, 23 Sep 2013 17:14:35 +0000 (10:14 -0700)]
pcap-file: Improve error logging.

There is no reason to log end of file as an error, but that's what this
code was doing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-upcall: Make miss handlers accumulate coverage counters.
Ben Pfaff [Mon, 23 Sep 2013 17:24:05 +0000 (10:24 -0700)]
ofproto-dpif-upcall: Make miss handlers accumulate coverage counters.

The miss handler threads do not call poll_block(), which calls
coverage_clear() indirectly.  This meant that coverage counters incremented
by miss handler threads never got integrated into the global coverage
counters and therefore did not show up in coverage logging or
"ovs-appctl coverage/show" output.  This commit fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotimeval: Call coverage_clear() before coverage_log() in time_poll().
Ben Pfaff [Mon, 23 Sep 2013 17:13:54 +0000 (10:13 -0700)]
timeval: Call coverage_clear() before coverage_log() in time_poll().

time_poll() calls log_poll_interval(), which in some circumstances calls
coverage_log().  Before this commit, time_poll() also called
coverage_clear() after log_poll_interval().  This made sense before commit
857165b5fd26 (coverage: Make thread-safe.), because coverage_log() would
log the most recent main loop's coverage counters separately and calling
coverage_clear() beforehand would zero out those counters.  However, it
doesn't make sense any longer because the most recent loop's counters are
no longer separately logged and in fact this practice now means that the
most recent loop's counters are omitted from the logged counters.

Therefore, this commit moves the call to coverage_clear() earlier, so that
the most recent loop's counters are included.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-xlate: Do initial rule lookup for callers.
Ethan Jackson [Wed, 9 Oct 2013 20:23:31 +0000 (13:23 -0700)]
ofproto-dpif-xlate: Do initial rule lookup for callers.

None of the functions available in ofproto-dpif.h are thread safe
unless holding the xlate_rwlock because one can't know that an ofproto
or ofport used as argument will survive during the function call.  For
this reason, ofproto-dpif-upcall's invocation of rule_dpif_lookup()
is unsafe because the ofproto could be destroyed during the call.

This patch fixes the problem by optionally doing the initial rule
lookup in xlate_actions() so that it can be done while holding the
xlate_rwlock.  This has the nice side benefit of removing a bunch of
boilerplate.

Note that this only partially solves the problem, there's still
vsp_realdev_to_vlandev() and ofproto_dpif_send_packet_in() which
aren't thread safe for the same reason.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
10 years agotests: a comment on OF1.3 table_mod
YAMAMOTO Takashi [Wed, 9 Oct 2013 07:50:29 +0000 (16:50 +0900)]
tests: a comment on OF1.3 table_mod

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agometa-flow: Fix inverted IPv6 flow label masking.
Jarno Rajahalme [Wed, 9 Oct 2013 20:50:51 +0000 (13:50 -0700)]
meta-flow: Fix inverted IPv6 flow label masking.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-monitor: Add ofproto-dpif-monitor module.
Alex Wang [Wed, 9 Oct 2013 04:30:37 +0000 (04:30 +0000)]
ofproto-dpif-monitor: Add ofproto-dpif-monitor module.

This commit adds a new module ofproto-dpif-monitor in ofproto
directory.  This module is in charge of executing the periodic
functions of monitoring code (e.g. bfd and cfm).

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agotimeval: Wake up all threads when time is warped.
Alex Wang [Wed, 9 Oct 2013 04:30:36 +0000 (04:30 +0000)]
timeval: Wake up all threads when time is warped.

This commit makes the main thread wake up all other threads when time is
warped.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agotests: Remove the unit test for "ovs-appctl coverage/show".
Alex Wang [Wed, 9 Oct 2013 04:30:35 +0000 (04:30 +0000)]
tests: Remove the unit test for "ovs-appctl coverage/show".

Changes will be made to allow "ovs-appctl time/warp" wake up all
threads.  With that, all threads will try calling "coverage_run()".
And it will be impossible to deterministically check the output of
the "ovs-appctl coverage/show" command.  Thus, this commit removes
the unit test for the coverage/show command.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Make stats update thread safe.
Alex Wang [Wed, 9 Oct 2013 04:30:34 +0000 (04:30 +0000)]
ofproto-dpif: Make stats update thread safe.

This commit makes the update of 'stats' member in ofproto_dpif
struct thread safe.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Move send_packet() to ofproto-dpif-xlate module.
Alex Wang [Wed, 9 Oct 2013 04:30:33 +0000 (04:30 +0000)]
ofproto-dpif: Move send_packet() to ofproto-dpif-xlate module.

This commit moves the main logic of send_packet() function into
the ofproto-dpif-xlate module.  Also, modification is made to
guarantee the thread safety of ofproto-dpif-xlate module.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoovs-lib: Return the correct exit status of the command 'status'
Gurucharan Shetty [Mon, 7 Oct 2013 21:28:48 +0000 (14:28 -0700)]
ovs-lib: Return the correct exit status of the command 'status'

commit 46528f78e5c(debian, rhel, xenserver: Ability to collect ovs-ctl logs)
made changes in the startup scripts such that the o/p of ovs-ctl is logged
into ovs-ctl.log. But it had an unintended consequence that the exit status
of ovs-ctl was no longer returned. We would always return success(the exit
status of tee).

With this commit, we return the exit status of ovs-ctl instead of tee.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agovswitchd: Improve the readability of the E-R diagram.
Ben Pfaff [Tue, 8 Oct 2013 22:25:28 +0000 (15:25 -0700)]
vswitchd: Improve the readability of the E-R diagram.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoovsdb-doc: Document immutable columns.
Ben Pfaff [Tue, 8 Oct 2013 22:22:20 +0000 (15:22 -0700)]
ovsdb-doc: Document immutable columns.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoovsdb-idl: Remove write-only member 'commit_seqno' from ovsdb_idl_txn.
Ben Pfaff [Tue, 8 Oct 2013 22:12:24 +0000 (15:12 -0700)]
ovsdb-idl: Remove write-only member 'commit_seqno' from ovsdb_idl_txn.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoovs-controller: Avoid dereferencing NULL pointer when the switch acts as a hub
ZhengLingyun [Tue, 8 Oct 2013 15:52:40 +0000 (23:52 +0800)]
ovs-controller: Avoid dereferencing NULL pointer when the switch acts as a hub

Starting ovs-controller with '-H' option will lead to a segment fault problem.
Add a check, and adjust the indentation of the following code.

Signed-off-by: ZhengLingyun <konghuarukhr@163.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-lib: Revert "Return the exit status of ovs-ctl in ovs_ctl()."
Gurucharan Shetty [Fri, 4 Oct 2013 21:52:34 +0000 (14:52 -0700)]
ovs-lib: Revert "Return the exit status of ovs-ctl in ovs_ctl()."

This reverts commit 9d46457e07ca which had a side-effect that
ssh executing start/restart command on a remote machine would
hang as one of the file descriptors created in that commit
was getting passed along to the daemons. The daemons weren't closing
it and hence ssh would just wait for them to close and hang.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: add linux/flow_{table, netlink}.c to .gitignore
Lorand Jakab [Fri, 4 Oct 2013 11:07:31 +0000 (14:07 +0300)]
datapath: add linux/flow_{table, netlink}.c to .gitignore

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoovsdb-server: Document that --remote may be used multiple times.
Ben Pfaff [Fri, 4 Oct 2013 15:58:52 +0000 (08:58 -0700)]
ovsdb-server: Document that --remote may be used multiple times.

Reported-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofproto-dpif-xlate: Suppress oversize datapath actions.
Ben Pfaff [Fri, 4 Oct 2013 15:48:48 +0000 (08:48 -0700)]
ofproto-dpif-xlate: Suppress oversize datapath actions.

If we allow oversize datapath actions to make it out of translation, then
we will assert-fail later when we try to put those actions into a Netlink
attribute.

Bug #19277.
Reported-by: Paul ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofproto-dpif-xlate: Limit memory and time that translation can consume.
Ben Pfaff [Fri, 4 Oct 2013 15:47:16 +0000 (08:47 -0700)]
ofproto-dpif-xlate: Limit memory and time that translation can consume.

The resubmit depth has been limited to MAX_RESUBMIT_RECURSION, currently
64, for a long time.  But the flow "actions=resubmit:1, resubmit:2,
output:1" generates about 2**MAX_RESUBMIT_RECURSION output actions,
exhausting memory.  This commit fixes the problem.

Such a flow also requires 2**MAX_RESUBMIT_RECURSION time for translation.
This commit fixes that problem too.

Bug #19277.
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agodatapath: Simplify mega-flow APIs.
Pravin B Shelar [Thu, 3 Oct 2013 20:54:51 +0000 (13:54 -0700)]
datapath: Simplify mega-flow APIs.

Hides mega-flow implementation in flow_table.c rather than
datapath.c.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Move mega-flow list out of rehashing struct.
Pravin B Shelar [Thu, 3 Oct 2013 20:49:31 +0000 (13:49 -0700)]
datapath: Move mega-flow list out of rehashing struct.

ovs-flow rehash does not touch mega flow list. Following patch
moves it dp struct datapath.  Avoid one extra indirection for
accessing mega-flow list head on every packet receive.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Restructure datapath.c and flow.c
Pravin B Shelar [Thu, 12 Sep 2013 03:26:11 +0000 (20:26 -0700)]
datapath: Restructure datapath.c and flow.c

Over the time datapath.c and flow.c has became pretty large files.
Following patch restructures functionality of component into three
different components:

flow.c: contains flow extract.
flow_netlink.c: netlink flow api.
flow_table.c: flow table api.

Diffstat is showing wrong count. This patch mostly restructures code
without changing logic.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agosignals: Don't assume that sys_siglist is an array.
YAMAMOTO Takashi [Thu, 3 Oct 2013 06:52:24 +0000 (15:52 +0900)]
signals: Don't assume that sys_siglist is an array.

Found by commit 878f1972909b3 (util: use gcc builtins to better check array
sizes).

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoutil: use gcc builtins to better check array sizes
Flavio Leitner [Wed, 2 Oct 2013 05:40:09 +0000 (02:40 -0300)]
util: use gcc builtins to better check array sizes

GCC provides two useful builtin functions that can help
to improve array size checking during compilation.

This patch contains no functional changes, but it makes
it easier to detect mistakes.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-upcall: Remove dead code from recv_upcalls().
Ben Pfaff [Wed, 2 Oct 2013 18:07:56 +0000 (11:07 -0700)]
ofproto-dpif-upcall: Remove dead code from recv_upcalls().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-upcall: reduce number of wakeup
YAMAMOTO Takashi [Wed, 2 Oct 2013 17:49:30 +0000 (10:49 -0700)]
ofproto-dpif-upcall: reduce number of wakeup

If a queue length is long (ie. non-0), the consumer thread should
already be busy working on the queue.  there's no need to wake it
up repeatedly.

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-lib: Return the exit status of ovs-ctl in ovs_ctl().
Duffie Cooley [Wed, 2 Oct 2013 14:07:43 +0000 (07:07 -0700)]
ovs-lib: Return the exit status of ovs-ctl in ovs_ctl().

commit 46528f78e5c(debian, rhel, xenserver: Ability to collect ovs-ctl logs)
made changes in the startup scripts such that the o/p of ovs-ctl is logged
into ovs-ctl.log. But it had an unintended consequence that the exit status
of ovs-ctl was no longer returned. We would always return success(the exit
status of tee).

With this commit, we return the exit status of ovs-ctl instead of tee.
Code referenced from: (line wrapped).
http://unix.stackexchange.com/questions/14270/\
get-exit-status-of-process-thats-piped-to-another/70675#70675)

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Duffie Cooley <dcooley@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dpctl, ofproto/trace: Show and handle the in_port name in flows.
Gurucharan Shetty [Tue, 24 Sep 2013 05:58:46 +0000 (22:58 -0700)]
ovs-dpctl, ofproto/trace: Show and handle the in_port name in flows.

With this commit, whenever the verbosity is enabled with '-m'
option, the ovs-dpctl dump-flows command will display the flows with
in_port field showing the name instead of a port number.

Conversely, one can also use a name in the in_port field with del-flow,
add-flow and mod-flow commands of ovs-dpctl. One should also be able
to use the port name when supplying the datapath flow as an input
to ofproto/trace command.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agostream: Log a warning when the default OpenFlow or OVSDB port is used.
Justin Pettit [Mon, 23 Sep 2013 21:20:27 +0000 (14:20 -0700)]
stream: Log a warning when the default OpenFlow or OVSDB port is used.

Both OpenFlow and OVSDB have new IANA-assigned port numbers.  We still
default to the original values (6633 and 6632, respectively), but this
commit logs a warning.  In the future, we will switch to the official
values (6653 and 6640, respectively).

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Define official OpenFlow port number.
Justin Pettit [Sat, 31 Aug 2013 00:26:56 +0000 (17:26 -0700)]
ofproto: Define official OpenFlow port number.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovsdb: Define official port number.
Justin Pettit [Sat, 31 Aug 2013 00:20:29 +0000 (17:20 -0700)]
ovsdb: Define official port number.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoDon't differentiate between TCP and SSL ports for OpenFlow and OVSDB.
Justin Pettit [Mon, 23 Sep 2013 21:33:09 +0000 (14:33 -0700)]
Don't differentiate between TCP and SSL ports for OpenFlow and OVSDB.

The OVS code has always made a distinction between the unencrypted (TCP)
and SSL port numbers for the OpenFlow and OVSDB protocols.  The default
port numbers for both protocols has changed, and there continues to be
no distinction between the unencrypted and SSL versions.  This
commit removes the distinction in port numbers.  A future patch will
recognize the change in default port number.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Fix vxlan gso with vlan.
Pravin B Shelar [Tue, 1 Oct 2013 15:24:55 +0000 (08:24 -0700)]
datapath: Fix vxlan gso with vlan.

To use ovs-gso-compatibility we need to record inner skb offset.
In case of vxlan it is done before vlan header is pushed which
gives wrong inner packet to ovs-gso.
Following patch reset skb offsets after inner skb is completely built.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agoofproto-dpif: Compute the subfacet add/del rate using coverage counters.
Alex Wang [Tue, 1 Oct 2013 01:32:44 +0000 (18:32 -0700)]
ofproto-dpif: Compute the subfacet add/del rate using coverage counters.

So far, the subfacet rates (e.g. add rate, del rate) are computed by
exponential moving averaging function in ofproto-dpif.c.  This commit
replaces that logic with coverage counters.  And the rates can be
checked by running "ovs-appctl coverage/show" command.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agocoverage: Reimplement the "ovs-appctl coverage/show" command.
Alex Wang [Tue, 1 Oct 2013 01:31:44 +0000 (18:31 -0700)]
coverage: Reimplement the "ovs-appctl coverage/show" command.

This commit changes the "ovs-appctl coverage/show" command to show the
the averaged per-second rates for the last few seconds, the last minute
and the last hour, and the total counts of all of the coverage counters.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agorhel: fix the exit status of the openvswitch init script.
Duffie Cooley [Tue, 1 Oct 2013 02:27:07 +0000 (19:27 -0700)]
rhel: fix the exit status of the openvswitch init script.

This is a fix for a request to make sure that the openvswitch status command
in rhel based distros gives a useful exit status. That was fixed in

commit 5e0c05bc058c78a11be6747f62e6ad88e5d06b70
debian: Fix exit status of openvswitch-switch init script "status" command

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