From: Eric Dumazet <eric.dumazet@gmail.com>
To: James Chapman <jchapman@katalix.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v2 02/12] l2tp: Split pppol2tp patch into separate l2tp and ppp parts
Date: Mon, 29 Mar 2010 12:18:16 +0200 [thread overview]
Message-ID: <1269857896.2164.10.camel@edumazet-laptop> (raw)
In-Reply-To: <20100329095650.30460.79849.stgit@bert.katalix.com>
Le lundi 29 mars 2010 à 10:56 +0100, James Chapman a écrit :
> +
> +/* Session hash list.
> + * The session_id SHOULD be random according to RFC2661, but several
> + * L2TP implementations (Cisco and Microsoft) use incrementing
> + * session_ids. So we do a real hash on the session_id, rather than a
> + * simple bitmask.
> + */
> +static inline struct hlist_head *
> +l2tp_session_id_hash(struct l2tp_tunnel *tunnel, u32 session_id)
> +{
> + unsigned long hash_val = (unsigned long) session_id;
> + return &tunnel->session_hlist[hash_long(hash_val, L2TP_HASH_BITS)];
> +}
Please use hash_32() here, its better in this case on 64 bit arches (32
bits in session_id)
return &tunnel->session_hlist[hash_32(session_id, L2TP_HASH_BITS)];
next prev parent reply other threads:[~2010-03-29 10:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-29 9:56 [PATCH v2 00/12] l2tp: Introduce L2TPv3 support James Chapman
2010-03-29 9:56 ` [PATCH v2 01/12] l2tp: Relocate pppol2tp driver to new net/l2tp directory James Chapman
2010-03-29 9:56 ` [PATCH v2 02/12] l2tp: Split pppol2tp patch into separate l2tp and ppp parts James Chapman
2010-03-29 10:18 ` Eric Dumazet [this message]
2010-03-29 9:56 ` [PATCH v2 03/12] ppp: Add ppp_dev_name() exported function James Chapman
2010-03-29 9:57 ` [PATCH v2 04/12] l2tp: Add ppp device name to L2TP ppp session data James Chapman
2010-03-29 9:57 ` [PATCH v2 05/12] l2tp: Add L2TPv3 protocol support James Chapman
2010-03-29 9:57 ` [PATCH v2 06/12] l2tp: Update PPP-over-L2TP driver to work over L2TPv3 James Chapman
2010-03-29 9:57 ` [PATCH v2 07/12] l2tp: Add L2TPv3 IP encapsulation (no UDP) support James Chapman
2010-03-29 9:57 ` [PATCH v2 08/12] netlink: Export genl_lock() API for use by modules James Chapman
2010-03-29 9:57 ` [PATCH v2 09/12] l2tp: Add netlink control API for L2TP James Chapman
2010-03-29 9:57 ` [PATCH v2 10/12] l2tp: Add L2TP ethernet pseudowire support James Chapman
2010-03-29 11:05 ` Eric Dumazet
2010-03-29 12:10 ` James Chapman
2010-03-29 9:57 ` [PATCH v2 11/12] l2tp: Add support for static unmanaged L2TPv3 tunnels James Chapman
2010-03-29 10:40 ` Eric Dumazet
2010-03-29 10:52 ` James Chapman
2010-03-29 9:57 ` [PATCH v2 12/12] l2tp: Update documentation James Chapman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1269857896.2164.10.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=jchapman@katalix.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox