[ovs-dev] [PATCH v3 1/3] ofproto-dpif: Unhide structure contents.

Justin Pettit jpettit at ovn.org
Thu Jan 5 23:41:17 UTC 2017


> On Dec 22, 2016, at 9:58 AM, Ben Pfaff <blp at ovn.org> wrote:
> 
> Until now, ofproto-dpif.c has hidden the definitions of several structures,
> such as struct ofproto_dpif and struct rule_dpif.  This kind of information
> hiding is often beneficial, because it forces code outside the file with
> the definition to use the documented interfaces.  However, in this case it
> was starting to burden ofproto-dpif with an increasing number of trivial
> helpers that were not improving or maintaining a useful abstraction and
> that were making code harder to maintain and read.
> 
> Information hiding also made it hard to move blocks of code outside
> ofproto-dpif.c itself, since any code moved out often needed new helpers if
> it used anything that wasn't previously exposed.  In the present instance,
> upcoming patches will move code for tracing outside ofproto-dpif, and this
> would require adding several helpers that would just obscure the function
> of the code otherwise needlessly.
> 
> In balance, it seems that there is more harm than good in the information
> hiding here, so this commit moves the definitions of several structures
> from ofproto-dpif.c into ofproto-dpif.h.  It also removes all of the
> trivial helpers that had accumulated, instead changing their users to
> directly access the members that they needed.  It also reorganizes
> ofproto-dpif.h, grouping structure definitions and function prototypes in a
> sensible way.
> 
> Signed-off-by: Ben Pfaff <blp at ovn.org>
> Acked-by: Lance Richardson <lrichard at redhat.com>

Acked-by: Justin Pettit <jpettit at ovn.org>

--Justin




More information about the dev mailing list