Re: [ovs-dev] [PATCH 01/14] socket-util: Move sock_errno() to socket-util.

2014-02-21 Thread Gurucharan Shetty
On Thu, Feb 20, 2014 at 1:31 PM, Ben Pfaff wrote: > On Wed, Feb 19, 2014 at 03:36:12PM -0800, Gurucharan Shetty wrote: >> And add more users. >> >> Signed-off-by: Gurucharan Shetty > > Bitwise operators don't make sense to me here: >> +if (error == EINPROGRESS >> +#ifdef _WIN32 >> +|

Re: [ovs-dev] [PATCH 05/14] socket-util: getaddrinfo return values for Windows.

2014-02-21 Thread Gurucharan Shetty
On Thu, Feb 20, 2014 at 1:41 PM, Ben Pfaff wrote: > On Wed, Feb 19, 2014 at 03:36:16PM -0800, Gurucharan Shetty wrote: >> Couple of return values need changes. >> * EAI_NODATA is the same as EAI_NONAME. So we prevent duplicate cases. >> * Windows does not have a EAI_SYSTEM. >> >> Signed-off-by: Gu

Re: [ovs-dev] openvswitch-2.0.0 : ovs-vswitchd segfault in netdev_get_etheraddr

2014-02-21 Thread Ben Pfaff
On Thu, Feb 20, 2014 at 11:06:07PM -0800, Sridhar Samudrala wrote: > I am seeing a segfault with ovs-vswitchd when a VM attached to a OVS > bridge is shutdown. > I am running openvswitch-2.0.0 on linux kernel:3.10.30 > > Is this a known issue with any fix in the git repository? Can you reproduce

Re: [ovs-dev] [PATCH] ofproto: Send port status message for port-mods, right away.

2014-02-21 Thread Ben Pfaff
On Fri, Feb 21, 2014 at 10:07:14AM +0800, Kmindg G wrote: > On Fri, Feb 21, 2014 at 5:19 AM, Ben Pfaff wrote: > > On Thu, Feb 20, 2014 at 12:45:49PM +0800, Kmindg G wrote: > >> On Thu, Feb 20, 2014 at 3:20 AM, Ben Pfaff wrote: > >> > Until now, when it processes OFPT_PORT_MOD message, Open vSwitc

Re: [ovs-dev] [PATCH] FAQ: Describe how to add new OpenFlow messages.

2014-02-21 Thread Ben Pfaff
On Thu, Feb 20, 2014 at 05:10:55PM -0800, Jarno Rajahalme wrote: > > > On Jan 21, 2014, at 9:34 AM, Ben Pfaff wrote: > > > > Signed-off-by: Ben Pfaff > > --- > > FAQ | 17 + > > 1 file changed, 17 insertions(+) > > > > diff --git a/FAQ b/FAQ > > index 75d9e6b..dac8fe1 100644 >

Re: [ovs-dev] openvswitch-2.0.0 : ovs-vswitchd segfault in netdev_get_etheraddr

2014-02-21 Thread Sridhar Samudrala
On 2/21/2014 8:38 AM, Ben Pfaff wrote: On Thu, Feb 20, 2014 at 11:06:07PM -0800, Sridhar Samudrala wrote: I am seeing a segfault with ovs-vswitchd when a VM attached to a OVS bridge is shutdown. I am running openvswitch-2.0.0 on linux kernel:3.10.30 Is this a known issue with any fix in the git

Re: [ovs-dev] [rwlock 3/5] ofproto-dpif-xlate: Avoid recursively taking read side of ofgroup rwlock.

2014-02-21 Thread Ben Pfaff
On Wed, Feb 19, 2014 at 02:53:11PM -0800, Joe Stringer wrote: > This looks good to me, although aren't we meant to report something at the > OpenFlow layer? > > Is this equivalent to the OpenFlow "chaining" description? So if we don't > support chaining groups together, we should return an error m

Re: [ovs-dev] [rwlock 4/5] ovs-thread: Get rid of obsolete sparse wrappers.

2014-02-21 Thread Ben Pfaff
Thanks, applied. On Wed, Feb 19, 2014 at 02:55:46PM -0800, Joe Stringer wrote: > Acked-by: Joe Stringer > > > On 16 January 2014 10:07, Ben Pfaff wrote: > > > These were useful back when we were trying to use the sparse lock balance > > annotations, but we removed those in commit 47b52c71232c

Re: [ovs-dev] [rwlock 5/5] ovs-thread: Use fair (but nonrecursive) rwlocks on glibc.

2014-02-21 Thread Ben Pfaff
On Wed, Feb 19, 2014 at 03:10:45PM -0800, Joe Stringer wrote: > On 16 January 2014 10:07, Ben Pfaff wrote: > > > > + * An ovs_rwlock does not support recursive readers, because POSIX allows > > + * taking the reader lock recursively to deadlock when a thread is > > waiting on > > + * the write-loc

Re: [ovs-dev] [PATCH 03/14] socket-util: Maximum file descriptors for windows.

2014-02-21 Thread Gurucharan Shetty
On Thu, Feb 20, 2014 at 1:34 PM, Ben Pfaff wrote: > On Wed, Feb 19, 2014 at 03:36:14PM -0800, Gurucharan Shetty wrote: >> Windows does not have a getrlimit() function. As such, >> there is no limit to number of file descriptors that >> can be opened. So, set an aritificial limit of 1024. >> This m

[ovs-dev] [PATCH v3 05/10] datapath: Clarify locking.

2014-02-21 Thread Jarno Rajahalme
Remove unnecessary locking from functions that are always called with appropriate locking. Signed-off-by: Jarno Rajahalme --- datapath/datapath.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 8a2c0af..59b7f3f 1

[ovs-dev] [PATCH v3 08/10] datapath: Split ovs_flow_cmd_new_or_set().

2014-02-21 Thread Jarno Rajahalme
Following patch will be easier to reason about with separate ovs_flow_cmd_new() and ovs_flow_cmd_set() functions. Signed-off-by: Jarno Rajahalme --- datapath/datapath.c | 173 +++ 1 file changed, 121 insertions(+), 52 deletions(-) diff --git a/da

[ovs-dev] [PATCH v3 02/10] datapath: Fix output of SCTP mask.

2014-02-21 Thread Jarno Rajahalme
The 'output' argument of the ovs_nla_put_flow() is the one from which the bits are written to the netlink attributes. For SCTP we accidentally used the bits from the 'swkey' instead. This caused the mask attributes to include the bits from the actual flow key instead of the mask. Signed-off-by:

[ovs-dev] [PATCH v3 10/10] datapath: Minimize dp and vport critical sections.

2014-02-21 Thread Jarno Rajahalme
Move most memory allocations away from the ovs_mutex critical sections. vport allocations still happen while the lock is taken, as changing that would require major refactoring. Also, vports are created very rarely so it should not matter. Change ovs_dp_cmd_get() now only takes the rcu_read_lock(

[ovs-dev] [PATCH v3 04/10] datapath: Compact sw_flow_key.

2014-02-21 Thread Jarno Rajahalme
Minimize padding in sw_flow_key and move 'tp' top the main struct. These changes simplify code when accessing the transport port numbers and the tcp flags, and makes the sw_flow_key 8 bytes smaller on 64-bit systems (128->120 bytes). These changes also make the keys for IPv4 packets to fit in one

[ovs-dev] [PATCH v3 07/10] datapath: Minimize ovs_flow_cmd_del critical section.

2014-02-21 Thread Jarno Rajahalme
ovs_flow_cmd_del() now allocates reply (if needed) after the flow has already been removed from the flow table. If the reply allocation fails, a netlink error is signaled with netlink_set_err(), as is already done in ovs_flow_cmd_new_or_set() in the similar situation. Signed-off-by: Jarno Rajahal

[ovs-dev] [PATCH v3 06/10] datapath: Build flow cmd netlink reply only if needed.

2014-02-21 Thread Jarno Rajahalme
Use netlink_has_listeners() and NLM_F_ECHO flag to determine if a reply is needed or not for OVS_FLOW_CMD_NEW, OVS_FLOW_CMD_SET, or OVS_FLOW_CMD_DEL. Note: This may need compat support for older kernels. Signed-off-by: Jarno Rajahalme --- datapath/datapath.c | 56 +

[ovs-dev] [PATCH v3 03/10] datapath: Use TCP flags in the flow key for stats.

2014-02-21 Thread Jarno Rajahalme
We already extract the TCP flags for the key, might as well use that for stats. Signed-off-by: Jarno Rajahalme --- datapath/flow.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/datapath/flow.c b/datapath/flow.c index c3e3fcb..3cc4cdf 100644 --- a/datapath/flo

[ovs-dev] [PATCH v3 01/10] datapath: Avoid assigning a NULL pointer to flow actions.

2014-02-21 Thread Jarno Rajahalme
Flow SET can set an empty set of actions by not passing any actions. Previously, we assigned the flow's actions pointer to NULL in this case, but we never check for the NULL pointer later on. This patch modifies this case to allocate a valid but empty set of actions instead. Note: If might be pru

[ovs-dev] [PATCH v3 09/10] datapath: Minimize ovs_flow_cmd_new_or_set critical section.

2014-02-21 Thread Jarno Rajahalme
Note that this has only a little performance benefit when responses are not created (which is normal when there are no netlink multicast listeners around). Signed-off-by: Jarno Rajahalme --- datapath/datapath.c | 123 +-- 1 file changed, 71 insert

Re: [ovs-dev] [PATCH 06/14] socket-util: poll() for Windows.

2014-02-21 Thread Gurucharan Shetty
On Thu, Feb 20, 2014 at 5:14 PM, Ben Pfaff wrote: > On Wed, Feb 19, 2014 at 03:36:17PM -0800, Gurucharan Shetty wrote: >> Windows send() does not have a MSG_DONTWAIT. >> So, use the get_socket_error() function. >> >> Co-authored-by: Linda Sun >> Signed-off-by: Linda Sun >> Signed-off-by: Gurucha

Re: [ovs-dev] [PATCH 08/14] socket-util: Unix socket related calls for non-windows platform.

2014-02-21 Thread Gurucharan Shetty
On Thu, Feb 20, 2014 at 5:21 PM, Ben Pfaff wrote: > On Wed, Feb 19, 2014 at 03:36:19PM -0800, Gurucharan Shetty wrote: >> Don't try to compile Unix socket related functions for Windows. >> >> Signed-off-by: Gurucharan Shetty > > Can we check for AF_UNIX instead of for _WIN32? Unfortunately, AF_UN

Re: [ovs-dev] [PATCH 10/14] socket-util: Windows does not have /dev/null.

2014-02-21 Thread Gurucharan Shetty
On Thu, Feb 20, 2014 at 5:25 PM, Ben Pfaff wrote: > On Wed, Feb 19, 2014 at 03:36:21PM -0800, Gurucharan Shetty wrote: >> Signed-off-by: Gurucharan Shetty > > This is only used in daemon.c, which isn't compiled on Windows. Can we > just move it into there (as a static function)? > Okay. I will d

[ovs-dev] [PATCH v3 00/10] datapath: Reduce lock contention.

2014-02-21 Thread Jarno Rajahalme
Here are some indicative netperf TCP_CRR performance numbers for these patches. Jarno Rajahalme (10): 44.7k (master) datapath: Avoid assigning a NULL pointer to flow actions. datapath: Fix output of SCTP mask. datapath: Use TCP flags in the flow key for stats. 45.0k datapath

Re: [ovs-dev] [PATCH 06/14] socket-util: poll() for Windows.

2014-02-21 Thread Ben Pfaff
On Fri, Feb 21, 2014 at 11:38:19AM -0800, Gurucharan Shetty wrote: > On Thu, Feb 20, 2014 at 5:14 PM, Ben Pfaff wrote: > > On Wed, Feb 19, 2014 at 03:36:17PM -0800, Gurucharan Shetty wrote: > >> Windows send() does not have a MSG_DONTWAIT. > >> So, use the get_socket_error() function. > >> > >> Co

Re: [ovs-dev] [PATCH 08/14] socket-util: Unix socket related calls for non-windows platform.

2014-02-21 Thread Ben Pfaff
On Fri, Feb 21, 2014 at 11:39:24AM -0800, Gurucharan Shetty wrote: > On Thu, Feb 20, 2014 at 5:21 PM, Ben Pfaff wrote: > > On Wed, Feb 19, 2014 at 03:36:19PM -0800, Gurucharan Shetty wrote: > >> Don't try to compile Unix socket related functions for Windows. > >> > >> Signed-off-by: Gurucharan She

[ovs-dev] [PATCH v2 1/4] socket-util: Move get_max_fds() to process.c.

2014-02-21 Thread Gurucharan Shetty
get_max_fds() is used only from process.c. Move it there along with rlim_is_finite(). Since process_start() can only be called before any additional threads are created, we no longer need the thread safety checks in get_max_fds(). Signed-off-by: Gurucharan Shetty --- lib/process.c | 43 +++

[ovs-dev] [PATCH v2 4/4] socket-util: Move get_null_fd() to daemon.c.

2014-02-21 Thread Gurucharan Shetty
get_null_fd() is only called from daemon.c. It does not need thread safety features anymore as it is called either through daemonize_start() or indirectly through daemonize_complete() once. Signed-off-by: Gurucharan Shetty --- lib/daemon.c | 20 lib/socket-util.c |

[ovs-dev] [PATCH v2 3/4] socket-util: poll() for Windows.

2014-02-21 Thread Gurucharan Shetty
Also, Windows does not have a MSG_DONTWAIT. Get rid of it as we always use non-blocking sockets. Co-authored-by: Linda Sun Signed-off-by: Linda Sun Signed-off-by: Gurucharan Shetty --- lib/socket-util.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/l

[ovs-dev] [PATCH v2 2/4] Replace inet_aton() with inet_pton().

2014-02-21 Thread Gurucharan Shetty
Windows does not have inet_aton(), but does have a inet_pton(). inet_aton() is not defined in POSIX. But inet_pton() is. Signed-off-by: Gurucharan Shetty --- lib/bfd.c |2 +- lib/socket-util.c |4 ++-- vswitchd/bridge.c |7 --- 3 files changed, 7 insertions(+), 6 deletion

Re: [ovs-dev] openvswitch-2.0.0 : ovs-vswitchd segfault in netdev_get_etheraddr

2014-02-21 Thread Ben Pfaff
On Fri, Feb 21, 2014 at 09:37:10AM -0800, Sridhar Samudrala wrote: > On 2/21/2014 8:38 AM, Ben Pfaff wrote: > >On Thu, Feb 20, 2014 at 11:06:07PM -0800, Sridhar Samudrala wrote: > >>I am seeing a segfault with ovs-vswitchd when a VM attached to a OVS > >>bridge is shutdown. > >>I am running openvsw

Re: [ovs-dev] [PATCH v2 1/4] socket-util: Move get_max_fds() to process.c.

2014-02-21 Thread Ben Pfaff
On Fri, Feb 21, 2014 at 01:14:33PM -0800, Gurucharan Shetty wrote: > get_max_fds() is used only from process.c. Move it there > along with rlim_is_finite(). Since process_start() can only > be called before any additional threads are created, we > no longer need the thread safety checks in get_max_

Re: [ovs-dev] [PATCH v2 2/4] Replace inet_aton() with inet_pton().

2014-02-21 Thread Ben Pfaff
On Fri, Feb 21, 2014 at 01:14:34PM -0800, Gurucharan Shetty wrote: > Windows does not have inet_aton(), but does have a inet_pton(). > inet_aton() is not defined in POSIX. But inet_pton() is. > > Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff __

Re: [ovs-dev] [PATCH v2 3/4] socket-util: poll() for Windows.

2014-02-21 Thread Ben Pfaff
On Fri, Feb 21, 2014 at 01:14:35PM -0800, Gurucharan Shetty wrote: > +#ifndef _WIN32 > pfd.events = POLLOUT; > +#else > +pfd.events = POLLWRNORM; > +#endif Does this mean that Windows has POLLWRNORM but not POLLOUT? POSIX says they're equivalent, so we could either use POLLWRNORM everywh

Re: [ovs-dev] [PATCH v2 4/4] socket-util: Move get_null_fd() to daemon.c.

2014-02-21 Thread Ben Pfaff
On Fri, Feb 21, 2014 at 01:14:36PM -0800, Gurucharan Shetty wrote: > get_null_fd() is only called from daemon.c. > It does not need thread safety features anymore as > it is called either through daemonize_start() or > indirectly through daemonize_complete() once. > > Signed-off-by: Gurucharan She

Re: [ovs-dev] [PATCH 1/2] dpif-netdev: Call ovs_refcount_destroy() before free().

2014-02-21 Thread Ben Pfaff
On Thu, Feb 20, 2014 at 10:04:53PM -0800, Alex Wang wrote: > This commit makes dp_netdev_flow_unref() and dp_netdev_actions_unref() > invoke the ovs_refcount_destroy() before freeing the corresponding > pointer. > > Signed-off-by: Alex Wang Acked-by: Ben Pfaff __

Re: [ovs-dev] [PATCH 2/2] dpif-netdev: Fix memory leak.

2014-02-21 Thread Ben Pfaff
On Thu, Feb 20, 2014 at 10:04:54PM -0800, Alex Wang wrote: > In dpif_netdev_flow_del() and dp_netdev_port_input(), the > referenced 'netdev_flow' is not un-referenced. This causes > the leak of the struct's memory. > > This commit fixes the above issue by calling dp_netdev_flow_unref() > after us

Re: [ovs-dev] [PATCH 1/2] ovs-vswitchd: Don't register for SIGHUP.

2014-02-21 Thread Ben Pfaff
On Thu, Feb 20, 2014 at 03:17:15PM -0800, Gurucharan Shetty wrote: > We are registering an interest in SIGHUP to reopen > log files. But there is an 'ovs-appctl vlog/reopen' > command that does the same and is used in the > logrotate config for the distributions. > > So remove the redundant functi

Re: [ovs-dev] [PATCH 2/2] signals: Remove unused functions.

2014-02-21 Thread Ben Pfaff
On Thu, Feb 20, 2014 at 03:17:16PM -0800, Gurucharan Shetty wrote: > Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev

Re: [ovs-dev] [PATCH v2 3/4] socket-util: poll() for Windows.

2014-02-21 Thread Gurucharan Shetty
On Fri, Feb 21, 2014 at 1:39 PM, Ben Pfaff wrote: > On Fri, Feb 21, 2014 at 01:14:35PM -0800, Gurucharan Shetty wrote: >> +#ifndef _WIN32 >> pfd.events = POLLOUT; >> +#else >> +pfd.events = POLLWRNORM; >> +#endif > > Does this mean that Windows has POLLWRNORM but not POLLOUT? POSIX > say

Re: [ovs-dev] [PATCH 2/2] dpif-netdev: Fix memory leak.

2014-02-21 Thread Alex Wang
> > > This commit fixes the above issue by calling dp_netdev_flow_unref() > > after using the reference. > > > > Signed-off-by: Alex Wang > > Please backport these fixes, if needed. > > Acked-by: Ben Pfaff > Thanks for the review, Ben, Pushed both patches. Checked the previous branches, no nee

Re: [ovs-dev] [PATCH 1/2] ovs-vswitchd: Don't register for SIGHUP.

2014-02-21 Thread Gurucharan Shetty
On Fri, Feb 21, 2014 at 1:44 PM, Ben Pfaff wrote: > On Thu, Feb 20, 2014 at 03:17:15PM -0800, Gurucharan Shetty wrote: >> We are registering an interest in SIGHUP to reopen >> log files. But there is an 'ovs-appctl vlog/reopen' >> command that does the same and is used in the >> logrotate config f

Re: [ovs-dev] [PATCH 1/2] ovs-vswitchd: Don't register for SIGHUP.

2014-02-21 Thread Ben Pfaff
On Fri, Feb 21, 2014 at 02:56:00PM -0800, Gurucharan Shetty wrote: > On Fri, Feb 21, 2014 at 1:44 PM, Ben Pfaff wrote: > > On Thu, Feb 20, 2014 at 03:17:15PM -0800, Gurucharan Shetty wrote: > >> We are registering an interest in SIGHUP to reopen > >> log files. But there is an 'ovs-appctl vlog/reo

Re: [ovs-dev] [rwlock 3/5] ofproto-dpif-xlate: Avoid recursively taking read side of ofgroup rwlock.

2014-02-21 Thread Joe Stringer
Looks good to me. Acked-by: Joe Stringer On 21 February 2014 10:46, Ben Pfaff wrote: > On Wed, Feb 19, 2014 at 02:53:11PM -0800, Joe Stringer wrote: > > This looks good to me, although aren't we meant to report something at > the > > OpenFlow layer? > > > > Is this equivalent to the OpenFlow

Re: [ovs-dev] [rwlock 3/5] ofproto-dpif-xlate: Avoid recursively taking read side of ofgroup rwlock.

2014-02-21 Thread Ben Pfaff
Thanks. I applied this and patch 5 (the only other remaining patch). On Fri, Feb 21, 2014 at 03:16:28PM -0800, Joe Stringer wrote: > Looks good to me. > > Acked-by: Joe Stringer > > > On 21 February 2014 10:46, Ben Pfaff wrote: > > > On Wed, Feb 19, 2014 at 02:53:11PM -0800, Joe Stringer wr

[ovs-dev] [PATCH] lib/process, socket-util: Update necessary headers

2014-02-21 Thread YAMAMOTO Takashi
Fix the regression introduced by commit 4f57ad10. ("socket-util: Move get_max_fds() to process.c") Signed-off-by: YAMAMOTO Takashi --- lib/process.c | 1 + lib/socket-util.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/process.c b/lib/process.c index b479d00..313f1

Re: [ovs-dev] [PATCH] lib/process, socket-util: Update necessary headers

2014-02-21 Thread Gurucharan Shetty
On Fri, Feb 21, 2014 at 5:33 PM, YAMAMOTO Takashi wrote: > Fix the regression introduced by commit 4f57ad10. > ("socket-util: Move get_max_fds() to process.c") > > Signed-off-by: YAMAMOTO Takashi I suppose this did not fail the build? Otherwise looks like the correct thing to do. > --- > lib/pr

Re: [ovs-dev] [PATCH] ofproto: Send port status message for port-mods, right away.

2014-02-21 Thread Kmindg G
On Sat, Feb 22, 2014 at 12:42 AM, Ben Pfaff wrote: > On Fri, Feb 21, 2014 at 10:07:14AM +0800, Kmindg G wrote: >> On Fri, Feb 21, 2014 at 5:19 AM, Ben Pfaff wrote: >> > On Thu, Feb 20, 2014 at 12:45:49PM +0800, Kmindg G wrote: >> >> On Thu, Feb 20, 2014 at 3:20 AM, Ben Pfaff wrote: >> >> > Until