[ovs-git] Open vSwitch: flow: Fix misaligned access. (wdp)

dev at openvswitch.org dev at openvswitch.org
Fri May 7 22:06:10 UTC 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, wdp has been updated
       via  99f4a6f223e937cad4e66c12d8355e5e10da1ca3 (commit)
       via  5ede26311a840f1ea63ca0998e0f7852bd765c7b (commit)
       via  0b8d6d3d969d99f4cfd127f8fcf169568f6bd3e7 (commit)
       via  eb18f4c70b84ad4b65180d9ebc200491e34d5aec (commit)
       via  549c1d0d63b20492d44384f91b7ecf0ac3ea77a9 (commit)
       via  ec45a0d3a5eb69391f8497c8b1c19fbb8950c07e (commit)
       via  eea62db5e278c5d9183f35a1fb42cc0fbafa86c0 (commit)
      from  1dc0c95e782acf9763993b9ea2cf63ebc99a3de2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 99f4a6f223e937cad4e66c12d8355e5e10da1ca3
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=99f4a6f223e937cad4e66c12d8355e5e10da1ca3
Author: Ben Pfaff <blp at nicira.com>
		
flow: Fix misaligned access.
		
The testsuite for the flow extractor triggered this.

With this commit, "make check" passes on SPARC.


commit 5ede26311a840f1ea63ca0998e0f7852bd765c7b
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=5ede26311a840f1ea63ca0998e0f7852bd765c7b
Author: Ben Pfaff <blp at nicira.com>
		
Add header for access to potentially unaligned data.
		
I had been under the impression that "memcpy" was a valid way to copy
unaligned data into an aligned location for access.  But testing on SPARC
has shown that GCC doesn't always honor that intention.  It seems that, if
GCC can see that there is a pointer of a type that requires alignment to
a given object, then it will access it directly regardless of whether
memcpy() is used to copy it.

This commit adds a new header with functions to access unaligned data.  I
managed to come up with two techniques, one GCC-specific, one generic, that
do avoid the misaligned access in my test case.  The GCC-specific technique
is the same one used by the Linux kernel (although no code has been
literally copied).  The other one seemed obvious but possibly slow
depending on the compiler's ability to optimize.

The following commit adds a user.


commit 0b8d6d3d969d99f4cfd127f8fcf169568f6bd3e7
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=0b8d6d3d969d99f4cfd127f8fcf169568f6bd3e7
Author: Ben Pfaff <blp at nicira.com>
		
ovsdb-client: Serialize columns in predictable order on "monitor" command.
		
The "monitor" command goes to some trouble to write its output in a
predictable order, so that test programs can reliably compare it against
expectations.  This commit fixes up one part that was missing, which is
that the columns were not being ordered predictably (it depended on
hash order, which differs between big-endian and little-endian systems).
It also updates the test suite to expect the new order.


commit eb18f4c70b84ad4b65180d9ebc200491e34d5aec
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=eb18f4c70b84ad4b65180d9ebc200491e34d5aec
Author: Ben Pfaff <blp at nicira.com>
		
tests: Fix bug in "ovsdb-tool compact" test.
		
This test examines the OVSDB database log and checks that it contains what
it should for specified transactions.  However, the database log ordering
differs between big-endian and little-endian architectures because it is
written out in hash order.  We don't want to incur the expense of always
sorting the log as we write it out, so instead this commit fixes the
problem by sorting the log as it reads it, using the "test-json" program.


commit 549c1d0d63b20492d44384f91b7ecf0ac3ea77a9
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=549c1d0d63b20492d44384f91b7ecf0ac3ea77a9
Author: Ben Pfaff <blp at nicira.com>
		
tests: Fix bug in "weak references" test.
		
One part of the "weak references" test inserts invalid all-zeros weak
references into two columns and expects to get an error message mentioning
one of them.  Unfortunately the one that actually gets mentioned depends
on hash ordering and thus differs between big-endian and little-endian
machines.  This commit fixes the problem by only putting an invalid
reference in a single column, instead of two of them.


commit ec45a0d3a5eb69391f8497c8b1c19fbb8950c07e
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=ec45a0d3a5eb69391f8497c8b1c19fbb8950c07e
Author: Ben Pfaff <blp at nicira.com>
		
tests: Fix bug in ovsdb-server test suite.
		
The formatting of OVSDB syntax errors differed between big-endian and
little-endian systems, which caused the "database multiplexing
implementation" test to fail on SPARC.  This commit fixes the problem by
always outputting JSON in syntax errors in deterministic (sorted) order.


commit eea62db5e278c5d9183f35a1fb42cc0fbafa86c0
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=eea62db5e278c5d9183f35a1fb42cc0fbafa86c0
Author: Ben Pfaff <blp at nicira.com>
		
util: Fix GCC false-positive warning for CONTAINER_OF.
		
On sparc, GCC would issue the following warning for every use of
CONTAINER_OF:

    warning: cast increases required alignment of target type

This is a false positive: assuming that the data structure that it is
applied to was allocated properly, the use of CONTAINER_OF to reach it is
valid.  And if it was not allocated properly, then code that accesses it
other ways will have trouble too.


-----------------------------------------------------------------------

Summary of changes:
 lib/automake.mk          |    1 +
 lib/flow.c               |    6 ++-
 lib/ovsdb-error.c        |    2 +-
 lib/unaligned.h          |  122 ++++++++++++++++++++++++++++++++++++++++++++++
 lib/util.h               |    2 +-
 ovsdb/ovsdb-client.c     |   18 +++++--
 tests/ovsdb-execution.at |    3 +-
 tests/ovsdb-monitor.at   |   12 ++--
 tests/ovsdb-server.at    |   40 ++++++++--------
 tests/ovsdb-tool.at      |   38 +++++++-------
 10 files changed, 189 insertions(+), 55 deletions(-)
 create mode 100644 lib/unaligned.h


hooks/post-receive
-- 
Open vSwitch




More information about the git mailing list