@@ -145,6 +145,8 @@ typedef struct {
145
145
146
146
int skip_frag ;
147
147
148
+ fd_shred_dest_weighted_t adtl_dest [1 ];
149
+
148
150
fd_ip4_udp_hdrs_t data_shred_net_hdr [1 ];
149
151
fd_ip4_udp_hdrs_t parity_shred_net_hdr [1 ];
150
152
@@ -509,12 +511,10 @@ during_frag( fd_shred_ctx_t * ctx,
509
511
}
510
512
511
513
static inline void
512
- send_shred ( fd_shred_ctx_t * ctx ,
513
- fd_shred_t const * shred ,
514
- fd_shred_dest_t * sdest ,
515
- fd_shred_dest_idx_t dest_idx ,
516
- ulong tsorig ) {
517
- fd_shred_dest_weighted_t * dest = fd_shred_dest_idx_to_dest ( sdest , dest_idx );
514
+ send_shred ( fd_shred_ctx_t * ctx ,
515
+ fd_shred_t const * shred ,
516
+ fd_shred_dest_weighted_t const * dest ,
517
+ ulong tsorig ) {
518
518
519
519
if ( FD_UNLIKELY ( !dest -> ip4 ) ) return ;
520
520
@@ -646,7 +646,8 @@ after_frag( fd_shred_ctx_t * ctx,
646
646
fd_shred_dest_idx_t * dests = fd_shred_dest_compute_children ( sdest , & shred , 1UL , ctx -> scratchpad_dests , 1UL , fanout , fanout , max_dest_cnt );
647
647
if ( FD_UNLIKELY ( !dests ) ) break ;
648
648
649
- for ( ulong j = 0UL ; j < * max_dest_cnt ; j ++ ) send_shred ( ctx , * out_shred , sdest , dests [ j ], ctx -> tsorig );
649
+ send_shred ( ctx , * out_shred , ctx -> adtl_dest , ctx -> tsorig );
650
+ for ( ulong j = 0UL ; j < * max_dest_cnt ; j ++ ) send_shred ( ctx , * out_shred , fd_shred_dest_idx_to_dest ( sdest , dests [ j ]), ctx -> tsorig );
650
651
} while ( 0 );
651
652
652
653
if ( FD_LIKELY ( ctx -> blockstore && rv == FD_FEC_RESOLVER_SHRED_OKAY ) ) { /* optimize for the compiler - branch predictor will still be correct */
@@ -763,7 +764,10 @@ after_frag( fd_shred_ctx_t * ctx,
763
764
if ( FD_UNLIKELY ( !dests ) ) return ;
764
765
765
766
/* Send only the ones we didn't receive. */
766
- for ( ulong i = 0UL ; i < k ; i ++ ) for ( ulong j = 0UL ; j < * max_dest_cnt ; j ++ ) send_shred ( ctx , new_shreds [ i ], sdest , dests [ j * out_stride + i ], ctx -> tsorig );
767
+ for ( ulong i = 0UL ; i < k ; i ++ ) {
768
+ send_shred ( ctx , new_shreds [ i ], ctx -> adtl_dest , ctx -> tsorig );
769
+ for ( ulong j = 0UL ; j < * max_dest_cnt ; j ++ ) send_shred ( ctx , new_shreds [ i ], fd_shred_dest_idx_to_dest ( sdest , dests [ j * out_stride + i ]), ctx -> tsorig );
770
+ }
767
771
}
768
772
769
773
static void
@@ -921,6 +925,9 @@ unprivileged_init( fd_topo_t * topo,
921
925
fd_ip4_udp_hdr_init ( ctx -> data_shred_net_hdr , FD_SHRED_MIN_SZ , 0 , tile -> shred .shred_listen_port );
922
926
fd_ip4_udp_hdr_init ( ctx -> parity_shred_net_hdr , FD_SHRED_MAX_SZ , 0 , tile -> shred .shred_listen_port );
923
927
928
+ ctx -> adtl_dest -> ip4 = tile -> shred .adtl_dest .ip ;
929
+ ctx -> adtl_dest -> port = tile -> shred .adtl_dest .port ;
930
+
924
931
for ( ulong i = 0UL ; i < tile -> in_cnt ; i ++ ) {
925
932
fd_topo_link_t const * link = & topo -> links [ tile -> in_link_id [ i ] ];
926
933
fd_topo_wksp_t const * link_wksp = & topo -> workspaces [ topo -> objs [ link -> dcache_obj_id ].wksp_id ];
0 commit comments