All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zang MingJie <zealot0630@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: dev@openvswitch.org, netdev@vger.kernel.org
Cc: dev@openvswitch.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: preserve IP control block during GSO segmentation
Date: Mon, 11 Jan 2016 15:45:57 +0800	[thread overview]
Message-ID: <56935DB5.1030502@gmail.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CCC01BA@AcuExch.aculab.com>

On 01/08/2016 08:13 PM, David Laight wrote:
> You could set SKB_SGO_CB_OFFSET to sizeof ((skb)->cb) - sizeof (struct skb_gso_cb)
> so that the end of 'cb' is always used.
> (Assuming the former is a multiple of 4.)
>
> It might be worth using an on-stack structure passed through as a separate
> parameter - it doesn't look as though it has to be queued with the skb.
> (Clearly a bigger change.)

I would definitely prefer the stack structure.

As a kernel developer, sometime I can hardly figure out which struct 
current cb is without debug it, and the worst they are not documented 
anywhere. I can hardly know the life time of the cb types.

If using a stack, things can be much easier. only an extra var to store 
the stack top:

    int cb_top;

and several macro to manage the stack:

    SKB_CB_PUSH(skb, type)
    SKB_CB_POP(skb)
    SKB_CB_TOP(skb, type)

and maybe a debug variable to store current cb type.

All current cb macro can be replaced by SKB_CB_TOP.


Although it is a big change, I think it worths, for both performance and 
maintainability

  parent reply	other threads:[~2016-01-11  8:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08 12:00 [PATCH] net: preserve IP control block during GSO segmentation Konstantin Khlebnikov
2016-01-08 12:00 ` Konstantin Khlebnikov
2016-01-08 12:10 ` Konstantin Khlebnikov
2016-01-08 12:10   ` Konstantin Khlebnikov
2016-01-08 12:11 ` Thadeu Lima de Souza Cascardo
2016-01-08 12:13 ` David Laight
2016-01-08 12:13   ` David Laight
2016-01-08 12:20   ` Thadeu Lima de Souza Cascardo
2016-01-08 12:20     ` Thadeu Lima de Souza Cascardo
2016-01-11  7:45   ` Zang MingJie
2016-01-11  7:45   ` Zang MingJie
2016-01-11  7:45   ` Zang MingJie [this message]
2016-01-12  0:58     ` Cong Wang
2016-01-12  0:58       ` Cong Wang
2016-01-08 12:24 ` kbuild test robot
2016-01-08 12:24   ` kbuild test robot

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=56935DB5.1030502@gmail.com \
    --to=zealot0630@gmail.com \
    --cc=dev@openvswitch.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.