Thread (13 messages) flat view 13 messages, 6 authors, 2012-09-20

Re: [PATCH v3] net-tcp: TCP/IP stack bypass for loopback connections

From: Stephen Clark <hidden>
Date: 2012-09-20 11:28:46

On 09/19/2012 05:19 PM, Bruce Curtis wrote:
On Wed, Sep 19, 2012 at 2:03 PM, Eric Dumazet[off-list ref]  wrote:
   
quoted
On Wed, 2012-09-19 at 16:34 -0400, David Miller wrote:

     
quoted
I have an idea on how to handle this.

In drivers/net/loopback.c:loopback_tx(), skip the SKB orphan operation
if there is a friend socket at skb->friend.

When sending such friend SKBs out at connection startup, arrange it
such that the skb->destructor will zap the skb->friend pointer to
NULL.

Also, in skb_orphan*(), if necessary, set skb->friend to NULL.

skb->sk will hold a reference to the socket, and since skb->friend
will be equal, this will make sure a pointer to an unreferenced
socket does not escape.
       
I now am wondering if we still need skb->friend field.

If skb->sk is not zeroed by a premature skb_orphan(), then

skb->sk->sk_friend gives the friend ?


     
Does this mean traffic on the loopback interface will not traverse 
netfilter?

-- 

"They that give up essential liberty to obtain temporary safety,
deserve neither liberty nor safety."  (Ben Franklin)

"The course of history shows that as a government grows, liberty
decreases."  (Thomas Jefferson)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help