[PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Gerrit Renker
[DCCP]: Use `unsigned' for packet lengths This patch implements a suggestion by Ian McDonald and 1) avoids tests against negative packet lengths by using unsigned (u32) for packet payload lengths in the CCID send_packet()/packet_sent() routines 2) removes an now unnecessary test with

Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Ian McDonald
On 11/29/06, Gerrit Renker [EMAIL PROTECTED] wrote: [DCCP]: Use `unsigned' for packet lengths I'm wondering whether this code is 64 bit safe??? I don't think it is. Arnaldo can probably advise. We changed int to u32 for length and I went and checked the callers and parameters. They all

Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Gerrit Renker
Quoting Ian McDonald: | On 11/29/06, Gerrit Renker [EMAIL PROTECTED] wrote: | [DCCP]: Use `unsigned' for packet lengths | | I'm wondering whether this code is 64 bit safe??? I don't think it is. | Arnaldo can probably advise. | | We changed int to u32 for length and I went and checked

Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Gerrit Renker
Quoting Ian McDonald: | I think I didn't explain my point well here. You can't change to u32 | but need to be unsigned int (not u64). Don't get this: u32 is a 32-bit unsigned value and therefore looks sufficient - and you are proposing `unsigned int' to have easier conversion to skb-len,

Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Ian McDonald
On 11/29/06, Gerrit Renker [EMAIL PROTECTED] wrote: Quoting Ian McDonald: | I think I didn't explain my point well here. You can't change to u32 | but need to be unsigned int (not u64). Don't get this: u32 is a 32-bit unsigned value and therefore looks sufficient - and you are proposing

Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Arnaldo Carvalho de Melo
On Wed, Nov 29, 2006 at 09:17:04AM +1300, Ian McDonald wrote: On 11/29/06, Gerrit Renker [EMAIL PROTECTED] wrote: Quoting Ian McDonald: | I think I didn't explain my point well here. You can't change to u32 | but need to be unsigned int (not u64). Don't get this: u32 is a 32-bit unsigned

Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Gerrit Renker
| On 11/29/06, Gerrit Renker [EMAIL PROTECTED] wrote: | Quoting Ian McDonald: | | I think I didn't explain my point well here. You can't change to u32 | | but need to be unsigned int (not u64). | Don't get this: u32 is a 32-bit unsigned value and therefore looks sufficient - and you |

Re: Packet size s Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Ian McDonald
In short: my suggestion is to keep an experimental patch for this and I would even offer to keep one up-to-date and online, if in return we can simplify the socket API. Does this sound like a more convincing argument? Fair enough, I think we should go this way for now,

Re: Packet size s Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Arnaldo Carvalho de Melo
On 11/28/06, Arnaldo Carvalho de Melo [EMAIL PROTECTED] wrote: On 11/28/06, Ian McDonald [EMAIL PROTECTED] wrote: In short: my suggestion is to keep an experimental patch for this and I would even offer to keep one up-to-date and online, if in return we can simplify the socket

Re: Packet size s Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Ian McDonald
OK, additionally I'm replacing: + DCCP_WARN(sockopt(PACKET_SIZE) is deprecated: fix your app\n); + err = -EINVAL; By + DCCP_WARN(sockopt(PACKET_SIZE) not yet supported\n); + err = -EINVAL; To better reflect what we've discussed so far.

Re: Packet size s Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Arnaldo Carvalho de Melo
On 11/28/06, Ian McDonald [EMAIL PROTECTED] wrote: OK, additionally I'm replacing: + DCCP_WARN(sockopt(PACKET_SIZE) is deprecated: fix your app\n); + err = -EINVAL; By + DCCP_WARN(sockopt(PACKET_SIZE) not yet supported\n); + err =

Re: Packet size s Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Gerrit Renker
Quoting Ian McDonald: |In short: my suggestion is to keep an experimental patch for this and I would even offer to | keep one up-to-date and online, if in return we can simplify the socket API. Does | this sound like a more convincing argument? | | Fair enough,

Re: Packet size s Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Arnaldo Carvalho de Melo
On 11/28/06, Arnaldo Carvalho de Melo [EMAIL PROTECTED] wrote: On 11/28/06, Ian McDonald [EMAIL PROTECTED] wrote: OK, additionally I'm replacing: + DCCP_WARN(sockopt(PACKET_SIZE) is deprecated: fix your app\n); + err = -EINVAL; By +

Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Gerrit Renker
Quoting Eddie Kohler: | | Would really appreciate if you could at some time have a look at the moving-average patch. Have communicated | | with Eddie again about it, and using MSS would at the moment be much more complicated. | | | | Will look at it tomorrow (along with

Re: Packet size s Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Ian McDonald
ttcp-r: accept from localhost.ghostprotocols.net ttcp-t: connect ttcp-t: 256000 bytes in 22.98 real seconds = 10.88 KB/sec +++ ttcp-t: 1000 I/O calls, msec/call = 23.53, calls/sec = 43.51 ttcp-t: 0.2user 17.0sys 0:22real 75% 0i+0d 0maxrss 0+1pf 0+1000csw ttcp-r: 256000 bytes in 23.31 real seconds

Re: Packet size s Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Arnaldo Carvalho de Melo
On 11/28/06, Ian McDonald [EMAIL PROTECTED] wrote: ttcp-r: accept from localhost.ghostprotocols.net ttcp-t: connect ttcp-t: 256000 bytes in 22.98 real seconds = 10.88 KB/sec +++ ttcp-t: 1000 I/O calls, msec/call = 23.53, calls/sec = 43.51 ttcp-t: 0.2user 17.0sys 0:22real 75% 0i+0d 0maxrss

Re: Packet size s Re: [PATCH 2/2]: Use `unsigned' for packet lengths

2006-11-28 Thread Ian McDonald
On 11/29/06, Arnaldo Carvalho de Melo [EMAIL PROTECTED] wrote: On 11/28/06, Ian McDonald [EMAIL PROTECTED] wrote: ttcp-r: accept from localhost.ghostprotocols.net ttcp-t: connect ttcp-t: 256000 bytes in 22.98 real seconds = 10.88 KB/sec +++ ttcp-t: 1000 I/O calls, msec/call = 23.53,