From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0042.outbound.protection.outlook.com [104.47.33.42]) by dpdk.org (Postfix) with ESMTP id B8FB81B16D for ; Thu, 14 Dec 2017 16:02:40 +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=oEM3GbLL2+kRKC8aPlEB1Yhft3sXa8j53gaJ0ue2nao=; b=SiAI9GRA/JqCFOc3ETWh46VeZiMRH1EsJSJ1N4p7DGqLrghFXxGqNrxIlVz/5yoe9NznummejClhviT04vwIGE6wEx4oP/jwkBtsSIVOrUOPPspVnuR8DnDi/QzbwMNo9pzmzppE7/FOoDBGTpRUa7wJiIt0GbXOew0NzPTn8Bk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by BN6PR07MB3460.namprd07.prod.outlook.com (10.161.153.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Thu, 14 Dec 2017 15:02:35 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@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: Thu, 14 Dec 2017 20:31:33 +0530 Message-Id: <20171214150138.25667-7-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171214150138.25667-1-pbhagavatula@caviumnetworks.com> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> <20171214150138.25667-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR17CA0079.namprd17.prod.outlook.com (10.173.237.145) To BN6PR07MB3460.namprd07.prod.outlook.com (10.161.153.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1389be8e-4871-4a38-3e01-08d54303b796 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:BN6PR07MB3460; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3460; 3:sjduh+SAwbL/84QneI3CzncltAGu+RRhbsPbkjg9KQSdpVV36Vz/lGwQIxylJq5yyD8LmKZSNbc1FB9ctJNj99+obAZz8VD89Tu5aQQhKmsUzz4C1RjBFMU6WQSL0GA9LQ8WKJkS2ySU8rYOCAFb8C6h83sTSwzvn+Vw6XfEEOHL63cVbBKsBUJ7uqPh04qRRZFoiuxMN8tYghmRYoy7JthczXU1ysmtmzglGOEMHyUVebDTFAymPhZXlmFfodwc; 25:awVWPY2xThsjtA+XoOhyLVKGMs6zR2ml09PE9v5qQ7rdT3rNYgxjLStWaSgRLi/YV9r65JA0mjY/rn7698y3jkh7UAj6M6MHYxxpCHGeF6rpkPQE/zUoJZ6b6escjkEQdp046ld0e36xkNP0IQG7a3vc1IbmbG484jLWsTrRljps0wZhVPH+Nd9/gkeaCl2Nzb4nPGE+hZ0NMp3Brht0KejbUQGEbrAHWWXMz3Aya2iTUpjtA0pZ26Pw9Uk1cxbXue9V2IyN7pwWfkMrzN88nMUM1hOsvkGE+i6WL2Yasmr+WyC56s4u+Ef/6ibBjCb/KIn67ovFM3GPVcOpjV0Bjg==; 31:gidkWVDOYJbUWSHnLldbZl7QHuOBNrylnX7cM7c+p4HDAeBXHx2bXTYB5qT6tytwBqK9PWNunmjuborYKt8/+v3KrPHf3Vx6EHijc3rY/TZEHD//BSLcYWtcqLej6HP6T+cl8vvGMI8ooHDfYoYfM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exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(3231023)(93006095)(10201501046)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011); SRVR:BN6PR07MB3460; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR07MB3460; X-Forefront-PRVS: 05214FD68E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(189003)(199004)(66066001)(42882006)(2950100002)(305945005)(97736004)(72206003)(478600001)(2906002)(6486002)(47776003)(69596002)(107886003)(6512007)(4326008)(25786009)(53936002)(48376002)(105586002)(36756003)(106356001)(50466002)(5660300001)(53416004)(5009440100003)(6116002)(3846002)(1076002)(16586007)(59450400001)(68736007)(6506007)(386003)(16526018)(316002)(52116002)(50226002)(76176011)(8656006)(7736002)(8936002)(8676002)(81156014)(51416003)(81166006)(42262002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3460; 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; BN6PR07MB3460; 23:78Q+OpRi+7hxwNnHqW83yETm2ClMlf5pfwE9I/Qid?= =?us-ascii?Q?L2F/n9RM146KJhPoNX6IrsTwmKXxC7gA3+zVLi/bl62MM18gZKOces8Fxu37?= =?us-ascii?Q?nlP7A8LA6p3RGvZVyWXJf3A80NYILhYSYYoj20/6zsKX16YbxuF8/ykFzta8?= =?us-ascii?Q?SrbbpWWZtfF5cS/znanXlKQSjHJjGQqoEb0QJvhnCrasRf2DR59FTvljRy/M?= =?us-ascii?Q?M4g9X/EPrgIBqsNq6KnG59AGvCqddU8HNnH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fB+zcfmHroMakZXgKhK8WuSUP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2017 15:02:35.1988 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1389be8e-4871-4a38-3e01-08d54303b796 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3460 Subject: [dpdk-dev] [PATCH v2 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, 14 Dec 2017 15:02:41 -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 627f5d24b..593ab63ef 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_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, @@ -629,7 +639,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 */ @@ -638,6 +655,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) { @@ -688,6 +729,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