From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v3 06/11] event/octeontx: add selftest to device arguments Date: Mon, 8 Jan 2018 15:44:52 +0530 Message-ID: <20180108101451.GE24213@jerin> References: <20171212192713.17620-1-pbhagavatula@caviumnetworks.com> <20171225191738.17151-1-pbhagavatula@caviumnetworks.com> <20171225191738.17151-6-pbhagavatula@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: harry.van.haaren@intel.com, gage.eads@intel.com, liang.j.ma@intel.com, dev@dpdk.org To: Pavan Nikhilesh Return-path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0074.outbound.protection.outlook.com [104.47.33.74]) by dpdk.org (Postfix) with ESMTP id 7CC4A8E01 for ; Mon, 8 Jan 2018 11:15:14 +0100 (CET) Content-Disposition: inline In-Reply-To: <20171225191738.17151-6-pbhagavatula@caviumnetworks.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Tue, 26 Dec 2017 00:47:33 +0530 > 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 > Subject: [dpdk-dev] [PATCH v3 06/11] event/octeontx: add selftest to device > arguments > X-Mailer: git-send-email 2.14.1 > > 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 > --- > /* 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'", s/paramss/params > + 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); I think, above three lines can be squashed to one line. With above changes: Acked-by: Jerin Jacob