On Thu, Oct 20, 2011 at 5:30 PM, Pravin B Shelar <[email protected]> wrote:
> Following patch cleanup hh_cache access by avoiding hh
> pointer fetching most of time. Now hh is read and checked at beginning
> of function. All hh->hh_len access are done inside hh_lock.
> This is required cleanup for next patch which adds support for kernel
> 3.1.
Looks like there's an extra tab at the beginning of the commit message.
> diff --git a/datapath/tunnel.c b/datapath/tunnel.c
> index 8edff06..b750bbc 100644
> --- a/datapath/tunnel.c
> +++ b/datapath/tunnel.c
> static inline void create_eth_hdr(struct tnl_cache *cache,
> - const struct rtable *rt)
> + struct hh_cache *hh)
> {
> void *cache_data = get_cached_header(cache);
> - int hh_len = rt_dst(rt).hh->hh_len;
> - int hh_off = HH_DATA_ALIGN(rt_dst(rt).hh->hh_len) - hh_len;
> + int hh_off;
>
> #ifdef HAVE_HH_SEQ
> unsigned hh_seq;
>
> do {
> - hh_seq = read_seqbegin(&rt_dst(rt).hh->hh_lock);
> - memcpy(cache_data, (void *)rt_dst(rt).hh->hh_data + hh_off,
> hh_len);
> - } while (read_seqretry(&rt_dst(rt).hh->hh_lock, hh_seq));
> +
Extra blank line here.
> + hh_off = HH_DATA_ALIGN(hh->hh_len) - hh->hh_len;
> +
> + hh_seq = read_seqbegin(&hh->hh_lock);
The assignment to hh_off should go after read_seqbegin since that's
that start of the lock.
> diff --git a/datapath/tunnel.h b/datapath/tunnel.h
> index 8d20c77..0ab0390 100644
> --- a/datapath/tunnel.h
> +++ b/datapath/tunnel.h
> @@ -148,6 +148,7 @@ struct tnl_cache {
> struct rcu_head rcu;
>
> int len; /* Length of data to be memcpy'd from cache. */
> + int hh_len;
Can you add a comment saying what this is?
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev