Re: [PATCH 24/39] app/test: octeontx unit test case helper functions
From: Van Haaren, Harry <hidden>
Date: 2017-03-23 12:02:00
From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] Sent: Friday, March 3, 2017 5:28 PM To: dev@dpdk.org Cc: thomas.monjalon@6wind.com; Richardson, Bruce <redacted>; Van Haaren, Harry [off-list ref]; hemant.agrawal@nxp.com; Eads, Gage [off-list ref]; nipun.gupta@nxp.com; santosh.shukla@caviumnetworks.com; Jerin Jacob [off-list ref] 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 <redacted>
Acked-by: Harry van Haaren <redacted>
+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 :)