All of lore.kernel.org
 help / color / mirror / Atom feed
* SKB Reference Question
@ 2017-11-01 17:27 Joe Smith
  2017-11-01 17:33 ` Eric Dumazet
  2017-11-02  5:35 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Joe Smith @ 2017-11-01 17:27 UTC (permalink / raw)
  To: netdev, David Miller, Eric Dumazet

How strictly are references on the SKB enforced. For example,
tcp_transmit_skb() clones the SKB and adds a TCP header. Can I assume
that in case of re-transmission the header added will be there and can
be reused instead of creating a new one from scratch. Some fields like
time stamp would need to be updated but they should be unmodified.

Regards,

-- 
JS

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SKB Reference Question
  2017-11-01 17:27 SKB Reference Question Joe Smith
@ 2017-11-01 17:33 ` Eric Dumazet
  2017-11-01 19:22   ` Joe Smith
  2017-11-02  5:35 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2017-11-01 17:33 UTC (permalink / raw)
  To: Joe Smith; +Cc: netdev, David Miller

On Wed, 2017-11-01 at 10:27 -0700, Joe Smith wrote:
> How strictly are references on the SKB enforced. For example,
> tcp_transmit_skb() clones the SKB and adds a TCP header. Can I assume
> that in case of re-transmission the header added will be there and can
> be reused instead of creating a new one from scratch. Some fields like
> time stamp would need to be updated but they should be unmodified.


Not sure what you are trying to do, but this seems messy ;)

At rtx time, there is no guarantee that the master skb has not been
changed, so the content of TCP header might be wrong anyway.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SKB Reference Question
  2017-11-01 17:33 ` Eric Dumazet
@ 2017-11-01 19:22   ` Joe Smith
  2017-11-01 19:44     ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Smith @ 2017-11-01 19:22 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, David Miller

On Wed, Nov 1, 2017 at 10:33 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Wed, 2017-11-01 at 10:27 -0700, Joe Smith wrote:
>> How strictly are references on the SKB enforced. For example,
>> tcp_transmit_skb() clones the SKB and adds a TCP header. Can I assume
>> that in case of re-transmission the header added will be there and can
>> be reused instead of creating a new one from scratch. Some fields like
>> time stamp would need to be updated but they should be unmodified.
>
>
> Not sure what you are trying to do, but this seems messy ;)

As an example, consider reusing options that might be expensive to
calculate. Assuming no coalescing.

>
> At rtx time, there is no guarantee that the master skb has not been
> changed, so the content of TCP header might be wrong anyway.

I would have thought that each layer below TCP would only add itś own
header and would not touch anything else. Is that not the guarantee
that SKB references provideś, or else the data could be changed.

Can you give an example why the TCP header could change.

Thanks a lot for your time.




>
>
>



-- 
JS

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SKB Reference Question
  2017-11-01 19:22   ` Joe Smith
@ 2017-11-01 19:44     ` Eric Dumazet
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2017-11-01 19:44 UTC (permalink / raw)
  To: Joe Smith; +Cc: netdev, David Miller

On Wed, 2017-11-01 at 12:22 -0700, Joe Smith wrote:
> On Wed, Nov 1, 2017 at 10:33 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > On Wed, 2017-11-01 at 10:27 -0700, Joe Smith wrote:
> >> How strictly are references on the SKB enforced. For example,
> >> tcp_transmit_skb() clones the SKB and adds a TCP header. Can I assume
> >> that in case of re-transmission the header added will be there and can
> >> be reused instead of creating a new one from scratch. Some fields like
> >> time stamp would need to be updated but they should be unmodified.
> >
> >
> > Not sure what you are trying to do, but this seems messy ;)
> 
> As an example, consider reusing options that might be expensive to
> calculate. Assuming no coalescing.
> 
> >
> > At rtx time, there is no guarantee that the master skb has not been
> > changed, so the content of TCP header might be wrong anyway.
> 
> I would have thought that each layer below TCP would only add itś own
> header and would not touch anything else. Is that not the guarantee
> that SKB references provideś, or else the data could be changed.
> 
> Can you give an example why the TCP header could change.

Before rtx, skbs can be split or coalesced.

Depending on ACK received from opposite peer, available cwnd budget,
pacing rate...

Also ECN can play a role.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: SKB Reference Question
  2017-11-01 17:27 SKB Reference Question Joe Smith
  2017-11-01 17:33 ` Eric Dumazet
@ 2017-11-02  5:35 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2017-11-02  5:35 UTC (permalink / raw)
  To: codesoldier1; +Cc: netdev, eric.dumazet

From: Joe Smith <codesoldier1@gmail.com>
Date: Wed, 1 Nov 2017 10:27:49 -0700

> How strictly are references on the SKB enforced. For example,
> tcp_transmit_skb() clones the SKB and adds a TCP header. Can I assume
> that in case of re-transmission the header added will be there and can
> be reused instead of creating a new one from scratch. Some fields like
> time stamp would need to be updated but they should be unmodified.

Every time a data packet goes out, whether it is the initial transmission
or a retransmission, it goes through tcp_transmit_skb() which pushes the
TCP headers and fills in all of the TCP header options as well.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-02  5:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01 17:27 SKB Reference Question Joe Smith
2017-11-01 17:33 ` Eric Dumazet
2017-11-01 19:22   ` Joe Smith
2017-11-01 19:44     ` Eric Dumazet
2017-11-02  5:35 ` David Miller

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.