Skip to content

Commit 087240b

Browse files
quic: tx_buf_sz pow2
1 parent 7fbdd6c commit 087240b

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

src/app/shared_dev/commands/bench/fd_benchs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ populate_quic_limits( fd_quic_limits_t * limits ) {
176176
limits->handshake_cnt = limits->conn_cnt;
177177
limits->conn_id_cnt = 16;
178178
limits->inflight_frame_cnt = 1500;
179-
limits->tx_buf_sz = FD_TXN_MTU;
179+
limits->tx_buf_sz = 1UL<<11;
180180
limits->stream_pool_cnt = 1UL<<16;
181181
limits->stream_id_cnt = 1UL<<16;
182182
}

src/discof/send/fd_send_tile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fd_quic_limits_t quic_limits = {
4848
.inflight_frame_cnt = 16UL * MAX_STAKED_LEADERS,
4949
.min_inflight_frame_cnt_conn = 4UL,
5050
.stream_id_cnt = 16UL,
51-
.tx_buf_sz = FD_TXN_MTU,
51+
.tx_buf_sz = 1UL<<11,
5252
.stream_pool_cnt = 2048UL
5353
};
5454

src/waltz/quic/fd_quic_stream.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fd_quic_buffer_load( fd_quic_buffer_t * buf,
7575

7676
if( mtail >= mhead ) {
7777
/* free space split */
78-
ulong end_sz = cap - mhead;
78+
ulong end_sz = cap - mtail;
7979
if( data_sz <= end_sz ) {
8080
/* consists entirely of space at end of buffer */
8181
fd_memcpy( data, raw + mtail, data_sz );
@@ -97,6 +97,8 @@ fd_quic_stream_align( void );
9797

9898
ulong
9999
fd_quic_stream_footprint( ulong tx_buf_sz ) {
100+
if( FD_UNLIKELY( !fd_ulong_is_pow2( tx_buf_sz ) ) ) return 0UL;
101+
100102
ulong align = fd_quic_stream_align();
101103
ulong offs = 0ul;
102104

src/waltz/quic/fd_quic_stream_pool.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ fd_quic_stream_pool_footprint( ulong count, ulong tx_buf_sz ) {
1313
FD_QUIC_STREAM_POOL_ALIGN );
1414

1515
ulong stream_foot = fd_quic_stream_footprint( tx_buf_sz );
16+
if( FD_UNLIKELY( !stream_foot ) ) return 0UL;
1617

1718
return foot + stream_foot * count;
1819
}
@@ -38,6 +39,7 @@ fd_quic_stream_pool_new( void * mem, ulong count, ulong tx_buf_sz ) {
3839
offs += fd_ulong_align_up( sizeof( fd_quic_stream_pool_t ), FD_QUIC_STREAM_POOL_ALIGN );
3940

4041
ulong stream_foot = fd_quic_stream_footprint( tx_buf_sz );
42+
if( FD_UNLIKELY( !stream_foot ) ) { FD_LOG_WARNING(( "stream_foot is 0" )); return NULL; }
4143

4244
FD_QUIC_STREAM_LIST_SENTINEL( pool->head );
4345

src/waltz/quic/tests/test_quic_bw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ main( int argc,
9494
float loss = fd_env_strip_cmdline_float ( &argc, &argv, "--loss", NULL, 0.0f );
9595
float reorder = fd_env_strip_cmdline_float ( &argc, &argv, "--reorder", NULL, 0.0f );
9696
float duration = fd_env_strip_cmdline_float ( &argc, &argv, "--duration", NULL, 10.0f );
97-
ushort sz = fd_env_strip_cmdline_ushort( &argc, &argv, "--sz", NULL, FRAG_SZ );
97+
ushort sz = fd_env_strip_cmdline_ushort( &argc, &argv, "--sz", NULL, 1UL<<10 );
9898
FD_TEST( sz<=FRAG_SZ );
9999

100100
ulong page_sz = fd_cstr_to_shmem_page_sz( _page_sz );

0 commit comments

Comments
 (0)