netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* comment about struct tcp_tw_bucket in struct sock
@ 2003-05-13 21:05 Olaf Hering
  2003-05-13 23:31 ` David S. Miller
  0 siblings, 1 reply; 14+ messages in thread
From: Olaf Hering @ 2003-05-13 21:05 UTC (permalink / raw)
  To: Marcelo Tosatti, David S. Miller; +Cc: netdev

Hi,

we just hit this one. struct tcp_tw_bucket and stuct sock must match.

Please apply.



--- linux-2.4/include/net/sock.h	2003-04-24 17:11:20.000000000 +0200
+++ linux-2.4.21-rc2/include/net/sock.h	2003-05-13 23:00:32.000000000 +0200
@@ -498,6 +498,10 @@ do {	spin_lock_init(&((__sk)->lock.slock
 } while(0)
 
 struct sock {
+	/* These _must_ match the beginning of struct tcp_tw_bucket precisely.
+	 * XXX Yes I know this is gross, but I'd have to edit every single
+	 * XXX networking file if I created a "struct sock_header". -DaveM
+	 */
 	/* Socket demultiplex comparisons on incoming packets. */
 	__u32			daddr;		/* Foreign IPv4 addr			*/
 	__u32			rcv_saddr;	/* Bound local IPv4 addr		*/

-- 
USB is for mice, FireWire is for men!

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-13 21:05 comment about struct tcp_tw_bucket in struct sock Olaf Hering
@ 2003-05-13 23:31 ` David S. Miller
  2003-05-14  2:44   ` Arnaldo Carvalho de Melo
                     ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: David S. Miller @ 2003-05-13 23:31 UTC (permalink / raw)
  To: olh; +Cc: marcelo, netdev

   From: Olaf Hering <olh@suse.de>
   Date: Tue, 13 May 2003 23:05:41 +0200

   we just hit this one. struct tcp_tw_bucket and stuct sock must match.
   
   Please apply.

It's documented in tcp.h already.

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-13 23:31 ` David S. Miller
@ 2003-05-14  2:44   ` Arnaldo Carvalho de Melo
  2003-05-14  8:00   ` Olaf Hering
  2003-05-14  8:32   ` Andi Kleen
  2 siblings, 0 replies; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2003-05-14  2:44 UTC (permalink / raw)
  To: David S. Miller; +Cc: olh, marcelo, netdev

Em Tue, May 13, 2003 at 04:31:50PM -0700, David S. Miller escreveu:
>    From: Olaf Hering <olh@suse.de>
>    Date: Tue, 13 May 2003 23:05:41 +0200
> 
>    we just hit this one. struct tcp_tw_bucket and stuct sock must match.
>    
>    Please apply.
> 
> It's documented in tcp.h already.

Yes, and in 2.5 the situation is a bit better, I still have an itching to
revisit this at some point, together with struct open_request, etc 8)

- Arnaldo

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-13 23:31 ` David S. Miller
  2003-05-14  2:44   ` Arnaldo Carvalho de Melo
@ 2003-05-14  8:00   ` Olaf Hering
  2003-05-14 19:17     ` David S. Miller
  2003-05-14  8:32   ` Andi Kleen
  2 siblings, 1 reply; 14+ messages in thread
From: Olaf Hering @ 2003-05-14  8:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: marcelo, netdev

 On Tue, May 13, David S. Miller wrote:

>    From: Olaf Hering <olh@suse.de>
>    Date: Tue, 13 May 2003 23:05:41 +0200
> 
>    we just hit this one. struct tcp_tw_bucket and stuct sock must match.
>    
>    Please apply.
> 
> It's documented in tcp.h already.

True, but not in struct sock.


-- 
USB is for mice, FireWire is for men!

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-13 23:31 ` David S. Miller
  2003-05-14  2:44   ` Arnaldo Carvalho de Melo
  2003-05-14  8:00   ` Olaf Hering
@ 2003-05-14  8:32   ` Andi Kleen
  2003-05-14 19:18     ` David S. Miller
  2 siblings, 1 reply; 14+ messages in thread
From: Andi Kleen @ 2003-05-14  8:32 UTC (permalink / raw)
  To: David S. Miller; +Cc: olh, marcelo, netdev

On Tue, May 13, 2003 at 04:31:50PM -0700, David S. Miller wrote:
>    From: Olaf Hering <olh@suse.de>
>    Date: Tue, 13 May 2003 23:05:41 +0200
> 
>    we just hit this one. struct tcp_tw_bucket and stuct sock must match.
>    
>    Please apply.
> 
> It's documented in tcp.h already.

Just not everybody changing sock.h also reads tcp.h :-(

-Andi

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-14  8:00   ` Olaf Hering
@ 2003-05-14 19:17     ` David S. Miller
  2003-05-14 19:23       ` Andi Kleen
  0 siblings, 1 reply; 14+ messages in thread
From: David S. Miller @ 2003-05-14 19:17 UTC (permalink / raw)
  To: olh; +Cc: marcelo, netdev

   From: Olaf Hering <olh@suse.de>
   Date: Wed, 14 May 2003 10:00:43 +0200

    On Tue, May 13, David S. Miller wrote:
   
   > It's documented in tcp.h already.
   
   True, but not in struct sock.

When you edit the layout of struct sock you assume
the full responsibility that you might be breaking
something that uses struct sock.  This includes
third party modules.

You shouldn't be making changing to it lightly.  How this made TCP
blow up is the negative feedback you get for trying to change struct
sock ;-)

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-14  8:32   ` Andi Kleen
@ 2003-05-14 19:18     ` David S. Miller
  2003-05-14 19:21       ` Andi Kleen
  0 siblings, 1 reply; 14+ messages in thread
From: David S. Miller @ 2003-05-14 19:18 UTC (permalink / raw)
  To: ak; +Cc: olh, marcelo, netdev

   From: Andi Kleen <ak@suse.de>
   Date: Wed, 14 May 2003 10:32:36 +0200

   On Tue, May 13, 2003 at 04:31:50PM -0700, David S. Miller wrote:
   > It's documented in tcp.h already.
   
   Just not everybody changing sock.h also reads tcp.h :-(

You assume that protocols in the tree are the only thing
that might break if you edit struct sock.

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-14 19:18     ` David S. Miller
@ 2003-05-14 19:21       ` Andi Kleen
  2003-05-22  0:52         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 14+ messages in thread
From: Andi Kleen @ 2003-05-14 19:21 UTC (permalink / raw)
  To: David S. Miller; +Cc: ak, olh, marcelo, netdev

On Wed, May 14, 2003 at 12:18:06PM -0700, David S. Miller wrote:
>    From: Andi Kleen <ak@suse.de>
>    Date: Wed, 14 May 2003 10:32:36 +0200
> 
>    On Tue, May 13, 2003 at 04:31:50PM -0700, David S. Miller wrote:
>    > It's documented in tcp.h already.
>    
>    Just not everybody changing sock.h also reads tcp.h :-(
> 
> You assume that protocols in the tree are the only thing
> that might break if you edit struct sock.

I'm not assuming anything and didn't even edit struct sock, just pointing 
out that such a fragile hack as the current tw bucket is needs an explicit 
comment on both places.

Best would be to bite the bullet and give them a common structure.

-Andi

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-14 19:17     ` David S. Miller
@ 2003-05-14 19:23       ` Andi Kleen
  2003-05-14 19:34         ` David S. Miller
  0 siblings, 1 reply; 14+ messages in thread
From: Andi Kleen @ 2003-05-14 19:23 UTC (permalink / raw)
  To: David S. Miller; +Cc: olh, marcelo, netdev

On Wed, May 14, 2003 at 12:17:27PM -0700, David S. Miller wrote:
> When you edit the layout of struct sock you assume
> the full responsibility that you might be breaking
> something that uses struct sock.  This includes
> third party modules.

What third party modules are you refering too ? 

I know openafs did or still does the cardinal sin of duplicating struct inode
and TCP has this hack too since ages, but other than that I hope 
"cut'n'paste" usage of structures is not common.

-Andi

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-14 19:23       ` Andi Kleen
@ 2003-05-14 19:34         ` David S. Miller
  2003-05-14 19:57           ` Andi Kleen
  0 siblings, 1 reply; 14+ messages in thread
From: David S. Miller @ 2003-05-14 19:34 UTC (permalink / raw)
  To: ak; +Cc: olh, marcelo, netdev

   From: Andi Kleen <ak@suse.de>
   Date: Wed, 14 May 2003 21:23:05 +0200

   What third party modules are you refering too ? 
   
We don't know, and that's precisely my point.

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-14 19:34         ` David S. Miller
@ 2003-05-14 19:57           ` Andi Kleen
  2003-05-14 20:02             ` David S. Miller
  0 siblings, 1 reply; 14+ messages in thread
From: Andi Kleen @ 2003-05-14 19:57 UTC (permalink / raw)
  To: David S. Miller; +Cc: ak, olh, marcelo, netdev

On Wed, May 14, 2003 at 12:34:21PM -0700, David S. Miller wrote:
>    From: Andi Kleen <ak@suse.de>
>    Date: Wed, 14 May 2003 21:23:05 +0200
> 
>    What third party modules are you refering too ? 
>    
> We don't know, and that's precisely my point.

When they cut'n'paste structures they're completely on their own ...

I hope you will never let stop such an omnious third party module
you from doing any bug fix or optimization.

-Andi

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-14 19:57           ` Andi Kleen
@ 2003-05-14 20:02             ` David S. Miller
  0 siblings, 0 replies; 14+ messages in thread
From: David S. Miller @ 2003-05-14 20:02 UTC (permalink / raw)
  To: ak; +Cc: olh, marcelo, netdev

   From: Andi Kleen <ak@suse.de>
   Date: Wed, 14 May 2003 21:57:31 +0200

   When they cut'n'paste structures they're completely on their own ...
   
Depends upon who's willing to support them.

   I hope you will never let stop such an omnious third party module
   you from doing any bug fix or optimization.
   
Aha, you're right and _I_ don't need to worry about this.  I'm merely
saying some vendor's _might_. :-)

But see, since it only matters in the main kernel, every attempt to
change the layout of struct sock will go through me before it hits the
vanilla tree, so as a result I'll catch such problems and we thus have
no problems :-)

You can't have it both ways Andi, either we care about arbitrary third
parties do or we don't.

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-14 19:21       ` Andi Kleen
@ 2003-05-22  0:52         ` Arnaldo Carvalho de Melo
  2003-05-22  8:02           ` Andi Kleen
  0 siblings, 1 reply; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2003-05-22  0:52 UTC (permalink / raw)
  To: Andi Kleen; +Cc: David S. Miller, olh, marcelo, netdev

Em Wed, May 14, 2003 at 09:21:17PM +0200, Andi Kleen escreveu:
> On Wed, May 14, 2003 at 12:18:06PM -0700, David S. Miller wrote:
> >    From: Andi Kleen <ak@suse.de>
> >    Date: Wed, 14 May 2003 10:32:36 +0200
> > 
> >    On Tue, May 13, 2003 at 04:31:50PM -0700, David S. Miller wrote:
> >    > It's documented in tcp.h already.
> >    
> >    Just not everybody changing sock.h also reads tcp.h :-(
> > 
> > You assume that protocols in the tree are the only thing
> > that might break if you edit struct sock.
> 
> I'm not assuming anything and didn't even edit struct sock, just pointing 
> out that such a fragile hack as the current tw bucket is needs an explicit 
> comment on both places.
> 
> Best would be to bite the bullet and give them a common structure.

Ah if we could just use a unnamed struct... 8)

- Arnaldo

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

* Re: comment about struct tcp_tw_bucket in struct sock
  2003-05-22  0:52         ` Arnaldo Carvalho de Melo
@ 2003-05-22  8:02           ` Andi Kleen
  0 siblings, 0 replies; 14+ messages in thread
From: Andi Kleen @ 2003-05-22  8:02 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Andi Kleen, David S. Miller, olh, marcelo, netdev

> Ah if we could just use a unnamed struct... 8)

Don't worry. Sometime someone will find a gcc 2.95 bug that prevents
compilation of some new kernel code and is too hard to work around. Once
that happens everybody will move to 3.2+ for the kernel (I don't think
3.0 is used anymore) 

-Andi

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

end of thread, other threads:[~2003-05-22  8:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-13 21:05 comment about struct tcp_tw_bucket in struct sock Olaf Hering
2003-05-13 23:31 ` David S. Miller
2003-05-14  2:44   ` Arnaldo Carvalho de Melo
2003-05-14  8:00   ` Olaf Hering
2003-05-14 19:17     ` David S. Miller
2003-05-14 19:23       ` Andi Kleen
2003-05-14 19:34         ` David S. Miller
2003-05-14 19:57           ` Andi Kleen
2003-05-14 20:02             ` David S. Miller
2003-05-14  8:32   ` Andi Kleen
2003-05-14 19:18     ` David S. Miller
2003-05-14 19:21       ` Andi Kleen
2003-05-22  0:52         ` Arnaldo Carvalho de Melo
2003-05-22  8:02           ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).