[ovs-dev] [PATCH] ofproto: Remove per-flow miss hash table from upcall handler.

Alex Wang alexw at nicira.com
Mon May 19 21:05:45 UTC 2014


Thanks Ryan, this is a great refactoring.

Looks good to me,

Minor issues:

1.  Could you rebase the patch against master?  Need to fix some new calls,
added after you posted the patch.



On Wed, May 7, 2014 at 3:14 PM, Ryan Wilson <wryan at nicira.com> wrote:

> The upcall hander keeps a hash table which hashes flow to a list of
> corresponding packets.



s/hander/handler





@@ -710,62 +687,55 @@ compose_slow_path(struct udpif *udpif, struct
> xlate_out *xout,
>      odp_put_userspace_action(pid, &cookie, sizeof cookie.slow_path, buf);
>  }
>
> -static struct flow_miss *
> -flow_miss_find(struct hmap *todo, const struct ofproto_dpif *ofproto,
> -               const struct flow *flow, uint32_t hash)
> +static void
> +upcall_init(struct upcall *upcall, struct flow *flow, struct ofpbuf
> *packet,
> +            struct ofproto_dpif *ofproto, struct dpif_upcall *dupcall,
> +            odp_port_t odp_in_port)
>  {
> -    struct flow_miss *miss;
> -
> -    HMAP_FOR_EACH_WITH_HASH (miss, hmap_node, hash, todo) {
> -        if (miss->ofproto == ofproto && flow_equal(&miss->flow, flow)) {
> -            return miss;
> -        }
> +    struct xlate_in xin;
> +    struct pkt_metadata md = pkt_metadata_from_flow(flow);
>



> +    flow_extract(packet, &md, &upcall->flow);
> +
>


Add a newline between local variable declaration and the code.




> +
>
>          /* Do not install a flow into the datapath if:
>           *
>           *    - The datapath already has too many flows.
>           *
> -         *    - An earlier iteration of this loop already put the same
> flow.
> -         *
>           *    - We received this packet via some flow installed in the
> kernel
>           *      already. */
>          if (may_put
> -            && !miss->put
>              && upcall->dpif_upcall.type == DPIF_UC_MISS) {
>              struct ofpbuf mask;
>              bool megaflow;
>
> -            miss->put = true;
> -
>


Here, the removal of 'miss->put', may cause the warning of inserting
duplicated flows (when upcalls from same flow
at handled in same batch).  We think it is okay, to have this warning,
since it should be very rare and it is will not
cause duplicated flows in datapath.  Let's see if there is anything shown
up during the tcp_crr test.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140519/58ded2c5/attachment-0005.html>


More information about the dev mailing list