> From: Jerin Jacob [mailto:[email protected]]
> Sent: Friday, March 3, 2017 5:28 PM
> To: [email protected]
> Cc: [email protected]; Richardson, Bruce 
> <[email protected]>; Van Haaren,
> Harry <[email protected]>; [email protected]; Eads, Gage 
> <[email protected]>;
> [email protected]; [email protected]; Jerin Jacob
> <[email protected]>
> 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 <[email protected]>


Acked-by: Harry van Haaren <[email protected]>



> +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 :)

Reply via email to