From: Sridhar S. <sr...@us...> - 2005-09-26 22:12:32
|
On Mon, 2005-09-26 at 23:41 +0200, Ivan Skytte J=C3=B8rgensen wrote: > On Sunday 25 September 2005 21:36, Ivan Skytte J=C3=B8rgensen wrote: > > On Tuesday 20 September 2005 00:11, Sridhar Samudrala wrote: > > [...] > > > > > 2. Make all the structures as packed so that the sizes are independ= ent > > > of the architecture and keep the kernel code simple, but break t= he > > > binary compatibility. > > > > > > Is it worth maintaining binary compatiblity and have some messy > > > compatibility code in the kernel? > > > Also there seems to be atleast one structure(sctp_paddrparams) whic= h > > > needs to be updated to the latest draft. > > > > > > I would prefer the 2nd option and let the apps rebuild using the ne= w > > > header file when they would like to run on newer kernels. > > > > I am preparing a patch that fixes the structure sizes and only breaks > > 64-bit programs where needed. Expect something the next week. > > > > I followed the discussion in tsvwg mailing list. My interpretation of= the > > few answers is that this is a "quality of implementation issue" and t= hat > > padding fields are allowed but won't get into the RFC because it is a= n > > implementation issue. >=20 > __attribute((packed)) patches attached. >=20 > patch summary: > - sctp_sndrcvinfo: Explicit 16-bit padding inserted > - sctp_paddr_change: __attribute__ ((packed)) > - sctp_remote_error: Explicit 16-bit padding inserted > - sctp_setpeerprim: __attribute__ ((packed)) > - sctp_prim: __attribute__ ((packed)) > - sctp_paddrparams: Explicit 16-bit padding inserted. __attribute__=20 > ((packed)) > - sctp_paddrinfo: __attribute__ ((packed)) >=20 > 32-bit programs should remain unaffected. 64-bit programs will break if= using=20 > sctp_paddr_change, sctp_setpeerprim, sctp_prim, sctp_paddrparams or=20 > sctp_paddrinfo > . I did not add the aligned(4) attribute as it is not strictly needed. With aligned(4), i think you don't need to add any padding. On ppc64, by adding __attribute__((packed, aligned(4))) to sctp_paddr_change, sctp_remote_error, sctp_setpeerprim, sctp_prim. sctp_paddrparams and sctp_paddrinfo i was able to get 32/64 and 64/64 to work and also old 32-bit apps on intel 32. Could you try this on x86-64? If you prefer, i can send you the patch. Thanks Sridhar >=20 > Tested with 32/64 and 64/64 on x86_64 >=20 > With the sctp-get{l,p}addrs() patch, and this patch, and Sridhar's msg_= flag=20 > patch, the whole test suite passes. >=20 > I have not tested with 32-bit programs using the "old" lksctp-1.0.3 bec= ause=20 > there is know breakage in sctp_get{l,p}addrs() |