uint32_t service_id;
};
+typedef uint8_t counter_dynfield_t;
+static int counter_dynfield_offset = -1;
+
+static inline counter_dynfield_t *
+counter_field(struct rte_mbuf *mbuf)
+{
+ return RTE_MBUF_DYNFIELD(mbuf, \
+ counter_dynfield_offset, counter_dynfield_t *);
+}
+
static struct rte_event release_ev;
static inline struct rte_mbuf *
}
ev[i].queue_id = 0;
- ev[i].mbuf->udata64++;
- if (ev[i].mbuf->udata64 != 16) {
+ (*counter_field(ev[i].mbuf))++;
+ if (*counter_field(ev[i].mbuf) != 16) {
ev[i].op = RTE_EVENT_OP_FORWARD;
enqd = rte_event_enqueue_burst(evdev, port,
&ev[i], 1);
m = rte_pktmbuf_alloc(t->mbuf_pool);
} while (m == NULL);
- m->udata64 = 0;
+ *counter_field(m) = 0;
struct rte_event ev = {
.op = RTE_EVENT_OP_NEW,
int err;
int w_lcore, p_lcore;
+ static const struct rte_mbuf_dynfield counter_dynfield_desc = {
+ .name = "rte_event_sw_dynfield_selftest_counter",
+ .size = sizeof(counter_dynfield_t),
+ .align = __alignof__(counter_dynfield_t),
+ };
+ counter_dynfield_offset =
+ rte_mbuf_dynfield_register(&counter_dynfield_desc);
+ if (counter_dynfield_offset < 0) {
+ printf("Error registering mbuf field\n");
+ return -rte_errno;
+ }
+
if (init(t, 8, 2) < 0 ||
create_atomic_qids(t, 8) < 0) {
printf("%d: Error initializing device\n", __LINE__);