pskb_copy() in tcp_transmit_skb()

8 messages, 5 authors, 2011-09-13 · open the first message on its own page

pskb_copy() in tcp_transmit_skb()

From: Christoph Paasch <hidden>
Date: 2011-09-13 09:21:42

Hi,

I'm trying to understand the reason for the possible call to pskb_copy() in 
tcp_transmit_skb().
I don't find, where we may have a cloned skb entering tcp_transmit_skb().

The original pskb_copy() came from tcp_retransmit_skb() (commit 
dfb4b9dceb35c567a595ae5e9d035cfda044a103).
But from that point, the git-history does not show where the pskb_copy() is 
coming from.


Does somebody has an idea, how a cloned skb can be passed to 
tcp_transmit_skb() and thus trigger this call to pskb_copy().


Thanks for your help,
Christoph


--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--

Re: pskb_copy() in tcp_transmit_skb()

From: Gaofeng <hidden>
Date: 2011-09-13 09:29:04

 于 2011年09月13日 17:21, Christoph Paasch 写道:
Hi,

I'm trying to understand the reason for the possible call to pskb_copy() in
tcp_transmit_skb().
I don't find, where we may have a cloned skb entering tcp_transmit_skb().

The original pskb_copy() came from tcp_retransmit_skb() (commit
dfb4b9dceb35c567a595ae5e9d035cfda044a103).
But from that point, the git-history does not show where the pskb_copy() is
coming from.


Does somebody has an idea, how a cloned skb can be passed to
tcp_transmit_skb() and thus trigger this call to pskb_copy().


Thanks for your help,
Christoph


--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maybe nat,nat can change the tcp packet header

Re: pskb_copy() in tcp_transmit_skb()

From: Christoph Paasch <hidden>
Date: 2011-09-13 10:56:00

Hi,

On Tuesday 13 September 2011 wrote Gaofeng:
quoted
I'm trying to understand the reason for the possible call to pskb_copy()
in tcp_transmit_skb().
I don't find, where we may have a cloned skb entering tcp_transmit_skb().

The original pskb_copy() came from tcp_retransmit_skb() (commit
dfb4b9dceb35c567a595ae5e9d035cfda044a103).
But from that point, the git-history does not show where the pskb_copy()
is coming from.


Does somebody has an idea, how a cloned skb can be passed to
tcp_transmit_skb() and thus trigger this call to pskb_copy().
maybe nat,nat can change the tcp packet header
although NAT may change the TCP header, it is not doing an skb_clone() - (at 
least I don't find it).
Thus, we will not call pskb_copy() in tcp_transmit_skb() due to NAT.

Christoph

--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--

Re: pskb_copy() in tcp_transmit_skb()

From: Eric Dumazet <hidden>
Date: 2011-09-13 12:09:17

Le 13 septembre 2011 12:55, Christoph Paasch
[off-list ref] a écrit :
Hi,

On Tuesday 13 September 2011 wrote Gaofeng:
quoted
quoted
I'm trying to understand the reason for the possible call to pskb_copy()
in tcp_transmit_skb().
I don't find, where we may have a cloned skb entering tcp_transmit_skb().

The original pskb_copy() came from tcp_retransmit_skb() (commit
dfb4b9dceb35c567a595ae5e9d035cfda044a103).
But from that point, the git-history does not show where the pskb_copy()
is coming from.


Does somebody has an idea, how a cloned skb can be passed to
tcp_transmit_skb() and thus trigger this call to pskb_copy().
maybe nat,nat can change the tcp packet header
although NAT may change the TCP header, it is not doing an skb_clone() - (at
least I don't find it).
Thus, we will not call pskb_copy() in tcp_transmit_skb() due to NAT.
I suggest you read dev_queue_xmit_nit() : Every xmit packet can be
cloned right here.

By the time tcp_retransmit_skb() is called, cloned skb might still be
in a AF_PACKET queue (or even a device TX queue)

Re: pskb_copy() in tcp_transmit_skb()

From: Gao feng <hidden>
Date: 2011-09-13 12:31:31

于 11-9-13 下午6:55, Christoph Paasch 写道:
Hi,

On Tuesday 13 September 2011 wrote Gaofeng:
quoted
quoted
I'm trying to understand the reason for the possible call to pskb_copy()
in tcp_transmit_skb().
I don't find, where we may have a cloned skb entering tcp_transmit_skb().

The original pskb_copy() came from tcp_retransmit_skb() (commit
dfb4b9dceb35c567a595ae5e9d035cfda044a103).
But from that point, the git-history does not show where the pskb_copy()
is coming from.


Does somebody has an idea, how a cloned skb can be passed to
tcp_transmit_skb() and thus trigger this call to pskb_copy().
maybe nat,nat can change the tcp packet header
although NAT may change the TCP header, it is not doing an skb_clone() - (at
least I don't find it).
Thus, we will not call pskb_copy() in tcp_transmit_skb() due to NAT.

Christoph

--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maybe this.
if the nic driver has not transmit the cloned skb to the network yet.
then tcp_retransmit_skb is called by some logical.
if dont use pskb_copy here,it will make the nat or some header operation error.

Re: pskb_copy() in tcp_transmit_skb()

From: Christoph Paasch <hidden>
Date: 2011-09-13 12:41:14

Eric,

On Tuesday 13 September 2011 wrote Eric Dumazet:
I suggest you read dev_queue_xmit_nit() : Every xmit packet can be
cloned right here.

By the time tcp_retransmit_skb() is called, cloned skb might still be
in a AF_PACKET queue (or even a device TX queue)
Thanks for the clear answer.

So, basically every call to tcp_retransmit_skb on an skb that is also still 
hold in an AF_PACKET queue will end up in pskb_copy, because:
1. it has been cloned previously in tcp_transmit_skb()
2. The data_ref > 1 because it's clone is still in an AF_PACKET queue.

Please correct me, if I'm wrong.

Christoph


--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--

Re: pskb_copy() in tcp_transmit_skb()

From: Eric Dumazet <hidden>
Date: 2011-09-13 12:51:17

Le 13 septembre 2011 14:41, Christoph Paasch
[off-list ref] a écrit :
Eric,

On Tuesday 13 September 2011 wrote Eric Dumazet:
quoted
I suggest you read dev_queue_xmit_nit() : Every xmit packet can be
cloned right here.

By the time tcp_retransmit_skb() is called, cloned skb might still be
in a AF_PACKET queue (or even a device TX queue)
Thanks for the clear answer.

So, basically every call to tcp_retransmit_skb on an skb that is also still
hold in an AF_PACKET queue will end up in pskb_copy, because:
1. it has been cloned previously in tcp_transmit_skb()
2. The data_ref > 1 because it's clone is still in an AF_PACKET queue.

Please correct me, if I'm wrong.
Thats correct.

Re: pskb_copy() in tcp_transmit_skb()

From: David Miller <davem@davemloft.net>
Date: 2011-09-13 16:35:51

From: Eric Dumazet <redacted>
Date: Tue, 13 Sep 2011 14:02:17 +0200
I suggest you read dev_queue_xmit_nit() : Every xmit packet can be
cloned right here.
Right, any packet that has been sent in the past might now be
cloned.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help