Line data Source code
1 : #include "topology.h"
2 : #include "config.h"
3 : #include "../shared/boot/fd_boot.h"
4 : #include "../shared/commands/configure/configure.h"
5 : #include "../shared/fd_action.h"
6 :
7 : char const * FD_APP_NAME = "Firedancer";
8 : char const * FD_BINARY_NAME = "firedancer";
9 :
10 : extern fd_topo_obj_callbacks_t fd_obj_cb_mcache;
11 : extern fd_topo_obj_callbacks_t fd_obj_cb_dcache;
12 : extern fd_topo_obj_callbacks_t fd_obj_cb_fseq;
13 : extern fd_topo_obj_callbacks_t fd_obj_cb_metrics;
14 : extern fd_topo_obj_callbacks_t fd_obj_cb_netdev_tbl;
15 : extern fd_topo_obj_callbacks_t fd_obj_cb_neigh4_hmap;
16 : extern fd_topo_obj_callbacks_t fd_obj_cb_keyswitch;
17 : extern fd_topo_obj_callbacks_t fd_obj_cb_node_info;
18 : extern fd_topo_obj_callbacks_t fd_obj_cb_wait_info;
19 : extern fd_topo_obj_callbacks_t fd_obj_cb_execrp_result;
20 : extern fd_topo_obj_callbacks_t fd_obj_cb_leader_txn_timing;
21 : extern fd_topo_obj_callbacks_t fd_obj_cb_tile;
22 : extern fd_topo_obj_callbacks_t fd_obj_cb_store;
23 : extern fd_topo_obj_callbacks_t fd_obj_cb_fec_sets;
24 : extern fd_topo_obj_callbacks_t fd_obj_cb_txncache;
25 : extern fd_topo_obj_callbacks_t fd_obj_cb_accdb;
26 : extern fd_topo_obj_callbacks_t fd_obj_cb_backup;
27 : extern fd_topo_obj_callbacks_t fd_obj_cb_snapin_shmem;
28 : extern fd_topo_obj_callbacks_t fd_obj_cb_banks;
29 : extern fd_topo_obj_callbacks_t fd_obj_cb_progcache;
30 : extern fd_topo_obj_callbacks_t fd_obj_cb_bpf_frames;
31 : extern fd_topo_obj_callbacks_t fd_obj_cb_rnonce_ss;
32 : extern fd_topo_obj_callbacks_t fd_obj_cb_footer_cache;
33 : extern fd_topo_obj_callbacks_t fd_obj_cb_adminctl;
34 : extern fd_topo_obj_callbacks_t fd_obj_cb_sleep;
35 :
36 : fd_topo_obj_callbacks_t * CALLBACKS[] = {
37 : &fd_obj_cb_mcache,
38 : &fd_obj_cb_dcache,
39 : &fd_obj_cb_fseq,
40 : &fd_obj_cb_metrics,
41 : &fd_obj_cb_netdev_tbl,
42 : &fd_obj_cb_neigh4_hmap,
43 : &fd_obj_cb_keyswitch,
44 : &fd_obj_cb_node_info,
45 : &fd_obj_cb_wait_info,
46 : &fd_obj_cb_execrp_result,
47 : &fd_obj_cb_leader_txn_timing,
48 : &fd_obj_cb_tile,
49 : &fd_obj_cb_store,
50 : &fd_obj_cb_fec_sets,
51 : &fd_obj_cb_txncache,
52 : &fd_obj_cb_accdb,
53 : &fd_obj_cb_backup,
54 : &fd_obj_cb_snapin_shmem,
55 : &fd_obj_cb_banks,
56 : &fd_obj_cb_progcache,
57 : &fd_obj_cb_bpf_frames,
58 : &fd_obj_cb_rnonce_ss,
59 : &fd_obj_cb_footer_cache,
60 : &fd_obj_cb_adminctl,
61 : &fd_obj_cb_sleep,
62 : NULL,
63 : };
64 :
65 : configure_stage_t * STAGES[] = {
66 : &fd_cfg_stage_mlx5,
67 : &fd_cfg_stage_iavf,
68 : &fd_cfg_stage_hugetlbfs,
69 : &fd_cfg_stage_sysctl,
70 : &fd_cfg_stage_hyperthreads,
71 : &fd_cfg_stage_bonding,
72 : &fd_cfg_stage_ethtool_channels,
73 : &fd_cfg_stage_ethtool_offloads,
74 : &fd_cfg_stage_ethtool_loopback,
75 : &fd_cfg_stage_irq_balance,
76 : &fd_cfg_stage_irq_affinity,
77 : &fd_cfg_stage_sysfs_poll,
78 : &fd_cfg_stage_kworkers,
79 : &fd_cfg_stage_cpuset,
80 : &fd_cfg_stage_nohz_full,
81 : &fd_cfg_stage_rcu_nocbs,
82 : &fd_cfg_stage_console,
83 : &fd_cfg_stage_snapshots,
84 : NULL,
85 : };
86 :
87 : FD_STATIC_ASSERT( sizeof(STAGES)/sizeof(STAGES[0])<=CONFIGURE_STAGE_COUNT, stage_array_larger_than_configure_stage_count );
88 :
89 :
90 : extern fd_topo_run_tile_t fd_tile_net;
91 : extern fd_topo_run_tile_t fd_tile_netlnk;
92 : extern fd_topo_run_tile_t fd_tile_mlx5;
93 : extern fd_topo_run_tile_t fd_tile_iavf;
94 : extern fd_topo_run_tile_t fd_tile_sock;
95 : extern fd_topo_run_tile_t fd_tile_quic;
96 : extern fd_topo_run_tile_t fd_tile_verify;
97 : extern fd_topo_run_tile_t fd_tile_dedup;
98 : extern fd_topo_run_tile_t fd_tile_resolv;
99 : extern fd_topo_run_tile_t fd_tile_pack;
100 : extern fd_topo_run_tile_t fd_tile_execle;
101 : extern fd_topo_run_tile_t fd_tile_motor;
102 : extern fd_topo_run_tile_t fd_tile_shred;
103 : extern fd_topo_run_tile_t fd_tile_sign;
104 : extern fd_topo_run_tile_t fd_tile_metric;
105 : extern fd_topo_run_tile_t fd_tile_event;
106 : extern fd_topo_run_tile_t fd_tile_diag;
107 : extern fd_topo_run_tile_t fd_tile_waker;
108 : extern fd_topo_run_tile_t fd_tile_mwaitx;
109 : extern fd_topo_run_tile_t fd_tile_gui;
110 : extern fd_topo_run_tile_t fd_tile_rpc;
111 : extern fd_topo_run_tile_t fd_tile_bundle;
112 : extern fd_topo_run_tile_t fd_tile_genesi;
113 : extern fd_topo_run_tile_t fd_tile_ipecho;
114 : extern fd_topo_run_tile_t fd_tile_admin;
115 : extern fd_topo_run_tile_t fd_tile_failov;
116 :
117 : extern fd_topo_run_tile_t fd_tile_gossvf;
118 : extern fd_topo_run_tile_t fd_tile_gossip;
119 : extern fd_topo_run_tile_t fd_tile_repair;
120 : extern fd_topo_run_tile_t fd_tile_rserve;
121 : extern fd_topo_run_tile_t fd_tile_replay;
122 : extern fd_topo_run_tile_t fd_tile_execrp;
123 : extern fd_topo_run_tile_t fd_tile_votor;
124 : extern fd_topo_run_tile_t fd_tile_accdb;
125 : extern fd_topo_run_tile_t fd_tile_solcap;
126 :
127 : extern fd_topo_run_tile_t fd_tile_snapct;
128 : extern fd_topo_run_tile_t fd_tile_snapld;
129 : extern fd_topo_run_tile_t fd_tile_snapdc;
130 : extern fd_topo_run_tile_t fd_tile_snapin;
131 : extern fd_topo_run_tile_t fd_tile_snapmk;
132 : extern fd_topo_run_tile_t fd_tile_snapzp;
133 : extern fd_topo_run_tile_t fd_tile_snaprd;
134 : extern fd_topo_run_tile_t fd_tile_snapsv;
135 :
136 : fd_topo_run_tile_t * TILES[] = {
137 : &fd_tile_net,
138 : &fd_tile_netlnk,
139 : &fd_tile_mlx5,
140 : &fd_tile_iavf,
141 : &fd_tile_sock,
142 : &fd_tile_quic,
143 : &fd_tile_verify,
144 : &fd_tile_dedup,
145 : &fd_tile_resolv,
146 : &fd_tile_pack,
147 : &fd_tile_execle,
148 : &fd_tile_shred,
149 : &fd_tile_sign,
150 : &fd_tile_metric,
151 : &fd_tile_event,
152 : &fd_tile_diag,
153 : &fd_tile_waker,
154 : &fd_tile_mwaitx,
155 : &fd_tile_gui,
156 : &fd_tile_rpc,
157 : &fd_tile_bundle,
158 : &fd_tile_gossvf,
159 : &fd_tile_gossip,
160 : &fd_tile_repair,
161 : &fd_tile_rserve,
162 : &fd_tile_replay,
163 : &fd_tile_execrp,
164 : &fd_tile_motor,
165 : &fd_tile_votor,
166 : &fd_tile_accdb,
167 : &fd_tile_snapct,
168 : &fd_tile_snapld,
169 : &fd_tile_snapdc,
170 : &fd_tile_snapin,
171 : &fd_tile_genesi,
172 : &fd_tile_ipecho,
173 : &fd_tile_admin,
174 : &fd_tile_failov,
175 : &fd_tile_solcap,
176 : &fd_tile_snapmk,
177 : &fd_tile_snapzp,
178 : &fd_tile_snaprd,
179 : &fd_tile_snapsv,
180 : NULL,
181 : };
182 :
183 : extern action_t fd_action_run;
184 : extern action_t fd_action_run1;
185 : extern action_t fd_action_configure;
186 : extern action_t fd_action_monitor;
187 : extern action_t fd_action_keys;
188 : extern action_t fd_action_ready;
189 : extern action_t fd_action_mem;
190 : extern action_t fd_action_netconf;
191 : extern action_t fd_action_help;
192 : extern action_t fd_action_metrics;
193 : extern action_t fd_action_version;
194 : extern action_t fd_action_shred_version;
195 : extern action_t fd_action_watch;
196 : extern action_t fd_action_add_authorized_voter;
197 : extern action_t fd_action_remove_all_authorized_voters;
198 : extern action_t fd_action_set_identity;
199 : extern action_t fd_action_get_identity;
200 : extern action_t fd_action_failover;
201 : extern action_t fd_action_ps;
202 : extern action_t fd_action_monitor_gossip;
203 : extern action_t fd_action_snapshot_create;
204 : extern action_t fd_action_wait;
205 :
206 : action_t * ACTIONS[] = {
207 : &fd_action_run,
208 : &fd_action_run1,
209 : &fd_action_configure,
210 : &fd_action_monitor,
211 : &fd_action_keys,
212 : &fd_action_ready,
213 : &fd_action_mem,
214 : &fd_action_netconf,
215 : &fd_action_help,
216 : &fd_action_metrics,
217 : &fd_action_version,
218 : &fd_action_shred_version,
219 : &fd_action_add_authorized_voter,
220 : &fd_action_remove_all_authorized_voters,
221 : &fd_action_watch,
222 : &fd_action_monitor_gossip,
223 : &fd_action_set_identity,
224 : &fd_action_get_identity,
225 : &fd_action_failover,
226 : &fd_action_ps,
227 : &fd_action_snapshot_create,
228 : &fd_action_wait,
229 : NULL,
230 : };
231 :
232 : int
233 : main( int argc,
234 0 : char ** argv ) {
235 0 : fd_config_file_t _default = fd_config_file_default();
236 0 : fd_config_file_t testnet = fd_config_file_testnet();
237 0 : fd_config_file_t devnet = fd_config_file_devnet();
238 0 : fd_config_file_t mainnet = fd_config_file_mainnet();
239 :
240 0 : fd_config_file_t * configs[] = {
241 0 : &_default,
242 0 : &testnet,
243 0 : &devnet,
244 0 : &mainnet,
245 0 : NULL
246 0 : };
247 :
248 0 : return fd_main( argc, argv, configs, fd_topo_initialize );
249 0 : }
250 :
251 : /* Kind of a hack for now, we sometimes want to view bench generation
252 : in the monitor binary, but it's not part of the production binary. */
253 :
254 : void
255 : add_bench_topo( fd_topo_t * topo,
256 : char const * affinity,
257 : ulong benchg_tile_cnt,
258 : ulong benchs_tile_cnt,
259 : ulong accounts_cnt,
260 : int transaction_mode,
261 : float contending_fraction,
262 : float cu_price_spread,
263 : ulong conn_cnt,
264 : ushort send_to_port,
265 : uint send_to_ip_addr,
266 : ushort rpc_port,
267 0 : uint rpc_ip_addr ) {
268 0 : (void)topo;
269 0 : (void)affinity;
270 0 : (void)benchg_tile_cnt;
271 0 : (void)benchs_tile_cnt;
272 0 : (void)accounts_cnt;
273 0 : (void)transaction_mode;
274 0 : (void)contending_fraction;
275 0 : (void)cu_price_spread;
276 0 : (void)conn_cnt;
277 0 : (void)send_to_port;
278 0 : (void)send_to_ip_addr;
279 0 : (void)rpc_port;
280 0 : (void)rpc_ip_addr;
281 0 : }
|