Lines Matching refs:pidx
214 int pidx; member
244 int pidx; member
249 int pidx; member
644 int rc, pidx = arg2, peer_port; in sysctl_peer_port_number() local
646 peer_port = ntb_peer_port_number(tc->dev, pidx); in sysctl_peer_port_number()
652 tc->peers[pidx].port_no = peer_port; in sysctl_peer_port_number()
677 int pidx; in tool_init_peers() local
682 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_peers()
683 tc->peers[pidx].pidx = pidx; in tool_init_peers()
684 tc->peers[pidx].tc = tc; in tool_init_peers()
731 int up = 0, pidx = arg2; in sysctl_peer_link_handle() local
739 if (up & (1UL << pidx)) in sysctl_peer_link_handle()
752 int rc, pidx = arg2; in sysctl_peer_link_event_handle() local
764 tc->link_mask = (1ULL << ((pidx) % 64)); in sysctl_peer_link_event_handle()
803 tool_setup_mw(struct tool_ctx *tc, unsigned int pidx, unsigned int widx, in tool_setup_mw() argument
806 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx]; in tool_setup_mw()
870 tool_free_mw(struct tool_ctx *tc, int pidx, int widx) in tool_free_mw() argument
872 struct tool_mw *inmw = &tc->peers[pidx].inmws[widx]; in tool_free_mw()
906 ntb_peer_port_number(inmw->tc->dev, inmw->pidx), inmw->pidx); in tool_mw_trans_read()
937 tool_free_mw(tc, inmw->pidx, inmw->widx); in tool_mw_trans_write()
939 rc = tool_setup_mw(tc, inmw->pidx, inmw->widx, wsize); in tool_mw_trans_write()
987 int widx, pidx; in tool_clear_mws() local
990 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_clear_mws()
991 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) in tool_clear_mws()
992 tool_free_mw(tc, pidx, widx); in tool_clear_mws()
993 free(tc->peers[pidx].inmws, M_NTB_TOOL); in tool_clear_mws()
1001 int widx, pidx, rc; in tool_init_mws() local
1004 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_mws()
1005 tc->peers[pidx].inmw_cnt = ntb_mw_count(tc->dev); in tool_init_mws()
1006 tc->peers[pidx].inmws = malloc(tc->peers[pidx].inmw_cnt * in tool_init_mws()
1007 sizeof(*tc->peers[pidx].inmws), M_NTB_TOOL, in tool_init_mws()
1010 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { in tool_init_mws()
1011 mw = &tc->peers[pidx].inmws[widx]; in tool_init_mws()
1015 mw->pidx = pidx; in tool_init_mws()
1213 int sidx, pidx; in tool_init_spads() local
1222 tc->inspads[sidx].pidx = -1; in tool_init_spads()
1227 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_init_spads()
1228 tc->peers[pidx].outspad_cnt = ntb_spad_count(tc->dev); in tool_init_spads()
1229 tc->peers[pidx].outspads = malloc(tc->peers[pidx].outspad_cnt * in tool_init_spads()
1230 sizeof(*tc->peers[pidx].outspads), M_NTB_TOOL, M_WAITOK | in tool_init_spads()
1233 for (sidx = 0; sidx < tc->peers[pidx].outspad_cnt; sidx++) { in tool_init_spads()
1234 tc->peers[pidx].outspads[sidx].sidx = sidx; in tool_init_spads()
1235 tc->peers[pidx].outspads[sidx].pidx = pidx; in tool_init_spads()
1236 tc->peers[pidx].outspads[sidx].tc = tc; in tool_init_spads()
1244 int pidx; in tool_clear_spads() local
1250 for (pidx = 0; pidx < tc->peer_cnt; pidx++) in tool_clear_spads()
1251 free(tc->peers[pidx].outspads, M_NTB_TOOL); in tool_clear_spads()
1312 unsigned int pidx, sidx, widx; in tool_setup_sysctl() local
1361 for (pidx = 0; pidx < tc->peer_cnt; pidx++) { in tool_setup_sysctl()
1362 snprintf(buf, sizeof(buf), "peer%d", pidx); in tool_setup_sysctl()
1369 CTLTYPE_UINT | CTLFLAG_RDTUN | CTLFLAG_MPSAFE, tc, pidx, in tool_setup_sysctl()
1373 CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, tc, pidx, in tool_setup_sysctl()
1377 CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, tc, pidx, in tool_setup_sysctl()
1380 for (widx = 0; widx < tc->peers[pidx].inmw_cnt; widx++) { in tool_setup_sysctl()
1386 &tc->peers[pidx].inmws[widx], 0, in tool_setup_sysctl()
1394 &tc->peers[pidx].inmws[widx], 0, in tool_setup_sysctl()
1402 &tc->peers[pidx].inmws[widx], 0, in tool_setup_sysctl()
1406 for (sidx = 0; sidx < tc->peers[pidx].outspad_cnt; sidx++) { in tool_setup_sysctl()