netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Jiri Pirko <jiri@resnulli.us>,
	netdev@vger.kernel.org, nicolas.dichtel@6wind.com, fw@strlen.de,
	pablo@netfilter.org, mkubecek@suse.cz,
	aleksander.lobakin@intel.com
Subject: Re: [RFC] netlink: add variable-length / auto integers
Date: Wed, 11 Oct 2023 09:34:10 -0700	[thread overview]
Message-ID: <20231011093410.6c330161@kernel.org> (raw)
In-Reply-To: <1335ccffdaaa5a553717e42a855bba1a6f36dc9b.camel@sipsolutions.net>

On Wed, 11 Oct 2023 18:21:47 +0200 Johannes Berg wrote:
> > > 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".

Right, sorry.

> 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.

I was wondering the same. And in fact that's what kept me from posting
this patch for like a year. Initially I was envisioning a Python-style
bigint, then at least a 128b int, then I gave up.

The problem is I have no idea how to handle large types in C.
Would nla_get_uint() then return uint128_t?  YNL also needs to turn the
value into the max width type and put it in a "parsed response struct".
Presumably that'd also have to render all uints as uint128_t..

If we can't make the consumers reliably handle 128b there's no point 
in pretending that more than 64b can be carried. 
I'm not even sure if all 32b arches support u128.

Given that we have 0 uses of 128b integers in netlink today, I figured
we're better off crossing that bridge when we get there..

  reply	other threads:[~2023-10-11 16:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11  0:33 [RFC] netlink: add variable-length / auto integers Jakub Kicinski
2023-10-11 13:11 ` Johannes Berg
2023-10-11 14:03   ` Nicolas Dichtel
2023-10-11 15:52     ` Jakub Kicinski
2023-10-11 16:01       ` Johannes Berg
2023-10-11 16:45         ` Stephen Hemminger
2023-10-12  9:26           ` David Laight
2023-10-12  6:47       ` Nicolas Dichtel
2023-10-11 16:08   ` Jakub Kicinski
2023-10-11 16:16     ` Johannes Berg
2023-10-11 16:19       ` Jakub Kicinski
2023-10-11 13:46 ` Jiri Pirko
2023-10-11 16:16   ` Jakub Kicinski
2023-10-11 16:21     ` Johannes Berg
2023-10-11 16:34       ` Jakub Kicinski [this message]
2023-10-11 16:37         ` Johannes Berg
2023-10-11 17:01     ` Jiri Pirko
2023-10-11 20:21       ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231011093410.6c330161@kernel.org \
    --to=kuba@kernel.org \
    --cc=aleksander.lobakin@intel.com \
    --cc=fw@strlen.de \
    --cc=jiri@resnulli.us \
    --cc=johannes@sipsolutions.net \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).