From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0072.outbound.protection.outlook.com [104.47.0.72]) by dpdk.org (Postfix) with ESMTP id 1E0991B2F4 for ; Mon, 5 Feb 2018 12:02:18 +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=OZpfNvQkPqiG/qMzuSFvZH3FrAJcFnFeXgK/2KhgLrg=; b=bBUf8gdx8fS48B6rsLI0G2i6xLclCZCh6Bn5RhFFfdmphOfOAiMC0pttoBMIF8d2yc2Fa59umekm9ONS0wnlGxZ78XrY8I3IsAMLQqAZxDtwjTkogh916zAbeYKlX+CafQgfbIN5iAfZ3qF4cF1OqDu1YVrzyexlUJgpgV4lVwc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (192.88.169.1) by HE1PR0401MB2460.eurprd04.prod.outlook.com (2603:10a6:3:82::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:02:13 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: dev@dpdk.org, Shreyansh Jain Date: Mon, 5 Feb 2018 16:46:14 +0530 Message-Id: <20180205111614.18461-1-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.88.169.1] X-ClientProxiedBy: OS2PR01CA0078.jpnprd01.prod.outlook.com (2603:1096:600:2::38) To HE1PR0401MB2460.eurprd04.prod.outlook.com (2603:10a6:3:82::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0d3fa19b-096d-4bb7-eb3f-08d56c87eb16 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:HE1PR0401MB2460; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2460; 3:uyXnTFtZ4WoQQ8qRmubMYrWU1R//7YGSM/RAigqmcWiCOVnBvGtVKVRH/Y6xNC85NPlxtPVf6c/iTacGqRcfQkPbiOUPyKBq8nrw3iCD5LxVJdJ4cn9tYgcSU/juOPXa+qaFPmUxEhGLDBWjzx8JmOdXlY0mn6JIFVttOeaV9uae181ZHOLQIHZSto007KuS9bESUEXPqEjliT0aBE+cRSFPqy7ZK7fcuYkHmBQNJmKpUpTNfifheVyCW5WOdmrq; 25:tfn8ft1hcuCRWoL7vmjYJYKOCOXFtni+hMzyQaCmYLcfNlHSlsWVY5RAIAzwdv3JpBS3l8nMwbraCAgbQn8LzqfmOhJ36DJxa8LL1xQ2lfIxZpz2glT95DCOG5fRkyNghPV/Yws74mFkDfnniNmPNQDCKQVOjkQ+bsjNv/52+q8NNgN7E5CbyJpQDIOMpNYnqAUSQLRpJs0lMzFtshbjCYBN/0yhYtPpLGP5FG10iyyO40Ig/cMvkisyPmIKAhKu07q7M/gd2dqm7u8V/f1i8Uv48LWBrXnQRYcxjhyMKJ1ZGvmbSLZjGUBozTZEnTCh6Xu1yj6aeo4YJ23kwxgBCQ==; 31:RGhePTgyA0hYPWX2Ir+4FI6M1StzUqePHbpLhtrv2dH0RCeVRRYuYGJ+qM6UcsKbFf99qM6sJAu3itnX8/ZDpb6hxAyxBHpSfDmfBMsmx20RFdrCOGc8Yyfysx3BUWgnUj9TPI8PtAIjWIsUmZXxn+MRvwQTuX+HQneifI8S2+0v4Ln6yvUXWFt4LqyMcKiBx9oGUUk2H8gQ9PaVEWjulNRM9kuP9odyPPEK1Lekl0c= X-MS-TrafficTypeDiagnostic: HE1PR0401MB2460: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2460; 20:UZQWdUY2GevV78/BJQN0Tl+/9N5MRq16Iq5Irf7yN0PhGokiFmsCLTRAevOyaOzXczarn+LP/uI7vUfWZqW8mtPJ2XwPZbRui4epsH99xvAnikM37ZP+J9KWdy+MKhLwzrGTxia3kbrTozPzXRpeZ7JPAIn5XOk07dqU+oiqJ+kxA6dYyVcgq7i/v7BbvtX2OuzY2w7tUmHmYKJj0V2aHfBf8SiezEjat7TWK0y1y1D5c1WjmZBF/9v/4iq359VWubdFi9i4RrSsXRzVBuFgSQG7rIsb5DflSR9OFyTPZZQ4wJk+8cXktiwVhCo4JtXGTAD+X4ULfB/dicBRELO4x6IJ24kzDOMSalLtB4Xxi5yd4R40+86GKsbqN8R1AppdpJHEG2VRgaY4wezFoNcCjPBgv1b0iDWbQU5xId/IzYuTnEiBxE3WNMibrreynItSftowOkrXJwq/FXx1HypR4LdPqHJGZLnuiz+ycmZHA8MUgdb1ZjpinzuOeJaOwb8X; 4:SyTqub1cTCUp7+aFCd7GYQbUJL9Voej6OMPDudRDzFnS+RUjoM7EMTLiBi7NgHNbNAJwpJsSSzToJvncSsyHd3fUmMCla1zu2va/qw76Vh4n/BywSlDr5zK7TFc1L/GjGtvBuCnD27qD5P//CsVtFCm3FaFHU/6cW9FWcOKasjjW/JPzoXY9m1GAdX3S3c+B34Jcu6tpz9JgScF7wg8EKXKoJUwGenJMKE1MG2/5ZYdlEPDbwiWIeJxGMErcb1ewznrlzwKpvzIG2/GJiR7DYY6IQO/AyNPjlpRG2nLIykeosLXzhl8s4FsA5wK0D6l/ 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)(3231101)(2400082)(944501161)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041288)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:HE1PR0401MB2460; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0401MB2460; X-Forefront-PRVS: 0574D4712B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(366004)(346002)(376002)(396003)(39860400002)(199004)(189003)(66066001)(47776003)(68736007)(53936002)(6916009)(6486002)(50466002)(1857600001)(6506007)(16526019)(26005)(386003)(186003)(8936002)(51416003)(52116002)(105586002)(86362001)(575784001)(2906002)(6512007)(50226002)(36756003)(7736002)(305945005)(4326008)(48376002)(478600001)(106356001)(2351001)(16586007)(81156014)(5660300001)(2361001)(1076002)(25786009)(97736004)(6116002)(3846002)(316002)(81166006)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0401MB2460; H:Tophie.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; HE1PR0401MB2460; 23:0P9y+vLke622IoXIDU18zdJxxqn7jNGqLLHoL1n?= =?us-ascii?Q?c5c8VgYDH1ESz2NakVbxA44nhedwMjYZAcGE8g80inL0nJfF0qaUk+lqpRFj?= =?us-ascii?Q?DTzYPjm6T29YjCoweC4iROvSRjE/H50SimdJeELObCHcHyj0ipONDyCITJ/J?= =?us-ascii?Q?Q2Tq4RibxoFtLhZKPJaLgoWgFXDS5+Quk0h4G+/lwHgo4IA0328i2D3k/4YN?= =?us-ascii?Q?2ipwjH7Iepmql8cr9rNcs+F+XOW3rhZRNo1reFXdlNMYhuB8bKA4WJ9PTTLI?= =?us-ascii?Q?anSY69/lLJA/MOrrCnsJ9SnBMlFUIAPOvNO/FtFi/D65iHT/2Izoq379haHL?= =?us-ascii?Q?ErqSo/OXdQs/hh4KoS8KY6OxMTnYJBUX6CGrb8Tc6s7L9+vsW6JMNuUWWwLJ?= =?us-ascii?Q?1E3qoyJPqINmEYJ8aJk6ZXYoCHUqVsyV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WAAV4UDloCyoNOhWxgNoc1Vs7mZTnCQiT8v22Oj9DD46Akgxket5L627yTgPoEuseXgpowh4Z/zSFvgkDj4u+K45dno2xXxKPZuxoqANWRzpU7Q9Hz6dzuT8/yKqD1RBXJdkiq5Y4260T3YGoJl9g6UWEXRWLjpwt4CPNkYOvCornb39iNXVT2jiO3xTPGTLePASmt5GEQwhc48A+AqHs=; 5:4j/7ZrY20/27NhC0KeK4oaG1u1uUVtsc4oXnLDmzFmlA89kTHw/QoQBm7AHE+WBUy7Udat8baVzLENpyI6F7wOViz6rnv6E/ucQX2hYZLTtM/puvLgndrC2DC8kq7CvM4NFDsBXNHDA+T6Ahuo7mjLxDA7PZ2P5D/8dvbc9ov4Q=; 24:L1OOsIXfWVWF68GNy702TUvS9NUwd6vjFjOz89bU9yjCNRgqYHjO40ClfIFG04LaXevlv4wtjM+nqKZqVmaL02Rd+K+XmwDy2hOzVaL/0EI=; 7:HZ19jKoNJSTgWH41cnnzkFVH1tQSZlYbchqu9hC/GXSkfBcadq4lbPfwHnA7WhdqK/8yeE6sl8LrTo4IXcCqmWshS7o3gJFmPmqf9ERJ+X25x+GSVJxJnZqM9CUaY3a/FHiyxgJ2gVArKvlABlVrE/vpEkvPhq4NGNVfdOE/Od8/EtNZHusUf/PzdssuSNFe6ybW5ei72M2gqd3ASjnPYZtARxRRCNxLWpN78D/tai8HEssIUrJjnI+2SUTzRJFk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2018 11:02:13.3013 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d3fa19b-096d-4bb7-eb3f-08d56c87eb16 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0401MB2460 Subject: [dpdk-dev] [PATCH] drivers/raw: 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:02:18 -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 --- 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..4095e0652 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 fimware (%d)", ret); + return TEST_SUCCESS; } -- 2.14.1