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

Function rte_flow_conv_copy

dpdk/lib/ethdev/rte_flow.c:50–66  ·  view source on GitHub ↗

* * @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. */

Source from the content-addressed store, hash-verified

48 * Offset into the desc param or negative value for private flow elements.
49 */
50static inline size_t
51rte_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
68static size_t
69rte_flow_item_flex_conv(void *buf, const void *data)

Callers 2

rte_flow_conv_item_specFunction · 0.85

Calls 1

rte_memcpyFunction · 0.50

Tested by

no test coverage detected