[ovs-dev] [PATCH] ofproto-dpif: Look at the flow's ofproto when handling flow misses.

Ethan Jackson ethan at nicira.com
Fri Feb 22 23:31:09 UTC 2013


Acked-by: Ethan Jackson <ethan at nicira.com>



On Fri, Feb 22, 2013 at 2:45 PM, Justin Pettit <jpettit at nicira.com> wrote:

> When handling flow misses, an attempt is made to group identical packets
> together.  Before the single datapath, each OpenFlow port number was
> unique, so the flow_equal() function was sufficient to check whether
> packets are identical.  With the single datapath, the OpenFlow port
> numbers are shared across bridges, so packets that arrive at the same
> time and are identical other than their ingress port were being serviced
> by the same ofproto instance.  This commit changes the duplicate flow
> finding function to take the ofproto into account.
>
> Bug #14934
>
> Signed-off-by: Justin Pettit <jpettit at nicira.com>
> ---
>  ofproto/ofproto-dpif.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
> index f54f9ff..4232594 100644
> --- a/ofproto/ofproto-dpif.c
> +++ b/ofproto/ofproto-dpif.c
> @@ -3341,12 +3341,13 @@ process_special(struct ofproto_dpif *ofproto,
> const struct flow *flow,
>  }
>
>  static struct flow_miss *
> -flow_miss_find(struct hmap *todo, const struct flow *flow, uint32_t hash)
> +flow_miss_find(struct hmap *todo, const struct ofproto_dpif *ofproto,
> +               const struct flow *flow, uint32_t hash)
>  {
>      struct flow_miss *miss;
>
>      HMAP_FOR_EACH_WITH_HASH (miss, hmap_node, hash, todo) {
> -        if (flow_equal(&miss->flow, flow)) {
> +        if (miss->ofproto == ofproto && flow_equal(&miss->flow, flow)) {
>              return miss;
>          }
>      }
> @@ -3814,7 +3815,7 @@ handle_miss_upcalls(struct dpif_backer *backer,
> struct dpif_upcall *upcalls,
>
>          /* Add other packets to a to-do list. */
>          hash = flow_hash(&miss->flow, 0);
> -        existing_miss = flow_miss_find(&todo, &miss->flow, hash);
> +        existing_miss = flow_miss_find(&todo, ofproto, &miss->flow, hash);
>          if (!existing_miss) {
>              hmap_insert(&todo, &miss->hmap_node, hash);
>              miss->ofproto = ofproto;
> --
> 1.7.5.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130222/fd110154/attachment-0003.html>


More information about the dev mailing list