• Home
  • Raw
  • Download

Lines Matching refs:ntb

188 	struct ntb_dev *ntb;  member
253 link = ntb_link_is_up(peer->perf->ntb, NULL, NULL); in perf_link_is_up()
264 dev_dbg(&perf->ntb->dev, "CMD send: %d 0x%llx\n", cmd, data); in perf_spad_cmd_send()
277 sts = ntb_peer_spad_read(perf->ntb, peer->pidx, in perf_spad_cmd_send()
284 ntb_peer_spad_write(perf->ntb, peer->pidx, in perf_spad_cmd_send()
287 ntb_peer_spad_write(perf->ntb, peer->pidx, in perf_spad_cmd_send()
290 ntb_peer_spad_write(perf->ntb, peer->pidx, in perf_spad_cmd_send()
293 ntb_peer_db_set(perf->ntb, PERF_SPAD_NOTIFY(peer->gidx)); in perf_spad_cmd_send()
295 dev_dbg(&perf->ntb->dev, "DB ring peer %#llx\n", in perf_spad_cmd_send()
310 ntb_db_clear(perf->ntb, PERF_SPAD_NOTIFY(perf->gidx)); in perf_spad_cmd_recv()
324 val = ntb_spad_read(perf->ntb, PERF_SPAD_CMD(peer->gidx)); in perf_spad_cmd_recv()
330 val = ntb_spad_read(perf->ntb, PERF_SPAD_LDATA(peer->gidx)); in perf_spad_cmd_recv()
333 val = ntb_spad_read(perf->ntb, PERF_SPAD_HDATA(peer->gidx)); in perf_spad_cmd_recv()
337 ntb_spad_write(perf->ntb, PERF_SPAD_CMD(peer->gidx), in perf_spad_cmd_recv()
340 dev_dbg(&perf->ntb->dev, "CMD recv: %d 0x%llx\n", *cmd, *data); in perf_spad_cmd_recv()
355 dev_dbg(&perf->ntb->dev, "CMD send: %d 0x%llx\n", cmd, data); in perf_msg_cmd_send()
364 outbits = ntb_msg_outbits(perf->ntb); in perf_msg_cmd_send()
369 ret = ntb_msg_clear_sts(perf->ntb, outbits); in perf_msg_cmd_send()
373 ntb_peer_msg_write(perf->ntb, peer->pidx, PERF_MSG_LDATA, in perf_msg_cmd_send()
376 if (ntb_msg_read_sts(perf->ntb) & outbits) { in perf_msg_cmd_send()
381 ntb_peer_msg_write(perf->ntb, peer->pidx, PERF_MSG_HDATA, in perf_msg_cmd_send()
385 ntb_peer_msg_write(perf->ntb, peer->pidx, PERF_MSG_CMD, cmd); in perf_msg_cmd_send()
399 inbits = ntb_msg_inbits(perf->ntb); in perf_msg_cmd_recv()
401 if (hweight64(ntb_msg_read_sts(perf->ntb) & inbits) < 3) in perf_msg_cmd_recv()
404 val = ntb_msg_read(perf->ntb, pidx, PERF_MSG_CMD); in perf_msg_cmd_recv()
407 val = ntb_msg_read(perf->ntb, pidx, PERF_MSG_LDATA); in perf_msg_cmd_recv()
410 val = ntb_msg_read(perf->ntb, pidx, PERF_MSG_HDATA); in perf_msg_cmd_recv()
414 ntb_msg_clear_sts(perf->ntb, inbits); in perf_msg_cmd_recv()
416 dev_dbg(&perf->ntb->dev, "CMD recv: %d 0x%llx\n", *cmd, *data); in perf_msg_cmd_recv()
428 dev_err(&perf->ntb->dev, "Send invalid command\n"); in perf_cmd_send()
442 dev_err(&peer->perf->ntb->dev, "Exec invalid command\n"); in perf_cmd_exec()
449 dev_dbg(&peer->perf->ntb->dev, "CMD exec: %d\n", cmd); in perf_cmd_exec()
473 dev_err(&perf->ntb->dev, "Recv invalid command\n"); in perf_cmd_recv()
508 dev_dbg(&perf->ntb->dev, "DB vec %d mask %#llx bits %#llx\n", vec, in perf_db_event()
509 ntb_db_vector_mask(perf->ntb, vec), ntb_db_read(perf->ntb)); in perf_db_event()
519 dev_dbg(&perf->ntb->dev, "Msg status bits %#llx\n", in perf_msg_event()
520 ntb_msg_read_sts(perf->ntb)); in perf_msg_event()
534 (void)ntb_peer_mw_clear_trans(peer->perf->ntb, peer->pidx, peer->gidx); in perf_free_outbuf()
543 ret = ntb_peer_mw_set_trans(perf->ntb, peer->pidx, peer->gidx, in perf_setup_outbuf()
546 dev_err(&perf->ntb->dev, "Failed to set outbuf translation\n"); in perf_setup_outbuf()
562 (void)ntb_mw_clear_trans(peer->perf->ntb, peer->pidx, peer->gidx); in perf_free_inbuf()
563 dma_free_coherent(&peer->perf->ntb->pdev->dev, peer->inbuf_size, in perf_free_inbuf()
575 ret = ntb_mw_get_align(perf->ntb, peer->pidx, perf->gidx, in perf_setup_inbuf()
578 dev_err(&perf->ntb->dev, "Couldn't get inbuf restrictions\n"); in perf_setup_inbuf()
583 dev_err(&perf->ntb->dev, "Too big inbuf size %pa > %pa\n", in perf_setup_inbuf()
592 peer->inbuf = dma_alloc_coherent(&perf->ntb->pdev->dev, in perf_setup_inbuf()
596 dev_err(&perf->ntb->dev, "Failed to alloc inbuf of %pa\n", in perf_setup_inbuf()
602 dev_err(&perf->ntb->dev, "Unaligned inbuf allocated\n"); in perf_setup_inbuf()
606 ret = ntb_mw_set_trans(perf->ntb, peer->pidx, peer->gidx, in perf_setup_inbuf()
609 dev_err(&perf->ntb->dev, "Failed to set inbuf translation\n"); in perf_setup_inbuf()
649 dev_warn(&peer->perf->ntb->dev, in perf_service_work()
662 if (ntb_peer_mw_count(perf->ntb) < perf->pcnt) { in perf_init_service()
663 dev_err(&perf->ntb->dev, "Not enough memory windows\n"); in perf_init_service()
667 if (ntb_msg_count(perf->ntb) >= PERF_MSG_CNT) { in perf_init_service()
671 dev_dbg(&perf->ntb->dev, "Message service initialized\n"); in perf_init_service()
676 dev_dbg(&perf->ntb->dev, "Message service unsupported\n"); in perf_init_service()
679 if (ntb_spad_count(perf->ntb) >= PERF_SPAD_CNT(perf->pcnt) && in perf_init_service()
680 (ntb_db_valid_mask(perf->ntb) & mask) == mask) { in perf_init_service()
684 dev_dbg(&perf->ntb->dev, "Scratchpad service initialized\n"); in perf_init_service()
689 dev_dbg(&perf->ntb->dev, "Scratchpad service unsupported\n"); in perf_init_service()
691 dev_err(&perf->ntb->dev, "Command services unsupported\n"); in perf_init_service()
701 mask = ntb_db_valid_mask(perf->ntb); in perf_enable_service()
702 (void)ntb_db_set_mask(perf->ntb, mask); in perf_enable_service()
704 ret = ntb_set_ctx(perf->ntb, perf, &perf_ops); in perf_enable_service()
711 inbits = ntb_msg_inbits(perf->ntb); in perf_enable_service()
712 outbits = ntb_msg_outbits(perf->ntb); in perf_enable_service()
713 (void)ntb_msg_set_mask(perf->ntb, inbits | outbits); in perf_enable_service()
716 ret = ntb_msg_clear_mask(perf->ntb, incmd_bit); in perf_enable_service()
718 dev_dbg(&perf->ntb->dev, "MSG sts unmasked %#llx\n", incmd_bit); in perf_enable_service()
720 scnt = ntb_spad_count(perf->ntb); in perf_enable_service()
722 ntb_spad_write(perf->ntb, sidx, PERF_CMD_INVAL); in perf_enable_service()
724 ret = ntb_db_clear_mask(perf->ntb, incmd_bit); in perf_enable_service()
726 dev_dbg(&perf->ntb->dev, "DB bits unmasked %#llx\n", incmd_bit); in perf_enable_service()
729 ntb_clear_ctx(perf->ntb); in perf_enable_service()
733 ntb_link_enable(perf->ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); in perf_enable_service()
735 ntb_link_event(perf->ntb); in perf_enable_service()
747 inbits = ntb_msg_inbits(perf->ntb); in perf_disable_service()
748 (void)ntb_msg_set_mask(perf->ntb, inbits); in perf_disable_service()
750 (void)ntb_db_set_mask(perf->ntb, PERF_SPAD_NOTIFY(perf->gidx)); in perf_disable_service()
753 ntb_clear_ctx(perf->ntb); in perf_disable_service()
764 ntb_spad_write(perf->ntb, PERF_SPAD_CMD(peer->gidx), 0); in perf_disable_service()
767 ntb_db_clear(perf->ntb, PERF_SPAD_NOTIFY(perf->gidx)); in perf_disable_service()
769 ntb_link_disable(perf->ntb); in perf_disable_service()
866 node = dev_to_node(&perf->ntb->dev); in perf_dma_filter()
878 dev_to_node(&perf->ntb->dev)); in perf_init_test()
891 dev_err(&perf->ntb->dev, "%d: Failed to get DMA channel\n", in perf_init_test()
945 dev_err(&perf->ntb->dev, "%d: Got error %d on test\n", in perf_run_test()
983 dev_dbg(&perf->ntb->dev, "%d: copied %llu bytes\n", in perf_sync_test()
986 dev_dbg(&perf->ntb->dev, "%d: lasted %llu usecs\n", in perf_sync_test()
989 dev_dbg(&perf->ntb->dev, "%d: %llu MBytes/s\n", pthr->tidx, in perf_sync_test()
1202 "Local port %d, Global index %d\n", ntb_port_number(perf->ntb), in perf_dbgfs_read_info()
1208 ntb_peer_port_number(perf->ntb, perf->test_peer->pidx), in perf_dbgfs_read_info()
1219 ntb_peer_port_number(perf->ntb, peer->pidx), peer->pidx, in perf_dbgfs_read_info()
1355 struct pci_dev *pdev = perf->ntb->pdev; in perf_setup_dbgfs()
1359 dev_warn(&perf->ntb->dev, "DebugFS unsupported\n"); in perf_setup_dbgfs()
1390 static struct perf_ctx *perf_create_data(struct ntb_dev *ntb) in perf_create_data() argument
1394 perf = devm_kzalloc(&ntb->dev, sizeof(*perf), GFP_KERNEL); in perf_create_data()
1398 perf->pcnt = ntb_peer_port_count(ntb); in perf_create_data()
1399 perf->peers = devm_kcalloc(&ntb->dev, perf->pcnt, sizeof(*perf->peers), in perf_create_data()
1404 perf->ntb = ntb; in perf_create_data()
1416 ret = ntb_peer_mw_get_addr(perf->ntb, perf->gidx, &phys_addr, in perf_setup_peer_mw()
1421 peer->outbuf = devm_ioremap_wc(&perf->ntb->dev, phys_addr, in perf_setup_peer_mw()
1430 dev_warn(&peer->perf->ntb->dev, in perf_setup_peer_mw()
1443 lport = ntb_port_number(perf->ntb); in perf_init_peers()
1450 if (lport < ntb_peer_port_number(perf->ntb, pidx)) { in perf_init_peers()
1467 if (perf->pcnt == 1 && ntb_port_number(perf->ntb) == 0 && in perf_init_peers()
1468 ntb_peer_port_number(perf->ntb, 0) == 0) { in perf_init_peers()
1479 dev_dbg(&perf->ntb->dev, "Global port index %d\n", perf->gidx); in perf_init_peers()
1484 static int perf_probe(struct ntb_client *client, struct ntb_dev *ntb) in perf_probe() argument
1489 perf = perf_create_data(ntb); in perf_probe()
1512 static void perf_remove(struct ntb_client *client, struct ntb_dev *ntb) in perf_remove() argument
1514 struct perf_ctx *perf = ntb->ctx; in perf_remove()