[ovs-git] Open vSwitch: datapath: Make VERIFY_NUL_STRING return a negative error code. (master)

dev at openvswitch.org dev at openvswitch.org
Thu Jan 27 17:33:59 UTC 2011


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, master has been updated
       via  ae1b9e7d2c6d447f912b7cfbfbf33067419bc156 (commit)
       via  d650378e743b93ab070ffde978a7557aa522dcb1 (commit)
       via  17dddfc95f133997a81a02cd713fc309dd9c81ee (commit)
       via  9d77f19064597afe0c2e5af73c84df57b8e9b2f5 (commit)
       via  c56d226f8d3fc7a68716be87e3d651be604213fa (commit)
       via  3476fce34e05af370e90961a9df4d237d6ca2e51 (commit)
       via  2ad204c8631635a0daf6bb58ece79f89e580e299 (commit)
       via  727ef33f12f7736961455d1835e654687efc4708 (commit)
       via  c6eab56db47739d73675ff181a03eb1923303284 (commit)
       via  7041c3a9b01f049551c1b230874f8ff809b0f3dc (commit)
       via  6b7c12fdc1d3a08a934b29109fa6ffac6b45ebe0 (commit)
       via  cceb11f5b12d09cc8afc87ca4fd03e941234d439 (commit)
       via  18c58479a14f760fb03c2062f9a35961fc74ebb5 (commit)
       via  33cada0cf1f24beb79c23328acb2bf9860c34679 (commit)
       via  b18fcf8edd07d7832c16e96f29d44a2961c1e5aa (commit)
       via  ee114c23f735a91b165dab0908c1fdea736e782a (commit)
       via  a46c577af5c5855939ca3192a56396e15bebf0f8 (commit)
       via  0dce369bdd8bf47895e59277bcbf77b74af20446 (commit)
       via  31ac1e590b9bb2a2ce7c70cd7c8fd2db0fb8e481 (commit)
      from  f0d3bc86154e697f4dc03667950319db66517522 (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 ae1b9e7d2c6d447f912b7cfbfbf33067419bc156
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=ae1b9e7d2c6d447f912b7cfbfbf33067419bc156
Author: Ben Pfaff <blp at nicira.com>
		
datapath: Make VERIFY_NUL_STRING return a negative error code.
		
This is the common kernel convention.  None of the callers currently do
anything with the return code except for test whether it is nonzero, so
they don't need any changes.

Signed-off-by: Ben Pfaff <blp at nicira.com>
Acked-by: Jesse Gross <jesse at nicira.com>


commit d650378e743b93ab070ffde978a7557aa522dcb1
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=d650378e743b93ab070ffde978a7557aa522dcb1
Author: Ben Pfaff <blp at nicira.com>
		
xenserver: Use "ovs-dpctl dump-dps" instead of parsing "ovs-dpctl show".
		
Might as well use the dump-dps command as intended.

Signed-off-by: Ben Pfaff <blp at nicira.com>
Acked-by: Jesse Gross <jesse at nicira.com>


commit 17dddfc95f133997a81a02cd713fc309dd9c81ee
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=17dddfc95f133997a81a02cd713fc309dd9c81ee
Author: Ben Pfaff <blp at nicira.com>
		
ovs-dpctl: Use datapath enumeration functions instead of guessing names.
		
I'm planning to get rid of userspace knowledge of ODP_MAX and this change
gets rid of one user of it.

Reviewed by Justin Pettit.


commit 9d77f19064597afe0c2e5af73c84df57b8e9b2f5
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=9d77f19064597afe0c2e5af73c84df57b8e9b2f5
Author: Ben Pfaff <blp at nicira.com>
		
netdev: Use shash and smap functions instead of inlined substitutes.
		
This simplifies the code and makes it easier to extend in upcoming commits.

Reviewed by Justin Pettit.


commit c56d226f8d3fc7a68716be87e3d651be604213fa
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=c56d226f8d3fc7a68716be87e3d651be604213fa
Author: Ben Pfaff <blp at nicira.com>
		
shash: New "smap" functions for working with string-to-string maps.
		
An shash always has string keys and sometimes it hash string values as
well.  Usually the general-purpose shash functions are fine for working
with string-to-string maps, but this commit introduces a few more
specialized functions that only work with string-to-string maps.  It's not
clear yet to me whether this should actually be a new data structure, so
for now the new functions just work on shashes.

This commit also converts one user of shash_destroy() to use smap_destroy().
This is the only existing user of these functions that I spotted as a
trivial conversion candidate while grepping.

These new functions will see more use in the following commit.

Reviewed by Justin Pettit.


commit 3476fce34e05af370e90961a9df4d237d6ca2e51
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=3476fce34e05af370e90961a9df4d237d6ca2e51
Author: Ben Pfaff <blp at nicira.com>
		
odp-util: Improve formatting of bogus empty action attributes.
		
Before this change, these were formatted as:
	,***%u leftover bytes***
After this change, they are formatted as:
	<empty>,***%u leftover bytes***

Reviewed by Ethan Jackson <ethan at nicira.com>.


commit 2ad204c8631635a0daf6bb58ece79f89e580e299
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=2ad204c8631635a0daf6bb58ece79f89e580e299
Author: Ben Pfaff <blp at nicira.com>
		
netlink-socket: Log Generic Netlink family names.
		
The ids for Generic Netlink family names aren't very helpful because they
can vary from machine to machine and even from one boot to the next.  So
this change logs their names too.

This only affects logging at DBG level.

Reviewed by Ethan Jackson <ethan at nicira.com>.


commit 727ef33f12f7736961455d1835e654687efc4708
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=727ef33f12f7736961455d1835e654687efc4708
Author: Ben Pfaff <blp at nicira.com>
		
netlink-socket: Consistently log sequence numbers in hexadecimal.
		
nlmsghdr_to_string() wrote sequence numbers in hex, but nl_sock_transact()
wrote them in decimal.  This consistently switches to hexadecimal.

Reviewed by Ethan Jackson <ethan at nicira.com>.


commit c6eab56db47739d73675ff181a03eb1923303284
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=c6eab56db47739d73675ff181a03eb1923303284
Author: Ben Pfaff <blp at nicira.com>
		
netlink-socket: Make dumping and doing transactions on same nl_sock safe.
		
It's not safe to use a single Netlink fd to do multiple operations in an
synchronous way.  Some of the limitations are fundamental; for example, the
kernel only supports a single "dump" operation at a time.  Others are
limitations imposed by the OVS coding style; for example, our Netlink
library is not callback based, so nothing can be done about incoming
messages that can't be handled immediately.  Regardless, in OVS multicast
groups, transactions, and dumps cannot coexist on a single nl_sock.

This is only mildly irritating at the moment, but it will become much worse
later on, when dpif-linux shifts to using Netlink dumps for listing various
kinds of datapath entities.  When that happens, a dump will be in progress
in situations where the dpif-linux client might want to do other
operations.  For example, it is reasonable for the client to list flows
and, in the middle, look up information on vports mentioned in those flows.
It might be possible to simply ban and avoid such nested operations--I have
not even audited the source tree to find out whether we do anything like
that already--but that seems like an unnecessary cramp on our coding style.
Furthermore, it's difficult to explain and justify without understanding
the implementation.

This patch takes another approach, by improving the Netlink socket library
to avoid artificial constraints.  When an operation, or a dump, or joining
a multicast group would cause a problem, this patch makes the library
transparently create a separate Netlink socket.  This solves the problem
without putting any onerous restrictions on use.

This commit also slightly simplifies netdev_vport_reset_names().  It had
been written to destroy the dump object before the Netlink socket that it
used, but this is no longer necessary and doing it in the opposite order
saved a few lines of code.

Reviewed by Ethan Jackson <ethan at nicira.com>.


commit 7041c3a9b01f049551c1b230874f8ff809b0f3dc
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=7041c3a9b01f049551c1b230874f8ff809b0f3dc
Author: Ben Pfaff <blp at nicira.com>
		
netlink-socket: Slightly improve logging of Generic Netlink messages.
		
This makes the stream of requests and replies very slightly easier to
understand.

Reviewed by Justin Pettit.


commit 6b7c12fdc1d3a08a934b29109fa6ffac6b45ebe0
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=6b7c12fdc1d3a08a934b29109fa6ffac6b45ebe0
Author: Ben Pfaff <blp at nicira.com>
		
netlink-socket: New function for draining the receive buffer.
		
This will be used in an upcoming patch.

Reviewed by Justin Pettit.


commit cceb11f5b12d09cc8afc87ca4fd03e941234d439
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=cceb11f5b12d09cc8afc87ca4fd03e941234d439
Author: Ben Pfaff <blp at nicira.com>
		
netlink-socket: Add functions for joining and leaving multicast groups.
		
When this library was originally implemented, support for Linux 2.4 was
important.  The Netlink implementation in Linux only added support for
joining and leaving multicast groups after a socket is bound as of Linux
2.6.14, so the library did not support it either.  But the current version
of Open vSwitch targets Linux 2.6.18 and over, so it's fine to add this
support now, and this commit does so.

This will be used more extensively in upcoming commits.

Reviewed by Justin Pettit.


commit 18c58479a14f760fb03c2062f9a35961fc74ebb5
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=18c58479a14f760fb03c2062f9a35961fc74ebb5
Author: Ben Pfaff <blp at nicira.com>
		
netlink: Add nl_attr_type constants for big-endian values.
		
These are semantically identical, so they might as well share existing
values, but they help to document the endianness of attributes in Netlink
attribute policies.

Acked-by: Jesse Gross <jesse at nicira.com>


commit 33cada0cf1f24beb79c23328acb2bf9860c34679
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=33cada0cf1f24beb79c23328acb2bf9860c34679
Author: Ben Pfaff <blp at nicira.com>
		
netlink: Log duplicate attributes in nl_policy_parse().
		
This made finding one particular bug slightly easier for me.

Reviewed by Justin Pettit.


commit b18fcf8edd07d7832c16e96f29d44a2961c1e5aa
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=b18fcf8edd07d7832c16e96f29d44a2961c1e5aa
Author: Ben Pfaff <blp at nicira.com>
		
netlink: New functions for finding a specific attribute.
		
These functions are useful in the occasional case where a piece of code
only cares about one or a few attributes, probably knows that the format
is correct, and doesn't want to go to the trouble of doing a full parse.
Upcoming commits will add a user.

Reviewed by Justin Pettit.


commit ee114c23f735a91b165dab0908c1fdea736e782a
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=ee114c23f735a91b165dab0908c1fdea736e782a
Author: Ben Pfaff <blp at nicira.com>
		
hmap: New function hmap_at_position().
		
This function offers a way to iterate through an hmap in situations where
it is not safe to retain a node pointer.

Acked-by: Jesse Gross <jesse at nicira.com>


commit a46c577af5c5855939ca3192a56396e15bebf0f8
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=a46c577af5c5855939ca3192a56396e15bebf0f8
Author: Ben Pfaff <blp at nicira.com>
		
ofpbuf: New function ofpbuf_clone_data_with_headroom().
		
This new function is a simple helper that creates a new ofpbuf with some
initial contents plus a caller-specified amount of headroom.

This will be used in upcoming commits.

Acked-by: Jesse Gross <jesse at nicira.com>


commit 0dce369bdd8bf47895e59277bcbf77b74af20446
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=0dce369bdd8bf47895e59277bcbf77b74af20446
Author: Ben Pfaff <blp at nicira.com>
		
ofpbuf: Enable ofpbuf_push() to expand headroom.
		
Until now, ofpbuf_put() has been able to reallocate an ofpbuf to
expand the tailroom, but ofpbuf_push() has not been able to expand
the headroom in an analogous way.  This omission is simply because
it has never been useful to do this.  However, an upcoming change
will make the amount of headroom in an ofpbuf passed up from a
dpif to ofproto harder to predict.  It seems that we might as well
simply implement expanding headroom, so this commit does that.

Acked-by: Jesse Gross <jesse at nicira.com>


commit 31ac1e590b9bb2a2ce7c70cd7c8fd2db0fb8e481
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=31ac1e590b9bb2a2ce7c70cd7c8fd2db0fb8e481
Author: Ben Pfaff <blp at nicira.com>
		
ofpbuf: New function ofpbuf_use_stack().
		
This new function is useful in a situation where a small stack-allocated
buffer is usually appropriate but occasionally it must be expanded.

Acked-by: Jesse Gross <jesse at nicira.com>


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

Summary of changes:
 .../linux-2.6/compat-2.6/include/net/netlink.h     |    2 +-
 lib/hmap.c                                         |   43 +++
 lib/hmap.h                                         |    3 +
 lib/netdev-linux.c                                 |    2 +-
 lib/netdev-provider.h                              |    8 +-
 lib/netdev-vport.c                                 |    6 +-
 lib/netdev.c                                       |   73 +----
 lib/netlink-protocol.h                             |   13 +-
 lib/netlink-socket.c                               |  363 +++++++++++++++-----
 lib/netlink-socket.h                               |   12 +-
 lib/netlink.c                                      |   41 +++-
 lib/netlink.h                                      |   11 +-
 lib/odp-util.c                                     |    5 +-
 lib/ofpbuf.c                                       |  180 ++++++++---
 lib/ofpbuf.h                                       |   18 +-
 lib/route-table.c                                  |    2 +-
 lib/rtnetlink.c                                    |   11 +-
 lib/shash.c                                        |   54 +++
 lib/shash.h                                        |    6 +
 utilities/nlmon.c                                  |    9 +-
 utilities/ovs-dpctl.c                              |   40 ++-
 utilities/ovs-vsctl.c                              |    6 +-
 vswitchd/ovs-brcompatd.c                           |   23 +-
 vswitchd/proc-net-compat.c                         |    4 +-
 xenserver/etc_init.d_openvswitch                   |    6 +-
 25 files changed, 675 insertions(+), 266 deletions(-)


hooks/post-receive
-- 
Open vSwitch




More information about the git mailing list