Thread (23 messages) 23 messages, 3 authors, 2025-07-09

Re: [PATCH net-next 05/15] quic: provide quic.h header files for kernel and userspace

flat view

From: Xin Long <lucien.xin@gmail.com>
Date: 2025-07-09 17:05:52
Also in: linux-cifs

On Tue, Jul 8, 2025 at 12:34 PM David Howells [off-list ref] wrote:
Xin Long [off-list ref] wrote:
quoted
+#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.
quoted
+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
quoted
+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.
quoted
+enum {
+     QUIC_TRANSPORT_ERROR_NONE,
+     QUIC_TRANSPORT_ERROR_INTERNAL,
+     QUIC_TRANSPORT_ERROR_CONNECTION_REFUSED,
Again, recommend assigning actual values.

David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help