Re: sk_buff destructor in 2.2.18

2001-05-23 Thread Andi Kleen

On Wed, May 23, 2001 at 05:02:15PM +0200, christophe barbé wrote:
> I believe you and It's sure that I have not tested all cases.
> So do you see a way to use a private data buffer ?

The only way I know currently is to keep skb->users >= 1 and use a timer
that collects such buffers from a global list, but it is not very nice. The
stack doesn't like private buffers.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread christophe barbé

I believe you and It's sure that I have not tested all cases.
So do you see a way to use a private data buffer ?

Christophe

On Wed, 23 May 2001 16:55:57 Andi Kleen wrote:
> On Wed, May 23, 2001 at 04:50:28PM +0200, christophe barbé wrote:
> > I don't know about socket but I allocate myself the skbuff and I set
> the
> > destructor (and previously the pointer value is NULL). So I don't
> overwrite
> > a destructor.
> 
> That just means you didn't test all cases; e.g. not TCP or UDP
> send/receive.
> 
> 
> 
> > 
> > I believe net/core/sock.c is not involved in my problem but I can be
> wrong.
> > What is worrying me is that I don't know who clones my skbuff and why.
> 
> skbuffs are cloned all over the stack for various reasons.
> 
>  
> > To said everything, I know who clones my skbuff because it causes a
> oops
> > when it tries to free my buffer If I use my destructor.
> 
> Because you're mistakely using a private field.
> 
> 
> -Andi
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
-- 
Christophe Barbé
Software Engineer - [EMAIL PROTECTED]
Lineo France - Lineo High Availability Group
42-46, rue Médéric - 92110 Clichy - France
phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
http://www.lineo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread Andi Kleen

On Wed, May 23, 2001 at 04:50:28PM +0200, christophe barbé wrote:
> I don't know about socket but I allocate myself the skbuff and I set the
> destructor (and previously the pointer value is NULL). So I don't overwrite
> a destructor.

That just means you didn't test all cases; e.g. not TCP or UDP send/receive.



> 
> I believe net/core/sock.c is not involved in my problem but I can be wrong.
> What is worrying me is that I don't know who clones my skbuff and why.

skbuffs are cloned all over the stack for various reasons.

 
> To said everything, I know who clones my skbuff because it causes a oops
> when it tries to free my buffer If I use my destructor.

Because you're mistakely using a private field.


-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread christophe barbé

I don't know about socket but I allocate myself the skbuff and I set the
destructor (and previously the pointer value is NULL). So I don't overwrite
a destructor.

I believe net/core/sock.c is not involved in my problem but I can be wrong.
What is worrying me is that I don't know who clones my skbuff and why.

To said everything, I know who clones my skbuff because it causes a oops
when it tries to free my buffer If I use my destructor.

Christophe

On Wed, 23 May 2001 16:40:36 Andi Kleen wrote:
> On Wed, May 23, 2001 at 04:37:58PM +0200, christophe barbé wrote:
> > It seems to not be the case, because my destructor is called.
> 
> It is called, but you overwrote the kernel destructor and therefore
> broke the socket memory accounting completely; causing all kinds of 
> problems.
> 
> > Could you point me the code where you think this method is already
> used?
> 
> net/core/sock.c
> 
> 
> -Andi
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
-- 
Christophe Barbé
Software Engineer - [EMAIL PROTECTED]
Lineo France - Lineo High Availability Group
42-46, rue Médéric - 92110 Clichy - France
phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
http://www.lineo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread Andi Kleen

On Wed, May 23, 2001 at 04:37:58PM +0200, christophe barbé wrote:
> It seems to not be the case, because my destructor is called.

It is called, but you overwrote the kernel destructor and therefore
broke the socket memory accounting completely; causing all kinds of 
problems.

> Could you point me the code where you think this method is already used?

net/core/sock.c


-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread christophe barbé

It seems to not be the case, because my destructor is called.
Could you point me the code where you think this method is already used?

Thank you for your answer,
Christophe


On Wed, 23 May 2001 16:27:39 Andi Kleen wrote:
> On Wed, May 23, 2001 at 04:16:54PM +0200, christophe barbé wrote:
> > Hi all,
> > 
> > I'm trying to figure out how to use the destructor function in the
> skbuff
> > object. 
> > I've read (the source code and) the alan cox's article from
> linuxjournal
> > but it refers to linux 2.0.
> > Perhaps someone can tell me what's wrong in the following :
> 
> You can't use the destructor; it is already used by the main stack for
> socket
> memory management.
> 
> -Andi
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
-- 
Christophe Barbé
Software Engineer - [EMAIL PROTECTED]
Lineo France - Lineo High Availability Group
42-46, rue Médéric - 92110 Clichy - France
phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
http://www.lineo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread Andi Kleen

On Wed, May 23, 2001 at 04:16:54PM +0200, christophe barbé wrote:
> Hi all,
> 
> I'm trying to figure out how to use the destructor function in the skbuff
> object. 
> I've read (the source code and) the alan cox's article from linuxjournal
> but it refers to linux 2.0.
> Perhaps someone can tell me what's wrong in the following :

You can't use the destructor; it is already used by the main stack for socket
memory management.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread Andi Kleen

On Wed, May 23, 2001 at 04:16:54PM +0200, christophe barbé wrote:
 Hi all,
 
 I'm trying to figure out how to use the destructor function in the skbuff
 object. 
 I've read (the source code and) the alan cox's article from linuxjournal
 but it refers to linux 2.0.
 Perhaps someone can tell me what's wrong in the following :

You can't use the destructor; it is already used by the main stack for socket
memory management.

-Andi
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread christophe barbé

It seems to not be the case, because my destructor is called.
Could you point me the code where you think this method is already used?

Thank you for your answer,
Christophe


On Wed, 23 May 2001 16:27:39 Andi Kleen wrote:
 On Wed, May 23, 2001 at 04:16:54PM +0200, christophe barbé wrote:
  Hi all,
  
  I'm trying to figure out how to use the destructor function in the
 skbuff
  object. 
  I've read (the source code and) the alan cox's article from
 linuxjournal
  but it refers to linux 2.0.
  Perhaps someone can tell me what's wrong in the following :
 
 You can't use the destructor; it is already used by the main stack for
 socket
 memory management.
 
 -Andi
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel
 in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 
-- 
Christophe Barbé
Software Engineer - [EMAIL PROTECTED]
Lineo France - Lineo High Availability Group
42-46, rue Médéric - 92110 Clichy - France
phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
http://www.lineo.com

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread Andi Kleen

On Wed, May 23, 2001 at 04:37:58PM +0200, christophe barbé wrote:
 It seems to not be the case, because my destructor is called.

It is called, but you overwrote the kernel destructor and therefore
broke the socket memory accounting completely; causing all kinds of 
problems.

 Could you point me the code where you think this method is already used?

net/core/sock.c


-Andi

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread christophe barbé

I don't know about socket but I allocate myself the skbuff and I set the
destructor (and previously the pointer value is NULL). So I don't overwrite
a destructor.

I believe net/core/sock.c is not involved in my problem but I can be wrong.
What is worrying me is that I don't know who clones my skbuff and why.

To said everything, I know who clones my skbuff because it causes a oops
when it tries to free my buffer If I use my destructor.

Christophe

On Wed, 23 May 2001 16:40:36 Andi Kleen wrote:
 On Wed, May 23, 2001 at 04:37:58PM +0200, christophe barbé wrote:
  It seems to not be the case, because my destructor is called.
 
 It is called, but you overwrote the kernel destructor and therefore
 broke the socket memory accounting completely; causing all kinds of 
 problems.
 
  Could you point me the code where you think this method is already
 used?
 
 net/core/sock.c
 
 
 -Andi
 
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel
 in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 
-- 
Christophe Barbé
Software Engineer - [EMAIL PROTECTED]
Lineo France - Lineo High Availability Group
42-46, rue Médéric - 92110 Clichy - France
phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
http://www.lineo.com

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread Andi Kleen

On Wed, May 23, 2001 at 04:50:28PM +0200, christophe barbé wrote:
 I don't know about socket but I allocate myself the skbuff and I set the
 destructor (and previously the pointer value is NULL). So I don't overwrite
 a destructor.

That just means you didn't test all cases; e.g. not TCP or UDP send/receive.



 
 I believe net/core/sock.c is not involved in my problem but I can be wrong.
 What is worrying me is that I don't know who clones my skbuff and why.

skbuffs are cloned all over the stack for various reasons.

 
 To said everything, I know who clones my skbuff because it causes a oops
 when it tries to free my buffer If I use my destructor.

Because you're mistakely using a private field.


-Andi
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread christophe barbé

I believe you and It's sure that I have not tested all cases.
So do you see a way to use a private data buffer ?

Christophe

On Wed, 23 May 2001 16:55:57 Andi Kleen wrote:
 On Wed, May 23, 2001 at 04:50:28PM +0200, christophe barbé wrote:
  I don't know about socket but I allocate myself the skbuff and I set
 the
  destructor (and previously the pointer value is NULL). So I don't
 overwrite
  a destructor.
 
 That just means you didn't test all cases; e.g. not TCP or UDP
 send/receive.
 
 
 
  
  I believe net/core/sock.c is not involved in my problem but I can be
 wrong.
  What is worrying me is that I don't know who clones my skbuff and why.
 
 skbuffs are cloned all over the stack for various reasons.
 
  
  To said everything, I know who clones my skbuff because it causes a
 oops
  when it tries to free my buffer If I use my destructor.
 
 Because you're mistakely using a private field.
 
 
 -Andi
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel
 in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 
-- 
Christophe Barbé
Software Engineer - [EMAIL PROTECTED]
Lineo France - Lineo High Availability Group
42-46, rue Médéric - 92110 Clichy - France
phone (33).1.41.40.02.12 - fax (33).1.41.40.02.01
http://www.lineo.com

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: sk_buff destructor in 2.2.18

2001-05-23 Thread Andi Kleen

On Wed, May 23, 2001 at 05:02:15PM +0200, christophe barbé wrote:
 I believe you and It's sure that I have not tested all cases.
 So do you see a way to use a private data buffer ?

The only way I know currently is to keep skb-users = 1 and use a timer
that collects such buffers from a global list, but it is not very nice. The
stack doesn't like private buffers.

-Andi
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/