All of lore.kernel.org
 help / color / mirror / Atom feed
From: Octavian Purdila <opurdila@ixiacom.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org
Subject: Re: [RFC][PATCH 1/3] net: per skb control messages
Date: Thu, 24 Jul 2008 19:22:57 +0300	[thread overview]
Message-ID: <200807241922.57361.opurdila@ixiacom.com> (raw)
In-Reply-To: <20080724150116.GA8692@gondor.apana.org.au>

On Thursday 24 July 2008, Herbert Xu wrote:

> > From what I understand, the shinfo remains shared, thus there is no need
> > to do the copy here.
>
> No pskb_copy does a full copy on the head portion of the packet
> which is where your cmsg is.
>
> > > Also what about pskb_expand_head?
> >
> > I think this is only touching the skb header, not the shinfo. Thus we
> > should be safe?
>
> But you're freeing the cmsg in skb_release_data which is called
> by pskb_expand_head.  This can't possibly work.

Right, I've missed the fact that skb_shinfo is stored in the header part. 

> Do we need to make it so generic? If we do then can you please
> come up with other uses for it too.  For example, find out what
> existing fields can be better suited by storing them as a cmsg.
> Only then can we design this properly.

It looks like we can switch a few members from the skb to cmsg: secmark, 
priority, tstamp, thus saving some space in the skb, but we will have a 
performance overhead for accessing these since we now have to search for them 
in the cmesg list.

So, the more I think about this the more I am inclined to think that we don't 
really need it. For our hw timestamp usecases, the reason of this patch, we 
can get away by adding these new fields in the skb:

u16 flags; /* request / signal presence of RX/TX hw stamps, TX scheduling, TX 	
		    embed hw timestamp in packet */
u8 hwstamp[6];

and of course the mechanism of enabling hw stamps requests on per skb, with 
msghdr.msg_control stuff. 

Would that be acceptable (with proper CONFIG_HW_TSTAMPS of course)?

Thanks,
tavi

  reply	other threads:[~2008-07-24 16:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-23 22:01 [RFC][PATCH 0/3] net: per skb control messages Octavian Purdila
2008-07-23 22:01 ` [RFC][PATCH 1/3] " Octavian Purdila
2008-07-24 12:46   ` Herbert Xu
2008-07-24 13:34     ` Octavian Purdila
2008-07-24 15:01       ` Herbert Xu
2008-07-24 16:22         ` Octavian Purdila [this message]
2008-07-24 20:28           ` David Miller
2008-07-24 21:49             ` Octavian Purdila
2008-07-24 21:56               ` David Miller
2008-07-24 21:58                 ` Stephen Hemminger
2008-07-24 22:35                   ` Octavian Purdila
2008-07-24 23:05                     ` Stephen Hemminger
2008-07-24 22:12                 ` Octavian Purdila
2008-07-24 22:17                   ` David Miller
2008-07-24 23:14                     ` Octavian Purdila
2008-07-24 23:18                       ` David Miller
2008-07-24 23:26                         ` Octavian Purdila
2008-07-23 22:01 ` [RFC][PATCH 2/3] ip: support for SOL_SKB control messages for UDP/RAW sockets Octavian Purdila
2008-07-23 22:01 ` [RFC][PATCH 3/3] net: add SKB_SOL control messages Octavian Purdila

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=200807241922.57361.opurdila@ixiacom.com \
    --to=opurdila@ixiacom.com \
    --cc=herbert@gondor.apana.org.au \
    --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.