[ovs-dev] [PATCH] ovsdb Allow comparison on optional scalar types

2014-08-19 Thread Terry Wilson
This allows things like initiating a wait request on an interface ofport being set. When the optional field is empty and operation is != or excludes then the result is true; otherwise it is false. If the field is set then the field is compared normally for its type. Signed-off-by: Terry Wilson

[ovs-dev] Working on C wrapper for Python JSON parsing

2016-05-04 Thread Terry Wilson
I currently have a patch that adds a C extension module to wrap the in-tree JSON parser. It works with both Python 2 and 3. The performance increase is quite large. For example, parsing a 100Mb JSON file: Without extension: 273 seconds With extension: 3.7 seconds On the object->string side, I

Re: [ovs-dev] Working on C wrapper for Python JSON parsing

2016-05-06 Thread Terry Wilson
On Fri, May 6, 2016 at 10:30 AM, Ben Pfaff wrote: >> I'd like to avoid having to wrap the serialization stuff when there is >> something else that already works and is better, but if I have to I >> will. Just looking for opinions on what I should do. Here's the test >> failure output: > > Both for

[ovs-dev] [PATCH 2/2] JSON serialization via Python's json lib

2016-05-09 Thread Terry Wilson
There is no particularly good reason to use our own Python JSON serialization implementation when serialization can be done faster with Python's built-in JSON library. A few tests were changed due to Python's default JSON library returning slightly more precise floating point numbers and returning

[ovs-dev] [PATCH 1/2] Add optional C extension wrapper for Python JSON parsing

2016-05-09 Thread Terry Wilson
The pure Python in-tree JSON parser is *much* slower than the in-tree C JSON parser. A local test parsing a 100Mb JSON file showed the Python version taking 270 seconds. With the C wrapper, it took 4 seconds. The C extension will be used automatically if it can be built. If the extension fails to

[ovs-dev] [PATCH 1/2] Add optional C extension wrapper for Python JSON parsing

2016-05-09 Thread Terry Wilson
The pure Python in-tree JSON parser is *much* slower than the in-tree C JSON parser. A local test parsing a 100Mb JSON file showed the Python version taking 270 seconds. With the C wrapper, it took 4 seconds. The C extension will be used automatically if it can be built. If the extension fails to

[ovs-dev] [PATCH 2/2] JSON serialization via Python's json lib

2016-05-09 Thread Terry Wilson
There is no particularly good reason to use our own Python JSON serialization implementation when serialization can be done faster with Python's built-in JSON library. A few tests were changed due to Python's default JSON library returning slightly more precise floating point numbers and returning

[ovs-dev] [PATCH v2 0/2] Python JSON improvements

2016-05-10 Thread Terry Wilson
Python and wrapped versions, so theoretically I'd need tests to handle both cases. Anyone have any ideas? Terry Wilson (2): Add optional C extension wrapper for Python JSON parsing JSON serialization via Python's json lib Makefile.am| 2 +- python/automake.mk | 3 + pyth

[ovs-dev] [PATCH v2 1/2] Add optional C extension wrapper for Python JSON parsing

2016-05-10 Thread Terry Wilson
The pure Python in-tree JSON parser is *much* slower than the in-tree C JSON parser. A local test parsing a 100Mb JSON file showed the Python version taking 270 seconds. With the C wrapper, it took under 4 seconds. The C extension will be used automatically if it can be built. If the extension fai

[ovs-dev] [PATCH v2 2/2] JSON serialization via Python's json lib

2016-05-10 Thread Terry Wilson
There is no particularly good reason to use our own Python JSON serialization implementation when serialization can be done faster with Python's built-in JSON library. A few tests were changed due to Python's default JSON library returning slightly more precise floating point numbers and returning

Re: [ovs-dev] [PATCH v2 0/2] Python JSON improvements

2016-05-23 Thread Terry Wilson
On Wed, May 18, 2016 at 8:12 PM, Ben Pfaff wrote: > These patches apply cleanly but they cause test failures for me, see > below. Maybe that is because of the issue you mentioned above? Yeah, these test issues are because the C extension ends up not getting built automatically. I'm having troubl

[ovs-dev] [PATCH 2/3] Add optional C extension wrapper for Python JSON parsing

2016-05-31 Thread Terry Wilson
The pure Python in-tree JSON parser is *much* slower than the in-tree C JSON parser. A local test parsing a 100Mb JSON file showed the Python version taking 270 seconds. With the C wrapper, it took under 4 seconds. The C extension will be used automatically if it can be built. If the extension fai

[ovs-dev] [PATCH 1/3] Ensure significand remains an integer in Python3 json parser

2016-05-31 Thread Terry Wilson
The / operation in Python 2 is "floor division" for int/long types while in Python 3 is "true division". This means that the significand can become a float with the existing code in Python 3. This, in turn, can result in a parse of something like [1.10e1] returning 11 in Python 2 and 11.0 in Python

[ovs-dev] [PATCH 3/3] JSON serialization via Python's json lib

2016-05-31 Thread Terry Wilson
There is no particularly good reason to use our own Python JSON serialization implementation when serialization can be done faster with Python's built-in JSON library. A few tests were changed due to Python's default JSON library returning slightly more precise floating point numbers. --- configu

[ovs-dev] [PATCH v3 0/3] Python JSON improvements

2016-05-31 Thread Terry Wilson
build system changes are resolved in this version. Terry Wilson (3): Ensure significand remains an integer in Python3 json parser Add optional C extension wrapper for Python JSON parsing JSON serialization via Python's json lib Makefile.am| 2 +- configure.ac | 2

[ovs-dev] [PATCH 0/2] Python JSON parser improvements

2016-07-12 Thread Terry Wilson
These patches should address the previous issue with building the Python wrapper when builddir != srcdir. It also ensures that the wrapper can be properly built by pip from out-of-tree by ensuring that json.h is added to include/openvswitch/json.h. Terry Wilson (2): Move lib/json.h to include

[ovs-dev] [PATCH 1/2] Move lib/json.h to include/openvswitch

2016-07-12 Thread Terry Wilson
id not use anything from there, but rather from include/openvswitch/util.h. Fixing that required including util.h in several C files mostly due to OVS_NOT_REACHED and things like xmalloc. Signed-off-by: Terry Wilson --- include/openvswitch/automake.mk | 3 + include/openvswitch/hmap.h

[ovs-dev] [PATCH 2/2] JSON serialization via Python's json lib

2016-07-12 Thread Terry Wilson
Signed-off-by: Terry Wilson --- configure.ac | 2 + m4/openvswitch.m4 | 47 python/automake.mk | 26 - python/ovs/json.py | 106 + tests/json.at | 26 ++--- 5 files changed, 103

[ovs-dev] [PATCH] JSON serialization via Python's json lib

2016-07-25 Thread Terry Wilson
I noticed that with the previous patch, in testing 'make install' with patch to move json.h, I had forgotten to remove the installed headers. Removing the installed headers revealed that this patch still didn't build properly from a separate build directory. This time it *shoul

[ovs-dev] [PATCH v5] JSON serialization via Python's json lib

2016-07-25 Thread Terry Wilson
Signed-off-by: Terry Wilson --- configure.ac | 2 + m4/openvswitch.m4 | 47 python/automake.mk | 27 +- python/ovs/json.py | 106 + tests/json.at | 26 ++--- 5 files changed, 104

Re: [ovs-dev] [PATCH v5] JSON serialization via Python's json lib

2016-07-25 Thread Terry Wilson
Terry On Fri, Jul 22, 2016 at 9:57 PM, Terry Wilson wrote: > There is no particularly good reason to use our own Python JSON > serialization implementation when serialization can be done faster > with Python's built-in JSON library. > > A few tests were changed due to Pyth

[ovs-dev] [PATCH] JSON serialization via Python's json lib

2016-07-25 Thread Terry Wilson
Signed-off-by: Terry Wilson --- python/ovs/json.py | 106 + tests/json.at | 26 ++--- 2 files changed, 30 insertions(+), 102 deletions(-) diff --git a/python/ovs/json.py b/python/ovs/json.py index ea0400a..ddf5dd2 100644 --- a/

[ovs-dev] [PATCH] JSON serialization via Python's json lib

2016-07-25 Thread Terry Wilson
This patch removes the json extension build system changes since they aren't even related to the serialization change, which is pure-Python. Terry Wilson (1): JSON serialization via Python's json lib python/ovs/json.py | 106 + tes

Re: [ovs-dev] [PATCH v5] JSON serialization via Python's json lib

2016-07-29 Thread Terry Wilson
On Fri, Jul 29, 2016 at 12:27 AM, Ben Pfaff wrote: > On Mon, Jul 25, 2016 at 06:55:49PM -0500, Terry Wilson wrote: >> Sigh. And of course I had libopenvswitch installed on the system as >> well and removing it breaks building the extensions with the above >> patch. This is t

[ovs-dev] [PATCH v4 0/3] Python JSON improvements

2016-06-08 Thread Terry Wilson
build system changes are resolved in this version. Terry Wilson (3): Ensure significand remains an integer in Python3 json parser Add optional C extension wrapper for Python JSON parsing JSON serialization via Python's json lib Makefile.am| 2 +- configure.ac | 2

[ovs-dev] [PATCH 1/3] Ensure significand remains an integer in Python3 json parser

2016-06-08 Thread Terry Wilson
Python 2 and 11.0 in Python 3. Switching to the // operator resolves this difference. The JSON tests do not catch this difference because the built-in serializer prints floats with the %.15g format which will convert floats with no fractional part to an integer representation. Signed-off-by: Terry Wil

[ovs-dev] [PATCH 3/3] JSON serialization via Python's json lib

2016-06-08 Thread Terry Wilson
Signed-off-by: Terry Wilson --- configure.ac | 2 + m4/openvswitch.m4 | 47 python/automake.mk | 22 +++ python/ovs/json.py | 106 + tests/json.at | 26 ++--- 5 files changed, 101 insertio

[ovs-dev] [PATCH 2/3] Add optional C extension wrapper for Python JSON parsing

2016-06-08 Thread Terry Wilson
igned-off-by: Terry Wilson --- Makefile.am| 2 +- python/automake.mk | 3 + python/ovs/_json.c | 268 + python/ovs/json.py | 11 +++ python/setup.py| 51 +- 5 files changed, 332 insertions(+), 3 deletions(-) create

[ovs-dev] Bug#826780: Bug#826780: Please package OVS >= 2.6.0.dev1

2016-06-09 Thread Terry Wilson
On Thu, Jun 9, 2016 at 3:07 AM, Russell Bryant wrote: > The real solution to making this less awkward would be to split the Python > library out of the OVS git tree so that it can be released independently of > OVS itself. That way a proper verison could be released that includes > Python 3 suppo

[ovs-dev] [PATCH v4] JSON serialization via Python's json lib

2016-06-09 Thread Terry Wilson
Signed-off-by: Terry Wilson --- configure.ac | 2 + m4/openvswitch.m4 | 47 python/automake.mk | 22 +++ python/ovs/json.py | 106 + tests/json.at | 26 ++--- 5 files changed, 101 insertio

[ovs-dev] [PATCH v5] JSON serialization via Python's json lib

2016-06-10 Thread Terry Wilson
Signed-off-by: Terry Wilson --- configure.ac | 2 + m4/openvswitch.m4 | 47 python/automake.mk | 26 - python/ovs/json.py | 106 + tests/json.at | 26 ++--- 5 files changed, 103

[ovs-dev] Bug#826780: Bug#826780: Please package OVS >= 2.6.0.dev1

2016-06-10 Thread Terry Wilson
On Thu, Jun 9, 2016 at 10:04 PM, Joe Stringer wrote: >> On Thu, Jun 9, 2016 at 3:07 AM, Russell Bryant wrote: >>> The real solution to making this less awkward would be to split the Python >>> library out of the OVS git tree so that it can be released independently of >>> OVS itself. That way a

Re: [ovs-dev] [PATCH] python: Allow specifying the iterations in Idl.run

2016-03-24 Thread Terry Wilson
On Wed, Mar 23, 2016 at 2:31 PM, Jason Kölker wrote: > On Wed, Mar 23, 2016 at 6:29 PM, Ben Pfaff wrote: >> On Sun, Mar 20, 2016 at 03:29:06AM +, Jason Kölker wrote: >>> Callers to Idl.run() should be able to specify the number of iterations >>> to run in one call. Instrumentation revealed th

Re: [ovs-dev] [PATCH v3 0/3] vhost-user: Add the ability to control ownership/permissions

2016-08-12 Thread Terry Wilson
On Thu, Aug 11, 2016 at 8:53 PM, Aaron Conole wrote: > I've been working on a better solution - it occurred to me that since > this is being done for linux-only anyway, I might as well do this with > systemd. I can get almost everything done with no C code changes, thus > far. Once I figure out

[ovs-dev] [PATCH v2] Start fixing some Python 3 compatibility issues

2015-07-30 Thread Terry Wilson
This patch fixes just the Python 3 problems found by running python3 setup.py install There are still many other issues to be fixed, but this is a start. Signed-off-by: Terry Wilson --- python/ovs/daemon.py | 31 --- python/ovs/db/idl.py | 10

[ovs-dev] [PATCH v2] Add setuptools for Python lib for PyPI

2015-04-10 Thread Terry Wilson
This adds very basic support for setuptools so that the OVS Python lib can be added to PyPI. This currently uses the Open vSwitch version number and the generated dirs.py, though there is no real reason to tie the Python libraries releases or version numbers to the main project's. --- Reposting t

Re: [ovs-dev] [PATCH v2] Add setuptools for Python lib for PyPI

2015-04-10 Thread Terry Wilson
Signed-off-by: Terry Wilson /me sighs ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev

Re: [ovs-dev] [PATCH v2] Add setuptools for Python lib for PyPI

2015-04-10 Thread Terry Wilson
- Original Message - > On 04/10/2015 03:57 PM, Terry Wilson wrote: > > This adds very basic support for setuptools so that the OVS Python > > lib can be added to PyPI. > > Most Python libraries are on PyPI, so it makes sense to put this one > there, too. Anot

[ovs-dev] [PATCH] Allow subclasses of Idl to define a notification hook

2015-04-24 Thread Terry Wilson
N response on an update to a Row object to make it easy for users of notify() to see what changed, though this usage of Row is quite different than Idl's typical use. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 42 +- 1 file changed, 41 i

[ovs-dev] [PATCH v2] Allow subclasses of Idl to define a notification hook

2015-04-25 Thread Terry Wilson
N response on an update to a Row object to make it easy for users of notify() to see what changed, though this usage of Row is quite different than Idl's typical use. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 42 +- tests/ovsd

[ovs-dev] [PATCH v3] Allow subclasses of Idl to define a notification hook

2015-04-25 Thread Terry Wilson
N response on an update to a Row object to make it easy for users of notify() to see what changed, though this usage of Row is quite different than Idl's typical use. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 42 +- tests/ovsd

[ovs-dev] [PATCH] Start fixing some Python 3 compatibility issues

2015-05-13 Thread Terry Wilson
This patch fixes just the Python 3 problems found by running python3 setup.py install There are still many other issues to be fixed, but this is a start. Signed-off-by: Terry Wilson --- python/compat/argparse.py | 2 +- python/ovs/daemon.py | 31

Re: [ovs-dev] [PATCH 1/2] Increase prerequisite from Python 2.4 to Python 2.7.

2015-05-27 Thread Terry Wilson
- Original Message - > On Wed, May 27, 2015 at 12:11:55AM -0400, Russell Bryant wrote: > > On 05/26/2015 10:14 PM, Ben Pfaff wrote: > > > On Tue, May 26, 2015 at 10:31:57AM -0400, Russell Bryant wrote: > > >> On 05/21/2015 10:23 PM, Andy Hill wrote: > > As a consequence, this require