Re: [PATCH] allow setting mtu and txqlen via RTM_SETLINK and provide txqlen via RTM_GETLINK
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2004-08-24 10:16:55
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2004-08-24 10:16:55
Thomas Graf [off-list ref] wrote:
* Herbert Xu [ref] 2004-08-24 12:26quoted
Thomas Graf [off-list ref] wrote:quoted
+ RTA_PUT(skb, IFLA_TXQLEN, sizeof(unsigned long), &dev->tx_queue_len);Please use a fixed width type like u32.I used the same type as it is stored in struct net_device to avoid data loss on certain architectures. Due to the fact that the size of the attribute is provided to the userspace receiver, no guessing is involved. Using u32 would mean to do an unnecessary cast.
Please think about the meaning of the value. Is anyone going to have a queue bigger than 2^32? And if the answer is yes, then please use u64. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} [off-list ref] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt