From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0078.outbound.protection.outlook.com [104.47.38.78]) by dpdk.org (Postfix) with ESMTP id 87D59199A9 for ; Fri, 15 Sep 2017 08:07:41 +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=DRcfUIrpoSoY+yWFpmSP+gtw1w3woOaBO02w8YUX3Gk=; b=kjiYmkQ24S85Z7hmgdDb4SXyblfPxNZrAlO8NUAP3wFPxfF3h/3yCy/23821iZjTKlI0URKYapd1L9lcEAWACdE/XfFoSWblp5tCG7B0GDLFhD8xgMF0cYqWdTV0PXRtyY+/s6cv5pNA9DfiNCdrBdjFtafM+ueGbvDl7XFsVCA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [IPv6:2401:4900:1987:ff18:e51f:824b:a2cd:22cb] (2401:4900:1987:ff18:e51f:824b:a2cd:22cb) by MWHPR07MB3103.namprd07.prod.outlook.com (10.172.95.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Fri, 15 Sep 2017 06:07:34 +0000 To: Nikhil Rao , jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com References: <1505219369-2493-1-git-send-email-nikhil.rao@intel.com> <1505219369-2493-5-git-send-email-nikhil.rao@intel.com> Cc: gage.eads@intel.com, dev@dpdk.org, thomas@monjalon.net, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, narender.vangati@intel.com, erik.g.carrillo@intel.com, abhinandan.gujjar@intel.com From: santosh Message-ID: <97759889-9349-ee87-2386-666973f162d1@caviumnetworks.com> Date: Fri, 15 Sep 2017 11:37:18 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1505219369-2493-5-git-send-email-nikhil.rao@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [2401:4900:1987:ff18:e51f:824b:a2cd:22cb] X-ClientProxiedBy: BM1PR01CA0087.INDPRD01.PROD.OUTLOOK.COM (10.174.208.155) To MWHPR07MB3103.namprd07.prod.outlook.com (10.172.95.9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89c21566-6c33-44b4-6bd2-08d4fc001188 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR07MB3103; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3103; 3:bMxQaTN+BQHCNBdK1WSuspgzIHjVzNhuXSMbMAZLuA7b4aXnVFk5qcXcqnrxg+292BR86WOE+73GlPs2u2yVf5R/QDuyaDw+4X9uRd1m2JI6CnhkYO+2PTijrO0sgEXVmlEqtGJJEU/RLu31DNVkMMVjXXJZ1Ygntix0QurBQefto4OSvKEwIjZjQUbzInGC+XllpUH4TOl4u3qzX425blVExY8bvNgad7dzwXCrQNMjAw0lo6h+W1l/aJXjAPNa; 25:nL8H2oSfTI/yBbx7UGxmY9Eh8ZaELNDS54GWbWz4lOWHife5/RsWdOghOwxTGzwgDHijgd/g8ozUiVxuXB76JW+xOrcGCucccSGt9/RHGYQ11mExDVgvSsPQD72WbTvrVN1sb5LcnIi9lE0vmldJ5sTM/wRmflFGXUA5qUpykSx/wwjXEoafrzYhdvJehpFzPxsyQkYrMfCBumLDHuJjKobEOhCIx6LTcsQbqr7ms48yEFLqMmtnD8o7vz1Jq/Yif86Gtl/aj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hmNsxlLqZ/qWjdTQ9mihJvZPg/GFCXTftZX3aKfT7VwAVswNY6lZUql26usgn9SfxVlfS8wjlCLhC/1pjamZAiuPpqRQ6POvOk3vgDkCclo0E+yk+B1yuTt3TZJfQU+y50ZzQ1NbL1Fne0tkhwgU9tRCIfKtcN4UpvAEd+Bnackf+FgbOw/gfL0F50h8N2yWAg9+ndtWeFU5WDC8k+MAgE58om3dfCZE= X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(93006095)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123564025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3103; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3103; X-Forefront-PRVS: 0431F981D8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6059001)(346002)(376002)(199003)(189002)(24454002)(377454003)(2906002)(97736004)(7416002)(64126003)(230700001)(54356999)(76176999)(50466002)(189998001)(305945005)(101416001)(7736002)(316002)(25786009)(83506001)(478600001)(33646002)(81166006)(65826007)(5660300001)(8676002)(81156014)(68736007)(31686004)(966005)(6116002)(72206003)(110136004)(6306002)(229853002)(53376002)(1706002)(6246003)(47776003)(23746002)(65956001)(8656003)(86152003)(6486002)(575784001)(50986999)(6666003)(106356001)(105586002)(53936002)(4326008)(36756003)(2950100002)(65806001)(8936002)(58126008)(31696002)(42882006)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3103; H:[IPv6:2401:4900:1987:ff18:e51f:824b:a2cd:22cb]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; MWHPR07MB3103; 23:/Rpr01TD2jUHlPSE/VfyZZuJHudBahuypvCtR?= =?Windows-1252?Q?9rTeKWsRDSZ+CSTZWVL3mnzaQZdTOTg8AcSePRQgO1M9GONm1EjTk7eg?= =?Windows-1252?Q?h9PJ3fQ/R18emFKUop0u8+ANF8IrXgGimtOu3JlLJ7/7tB4YQO0uuOmI?= =?Windows-1252?Q?ynAWwzbwnF1NmC+q8zAFhqIdhrl3GDcKq/Bi5DZedoat1G6A2PfwxEHh?= =?Windows-1252?Q?3fl6WqYxGNT3qy52OIvXqjo4SyHftaudiiyl3Ta2WONS29JSo2VWyp/i?= =?Windows-1252?Q?5c5UDT6WcMjeZwuLD1EdSJ8q1HQqjPBi7oJWX3P4WLkAoHSLGCl9heV7?= =?Windows-1252?Q?1NeNpyKi919XZs/ZpKkH7iEKywS1kVJDpLGXquCsqdX1xcCYWaKun+/5?= =?Windows-1252?Q?LZqkv5LYTyhgWegwi9jSWh4zhuwr3dAjuLMzGLq1tV/oJJjapLNg4LM/?= =?Windows-1252?Q?emLzYs9BiqJ5uRUvS0Cbzd/byYZ0L7L3SCtA0oOpb0gy8/Oa9lU5ZNH4?= =?Windows-1252?Q?63eRajIYlEb4sLZ/S96pOWf8mGqzoLoTJtzHRAc+m2x2Lx2yKsWdQPJK?= =?Windows-1252?Q?8nwZGmv/pEJVNT2OETkdB1XCdiHvljUoWUM97YlR9S9TbCEJtyoR+89G?= =?Windows-1252?Q?3BHTdaz6mphOB3W3ekyg/ueEIjlsZJuLRu7ZFHsmivqbdz6pvzNgfFv7?= =?Windows-1252?Q?3PKIaPmP8KL4KpjRAgYduLcaLBSrX5YikqGgbUiCZQySbkN/dYamKEC2?= =?Windows-1252?Q?ud25JjpmuPdBYspqFSihbVJCbGy/L8bLIqKNN+t6UaNABFi1kUfOljgc?= =?Windows-1252?Q?+OI5hagAIeZLvUXsso6DScyoAoVugAYNVhDdUuJYXDToQhV66XbIIU2p?= =?Windows-1252?Q?vB6pz4LKQsF6mP0hqsb9kkchBxVFDLEnnhQgT11aXGX+SWmRMkUlQzpZ?= =?Windows-1252?Q?3zy9sbjdXtcH4Chn6+Fg37vV0lsLxuzm41ne8fuFfT3PJl6kCmL1FKPW?= =?Windows-1252?Q?lh0xm787ZnW9wySp615cieSGXWNupnR4FzWQx7tR05c5IHE53Kb5PCpt?= =?Windows-1252?Q?Ktvy8i8kIyTjCZQl3yemLXNprE1cfZMPBKjkw4E46rY3fRGb9kqmuTTK?= =?Windows-1252?Q?j9uFmLaFnSPfvTA5vE7bJlUgh2EIuOdBLdvKyz+a3jX09E+QO+3Cdkl4?= =?Windows-1252?Q?9pv1xGaafq1BeEKfqCupsd74VEvL57QtevqjoxVZ0USserV57CWzoahK?= =?Windows-1252?Q?DzL+D5YlrgdCdwcQZNGBhXqYKTFotpKr2ixGSw1DPvKtOUqXtVqhzxER?= =?Windows-1252?Q?sRIRKYvqYP5ULLKTFtxMcV19jmS5EG9pOWW8Bvb6t4lnOhb9pn9yIM71?= =?Windows-1252?Q?jNhYAz6OF3drDgT4iJ/9hO/r49BUKp5SSTAI2FBMViHeY5zFm5auY7n5?= =?Windows-1252?Q?WiHieBYGKAPqzx4LmrNBHxh/3ffxlQhXHRtln0EoYgEZpKa4INhqUxCY?= =?Windows-1252?Q?zEEytwy4PUvq8yaX4diT1SMjjZ0kkMQB9HL151ohppeZP9ZuA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3103; 6:D9syazjh7W4ZBo8vNrkvNwHSabQi+2mwh8KICaiJP6PNALYtzy7tVCigyLEzJPQTr5ijZ3GXbxfIuSpJyHOAFjUT9dE23WWe/UOumxtcUNFwpBcRQ4D28KWRvNqMVXDoNLuV9b6F+KASeaiwz8xH1y+ZdTj7u7lpJgTfWwZDuTwoKDSFNDwXZk5HDpBT2338nylwRX5JjQ9gLY5qUUgtB8dBci2iZ/xJ25FXc4Mcq47LQjm5nn+E24b2MXjqCfT9RQ56NN728akK8rIzphwLuH5nrTCc+klwjoLqE8CHmT9t0zHatvbPKT2NnyCtbY944AF3jurVnEJxaayeKSqQgw==; 5:fkIFeWwmswjQS1EJcABnJkLiGgQqe4VB232qqaVws9Cy8y8oyn/O9SoRId5rXuXUBc2TZC9fvzYpWKwkMfTxYwfsPXL0DiZ6pfUOxf89VQL0cB68/Kj2JmiRqJabHUiOtxhv8TS1HYfg9rtPRuYQVA==; 24:Zl6OiffsowQwf+nPZ2Qu58B07KiAGDGQlM7hqKtFto9wsP0FDjYgnU9za/OaJvmgp1BBZtrq3WLyG+or2WNeda2AZDgE7wBoNCJ9nDePopw=; 7:dO30bO/0PAXTP+TFH4FDxXQqqJadVYba6UJKft87FN7wfvbcO4NUgAOgbw1es1TxgsnndS87UrxP0jkbmtQ9LU4fISgy5tQkXgqw8EDnnnlfBpxMUYo4Phhv6GIYQcJqFsE0hbm/eW8O8GhSPBVbIbVpsH6u/Lzoz5Jnsm08cAYb1uoBiOoOBhQAw0gtYwKWZwOHxcc5svngFQJIPyerjHvPtxtCT3Lbh1mtnJH1G0Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2017 06:07:34.9341 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3103 Subject: Re: [dpdk-dev] [PATCH v3 4/4] eventdev: Add tests for event eth Rx adapter APIs 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: Fri, 15 Sep 2017 06:07:42 -0000 Hi Nikhil, On Tuesday 12 September 2017 05:59 PM, Nikhil Rao wrote: > Add unit tests for rte_event_eth_rx_adapter_xxx() APIs > > Signed-off-by: Nikhil Rao > --- > test/test/test_event_eth_rx_adapter.c | 385 ++++++++++++++++++++++++++++++++++ > test/test/Makefile | 1 + > 2 files changed, 386 insertions(+) > create mode 100644 test/test/test_event_eth_rx_adapter.c patch breaks build: http://dpdk.org/ml/archives/test-report/2017-September/029088.html > diff --git a/test/test/test_event_eth_rx_adapter.c b/test/test/test_event_eth_rx_adapter.c > new file mode 100644 > index 0000000..d338b0b > --- /dev/null > +++ b/test/test/test_event_eth_rx_adapter.c > @@ -0,0 +1,385 @@ > +/*- > + * BSD LICENSE > + * > + * Copyright(c) 2017 Intel Corporation. All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * > + * * Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * * Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in > + * the documentation and/or other materials provided with the > + * distribution. > + * * Neither the name of Intel Corporation nor the names of its > + * contributors may be used to endorse or promote products derived > + * from this software without specific prior written permission. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR > + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT > + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, > + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include "test.h" > + > +/* i40e limits max to 64 */ > +#define MAX_NUM_RX_QUEUE 64 > +struct rte_mempool *mp; Pl. avoid globals for mempool, I did similar cleanup for mempool tests in past. And in your test case, few functions are are pool consumer so I suggest to add mempool * arg to those function. > +uint16_t rx_rings, tx_rings; > +uint32_t cap; > + > +static inline int > +port_init(uint8_t port, struct rte_mempool *mp) > +{ > + static const struct rte_eth_conf port_conf_default = { > + .rxmode = { > + .mq_mode = ETH_MQ_RX_RSS, > + .max_rx_pkt_len = ETHER_MAX_LEN > + }, > + .rx_adv_conf = { > + .rss_conf = { > + .rss_hf = ETH_RSS_IP | > + ETH_RSS_TCP | > + ETH_RSS_UDP, > + } > + } > + }; > + const uint16_t rx_ring_size = 512, tx_ring_size = 512; > + struct rte_eth_conf port_conf = port_conf_default; > + int retval; > + uint16_t q; > + struct rte_eth_dev_info dev_info; > + > + if (port >= rte_eth_dev_count()) > + return -1; > + > + rte_eth_dev_info_get(port, &dev_info); > + rx_rings = RTE_MIN(MAX_NUM_RX_QUEUE, dev_info.max_rx_queues); > + > + /* Configure the Ethernet device. */ > + retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); > + if (retval != 0) > + return retval; > + > + for (q = 0; q < rx_rings; q++) { > + retval = rte_eth_rx_queue_setup(port, q, rx_ring_size, > + rte_eth_dev_socket_id(port), NULL, mp); > + if (retval < 0) > + return retval; > + } > + > + /* Allocate and set up 1 TX queue per Ethernet port. */ > + for (q = 0; q < tx_rings; q++) { > + retval = rte_eth_tx_queue_setup(port, q, tx_ring_size, > + rte_eth_dev_socket_id(port), NULL); > + if (retval < 0) > + return retval; > + } > + > + /* Start the Ethernet port. */ > + retval = rte_eth_dev_start(port); > + if (retval < 0) > + return retval; > + > + /* Display the port MAC address. */ > + struct ether_addr addr; > + rte_eth_macaddr_get(port, &addr); > + printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 > + " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", > + (unsigned int)port, > + addr.addr_bytes[0], addr.addr_bytes[1], > + addr.addr_bytes[2], addr.addr_bytes[3], > + addr.addr_bytes[4], addr.addr_bytes[5]); > + > + /* Enable RX in promiscuous mode for the Ethernet device. */ > + rte_eth_promiscuous_enable(port); > + > + return 0; > +} > + > +static int > +init_ports(int num_ports) > +{ > + uint8_t portid; > + > + mp = rte_pktmbuf_pool_create("packet_pool", > + /* mbufs */ 8192 * num_ports * MAX_NUM_RX_QUEUE, > + /* cache_size */ 512, Use macro for cache_size value, same comment for mbufs. Something like, for cache_size: RTE_MEMPOOL_CACHE_MAX_SIZE, Local test macro for mbuf could be: MBUF_xxx, see test/test/test_mbuf.c. Thanks.