* * @param buf * Destination memory. * @param data * Source memory * @param size * Requested copy size * @param desc * rte_flow_desc_item - for flow item conversion. * rte_flow_desc_action - for flow action conversion. * @param type * Offset into the desc param or negative value for private flow elements. */
| 48 | * Offset into the desc param or negative value for private flow elements. |
| 49 | */ |
| 50 | static inline size_t |
| 51 | rte_flow_conv_copy(void *buf, const void *data, const size_t size, |
| 52 | const struct rte_flow_desc_data *desc, int type) |
| 53 | { |
| 54 | /** |
| 55 | * Allow PMD private flow item |
| 56 | */ |
| 57 | bool rte_type = type >= 0; |
| 58 | |
| 59 | size_t sz = rte_type ? desc[type].size : sizeof(void *); |
| 60 | if (buf == NULL || data == NULL) |
| 61 | return 0; |
| 62 | rte_memcpy(buf, data, (size > sz ? sz : size)); |
| 63 | if (rte_type && desc[type].desc_fn) |
| 64 | sz += desc[type].desc_fn(size > 0 ? buf : NULL, data); |
| 65 | return sz; |
| 66 | } |
| 67 | |
| 68 | static size_t |
| 69 | rte_flow_item_flex_conv(void *buf, const void *data) |
no test coverage detected