MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ntb_link_cleanup

Function ntb_link_cleanup

dpdk/drivers/raw/ntb/ntb.c:43–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41#define NTB_XSTATS_NUM RTE_DIM(ntb_xstats_names)
42
43static inline void
44ntb_link_cleanup(struct rte_rawdev *dev)
45{
46 struct ntb_hw *hw = dev->dev_private;
47 int status, i;
48
49 if (hw->ntb_ops->spad_write == NULL ||
50 hw->ntb_ops->mw_set_trans == NULL) {
51 NTB_LOG(ERR, "Not supported to clean up link.");
52 return;
53 }
54
55 /* Clean spad registers. */
56 for (i = 0; i < hw->spad_cnt; i++) {
57 status = (*hw->ntb_ops->spad_write)(dev, i, 0, 0);
58 if (status)
59 NTB_LOG(ERR, "Failed to clean local spad.");
60 }
61
62 /* Clear mw so that peer cannot access local memory.*/
63 for (i = 0; i < hw->used_mw_num; i++) {
64 status = (*hw->ntb_ops->mw_set_trans)(dev, i, 0, 0);
65 if (status)
66 NTB_LOG(ERR, "Failed to clean mw.");
67 }
68}
69
70static inline int
71ntb_handshake_work(const struct rte_rawdev *dev)

Callers 2

ntb_dev_intr_handlerFunction · 0.85
ntb_dev_stopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected