From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10049.outbound.protection.outlook.com [40.107.1.49]) by dpdk.org (Postfix) with ESMTP id B39B41B332 for ; Mon, 5 Feb 2018 12:09:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=mPS6meimvCTPE2NU2Zfi9sL8cHWNGoeYJOS1AKwLcHk=; b=PAbE89sYRUpdJVr423YcQKCRQsVntNqNjRzxCf4aHbSpOGX5d3YQpnq2onrupgujeqexerJPmf2BYSaOp3LGDm9Loi+FPWCdSE8tMxlN70I3FiG00Lma4DFh4x4dRUazdEXlGRDGv2X4V1O065f1cAM/XwugSsz48mvLvqCNPFI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (192.88.169.1) by AM5PR0401MB2451.eurprd04.prod.outlook.com (2603:10a6:203:35::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Mon, 5 Feb 2018 11:09:50 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: dev@dpdk.org, Shreyansh Jain Date: Mon, 5 Feb 2018 16:54:25 +0530 Message-Id: <20180205112425.17579-1-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180205111614.18461-1-shreyansh.jain@nxp.com> References: <20180205111614.18461-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.169.1] X-ClientProxiedBy: KAWPR01CA0085.jpnprd01.prod.outlook.com (2603:1096:402:c::21) To AM5PR0401MB2451.eurprd04.prod.outlook.com (2603:10a6:203:35::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a532fc65-4fa4-4489-e920-08d56c88fb65 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM5PR0401MB2451; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0401MB2451; 3:bZSf40/FdlMn0jAXxY/o3RZvWOvmeHpxK3kMHn1IoGthY6qYiPbDQM6G5Dua8quWoTLnJGJvlJR9xWFULloxm5VAJK/evYElOsr7FvMbqCHO+z/EU+sDvF2Z1OuWC+qewdjkhI4ZKNeHda8OzYsAKC7A7wryHPTdPtMp7QTmYyQPfbtCTjOT3PoDPeyx4Y1UDmJPvWE1jxbIGOiyTLIlDWlxpPdD6KhlgdNWfVomyZ7vi6GVdRAEi1YC3XGD0TEC; 25:anJwefZcF2XqnFmYsJMRE7gT2m0bU9vvponPd16VPe/6+BgXXjl41+EDc/TqdzlePhjNUte26gBpIz8jReiQHHJ55yOhyBYkK7Algsa3ZFTe0Ny74vT3VKqF9FHIDRDraNsJisQ7FXcQlUiVQTW/6Cctpqi/nDcbc0SSJjRbdhuQTyjIwoHaEkJWGD8Y8PCHt+ljTWvaQg6Gco77jZNEUw8uhiV6YgY7SEcLrMP459j7v4CEiBVklZps46RJPJ2dmtM5Os9IPfbkBrh07LNHqwG8yJXQWZmweglQGAhI3vKKThUFonSf++loyoCo4vST0y3dfLyqNmkPJKuu2M8qHA==; 31:2MM0Fs8aYLmacnEZQmHQZwD5vfpKeqsb6fnWJs9MIWp3gYSg5uIHAwfGqk1jotu9Q9pmbYaaO06/f5aRbhtNzz4Tcw6FsSKjnyFqAehG+a1kjtI8ByLvb9aXLuQi2w4Vs5AdwtmF21yE/meaqo7oxTdznKrFsF3VnsdMmu/TJ1M7WKpYnfd8tRendeb8oWc7cyWmUv3opgYCGJRfb/RON1nldyN46/twGv80f0tpGUU= X-MS-TrafficTypeDiagnostic: AM5PR0401MB2451: X-Microsoft-Exchange-Diagnostics: 1; AM5PR0401MB2451; 20:rbOIViwdIrBoxtEN0CWBrlgH2OAHJmagHu4JPNbsaR1HLpYrJ/+th55kPaBOQoZYmzzZNXWHduUpEakoZezUcTQuf8HRIw1mL5UZwzJwsRdUwH23tgQdJHAHzdZm2V21LisF89SXdlCr+FxqgJ8tdPUJswwIPF4nhzGy4r2fMMeNsIz7zUcwcSIV70YM1Cgp4Kto7Q5Zwqk0mgscV8BuDVhxHUrZ/Eo4qjLdcg6IkHX/ADP82jA0O34x1gwMEXXY8iMTn+VVXii47qsJI+NPBgK3k3BgP1CI3RoGj8MUagqy9uBV4iU7SqZM3aRHbPtfeEbsCxcLvHV3jE1EdJPBkGizSUHggZGPFMWkarEBZCLRuNHBW3bxSyPzgYXDx7zB67QSDBY+rPFDaGSZuA0LA1yUdXO304Jj/Dyra6PfykabQ70pEWDM/SCKnmqya3FaxjMG0AmbHtNiaZ0USxeEmus+S8DPa9435SLG6IfRK3Yg3aqGgJ/KuxFFbiIPoe9s; 4:/bMBozUqpNCR8x/V45/5DODR5mODDEolmOGGITXdB7EpWIm1JCahzR9bwGXqsGpuX9tt6meCxhnveE1pKreVV6uqb1UPTB2MT3c6esZ8YDsPQkKL5PRbOqeJH/ss01+sgdA7StdYhcXNooywM2FQLJQgNpZF1tx5hSCWiH0385vVS6hjZzcpc9KjsSOMcqmwtnoyi6pFnolEKDruB5S93iVoeHvkzUnigsrdgznNy4easSSnyb5TAa7sPAbTeILMp9ESz+B43Edn/J1Iuk30GrkIUzNte7jyLLcVZFbjFOJ9oVHmt4ZVMI5LhnsK+sZA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231101)(2400082)(944501161)(3002001)(6055026)(6041288)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM5PR0401MB2451; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0401MB2451; X-Forefront-PRVS: 0574D4712B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(346002)(39380400002)(396003)(376002)(189003)(199004)(4326008)(386003)(6506007)(2361001)(16586007)(2351001)(316002)(86362001)(478600001)(50226002)(3846002)(6666003)(575784001)(2950100002)(6116002)(8936002)(48376002)(50466002)(68736007)(1076002)(25786009)(6486002)(81166006)(2906002)(6916009)(66066001)(36756003)(5660300001)(53936002)(81156014)(7736002)(186003)(16526019)(305945005)(105586002)(106356001)(52116002)(8676002)(47776003)(26005)(6512007)(51416003)(76176011)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0401MB2451; H:Tophie.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0401MB2451; 23:sZnWggD4ehMtFIVjITEGzdPMq4isfI2A6wkydiI?= =?us-ascii?Q?QyhpMVR3B0sB73tKHc9JcpMHlxkVapc9F7flflRyCBri3mesi0WgtgYsO7Jr?= =?us-ascii?Q?8Jjh2JesPrYSRMQIm7xXQF5faLexo51dJK0Y4fL5j3ZJs2yPKwqmMR9SvUeo?= =?us-ascii?Q?PSQwpiZASR4sEtjPYboJCccGCleFm8djmq/HR63fQ16WFakasnzRNmQvbwgj?= =?us-ascii?Q?wqk5zn4D6mzcgsoz33shCaHMd8h1puQ1xGYg/AmDlA6hUwbzORlD8QW99cp3?= =?us-ascii?Q?3kyE/2KMukBpdzSVlNDU9yFBw9ge329hUINYQWzKk1YmXuYwndB3Cis7Ky7d?= =?us-ascii?Q?jyRvPSIaP358O1WSa7qFbGyB+igm8eSxVR5U6DT+d2d5Rp1q040AP9AQrS2A?= =?us-ascii?Q?eZHhflp+p6kw6Uc505Vv7lHEBf8VTDe/S+kMTWK8oCx274MBWqgM8LsFvNU6?= =?us-ascii?Q?Np4Gg9UotT5yjMOI814sYeBDmc4AGIBnvRiYso3lEET+6j0CMOs22bmsConR?= =?us-ascii?Q?ok/qOH3FaVTLmSp9BTecjOS/3XZT5vikYjd2hJN57xHooY9AZdP9L4y03766?= =?us-ascii?Q?FZ+dJkfnG01dwNJxrYZDB0xXB+h/Hf30b7UsKAbmL7WAcr3iGWvlgOCc1iLq?= =?us-ascii?Q?xLxR6k83vbqsKA1EfgFXDg2NhItaYTfILSvA7BpkAshnb02UbRhfVFG+Y8pL?= =?us-ascii?Q?XjvymtIGLHKLD0gILgPtIRgU+2dOCJsRWEjCVwP0lD2jTdrzTgVg9J20ENEL?= =?us-ascii?Q?uWCLuwjfn3tG/zb8BRntJbbNXJY3xA/qb854ZBeq46s8G0SzY7H2G+NLBMgK?= =?us-ascii?Q?ICM6b7fxGsnCtn6OsOLr7AmNYWoegJoYKf6EyVFJHZGKsMlcSh/18BfzpY8f?= =?us-ascii?Q?NhEZBzGlqxUYLmx/extjhJrcG/cdlxzkg55fbT/M87wfln6/7dqtmT9ph+Dl?= =?us-ascii?Q?+x33UhKxU4ZYR+g7SmyIg4p1QKcPFDpA+ZosdtrL7YpVaaDrvzY20dR1x3gq?= =?us-ascii?Q?P3IX76i+7zUjm0dQPnGRUSQxthGLRSZaCvJ2dIpfaWXlmjVan12U2DrfKOrA?= =?us-ascii?Q?QgW+vqaeq/g0NQttlBJAQngB0Ds3e+80eOBe5/FZEpl0YcnXlJVWouFx9K9b?= =?us-ascii?Q?6AxVRkwz5cf9lSv6EdxyIEe4bejfPN1L85FaCaOEXG123DcjdFN6RML0mkRF?= =?us-ascii?Q?8n8NF0jas1CNe7Qk=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0401MB2451; 6:T18Ej/dxGp2rt6RcERYfx7E1kkDLpnX2FJHt2uHx0ZdTZeuHkE0LihXmNAlaCURN4srNP+X5r7sP/LeEpVxQYFJLkKqgrYKQXyNOw2GXDj34kwRt9JJhNZ3TJdiEiLcIaCBiOMrnLgxvXHuPcpmwN0T4NGtyFvSG+OROkJGjQsHzm8sGEXd+4hwUYg9NlaDtctNZSBVBlWGdv2fVkjFE5cLlvtN38NPdRfOxiFYJkIAIeK7gx0PLQFW6npjZlVaZIqpRrzWbyH7DI0QPszI0JTOD80stF71ObdcU9hpRzxdx+jcgmHcdaUUq3k35c5J8t4wkp+7Xyxy6MGgiAT7eGIA7GrzNpaT5dRkCngJEWs4=; 5:h8y+sVStqhUua9ycdec5A+dP61g9RdXhEjs37rnydbRAO/U4FAUW6Mqm50rNUsmMy/MkR1PjG9/1DxF0moWDiLnWict9flVDrhXVfGf7jlFUh0np4LauJys6+Vzx4yqlpOXlFCcuxFdXoqlTeFbEz/o3W4jU2IZ3q920xOmyFq4=; 24:gDpIuZAw014iFLS3H4FkOY/i3ryt+R1qtHF1HpQQNJVNk4z9uwFwEIrE4WVcPa1qPTT08cWfyyJZbl/T7qYleqFAwGadx72PwxyA3LqI4VI=; 7:C0sqv6yYS04ZP1RudMixJHU1yObMYHcKSF0TfwMPIOP6/3O+ztNQOAYeuzuM/zu84rMh2ZYcpToBBMAYjcJaTGjRnuT2a/mbaFF/8v6pmv9kCuYlQowTGd5EUU4wNl1m9flYd6gEItVrVSTLafb7OgnnUPHrFeosM46MCDV0OZ8VKgFeOctsAWVxA+BYxh1qo0l7Seed0xVCNv9jFQ9pCTZwZ9Q5Pybxz8WYDUit2HPnGHQ3xxGwlYgm2paocBL5 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2018 11:09:50.5030 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a532fc65-4fa4-4489-e920-08d56c88fb65 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0401MB2451 Subject: [dpdk-dev] [PATCH v2] raw/skeleton_rawdev: fix incorrect device start 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: Mon, 05 Feb 2018 11:09:56 -0000 Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases") Cc: shreyansh.jain@nxp.com Device can only be started if firmware is loaded, as per Skeleton rawdev driver semantics. This patch fixes original implementation which attempted to start the device without loading firmware. Signed-off-by: Shreyansh Jain --- v2: - Fixed headline from drivers/raw to raw/skeleton_rawdev - checkpatch for spelling mistake drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c index c7931d869..795f24bcb 100644 --- a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c +++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c @@ -297,10 +297,25 @@ test_rawdev_start_stop(void) int ret; struct rte_rawdev_info rdev_info = {0}; struct skeleton_rawdev_conf rdev_conf_get = {0}; + char *dummy_firmware = NULL; /* Get the current configuration */ rdev_info.dev_private = &rdev_conf_get; + /* Load a firmware using a dummy address area */ + dummy_firmware = rte_zmalloc("RAWDEV SKELETON", sizeof(int) * 10, 0); + RTE_TEST_ASSERT(dummy_firmware != NULL, + "Failed to create firmware memory backing"); + + ret = rte_rawdev_firmware_load(TEST_DEV_ID, dummy_firmware); + RTE_TEST_ASSERT_SUCCESS(ret, "Firmware loading failed (%d)", ret); + + /* Skeleton doesn't do anything with the firmware area - that is dummy + * and can be removed. + */ + rte_free(dummy_firmware); + dummy_firmware = NULL; + rte_rawdev_start(TEST_DEV_ID); ret = rte_rawdev_info_get(TEST_DEV_ID, (rte_rawdev_obj_t)&rdev_info); RTE_TEST_ASSERT_SUCCESS(ret, @@ -319,6 +334,10 @@ test_rawdev_start_stop(void) "Device stop failed. State is (%d)", rdev_conf_get.device_state); + /* Unloading the firmware once device is stopped */ + ret = rte_rawdev_firmware_unload(TEST_DEV_ID); + RTE_TEST_ASSERT_SUCCESS(ret, "Failed to unload firmware (%d)", ret); + return TEST_SUCCESS; } -- 2.14.1