From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v2 03/15] event/sw: add new software-only eventdev driver Date: Mon, 6 Feb 2017 14:02:55 +0530 Message-ID: <20170206083254.GD25242@localhost.localdomain> References: <1484580885-148524-1-git-send-email-harry.van.haaren@intel.com> <1485879273-86228-1-git-send-email-harry.van.haaren@intel.com> <1485879273-86228-4-git-send-email-harry.van.haaren@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: , Bruce Richardson To: Harry van Haaren Return-path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0078.outbound.protection.outlook.com [104.47.38.78]) by dpdk.org (Postfix) with ESMTP id B4D03293B for ; Mon, 6 Feb 2017 09:33:13 +0100 (CET) Content-Disposition: inline In-Reply-To: <1485879273-86228-4-git-send-email-harry.van.haaren@intel.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" On Tue, Jan 31, 2017 at 04:14:21PM +0000, Harry van Haaren wrote: > From: Bruce Richardson > > 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 > Signed-off-by: Harry van Haaren > +# 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; > +} > +