[ovs-discuss] Best way to implement a partial wildcard match?

Ben Pfaff blp at nicira.com
Wed May 16 04:19:41 UTC 2012


On Wed, May 16, 2012 at 11:31:38AM +0800, YIMIN CHEN wrote:
> I am looking at a way to perform a flow match based on src mac, but
> only part of it, say the first 4 bytes of the mac address. Can I do
> similar things like nw_src_mask/nw_dst_mask?
> 
> /* Information on wildcards for a flow, as a supplement to flow_t. */
> struct flow_wildcards {
>     uint32_t wildcards;         /* enum ofp_flow_wildcards (in host order). */
>     uint32_t nw_src_mask;       /* 1-bit in each significant nw_src bit. */
>     uint32_t nw_dst_mask;       /* 1-bit in each significant nw_dst bit. */
> };
> 
> Can I add a new src mac mask to the flow_wildcards and change
> corresponding lookup functions to handle it similar to IP mask?

You could.

Joe Stringer posted patches to do this to ovs-dev just today.  I haven't
reviewed them yet.



More information about the discuss mailing list