[ovs-dev] [PATCH v2] Introduce odp_flow_key_to_mask() API

2013-08-15 Thread gyang
From: gyang With megaflow support, there is API to convert mask to nlattr key based format. This change introduces API to do the reverse conversion. We leverage the existing odp_flow_key_to_flow() API to resue the code. Signed-off-by: Guolin Yang --- lib/odp-util.c | 295 +

[ovs-dev] [PATCH] ofproto-dpif-upcall: fix fail-open

2013-08-15 Thread YAMAMOTO Takashi
fix a bug introduced by commit e1ec7dd4608876283038c417065c4f9978255fa3. (ofproto-dpif: Implement multi-threaded miss handling.) Signed-off-by: YAMAMOTO Takashi --- ofproto/ofproto-dpif-upcall.c | 41 ++--- 1 file changed, 22 insertions(+), 19 deletions(-) di

[ovs-dev] [PATCH] ofproto-dpif-xlate: Unreference handles on xbridge removal.

2013-08-15 Thread Ethan Jackson
Reported-by: Ben Pfaff Signed-off-by: Ethan Jackson --- ofproto/ofproto-dpif-xlate.c |5 + 1 file changed, 5 insertions(+) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 8be8088..a7f051d 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif

Re: [ovs-dev] memory leaks

2013-08-15 Thread Ethan Jackson
I'll have a look thanks. Ethan On Fri, Aug 16, 2013 at 9:23 AM, Ben Pfaff wrote: > valgrind reports a couple of memory leaks for current master: > > ==25376== 84 bytes in 1 blocks are definitely lost in loss record 163 of > 175 > ==25376==at 0x4D7B308: malloc (vg_replace_malloc.c:26

[ovs-dev] memory leaks

2013-08-15 Thread Ben Pfaff
valgrind reports a couple of memory leaks for current master: ==25376== 84 bytes in 1 blocks are definitely lost in loss record 163 of 175 ==25376==at 0x4D7B308: malloc (vg_replace_malloc.c:263) ==25376==by 0x80E2364: xmalloc (util.c:103) ==25376==by 0x8096244: mac_lear

Re: [ovs-dev] [PATCH] ofproto: Avoid extra O(N) work in common case on flow addition.

2013-08-15 Thread Ben Pfaff
Thanks, applied. On Fri, Aug 16, 2013 at 08:51:18AM +0800, Ethan Jackson wrote: > Acked-by: Ethan Jackson > > Thanks a lot. > > On Fri, Aug 16, 2013 at 8:39 AM, Ben Pfaff wrote: > > The OpenFlow OFPFF_CHECK_OVERLAP flag requires us to check whether the flow > > being inserted overlaps with any

Re: [ovs-dev] [PATCH] ofproto-dpif: Fix bad pointer dereference when deleting a bridge.

2013-08-15 Thread Ben Pfaff
Thanks, applied. On Fri, Aug 16, 2013 at 08:58:40AM +0800, Ethan Jackson wrote: > Acked-by: Ethan Jackson > > On Fri, Aug 16, 2013 at 8:55 AM, Ben Pfaff wrote: > > The 'pins' list contains packet-ins, not flow-mods. > > > > Introduced by commit ada3a58d1f8 (ofproto-dpif: Make packet_ins thread

Re: [ovs-dev] [PATCH] ofproto-dpif: Fix bad pointer dereference when deleting a bridge.

2013-08-15 Thread Ethan Jackson
Acked-by: Ethan Jackson On Fri, Aug 16, 2013 at 8:55 AM, Ben Pfaff wrote: > The 'pins' list contains packet-ins, not flow-mods. > > Introduced by commit ada3a58d1f8 (ofproto-dpif: Make packet_ins thread > safe.). > > Signed-off-by: Ben Pfaff > --- > ofproto/ofproto-dpif.c |4 ++-- > 1 file

[ovs-dev] [PATCH] ofproto-dpif: Fix bad pointer dereference when deleting a bridge.

2013-08-15 Thread Ben Pfaff
The 'pins' list contains packet-ins, not flow-mods. Introduced by commit ada3a58d1f8 (ofproto-dpif: Make packet_ins thread safe.). Signed-off-by: Ben Pfaff --- ofproto/ofproto-dpif.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofpr

Re: [ovs-dev] [PATCH] ofproto: Avoid extra O(N) work in common case on flow addition.

2013-08-15 Thread Ethan Jackson
Acked-by: Ethan Jackson Thanks a lot. On Fri, Aug 16, 2013 at 8:39 AM, Ben Pfaff wrote: > The OpenFlow OFPFF_CHECK_OVERLAP flag requires us to check whether the flow > being inserted overlaps with any existing flows. That isn't efficiently > implemented and typically requires us to compare the

Re: [ovs-dev] [PATCH V3 1/3] coverage: Reimplement the "ovs-appclt coverage/show" command

2013-08-15 Thread Andy Zhou
Thanks for rebasing. On Wed, Aug 14, 2013 at 5:04 PM, Alex Wang wrote: > This commit changes the "ovs-appclt coverage/show" command to show the > per-second, per-minute and per-hour rates of function invocation. More > importantly, this makes using coverage counter an easy way to monitor > the

[ovs-dev] [PATCH] ofproto: Avoid extra O(N) work in common case on flow addition.

2013-08-15 Thread Ben Pfaff
The OpenFlow OFPFF_CHECK_OVERLAP flag requires us to check whether the flow being inserted overlaps with any existing flows. That isn't efficiently implemented and typically requires us to compare the new flow against most or all of the existing flows. We don't have to do that work if OFPFF_CHECK

Re: [ovs-dev] bridge/dump-flows

2013-08-15 Thread Ben Pfaff
On Fri, Aug 16, 2013 at 08:09:02AM +0900, YAMAMOTO Takashi wrote: > > On Fri, Aug 16, 2013 at 07:40:20AM +0900, YAMAMOTO Takashi wrote: > >> is there any reason why ovs-appctl bridge/dump-flows reports > >> "priority" twice for each flows? > > > > There are two possibilities. I have not looked to

Re: [ovs-dev] [PATCH] ovsdb: Add "n-handler-threads" to Open_vSwitch TABLE.

2013-08-15 Thread Ben Pfaff
Applied, thanks. On Thu, Aug 15, 2013 at 04:05:15PM -0700, Alex Wang wrote: > This looks good, thanks Ben, > > > On Thu, Aug 15, 2013 at 3:49 PM, Ben Pfaff wrote: > > > I think that the documentation can be improved. What do you think of > > this incremental? > > > > diff --git a/vswitchd/vsw

Re: [ovs-dev] bridge/dump-flows

2013-08-15 Thread YAMAMOTO Takashi
> On Fri, Aug 16, 2013 at 07:40:20AM +0900, YAMAMOTO Takashi wrote: >> is there any reason why ovs-appctl bridge/dump-flows reports >> "priority" twice for each flows? > > There are two possibilities. I have not looked to see which is the > case. > > One possibility is that this is a bug. If so

Re: [ovs-dev] [PATCH] ovsdb: Add "n-handler-threads" to Open_vSwitch TABLE.

2013-08-15 Thread Alex Wang
This looks good, thanks Ben, On Thu, Aug 15, 2013 at 3:49 PM, Ben Pfaff wrote: > I think that the documentation can be improved. What do you think of > this incremental? > > diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml > index 8c7d082..5bbe943 100644 > --- a/vswitchd/vswitch.xml >

Re: [ovs-dev] [PATCH] ovsdb: Add "n-handler-threads" to Open_vSwitch TABLE.

2013-08-15 Thread Ben Pfaff
I think that the documentation can be improved. What do you think of this incremental? diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 8c7d082..5bbe943 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -160,16 +160,18 @@ + type='{"type":

Re: [ovs-dev] bridge/dump-flows

2013-08-15 Thread Ben Pfaff
On Fri, Aug 16, 2013 at 07:40:20AM +0900, YAMAMOTO Takashi wrote: > is there any reason why ovs-appctl bridge/dump-flows reports > "priority" twice for each flows? There are two possibilities. I have not looked to see which is the case. One possibility is that this is a bug. If so, then we shou

Re: [ovs-dev] [PATCH] ofproto-dpif: move per-backer wait calls from wait to type_wait

2013-08-15 Thread Ben Pfaff
On Fri, Aug 16, 2013 at 07:25:18AM +0900, YAMAMOTO Takashi wrote: > > On Thu, Aug 15, 2013 at 08:25:44PM +0900, YAMAMOTO Takashi wrote: > >> move per-backer wait calls (dpif_wait/udpif_wait) from ofproto_wait > >> to ofproto_type_wait. > >> > >> this fixes O(N^2) behaviour (eg. poll slot consumpti

[ovs-dev] bridge/dump-flows

2013-08-15 Thread YAMAMOTO Takashi
is there any reason why ovs-appctl bridge/dump-flows reports "priority" twice for each flows? YAMAMOTO Takashi duration=45786s, priority=32768, n_packets=0, n_bytes=0, dl_dst=30:31:3a:38:30:3a,dl_type=0x88cc,actions=CONTROLLER:51 table_id=254, duration=45787s, priority=0, n_packets=0, n_bytes=0,

Re: [ovs-dev] [PATCH] ofproto-dpif: move per-backer wait calls from wait to type_wait

2013-08-15 Thread YAMAMOTO Takashi
> On Thu, Aug 15, 2013 at 08:25:44PM +0900, YAMAMOTO Takashi wrote: >> move per-backer wait calls (dpif_wait/udpif_wait) from ofproto_wait >> to ofproto_type_wait. >> >> this fixes O(N^2) behaviour (eg. poll slot consumption) for >> dpif-netdev where N is the number of bridges. >> >> Signed-off-b

Re: [ovs-dev] [PATCH V3 1/4] bfd: Implement BFD decay.

2013-08-15 Thread Ethan Jackson
> There are two solutions I can think of: > 1. use "(2000 / bfd->cfg_min_rx + 10)" to compensate for the jitter. Sure I think this is fine as it gives us a little bit of wiggle room. Seems a bit cleaner than option (2). Ethan > > > 2. if I can share the "push_timer" in ofproto-dpif.c with bfd.c

Re: [ovs-dev] [PATCH] ofproto-dpif: move per-backer wait calls from wait to type_wait

2013-08-15 Thread Ben Pfaff
On Thu, Aug 15, 2013 at 08:25:44PM +0900, YAMAMOTO Takashi wrote: > move per-backer wait calls (dpif_wait/udpif_wait) from ofproto_wait > to ofproto_type_wait. > > this fixes O(N^2) behaviour (eg. poll slot consumption) for > dpif-netdev where N is the number of bridges. > > Signed-off-by: YAMAMO

[ovs-dev] [PATCH] datapath: More strict vlan encap netlink check

2013-08-15 Thread Andy Zhou
Only parse the encap key field if eth_type is 802.1Q and VLAN_TAG_PRESENT bit is set. Add a few more eror checks and logs. Signed-off-by: Andy Zhou --- datapath/flow.c | 66 --- 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/

[ovs-dev] [PATCH V4 1/4] bfd: Implement BFD decay.

2013-08-15 Thread Alex Wang
When there is no incoming data traffic at the interface for a period, BFD decay allows the bfd session to increase the min_rx. This is helpful in that some interfaces may be idle for long a time. And cpu consumption can be reduced by processing fewer bfd control packets. Signed-off-by: Alex Wang

Re: [ovs-dev] [PATCH V3 1/4] bfd: Implement BFD decay.

2013-08-15 Thread Alex Wang
On Wed, Aug 14, 2013 at 7:21 PM, Ethan Jackson wrote: > > - do not allow bfd to call bfd_may_decay when decay_min_rx > > is less than rmt_min_tx. > > Why? I don't think we should need this. If the rmt_min_tx is greater > than our min_rx, according to the bfd protocol we'll simply use the > rm

Re: [ovs-dev] [PATCH] datapath: Fix RHEL compat for netdev_rx_handler_register

2013-08-15 Thread Pravin Shelar
Thanks guys. I pushed patch to master On Thu, Aug 15, 2013 at 12:49 PM, Thomas Graf wrote: > On Thu, Aug 15, 2013 at 12:33:06PM -0700, Chris Wright wrote: > > Andrei Andone reported an oops on CentOS 6.4 when adding a device to an > > ovs instance. The problem is easy to reproduce and generate

[ovs-dev] Bug#719736: openvswitch: build FTBFS "make check" failures on most archs

2013-08-15 Thread Ben Pfaff
On Wed, Aug 14, 2013 at 11:24:38AM -0700, Ben Pfaff wrote: > A little work with gdb shows that 501 failed due to misaligned data > access in a "packet out" OpenFlow command in packet_set_ipv4(). It > looks like handle_packet_out() in ofproto.c needs to properly align > the L3 header. It seems lik

[ovs-dev] [risc 4/4] packets, pktbuf: Align L3 headers on 32-bit boundary.

2013-08-15 Thread Ben Pfaff
Memory access tends to be faster when data is properly aligned. Signed-off-by: Ben Pfaff --- lib/packets.c | 16 +++- ofproto/ofproto-provider.h |1 + ofproto/ofproto.c |4 ++-- ofproto/pktbuf.c |9 - 4 files changed, 18 insertion

[ovs-dev] [risc 3/4] packets: Introduce IPv6 headers not aligned on a 32-bit boundary.

2013-08-15 Thread Ben Pfaff
This fixes the same problem for IPv6 headers treated for other headers in the previous commit. Signed-off-by: Ben Pfaff --- lib/csum.c|7 --- lib/csum.h|2 +- lib/flow.c| 10 +- lib/packets.c | 32 ++-- lib/packets.h | 32

[ovs-dev] [risc 0/4] Fix misaligned data causing bus errors on RISC

2013-08-15 Thread Ben Pfaff
This series fixes bus errors on RISC machines due to misaligned data, e.g. see this sparc build: https://buildd.debian.org/status/fetch.php?pkg=openvswitch&arch=sparc&ver=1.9.2%2Bgit20130813-1&stamp=1376471499 See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719736 I intend to b

[ovs-dev] [risc 1/4] ofproto: Remove obsolete comment and assertion.

2013-08-15 Thread Ben Pfaff
At one time, the ofproto-dpif implementation of the 'rule_execute' member function required, indirectly, at least struct(ofp10_packet_in) bytes of headroom in the packet passed into it. (This allowed constructing an OFPT_PACKET_IN without allocating and copying a new ofpbuf.) This restriction has

[ovs-dev] [risc 2/4] packets: Do not assume that IPv4, TCP, or ARP headers are 32-bit aligned.

2013-08-15 Thread Ben Pfaff
Ethernet headers are 14 bytes long, so when the beginning of such a header is 32-bit aligned, the following data is misaligned. The usual trick to fix that is to start the Ethernet header on an odd-numbered 16-bit boundary. That trick works OK for Open vSwitch, but there are two problems: - O

Re: [ovs-dev] [PATCH] datapath: Fix RHEL compat for netdev_rx_handler_register

2013-08-15 Thread Thomas Graf
On Thu, Aug 15, 2013 at 12:33:06PM -0700, Chris Wright wrote: > Andrei Andone reported an oops on CentOS 6.4 when adding a device to an > ovs instance. The problem is easy to reproduce and generates the > following stack trace: > > kernel tried to execute NX-protected page - exploit attempt? (uid

Re: [ovs-dev] [PATCH] datapath: Fix RHEL compat for netdev_rx_handler_register

2013-08-15 Thread Kyle Mestery (kmestery)
On Aug 15, 2013, at 2:33 PM, Chris Wright wrote: > Andrei Andone reported an oops on CentOS 6.4 when adding a device to an > ovs instance. The problem is easy to reproduce and generates the > following stack trace: > > kernel tried to execute NX-protected page - exploit attempt? (uid: 0) > BUG:

[ovs-dev] [PATCH] datapath: Fix RHEL compat for netdev_rx_handler_register

2013-08-15 Thread Chris Wright
Andrei Andone reported an oops on CentOS 6.4 when adding a device to an ovs instance. The problem is easy to reproduce and generates the following stack trace: kernel tried to execute NX-protected page - exploit attempt? (uid: 0) BUG: unable to handle kernel paging request at 88033afa49c0 IP:

Re: [ovs-dev] [PATCH 5/5] datapath lisp: Use ovs offload compat functionality.

2013-08-15 Thread Pravin Shelar
On Wed, Aug 14, 2013 at 10:56 AM, Jesse Gross wrote: > On Mon, Jul 29, 2013 at 3:48 PM, Pravin B Shelar > wrote: > > diff --git a/datapath/vport-lisp.c b/datapath/vport-lisp.c > > index 847cb39..9ffa74f 100644 > > --- a/datapath/vport-lisp.c > > +++ b/datapath/vport-lisp.c > > +static void handl

[ovs-dev] [PATCH] ofproto-dpif: move per-backer wait calls from wait to type_wait

2013-08-15 Thread YAMAMOTO Takashi
move per-backer wait calls (dpif_wait/udpif_wait) from ofproto_wait to ofproto_type_wait. this fixes O(N^2) behaviour (eg. poll slot consumption) for dpif-netdev where N is the number of bridges. Signed-off-by: YAMAMOTO Takashi --- ofproto/ofproto-dpif.c | 4 ++-- 1 file changed, 2 insertions(+

Re: [ovs-dev] [GIT net] Open vSwitch

2013-08-15 Thread David Miller
From: Jesse Gross Date: Wed, 14 Aug 2013 16:19:04 -0700 > Three bug fixes that are fairly small either way but resolve obviously > incorrect code. For net/3.11. Pulled, thanks Jesse. ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailm

Re: [ovs-dev] [PATCH] ovsdb: Add "n-handler-threads" to Open_vSwitch TABLE.

2013-08-15 Thread Alex Wang
This patch is the rework of : http://openvswitch.org/pipermail/dev/2013-August/030705.html It includes the configuration of ofproto-dpif-upcall module. On Thu, Aug 15, 2013 at 12:23 AM, Alex Wang wrote: > This commit adds a new column "n-handler-threads" to ovsdb Open_vSwitch > TABLE. This is

[ovs-dev] [PATCH] ovsdb: Add "n-handler-threads" to Open_vSwitch TABLE.

2013-08-15 Thread Alex Wang
This commit adds a new column "n-handler-threads" to ovsdb Open_vSwitch TABLE. This is used to set the number of upcall handler threads created by the ofproto-dpif-upcall module. Signed-off-by: Alex Wang --- ofproto/ofproto-dpif.c | 20 ofproto/ofproto-provider.h |