"dev" <dev-boun...@openvswitch.org> wrote on 04/22/2016 07:04:08 PM:

> From: Ben Pfaff <b...@ovn.org>
> To: dev@openvswitch.org
> Cc: Gurucharan Shetty <g...@ovn.org>, Ben Pfaff <b...@ovn.org>
> Date: 04/22/2016 07:04 PM
> Subject: [ovs-dev] [PATCH 1/2] cmap: New macro CMAP_INITIALIZER, for
> initializing an empty cmap.
> Sent by: "dev" <dev-boun...@openvswitch.org>
>
> Sometimes code is much simpler if we can statically initialize data
> structures.  Until now, this has not been possible for cmap-based data
> structures, so this commit introduces a CMAP_INITIALIZER macro.
>
> This works by adding a singleton empty cmap_impl that simply forces the
> first insertion into any cmap that points to it to allocate a real
> cmap_impl.  There could be some risk that rogue code modifies the
> singleton, so for safety it is also marked 'const' to allow the linker to
> put it into a read-only page.
>
> This adds a new OVS_ALIGNED_VAR macro with GCC and MSVC implementations.
> The latter is based on Microsoft webpages, so developers who know Windows
> might want to scrutinize it.
>
> As examples of the kind of simplification this can make possible, this
> commit removes an initialization function from ofproto-dpif-rid.c and a
> call to cmap_init() from tnl-neigh-cache.c.  An upcoming commit will add
> another user.
>
> CC: Jarno Rajahalme <ja...@ovn.org>
> CC: Gurucharan Shetty <g...@ovn.org>
> Signed-off-by: Ben Pfaff <b...@ovn.org>
> ---

Again, as promised...

Acked-by: Ryan Moats <rmo...@us.ibm.com>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to