|
11 | 11 | #include <linux/unistd.h>
|
12 | 12 | #include <sys/random.h>
|
13 | 13 |
|
| 14 | +#define OUT_IDX_VERIFY 0 |
| 15 | +#define OUT_IDX_NET 1 |
| 16 | + |
14 | 17 | /* fd_quic_tile provides a TPU server tile.
|
15 | 18 |
|
16 | 19 | This tile handles incoming transactions that clients request to be
|
@@ -89,14 +92,6 @@ legacy_stream_notify( fd_quic_ctx_t * ctx,
|
89 | 92 | }
|
90 | 93 | }
|
91 | 94 |
|
92 |
| -/* Because of the separate mcache for publishing network fragments |
93 |
| - back to networking tiles, which is not managed by fd_stem, we |
94 |
| - need to periodically update the sync. */ |
95 |
| -static void |
96 |
| -during_housekeeping( fd_quic_ctx_t * ctx ) { |
97 |
| - fd_mcache_seq_update( ctx->net_out_sync, ctx->net_out_seq ); |
98 |
| -} |
99 |
| - |
100 | 95 | /* This tile always publishes messages downstream, even if there are
|
101 | 96 | no credits available. It ignores the flow control of the downstream
|
102 | 97 | verify tile. This is OK as the verify tile is written to expect
|
@@ -409,19 +404,11 @@ quic_tx_aio_send( void * _ctx,
|
409 | 404 | just indicate where they came from so they don't bounce back */
|
410 | 405 | ulong sig = fd_disco_netmux_sig( ip_dst, 0U, ip_dst, DST_PROTO_OUTGOING, FD_NETMUX_SIG_MIN_HDR_SZ );
|
411 | 406 |
|
412 |
| - long tspub = fd_tickcount(); |
413 |
| - fd_mcache_publish( ctx->net_out_mcache, |
414 |
| - ctx->net_out_depth, |
415 |
| - ctx->net_out_seq, |
416 |
| - sig, |
417 |
| - ctx->net_out_chunk, |
418 |
| - sz_l2, |
419 |
| - fd_frag_meta_ctl( 0UL, 1, 1, 0 ), |
420 |
| - 0, |
421 |
| - fd_frag_meta_ts_comp( tspub ) ); |
422 |
| - |
423 |
| - ctx->net_out_seq = fd_seq_inc( ctx->net_out_seq, 1UL ); |
424 |
| - ctx->net_out_chunk = fd_dcache_compact_next( ctx->net_out_chunk, FD_NET_MTU, ctx->net_out_chunk0, ctx->net_out_wmark ); |
| 407 | + ulong chunk = ctx->net_out_chunk; |
| 408 | + ulong ctl = fd_frag_meta_ctl( 0UL, 1, 1, 0 ); |
| 409 | + fd_stem_publish( ctx->stem, OUT_IDX_NET, sig, chunk, sz_l2, ctl, 0L, 0L ); |
| 410 | + |
| 411 | + ctx->net_out_chunk = fd_dcache_compact_next( chunk, FD_NET_MTU, ctx->net_out_chunk0, ctx->net_out_wmark ); |
425 | 412 | }
|
426 | 413 |
|
427 | 414 | if( FD_LIKELY( opt_batch_idx ) ) {
|
@@ -475,8 +462,8 @@ unprivileged_init( fd_topo_t * topo,
|
475 | 462 | }
|
476 | 463 |
|
477 | 464 | if( FD_UNLIKELY( tile->out_cnt!=2UL ||
|
478 |
| - strcmp( topo->links[ tile->out_link_id[ 0UL ] ].name, "quic_verify" ) || |
479 |
| - strcmp( topo->links[ tile->out_link_id[ 1UL ] ].name, "quic_net" ) ) ) |
| 465 | + strcmp( topo->links[ tile->out_link_id[ OUT_IDX_VERIFY ] ].name, "quic_verify" ) || |
| 466 | + strcmp( topo->links[ tile->out_link_id[ OUT_IDX_NET ] ].name, "quic_net" ) ) ) |
480 | 467 | FD_LOG_ERR(( "quic tile has none or unexpected output links %lu %s %s",
|
481 | 468 | tile->out_cnt, topo->links[ tile->out_link_id[ 0 ] ].name, topo->links[ tile->out_link_id[ 1 ] ].name ));
|
482 | 469 |
|
@@ -549,10 +536,6 @@ unprivileged_init( fd_topo_t * topo,
|
549 | 536 |
|
550 | 537 | fd_topo_link_t * net_out = &topo->links[ tile->out_link_id[ 1 ] ];
|
551 | 538 |
|
552 |
| - ctx->net_out_mcache = net_out->mcache; |
553 |
| - ctx->net_out_sync = fd_mcache_seq_laddr( ctx->net_out_mcache ); |
554 |
| - ctx->net_out_depth = fd_mcache_depth( ctx->net_out_mcache ); |
555 |
| - ctx->net_out_seq = fd_mcache_seq_query( ctx->net_out_sync ); |
556 | 539 | ctx->net_out_mem = topo->workspaces[ topo->objs[ net_out->dcache_obj_id ].wksp_id ].wksp;
|
557 | 540 | ctx->net_out_chunk0 = fd_dcache_compact_chunk0( ctx->net_out_mem, net_out->dcache );
|
558 | 541 | ctx->net_out_wmark = fd_dcache_compact_wmark ( ctx->net_out_mem, net_out->dcache, net_out->mtu );
|
@@ -615,12 +598,11 @@ populate_allowed_fds( fd_topo_t const * topo,
|
615 | 598 | #define STEM_CALLBACK_CONTEXT_TYPE fd_quic_ctx_t
|
616 | 599 | #define STEM_CALLBACK_CONTEXT_ALIGN alignof(fd_quic_ctx_t)
|
617 | 600 |
|
618 |
| -#define STEM_CALLBACK_DURING_HOUSEKEEPING during_housekeeping |
619 |
| -#define STEM_CALLBACK_METRICS_WRITE metrics_write |
620 |
| -#define STEM_CALLBACK_BEFORE_CREDIT before_credit |
621 |
| -#define STEM_CALLBACK_BEFORE_FRAG before_frag |
622 |
| -#define STEM_CALLBACK_DURING_FRAG during_frag |
623 |
| -#define STEM_CALLBACK_AFTER_FRAG after_frag |
| 601 | +#define STEM_CALLBACK_METRICS_WRITE metrics_write |
| 602 | +#define STEM_CALLBACK_BEFORE_CREDIT before_credit |
| 603 | +#define STEM_CALLBACK_BEFORE_FRAG before_frag |
| 604 | +#define STEM_CALLBACK_DURING_FRAG during_frag |
| 605 | +#define STEM_CALLBACK_AFTER_FRAG after_frag |
624 | 606 |
|
625 | 607 | #include "../stem/fd_stem.c"
|
626 | 608 |
|
|
0 commit comments