From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0063.outbound.protection.outlook.com [104.47.40.63]) by dpdk.org (Postfix) with ESMTP id 5987F1B38B for ; Mon, 25 Dec 2017 20:18:42 +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=xrEJakfwJSb56rwbsSDZUEXA5srL+0fctU1fuUMQptw=; b=E6TFqPsaaz62Ddi3yoQ+VxrlUIDrHaOXBe/b+m+JFiwI+ApNPVlwZym/5jxgfFk19m09VdMlqsMeMMwe9EogTtVvgAdgRd4fvE3d0E8iwEPXIp2oWBUWjLZCmdzTMypTuSGJXtRA+txlh7SyMsCmjufPaPzqgnPUXF9hgsZobtw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Mon, 25 Dec 2017 19:18:38 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com, gage.eads@intel.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 26 Dec 2017 00:47:33 +0530 Message-Id: <20171225191738.17151-6-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171225191738.17151-1-pbhagavatula@caviumnetworks.com> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> <20171225191738.17151-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SG2PR0601CA0004.apcprd06.prod.outlook.com (10.170.128.14) To DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3815b3d6-353a-49ef-b3f1-08d54bcc4e9f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:DM5PR07MB3466; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 3:atRV3VeCHYSX+bdkZV1dGnoXSZzBCUvW+12TkV7njfQ3vAsvWWHqs/NXJG5T0rYIrpH+tjkTr6aTBxumtt8NEmmMqpqfd8k5woBPcguO3UCxl+Zdy1bPtayU2BgGv+/gM20t59ptXkYNieGK4e+RZq4Tv54P7uBYWDf7Ow9jpr94NE1C0uk1/CVpgrUQCd8ArGUPEWZCpd3nsL+hxdJYOO+W2Q8zVx7tp0C5tZjrb0OFxiC3lvE5cRWJFMb2KbbG; 25:n5n7Kmze0NFQthI2sZ2ihWXuNtAs7YtqzOREaDf7zr2/9JcUjIaBjHTWl/sV5eWoSwsO2gSSXLti8frBKVQT2VmlICannAG3dQ93eGuBURt2pszoi35YZ64ZDjtpec3QYq4J4BcoEwm2S+k4wdfIlm8j7/7WyrOcB7A/pT+gJwOTL5ZNyqOWQlp/9ztKaDQGD8Zx3lS1AHaXJI53lGyS8qUbHwZdS8j1b88TCWoRu4v4OVvq/1yBmuNQlJ4uG6ipCFRo7RIAqOxtcJWjnVGgv7SbbcmX6tLptI/OTSbpKCai+Sp+oaXioEfZAr8GYbEIVcQ0EysE5oJD3RMfc+CZmw==; 31:qRQxNCN8xDryTzKHDf7/LZYj/mGZUjFLkgTqj0iFhnKrz6poKr11ltRWPfzz7T2h/KTIJF9Do85JxEg6PC7deAFlmWHqyinrAgI7+VQPjJw/pV4ZC3mszGy3hKwjkPJ2dPfIyNhQaVaGXZZgJIg+xUVk34ED7aeIViYnbev+T+x1YiX2o77QKHR0tpQE6nWLUuy+p7OsbjVHREnFF9Gn98lU8uDbgpIftvZOoZwbsBg= X-MS-TrafficTypeDiagnostic: DM5PR07MB3466: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 20:5t0DRW8fooQtHaQpRgoFUN99RnWWCSet2CQ1QKYrcdZePlA1/QKVcZl7e6wve7RI0q4xWgxPGuC/zHQxOynZ9Av4rVX3p5XXHKeQCwQy4eZmNg5uPcre3Ej8UswpN56YOMmdITcp2xu6KJC1W3XyzCO7KPNU2NW72YOHlBvymYzHc+QpfHSXyAtBpUpeN0bdAlf3GrUn4MCZ8KBpfDMHjhBcbe/OgRGRRQXswXq4y7MUaqTXYoNGNmHP7zRTBPp439LEa4lURKENFBDXcuxFcl8VbBtcbYA9ntr3BXvQBjOpCwuIhEQLazU/wQhZRzfbsonKaeAzPCbapxiCklVuycuKhr5Aa8RsIDosmyuZngrknYClEMZdTFZsenXm7aJz+fMrjkhrz8RvHYWAUtpS/CO+8W9dTe9O3ODLUktMis2T0dDBcdTLKlSUdFnO/TUKO6IjGsgYpSMhUQ/idc3WofPnkGrdAVGZ3szb5LEEqgs2UuJm8aB/j0evfiZxh18VlAK01iZiEqe0ZPy8pJWdjkwgz8tvhaxVvTNbZx30r3LHb6zUOqfND2aT9qYiZUs1ssdQiuNKSoHFz3Eys+VDEZiYpadSjNz0tvNIrBK+EYU=; 4:kqe//bnAItTscJzEg//qdYDXAOCecQnfJ7F+mNvhW9uH4QQgpZLzlE3n6KPTLXcWYt86O0qlydOvMNIW+JiRTNfpB3Ee0e3F0BkVwiCFu/wuMXkBffLGSG4LZfU6/pLR7lGaXCanzV32UqqB33mPWCHsdJBH7D0TZwQDpXjN6YXcLH7WyfeNAhOUVS7tZC6z3+ZBVTwpVeyQFoHMeP4kTkhI8Pfc3L9Tsu8255DZ2GVlBNpNdm3W1LnEpgzPyAPbZYOX1iK84iqiJ3GbQDdHjQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3231023)(944501075)(10201501046)(3002001)(93006095)(6041268)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR07MB3466; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3466; X-Forefront-PRVS: 0532BF6DC2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(366004)(396003)(376002)(39380400002)(346002)(39850400004)(199004)(189003)(36756003)(68736007)(5009440100003)(7736002)(66066001)(81166006)(478600001)(81156014)(305945005)(47776003)(16526018)(8676002)(59450400001)(6506007)(386003)(316002)(97736004)(16586007)(5660300001)(52116002)(106356001)(25786009)(53936002)(48376002)(2906002)(105586002)(76176011)(51416003)(1076002)(3846002)(107886003)(6486002)(4326008)(6666003)(50226002)(72206003)(8936002)(6512007)(6116002)(42882006)(2950100002)(50466002)(42262002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3466; H:localhost.localdomain; 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: =?us-ascii?Q?1; DM5PR07MB3466; 23:Y0RbxAChZZnWSa4Cj29wC8NLl5cw+Epk83mhyyi8B?= =?us-ascii?Q?YjBZhmluJWK9vAuGqZQ1TeEGEEy3i7IehrwWvNjtIUuXZHRMN8/f1ZQZ3Upu?= =?us-ascii?Q?gKlABusR1c8CfJoGL/xGeT/CmblbpSOQGEzvw+QN23zjN7s55UxnFDqkkU9o?= =?us-ascii?Q?NkdmemofDj+C1YAUsWZYgcrcLuZdIgSO7WNbYCbMHO8W2MnFnXBeKOjWUAFN?= =?us-ascii?Q?4k5YPaxDGbBvROZ5DASavV8siQsb05EP+OlJOox4fvjsUP2zSjaoFIEd3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DiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Dec 2017 19:18:38.4793 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3815b3d6-353a-49ef-b3f1-08d54bcc4e9f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3466 Subject: [dpdk-dev] [PATCH v3 06/11] event/octeontx: add selftest to device arguments 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, 25 Dec 2017 19:18:43 -0000 Add selftest as a device argument that can be enabled by suppling 'self_test=1' as a vdev parameter --vdev="event_octeontx,self_test=1" The selftest is run after vdev creation is successfully complete. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx/Makefile | 2 +- drivers/event/octeontx/ssovf_evdev.c | 43 ++++++++++++++++++++++++++++++++++++ drivers/event/octeontx/ssovf_evdev.h | 2 ++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile index 1ad638574..bf45133f7 100644 --- a/drivers/event/octeontx/Makefile +++ b/drivers/event/octeontx/Makefile @@ -42,7 +42,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/ CFLAGS += -I$(RTE_SDK)/drivers/net/octeontx/ LDLIBS += -lrte_eal -lrte_eventdev -lrte_mempool_octeontx -LDLIBS += -lrte_bus_pci -lrte_mempool -lrte_mbuf +LDLIBS += -lrte_bus_pci -lrte_mempool -lrte_mbuf -lrte_kvargs LDLIBS += -lrte_bus_vdev EXPORT_MAP := rte_pmd_octeontx_ssovf_version.map diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index 0a96fbd7f..8c78b323a 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -593,6 +594,15 @@ ssovf_close(struct rte_eventdev *dev) return 0; } +static int +ssovf_selftest(const char *key __rte_unused, const char *value, + void *opaque) +{ + int *flag = opaque; + *flag = !!atoi(value); + return 0; +} + /* Initialize and register event driver with DPDK Application */ static const struct rte_eventdev_ops ssovf_ops = { .dev_infos_get = ssovf_info_get, @@ -630,7 +640,14 @@ ssovf_vdev_probe(struct rte_vdev_device *vdev) struct rte_eventdev *eventdev; static int ssovf_init_once; const char *name; + const char *params; int ret; + int selftest = 0; + + static const char *const args[] = { + SSOVF_SELFTEST_ARG, + NULL + }; name = rte_vdev_device_name(vdev); /* More than one instance is not supported */ @@ -639,6 +656,30 @@ ssovf_vdev_probe(struct rte_vdev_device *vdev) return -EINVAL; } + params = rte_vdev_device_args(vdev); + if (params != NULL && params[0] != '\0') { + struct rte_kvargs *kvlist = rte_kvargs_parse(params, args); + + if (!kvlist) { + ssovf_log_info( + "Ignoring unsupported paramss supplied '%s'", + name); + } else { + int ret = rte_kvargs_process(kvlist, + SSOVF_SELFTEST_ARG, + ssovf_selftest, &selftest); + if (ret != 0) { + ssovf_log_err( + "%s: Error in selftest", + name); + rte_kvargs_free(kvlist); + return ret; + } + } + + rte_kvargs_free(kvlist); + } + eventdev = rte_event_pmd_vdev_init(name, sizeof(struct ssovf_evdev), rte_socket_id()); if (eventdev == NULL) { @@ -689,6 +730,8 @@ ssovf_vdev_probe(struct rte_vdev_device *vdev) edev->max_event_ports); ssovf_init_once = 1; + if (selftest) + test_eventdev_octeontx(); return 0; error: diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index 72a980447..018fbdfa5 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -117,6 +117,8 @@ #define SSO_GRP_GET_PRIORITY 0x7 #define SSO_GRP_SET_PRIORITY 0x8 +#define SSOVF_SELFTEST_ARG ("selftest") + /* * In Cavium OcteonTX SoC, all accesses to the device registers are * implictly strongly ordered. So, The relaxed version of IO operation is -- 2.14.1