[ovs-dev] [patch v2] conntrack: Fix alg expectation cleanup.

Ben Pfaff blp at ovn.org
Thu Jan 4 21:24:22 UTC 2018


On Fri, Dec 15, 2017 at 07:32:48PM -0800, Darrell Ball wrote:
> Presently, alg expectations are removed by being time expired.
> This was intended to happen before the control connections and
> was intended to minimize the extra work involved for tracking and
> removing the expectations.  This is not the best option and
> conceptually an expectation should not exist without a control
> connection context.
> 
> The approach is changed to remove the expectations when the control
> connections are removed.  The previous code to expire the expectations
> is removed at the same time.
> 
> Fixes: bd5e81a0e ("Userspace Datapath: Add ALG infra and FTP.")
> Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-December/341683.html
> Signed-off-by: Darrell Ball <dlu998 at gmail.com>
> ---
> 
> v1->v2: Use single node for both expectations and expectation_refs.
>         Remove outdated comment.
>         Simplify an api.

Thanks for working on this.

It looks to me like the new alg_expectation_refs hmap is expected to
have duplicate keys.  If so, then I recommend using an hindex instead of
an hmap, because hindexes are designed for duplicates and will perform
better.

I would have guessed that the easiest way to do this would be to add to
struct conn a linked list of child expectations (and possibly a pointer
to the parent conn).  Then, there would be no need to look up anything
in an hmap (or hindex), one would simply iterate the list of children.
Did you consider that design?

Thanks,

Ben.


More information about the dev mailing list