| 130 | } |
| 131 | |
| 132 | static inline int |
| 133 | dpaa_event_dequeue_wait(uint64_t timeout_ticks) |
| 134 | { |
| 135 | int fd_qman, nfds; |
| 136 | int ret; |
| 137 | fd_set readset; |
| 138 | |
| 139 | /* Go into (and back out of) IRQ mode for each select, |
| 140 | * it simplifies exit-path considerations and other |
| 141 | * potential nastiness. |
| 142 | */ |
| 143 | struct timeval tv = { |
| 144 | .tv_sec = timeout_ticks / 1000000, |
| 145 | .tv_usec = timeout_ticks % 1000000 |
| 146 | }; |
| 147 | |
| 148 | fd_qman = qman_thread_fd(); |
| 149 | nfds = fd_qman + 1; |
| 150 | FD_ZERO(&readset); |
| 151 | FD_SET(fd_qman, &readset); |
| 152 | |
| 153 | qman_irqsource_add(QM_PIRQ_DQRI); |
| 154 | |
| 155 | ret = select(nfds, &readset, NULL, NULL, &tv); |
| 156 | if (ret < 0) |
| 157 | return ret; |
| 158 | /* Calling irqsource_remove() prior to thread_irq() |
| 159 | * means thread_irq() will not process whatever caused |
| 160 | * the interrupts, however it does ensure that, once |
| 161 | * thread_irq() re-enables interrupts, they won't fire |
| 162 | * again immediately. |
| 163 | */ |
| 164 | qman_irqsource_remove(~0); |
| 165 | drain_4_bytes(fd_qman, &readset); |
| 166 | qman_thread_irq(); |
| 167 | |
| 168 | return ret; |
| 169 | } |
| 170 | |
| 171 | static uint16_t |
| 172 | dpaa_event_dequeue_burst(void *port, struct rte_event ev[], |
no test coverage detected