[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADvbK_dDbzdxdfZT43M17hG6TKFfoQZ+YuZGR6q6E5s7eRUr4A@mail.gmail.com>
Date: Wed, 9 Jul 2025 13:05:40 -0400
From: Xin Long <lucien.xin@...il.com>
To: David Howells <dhowells@...hat.com>
Cc: network dev <netdev@...r.kernel.org>, davem@...emloft.net, kuba@...nel.org,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Stefan Metzmacher <metze@...ba.org>, Moritz Buhl <mbuhl@...nbsd.org>, Tyler Fanelli <tfanelli@...hat.com>,
Pengtao He <hepengtao@...omi.com>, linux-cifs@...r.kernel.org,
Steve French <smfrench@...il.com>, Namjae Jeon <linkinjeon@...nel.org>,
Paulo Alcantara <pc@...guebit.com>, Tom Talpey <tom@...pey.com>, kernel-tls-handshake@...ts.linux.dev,
Chuck Lever <chuck.lever@...cle.com>, Jeff Layton <jlayton@...nel.org>,
Benjamin Coddington <bcodding@...hat.com>, Steve Dickson <steved@...hat.com>, Hannes Reinecke <hare@...e.de>,
Alexander Aring <aahringo@...hat.com>, Cong Wang <xiyou.wangcong@...il.com>,
"D . Wythe" <alibuda@...ux.alibaba.com>, Jason Baron <jbaron@...mai.com>,
illiliti <illiliti@...tonmail.com>, Sabrina Dubroca <sd@...asysnail.net>,
Marcelo Ricardo Leitner <marcelo.leitner@...il.com>, Daniel Stenberg <daniel@...x.se>,
Andy Gospodarek <andrew.gospodarek@...adcom.com>
Subject: Re: [PATCH net-next 05/15] quic: provide quic.h header files for
kernel and userspace
On Tue, Jul 8, 2025 at 12:34 PM David Howells <dhowells@...hat.com> wrote:
>
> Xin Long <lucien.xin@...il.com> wrote:
>
> > +#ifndef __uapi_quic_h__
> > +#define __uapi_quic_h__
>
> I think capital letters are preferred for system headers, e.g.:
> _UAPI_LINUX_QUIC_H.
>
Looks better, will update.
> > +enum quic_crypto_level {
> > + QUIC_CRYPTO_APP,
> > + QUIC_CRYPTO_INITIAL,
> > + QUIC_CRYPTO_HANDSHAKE,
> > + QUIC_CRYPTO_EARLY,
> > + QUIC_CRYPTO_MAX,
> > +};
>
> I would recommend that you assign explicit values to enums in uapi headers to
> avoid accidental changes if someone tries inserting in the middle of the list.
>
That doesn't sound like an easy mistake to make. Assigning explicit values
to zero-based, continuous enums isn’t commonly seen in other header files
either.
But I will make such a change for QUIC_TRANSPORT_ enums, as their values
are actually defined in:
https://datatracker.ietf.org/doc/html/rfc9000#section-20.1
> > +struct quic_transport_param {
> > + uint8_t remote;
> > + uint8_t disable_active_migration;
> > + uint8_t grease_quic_bit;
>
> I believe use of __u8, __u16, __s32 and similar is preferred to uint8_t,
> uint16_t, int32_t, etc. in UAPI headers.
>
Make sense, will update.
Thanks for the suggestions.
> > +enum {
> > + QUIC_TRANSPORT_ERROR_NONE,
> > + QUIC_TRANSPORT_ERROR_INTERNAL,
> > + QUIC_TRANSPORT_ERROR_CONNECTION_REFUSED,
>
> Again, recommend assigning actual values.
>
> David
>
Powered by blists - more mailing lists