> From: Jerin Jacob [mailto:jerin.ja...@caviumnetworks.com] > Sent: Friday, March 3, 2017 5:28 PM > To: dev@dpdk.org > Cc: thomas.monja...@6wind.com; Richardson, Bruce > <bruce.richard...@intel.com>; Van Haaren, > Harry <harry.van.haa...@intel.com>; hemant.agra...@nxp.com; Eads, Gage > <gage.e...@intel.com>; > nipun.gu...@nxp.com; santosh.shu...@caviumnetworks.com; Jerin Jacob > <jerin.ja...@caviumnetworks.com> > Subject: [dpdk-dev] [PATCH 24/39] app/test: octeontx unit test case helper > functions > > Add helper functions to generate, inject, consume and validate the events. > > Signed-off-by: Jerin Jacob <jerin.ja...@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haa...@intel.com> > +static inline void > +update_event_and_validation_attr(struct rte_mbuf *m, struct rte_event *ev, > + uint32_t flow_id, uint8_t event_type, > + uint8_t sub_event_type, uint8_t sched_type, > + uint8_t queue, uint8_t port) > +{ > + struct event_attr *attr; > + > + /* Store the event attributes in mbuf for future reference */ > + attr = rte_pktmbuf_mtod(m, struct event_attr *); <snip> > +static inline int > +validate_event(struct rte_event *ev) > +{ > + struct event_attr *attr; > + > + attr = rte_pktmbuf_mtod(ev->mbuf, struct event_attr *); > + TEST_ASSERT_EQUAL(attr->flow_id, ev->flow_id, > + "flow_id mismatch enq=%d deq =%d", > + attr->flow_id, ev->flow_id); > + TEST_ASSERT_EQUAL(attr->event_type, ev->event_type, > + "event_type mismatch enq=%d deq =%d", > + attr->event_type, ev->event_type); Simple + effective technique - I'll remember that one :)