From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sessmg22.ericsson.net (sessmg22.ericsson.net [193.180.251.58]) by dpdk.org (Postfix) with ESMTP id 916644F9B for ; Tue, 18 Sep 2018 14:45:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1537274729; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bVTeYRG9tNbhMMs7+sooUq/0VzWMLt79h9ikluNBcRc=; b=OkFH9WFZB1QfHxdXpnGUNEyqcGMArDEtgsJl86L0UViP9zRPBu84myGkRPiPzdD/ 7A4BzcGIZBx/hCJg+BAdsPkVwFEaUN+YiRQ8/i+L00gSYgx3iAg2gY00/+S5FMPJ hQgl/M2oKqmGXQysdWcncGCEYYw9S4JBQEvAbzbgk4o=; X-AuditID: c1b4fb3a-75d969c000003197-8c-5ba0f36904f8 Received: from ESESSMB501.ericsson.se (Unknown_Domain [153.88.183.119]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id A1.EF.12695.963F0AB5; Tue, 18 Sep 2018 14:45:29 +0200 (CEST) Received: from ESESSMB504.ericsson.se (153.88.183.165) by ESESSMB501.ericsson.se (153.88.183.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 18 Sep 2018 14:45:26 +0200 Received: from selio1a020.lmera.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.192) with Microsoft SMTP Server id 15.1.1466.3 via Frontend Transport; Tue, 18 Sep 2018 14:45:26 +0200 Received: from breslau.lmera.ericsson.se (breslau.lmera.ericsson.se [150.132.109.241]) by selio1a020.lmera.ericsson.se (8.15.1+Sun/8.15.1) with ESMTP id w8ICjQ1U011575; Tue, 18 Sep 2018 14:45:27 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: Jerin Jacob CC: Bruce Richardson , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Tue, 18 Sep 2018 14:45:05 +0200 Message-ID: <20180918124514.10615-2-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180918124514.10615-1-mattias.ronnblom@ericsson.com> References: <20180918124514.10615-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsUyM2J7uW7m5wXRBqt7rSxurLK3ePdpO5PF xEkmDsweG070s3r8WrCU1WPxnpdMAcxRXDYpqTmZZalF+nYJXBnv3r9gKWg1qmg5tYu5gfG9 ZhcjJ4eEgInEtsYJTF2MXBxCAkcZJY7vOcgG4XxjlLh26AkLSJWQwEVGiQPPYiASlxklfuxd zgaSYBPwlJj8rhusSETAQGLRmfvMIEXMAh2MEs1T/4AlhAUCJb5s/csKYrMIqEpsOd4PFucV cJJYvH8bE8Qd8hKrNxxgBrE5BZwlPk9dBxTnANrmJHFxgzJEuaDEyZkQBzELaEq0bv/NDmHL SzRvnc0McaiWxP0lX5gnMArNQtIyC0nLLCQtCxiZVzGKFqcWF+emGxnppRZlJhcX5+fp5aWW bGIEhvbBLb+tdjAefO54iFGAg1GJhzf51YJoIdbEsuLK3EOMEhzMSiK8nDlAId6UxMqq1KL8 +KLSnNTiQ4zSHCxK4rxOaRZRQgLpiSWp2ampBalFMFkmDk6pBkbPq9vPKicL9jtbGycUL5ti oH72VKXCmRrdV2172QWbGsQOn1epv/9akH2pomyJlWRY495bzZcXVd43uFrJtUS0NfD+uaRQ dyOHw6rKM4LfirtdDoj6cSxK73tJekFLtIuAcW+d0Onpgoa5jlsb8v9mBVy6Fqyl+Pigc0tr rpeNJ5/okTdLlViKMxINtZiLihMB4H7bc2kCAAA= Subject: [dpdk-dev] [PATCH v4 01/10] event/dsw: add DSW device registration and build system 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: Tue, 18 Sep 2018 12:45:31 -0000 This patch contains the Meson and GNU Make build system extensions required for the Distributed Event Device, and also the initialization code for the driver itself. Signed-off-by: Mattias Rönnblom --- config/common_base | 5 ++ drivers/event/Makefile | 1 + drivers/event/dsw/Makefile | 26 ++++++++++ drivers/event/dsw/dsw_evdev.c | 52 +++++++++++++++++++ drivers/event/dsw/dsw_evdev.h | 16 ++++++ drivers/event/dsw/meson.build | 6 +++ .../event/dsw/rte_pmd_dsw_event_version.map | 3 ++ drivers/event/meson.build | 2 +- mk/rte.app.mk | 1 + 9 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 drivers/event/dsw/Makefile create mode 100644 drivers/event/dsw/dsw_evdev.c create mode 100644 drivers/event/dsw/dsw_evdev.h create mode 100644 drivers/event/dsw/meson.build create mode 100644 drivers/event/dsw/rte_pmd_dsw_event_version.map diff --git a/config/common_base b/config/common_base index 4bcbaf923..c43f5139d 100644 --- a/config/common_base +++ b/config/common_base @@ -614,6 +614,11 @@ CONFIG_RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG=n # CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV=y +# +# Compile PMD for distributed software event device +# +CONFIG_RTE_LIBRTE_PMD_DSW_EVENTDEV=y + # # Compile PMD for octeontx sso event device # diff --git a/drivers/event/Makefile b/drivers/event/Makefile index f301d8dc2..03ad1b6cb 100644 --- a/drivers/event/Makefile +++ b/drivers/event/Makefile @@ -6,6 +6,7 @@ include $(RTE_SDK)/mk/rte.vars.mk DIRS-$(CONFIG_RTE_LIBRTE_PMD_SKELETON_EVENTDEV) += skeleton DIRS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += sw +DIRS-$(CONFIG_RTE_LIBRTE_PMD_DSW_EVENTDEV) += dsw DIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += octeontx ifeq ($(CONFIG_RTE_LIBRTE_DPAA_BUS),y) DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV) += dpaa diff --git a/drivers/event/dsw/Makefile b/drivers/event/dsw/Makefile new file mode 100644 index 000000000..5cbf488ff --- /dev/null +++ b/drivers/event/dsw/Makefile @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Ericsson AB + +include $(RTE_SDK)/mk/rte.vars.mk + +LIB = librte_pmd_dsw_event.a + +CFLAGS += -DALLOW_EXPERIMENTAL_API +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) +CFLAGS += -Wno-format-nonliteral + +LDLIBS += -lrte_eal +LDLIBS += -lrte_mbuf +LDLIBS += -lrte_mempool +LDLIBS += -lrte_ring +LDLIBS += -lrte_eventdev +LDLIBS += -lrte_bus_vdev + +LIBABIVER := 1 + +EXPORT_MAP := rte_pmd_dsw_event_version.map + +SRCS-$(CONFIG_RTE_LIBRTE_PMD_DSW_EVENTDEV) += dsw_evdev.c + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c new file mode 100644 index 000000000..6990bbc9e --- /dev/null +++ b/drivers/event/dsw/dsw_evdev.c @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Ericsson AB + */ + +#include +#include + +#include "dsw_evdev.h" + +#define EVENTDEV_NAME_DSW_PMD event_dsw + +static int +dsw_probe(struct rte_vdev_device *vdev) +{ + const char *name; + struct rte_eventdev *dev; + struct dsw_evdev *dsw; + + name = rte_vdev_device_name(vdev); + + dev = rte_event_pmd_vdev_init(name, sizeof(struct dsw_evdev), + rte_socket_id()); + if (dev == NULL) + return -EFAULT; + + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return 0; + + dsw = dev->data->dev_private; + dsw->data = dev->data; + + return 0; +} + +static int +dsw_remove(struct rte_vdev_device *vdev) +{ + const char *name; + + name = rte_vdev_device_name(vdev); + if (name == NULL) + return -EINVAL; + + return rte_event_pmd_vdev_uninit(name); +} + +static struct rte_vdev_driver evdev_dsw_pmd_drv = { + .probe = dsw_probe, + .remove = dsw_remove +}; + +RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_DSW_PMD, evdev_dsw_pmd_drv); diff --git a/drivers/event/dsw/dsw_evdev.h b/drivers/event/dsw/dsw_evdev.h new file mode 100644 index 000000000..9a0f4c357 --- /dev/null +++ b/drivers/event/dsw/dsw_evdev.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Ericsson AB + */ + +#ifndef _DSW_EVDEV_H_ +#define _DSW_EVDEV_H_ + +#include + +#define DSW_PMD_NAME RTE_STR(event_dsw) + +struct dsw_evdev { + struct rte_eventdev_data *data; +}; + +#endif diff --git a/drivers/event/dsw/meson.build b/drivers/event/dsw/meson.build new file mode 100644 index 000000000..275d051c3 --- /dev/null +++ b/drivers/event/dsw/meson.build @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Ericsson AB + +allow_experimental_apis = true +deps += ['bus_vdev'] +sources = files('dsw_evdev.c') diff --git a/drivers/event/dsw/rte_pmd_dsw_event_version.map b/drivers/event/dsw/rte_pmd_dsw_event_version.map new file mode 100644 index 000000000..24bd5cdb3 --- /dev/null +++ b/drivers/event/dsw/rte_pmd_dsw_event_version.map @@ -0,0 +1,3 @@ +DPDK_18.11 { + local: *; +}; diff --git a/drivers/event/meson.build b/drivers/event/meson.build index e95119935..4b9fed22b 100644 --- a/drivers/event/meson.build +++ b/drivers/event/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -drivers = ['dpaa', 'dpaa2', 'octeontx', 'skeleton', 'sw'] +drivers = ['dpaa', 'dpaa2', 'octeontx', 'skeleton', 'sw', 'dsw'] std_deps = ['eventdev', 'kvargs'] config_flag_fmt = 'RTE_LIBRTE_@0@_EVENTDEV_PMD' driver_name_fmt = 'rte_pmd_@0@_event' diff --git a/mk/rte.app.mk b/mk/rte.app.mk index de33883be..682e224eb 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -236,6 +236,7 @@ endif # CONFIG_RTE_LIBRTE_COMPRESSDEV ifeq ($(CONFIG_RTE_LIBRTE_EVENTDEV),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SKELETON_EVENTDEV) += -lrte_pmd_skeleton_event _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += -lrte_pmd_sw_event +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DSW_EVENTDEV) += -lrte_pmd_dsw_event _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += -lrte_pmd_octeontx_ssovf ifeq ($(CONFIG_RTE_LIBRTE_DPAA_BUS),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV) += -lrte_pmd_dpaa_event -- 2.17.1