From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0083.outbound.protection.outlook.com [104.47.37.83]) by dpdk.org (Postfix) with ESMTP id F1FC02A5E for ; Wed, 23 Nov 2016 04:32:53 +0100 (CET) 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=fZnvm4oTi6b/ftFFlcGvJmRvJ8smH6VBsIop9eoepQg=; b=JQ5FXwQGW/lbCAJpJG44i8rxwvcsWmJQ/zL2a8nPnR+25SP4PMbNQV46Gzk47tNVygMt7gj8UTAEHcJZ3B/cqBqCpOlIb+Lm4KewhostmEmimzMLY7OzqA2lvjhpZ15bX0PuyrxcCfi3hTAQvebOt28O/SCcMbMw6a5kOoTUAtY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from svelivela-lt.caveonetworks.com (50.233.148.156) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Wed, 23 Nov 2016 03:32:50 +0000 Date: Wed, 23 Nov 2016 09:02:46 +0530 From: Jerin Jacob To: Harry van Haaren CC: , Gage Eads , David Hunt Message-ID: <20161123033245.GA30043@svelivela-lt.caveonetworks.com> References: <1479319207-130646-1-git-send-email-harry.van.haaren@intel.com> <1479319207-130646-6-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: <1479319207-130646-6-git-send-email-harry.van.haaren@intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: BY1PR13CA0002.namprd13.prod.outlook.com (10.162.107.140) To BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 2:+mNyPmq5RC7yM7F1nF4zg9qsYjshi0h75z0AxpF8f0fCnXITx7VqGVXDgDqav2acN2vCCTkcrEjF0G9f2q+5toPsXb1FcYJNutnzLDbqLDuOfxo2t37aeWzjOUGLrKCmGHZ0E0aCAtHNYrj6GefVmNsSx5ZI+W5DL5rVnht2+lA=; 3:8ISR+EVRa18dN3cFspvHr3o2bW7fQPeg71kOjgcMcxcHkmcHR2Iwtv9wUJ3xhvgQ7Bcwk9UeOCpf+sz4TYASwY6oGmv1oa2LGUY6Rv64VyjtDdwFznnQvT6NKZ4A7EDyuBaYZ3ripacNFsQ+BFGKCnYDp2FwT0D0tel+nrFHsYQ=; 25:245vuNWzzNnXeL3wsPpAHZJo3bvH+8L4UowyKPoC+dIqcV4P3/bd95UmjYg2miPRVJqAwkm82rf+VkIb156bDuDV8AQC/z8KdYaIXvy40bKHWa8s3ZnoA/964V7pTwIJ+rnFLW27wck9UvYZwUtrX+6XbPYCMcBPMdAEt2QWKLCNXA67w0Rz4+q3hTAR80xzfMWcpfGRMksK6iluhSCMz1xflKeDvI5jtVtMxqwbyzOp7Du8URLbVzLb7dEOh6fqPiAcOaJ21iDoRTVL7s9xJJYUtYSPlqWPavhCd5PGr8rHU6KMTwbAPR0EsvodF0M1PeybhmB7zUgdEHMxWB4wnn+sybokBzFAQCcBvAOvMvZC3EAS8QssOTfdwgcOkmWdOGENhN/oZj7piK41zIFzWy4n90wpilOtjHg7hSg0B/nJwNYGUmqo+IK+pTkClohemWgegvqYWxQtqFC1VYOsDA== X-MS-Office365-Filtering-Correlation-Id: e8773d51-4671-4e09-5af1-08d4135166a4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 31:q7va7K+W+fdfNcZse/xh1N/pe878AW9VyL66ytFyvoqCKmLLd/i70Ekx/KR3oFjk043dGh9K0cVD/GCN23TD84Vp3IQ/EO/lWahyHvIsfV8MVB1QqGs0f0yIBGfRJameH7BBGt+2jRBoNTqyKg1/S7DlG8WX6LJNMtsWr7F+17pyeaYeYS0ZOMSkNRxjwK4RQjLaKYivwZKtonFd3xhlEK9A6ZNvl3v1eP1ZjgqRW7nSFKliEDk1RP7BQyre3lYtpyUSE4utAGErjFUDlOx9/A==; 20:tygaW0P7d2i1mgWlPy0yct0clU9nRH+qR1cBSSz5vmNdUxBWc0d38UQyU844Gq6hyZsRz7jlzKNscO9axo1uzp/YNnpWhHjb4QRc53JRdFJ32veT8ukkRuCDgG+o+h6qJ+ms5VS4hmJZg7CYXgz0G003pBU9WTY9Vbq80UYg4x4gyGZE0eRTQ2uDOGwaVtNp6pNhVmBOwmcAER1vA6oJWMiMM+fi0bBa9GHEBVdWna4T52Qc/amQlQ6WlzQGILaUqtGmSDPvc+sOqUusZAwmdisTbZZLVaEZAfl412jZJyKxIoTLeckTbzDaadC107Na9lE6zI/boHhFW4IyFqEbFq1ccAQQQYYhtJPSxWoTeE5t8gnrzh4meQLKZ3yjTjySYixMAbGCkEG5ud9ti2os4ZuFxU1o2tyEh8UV+KF6r6Ia9aYEib5oRGa9WgiSJtPYiSGxlNSSua4EkFzVVfOPYh89qrS7Yf2DoJZtIyr992j+yA1OMsjEVJga7ATzhJMAvvBSFJCu1bvSHZFKeJd0pXmdANq4zz5Oxd0MkDNk+JmPxDY8sR2ndsqmCFws8OJDTwg8PlBH6RWgW64d6GTybjNJf4nZMG3uBS4pCXYIi9M= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6060326)(6040307)(6045199)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6061324)(6041248); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:X2M6x6J7Nicgop6/mAunN3REGxaw/4r8cFoZG59c23i7TO7cgoDN7VYy65Q9jPr4WRnYdBxrBZxCBhigGirMcIgBhI1WbhweJS722+lqRkv62JQx7IV8w6rVr7Jszb46I9axAb+R6OadtjswylLIzKCDBd3kkl8NZW+hpXw8yMgrTkRjXHNO/iq74AGNxRLfPCSklji87pcJz3ZgZOuQIpZwG9yknWm6mNi1njPBnd5owQMt1rBX1F6R8gFL0eoANUgIqRjUFqtU4i18bHVlF17MRgb9Oq0GJo0KCI/cUM3NMHNXQU/pKvAtnZ08SMJRYN1qTXgP7q9xUm3mn7zJnmbFhbQO20vdEajyVSJ+svBSDepzxVy9aOvnvijbum+P7bl4HISsrAybHHlP6yUO0p2RzHq8ZVfchKZPd/uBIQ/EoZCZIoqeg7L504/aBm+ZcJxoqK9YPXKQ2LBChhiK3/SeTk8MdkmQDFRv72HbOobW1YS3Jam7IIHhbxFQkeeTX6fFjgi58Sp4RPG+FJ339Q== X-Forefront-PRVS: 013568035E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(24454002)(23726003)(3846002)(76176999)(6116002)(1076002)(54356999)(4326007)(97756001)(50986999)(47776003)(8676002)(101416001)(81156014)(81166006)(6666003)(9686002)(66066001)(77096005)(50466002)(33656002)(2906002)(68736007)(189998001)(4001350100001)(106356001)(97736004)(42186005)(46406003)(229853002)(105586002)(53416004)(110136003)(2950100002)(42882006)(7736002)(92566002)(83506001)(6916009)(7846002)(38730400001)(305945005)(69596002)(5660300001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:svelivela-lt.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1723; 23:MKIbfYei6tygI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5Cgk3urwwqvMZsB7W3HK+BPqPEmgkBKmimFlAtX29V0O20= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 7:DCmHqPVMJoGaLHqSjf/iGA/kgXRO8bWGUr12HkHz1/rTw9DD8tl8okjktEiq5kXv19LahNfjemz5kR2ZFJMh8uC9aiPGrEGm8r2EGUYr6XqLEtqcFcCE5fukZAYAMZE2lIWz1avIZvbxxl1Lp9kaCLE7knRrrl0odCtUK8UwIniwTmpeNcy536Y18jDVVUFimQZjvZApQO2w+qQQ5xHo5ns4OGDOB3M8aJ5W4ueE0H7I7FBW3BUt3c1oJHCoCsbeRuJyc33+cZ6r+deB3znBFPOX2FYTK/bXOCjBIC4AKVxEmQ6vY2E8avDIDyrOb38JHajj6S9kn1axz6X8DQhrpgkGZNvSWGf3e/EvQqaBALU= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2016 03:32:50.0537 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: Re: [dpdk-dev] [PATCH 5/7] test/eventdev: unit and functional tests X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2016 03:32:54 -0000 On Wed, Nov 16, 2016 at 06:00:05PM +0000, Harry van Haaren wrote: > This commit adds basic unit and functional tests for the eventdev > API. The test code is added in this commit, but not yet enabled until > the next commit. > > Signed-off-by: Gage Eads > Signed-off-by: David Hunt > Signed-off-by: Harry van Haaren > --- A few comments on portability and usage perspective. See below, > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include "test.h" > + > + > +static inline int > +create_ports(struct test *t, int num_ports) > +{ > + int i; > + static const struct rte_event_port_conf conf = { > + .dequeue_queue_depth = 32, > + .enqueue_queue_depth = 64, > + }; Check the max supported through info get first. > + > + for (i = 0; i < num_ports; i++) { > + if (rte_event_port_setup(t->ev, i, &conf) < 0) { > + printf("Error setting up port %d\n", i); > + return -1; > + } > + t->port[i] = i; > + } > + > + return 0; > +} > + > + > +static int > +run_prio_packet_test(struct test *t) Run per event enqueue priority test if the platform supports RTE_EVENT_DEV_CAP_EVENT_QOS > +{ > + int err; > + const uint32_t MAGIC_SEQN[] = {4711, 1234}; > + const uint32_t PRIORITY[] = {3, 0}; > + unsigned 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]; For me, it make sense to don't touch any field in mbuf to make eventdev model works. use private field to store test specific data > + > + ev = (struct rte_event){ > + .priority = PRIORITY[i], > + .operation = RTE_EVENT_OP_NEW, > + .queue_id = t->qid[0], > + .mbuf = arp > + }; > + err = rte_event_enqueue(t->ev, t->port[0], &ev, 0); > + if (err < 0) { > + printf("%d: error failed to enqueue\n", __LINE__); > + return -1; > + } > + } > + > + rte_event_schedule(t->ev); > + > + struct rte_event_dev_stats stats; > + err = rte_event_dev_stats_get(t->ev, &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(stdout, t->ev); > + return -1; > + } rely on stats for functional verification may not work in all the implementation. makes sense to have more concrete functional verification without stats > + > + struct rte_event ev, ev2; > + uint32_t deq_pkts; > + deq_pkts = rte_event_dequeue(t->ev, t->port[0], &ev, 0); > + if (deq_pkts != 1) { > + printf("%d: error failed to deq\n", __LINE__); > + rte_event_dev_dump(stdout, t->ev); > + return -1; > + } > + if(ev.mbuf->seqn != MAGIC_SEQN[1]) { > + printf("%d: first packet out not highest priority\n", __LINE__); > + rte_event_dev_dump(stdout, t->ev); > + return -1; > + } > + rte_pktmbuf_free(ev.mbuf); > + > + > +static int > +test_overload_trip(struct test *t) overload tests wont fail in ddr backed systems.(ddr backed system will mimic infinite size queue to application). So testing against failure may not work at all in some implementation > +{ > + int err; > + > + /* Create instance with 3 directed QIDs going to 3 ports */ > + if (init(t, 1, 1) < 0 || > + create_ports(t, 1) < 0 || > + create_atomic_qids(t, 1) < 0) > + return -1; > +