On Tue, Jan 31, 2017 at 04:14:21PM +0000, Harry van Haaren wrote:
> From: Bruce Richardson <bruce.richard...@intel.com>
> 
> This adds the minimal changes to allow a SW eventdev implementation to
> be compiled, linked and created at run time. The eventdev does nothing,
> but can be created via vdev on commandline, e.g.
> 
>   sudo ./x86_64-native-linuxapp-gcc/app/test --vdev=event_sw0
>   ...
>   PMD: Creating eventdev sw device event_sw0, numa_node=0, sched_quanta=128
>   RTE>>

Like other PMDs, I think, we need to add PMD specific documentation at
doc/guides/eventdevs/sw.rst?

reference:
http://dpdk.org/browse/next/dpdk-next-crypto/tree/doc/guides/cryptodevs/zuc.rst

> 
> Signed-off-by: Bruce Richardson <bruce.richard...@intel.com>
> Signed-off-by: Harry van Haaren <harry.van.haa...@intel.com>
> +# library dependencies
> +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += lib/librte_eal
> +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += lib/librte_eventdev
> +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += lib/librte_kvargs
> +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += lib/librte_ring
> +
> +include $(RTE_SDK)/mk/rte.lib.mk
> diff --git a/drivers/event/sw/rte_pmd_evdev_sw_version.map 
> b/drivers/event/sw/rte_pmd_evdev_sw_version.map
> new file mode 100644
> index 0000000..1f84b68
> --- /dev/null
> +++ b/drivers/event/sw/rte_pmd_evdev_sw_version.map
> @@ -0,0 +1,3 @@
> +DPDK_17.02 {

DPDK_17.05

> +     local: *;
> +};
> diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
> new file mode 100644
> index 0000000..d60f00f
> --- /dev/null
> +++ b/drivers/event/sw/sw_evdev.c
> @@ -0,0 +1,178 @@
> +/*-
> + *   BSD LICENSE
> + *
> + *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
> + *
> + *   Redistribution and use in source and binary forms, with or without
> + *   modification, are permitted provided that the following conditions
> + *   are met:
> + *
> + *     * Redistributions of source code must retain the above copyright
> + *       notice, this list of conditions and the following disclaimer.
> + *     * Redistributions in binary form must reproduce the above copyright
> + *       notice, this list of conditions and the following disclaimer in
> + *       the documentation and/or other materials provided with the
> + *       distribution.
> + *     * Neither the name of Intel Corporation nor the names of its
> + *       contributors may be used to endorse or promote products derived
> + *       from this software without specific prior written permission.
> + *
> + *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> + *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> + *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> + *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> +     }
> +
> +     RTE_LOG(INFO, PMD,
> +                     "Creating eventdev sw device %s, numa_node=%d, 
> sched_quanta=%d, credit_quanta=%d\n",
> +                     name, socket_id, sched_quanta, credit_quanta);
> +
> +     dev = rte_event_pmd_vdev_init(name,
> +                     sizeof(struct sw_evdev), socket_id);
> +     if (dev == NULL) {
> +             printf("eventdev vdev init() failed");

IMO, We need to avoid using printf for error reporting.I guess there are
multiple instance of the same in the patch series.

> +             return -EFAULT;
> +     }
> +     dev->dev_ops = &evdev_sw_ops;
> +
> +     sw = dev->data->dev_private;
> +     sw->data = dev->data;
> +
> +     /* copy values passed from vdev command line to instance */
> +     sw->credit_update_quanta = credit_quanta;
> +     sw->sched_quanta = sched_quanta;
> +
> +     return 0;
> +}
> +
> +static int
> +sw_remove(const char *name)
> +{
> +     if (name == NULL)
> +             return -EINVAL;
> +
> +     RTE_LOG(INFO, PMD, "Closing eventdev sw device %s\n", name);
> +     /* TODO unregister eventdev and release memzone */

I have sent a patch to address this.

> +
> +     return 0;
> +}
> +

Reply via email to