From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9D712CF62 for ; Thu, 23 Mar 2017 13:02:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490270520; x=1521806520; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=8EEOFTSmq4YeLNw6SipVBrRyfMyuN/nVyRIOrZmZxjE=; b=JBR7iV0zzU9oPpkY28vMxsNS0PunRCQYTfpRgxPhTDUICC+ha3VFrOxp IoFFBBdGX4D7/XoN0rT4RAbQZxCKxQ==; Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Mar 2017 05:01:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,209,1486454400"; d="scan'208";a="79791920" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by fmsmga005.fm.intel.com with ESMTP; 23 Mar 2017 05:01:57 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.230]) by IRSMSX154.ger.corp.intel.com ([169.254.12.40]) with mapi id 14.03.0248.002; Thu, 23 Mar 2017 12:00:32 +0000 From: "Van Haaren, Harry" To: Jerin Jacob , "dev@dpdk.org" CC: "thomas.monjalon@6wind.com" , "Richardson, Bruce" , "hemant.agrawal@nxp.com" , "Eads, Gage" , "nipun.gupta@nxp.com" , "santosh.shukla@caviumnetworks.com" Thread-Topic: [dpdk-dev] [PATCH 24/39] app/test: octeontx unit test case helper functions Thread-Index: AQHSlEPmVbWmDJFUMk2dmo3vsovTpaGicH2g Date: Thu, 23 Mar 2017 12:00:31 +0000 Message-ID: References: <1488562101-6658-1-git-send-email-jerin.jacob@caviumnetworks.com> <1488562101-6658-25-git-send-email-jerin.jacob@caviumnetworks.com> In-Reply-To: <1488562101-6658-25-git-send-email-jerin.jacob@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjk3NTk4NDktNTA2ZS00ZmZlLTgwODItMzAyZTg5ODgyOTgyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImlRNnV0UEl3dDlKK0RYTTM4ckVPYzdZQkN4ZEM0czlsbSttZHg0V0gxTlk9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 24/39] app/test: octeontx unit test case helper functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2017 12:02:01 -0000 > 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 ; Van Haaren, > Harry ; hemant.agrawal@nxp.com; Eads, Gage ; > nipun.gupta@nxp.com; santosh.shukla@caviumnetworks.com; Jerin Jacob > > Subject: [dpdk-dev] [PATCH 24/39] app/test: octeontx unit test case helpe= r functions >=20 > Add helper functions to generate, inject, consume and validate the events= . >=20 > Signed-off-by: Jerin Jacob Acked-by: Harry van Haaren > +static inline void > +update_event_and_validation_attr(struct rte_mbuf *m, struct rte_event *e= v, > + 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 =3D rte_pktmbuf_mtod(m, struct event_attr *); > +static inline int > +validate_event(struct rte_event *ev) > +{ > + struct event_attr *attr; > + > + attr =3D rte_pktmbuf_mtod(ev->mbuf, struct event_attr *); > + TEST_ASSERT_EQUAL(attr->flow_id, ev->flow_id, > + "flow_id mismatch enq=3D%d deq =3D%d", > + attr->flow_id, ev->flow_id); > + TEST_ASSERT_EQUAL(attr->event_type, ev->event_type, > + "event_type mismatch enq=3D%d deq =3D%d", > + attr->event_type, ev->event_type); Simple + effective technique - I'll remember that one :)