[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100405083302.GA16636@gondor.apana.org.au>
Date: Mon, 5 Apr 2010 16:33:02 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Timo Teras <timo.teras@....fi>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 1/4] flow: virtualize flow cache entry methods
On Mon, Apr 05, 2010 at 10:00:21AM +0300, Timo Teras wrote:
>
> @@ -219,33 +222,32 @@ void *flow_cache_lookup(struct net *net, struct flowi *key, u16 family, u8 dir,
> fle->object = NULL;
> fcp->hash_count++;
> }
> + } else if (fle->genid == atomic_read(&flow_cache_genid)) {
> + flo = fle->object;
> + if (!flo)
> + goto ret_object;
> + flo = flo->ops->get(flo);
> + if (flo)
> + goto ret_object;
> }
>
> nocache:
> - {
> - int err;
> - void *obj;
> - atomic_t *obj_ref;
> -
> - err = resolver(net, key, family, dir, &obj, &obj_ref);
> -
> - if (fle && !err) {
> - fle->genid = atomic_read(&flow_cache_genid);
> -
> - if (fle->object)
> - atomic_dec(fle->object_ref);
> -
> - fle->object = obj;
> - fle->object_ref = obj_ref;
> - if (obj)
> - atomic_inc(fle->object_ref);
> + flo = resolver(net, key, family, dir, fle ? fle->object : NULL, ctx);
> + if (fle) {
> + fle->genid = atomic_read(&flow_cache_genid);
> + if (IS_ERR(flo)) {
> + fle->genid--;
> + fle->object = NULL;
Shouldn't we call fle->object->ops->delete here?
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists