From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0070.outbound.protection.outlook.com [104.47.32.70]) by dpdk.org (Postfix) with ESMTP id 74242A84F for ; Thu, 11 Jan 2018 11:23:29 +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=0w9xwdqJippchjYb1WowIGq9sTKCeD4j6UrnW21MXR4=; b=Luje87ZJgcuZczsyXoLtgLd9Ix0eJmvWyfWUt8shJPIq2h4G83YldzfOo4KJjQujH6KbrkGUPS9VzXOPZPBo1KoUCBwPNS7PAx0n+6lWhg4EEvHT16iM92OicsIhizmhh87vs1K8Sb79vVeGonDM3gPAQ9ll5HhT2wdblNj/34Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Thu, 11 Jan 2018 10:23:25 +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: Thu, 11 Jan 2018 15:51:51 +0530 Message-Id: <20180111102156.12726-6-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180111102156.12726-1-pbhagavatula@caviumnetworks.com> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> <20180111102156.12726-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR2001CA0023.namprd20.prod.outlook.com (10.172.58.161) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5afe6ee-2227-48c2-f416-08d558dd5ad6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:hgzUAngJ1aexjHQoXCK/0D9TBmPF1cqzgwasY+GpEVnvs86lPJrdOlnYFmdXv+lUZljXCEWhiqkiJCoZZw8fEk2XR7dudd7KUkGaGZPX3/YOJ9IS3uv8rEY//Vx6lrXgefdKpvnxoXuSuuwd27Ku9cdGhl1BSKKbWf25i9XuIPM1XAqvDNHMTnUlLKf5pmIlN8d+74jharSWMYebM0C8qXWdlKAJqRIwn+krzBNfa3R+fAZLz6LRgWX8CyP0RFdC; 25:AMSuOJJpsfByYFP+IodKhRD7fTwQ+tA/35G/XiwSgPLrSG++9Eq21e8Z7aJUKiPjZddwtDyzdsmsE7kj3HmawT+l/z7M8OeYm+Rr2QmF2uMiCac94rRo1s42iCbAS2r8ZvadxeCA11n9wW26sAXJqO5r3wI2IrqTIPSBwvVCdDpfGdq4gyIJrKSENWeJP2/XsmEWW7MVPIfLjxQrqiK2Xid60tUPuc3wNRjagvbS4Ep1qdjyMdwhbG7eeEjh+g+Y7S4lBRTGysZhrvuGx15V46RxrQ7CJ/Z/u0RjkFzJh8S6+M+UgDL7Y3h0w+oUAxFvBQUyd1zjBllMDwutv25TFg==; 31:lzlnzVF5ZEsyr/aU7AAanj3wGfe56Y+JvrqwzW8HgUZUhGRWUeVbVwhzUTZ6+0w/04tGXKh7KZNYtmSjajtKeY/3kNEikRPtAQVC8Qeh3Mrj+M5M4ZgyEDciFmUqQ1SesLLPMpsF/hfI6fOjLod0TxI53QIXlkO65kZAxet5ohxiNWYJ3HhV6m1Kot9GuKL3xWQT+cvvcOHyi/HiHbXU1Dc2YR7bfsdBZakQLqtaKsE= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:GcMrOb1gajoSyYJqKS4jwT4rl81+nRELSY7gWlJrYNMtx1eVKBEI62JF4tdZVw/RNaIBV4BrKhXt8RxR+UdHjX9JbBFrEm7U0TnGc+420pbypAHf5byNuSZkotc+jkmIXU4NEk/KySMQGm5ey475oWVSmQkCppqgV4V29Tn00qZpynkTUVMI1aBvMfgrcqM5sDeGrvQ9mGuE8FrJr7SwipRl3XRcXX3SfKvbiTEynJCUy2jTGYLSRIhl42747jFMHM6ER96chMwfldR8PX0ZyPUttFFKLTcdtjj/S3xaa7wEe6LCzYAH8sdxTUwQ7pqMFXBPys07I/2el1MjkZaHIIiKFPc60vsR3jEyX3SPgn8ANVcX4jikRnzmqOZ/iilVa4vuUZDQUL200TgllrtGXO/QaV6a6E7RfP/SfBJdpZKrj+mk5dK48mrAHbIMuDgnYCSIzrQJU302hElosZTp20n6mNfa4u96bO3gISd7HV6Hm4hTnl8HqOs/hjHgLepW4LL2rUnIh47sT2bwVUR1QWVx4/kWj3DjekOghzzEQD56nVDq/4gVbd0BPGr2zqlGEYkI2b4yOy5MKXglZOVgJZLSxAiKg9yoaEp9huhHgjU=; 4:XCu49bNcF24/xwgMc+eSPU7txWryATwKYOYGWDI/JHa4T5Y0/GCElVVuwQ/QM7AKOKYM+ArNuIHrgzPfHZnCqdINlPGa8dxQ4aaQzCs6xDdzameNrX7ApBvLmptncbNc+/RJiI9dqoqFi2qUpl6ifx4usAGVXubpGMUx5jLW+yqBqiyCa1Uh0xjBOm/UG5Wy2++dtjEc9/Vw1pR75wmTtf2qeK6f7QgkJ72WUfkbBbzPci9Y59dIpFM8ZXLcfG52pAeqSFmbhay8Bim9SRnl0Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231023)(944501075)(93006095)(6041268)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 0549E6FD50 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(39380400002)(366004)(376002)(396003)(189003)(199004)(6116002)(2906002)(8676002)(6506007)(47776003)(97736004)(53936002)(5009440100003)(72206003)(1076002)(16526018)(53416004)(51416003)(66066001)(59450400001)(50226002)(16586007)(386003)(76176011)(25786009)(6486002)(316002)(69596002)(48376002)(42882006)(106356001)(52116002)(8936002)(6666003)(7736002)(6512007)(3846002)(81166006)(2950100002)(4326008)(478600001)(107886003)(5660300001)(81156014)(68736007)(105586002)(50466002)(305945005)(36756003)(42262002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:Pavan-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; CY4PR07MB3464; 23:KBbQ8yH5gD5RZ3gbjN2YuzcX9shq7uIIxWs2p80OG?= =?us-ascii?Q?RrvGo+lXbjfeyalLV1Men1tOvN7A7w28dkwD8+I/30FcHnUzBzFnEvRx5HZ9?= =?us-ascii?Q?goz1lU1XBJlYq+uWytjjg2FK10dVopjReFML2LETOELLH7vNsX+di+NMTFe7?= =?us-ascii?Q?cRkiXh80lWptULPqGFbIYVQ+HM6zG96M+vd54Hxl9mUcllfmKe40S+GbIxeh?= =?us-ascii?Q?XdJKWit7lqpBLWhOJI939LCljmNUcofZhJ2VWmf5dDojA0keT6Do7qde1Hl0?= =?us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NE5fDy2tMQvwddeRSOU0daeJVX4VRIoXey0OK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2018 10:23:25.0502 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5afe6ee-2227-48c2-f416-08d558dd5ad6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: [dpdk-dev] [PATCH v5 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: Thu, 11 Jan 2018 10:23:29 -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 Acked-by: Jerin Jacob --- drivers/event/octeontx/Makefile | 2 +- drivers/event/octeontx/ssovf_evdev.c | 41 ++++++++++++++++++++++++++++++++++++ drivers/event/octeontx/ssovf_evdev.h | 2 ++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile index 9a6ffdfb1..ff2a11793 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..f092d352b 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,28 @@ 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 params 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 +728,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.15.1