netdev
[Top] [All Lists]

Re: [PATCH] allow setting mtu and txqlen via RTM_SETLINK and provide txq

To: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [PATCH] allow setting mtu and txqlen via RTM_SETLINK and provide txqlen via RTM_GETLINK
From: Thomas Graf <tgraf@xxxxxxx>
Date: Tue, 24 Aug 2004 11:49:52 +0200
Cc: davem@xxxxxxxxxx, kuznet@xxxxxxxxxxxxx, hadi@xxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <E1BzR1C-0000c4-00@gondolin.me.apana.org.au>
References: <20040823205114.GB19921@postel.suug.ch> <E1BzR1C-0000c4-00@gondolin.me.apana.org.au>
Sender: netdev-bounce@xxxxxxxxxxx
* Herbert Xu <E1BzR1C-0000c4-00@xxxxxxxxxxxxxxxxxxxxxxxx> 2004-08-24 12:26
> Thomas Graf <tgraf@xxxxxxx> wrote:
> >
> > +       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.

> Keep in mind that the ioctl version is exporting an int.

Yes, but the size of ivalue is also dependent on the architecture and
the cast to int is done for compatibility reasons.

   Thomas

<Prev in Thread] Current Thread [Next in Thread>