From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0054.outbound.protection.outlook.com [104.47.36.54]) by dpdk.org (Postfix) with ESMTP id 00F091B1D5 for ; Mon, 8 Jan 2018 14:48:35 +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=MZ069zhFlmvvbfkXF/gPakTdZ96XElAxTk7q2Ol5jIPytnTlWQoMowWugYGsui1nCY4SK46fing3XxR67BexdCbQp8lAdw8FFl/6pMz60BIVSkkozhElLHg34RE3oPcLNd35PasJiu3yaOZSxiYNg2b2uVYretlJgFvx9cHMd5A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by MWHPR07MB3470.namprd07.prod.outlook.com (10.164.192.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Mon, 8 Jan 2018 13:48:32 +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: Mon, 8 Jan 2018 19:17:37 +0530 Message-Id: <20180108134742.30857-6-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180108134742.30857-1-pbhagavatula@caviumnetworks.com> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> <20180108134742.30857-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SG2PR06CA0105.apcprd06.prod.outlook.com (10.170.138.31) To MWHPR07MB3470.namprd07.prod.outlook.com (10.164.192.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3b5d1e32-9695-4ac5-89a3-08d5569e82cc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:MWHPR07MB3470; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 3:eSA+R1LyJhVZQd4QmiXBusYNdfGIUHHEKUppnLpDhBBrniSVpiPDqVQ5MM1ODLvI+NXEWtmQPn2Sm9js/pKsdRmrIsXh3H3dqAKG0NPh9ezyjnleb3F5iI3Ol7ccLCrYCakE/owhN+BpYkfPJU2/fXEcyjf8WZBPqnZCEsCHNjNBsDYIqZRl/o6FO+F+LTLoZBzKjaFIT1NOyZLZ9xZXRGsv8u2MbZJhPwnSy6eQ9h/pTnFrV+zfwiOJYNoKgJaH; 25:qhEtmxN0GoyGcJCWryNMm6QnRcnLc22KNLI7/eEbc+KzmX1UwF5/VH6oDyBTa/uwrZmcNz6yhVR+deG6JMo6Op22XOSLkXT0l2hl3GJsFCS7/q5PsRpwsvW2WOby5bDDI2hXJid6+wxUSC9RnQHIs6EFFZ5a3sif89z/VYQzVsq+FVEt8/vx0p7IzI6CRA/nRUKadFTPZu8s3TPJda21J4clhR54uNN4oN6LtxOM2FWFMPTJ9ME2e3YXqO4ATZegxdi8w3Fwd4Zi+t8w7+PbPo+QAbtBlHTmZNfAR+JBnJx/eUkykpi2l0l6/+II9QSN0v2QENqcg1dxEAFXRrOLRA==; 31:qTQ2l7m9YZQR+K1uQHBrzupzJh96zM/dplQ2n3IQZaegmNtexelwfVZeLFkzAvyPieqDwxFXMg2+eYMbA2jKSA/S1MfBcB1iPiRlCK9jBwOqjweUg8ADVCmi/kkpUZccHnkXpx5YqCDoGB1i0U+Q/9TI0DZgq5+0sl8q0Jtx/bEBnW4d/5T4i1hE1y2kyzLuko4i0hOG8wwO/fwsoeVGyzrTIMv0wlC9rpNDKli18e4= X-MS-TrafficTypeDiagnostic: MWHPR07MB3470: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 20:S2XQyBE8N4cUAacGe/y+Mha+rwe5sH07+67Hs0oL2Vdc51nGlKsaRT53KZaXQyt9FHYWVgCyIeihb0qw1R3zLj/Cc6VcsX592/fHh2yD7Mkt6en0SAqzy8/JOQWKyPP7NzDFs09pk3WNRCzeZc9ssJ6drdRPDGhcSqlwyHL1Rj8IMOQJ9pAaj/M0K+nFs5W/1egZmgluvDAK3BiD/TUPYirbRxQQnDEhOvgZNnvPEyTeM42qkIGTZdGC1MxuDtOClWOArSvhUWn0jx8a7KkqEQ5s8kA6kOJ2UkqRq/VjJh0Tg0dd8U7qNVXUI8Or3Far/m40JIjBWvTKwVTn9H3xmDp3cRNL7LnkE6vzH0cyzqiXu0+uFsxfzKRAwEZK5bwxecSgT96tCDOzLvgAuoT2v8SoTU32/YZHG6zAB5cHDdUQfDk4pR5ojtPr7Q2G8vUkEP691iqogAgvnFzPDso51JQnlj1qVGdkwkqXvviF05xLJi5dPbfNiBBb5dXJ+zZb0EoD6oiuH12AWrkcSFEiDqZNfxF63v+gX1Iq6MmQQERQSWq45lXUHLtUa1tZGzb5WJPADLwHBxKl7dsWPKIEqnrgm+4WziUs7Mt1raMob90=; 4:J3+LV6cjwAl0pctALHgR+UF3BriM1lO1EQW9vElqXNYZiSQE+ANJ+MVUkHi+C7rU8d4Esh4u8ru4AMy0fPWJAmogVnCDFBhm+eRAnmb3pw8UK88ofzH9n3vWtHSXt9HUYshfZpGGboPvE6Scsdy0aX85l0QXIM8JhdJ+RfL0Jz4WdKEgeWNEJUteoDAkYDBEyr6Mx7RgnEGruDndM5C5tQ6wyvhK33aUYMvItvZ83zhDwXjmOy7qyKEhEXyQm87RsJaSVnGT8UxCwYut8Dj7Og== 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)(3231023)(944501075)(3002001)(10201501046)(93006095)(6041268)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:MWHPR07MB3470; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR07MB3470; X-Forefront-PRVS: 054642504A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(366004)(346002)(376002)(39850400004)(39380400002)(396003)(189003)(199004)(1076002)(2906002)(305945005)(7736002)(6486002)(76176011)(51416003)(52116002)(2950100002)(36756003)(16526018)(6116002)(42882006)(316002)(3846002)(5660300001)(5009440100003)(16586007)(53936002)(48376002)(50466002)(8676002)(8936002)(50226002)(107886003)(81166006)(72206003)(68736007)(478600001)(105586002)(6506007)(106356001)(59450400001)(97736004)(386003)(47776003)(25786009)(66066001)(81156014)(6512007)(4326008)(42262002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3470; H:localhost.localdomain; 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; MWHPR07MB3470; 23:ihKWeixAWe/KwRt+OpQ/N6GVzSeB0GAwihezUGect?= =?us-ascii?Q?1i3afTJiXXo6IFBXsFezn364EMDhp5Uk+/VQdHMPEs/Qqwr/AaSqBoVyf5k4?= =?us-ascii?Q?j4ZvqUkjnu1WhgyU1/L88slJ+rZQClT/qFlQIZoA7vjT2+cFSo3Wf1EnaIVX?= =?us-ascii?Q?Z0uk8iCX29uuHc7AyqfkIkVbaCZa3MV2PQKq6lz8+MLv4p72O++YQtIWREyD?= =?us-ascii?Q?e/ETUqZ4GP7deToArc9ZGuT6iVbxx71GO8H4GmzlVo0h4sot83E4UQu59XSv?= =?us-ascii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Metadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2018 13:48:32.1900 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b5d1e32-9695-4ac5-89a3-08d5569e82cc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3470 Subject: [dpdk-dev] [PATCH v4 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, 08 Jan 2018 13:48:36 -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