[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1335ccffdaaa5a553717e42a855bba1a6f36dc9b.camel@sipsolutions.net>
Date: Wed, 11 Oct 2023 18:21:47 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Jakub Kicinski <kuba@...nel.org>, Jiri Pirko <jiri@...nulli.us>
Cc: netdev@...r.kernel.org, nicolas.dichtel@...nd.com, fw@...len.de,
pablo@...filter.org, mkubecek@...e.cz, aleksander.lobakin@...el.com
Subject: Re: [RFC] netlink: add variable-length / auto integers
On Wed, 2023-10-11 at 09:16 -0700, Jakub Kicinski wrote:
>
> > > +static inline int nla_put_uint(struct sk_buff *skb, int attrtype, u64 value)
> > > +{
> > > + u64 tmp64 = value;
> > > + u32 tmp32 = value;
> > > +
> > > + if (tmp64 == tmp32)
> > > + return nla_put_u32(skb, attrtype, tmp32);
> >
> > It's a bit confusing, perheps better just to use nla_put() here as well?
>
> I want to underscore the equivalency to u32 for smaller types.
ITYM "smaller values".
Now I'm wondering if we should keep ourselves some option of going to
even bigger values (128 bits) in some potential future, but I guess
that's not really natively supported anywhere in the same way 64-bit is
supposed on 32-bit.
johannes
Powered by blists - more mailing lists