[dpdk-dev] [PATCH 24/39] app/test: octeontx unit test case helper functions
Van Haaren, Harry
harry.van.haaren at intel.com
Thu Mar 23 13:00:31 CET 2017
> From: Jerin Jacob [mailto:jerin.jacob at caviumnetworks.com]
> Sent: Friday, March 3, 2017 5:28 PM
> To: dev at dpdk.org
> Cc: thomas.monjalon at 6wind.com; Richardson, Bruce <bruce.richardson at intel.com>; Van Haaren,
> Harry <harry.van.haaren at intel.com>; hemant.agrawal at nxp.com; Eads, Gage <gage.eads at intel.com>;
> nipun.gupta at nxp.com; santosh.shukla at caviumnetworks.com; Jerin Jacob
> <jerin.jacob at 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.jacob at caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren at 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 :)
More information about the dev
mailing list