Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/include/ci/internal/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,14 @@ extern void citp_waitable_print_to_logger(ci_netif*, citp_waitable*,
extern void
ci_tcp_listenq_print_to_logger(ci_netif* ni, ci_tcp_socket_listen* tls,
oo_dump_log_fn_t logger, void *log_arg);
extern int ci_tcp_listenq_bucket_iter(ci_netif* ni, ci_tcp_listen_bucket* bucket,
void (fn_tsr)(ci_netif* ni,
ci_tcp_state_synrecv* tsr,
void* arg),
void (fn_bucket)(ci_netif* ni,
ci_tcp_listen_bucket* bucket,
void* arg),
void* arg);


/*********************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/lib/transport/ip/tcp_synrecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ci_inline int ci_tcp_listenq_hash2idx(ci_uint32 hash, int level)
* (sub-)bucket, including the top one. fn_bucket() is called after all
* the syn-recv states have been handled via fn_tsr() callback.
*/
static int
int
ci_tcp_listenq_bucket_iter(ci_netif* ni, ci_tcp_listen_bucket* bucket,
void (fn_tsr)(ci_netif* ni,
ci_tcp_state_synrecv* tsr,
Expand Down
1 change: 1 addition & 0 deletions src/tools/onload_remote_monitor/ftl_decls.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ FTL_DECLARE(STRUCT_IP_SOCK_STATS)
FTL_DECLARE(STRUCT_TCP_COMMON)
FTL_DECLARE(STRUCT_TCP)
FTL_DECLARE(STRUCT_TCP_SOCKET_LISTEN_STATS)
FTL_DECLARE(STRUCT_STATE_SYNRECV)
FTL_DECLARE(STRUCT_TCP_LISTEN)
FTL_DECLARE(STRUCT_WAITABLE_OBJ)
FTL_DECLARE(STRUCT_FILTER_TABLE_ENTRY_FAST)
Expand Down
8 changes: 8 additions & 0 deletions src/tools/onload_remote_monitor/ftl_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,14 @@ typedef struct oo_tcp_socket_stats oo_tcp_socket_stats;
n_rx_pkts, (ORM_OUTPUT_STACK | ORM_OUTPUT_SOCKETS)) \
FTL_TSTRUCT_END(ctx)

#define STRUCT_STATE_SYNRECV(ctx) \
FTL_TSTRUCT_BEGIN(ctx, ci_tcp_state_synrecv, ) \
FTL_TFIELD_IPXADDR(ctx, l_addr, (ORM_OUTPUT_STACK | ORM_OUTPUT_SOCKETS)) \
FTL_TFIELD_IPXADDR(ctx, r_addr, (ORM_OUTPUT_STACK | ORM_OUTPUT_SOCKETS)) \
FTL_TFIELD_PORT(ctx, l_port, (ORM_OUTPUT_STACK | ORM_OUTPUT_SOCKETS)) \
FTL_TFIELD_PORT(ctx, r_port, (ORM_OUTPUT_STACK | ORM_OUTPUT_SOCKETS)) \
FTL_TSTRUCT_END(ctx)

#define STRUCT_TCP_LISTEN(ctx) \
FTL_TSTRUCT_BEGIN(ctx, ci_tcp_socket_listen, ) \
FTL_TFIELD_STRUCT(ctx, ci_sock_cmn, s, (ORM_OUTPUT_STACK | ORM_OUTPUT_SOCKETS)) \
Expand Down
13 changes: 13 additions & 0 deletions src/tools/onload_remote_monitor/orm_json_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,14 @@ static void orm_dump_struct_ci_netif_config_opts(char* label, ci_netif_config_op
#include "ftl_decls.h"


static void orm_dump_synrecv(ci_netif* ni, ci_tcp_state_synrecv* tsr, void* arg)
{
dump_buf_literal("{");
orm_dump_struct_ci_tcp_state_synrecv("tcp_listen_synrecv", tsr, *(int *)arg);
dump_buf_cleanup();
dump_buf_literal_comma("}");
}

static void orm_waitable_dump(ci_netif* ni, const char* sock_type,
int output_flags, const sockbuf_filter_t* sft)
{
Expand All @@ -824,6 +832,11 @@ static void orm_waitable_dump(ci_netif* ni, const char* sock_type,
sockbuf_filter_matches(sft, wo) ) {
dump_buf_cat("\"%d\":{", W_FMT(w));
orm_dump_struct_ci_tcp_socket_listen("tcp_listen_sockets", &wo->tcp_listen, output_flags);
dump_buf_literal("\"tcp_listenq_bucket\":[");
ci_tcp_listenq_bucket_iter(ni, ci_ni_aux_p2bucket(ni, wo->tcp_listen.bucket),
orm_dump_synrecv, NULL, &output_flags);
dump_buf_cleanup();
dump_buf_literal_comma("]");
dump_buf_cleanup();
dump_buf_literal_comma("}");
}
Expand Down