From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <Jerin.JacobKollanukkaran@cavium.com>
Received: from NAM02-SN1-obe.outbound.protection.outlook.com
 (mail-sn1nam02on0060.outbound.protection.outlook.com [104.47.36.60])
 by dpdk.org (Postfix) with ESMTP id DDEA61DB1
 for <dev@dpdk.org>; Sun,  2 Apr 2017 16:57:07 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version;
 bh=nQiMORI2x2kJWnr+m1F2wHOdwKKkY5QEzA33VobCWEA=;
 b=BphhwLFm/FnuV74o9S9HE/wNn9joCWjy9DOrL/bbeQJofcVUzftkaCR9gVLqg2WxoTG7vwT7dmDJsCvBga+/BsaxOcrGL3+OURgY8fcUtEbl56hiF8slXeTQWoyChiChaD3BMXVzK4J7RN3TD7ujMHsYyz7g619H3wwCYL6KMUQ=
Authentication-Results: intel.com; dkim=none (message not signed)
 header.d=none;intel.com; dmarc=none action=none
 header.from=caviumnetworks.com;
Received: from localhost.localdomain (14.140.2.178) by
 BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id
 15.1.1005.10; Sun, 2 Apr 2017 14:57:02 +0000
Date: Sun, 2 Apr 2017 20:26:48 +0530
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: Harry van Haaren <harry.van.haaren@intel.com>
Cc: dev@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>,
 David Hunt <david.hunt@intel.com>
Message-ID: <20170402145646.c54niqeptw6lclnc@localhost.localdomain>
References: <1490829963-106807-1-git-send-email-harry.van.haaren@intel.com>
 <1490902250-32164-1-git-send-email-harry.van.haaren@intel.com>
 <1490902250-32164-18-git-send-email-harry.van.haaren@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <1490902250-32164-18-git-send-email-harry.van.haaren@intel.com>
User-Agent: NeoMutt/20170306 (1.8.0)
X-Originating-IP: [14.140.2.178]
X-ClientProxiedBy: BM1PR01CA0031.INDPRD01.PROD.OUTLOOK.COM (10.163.198.166) To
 BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17)
X-MS-Office365-Filtering-Correlation-Id: 92f40e13-c6a0-4c6f-4699-08d479d886ad
X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0;
 RULEID:(22001)(201703131423075)(201703031133081); SRVR:BN3PR0701MB1718; 
X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718;
 3:Uid5FAAMNi+BuT7wstL0EoB3bbSjNHyjw7taAYz1mjvZT5pn42Ac1dEkpyy9Iz/GJaGQ3myhx6qSnjn5aaTGH2nqWGcYjUe0SKUh4Z6PWmEN2FdTmCGW6L85uEpaJXUGHG4wWags4TqaFZ7dDuB3lp3EiH92/5m7XqLysUUD06d9Zdr4w8AkfPQ30QlBCZ/qyCenzXGmP8+F4/vJnR/5N2k1Dvrl4qDsZ6aJDr25rA1HZa3tdeUKkpzZImUdVTKtr1QLZKXy6ITqlF+IVu2WQemN7texyqfKIPVCvpN7nEkX+7rfV6RQ8IT1bOa+OwnQCUV7OjlhzPgHnV37AcMVRg==;
 25:OOv+Q5od3x3HDO8caDsIMrP3Thyr6ebiCzVJZGfv0oTxL9vVZU0vdDuc+FNvbSkH0jdMY+1uAQV8/5ogNTJlDV4zGDwlTSZTWJLrGY/F0pknpSSxfDIgS2tU331bbMlduI0B++coYPQ+44qSH8i4Au9hGHEoLbupXiV0ywkIWjUltnV4e+k6QFR9fCCp2OBM1HssH64HqO0siP2N79P3bn5Pr2tHLBDngt+YZibQ4FjABFzafkAm8W3QtQuenPIwR3DJsttxvlwiccePrypgb95P1zWXLJHMGc2Qnv84IAtM3PmIzL64Xjq2q89cZr7gGYAc0i4vGPoHsntfu2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ots28M=
X-Microsoft-Antispam-PRVS: <BN3PR0701MB1718D0A1AE92FBAE44A8C26CE3090@BN3PR0701MB1718.namprd07.prod.outlook.com>
X-Exchange-Antispam-Report-Test: UriScan:(228905959029699);
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
 RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123555025)(20161123564025)(6072148);
 SRVR:BN3PR0701MB1718; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1718; 
X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718;
 4:SV2O+SwDC3pfS5T7XOwqI8jB4hG9whm7ahBticVfsr9/j4b5ucIKXxf+2t6hhGvpqDH1y+I4+a4PonPm8jhYLSrzpzd3iAinoTxPT2okFqcalVZbOrtqzsV8KxQCi36QcMG84P5hhXCarDlHmYE6MXb2vaaEw4LqNBha0Sl/b22qHeU5885S4bas3x5+AKp8socwMyX2agrjgyDWIyDvcSI5qdjlBfTwEJ1HjfZW0ekbViC3HPUpt3m9Wnz9SH3Wacf9gFz1wzMBixKleE+h94o1vG7n+4u5dynGwMAW3n+03XK0xsAvAslsv6DYjdcDgSqGUeLYZSv9z0bYszYBhfmt60+nlDV2JRlruyKD1T+CY190R8mKaDYG3ugQxQhJhK47iXHNKWC3zu5rn+wLNTBbif7i+kqhFBCO2YrH3sFCrvkzS5bFuLFpjmY3kZhZqikjbNST9D0mtHlaga+LvSAkHHT81YHy0/Bu9PA+D9D7fozzCCmXHR3A9gQrAJ4bzXxtwq14E6lh+nqvVgkl6yZ3IVQYuNOLZH7DNo7sWwvTnmNqwKoFILIRbB1dKEI+AkVzmOhSCR+wNm+gsphzxCHUQXmUUm+/C2Oe9GOA955+iLuH+Cn9Pz+aQZaVK7TGbsAYPxxl7ske4kKQqpxAsQQApfqp+DuM91Gwjq9xkjmsqK4/+OGoqIeeyR09cNpeva1Z3urIVOBhZcU7RvKmzRzNH/s72oRpW7+95d4eQII=
X-Forefront-PRVS: 02652BD10A
X-Forefront-Antispam-Report: SFV:NSPM;
 SFS:(10009020)(4630300001)(6069001)(6009001)(39840400002)(39850400002)(39450400003)(39400400002)(39410400002)(24454002)(6116002)(23726003)(53936002)(55016002)(3846002)(33646002)(42882006)(2950100002)(6916009)(66066001)(1076002)(6246003)(305945005)(7736002)(47776003)(61506002)(189998001)(229853002)(54906002)(6306002)(25786009)(5660300001)(9686003)(2906002)(5009440100003)(8676002)(81166006)(966004)(50986999)(76176999)(83506001)(54356999)(110136004)(6506006)(53376002)(6666003)(4001350100001)(38730400002)(4326008)(50466002)(42186005)(110426004);
 DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1718; H:localhost.localdomain; FPR:;
 SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; 
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1718;
 23:0nc1oh9lQ2S1x72zDm4JTse6jWQxmUVFgCxdLAx?=
 =?us-ascii?Q?gy9+iz+RoXEjvoA00/F7WGUnthTj6ZwnkFm2EoAJQc3fZRR/62YTHETRu7pE?=
 =?us-ascii?Q?Rl/a7XMXwgMfnUkNKSP0DUD/im+l56aD0RcgGg0/KkDxkTaYM4c/tvs0HCiA?=
 =?us-ascii?Q?9JYqX/iW++s0/1tRFhV6qK9cSFkInxnkbZCy6aJrHsA7RGoxuR/EN/LR1zTM?=
 =?us-ascii?Q?gRV4sqB0Q/2u8zOhWqz12Dunfc5XSrv/zUMTdwjVVbnXZLk9z29+KowUCxko?=
 =?us-ascii?Q?rpapr5bkpdZc10cgGI/dHBleFtChHC4M+ejTnaQ8T+IRD6ZJtEYu1PG+I1YM?=
 =?us-ascii?Q?3mz5ZYT8b9Q96+OdfzCbZq9WXe+0RoHXHsQ8PSgxkebD3s4RJ0xzmY0D92vY?=
 =?us-ascii?Q?tOAbOA0QTO4FCTMGEZ1zBqcz1w6npVYO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X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718;
 6:ssgKqziht6QqekZszNDWy16mwdDJ4uyo84xkIW2CGMnKr5StUoAAbEQY5cYwfTPJ7uh6yYSOXfyhEFItoW/HUphYnmKMPhR8cFv4ambMDYVMD/J2Z2jN6FihcBbZukosAO/1ViGqq7A2yIE/Axl+w/d//PYOINcQssO8ABcY7PR8OgseJCJw3pU3xaYrLNfcsJazIWpLV9wsbV2WG68sCzt302fNx6XvjFUC9nmSP+nssb45AkKIbJZAmDW+/7c6MjYK8vXVr/CdPHGiDLrmD3gKn+V2+v+dJxhkNDw6JoaTod6QpvEhMnN+5VONk/G1UuQXCywsSamPmmFA1mQRAi2J8kzuhC0gwpVLy8qaeI9RzIUiGvftxThx1rK5HktbOjVaeX0hnmbyK8njCcB4fA==;
 5:1GMHMqIeqcEuFarXDFQXRfMv2Z8D0MlDTOSmHJrkzt2Ha0wPs1g9FZhtlW0KsgHJ8ztiPjFV0avrb1A6POQ76WGLcig6a/Z/455Pe0x6JhZuGPk36f9VDSTrrYIOJf9cCnjT6Fy4KOR8CY54bVelmQ==;
 24:+4ghSJhPpmzYweAmgnd8kP5vpeBTc2pvflCmEDe1GgYuI7DfEwhSaUWSKdKZnQFkA4admEGf19w5m9XHyuMPp8D8gY/LOwxXvas/6tFzj/U=
SpamDiagnosticOutput: 1:99
SpamDiagnosticMetadata: NSPM
X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718;
 7:PCccYnWTA5+1M0MBifua5sWSgbw0beckakA50ohl4FljWQJ6H8Vkbvy6VSsYIRYfOKvOoBvHXEitdbRovx3s0jSPLXUAp5M6mM5mUj4d/S+JUHpraRoQcSTdwOscYFJ9++4HCCfgFD+I+hZcV69IQdMD92yFPyPAUVcPrnGUKiByTkKRKuNHlj5zOqyduvRl00SDO+5iFtejNk6JbMlZ2BlRPmrr4G7SaYhlKilZUdvzptKMb5qaRU8grIhV/uMoueWOukQXW/srMu28rgmwwfCJfejTag4lYgBET41OKaM2R/xL7mKh5y1qIWkTDIUTInL/qtczFOmTAd0v60rfbw==
X-OriginatorOrg: caviumnetworks.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2017 14:57:02.5325 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1718
Subject: Re: [dpdk-dev] [PATCH v7 17/22] test/eventdev: add SW tests for
	load balancing
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Sun, 02 Apr 2017 14:57:08 -0000

On Thu, Mar 30, 2017 at 08:30:45PM +0100, Harry van Haaren wrote:
> This commit adds various tests for load-balancing and
> queue prioritization.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Signed-off-by: David Hunt <david.hunt@intel.com>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>


Hi Harry,

I got following build error on FreeBSD + gcc 4.9.4 combo.

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc49/gcc/x86_64-portbld-freebsd10.3/4.9.4/lto-wrapper
Target: x86_64-portbld-freebsd10.3
Configured with: /wrkdirs/usr/ports/lang/gcc/work/gcc-4.9.4/configure
--disable-bootstrap --disable-nls --enable-gnu-indirect-function
--libdir=/usr/local/lib/gcc49 --libexecdir=/usr/local/libexec/gcc49
--program-suffix=49 --with-as=/usr/local/bin/as --with-gmp=/usr/local
--with-gxx-include-dir=/usr/local/lib/gcc49/include/c++/
--with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection'
--with-system-zlib --with-ecj-jar=/usr/local/share/java/ecj-4.5.jar
--enable-languages=c,c++,objc,fortran,java --prefix=/usr/local
--localstatedir=/var --mandir=/usr/local/man
--infodir=/usr/local/info/gcc49 --build=x86_64-portbld-freebsd10.3
Thread model: posix
gcc version 4.9.4 (FreeBSD Ports Collection) 
$ 

I think it is nothing do with FreeBSD. Looks like gcc < 5 will hit this
issue. But the strange part is patchwork test report shows as compilation success.

http://dpdk.org/ml/archives/test-report/2017-April/017005.html

== Build test/test
CC test_eventdev_sw.o
/usr/home/guest/dpdk-next-eventdev-test/test/test/test_eventdev_sw.c: In
function 'run_prio_packet_test':
/usr/home/guest/dpdk-next-eventdev-test/test/test/test_eventdev_sw.c:408:4:
error: missing initializer for field 'impl_opaque' of 'struct
<anonymous>' [-Werror=missing-field-ini
tializers]
.op = RTE_EVENT_OP_NEW,
    ^
In file included from
/usr/home/guest/dpdk-next-eventdev-test/test/test/test_eventdev_sw.c:51:0:
/usr/home/guest/dpdk-next-eventdev-test/build/include/rte_eventdev.h:960:12:
note: 'impl_opaque' declared here
    uint8_t impl_opaque;
^
/usr/home/guest/dpdk-next-eventdev-test/test/test/test_eventdev_sw.c:409:4:
error: missing initializer for field 'impl_opaque' of 'struct
<anonymous>' [-Werror=missing-field-ini
tializers]
.queue_id = t->qid[0],
    ^
In file included from
/usr/home/guest/dpdk-next-eventdev-test/test/test/test_eventdev_sw.c:51:0:
/usr/home/guest/dpdk-next-eventdev-test/build/include/rte_eventdev.h:960:12:
note: 'impl_opaque' declared here
    uint8_t impl_opaque;
^
/usr/home/guest/dpdk-next-eventdev-test/test/test/test_eventdev_sw.c:410:4:
error: missing initializer for field 'impl_opaque' of 'struct
<anonymous>' [-Werror=missing-field-initializers]
    .mbuf = arp
    ^
In file included from
/usr/home/guest/dpdk-next-eventdev-test/test/test/test_eventdev_sw.c:51:0:
/usr/home/guest/dpdk-next-eventdev-test/build/include/rte_eventdev.h:960:12:
note: 'impl_opaque' declared here
    uint8_t impl_opaque;
^
/usr/home/guest/dpdk-next-eventdev-test/test/test/test_eventdev_sw.c: In
function 'test_single_directed_packet':
/usr/home/guest/dpdk-next-eventdev-test/test/test/test_eventdev_sw.c:492:4:
error: missing initializer for field 'priority' of 'struct <anonymous>'
[-Werror=missing-field-initializers]
    .mbuf = arp,


If you don't have any better fix, I can apply the following on pull
request. If you have something better send it as patch.

$ git diff
diff --git a/test/test/Makefile b/test/test/Makefile
index ac802e1d..104532d 100644
--- a/test/test/Makefile
+++ b/test/test/Makefile
@@ -218,6 +218,11 @@ ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo
1), 1)
 CFLAGS_test_memcpy.o += -fno-var-tracking-assignments
 CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
 endif
+# for older GCC versions, allow us to initialize an event using
+# designated initializers.
+ifeq ($(shell test $(GCC_VERSION) -le 50 && echo 1), 1)
+CFLAGS_test_eventdev_sw.o += -Wno-missing-field-initializers
+endif
 endif
 
 # Link against shared libraries when needed
$ 



> ---
>  test/test/test_eventdev_sw.c | 566 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 566 insertions(+)
> 
> diff --git a/test/test/test_eventdev_sw.c b/test/test/test_eventdev_sw.c
> index f294cb9..03003e6 100644
> --- a/test/test/test_eventdev_sw.c
> +++ b/test/test/test_eventdev_sw.c
> @@ -309,6 +309,100 @@ test_event_dev_stats_get(int dev_id, struct test_event_dev_stats *stats)
>  	return 0;
>  }
>  
> +/* run_prio_packet_test
> + * This performs a basic packet priority check on the test instance passed in.
> + * It is factored out of the main priority tests as the same tests must be
> + * performed to ensure prioritization of each type of QID.
> + *
> + * Requirements:
> + *  - An initialized test structure, including mempool
> + *  - t->port[0] is initialized for both Enq / Deq of packets to the QID
> + *  - t->qid[0] is the QID to be tested
> + *  - if LB QID, the CQ must be mapped to the QID.
> + */
> +static int
> +run_prio_packet_test(struct test *t)
> +{
> +	int err;
> +	const uint32_t MAGIC_SEQN[] = {4711, 1234};
> +	const uint32_t PRIORITY[] = {
> +		RTE_EVENT_DEV_PRIORITY_NORMAL,
> +		RTE_EVENT_DEV_PRIORITY_HIGHEST
> +	};
> +	unsigned int i;
> +	for (i = 0; i < RTE_DIM(MAGIC_SEQN); i++) {
> +		/* generate pkt and enqueue */
> +		struct rte_event ev;
> +		struct rte_mbuf *arp = rte_gen_arp(0, t->mbuf_pool);
> +		if (!arp) {
> +			printf("%d: gen of pkt failed\n", __LINE__);
> +			return -1;
> +		}
> +		arp->seqn = MAGIC_SEQN[i];
> +
> +		ev = (struct rte_event){
> +			.priority = PRIORITY[i],
> +			.op = RTE_EVENT_OP_NEW,
> +			.queue_id = t->qid[0],
> +			.mbuf = arp
> +		};
> +		err = rte_event_enqueue_burst(evdev, t->port[0], &ev, 1);
> +		if (err < 0) {
> +			printf("%d: error failed to enqueue\n", __LINE__);
> +			return -1;
> +		}
> +	}
> +
> +	rte_event_schedule(evdev);
> +
> +	struct test_event_dev_stats stats;
> +	err = test_event_dev_stats_get(evdev, &stats);
> +	if (err) {
> +		printf("%d: error failed to get stats\n", __LINE__);
> +		return -1;
> +	}
> +
> +	if (stats.port_rx_pkts[t->port[0]] != 2) {
> +		printf("%d: error stats incorrect for directed port\n",
> +				__LINE__);
> +		rte_event_dev_dump(evdev, stdout);
> +		return -1;
> +	}
> +
> +	struct rte_event ev, ev2;
> +	uint32_t deq_pkts;
> +	deq_pkts = rte_event_dequeue_burst(evdev, t->port[0], &ev, 1, 0);
> +	if (deq_pkts != 1) {
> +		printf("%d: error failed to deq\n", __LINE__);
> +		rte_event_dev_dump(evdev, stdout);
> +		return -1;
> +	}
> +	if (ev.mbuf->seqn != MAGIC_SEQN[1]) {
> +		printf("%d: first packet out not highest priority\n",
> +				__LINE__);
> +		rte_event_dev_dump(evdev, stdout);
> +		return -1;
> +	}
> +	rte_pktmbuf_free(ev.mbuf);
> +
> +	deq_pkts = rte_event_dequeue_burst(evdev, t->port[0], &ev2, 1, 0);
> +	if (deq_pkts != 1) {
> +		printf("%d: error failed to deq\n", __LINE__);
> +		rte_event_dev_dump(evdev, stdout);
> +		return -1;
> +	}
> +	if (ev2.mbuf->seqn != MAGIC_SEQN[0]) {
> +		printf("%d: second packet out not lower priority\n",
> +				__LINE__);
> +		rte_event_dev_dump(evdev, stdout);
> +		return -1;
> +	}
> +	rte_pktmbuf_free(ev2.mbuf);
> +
> +	cleanup(t);
> +	return 0;
> +}
> +
>  static int
>  test_single_directed_packet(struct test *t)
>  {
> @@ -391,6 +485,94 @@ test_single_directed_packet(struct test *t)
>  	return 0;
>  }
>  
> +
> +static int
> +test_priority_directed(struct test *t)
> +{
> +	if (init(t, 1, 1) < 0 ||
> +			create_ports(t, 1) < 0 ||
> +			create_directed_qids(t, 1, t->port) < 0) {
> +		printf("%d: Error initializing device\n", __LINE__);
> +		return -1;
> +	}
> +
> +	if (rte_event_dev_start(evdev) < 0) {
> +		printf("%d: Error with start call\n", __LINE__);
> +		return -1;
> +	}
> +
> +	return run_prio_packet_test(t);
> +}
> +
> +static int
> +test_priority_atomic(struct test *t)
> +{
> +	if (init(t, 1, 1) < 0 ||
> +			create_ports(t, 1) < 0 ||
> +			create_atomic_qids(t, 1) < 0) {
> +		printf("%d: Error initializing device\n", __LINE__);
> +		return -1;
> +	}
> +
> +	/* map the QID */
> +	if (rte_event_port_link(evdev, t->port[0], &t->qid[0], NULL, 1) != 1) {
> +		printf("%d: error mapping qid to port\n", __LINE__);
> +		return -1;
> +	}
> +	if (rte_event_dev_start(evdev) < 0) {
> +		printf("%d: Error with start call\n", __LINE__);
> +		return -1;
> +	}
> +
> +	return run_prio_packet_test(t);
> +}
> +
> +static int
> +test_priority_ordered(struct test *t)
> +{
> +	if (init(t, 1, 1) < 0 ||
> +			create_ports(t, 1) < 0 ||
> +			create_ordered_qids(t, 1) < 0) {
> +		printf("%d: Error initializing device\n", __LINE__);
> +		return -1;
> +	}
> +
> +	/* map the QID */
> +	if (rte_event_port_link(evdev, t->port[0], &t->qid[0], NULL, 1) != 1) {
> +		printf("%d: error mapping qid to port\n", __LINE__);
> +		return -1;
> +	}
> +	if (rte_event_dev_start(evdev) < 0) {
> +		printf("%d: Error with start call\n", __LINE__);
> +		return -1;
> +	}
> +
> +	return run_prio_packet_test(t);
> +}
> +
> +static int
> +test_priority_unordered(struct test *t)
> +{
> +	if (init(t, 1, 1) < 0 ||
> +			create_ports(t, 1) < 0 ||
> +			create_unordered_qids(t, 1) < 0) {
> +		printf("%d: Error initializing device\n", __LINE__);
> +		return -1;
> +	}
> +
> +	/* map the QID */
> +	if (rte_event_port_link(evdev, t->port[0], &t->qid[0], NULL, 1) != 1) {
> +		printf("%d: error mapping qid to port\n", __LINE__);
> +		return -1;
> +	}
> +	if (rte_event_dev_start(evdev) < 0) {
> +		printf("%d: Error with start call\n", __LINE__);
> +		return -1;
> +	}
> +
> +	return run_prio_packet_test(t);
> +}
> +
>  static int
>  burst_packets(struct test *t)
>  {
> @@ -765,6 +947,347 @@ ordered_reconfigure(struct test *t)
>  }
>  
>  static int
> +qid_priorities(struct test *t)
> +{
> +	/* Test works by having a CQ with enough empty space for all packets,
> +	 * and enqueueing 3 packets to 3 QIDs. They must return based on the
> +	 * priority of the QID, not the ingress order, to pass the test
> +	 */
> +	unsigned int i;
> +	/* Create instance with 1 ports, and 3 qids */
> +	if (init(t, 3, 1) < 0 ||
> +			create_ports(t, 1) < 0) {
> +		printf("%d: Error initializing device\n", __LINE__);
> +		return -1;
> +	}
> +
> +	for (i = 0; i < 3; i++) {
> +		/* Create QID */
> +		const struct rte_event_queue_conf conf = {
> +			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
> +			/* increase priority (0 == highest), as we go */
> +			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL - i,
> +			.nb_atomic_flows = 1024,
> +			.nb_atomic_order_sequences = 1024,
> +		};
> +
> +		if (rte_event_queue_setup(evdev, i, &conf) < 0) {
> +			printf("%d: error creating qid %d\n", __LINE__, i);
> +			return -1;
> +		}
> +		t->qid[i] = i;
> +	}
> +	t->nb_qids = i;
> +	/* map all QIDs to port */
> +	rte_event_port_link(evdev, t->port[0], NULL, NULL, 0);
> +
> +	if (rte_event_dev_start(evdev) < 0) {
> +		printf("%d: Error with start call\n", __LINE__);
> +		return -1;
> +	}
> +
> +	/* enqueue 3 packets, setting seqn and QID to check priority */
> +	for (i = 0; i < 3; i++) {
> +		struct rte_event ev;
> +		struct rte_mbuf *arp = rte_gen_arp(0, t->mbuf_pool);
> +		if (!arp) {
> +			printf("%d: gen of pkt failed\n", __LINE__);
> +			return -1;
> +		}
> +		ev.queue_id = t->qid[i];
> +		ev.op = RTE_EVENT_OP_NEW;
> +		ev.mbuf = arp;
> +		arp->seqn = i;
> +
> +		int err = rte_event_enqueue_burst(evdev, t->port[0], &ev, 1);
> +		if (err != 1) {
> +			printf("%d: Failed to enqueue\n", __LINE__);
> +			return -1;
> +		}
> +	}
> +
> +	rte_event_schedule(evdev);
> +
> +	/* dequeue packets, verify priority was upheld */
> +	struct rte_event ev[32];
> +	uint32_t deq_pkts =
> +		rte_event_dequeue_burst(evdev, t->port[0], ev, 32, 0);
> +	if (deq_pkts != 3) {
> +		printf("%d: failed to deq packets\n", __LINE__);
> +		rte_event_dev_dump(evdev, stdout);
> +		return -1;
> +	}
> +	for (i = 0; i < 3; i++) {
> +		if (ev[i].mbuf->seqn != 2-i) {
> +			printf(
> +				"%d: qid priority test: seqn %d incorrectly prioritized\n",
> +					__LINE__, i);
> +		}
> +	}
> +
> +	cleanup(t);
> +	return 0;
> +}
> +
> +static int
> +load_balancing(struct test *t)
> +{
> +	const int rx_enq = 0;
> +	int err;
> +	uint32_t i;
> +
> +	if (init(t, 1, 4) < 0 ||
> +			create_ports(t, 4) < 0 ||
> +			create_atomic_qids(t, 1) < 0) {
> +		printf("%d: Error initializing device\n", __LINE__);
> +		return -1;
> +	}
> +
> +	for (i = 0; i < 3; i++) {
> +		/* map port 1 - 3 inclusive */
> +		if (rte_event_port_link(evdev, t->port[i+1], &t->qid[0],
> +				NULL, 1) != 1) {
> +			printf("%d: error mapping qid to port %d\n",
> +					__LINE__, i);
> +			return -1;
> +		}
> +	}
> +
> +	if (rte_event_dev_start(evdev) < 0) {
> +		printf("%d: Error with start call\n", __LINE__);
> +		return -1;
> +	}
> +
> +	/************** FORWARD ****************/
> +	/*
> +	 * Create a set of flows that test the load-balancing operation of the
> +	 * implementation. Fill CQ 0 and 1 with flows 0 and 1, and test
> +	 * with a new flow, which should be sent to the 3rd mapped CQ
> +	 */
> +	static uint32_t flows[] = {0, 1, 1, 0, 0, 2, 2, 0, 2};
> +
> +	for (i = 0; i < RTE_DIM(flows); i++) {
> +		struct rte_mbuf *arp = rte_gen_arp(0, t->mbuf_pool);
> +		if (!arp) {
> +			printf("%d: gen of pkt failed\n", __LINE__);
> +			return -1;
> +		}
> +
> +		struct rte_event ev = {
> +				.op = RTE_EVENT_OP_NEW,
> +				.queue_id = t->qid[0],
> +				.flow_id = flows[i],
> +				.mbuf = arp,
> +		};
> +		/* generate pkt and enqueue */
> +		err = rte_event_enqueue_burst(evdev, t->port[rx_enq], &ev, 1);
> +		if (err < 0) {
> +			printf("%d: Failed to enqueue\n", __LINE__);
> +			return -1;
> +		}
> +	}
> +
> +	rte_event_schedule(evdev);
> +
> +	struct test_event_dev_stats stats;
> +	err = test_event_dev_stats_get(evdev, &stats);
> +	if (err) {
> +		printf("%d: failed to get stats\n", __LINE__);
> +		return -1;
> +	}
> +
> +	if (stats.port_inflight[1] != 4) {
> +		printf("%d:%s: port 1 inflight not correct\n", __LINE__,
> +				__func__);
> +		return -1;
> +	}
> +	if (stats.port_inflight[2] != 2) {
> +		printf("%d:%s: port 2 inflight not correct\n", __LINE__,
> +				__func__);
> +		return -1;
> +	}
> +	if (stats.port_inflight[3] != 3) {
> +		printf("%d:%s: port 3 inflight not correct\n", __LINE__,
> +				__func__);
> +		return -1;
> +	}
> +
> +	cleanup(t);
> +	return 0;
> +}
> +
> +static int
> +load_balancing_history(struct test *t)
> +{
> +	struct test_event_dev_stats stats = {0};
> +	const int rx_enq = 0;
> +	int err;
> +	uint32_t i;
> +
> +	/* Create instance with 1 atomic QID going to 3 ports + 1 prod port */
> +	if (init(t, 1, 4) < 0 ||
> +			create_ports(t, 4) < 0 ||
> +			create_atomic_qids(t, 1) < 0)
> +		return -1;
> +
> +	/* CQ mapping to QID */
> +	if (rte_event_port_link(evdev, t->port[1], &t->qid[0], NULL, 1) != 1) {
> +		printf("%d: error mapping port 1 qid\n", __LINE__);
> +		return -1;
> +	}
> +	if (rte_event_port_link(evdev, t->port[2], &t->qid[0], NULL, 1) != 1) {
> +		printf("%d: error mapping port 2 qid\n", __LINE__);
> +		return -1;
> +	}
> +	if (rte_event_port_link(evdev, t->port[3], &t->qid[0], NULL, 1) != 1) {
> +		printf("%d: error mapping port 3 qid\n", __LINE__);
> +		return -1;
> +	}
> +	if (rte_event_dev_start(evdev) < 0) {
> +		printf("%d: Error with start call\n", __LINE__);
> +		return -1;
> +	}
> +
> +	/*
> +	 * Create a set of flows that test the load-balancing operation of the
> +	 * implementation. Fill CQ 0, 1 and 2 with flows 0, 1 and 2, drop
> +	 * the packet from CQ 0, send in a new set of flows. Ensure that:
> +	 *  1. The new flow 3 gets into the empty CQ0
> +	 *  2. packets for existing flow gets added into CQ1
> +	 *  3. Next flow 0 pkt is now onto CQ2, since CQ0 and CQ1 now contain
> +	 *     more outstanding pkts
> +	 *
> +	 *  This test makes sure that when a flow ends (i.e. all packets
> +	 *  have been completed for that flow), that the flow can be moved
> +	 *  to a different CQ when new packets come in for that flow.
> +	 */
> +	static uint32_t flows1[] = {0, 1, 1, 2};
> +
> +	for (i = 0; i < RTE_DIM(flows1); i++) {
> +		struct rte_mbuf *arp = rte_gen_arp(0, t->mbuf_pool);
> +		struct rte_event ev = {
> +				.flow_id = flows1[i],
> +				.op = RTE_EVENT_OP_NEW,
> +				.queue_id = t->qid[0],
> +				.event_type = RTE_EVENT_TYPE_CPU,
> +				.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
> +				.mbuf = arp
> +		};
> +
> +		if (!arp) {
> +			printf("%d: gen of pkt failed\n", __LINE__);
> +			return -1;
> +		}
> +		arp->hash.rss = flows1[i];
> +		err = rte_event_enqueue_burst(evdev, t->port[rx_enq], &ev, 1);
> +		if (err < 0) {
> +			printf("%d: Failed to enqueue\n", __LINE__);
> +			return -1;
> +		}
> +	}
> +
> +	/* call the scheduler */
> +	rte_event_schedule(evdev);
> +
> +	/* Dequeue the flow 0 packet from port 1, so that we can then drop */
> +	struct rte_event ev;
> +	if (!rte_event_dequeue_burst(evdev, t->port[1], &ev, 1, 0)) {
> +		printf("%d: failed to dequeue\n", __LINE__);
> +		return -1;
> +	}
> +	if (ev.mbuf->hash.rss != flows1[0]) {
> +		printf("%d: unexpected flow received\n", __LINE__);
> +		return -1;
> +	}
> +
> +	/* drop the flow 0 packet from port 1 */
> +	rte_event_enqueue_burst(evdev, t->port[1], &release_ev, 1);
> +
> +	/* call the scheduler */
> +	rte_event_schedule(evdev);
> +
> +	/*
> +	 * Set up the next set of flows, first a new flow to fill up
> +	 * CQ 0, so that the next flow 0 packet should go to CQ2
> +	 */
> +	static uint32_t flows2[] = { 3, 3, 3, 1, 1, 0 };
> +
> +	for (i = 0; i < RTE_DIM(flows2); i++) {
> +		struct rte_mbuf *arp = rte_gen_arp(0, t->mbuf_pool);
> +		struct rte_event ev = {
> +				.flow_id = flows2[i],
> +				.op = RTE_EVENT_OP_NEW,
> +				.queue_id = t->qid[0],
> +				.event_type = RTE_EVENT_TYPE_CPU,
> +				.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
> +				.mbuf = arp
> +		};
> +
> +		if (!arp) {
> +			printf("%d: gen of pkt failed\n", __LINE__);
> +			return -1;
> +		}
> +		arp->hash.rss = flows2[i];
> +
> +		err = rte_event_enqueue_burst(evdev, t->port[rx_enq], &ev, 1);
> +		if (err < 0) {
> +			printf("%d: Failed to enqueue\n", __LINE__);
> +			return -1;
> +		}
> +	}
> +
> +	/* schedule */
> +	rte_event_schedule(evdev);
> +
> +	err = test_event_dev_stats_get(evdev, &stats);
> +	if (err) {
> +		printf("%d:failed to get stats\n", __LINE__);
> +		return -1;
> +	}
> +
> +	/*
> +	 * Now check the resulting inflights on each port.
> +	 */
> +	if (stats.port_inflight[1] != 3) {
> +		printf("%d:%s: port 1 inflight not correct\n", __LINE__,
> +				__func__);
> +		printf("Inflights, ports 1, 2, 3: %u, %u, %u\n",
> +				(unsigned int)stats.port_inflight[1],
> +				(unsigned int)stats.port_inflight[2],
> +				(unsigned int)stats.port_inflight[3]);
> +		return -1;
> +	}
> +	if (stats.port_inflight[2] != 4) {
> +		printf("%d:%s: port 2 inflight not correct\n", __LINE__,
> +				__func__);
> +		printf("Inflights, ports 1, 2, 3: %u, %u, %u\n",
> +				(unsigned int)stats.port_inflight[1],
> +				(unsigned int)stats.port_inflight[2],
> +				(unsigned int)stats.port_inflight[3]);
> +		return -1;
> +	}
> +	if (stats.port_inflight[3] != 2) {
> +		printf("%d:%s: port 3 inflight not correct\n", __LINE__,
> +				__func__);
> +		printf("Inflights, ports 1, 2, 3: %u, %u, %u\n",
> +				(unsigned int)stats.port_inflight[1],
> +				(unsigned int)stats.port_inflight[2],
> +				(unsigned int)stats.port_inflight[3]);
> +		return -1;
> +	}
> +
> +	for (i = 1; i <= 3; i++) {
> +		struct rte_event ev;
> +		while (rte_event_dequeue_burst(evdev, i, &ev, 1, 0))
> +			rte_event_enqueue_burst(evdev, i, &release_ev, 1);
> +	}
> +	rte_event_schedule(evdev);
> +
> +	cleanup(t);
> +	return 0;
> +}
> +
> +static int
>  invalid_qid(struct test *t)
>  {
>  	struct test_event_dev_stats stats;
> @@ -1370,12 +1893,49 @@ test_sw_eventdev(void)
>  		printf("ERROR - Burst Packets test FAILED.\n");
>  		return ret;
>  	}
> +	printf("*** Running Load Balancing test...\n");
> +	ret = load_balancing(t);
> +	if (ret != 0) {
> +		printf("ERROR - Load Balancing test FAILED.\n");
> +		return ret;
> +	}
> +	printf("*** Running Prioritized Directed test...\n");
> +	ret = test_priority_directed(t);
> +	if (ret != 0) {
> +		printf("ERROR - Prioritized Directed test FAILED.\n");
> +		return ret;
> +	}
> +	printf("*** Running Prioritized Atomic test...\n");
> +	ret = test_priority_atomic(t);
> +	if (ret != 0) {
> +		printf("ERROR - Prioritized Atomic test FAILED.\n");
> +		return ret;
> +	}
> +
> +	printf("*** Running Prioritized Ordered test...\n");
> +	ret = test_priority_ordered(t);
> +	if (ret != 0) {
> +		printf("ERROR - Prioritized Ordered test FAILED.\n");
> +		return ret;
> +	}
> +	printf("*** Running Prioritized Unordered test...\n");
> +	ret = test_priority_unordered(t);
> +	if (ret != 0) {
> +		printf("ERROR - Prioritized Unordered test FAILED.\n");
> +		return ret;
> +	}
>  	printf("*** Running Invalid QID test...\n");
>  	ret = invalid_qid(t);
>  	if (ret != 0) {
>  		printf("ERROR - Invalid QID test FAILED.\n");
>  		return ret;
>  	}
> +	printf("*** Running Load Balancing History test...\n");
> +	ret = load_balancing_history(t);
> +	if (ret != 0) {
> +		printf("ERROR - Load Balancing History test FAILED.\n");
> +		return ret;
> +	}
>  	printf("*** Running Inflight Count test...\n");
>  	ret = inflight_counts(t);
>  	if (ret != 0) {
> @@ -1388,6 +1948,12 @@ test_sw_eventdev(void)
>  		printf("ERROR - Abuse Inflights test FAILED.\n");
>  		return ret;
>  	}
> +	printf("*** Running QID Priority test...\n");
> +	ret = qid_priorities(t);
> +	if (ret != 0) {
> +		printf("ERROR - QID Priority test FAILED.\n");
> +		return ret;
> +	}
>  	printf("*** Running Ordered Reconfigure test...\n");
>  	ret = ordered_reconfigure(t);
>  	if (ret != 0) {
> -- 
> 2.7.4
>