netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: James Chapman <jchapman@katalix.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] l2tp: do data sequence number handling in a separate func
Date: Tue, 02 Jul 2013 20:28:49 +0400	[thread overview]
Message-ID: <51D2FFC1.70009@cogentembedded.com> (raw)
In-Reply-To: <1372759229-15178-2-git-send-email-jchapman@katalix.com>

Hello.

On 02-07-2013 14:00, James Chapman wrote:

> This change moves some code handling data sequence numbers into a
> separate function to avoid too much indentation. This is to prepare
> for some changes to data sequence number handling in subsequent
> patches.

> Signed-off-by: James Chapman <jchapman@katalix.com>
> ---
>   net/l2tp/l2tp_core.c |   55 +++++++++++++++++++++++++++++++------------------
>   1 files changed, 35 insertions(+), 20 deletions(-)

> diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
> index 6984c3a..b2389fe 100644
> --- a/net/l2tp/l2tp_core.c
> +++ b/net/l2tp/l2tp_core.c
> @@ -542,6 +542,39 @@ static inline int l2tp_verify_udp_checksum(struct sock *sk,
>   	return __skb_checksum_complete(skb);
>   }
>
> +/* If packet has sequence numbers, queue it if acceptable. Returns 0 if
> + * acceptable, else non-zero.
> + */
> +static int l2tp_recv_data_seq(struct l2tp_session *session, struct sk_buff *skb)
> +{
> +	if (session->reorder_timeout != 0) {
> +		/* Packet reordering enabled. Add skb to session's
> +		 * reorder queue, in order of ns.
> +		 */
> +		l2tp_recv_queue_skb(session, skb);
> +	} else {
> +		/* Packet reordering disabled. Discard out-of-sequence
> +		 * packets
> +		 */
> +		if (L2TP_SKB_CB(skb)->ns != session->nr) {
> +			atomic_long_inc(&session->stats.rx_seq_discards);
> +			l2tp_dbg(session, L2TP_MSG_SEQ,
> +				 "%s: oos pkt %u len %d discarded, "
> +				 "waiting for %u, reorder_q_len=%d\n",

    You shouldn't break the long message strings -- leave it as it was 
please.

WBR, Sergei

  reply	other threads:[~2013-07-02 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02 10:00 [PATCH 0/3] l2tp: make datapath sequence number handling RFC-compliant James Chapman
2013-07-02 10:00 ` [PATCH 1/3] l2tp: do data sequence number handling in a separate func James Chapman
2013-07-02 16:28   ` Sergei Shtylyov [this message]
2013-07-02 10:00 ` [PATCH 2/3] l2tp: make datapath sequence number support RFC-compliant James Chapman
2013-07-02 10:00 ` [PATCH 3/3] l2tp: make datapath resilient to packet loss when sequence numbers enabled James Chapman
2013-07-02 16:32   ` Sergei Shtylyov

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=51D2FFC1.70009@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.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;
as well as URLs for NNTP newsgroup(s).