| 41 | #define NTB_XSTATS_NUM RTE_DIM(ntb_xstats_names) |
| 42 | |
| 43 | static inline void |
| 44 | ntb_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 | |
| 70 | static inline int |
| 71 | ntb_handshake_work(const struct rte_rawdev *dev) |
no outgoing calls
no test coverage detected