From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0085.outbound.protection.outlook.com [104.47.34.85]) by dpdk.org (Postfix) with ESMTP id B07121ADD3 for ; Tue, 12 Dec 2017 20:28:19 +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=tgy9SAtTMKu7yy3qK53WvqW4ynud4erduXqHbumDVdY=; b=WUn4P8cm35HMuagKmACpWNukK1Xt6KSFCoxlWaAsQhSLWGCD4/bXsc6IuGU+PpkDYnX83hSM8whI6SIDtvbX7GoIkXnRWh/wAaQgqtRWibOCvmRB4S8wLzQexLx3hPkleB+tlLPxedmsTX/SpslfIhRRvghA/ii330pUJGedvAc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (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.302.9; Tue, 12 Dec 2017 19:28:13 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Wed, 13 Dec 2017 00:57:09 +0530 Message-Id: <20171212192713.17620-3-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: HK2PR04CA0045.apcprd04.prod.outlook.com (10.170.154.13) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e1336547-b87e-4717-0324-08d541967f8c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:P1ohQA4CKDUNTqCPWsQh4H8FASD/ghUfjM1ysiNrYQksZf3bFdmiqkKwPivlnDunN68ZHsefx7ZMw3dJcOe74LAHdgI/YAecbVSU0nH8qIdFfYqK1pquW7LfjUJ3GPrCObAmKJTqNKfnazqndVY3cCAKN0LNHbEXd43VmN5UkRmbTFkuZqmmmaz7J79rhdetf+EOfOyu2wMjleFin+qde1p85QqupYBYdS7AjRyXbajWB25CuowVntMLmER/fcpM; 25:TKjdnnahhs4GiT1NGDiszgXn6rBBZMCnPNl5Ubue6PxnKH9qjRA3Oc+5Cq+EDmL0ziimqlteOUhtsNfSZR66hCcuR3jpNKC3yb7sQkAmqFehNsitek3hUXbyZQEKRVIsOr0AQC/+4KqScmUUBAg7V0ojNXdwFDL1oHmPKkH6IOYHtWUa8HdSwodjyof2cNjONneYvEqVKwmO0G8qNEi2aLL3hJgiTX1be9KEVvKJPKIWKPDLDFHkIPOOQPIka90qhWHsqaI2iVje/Q/5wvIykZ/tdIUvINz5Nosa1wtXJmq4u/cVLsLUkiOxlZbb5r2YkPUY6+WzINzlVbvVwebBdA==; 31:FM69Oovk0078gsXdkoeLBqKHhLllj9enqX4ccgc04KDDHIRjXYsT1XvCuX7hNCr6KlMS7m8RvPPMunffme1WMwSNSGJv2LN9tN6rWcvg69TDpoOz65K+DlT9RFQF5q3ftYfNvgZwA2+LmZFP+9p7S2K5/kZJSg7LFvHo6KB07o0usgvoMwx2bBjyj4xjOzCiY4lxJQrEeB7IJfiLE1RCpF6ilVttx1ChmXCp8nCeEjU= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:/Inlb/XIi+hCregUMJ6XeUmMSpxrRYspf/UYamW340SajV4feKshBWcZbv7yCym6bIOiOciCwDj6Q5z1AoWF+P1EqzLIfRf0SRayJSEADvuLzUoS1TInsqIy2PC9v9jO5d6wLTxfFjgXArXTSIIc6+QVSHuvVPWcXgOglrBT/FeUFo3HAmNNPgSRROyqXq/NijKkahf3Eg5wok3gx1gQ4yy4PLUxFEGjlRctNglyHRjxY+kZV+8QEEjlf9x8RJ/nO6adrkz1nSR/zoHVK/zKcK7UMOjOqIHuPmwngN8KBkTgMFyD5Zd2HFCjfDrp736mu82DZ7wkKGb5/sQ3T/qLuMV3yrYDNVpZFsgfkPlmKBBhqGEB3Bc5/xTpoFtewFQ2YLYXf5fAAaGNE6ifcxYOUy2Aw7P+Ln3B38+ViR7GRmXy+o87N6DjFOhv1TD7VGRv4ZkXBeL95G/hHqZ+F+sPSqiMUAYZf/Lte10f53ju6/Rcolfmk76XTi7S/1Id/CoGXEaZBWYpmz9VnmvOecZETO1T6nKW7rjRe3wz9DOKyMiHh0mLRZzEdFu49e2hDe/uwsm1ksVtwYsX9SqZjbFaANp5WgQ+byrkiklTziIk5WE=; 4:0h0rypvL453yWA9rJPXwRjZsaA3oxLWqkDYp3JFCHAeK5EcgctBXDNDizdE3EMwCpUx6H+WYeIlYoTde+yRV0n7p/DvwyT+JKDhenr8e/ntgwWQvOP065WYMPV7URAXBkPqLtlF12FCoa0QImOFBYoUKVYmHYiPIVzj13n3YInfimpWMivj4vtw5FEMKTcMiPWMkRg9TCW9kFw4khxa1rLDEi8PX8ioA1k5mwU/2PmuqGYUkXmVphwVVk7GlaH6rkPCAltC+jjjlPsRbBpn+Ug== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3231023)(3002001)(6041248)(20161123560025)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(366004)(376002)(189003)(199004)(66066001)(4326008)(5660300001)(6486002)(316002)(16526018)(36756003)(50466002)(25786009)(72206003)(47776003)(478600001)(68736007)(8676002)(305945005)(81166006)(6506007)(386003)(81156014)(16586007)(48376002)(50226002)(6116002)(3846002)(7736002)(5009440100003)(53936002)(106356001)(1076002)(97736004)(42882006)(76176011)(6666003)(2906002)(107886003)(6512007)(2950100002)(8656006)(52116002)(51416003)(8936002)(59450400001)(105586002)(42262002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; 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; CY4PR07MB3464; 23:rUQcO49qz6Ik9FlgjZNDNuara/qALZEzkDgqT+Wci?= =?us-ascii?Q?lQVOiMLoFdTerCXmgNTadIAWood9PNUoSqWRC5dRFTSL+RlxpWPPcVBRX1wt?= =?us-ascii?Q?d/5FJxi1WC42ZbrdBGh9NrpGQ+x2vdoSUiczo0WANtrcaHH2zxJsircpAzNd?= =?us-ascii?Q?9pd9HnMVo4G7PKfj5Bwn2IKbFPEbasb+ZrEC1t9wNJ96Krub/eT2URmk6MyS?= =?us-ascii?Q?JYmEMPNK4siB+bGiKmoBF/oIN1QOdKv2qd1SK9859TJRp0SCa/6Ay0DcVQuM?= =?us-ascii?Q?YBa4+rX+qciNeuDpQ8WqugiqQrBkTbz+XwpYc8IGjuDLA3wuik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?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 6:r+OASTD+OpHLRpSmJYnZs03PMmZc9nqrOequKun3BPw6cWVRtGQHj+1ptHYdd5nl3A9ulDc9Lpe29dRP3PN/GS0tYcMu8Tb3F3DL0cEj2BdHUuAzlazV2Gs2BMf2dZnKWvH8rO7ybAItKoAt4Q/RR1yviEqY0+EnuJaXwrvTOyEPtizSqEYMpS3NgbgN0MSEktr3UMda7qtd0q/UG+4aHKNo2nonHW2oskX4Ea2smoLaCJezyKKifV9IZ6VKOoETBirV3Rlc5ngA3gXS9BTIHHBfHUJj74xby5QOnS8gF8ArlaE6Ys1ICo4aSRVuG2ymW7rs9OAtdGECnfDN7LvKlWI2lMItAaivF+D7dOSQVQQ=; 5:rsv2mVgbKzeNFBCm7wbF7chKmSQ1T7AMrHQT9ChbY7WHrx2X8fd5O+x2dHg19W07bxgTfofObletnk+CH+IM3AD/5s/3P5M6GLyXQe+GNqr0UX52ZS2AbJDYwodjjZGBR/WoqFWH2+kpdH7PKr/xP8lMnPojpNjLkmIpvMoYQ/w=; 24:JhnPGTEW6lr49IWwBx3FJgYgnxS5lkNfIlQVwkQ/IHvTxqAMIMDHiFhLKtjQvazxGuJ/jOn5xtFMOttNy+eAdvVFK2RW/ruApUGtkn642w8=; 7:6I9aprTO3TQz/PnT4BYL/5FWQf3va7ndUvG7KtP6MFSLLX5r5WXlJqhVCdozu23vAZK7FD88WL+bFFWkLjrY/gjupkguBrVmMbJx01Pgo/3YD89dWCU5ZduEbVbDOlKjHS6txx7L4SRYgvrZ9RCX9g6LhZHG56gVNksVXx2EoLVVbZCzpXfO/cRvt2gN3yMT/cQS6viHk3GvwZyis8aIfBW6zPr4nLkeQ9QBKIR694RpkBUkxLFNdac+pshGhOgV SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 19:28:13.5998 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e1336547-b87e-4717-0324-08d541967f8c 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 3/7] 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: Tue, 12 Dec 2017 19:28:20 -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 | 3 ++- drivers/event/octeontx/ssovf_evdev.c | 43 ++++++++++++++++++++++++++++++++++++ drivers/event/octeontx/ssovf_evdev.h | 6 +++++ 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile index fdf1b7385..adffd4f09 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 +LDLIBS += -lrte_bus_pci -lrte_kvargs -lrte_mempool -lrte_mbuf LDLIBS += -lrte_bus_vdev EXPORT_MAP := rte_pmd_octeontx_ssovf_version.map @@ -54,6 +54,7 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_worker.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_evdev.c +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += selftest_octeontx.c ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) CFLAGS_ssovf_worker.o += -fno-prefetch-loop-arrays diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index 117b1453e..80e8d23c7 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 @@ -592,6 +593,15 @@ ssovf_close(struct rte_eventdev *dev) return 0; } +static int +ssovf_self_test(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, @@ -627,7 +637,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 self_test; + + static const char *const args[] = { + SSOVF_SELF_TEST_ARG, + NULL + }; name = rte_vdev_device_name(vdev); /* More than one instance is not supported */ @@ -636,6 +653,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_SELF_TEST_ARG, + ssovf_self_test, &self_test); + 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) { @@ -686,6 +727,8 @@ ssovf_vdev_probe(struct rte_vdev_device *vdev) edev->max_event_ports); ssovf_init_once = 1; + if (self_test) + test_eventdev_octeontx(); return 0; error: diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index b093a3e73..4332d2461 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -57,6 +57,9 @@ #define ssovf_log_err(fmt, args...) \ RTE_LOG(ERR, EVENTDEV, "[%s] %s() " fmt "\n", \ RTE_STR(EVENTDEV_NAME_OCTEONTX_PMD), __func__, ## args) +#define ssovf_log_selftest(fmt, args...) \ + RTE_LOG(INFO, EVENTDEV, "[%s] %s() " fmt "\n", \ + RTE_STR(EVENTDEV_NAME_OCTEONTX_PMD), __func__, ## args) #define SSO_MAX_VHGRP (64) #define SSO_MAX_VHWS (32) @@ -114,6 +117,8 @@ #define SSO_GRP_GET_PRIORITY 0x7 #define SSO_GRP_SET_PRIORITY 0x8 +#define SSOVF_SELF_TEST_ARG ("self_test") + /* * In Cavium OcteonTX SoC, all accesses to the device registers are * implictly strongly ordered. So, The relaxed version of IO operation is @@ -196,5 +201,6 @@ uint16_t ssows_deq_timeout_burst(void *port, struct rte_event ev[], uint16_t nb_events, uint64_t timeout_ticks); void ssows_flush_events(struct ssows *ws, uint8_t queue_id); void ssows_reset(struct ssows *ws); +void test_eventdev_octeontx(void); #endif /* __SSOVF_EVDEV_H__ */ -- 2.14.1