* Return the number of operations that have been successfully completed. * Once an operation has been reported as completed, the results of that * operation will be visible to all cores on the system. * * @param dev_id * The identifier of the device. * @param vchan * The identifier of virtual DMA channel. * @param nb_cpls * The maximum number of completed operations that can be proc
| 991 | * must be less than or equal to the value of nb_cpls. |
| 992 | */ |
| 993 | static inline uint16_t |
| 994 | rte_dma_completed(int16_t dev_id, uint16_t vchan, const uint16_t nb_cpls, |
| 995 | uint16_t *last_idx, bool *has_error) |
| 996 | { |
| 997 | struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; |
| 998 | uint16_t idx; |
| 999 | bool err; |
| 1000 | |
| 1001 | #ifdef RTE_DMADEV_DEBUG |
| 1002 | if (!rte_dma_is_valid(dev_id) || nb_cpls == 0) |
| 1003 | return 0; |
| 1004 | if (*obj->completed == NULL) |
| 1005 | return 0; |
| 1006 | #endif |
| 1007 | |
| 1008 | /* Ensure the pointer values are non-null to simplify drivers. |
| 1009 | * In most cases these should be compile time evaluated, since this is |
| 1010 | * an inline function. |
| 1011 | * - If NULL is explicitly passed as parameter, then compiler knows the |
| 1012 | * value is NULL |
| 1013 | * - If address of local variable is passed as parameter, then compiler |
| 1014 | * can know it's non-NULL. |
| 1015 | */ |
| 1016 | if (last_idx == NULL) |
| 1017 | last_idx = &idx; |
| 1018 | if (has_error == NULL) |
| 1019 | has_error = &err; |
| 1020 | |
| 1021 | *has_error = false; |
| 1022 | return (*obj->completed)(obj->dev_private, vchan, nb_cpls, last_idx, |
| 1023 | has_error); |
| 1024 | } |
| 1025 | |
| 1026 | /** |
| 1027 | * Return the number of operations that have been completed, and the operations |