All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>, davem@redhat.com
Subject: New struct sock_common breaks parisc 64 bit compiles with a misalignment
Date: 09 Jun 2003 23:57:46 -0500	[thread overview]
Message-ID: <1055221067.11728.14.camel@mulgrave> (raw)

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

The problem seems to be that the new struct sock_common ends with a
pointer and an atomic_t (which is an int on parisc), so the compiler
adds an extra four bytes of padding where none previously existed in
struct tcp_tw_bucket, so the __u64 ptr tricks with tw_daddr fail.

A fix that seems to work for me on parisc64 is to move the atomic_t out
of the end of struct sock_common and back into the two other structures
(so struct sock_common now ends on 0 mod 8).

James



[-- Attachment #2: tmp.diff --]
[-- Type: text/plain, Size: 1131 bytes --]

===== include/net/sock.h 1.43 vs edited =====
--- 1.43/include/net/sock.h	Wed Jun  4 19:57:07 2003
+++ edited/include/net/sock.h	Mon Jun  9 23:41:15 2003
@@ -111,7 +111,6 @@
 	struct sock		**skc_pprev;
 	struct sock		*skc_bind_next;
 	struct sock		**skc_bind_pprev;
-	atomic_t		skc_refcnt;
 };
 
 /**
@@ -191,7 +190,7 @@
 #define sk_pprev		__sk_common.skc_pprev
 #define sk_bind_next		__sk_common.skc_bind_next
 #define sk_bind_pprev		__sk_common.skc_bind_pprev
-#define sk_refcnt		__sk_common.skc_refcnt
+	atomic_t		sk_refcnt;
 	volatile unsigned char	sk_zapped;
 	unsigned char		sk_shutdown;
 	unsigned char		sk_use_write_queue;
===== include/net/tcp.h 1.44 vs edited =====
--- 1.44/include/net/tcp.h	Fri Jun  6 05:24:44 2003
+++ edited/include/net/tcp.h	Mon Jun  9 23:39:44 2003
@@ -178,7 +178,7 @@
 #define tw_pprev		__tw_common.skc_pprev
 #define tw_bind_next		__tw_common.skc_bind_next
 #define tw_bind_pprev		__tw_common.skc_bind_pprev
-#define tw_refcnt		__tw_common.skc_refcnt
+	atomic_t		tw_refcnt;
 	volatile unsigned char	tw_substate;
 	unsigned char		tw_rcv_wscale;
 	__u16			tw_sport;

             reply	other threads:[~2003-06-10  4:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-10  4:57 James Bottomley [this message]
2003-06-10 16:12 ` New struct sock_common breaks parisc 64 bit compiles with a misalignment David S. Miller
2003-06-15 17:09   ` YOSHIFUJI Hideaki / 吉藤英明
2003-06-15 17:06     ` David S. Miller
2003-06-15  6:19 ` David S. Miller
2003-06-15 14:35   ` James Bottomley
2003-06-15 14:35     ` David S. Miller
2003-06-15 15:17       ` James Bottomley
2003-06-15 15:23         ` David S. Miller
     [not found] <1055687753.10803.28.camel@mulgrave.suse.lists.linux.kernel>
     [not found] ` <20030615.073503.112613460.davem@redhat.com.suse.lists.linux.kernel>
     [not found]   ` <1055690231.10803.54.camel@mulgrave.suse.lists.linux.kernel>
     [not found]     ` <20030615.082355.08334189.davem@redhat.com.suse.lists.linux.kernel>
2003-06-15 15:41       ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1055221067.11728.14.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=acme@conectiva.com.br \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.