[ovs-dev] [Single DP 07/15] tests: Define new ADD_OF_PORTS macro for ofproto tests.

Justin Pettit jpettit at nicira.com
Mon Oct 29 22:32:41 UTC 2012

On Oct 19, 2012, at 11:05 AM, Ben Pfaff <blp at nicira.com> wrote:

> On Thu, Oct 18, 2012 at 12:51:52PM -0700, Justin Pettit wrote:
>> A future commit will break the relation between OpenFlow and datapath
>> port numbers.  The new ADD_OF_PORTS macro adds an interface to a bridge
>> and configures it such that both the OpenFlow and datapath port numbers
>> are the same.  This is important in tests that deal with both OpenFlow
>> and datapath port numbers (e.g., ones that use ofproto/trace).
>> Signed-off-by: Justin Pettit <jpettit at nicira.com>
> This looks good, but the following definition of ADD_OF_PORTS should
> be faster because it will run ovs-vsctl only once regardless of the
> number of ports to add:
> m4_define([ADD_OF_PORTS],
>  [ovs-vsctl m4_foreach([of_port], m4_cdr($@),
>    [ \
> -- add-port $1 p[]of_port -- set Interface p[]of_port type=dummy ofport_request=of_port])])

Awesome!  Much better.  Thank you.


More information about the dev mailing list