From e9de61146146b250dd1c6977086a62435c21d771 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" <lukeshu@lukeshu.com> Date: Mon, 13 Jan 2025 23:20:13 -0700 Subject: lib9p: idl.gen: Track more aspects of max object size --- lib9p/include/lib9p/9p.generated.h | 248 +++++++++++++++++++++---------------- 1 file changed, 139 insertions(+), 109 deletions(-) (limited to 'lib9p/include') diff --git a/lib9p/include/lib9p/9p.generated.h b/lib9p/include/lib9p/9p.generated.h index a5b719e..e3f4d01 100644 --- a/lib9p/include/lib9p/9p.generated.h +++ b/lib9p/include/lib9p/9p.generated.h @@ -148,15 +148,15 @@ enum lib9p_msg_type { /* uint8_t */ /* payload types **************************************************************/ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 2 */ +/* size = 2 ; max_iov = 1 ; max_copy = 2 */ typedef uint16_t lib9p_tag_t; #define LIB9P_TAG_NOTAG ((lib9p_tag_t)UINT16_C(~0)) -/* size = 4 */ +/* size = 4 ; max_iov = 1 ; max_copy = 4 */ typedef uint32_t lib9p_fid_t; #define LIB9P_FID_NOFID ((lib9p_fid_t)UINT32_C(~0)) -/* min_size = 2 ; max_size = 65,537 */ +/* min_size = 2 ; exp_size = 29 ; max_size = 65,537 ; max_iov = 2 ; max_copy = 2 */ struct lib9p_s { uint16_t len; [[gnu::nonstring]] char *utf8; @@ -164,7 +164,7 @@ struct lib9p_s { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 4 */ +/* size = 4 ; max_iov = 1 ; max_copy = 4 */ typedef uint32_t lib9p_dm_t; #define LIB9P_DM_DIR ((lib9p_dm_t)(1<<31)) @@ -208,7 +208,7 @@ typedef uint32_t lib9p_dm_t; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 1 */ +/* size = 1 ; max_iov = 1 ; max_copy = 1 */ typedef uint8_t lib9p_qt_t; #define LIB9P_QT_DIR ((lib9p_qt_t)(1<<7)) @@ -226,13 +226,13 @@ typedef uint8_t lib9p_qt_t; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u -/* size = 4 */ +/* size = 4 ; max_iov = 1 ; max_copy = 4 */ typedef uint32_t lib9p_nuid_t; #define LIB9P_NUID_NONUID ((lib9p_nuid_t)UINT32_C(~0)) #endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 1 */ +/* size = 1 ; max_iov = 1 ; max_copy = 1 */ typedef uint8_t lib9p_o_t; /* unused ((lib9p_o_t)(1<<7)) */ @@ -253,7 +253,7 @@ typedef uint8_t lib9p_o_t; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L -/* size = 8 */ +/* size = 8 ; max_iov = 1 ; max_copy = 8 */ typedef uint64_t lib9p_getattr_t; /* unused ((lib9p_getattr_t)(1<<63)) */ @@ -324,7 +324,7 @@ typedef uint64_t lib9p_getattr_t; #define LIB9P_GETATTR_BASIC ((lib9p_getattr_t)(0x000007ff)) #define LIB9P_GETATTR_ALL ((lib9p_getattr_t)(0x00003fff)) -/* size = 4 */ +/* size = 4 ; max_iov = 1 ; max_copy = 4 */ typedef uint32_t lib9p_setattr_t; /* unused ((lib9p_setattr_t)(1<<31)) */ @@ -360,13 +360,13 @@ typedef uint32_t lib9p_setattr_t; #define LIB9P_SETATTR_UID ((lib9p_setattr_t)(1<<1)) #define LIB9P_SETATTR_MODE ((lib9p_setattr_t)(1<<0)) -/* size = 1 */ +/* size = 1 ; max_iov = 1 ; max_copy = 1 */ typedef uint8_t lib9p_lock_type_t; #define LIB9P_LOCK_TYPE_RDLCK ((lib9p_lock_type_t)UINT8_C(0)) #define LIB9P_LOCK_TYPE_WRLCK ((lib9p_lock_type_t)UINT8_C(1)) #define LIB9P_LOCK_TYPE_UNLCK ((lib9p_lock_type_t)UINT8_C(2)) -/* size = 4 */ +/* size = 4 ; max_iov = 1 ; max_copy = 4 */ typedef uint32_t lib9p_lock_flags_t; /* unused ((lib9p_lock_flags_t)(1<<31)) */ @@ -402,7 +402,7 @@ typedef uint32_t lib9p_lock_flags_t; #define LIB9P_LOCK_FLAGS_RECLAIM ((lib9p_lock_flags_t)(1<<1)) #define LIB9P_LOCK_FLAGS_BLOCK ((lib9p_lock_flags_t)(1<<0)) -/* size = 1 */ +/* size = 1 ; max_iov = 1 ; max_copy = 1 */ typedef uint8_t lib9p_lock_status_t; #define LIB9P_LOCK_STATUS_SUCCESS ((lib9p_lock_status_t)UINT8_C(0)) #define LIB9P_LOCK_STATUS_BLOCKED ((lib9p_lock_status_t)UINT8_C(1)) @@ -411,56 +411,56 @@ typedef uint8_t lib9p_lock_status_t; #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 9 */ +/* size = 9 ; max_iov = 1 ; max_copy = 9 */ struct lib9p_msg_Tflush { lib9p_tag_t tag; uint16_t oldtag; }; -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rflush { lib9p_tag_t tag; }; -/* min_size = 11 ; max_size = 2,147,483,658 */ +/* min_size = 11 ; exp_size = 8,203 ; max_size = 2,147,483,658 ; max_iov = 2 ; max_copy = 11 */ struct lib9p_msg_Rread { lib9p_tag_t tag; uint32_t count; [[gnu::nonstring]] char *data; }; -/* size = 11 */ +/* size = 11 ; max_iov = 1 ; max_copy = 11 */ struct lib9p_msg_Rwrite { lib9p_tag_t tag; uint32_t count; }; -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rclunk { lib9p_tag_t tag; }; -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rremove { lib9p_tag_t tag; }; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rwstat { lib9p_tag_t tag; }; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L -/* size = 11 */ +/* size = 11 ; max_iov = 1 ; max_copy = 11 */ struct lib9p_msg_Rlerror { lib9p_tag_t tag; uint32_t ecode; }; -/* size = 67 */ +/* size = 67 ; max_iov = 1 ; max_copy = 67 */ struct lib9p_msg_Rstatfs { lib9p_tag_t tag; uint32_t type; @@ -474,75 +474,75 @@ struct lib9p_msg_Rstatfs { uint32_t namelen; }; -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rrename { lib9p_tag_t tag; }; -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rsetattr { lib9p_tag_t tag; }; -/* size = 15 */ +/* size = 15 ; max_iov = 1 ; max_copy = 15 */ struct lib9p_msg_Rxattrwalk { lib9p_tag_t tag; uint64_t attr_size; }; -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rxattrcreate { lib9p_tag_t tag; }; -/* min_size = 11 ; max_size = 4,294,967,306 (warning: >UINT32_MAX) */ +/* min_size = 11 ; exp_size = 8,203 ; max_size = 4,294,967,306 (warning: >UINT32_MAX) ; max_iov = 2 ; max_copy = 11 */ struct lib9p_msg_Rreaddir { lib9p_tag_t tag; uint32_t count; [[gnu::nonstring]] char *data; }; -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rfsync { lib9p_tag_t tag; }; -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rlink { lib9p_tag_t tag; }; -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rrenameat { lib9p_tag_t tag; }; -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Runlinkat { lib9p_tag_t tag; }; #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000_e -/* size = 15 */ +/* size = 15 ; max_iov = 1 ; max_copy = 15 */ struct lib9p_msg_Tsession { lib9p_tag_t tag; uint64_t key; }; -/* size = 7 */ +/* size = 7 ; max_iov = 1 ; max_copy = 7 */ struct lib9p_msg_Rsession { lib9p_tag_t tag; }; -/* min_size = 11 ; max_size = 4,294,967,306 (warning: >UINT32_MAX) */ +/* min_size = 11 ; exp_size = 8,203 ; max_size = 4,294,967,306 (warning: >UINT32_MAX) ; max_iov = 2 ; max_copy = 11 */ struct lib9p_msg_Rsread { lib9p_tag_t tag; uint32_t count; [[gnu::nonstring]] char *data; }; -/* size = 11 */ +/* size = 11 ; max_iov = 1 ; max_copy = 11 */ struct lib9p_msg_Rswrite { lib9p_tag_t tag; uint32_t count; @@ -550,7 +550,7 @@ struct lib9p_msg_Rswrite { #endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 23 */ +/* size = 23 ; max_iov = 1 ; max_copy = 23 */ struct lib9p_msg_Tread { lib9p_tag_t tag; lib9p_fid_t fid; @@ -558,7 +558,7 @@ struct lib9p_msg_Tread { uint32_t count; }; -/* min_size = 23 ; max_size = 2,147,483,670 */ +/* min_size = 23 ; exp_size = 8,215 ; max_size = 2,147,483,670 ; max_iov = 2 ; max_copy = 23 */ struct lib9p_msg_Twrite { lib9p_tag_t tag; lib9p_fid_t fid; @@ -567,13 +567,13 @@ struct lib9p_msg_Twrite { [[gnu::nonstring]] char *data; }; -/* size = 11 */ +/* size = 11 ; max_iov = 1 ; max_copy = 11 */ struct lib9p_msg_Tclunk { lib9p_tag_t tag; lib9p_fid_t fid; }; -/* size = 11 */ +/* size = 11 ; max_iov = 1 ; max_copy = 11 */ struct lib9p_msg_Tremove { lib9p_tag_t tag; lib9p_fid_t fid; @@ -581,7 +581,7 @@ struct lib9p_msg_Tremove { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 11 */ +/* size = 11 ; max_iov = 1 ; max_copy = 11 */ struct lib9p_msg_Tstat { lib9p_tag_t tag; lib9p_fid_t fid; @@ -589,26 +589,26 @@ struct lib9p_msg_Tstat { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L -/* size = 11 */ +/* size = 11 ; max_iov = 1 ; max_copy = 11 */ struct lib9p_msg_Tstatfs { lib9p_tag_t tag; lib9p_fid_t fid; }; -/* size = 15 */ +/* size = 15 ; max_iov = 1 ; max_copy = 15 */ struct lib9p_msg_Tlopen { lib9p_tag_t tag; lib9p_fid_t fid; uint32_t flags; }; -/* size = 11 */ +/* size = 11 ; max_iov = 1 ; max_copy = 11 */ struct lib9p_msg_Treadlink { lib9p_tag_t tag; lib9p_fid_t fid; }; -/* size = 23 */ +/* size = 23 ; max_iov = 1 ; max_copy = 23 */ struct lib9p_msg_Treaddir { lib9p_tag_t tag; lib9p_fid_t fid; @@ -616,7 +616,7 @@ struct lib9p_msg_Treaddir { uint32_t count; }; -/* size = 15 */ +/* size = 15 ; max_iov = 1 ; max_copy = 15 */ struct lib9p_msg_Tfsync { lib9p_tag_t tag; lib9p_fid_t fid; @@ -625,25 +625,25 @@ struct lib9p_msg_Tfsync { #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* min_size = 13 ; max_size = 65,548 */ +/* min_size = 13 ; exp_size = 40 ; max_size = 65,548 ; max_iov = 2 ; max_copy = 13 */ struct lib9p_msg_Tversion { lib9p_tag_t tag; uint32_t max_msg_size; struct lib9p_s version; }; -/* min_size = 13 ; max_size = 65,548 */ +/* min_size = 13 ; exp_size = 40 ; max_size = 65,548 ; max_iov = 2 ; max_copy = 13 */ struct lib9p_msg_Rversion { lib9p_tag_t tag; uint32_t max_msg_size; struct lib9p_s version; }; -/* LIB9P_VER_9P2000 : min_size = 9 ; max_size = 65,544 */ -/* LIB9P_VER_9P2000_L : min_size = 9 ; max_size = 65,544 */ -/* LIB9P_VER_9P2000_e : min_size = 9 ; max_size = 65,544 */ -/* LIB9P_VER_9P2000_p9p: min_size = 9 ; max_size = 65,544 */ -/* LIB9P_VER_9P2000_u : min_size = 13 ; max_size = 65,548 */ +/* LIB9P_VER_9P2000 : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */ +/* LIB9P_VER_9P2000_L : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */ +/* LIB9P_VER_9P2000_e : min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */ +/* LIB9P_VER_9P2000_p9p: min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */ +/* LIB9P_VER_9P2000_u : min_size = 13 ; exp_size = 40 ; max_size = 65,548 ; max_iov = 3 ; max_copy = 13 */ struct lib9p_msg_Rerror { lib9p_tag_t tag; struct lib9p_s ename; @@ -652,7 +652,7 @@ struct lib9p_msg_Rerror { #endif /* CONFIG_9P_ENABLE_9P2000_u */ }; -/* min_size = 17 ; max_size = 1,048,609 */ +/* min_size = 17 ; exp_size = 481 ; max_size = 1,048,609 ; max_iov = 32 ; max_copy = 49 */ struct lib9p_msg_Twalk { lib9p_tag_t tag; lib9p_fid_t fid; @@ -663,7 +663,7 @@ struct lib9p_msg_Twalk { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L -/* min_size = 17 ; max_size = 65,552 */ +/* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 2 ; max_copy = 17 */ struct lib9p_msg_Trename { lib9p_tag_t tag; lib9p_fid_t fid; @@ -671,13 +671,13 @@ struct lib9p_msg_Trename { struct lib9p_s name; }; -/* min_size = 9 ; max_size = 65,544 */ +/* min_size = 9 ; exp_size = 36 ; max_size = 65,544 ; max_iov = 2 ; max_copy = 9 */ struct lib9p_msg_Rreadlink { lib9p_tag_t tag; struct lib9p_s target; }; -/* min_size = 17 ; max_size = 65,552 */ +/* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 2 ; max_copy = 17 */ struct lib9p_msg_Txattrwalk { lib9p_tag_t tag; lib9p_fid_t fid; @@ -685,7 +685,7 @@ struct lib9p_msg_Txattrwalk { struct lib9p_s name; }; -/* min_size = 25 ; max_size = 65,560 */ +/* min_size = 25 ; exp_size = 52 ; max_size = 65,560 ; max_iov = 3 ; max_copy = 25 */ struct lib9p_msg_Txattrcreate { lib9p_tag_t tag; lib9p_fid_t fid; @@ -694,7 +694,7 @@ struct lib9p_msg_Txattrcreate { uint32_t flags; }; -/* min_size = 34 ; max_size = 65,569 */ +/* min_size = 34 ; exp_size = 61 ; max_size = 65,569 ; max_iov = 2 ; max_copy = 34 */ struct lib9p_msg_Tgetlock { lib9p_tag_t tag; lib9p_fid_t fid; @@ -705,7 +705,7 @@ struct lib9p_msg_Tgetlock { struct lib9p_s client_id; }; -/* min_size = 30 ; max_size = 65,565 */ +/* min_size = 30 ; exp_size = 57 ; max_size = 65,565 ; max_iov = 2 ; max_copy = 30 */ struct lib9p_msg_Rgetlock { lib9p_tag_t tag; uint8_t type; @@ -715,7 +715,7 @@ struct lib9p_msg_Rgetlock { struct lib9p_s client_id; }; -/* min_size = 17 ; max_size = 65,552 */ +/* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 2 ; max_copy = 17 */ struct lib9p_msg_Tlink { lib9p_tag_t tag; lib9p_fid_t dfid; @@ -723,7 +723,7 @@ struct lib9p_msg_Tlink { struct lib9p_s name; }; -/* min_size = 19 ; max_size = 131,089 */ +/* min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 4 ; max_copy = 19 */ struct lib9p_msg_Trenameat { lib9p_tag_t tag; lib9p_fid_t olddirfid; @@ -732,7 +732,7 @@ struct lib9p_msg_Trenameat { struct lib9p_s newname; }; -/* min_size = 17 ; max_size = 65,552 */ +/* min_size = 17 ; exp_size = 44 ; max_size = 65,552 ; max_iov = 3 ; max_copy = 17 */ struct lib9p_msg_Tunlinkat { lib9p_tag_t tag; lib9p_fid_t dirfd; @@ -742,7 +742,7 @@ struct lib9p_msg_Tunlinkat { #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000_e -/* min_size = 13 ; max_size = 4,294,967,308 (warning: >UINT32_MAX) */ +/* min_size = 13 ; exp_size = 477 ; max_size = 4,294,967,308 (warning: >UINT32_MAX) ; max_iov = 131,070 ; max_copy = 131,083 */ struct lib9p_msg_Tsread { lib9p_tag_t tag; uint32_t fid; @@ -750,7 +750,7 @@ struct lib9p_msg_Tsread { struct lib9p_s *wname; }; -/* min_size = 17 ; max_size = 8,589,934,607 (warning: >UINT32_MAX) */ +/* min_size = 17 ; exp_size = 8,673 ; max_size = 8,589,934,607 (warning: >UINT32_MAX) ; max_iov = 131,072 ; max_copy = 131,087 */ struct lib9p_msg_Tswrite { lib9p_tag_t tag; uint32_t fid; @@ -762,18 +762,18 @@ struct lib9p_msg_Tswrite { #endif /* CONFIG_9P_ENABLE_9P2000_e */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 13 */ +/* size = 13 ; max_iov = 1 ; max_copy = 13 */ struct lib9p_qid { lib9p_qt_t type; uint32_t vers; uint64_t path; }; -/* LIB9P_VER_9P2000 : min_size = 15 ; max_size = 131,085 */ -/* LIB9P_VER_9P2000_L : min_size = 19 ; max_size = 131,089 */ -/* LIB9P_VER_9P2000_e : min_size = 15 ; max_size = 131,085 */ -/* LIB9P_VER_9P2000_p9p: min_size = 15 ; max_size = 131,085 */ -/* LIB9P_VER_9P2000_u : min_size = 19 ; max_size = 131,089 */ +/* LIB9P_VER_9P2000 : min_size = 15 ; exp_size = 69 ; max_size = 131,085 ; max_iov = 4 ; max_copy = 15 */ +/* LIB9P_VER_9P2000_L : min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 5 ; max_copy = 19 */ +/* LIB9P_VER_9P2000_e : min_size = 15 ; exp_size = 69 ; max_size = 131,085 ; max_iov = 4 ; max_copy = 15 */ +/* LIB9P_VER_9P2000_p9p: min_size = 15 ; exp_size = 69 ; max_size = 131,085 ; max_iov = 4 ; max_copy = 15 */ +/* LIB9P_VER_9P2000_u : min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 5 ; max_copy = 19 */ struct lib9p_msg_Tauth { lib9p_tag_t tag; lib9p_fid_t afid; @@ -784,11 +784,11 @@ struct lib9p_msg_Tauth { #endif /* CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u */ }; -/* LIB9P_VER_9P2000 : min_size = 19 ; max_size = 131,089 */ -/* LIB9P_VER_9P2000_L : min_size = 23 ; max_size = 131,093 */ -/* LIB9P_VER_9P2000_e : min_size = 19 ; max_size = 131,089 */ -/* LIB9P_VER_9P2000_p9p: min_size = 19 ; max_size = 131,089 */ -/* LIB9P_VER_9P2000_u : min_size = 23 ; max_size = 131,093 */ +/* LIB9P_VER_9P2000 : min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 4 ; max_copy = 19 */ +/* LIB9P_VER_9P2000_L : min_size = 23 ; exp_size = 77 ; max_size = 131,093 ; max_iov = 5 ; max_copy = 23 */ +/* LIB9P_VER_9P2000_e : min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 4 ; max_copy = 19 */ +/* LIB9P_VER_9P2000_p9p: min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 4 ; max_copy = 19 */ +/* LIB9P_VER_9P2000_u : min_size = 23 ; exp_size = 77 ; max_size = 131,093 ; max_iov = 5 ; max_copy = 23 */ struct lib9p_msg_Tattach { lib9p_tag_t tag; lib9p_fid_t fid; @@ -802,7 +802,7 @@ struct lib9p_msg_Tattach { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L -/* min_size = 25 ; max_size = 65,560 */ +/* min_size = 25 ; exp_size = 52 ; max_size = 65,560 ; max_iov = 3 ; max_copy = 25 */ struct lib9p_msg_Tlcreate { lib9p_tag_t tag; lib9p_fid_t fid; @@ -812,7 +812,7 @@ struct lib9p_msg_Tlcreate { lib9p_nuid_t gid; }; -/* min_size = 19 ; max_size = 131,089 */ +/* min_size = 19 ; exp_size = 73 ; max_size = 131,089 ; max_iov = 5 ; max_copy = 19 */ struct lib9p_msg_Tsymlink { lib9p_tag_t tag; lib9p_fid_t fid; @@ -821,7 +821,7 @@ struct lib9p_msg_Tsymlink { lib9p_nuid_t gid; }; -/* min_size = 29 ; max_size = 65,564 */ +/* min_size = 29 ; exp_size = 56 ; max_size = 65,564 ; max_iov = 3 ; max_copy = 29 */ struct lib9p_msg_Tmknod { lib9p_tag_t tag; lib9p_fid_t dfid; @@ -832,7 +832,7 @@ struct lib9p_msg_Tmknod { lib9p_nuid_t gid; }; -/* min_size = 21 ; max_size = 65,556 */ +/* min_size = 21 ; exp_size = 48 ; max_size = 65,556 ; max_iov = 3 ; max_copy = 21 */ struct lib9p_msg_Tmkdir { lib9p_tag_t tag; lib9p_fid_t dfid; @@ -843,14 +843,14 @@ struct lib9p_msg_Tmkdir { #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 12 */ +/* size = 12 ; max_iov = 1 ; max_copy = 12 */ struct lib9p_msg_Topen { lib9p_tag_t tag; lib9p_fid_t fid; lib9p_o_t mode; }; -/* min_size = 18 ; max_size = 65,553 */ +/* min_size = 18 ; exp_size = 45 ; max_size = 65,553 ; max_iov = 3 ; max_copy = 18 */ struct lib9p_msg_Tcreate { lib9p_tag_t tag; lib9p_fid_t fid; @@ -861,7 +861,7 @@ struct lib9p_msg_Tcreate { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_p9p -/* size = 12 */ +/* size = 12 ; max_iov = 1 ; max_copy = 12 */ struct lib9p_msg_Topenfd { lib9p_tag_t tag; lib9p_fid_t fid; @@ -870,14 +870,14 @@ struct lib9p_msg_Topenfd { #endif /* CONFIG_9P_ENABLE_9P2000_p9p */ #if CONFIG_9P_ENABLE_9P2000_L -/* size = 19 */ +/* size = 19 ; max_iov = 1 ; max_copy = 19 */ struct lib9p_msg_Tgetattr { lib9p_tag_t tag; lib9p_fid_t fid; lib9p_getattr_t request_mask; }; -/* size = 67 */ +/* size = 67 ; max_iov = 1 ; max_copy = 67 */ struct lib9p_msg_Tsetattr { lib9p_tag_t tag; lib9p_fid_t fid; @@ -892,7 +892,7 @@ struct lib9p_msg_Tsetattr { uint64_t mtime_nsec; }; -/* min_size = 38 ; max_size = 65,573 */ +/* min_size = 38 ; exp_size = 65 ; max_size = 65,573 ; max_iov = 2 ; max_copy = 38 */ struct lib9p_msg_Tlock { lib9p_tag_t tag; lib9p_fid_t fid; @@ -904,7 +904,7 @@ struct lib9p_msg_Tlock { struct lib9p_s client_id; }; -/* size = 8 */ +/* size = 8 ; max_iov = 1 ; max_copy = 8 */ struct lib9p_msg_Rlock { lib9p_tag_t tag; lib9p_lock_status_t status; @@ -912,10 +912,10 @@ struct lib9p_msg_Rlock { #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* LIB9P_VER_9P2000 : min_size = 49 ; max_size = 262,189 */ -/* LIB9P_VER_9P2000_e : min_size = 49 ; max_size = 262,189 */ -/* LIB9P_VER_9P2000_p9p: min_size = 49 ; max_size = 262,189 */ -/* LIB9P_VER_9P2000_u : min_size = 63 ; max_size = 327,738 */ +/* LIB9P_VER_9P2000 : min_size = 49 ; exp_size = 157 ; max_size = 262,189 ; max_iov = 8 ; max_copy = 49 */ +/* LIB9P_VER_9P2000_e : min_size = 49 ; exp_size = 157 ; max_size = 262,189 ; max_iov = 8 ; max_copy = 49 */ +/* LIB9P_VER_9P2000_p9p: min_size = 49 ; exp_size = 157 ; max_size = 262,189 ; max_iov = 8 ; max_copy = 49 */ +/* LIB9P_VER_9P2000_u : min_size = 63 ; exp_size = 198 ; max_size = 327,738 ; max_iov = 11 ; max_copy = 63 */ struct lib9p_stat { uint16_t kern_type; uint32_t kern_dev; @@ -938,19 +938,19 @@ struct lib9p_stat { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 20 */ +/* size = 20 ; max_iov = 1 ; max_copy = 20 */ struct lib9p_msg_Rauth { lib9p_tag_t tag; struct lib9p_qid aqid; }; -/* size = 20 */ +/* size = 20 ; max_iov = 1 ; max_copy = 20 */ struct lib9p_msg_Rattach { lib9p_tag_t tag; struct lib9p_qid qid; }; -/* min_size = 9 ; max_size = 217 */ +/* min_size = 9 ; exp_size = 217 ; max_size = 217 ; max_iov = 1 ; max_copy = 217 */ struct lib9p_msg_Rwalk { lib9p_tag_t tag; uint16_t nwqid; @@ -959,14 +959,14 @@ struct lib9p_msg_Rwalk { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* size = 24 */ +/* size = 24 ; max_iov = 1 ; max_copy = 24 */ struct lib9p_msg_Ropen { lib9p_tag_t tag; struct lib9p_qid qid; uint32_t iounit; }; -/* size = 24 */ +/* size = 24 ; max_iov = 1 ; max_copy = 24 */ struct lib9p_msg_Rcreate { lib9p_tag_t tag; struct lib9p_qid qid; @@ -975,7 +975,7 @@ struct lib9p_msg_Rcreate { #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_p9p -/* size = 28 */ +/* size = 28 ; max_iov = 1 ; max_copy = 28 */ struct lib9p_msg_Ropenfd { lib9p_tag_t tag; struct lib9p_qid qid; @@ -985,33 +985,33 @@ struct lib9p_msg_Ropenfd { #endif /* CONFIG_9P_ENABLE_9P2000_p9p */ #if CONFIG_9P_ENABLE_9P2000_L -/* size = 24 */ +/* size = 24 ; max_iov = 1 ; max_copy = 24 */ struct lib9p_msg_Rlopen { lib9p_tag_t tag; struct lib9p_qid qid; uint32_t iounit; }; -/* size = 24 */ +/* size = 24 ; max_iov = 1 ; max_copy = 24 */ struct lib9p_msg_Rlcreate { lib9p_tag_t tag; struct lib9p_qid qid; uint32_t iounit; }; -/* size = 20 */ +/* size = 20 ; max_iov = 1 ; max_copy = 20 */ struct lib9p_msg_Rsymlink { lib9p_tag_t tag; struct lib9p_qid qid; }; -/* size = 20 */ +/* size = 20 ; max_iov = 1 ; max_copy = 20 */ struct lib9p_msg_Rmknod { lib9p_tag_t tag; struct lib9p_qid qid; }; -/* size = 160 */ +/* size = 160 ; max_iov = 1 ; max_copy = 160 */ struct lib9p_msg_Rgetattr { lib9p_tag_t tag; uint64_t valid; @@ -1036,7 +1036,7 @@ struct lib9p_msg_Rgetattr { uint64_t data_version; }; -/* size = 20 */ +/* size = 20 ; max_iov = 1 ; max_copy = 20 */ struct lib9p_msg_Rmkdir { lib9p_tag_t tag; struct lib9p_qid qid; @@ -1044,22 +1044,52 @@ struct lib9p_msg_Rmkdir { #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u -/* LIB9P_VER_9P2000 : min_size = 58 ; max_size = 262,198 */ -/* LIB9P_VER_9P2000_e : min_size = 58 ; max_size = 262,198 */ -/* LIB9P_VER_9P2000_p9p: min_size = 58 ; max_size = 262,198 */ -/* LIB9P_VER_9P2000_u : min_size = 72 ; max_size = 327,747 */ +/* LIB9P_VER_9P2000 : min_size = 58 ; exp_size = 166 ; max_size = 262,198 ; max_iov = 8 ; max_copy = 58 */ +/* LIB9P_VER_9P2000_e : min_size = 58 ; exp_size = 166 ; max_size = 262,198 ; max_iov = 8 ; max_copy = 58 */ +/* LIB9P_VER_9P2000_p9p: min_size = 58 ; exp_size = 166 ; max_size = 262,198 ; max_iov = 8 ; max_copy = 58 */ +/* LIB9P_VER_9P2000_u : min_size = 72 ; exp_size = 207 ; max_size = 327,747 ; max_iov = 11 ; max_copy = 72 */ struct lib9p_msg_Rstat { lib9p_tag_t tag; struct lib9p_stat stat; }; -/* LIB9P_VER_9P2000 : min_size = 62 ; max_size = 262,202 */ -/* LIB9P_VER_9P2000_e : min_size = 62 ; max_size = 262,202 */ -/* LIB9P_VER_9P2000_p9p: min_size = 62 ; max_size = 262,202 */ -/* LIB9P_VER_9P2000_u : min_size = 76 ; max_size = 327,751 */ +/* LIB9P_VER_9P2000 : min_size = 62 ; exp_size = 170 ; max_size = 262,202 ; max_iov = 8 ; max_copy = 62 */ +/* LIB9P_VER_9P2000_e : min_size = 62 ; exp_size = 170 ; max_size = 262,202 ; max_iov = 8 ; max_copy = 62 */ +/* LIB9P_VER_9P2000_p9p: min_size = 62 ; exp_size = 170 ; max_size = 262,202 ; max_iov = 8 ; max_copy = 62 */ +/* LIB9P_VER_9P2000_u : min_size = 76 ; exp_size = 211 ; max_size = 327,751 ; max_iov = 11 ; max_copy = 76 */ struct lib9p_msg_Twstat { lib9p_tag_t tag; lib9p_fid_t fid; struct lib9p_stat stat; }; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ + +/* sizes **********************************************************************/ + +#if CONFIG_9P_ENABLE_9P2000_e + #define LIB9P_TMSG_MAX_IOV 131072 +#elif CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u + #define LIB9P_TMSG_MAX_IOV 32 +#endif + +#if CONFIG_9P_ENABLE_9P2000_e + #define LIB9P_TMSG_MAX_COPY 131087 +#elif CONFIG_9P_ENABLE_9P2000_u + #define LIB9P_TMSG_MAX_COPY 76 +#elif CONFIG_9P_ENABLE_9P2000_L + #define LIB9P_TMSG_MAX_COPY 67 +#elif CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_p9p + #define LIB9P_TMSG_MAX_COPY 62 +#endif + +#if CONFIG_9P_ENABLE_9P2000_u + #define LIB9P_RMSG_MAX_IOV 11 +#elif CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p + #define LIB9P_RMSG_MAX_IOV 8 +#elif CONFIG_9P_ENABLE_9P2000_L + #define LIB9P_RMSG_MAX_IOV 2 +#endif + +#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u + #define LIB9P_RMSG_MAX_COPY 217 +#endif -- cgit v1.2.3-2-g168b From 1793bda7f3e445c5ad81cf108589f8b1edcda4eb Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" <lukeshu@lukeshu.com> Date: Fri, 17 Jan 2025 20:30:41 -0700 Subject: lib9p: idl.gen: Enforce a max WELEM for 9P2000.e --- lib9p/include/lib9p/9p.generated.h | 47 +++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 13 deletions(-) (limited to 'lib9p/include') diff --git a/lib9p/include/lib9p/9p.generated.h b/lib9p/include/lib9p/9p.generated.h index e3f4d01..881d2e3 100644 --- a/lib9p/include/lib9p/9p.generated.h +++ b/lib9p/include/lib9p/9p.generated.h @@ -20,6 +20,13 @@ #ifndef CONFIG_9P_ENABLE_9P2000_e #error config.h must define CONFIG_9P_ENABLE_9P2000_e +#else + #if CONFIG_9P_ENABLE_9P2000_e + #ifndef(CONFIG_9P_MAX_9P2000_e_WELEM) + #error if CONFIG_9P_ENABLE_9P2000_e then config.h must define CONFIG_9P_MAX_9P2000_e_WELEM + #endif + static_assert(CONFIG_9P_MAX_9P2000_e_WELEM > 0); + #endif #endif #ifndef CONFIG_9P_ENABLE_9P2000_p9p @@ -742,7 +749,7 @@ struct lib9p_msg_Tunlinkat { #endif /* CONFIG_9P_ENABLE_9P2000_L */ #if CONFIG_9P_ENABLE_9P2000_e -/* min_size = 13 ; exp_size = 477 ; max_size = 4,294,967,308 (warning: >UINT32_MAX) ; max_iov = 131,070 ; max_copy = 131,083 */ +/* min_size = 13 ; exp_size = 477 ; max_size = 4,294,967,308 (warning: >UINT32_MAX) ; max_iov = 0 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2) ; max_copy = 13 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2) */ struct lib9p_msg_Tsread { lib9p_tag_t tag; uint32_t fid; @@ -750,7 +757,7 @@ struct lib9p_msg_Tsread { struct lib9p_s *wname; }; -/* min_size = 17 ; exp_size = 8,673 ; max_size = 8,589,934,607 (warning: >UINT32_MAX) ; max_iov = 131,072 ; max_copy = 131,087 */ +/* min_size = 17 ; exp_size = 8,673 ; max_size = 8,589,934,607 (warning: >UINT32_MAX) ; max_iov = 2 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2) ; max_copy = 17 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2) */ struct lib9p_msg_Tswrite { lib9p_tag_t tag; uint32_t fid; @@ -1066,20 +1073,34 @@ struct lib9p_msg_Twstat { /* sizes **********************************************************************/ -#if CONFIG_9P_ENABLE_9P2000_e - #define LIB9P_TMSG_MAX_IOV 131072 -#elif CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u - #define LIB9P_TMSG_MAX_IOV 32 +#define _LIB9P_MAX(a, b) ((a) > (b)) ? (a) : (b) + +#if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u + #if CONFIG_9P_ENABLE_9P2000_e + #define LIB9P_TMSG_MAX_IOV _LIB9P_MAX(32, 2 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2)) + #else + #define LIB9P_TMSG_MAX_IOV 32 + #endif #endif -#if CONFIG_9P_ENABLE_9P2000_e - #define LIB9P_TMSG_MAX_COPY 131087 -#elif CONFIG_9P_ENABLE_9P2000_u - #define LIB9P_TMSG_MAX_COPY 76 +#if CONFIG_9P_ENABLE_9P2000_u + #if CONFIG_9P_ENABLE_9P2000_e + #define LIB9P_TMSG_MAX_COPY _LIB9P_MAX(76, 17 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2)) + #else + #define LIB9P_TMSG_MAX_COPY 76 + #endif #elif CONFIG_9P_ENABLE_9P2000_L - #define LIB9P_TMSG_MAX_COPY 67 -#elif CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_p9p - #define LIB9P_TMSG_MAX_COPY 62 + #if CONFIG_9P_ENABLE_9P2000_e + #define LIB9P_TMSG_MAX_COPY _LIB9P_MAX(67, 17 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2)) + #else + #define LIB9P_TMSG_MAX_COPY 67 + #endif +#elif CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p + #if CONFIG_9P_ENABLE_9P2000_e + #define LIB9P_TMSG_MAX_COPY _LIB9P_MAX(62, 17 + (CONFIG_9P_MAX_9P2000_e_WELEM * 2)) + #else + #define LIB9P_TMSG_MAX_COPY 62 + #endif #endif #if CONFIG_9P_ENABLE_9P2000_u -- cgit v1.2.3-2-g168b From a24a60232204702fe245c312edb0c2c8041b17a8 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" <lukeshu@lukeshu.com> Date: Mon, 13 Jan 2025 23:20:13 -0700 Subject: lib9p: Rewrite the marshalers to support zero-copy for data --- lib9p/include/lib9p/9p.generated.h | 16 +++++++++++++++- lib9p/include/lib9p/9p.h | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'lib9p/include') diff --git a/lib9p/include/lib9p/9p.generated.h b/lib9p/include/lib9p/9p.generated.h index 881d2e3..d34a0f6 100644 --- a/lib9p/include/lib9p/9p.generated.h +++ b/lib9p/include/lib9p/9p.generated.h @@ -6,6 +6,8 @@ #include <stdint.h> /* for uint{n}_t types */ +#include <libhw/generic/net.h> /* for struct iovec */ + /* config *********************************************************************/ #include "config.h" @@ -1071,7 +1073,7 @@ struct lib9p_msg_Twstat { }; #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ -/* sizes **********************************************************************/ +/* containers *****************************************************************/ #define _LIB9P_MAX(a, b) ((a) > (b)) ? (a) : (b) @@ -1114,3 +1116,15 @@ struct lib9p_msg_Twstat { #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u #define LIB9P_RMSG_MAX_COPY 217 #endif + +struct lib9p_Tmsg_send_buf { + size_t iov_cnt; + struct iovec iov[LIB9P_TMSG_MAX_IOV]; + uint8_t copied[LIB9P_TMSG_MAX_COPY]; +}; + +struct lib9p_Rmsg_send_buf { + size_t iov_cnt; + struct iovec iov[LIB9P_RMSG_MAX_IOV]; + uint8_t copied[LIB9P_RMSG_MAX_COPY]; +}; diff --git a/lib9p/include/lib9p/9p.h b/lib9p/include/lib9p/9p.h index d4764a2..68e007f 100644 --- a/lib9p/include/lib9p/9p.h +++ b/lib9p/include/lib9p/9p.h @@ -118,7 +118,7 @@ void lib9p_Tmsg_unmarshal(struct lib9p_ctx *ctx, uint8_t *net_bytes, * @errno LINUX_ERANGE: reply does not fit in ctx->max_msg_size */ bool lib9p_Tmsg_marshal(struct lib9p_ctx *ctx, enum lib9p_msg_type typ, void *body, - uint8_t *ret_bytes); + struct lib9p_Tmsg_send_buf *ret); /* main R-message functions ***************************************************/ @@ -128,7 +128,7 @@ ssize_t lib9p_Rmsg_validate(struct lib9p_ctx *ctx, uint8_t *net_bytes); void lib9p_Rmsg_unmarshal(struct lib9p_ctx *ctx, uint8_t *net_bytes, enum lib9p_msg_type *ret_typ, void *ret_body); bool lib9p_Rmsg_marshal(struct lib9p_ctx *ctx, enum lib9p_msg_type typ, void *body, - uint8_t *ret_bytes); + struct lib9p_Rmsg_send_buf *ret); /* `struct lib9p_stat` helpers ************************************************/ -- cgit v1.2.3-2-g168b