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

Justin Pettit jpettit at nicira.com
Fri Feb 22 23:55:54 UTC 2013


Thanks for the review.  I pushed this to master and branch-1.10.

--Justin


On Feb 22, 2013, at 3:31 PM, Ethan Jackson <ethan at nicira.com> wrote:

> 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
> 




More information about the dev mailing list