[dpdk-dev] [PATCH v3 06/11] event/octeontx: add selftest to device arguments
Jerin Jacob
jerin.jacob at caviumnetworks.com
Mon Jan 8 11:14:52 CET 2018
-----Original Message-----
> Date: Tue, 26 Dec 2017 00:47:33 +0530
> From: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> To: jerin.jacob at caviumnetworks.com, harry.van.haaren at intel.com,
> gage.eads at intel.com, liang.j.ma at intel.com
> Cc: dev at dpdk.org, Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> 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 <pbhagavatula at caviumnetworks.com>
> ---
> /* 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 <jerin.jacob at caviumnetworks.com>
More information about the dev
mailing list