[ovs-dev] [PATCH v4] flow: Split miniflow's map.

Ben Pfaff blp at nicira.com
Fri Jul 17 15:51:47 UTC 2015


On Thu, Jul 16, 2015 at 05:47:00PM -0700, Jarno Rajahalme wrote:
> Use two maps in miniflow to allow for expansion of struct flow past
> 512 bytes.  We now have one map for tunnel related fields, and another
> for the rest of the packet metadata and actual packet header fields.
> This split has the benefit that for non-tunneled packets the overhead
> should be minimal.
> 
> Some miniflow utilities now exist in two variants, new ones operating
> over all the data, and the old ones operating only on a single 64-bit
> map at a time.  The old ones require doubling of code but should
> execute faster, so those are used in the datapath and classifier's
> lookup path.
> 
> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>

This version passes tests and does not cause any sparse warnings.  Thank
you!

I am a little surprised to see two named bitmaps instead of an array of
two elements.  Names are nice for some things, but other times it is
convenient to be able to use loops to iterate, and of course arrays
generalize better.

This change to dpif-netdev.c looks like an independent bug fix to me:

@@ -1892,10 +1913,11 @@ dpif_netdev_mask_from_nlattrs(const struct nlattr *key, uint32_t key_len,
         memset(mask, 0x0, sizeof *mask);
 
         for (id = 0; id < MFF_N_IDS; ++id) {
             /* Skip registers and metadata. */
             if (!(id >= MFF_REG0 && id < MFF_REG0 + FLOW_N_REGS)
+                && !(id >= MFF_XREG0 && id < MFF_XREG0 + FLOW_N_XREGS)
                 && id != MFF_METADATA) {
                 const struct mf_field *mf = mf_from_id(id);
                 if (mf_are_prereqs_ok(mf, flow)) {
                     mf_mask_field(mf, mask);
                 }

Acked-by: Ben Pfaff <blp at nicira.com>



More information about the dev mailing list