[dpdk-dev] [PATCH 0/7] Cisco Systems Inc. VIC Ethernet PMD - ENIC PMD
ENIC PMD is the poll-mode driver for the Cisco Systems Inc. VIC to be used with DPDK suite. Further details are provided in the ReleaseNotes.txt in the path lib/librte_pmd_enic/ Sujith Sankar (7): DPDK changes for accommodating ENIC PMD ENIC PMD License ENIC PMD Makefile VNIC common code ENIC PMD specific code DPDK-ENIC PMD interface Release notes for ENIC PMD 1.0.0.3 app/test-pmd/testpmd.c |1 + config/common_linuxapp |6 + lib/Makefile |1 + lib/librte_eal/linuxapp/eal/eal_pci_vfio.c |7 + lib/librte_eal/linuxapp/eal/include/eal_pci_init.h |1 + lib/librte_pmd_enic/LICENSE| 23 + lib/librte_pmd_enic/Makefile | 66 + lib/librte_pmd_enic/ReleaseNotes.txt | 196 +++ lib/librte_pmd_enic/src/cq_desc.h | 122 ++ lib/librte_pmd_enic/src/cq_enet_desc.h | 257 lib/librte_pmd_enic/src/enic.h | 154 +++ lib/librte_pmd_enic/src/enic_clsf.c| 240 lib/librte_pmd_enic/src/enic_compat.h | 138 ++ lib/librte_pmd_enic/src/enic_etherdev.c| 616 + lib/librte_pmd_enic/src/enic_main.c| 1325 lib/librte_pmd_enic/src/enic_res.c | 217 lib/librte_pmd_enic/src/enic_res.h | 164 +++ lib/librte_pmd_enic/src/rq_enet_desc.h | 72 ++ lib/librte_pmd_enic/src/vnic_cq.c | 113 ++ lib/librte_pmd_enic/src/vnic_cq.h | 148 +++ lib/librte_pmd_enic/src/vnic_dev.c | 1077 lib/librte_pmd_enic/src/vnic_dev.h | 198 +++ lib/librte_pmd_enic/src/vnic_devcmd.h | 770 lib/librte_pmd_enic/src/vnic_enet.h| 74 ++ lib/librte_pmd_enic/src/vnic_intr.c| 79 ++ lib/librte_pmd_enic/src/vnic_intr.h| 122 ++ lib/librte_pmd_enic/src/vnic_nic.h | 84 ++ lib/librte_pmd_enic/src/vnic_resource.h| 93 ++ lib/librte_pmd_enic/src/vnic_rq.c | 242 lib/librte_pmd_enic/src/vnic_rq.h | 278 lib/librte_pmd_enic/src/vnic_rss.c | 81 ++ lib/librte_pmd_enic/src/vnic_rss.h | 57 + lib/librte_pmd_enic/src/vnic_stats.h | 82 ++ lib/librte_pmd_enic/src/vnic_wq.c | 241 lib/librte_pmd_enic/src/vnic_wq.h | 279 + lib/librte_pmd_enic/src/wq_enet_desc.h | 110 ++ mk/rte.app.mk |4 + 37 files changed, 7738 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE create mode 100644 lib/librte_pmd_enic/Makefile create mode 100644 lib/librte_pmd_enic/ReleaseNotes.txt create mode 100644 lib/librte_pmd_enic/src/cq_desc.h create mode 100644 lib/librte_pmd_enic/src/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/src/enic.h create mode 100644 lib/librte_pmd_enic/src/enic_clsf.c create mode 100644 lib/librte_pmd_enic/src/enic_compat.h create mode 100644 lib/librte_pmd_enic/src/enic_etherdev.c create mode 100644 lib/librte_pmd_enic/src/enic_main.c create mode 100644 lib/librte_pmd_enic/src/enic_res.c create mode 100644 lib/librte_pmd_enic/src/enic_res.h create mode 100644 lib/librte_pmd_enic/src/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/src/vnic_cq.c create mode 100644 lib/librte_pmd_enic/src/vnic_cq.h create mode 100644 lib/librte_pmd_enic/src/vnic_dev.c create mode 100644 lib/librte_pmd_enic/src/vnic_dev.h create mode 100644 lib/librte_pmd_enic/src/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/src/vnic_enet.h create mode 100644 lib/librte_pmd_enic/src/vnic_intr.c create mode 100644 lib/librte_pmd_enic/src/vnic_intr.h create mode 100644 lib/librte_pmd_enic/src/vnic_nic.h create mode 100644 lib/librte_pmd_enic/src/vnic_resource.h create mode 100644 lib/librte_pmd_enic/src/vnic_rq.c create mode 100644 lib/librte_pmd_enic/src/vnic_rq.h create mode 100644 lib/librte_pmd_enic/src/vnic_rss.c create mode 100644 lib/librte_pmd_enic/src/vnic_rss.h create mode 100644 lib/librte_pmd_enic/src/vnic_stats.h create mode 100644 lib/librte_pmd_enic/src/vnic_wq.c create mode 100644 lib/librte_pmd_enic/src/vnic_wq.h create mode 100644 lib/librte_pmd_enic/src/wq_enet_desc.h -- 1.9.1
[dpdk-dev] [PATCH 1/7] DPDK changes for accommodating ENIC PMD
Signed-off-by: Sujith Sankar --- app/test-pmd/testpmd.c | 1 + config/common_linuxapp | 6 ++ lib/Makefile | 1 + lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 7 +++ lib/librte_eal/linuxapp/eal/include/eal_pci_init.h | 1 + mk/rte.app.mk | 4 6 files changed, 20 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index f76406f..4857d56 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1874,6 +1874,7 @@ main(int argc, char** argv) "check that " "CONFIG_RTE_LIBRTE_IGB_PMD=y and that " "CONFIG_RTE_LIBRTE_EM_PMD=y and that " + "CONFIG_RTE_LIBRTE_ENIC_PMD=y and that " "CONFIG_RTE_LIBRTE_IXGBE_PMD=y in your " "configuration file\n"); diff --git a/config/common_linuxapp b/config/common_linuxapp index 57b61c9..6b5bac6 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -210,6 +210,12 @@ CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM=4 CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1 # +# Compile burst-oriented Cisco ENIC PMD driver +# +CONFIG_RTE_LIBRTE_ENIC_PMD=y +CONFIG_RTE_LIBRTE_ENIC_PMD_DEBUG_TRACE=n + +# # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y diff --git a/lib/Makefile b/lib/Makefile index e3237ff..1911790 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -43,6 +43,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ether DIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += librte_pmd_e1000 DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_ixgbe +DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_enic DIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += librte_pmd_i40e DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += librte_pmd_bond DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += librte_pmd_ring diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c index c776ddc..6bf8f2e 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c @@ -736,6 +736,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev) maps[i].offset = reg.offset; maps[i].size = reg.size; dev->mem_resource[i].addr = bar_addr; + dev->mem_resource[i].len = reg.size; } /* if secondary process, do not set up interrupts */ @@ -791,4 +792,10 @@ pci_vfio_is_enabled(void) { return vfio_cfg.vfio_enabled; } + +int +pci_vfio_container_fd(void) +{ + return vfio_cfg.vfio_container_fd; +} #endif diff --git a/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h b/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h index d758bee..c9e9e40 100644 --- a/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h +++ b/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h @@ -71,6 +71,7 @@ int pci_uio_map_resource(struct rte_pci_device *dev); int pci_vfio_enable(void); int pci_vfio_is_enabled(void); +int pci_vfio_container_fd(void); int pci_vfio_mp_sync_setup(void); /* map VFIO resource prototype */ diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 285b65c..95c652f 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -186,6 +186,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) LDLIBS += -lrte_pmd_vmxnet3_uio endif +ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) +LDLIBS += -lrte_pmd_enic +endif + ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) LDLIBS += -lrte_pmd_virtio_uio endif -- 1.9.1
[dpdk-dev] [PATCH 2/7] ENIC PMD License
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/LICENSE | 23 +++ 1 file changed, 23 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE diff --git a/lib/librte_pmd_enic/LICENSE b/lib/librte_pmd_enic/LICENSE new file mode 100644 index 000..589e36f --- /dev/null +++ b/lib/librte_pmd_enic/LICENSE @@ -0,0 +1,23 @@ + * Copyright (c) 2014, Cisco Systems, Inc. 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. + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. -- 1.9.1
[dpdk-dev] [PATCH 3/7] ENIC PMD Makefile
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/Makefile | 66 1 file changed, 66 insertions(+) create mode 100644 lib/librte_pmd_enic/Makefile diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile new file mode 100644 index 000..7605a8f --- /dev/null +++ b/lib/librte_pmd_enic/Makefile @@ -0,0 +1,66 @@ +# BSD LICENSE +# +# Copyright(c) 2010-2013 Intel Corporation. All rights reserved. +# 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 +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_enic.a + +CFLAGS += -I$(RTE_SDK)/lib/librte_hash/ +CFLAGS += -O3 -Wno-deprecated + +VPATH += $(RTE_SDK)/lib/librte_pmd_enic/src + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_main.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_clsf.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_cq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_wq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_dev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_intr.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_rq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_etherdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_res.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_rss.c + + +# this lib depends upon: +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_eal lib/librte_ether +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_mempool lib/librte_mbuf +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_net lib/librte_malloc + +include $(RTE_SDK)/mk/rte.lib.mk + -- 1.9.1
[dpdk-dev] [PATCH 4/7] VNIC common code
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/src/cq_desc.h | 122 lib/librte_pmd_enic/src/cq_enet_desc.h | 257 lib/librte_pmd_enic/src/rq_enet_desc.h | 72 +++ lib/librte_pmd_enic/src/vnic_cq.c | 113 lib/librte_pmd_enic/src/vnic_cq.h | 148 + lib/librte_pmd_enic/src/vnic_dev.c | 1077 +++ lib/librte_pmd_enic/src/vnic_dev.h | 198 ++ lib/librte_pmd_enic/src/vnic_devcmd.h | 770 ++ lib/librte_pmd_enic/src/vnic_enet.h | 74 +++ lib/librte_pmd_enic/src/vnic_intr.c | 79 +++ lib/librte_pmd_enic/src/vnic_intr.h | 122 lib/librte_pmd_enic/src/vnic_nic.h | 84 +++ lib/librte_pmd_enic/src/vnic_resource.h | 93 +++ lib/librte_pmd_enic/src/vnic_rq.c | 242 +++ lib/librte_pmd_enic/src/vnic_rq.h | 278 lib/librte_pmd_enic/src/vnic_rss.c | 81 +++ lib/librte_pmd_enic/src/vnic_rss.h | 57 ++ lib/librte_pmd_enic/src/vnic_stats.h| 82 +++ lib/librte_pmd_enic/src/vnic_wq.c | 241 +++ lib/librte_pmd_enic/src/vnic_wq.h | 279 lib/librte_pmd_enic/src/wq_enet_desc.h | 110 21 files changed, 4579 insertions(+) create mode 100644 lib/librte_pmd_enic/src/cq_desc.h create mode 100644 lib/librte_pmd_enic/src/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/src/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/src/vnic_cq.c create mode 100644 lib/librte_pmd_enic/src/vnic_cq.h create mode 100644 lib/librte_pmd_enic/src/vnic_dev.c create mode 100644 lib/librte_pmd_enic/src/vnic_dev.h create mode 100644 lib/librte_pmd_enic/src/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/src/vnic_enet.h create mode 100644 lib/librte_pmd_enic/src/vnic_intr.c create mode 100644 lib/librte_pmd_enic/src/vnic_intr.h create mode 100644 lib/librte_pmd_enic/src/vnic_nic.h create mode 100644 lib/librte_pmd_enic/src/vnic_resource.h create mode 100644 lib/librte_pmd_enic/src/vnic_rq.c create mode 100644 lib/librte_pmd_enic/src/vnic_rq.h create mode 100644 lib/librte_pmd_enic/src/vnic_rss.c create mode 100644 lib/librte_pmd_enic/src/vnic_rss.h create mode 100644 lib/librte_pmd_enic/src/vnic_stats.h create mode 100644 lib/librte_pmd_enic/src/vnic_wq.c create mode 100644 lib/librte_pmd_enic/src/vnic_wq.h create mode 100644 lib/librte_pmd_enic/src/wq_enet_desc.h diff --git a/lib/librte_pmd_enic/src/cq_desc.h b/lib/librte_pmd_enic/src/cq_desc.h new file mode 100644 index 000..6c14cb3 --- /dev/null +++ b/lib/librte_pmd_enic/src/cq_desc.h @@ -0,0 +1,122 @@ +/* + * Copyright 2008-2010 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. 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. + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id: cq_desc.h 129574 2013-04-26 22:11:14Z rfaucett $" + +#ifndef _CQ_DESC_H_ +#define _CQ_DESC_H_ + +/* + * Completion queue descriptor types + */ +enum cq_desc_types { + CQ_DESC_TYPE_WQ_ENET = 0, + CQ_DESC_TYPE_DESC_COPY = 1, + CQ_DESC_TYPE_WQ_EXCH = 2, + CQ_DESC_TYPE_RQ_ENET = 3, + CQ_DESC_TYPE_RQ_FCP = 4, + CQ_DESC_TYPE_IOMMU_MISS = 5, + CQ_DESC_TYPE_SGL = 6, + CQ_DESC_TYPE_CLASSIFIER = 7, + CQ_DESC_TYPE_TEST = 127, +}; + +/* Completion queue descriptor: 16B + * + * All completion queues have this basic layout. The + * type_specfic area is unique for each completion + * queue type. + */ +struct cq_desc { + __le16 completed_index; + __le16 q_number; + u8 type_specfic[11]; + u8 type_color; +}; + +#define CQ_DESC_TYPE_BITS4 +#defi
[dpdk-dev] [PATCH 5/7] ENIC PMD specific code
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/src/enic.h| 154 lib/librte_pmd_enic/src/enic_clsf.c | 240 ++ lib/librte_pmd_enic/src/enic_compat.h | 138 lib/librte_pmd_enic/src/enic_main.c | 1325 + lib/librte_pmd_enic/src/enic_res.c| 217 ++ lib/librte_pmd_enic/src/enic_res.h| 164 6 files changed, 2238 insertions(+) create mode 100644 lib/librte_pmd_enic/src/enic.h create mode 100644 lib/librte_pmd_enic/src/enic_clsf.c create mode 100644 lib/librte_pmd_enic/src/enic_compat.h create mode 100644 lib/librte_pmd_enic/src/enic_main.c create mode 100644 lib/librte_pmd_enic/src/enic_res.c create mode 100644 lib/librte_pmd_enic/src/enic_res.h diff --git a/lib/librte_pmd_enic/src/enic.h b/lib/librte_pmd_enic/src/enic.h new file mode 100644 index 000..fd9cdd9 --- /dev/null +++ b/lib/librte_pmd_enic/src/enic.h @@ -0,0 +1,154 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. 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. + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#ifndef _ENIC_H_ +#define _ENIC_H_ + +#include "vnic_enet.h" +#include "vnic_dev.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_cq.h" +#include "vnic_intr.h" +#include "vnic_stats.h" +#include "vnic_nic.h" +#include "vnic_rss.h" +#include "enic_res.h" + +#define DRV_NAME "enic_pmd" +#define DRV_DESCRIPTION"Cisco VIC Ethernet NIC Poll-mode Driver" +#define DRV_VERSION"1.0.0.3" +#define DRV_COPYRIGHT "Copyright 2008-2014 Cisco Systems, Inc" + +#define ENIC_WQ_MAX8 +#define ENIC_RQ_MAX8 +#define ENIC_CQ_MAX(ENIC_WQ_MAX + ENIC_RQ_MAX) +#define ENIC_INTR_MAX (ENIC_CQ_MAX + 2) + +#define VLAN_ETH_HLEN 18 + +#define ENICPMD_SETTING(enic, f) ((enic->config.flags & VENETF_##f) ? 1 : 0) + +#define ENICPMD_BDF_LENGTH 13 /* :00:00.0'\0' */ +#define PKT_TX_TCP_UDP_CKSUM0x6000 +#define ENIC_CALC_IP_CKSUM 1 +#define ENIC_CALC_TCP_UDP_CKSUM 2 +#define ENIC_MAX_MTU9000 +#define PAGE_SIZE 4096 +#define PAGE_ROUND_UP(x) \ + unsigned long)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1))) + +#define ENICPMD_VFIO_PATH "/dev/vfio/vfio" +/*#define ENIC_DESC_COUNT_MAKE_ODD (x) do{if ((~(x)) & 1) { (x)--; } }while(0)*/ + +#define PCI_DEVICE_ID_CISCO_VIC_ENET 0x0043 /* ethernet vnic */ +#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF 0x0071 /* enet SRIOV VF */ + + +#define ENICPMD_FDIR_MAX 64 + +struct enic_fdir_node { + struct rte_fdir_filter filter; + u16 fltr_id; + u16 rq_index; +}; + +struct enic_fdir { + struct rte_eth_fdir stats; + struct rte_hash *hash; + struct enic_fdir_node *nodes[ENICPMD_FDIR_MAX]; +}; + +/* Per-instance private data structure */ +struct enic { + struct enic *next; + struct rte_pci_device *pdev; + struct vnic_enet_config config; + struct vnic_dev_bar bar0; + struct vnic_dev *vdev; + + struct rte_eth_dev *rte_dev; + struct enic_fdir fdir; + char bdf_name[ENICPMD_BDF_LENGTH]; + int dev_fd; + int iommu_group_fd; + int vfio_fd; + int iommu_groupid; + int eventfd; + u_int8_t mac_addr[ETH_ALEN]; + pthread_t err_intr_thread; + int promisc; + int allmulti; +
[dpdk-dev] [PATCH 6/7] DPDK-ENIC PMD interface
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/src/enic_etherdev.c | 616 1 file changed, 616 insertions(+) create mode 100644 lib/librte_pmd_enic/src/enic_etherdev.c diff --git a/lib/librte_pmd_enic/src/enic_etherdev.c b/lib/librte_pmd_enic/src/enic_etherdev.c new file mode 100644 index 000..e9a64f5 --- /dev/null +++ b/lib/librte_pmd_enic/src/enic_etherdev.c @@ -0,0 +1,616 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. 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. + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#include +#include + +#include +#include +#include +#include + +#include "vnic_intr.h" +#include "vnic_cq.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_enet.h" +#include "enic.h" + +#ifdef RTE_LIBRTE_ENIC_PMD_DEBUG_TRACE +#define ENICPMD_FUNC_TRACE()\ + do { \ + dev_trace(enic, "Entering %s\n", __func__); \ + } while (0) +#else +#define ENICPMD_FUNC_TRACE() +#endif + + +/* + * The set of PCI devices this driver supports + */ +static struct rte_pci_id pci_id_enic_map[] = { +#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, +#ifndef PCI_VENDOR_ID_CISCO +#define PCI_VENDOR_ID_CISCO0x1137 +#endif +#include "rte_pci_dev_ids.h" +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET) +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF) +{.vendor_id = 0, /* Sentinal */}, +}; + +int enicpmd_fdir_remove_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, + uint16_t soft_id) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_del_fltr(enic, fdir_filter); +} + +int enicpmd_fdir_add_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, uint16_t soft_id, + uint8_t queue, uint8_t drop) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_add_fltr(enic, fdir_filter, (uint16_t)queue, drop); +} + +void enicpmd_fdir_info_get(struct rte_eth_dev *eth_dev, + struct rte_eth_fdir *fdir) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + *fdir = enic->fdir.stats; +} + +void enicpmd_dev_tx_queue_release(void *txq) +{ + ENICPMD_FUNC_TRACE(); + enic_free_wq(txq); +} + +static int enicpmd_dev_setup_intr(struct enic *enic) +{ + int ret; + int index; + + ENICPMD_FUNC_TRACE(); + + /* Are we done with the init of all the queues? */ + for (index = 0; index < enic->cq_count; index++) { + if (!enic->cq[index].ctrl) + break; + } + + if (enic->cq_count != index) + return 0; + + ret = enic_alloc_intr_resources(enic); + if (ret) { + dev_err(enic, "alloc intr failed\n"); + return ret; + } + enic_init_vnic_resources(enic); + + ret = enic_setup_finish(enic); + if (ret) + dev_err(enic, "setup could not be finished\n"); + + return ret; +} + +int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, + uint16_t queue_idx, + uint16_t nb_desc, + unsigned int socket_id, + const struct rte_eth_txconf *tx_conf) +{ + int ret; + struct enic *enic = pmd_p
[dpdk-dev] [PATCH 7/7] Release notes for ENIC PMD 1.0.0.3
+ + +Prerequisites +- + - Prepare the system as recommended by DPDK suite. This includes environment + variables, hugepages configuration, tool-chains and configuration + - Insert vfio-pci kernel module using the command 'modprobe vfio-pci' if the + user wants to use VFIO framework + - Insert uio kernel module using the command 'modprobe uio' if the user wants + to use UIO framework + - DPDK suite should be configured based on the user's decision to use VFIO or + UIO framework + - Bind the intended vNIC to vfio-pci using librte_pmd_enic/scripts/bind_to_vfio + in case the user wants ENIC PMD to use VFIO framework + - Bind the intended vNIC to igb_uio in case the user wants ENIC PMD to use + UIO framework + + Now, the system is ready to run the application. Once the application runs to + completion, if it is required, the vNIC could be detached from vfio-pci or igb_uio. + vNICs could be detached from vfio-pci using the script + librte_pmd_enic/scripts/unbind_from_vfio + + Root privilege is required to bind and unbind vNICs to/from VFIO/UIO. + + VFIO framework helps an unprivileged user to run the applications. + + For an unprivileged user to run the applications on DPDK and ENIC PMD, + it might be required to increase the maximum locked memory of the user. + The following command could be used to do this. + + sudo sh -c "ulimit -l " + + The value depends on the memory configuration of the application, DPDK and + PMD. Typically, the limit has to be raised to higher than 2GB. + e.g., 2621440 + + The compilation of any unused drivers could be turned off using the + configuration file in config/ directory (e.g., config/common_linuxapp). + This would help in bringing down the time taken for building the + libraries and the initialization time of the application. + +Additional Reference + + - www.dpdk.org + - Intel? Data Plane Development Kit: Release Notes + - Intel? Data Plane Development Kit: Programmer's Guide + - Intel? Data Plane Development Kit Testpmd Application: Guide + + +Contact Information +--- + Any questions or bugs should be reported to DPDK community or to the following + email addresses. + + Sujith Sankar + Prasad Rao + -- 1.9.1
[dpdk-dev] [PATCH] enic: corrected the usage of VFIO_PRESENT
This patch corrects the usage of the flag VFIO_PRESENT in enic driver. This has uncovered a few warnings, and this patch corrects those too. Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/Makefile| 1 + lib/librte_pmd_enic/enic.h | 1 + lib/librte_pmd_enic/enic_main.c | 12 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile index a2a623f..3271960 100644 --- a/lib/librte_pmd_enic/Makefile +++ b/lib/librte_pmd_enic/Makefile @@ -39,6 +39,7 @@ LIB = librte_pmd_enic.a CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/ CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/ +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal/ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) -Wno-strict-aliasing diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h index c43417c..c692bab 100644 --- a/lib/librte_pmd_enic/enic.h +++ b/lib/librte_pmd_enic/enic.h @@ -182,6 +182,7 @@ extern void enic_dev_stats_get(struct enic *enic, struct rte_eth_stats *r_stats); extern void enic_dev_stats_clear(struct enic *enic); extern void enic_add_packet_filter(struct enic *enic); +extern void *enic_err_intr_handler(void *arg); extern void enic_set_mac_address(struct enic *enic, uint8_t *mac_addr); extern void enic_del_mac_address(struct enic *enic); extern unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq); diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c index e4f43c5..469cb6c 100644 --- a/lib/librte_pmd_enic/enic_main.c +++ b/lib/librte_pmd_enic/enic_main.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -46,6 +47,7 @@ #include #include #include +#include #include "enic_compat.h" #include "enic.h" @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct rte_pci_device *hwdev, /* Nothing to be done */ } +#ifndef VFIO_PRESENT static void enic_intr_handler(__rte_unused struct rte_intr_handle *handle, void *arg) @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct rte_intr_handle *handle, enic_log_q_error(enic); } +#endif int enic_enable(struct enic *enic) { @@ -978,12 +982,13 @@ static void enic_eventfd_init(struct enic *enic) void *enic_err_intr_handler(void *arg) { struct enic *enic = (struct enic *)arg; - unsigned int intr = enic_msix_err_intr(enic); - ssize_t size; uint64_t data; while (1) { - size = read(enic->eventfd, &data, sizeof(data)); + if (-1 == read(enic->eventfd, &data, sizeof(data))) { + dev_err(enic, "eventfd read failed with error %d\n", errno); + continue; + } dev_err(enic, "Err intr.\n"); vnic_intr_return_all_credits(&enic->intr); @@ -1035,7 +1040,6 @@ static int enic_set_intr_mode(struct enic *enic) int *fds; int size; int ret = -1; - int index; if (enic->intr_count < 1) { dev_err(enic, "Unsupported resource conf.\n"); -- 1.9.1
[dpdk-dev] [PATCH] enic: remove code under VFIO_PRESENT and use eal code for interrupts
This patch removes the interrupt registration code which was under the flag VFIO_PRESENT and relies on the rte_lib code for the same. This also ignores the initial trigger of ISR from the lib. Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic_main.c | 117 1 file changed, 117 deletions(-) diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c index e4f43c5..8ab8e44 100644 --- a/lib/librte_pmd_enic/enic_main.c +++ b/lib/librte_pmd_enic/enic_main.c @@ -567,7 +567,6 @@ enic_intr_handler(__rte_unused struct rte_intr_handle *handle, { struct enic *enic = pmd_priv((struct rte_eth_dev *)arg); - dev_err(enic, "Err intr.\n"); vnic_intr_return_all_credits(&enic->intr); enic_log_q_error(enic); @@ -605,13 +604,11 @@ int enic_enable(struct enic *enic) vnic_dev_enable_wait(enic->vdev); -#ifndef VFIO_PRESENT /* Register and enable error interrupt */ rte_intr_callback_register(&(enic->pdev->intr_handle), enic_intr_handler, (void *)enic->rte_dev); rte_intr_enable(&(enic->pdev->intr_handle)); -#endif vnic_intr_unmask(&enic->intr); return 0; @@ -969,31 +966,6 @@ int enic_setup_finish(struct enic *enic) return 0; } -#ifdef VFIO_PRESENT -static void enic_eventfd_init(struct enic *enic) -{ - enic->eventfd = enic->pdev->intr_handle.fd; -} - -void *enic_err_intr_handler(void *arg) -{ - struct enic *enic = (struct enic *)arg; - unsigned int intr = enic_msix_err_intr(enic); - ssize_t size; - uint64_t data; - - while (1) { - size = read(enic->eventfd, &data, sizeof(data)); - dev_err(enic, "Err intr.\n"); - vnic_intr_return_all_credits(&enic->intr); - - enic_log_q_error(enic); - } - - return NULL; -} -#endif - void enic_add_packet_filter(struct enic *enic) { /* Args -> directed, multicast, broadcast, promisc, allmulti */ @@ -1006,87 +978,12 @@ int enic_get_link_status(struct enic *enic) return vnic_dev_link_status(enic->vdev); } - -#ifdef VFIO_PRESENT -static int enic_create_err_intr_thread(struct enic *enic) -{ - pthread_attr_t intr_attr; - - /* create threads for error interrupt handling */ - pthread_attr_init(&intr_attr); - pthread_attr_setstacksize(&intr_attr, 0x10); - - /* ERR */ - if (pthread_create(&enic->err_intr_thread, &intr_attr, - enic_err_intr_handler, (void *)enic)) { - dev_err(enic, "Failed to create err interrupt handler threads\n"); - return -1; - } - - pthread_attr_destroy(&intr_attr); - - return 0; -} - - -static int enic_set_intr_mode(struct enic *enic) -{ - struct vfio_irq_set *irq_set; - int *fds; - int size; - int ret = -1; - int index; - - if (enic->intr_count < 1) { - dev_err(enic, "Unsupported resource conf.\n"); - return -1; - } - vnic_dev_set_intr_mode(enic->vdev, VNIC_DEV_INTR_MODE_MSIX); - - enic->intr_count = 1; - - enic_eventfd_init(enic); - size = sizeof(*irq_set) + (sizeof(int)); - - irq_set = rte_zmalloc("enic_vfio_irq", size, 0); - irq_set->argsz = size; - irq_set->index = VFIO_PCI_MSIX_IRQ_INDEX; - irq_set->start = 0; - irq_set->count = 1; /* For error interrupt only */ - irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | - VFIO_IRQ_SET_ACTION_TRIGGER; - fds = (int *)&irq_set->data; - - fds[0] = enic->eventfd; - - ret = ioctl(enic->pdev->intr_handle.vfio_dev_fd, - VFIO_DEVICE_SET_IRQS, irq_set); - rte_free(irq_set); - if (ret) { - dev_err(enic, "Failed to set eventfds for interrupts\n"); - return -1; - } - - enic_create_err_intr_thread(enic); - return 0; -} - -static void enic_clear_intr_mode(struct enic *enic) -{ - vnic_dev_set_intr_mode(enic->vdev, VNIC_DEV_INTR_MODE_UNKNOWN); -} -#endif - static void enic_dev_deinit(struct enic *enic) { struct rte_eth_dev *eth_dev = enic->rte_dev; if (eth_dev->data->mac_addrs) rte_free(eth_dev->data->mac_addrs); - -#ifdef VFIO_PRESENT - enic_clear_intr_mode(enic); -#endif } @@ -1139,20 +1036,6 @@ static int enic_dev_init(struct enic *enic) */ enic_get_res_counts(enic); -#ifdef VFIO_PRESENT - /* Set interrupt mode based on resource counts and system -* capabilities -*/ - err = enic_set_intr_mode(enic); - if (err) { - rte_free(eth_dev->data->mac_addrs); -
[dpdk-dev] [PATCH] enic: migrating to new fdir api
This patch helps enic migrate to the new flow-director API. It takes care of the following. 1. The change in fdir_filter structure and stats structure 2. DPDK interface functions in enic_ethdev.c 3. ENIC driver functions that deal with the VIC adapter Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic.h| 12 +++--- lib/librte_pmd_enic/enic_clsf.c | 43 -- lib/librte_pmd_enic/enic_ethdev.c | 77 ++- 3 files changed, 89 insertions(+), 43 deletions(-) diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h index a50bff1..acdd0f6 100644 --- a/lib/librte_pmd_enic/enic.h +++ b/lib/librte_pmd_enic/enic.h @@ -80,13 +80,13 @@ #define ENICPMD_FDIR_MAX 64 struct enic_fdir_node { - struct rte_fdir_filter filter; + struct rte_eth_fdir_filter filter; u16 fltr_id; u16 rq_index; }; struct enic_fdir { - struct rte_eth_fdir stats; + struct rte_eth_fdir_stats stats; struct rte_hash *hash; struct enic_fdir_node *nodes[ENICPMD_FDIR_MAX]; }; @@ -110,7 +110,7 @@ struct enic { pthread_t err_intr_thread; int promisc; int allmulti; - uint8_t ig_vlan_strip_en; + u8 ig_vlan_strip_en; int link_status; u8 hw_ip_checksum; @@ -154,10 +154,12 @@ static inline struct enic *pmd_priv(struct rte_eth_dev *eth_dev) return (struct enic *)eth_dev->data->dev_private; } +extern void enic_fdir_stats_get(struct enic *enic, + struct rte_eth_fdir_stats *stats); extern int enic_fdir_add_fltr(struct enic *enic, - struct rte_fdir_filter *params, u16 queue, u8 drop); + struct rte_eth_fdir_filter *params); extern int enic_fdir_del_fltr(struct enic *enic, - struct rte_fdir_filter *params); + struct rte_eth_fdir_filter *params); extern void enic_free_wq(void *txq); extern int enic_alloc_intr_resources(struct enic *enic); extern int enic_setup_finish(struct enic *enic); diff --git a/lib/librte_pmd_enic/enic_clsf.c b/lib/librte_pmd_enic/enic_clsf.c index b61d625..f4cba75 100644 --- a/lib/librte_pmd_enic/enic_clsf.c +++ b/lib/librte_pmd_enic/enic_clsf.c @@ -65,7 +65,12 @@ #define ENICPMD_CLSF_HASH_ENTRIES ENICPMD_FDIR_MAX #define ENICPMD_CLSF_BUCKET_ENTRIES 4 -int enic_fdir_del_fltr(struct enic *enic, struct rte_fdir_filter *params) +void enic_fdir_stats_get(struct enic *enic, struct rte_eth_fdir_stats *stats) +{ + *stats = enic->fdir.stats; +} + +int enic_fdir_del_fltr(struct enic *enic, struct rte_eth_fdir_filter *params) { int32_t pos; struct enic_fdir_node *key; @@ -92,23 +97,33 @@ int enic_fdir_del_fltr(struct enic *enic, struct rte_fdir_filter *params) return 0; } -int enic_fdir_add_fltr(struct enic *enic, struct rte_fdir_filter *params, - u16 queue, u8 drop) +int enic_fdir_add_fltr(struct enic *enic, struct rte_eth_fdir_filter *params) { struct enic_fdir_node *key; struct filter fltr = {.type = 0}; int32_t pos; u8 do_free = 0; u16 old_fltr_id = 0; + u32 flowtype_supported; + u16 flex_bytes; + u16 queue; + + flowtype_supported = ( + (RTE_ETH_FLOW_NONFRAG_IPV4_TCP == params->input.flow_type) || + (RTE_ETH_FLOW_NONFRAG_IPV4_UDP == params->input.flow_type)); + + flex_bytes = ((params->input.flow_ext.flexbytes[1] << 8 & 0xFF00) | + (params->input.flow_ext.flexbytes[0] & 0xFF)); - if (!enic->fdir.hash || params->vlan_id || !params->l4type || - (RTE_FDIR_IPTYPE_IPV6 == params->iptype) || - (RTE_FDIR_L4TYPE_SCTP == params->l4type) || - params->flex_bytes || drop) { + if (!enic->fdir.hash || + (params->input.flow_ext.vlan_tci & 0xFFF) || + !flowtype_supported || flex_bytes || + params->action.behavior /* drop */) { enic->fdir.stats.f_add++; return -ENOTSUP; } + queue = params->action.rx_queue; /* See if the key is already there in the table */ pos = rte_hash_del_key(enic->fdir.hash, params); switch (pos) { @@ -168,12 +183,16 @@ int enic_fdir_add_fltr(struct enic *enic, struct rte_fdir_filter *params, key->rq_index = queue; fltr.type = FILTER_IPV4_5TUPLE; - fltr.u.ipv4.src_addr = rte_be_to_cpu_32(params->ip_src.ipv4_addr); - fltr.u.ipv4.dst_addr = rte_be_to_cpu_32(params->ip_dst.ipv4_addr); - fltr.u.ipv4.src_port = rte_be_to_cpu_16(params->port_src); - fltr.u.ipv4.dst_port = rte_be_to_cpu_16(params->port_dst); + fltr.u.ipv4.src_addr = rte_be_to_cpu_32( + params->input.flow.ip4_flow.src_ip); + fltr.u.ipv4.dst_addr = rte_be_to_cpu_32( + params->input.flow.ip4_flow.dst_ip); + fltr.u.ipv4.src_port
[dpdk-dev] [PATCH] enic: remove use of rte_fdir_filter for key_len
This patch removes the use of rte_fdir_filter from enic_clsf. This also takes care of modifying the version and copyright string. Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic.h | 4 ++-- lib/librte_pmd_enic/enic_clsf.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h index 7528d7d..1417b0c 100644 --- a/lib/librte_pmd_enic/enic.h +++ b/lib/librte_pmd_enic/enic.h @@ -49,8 +49,8 @@ #define DRV_NAME "enic_pmd" #define DRV_DESCRIPTION"Cisco VIC Ethernet NIC Poll-mode Driver" -#define DRV_VERSION"1.0.0.4" -#define DRV_COPYRIGHT "Copyright 2008-2014 Cisco Systems, Inc" +#define DRV_VERSION"1.0.0.5" +#define DRV_COPYRIGHT "Copyright 2008-2015 Cisco Systems, Inc" #define ENIC_WQ_MAX8 #define ENIC_RQ_MAX8 diff --git a/lib/librte_pmd_enic/enic_clsf.c b/lib/librte_pmd_enic/enic_clsf.c index 937723e..ca12d2d 100644 --- a/lib/librte_pmd_enic/enic_clsf.c +++ b/lib/librte_pmd_enic/enic_clsf.c @@ -246,7 +246,7 @@ int enic_clsf_init(struct enic *enic) .name = "enicpmd_clsf_hash", .entries = ENICPMD_CLSF_HASH_ENTRIES, .bucket_entries = ENICPMD_CLSF_BUCKET_ENTRIES, - .key_len = sizeof(struct rte_fdir_filter), + .key_len = RTE_HASH_KEY_LENGTH_MAX, .hash_func = DEFAULT_HASH_FUNC, .hash_func_init_val = 0, .socket_id = SOCKET_0, -- 1.9.1
[dpdk-dev] net/bonding - need for 8023ad slave to be in promisc mode
Hi folks, Could someone clarify the need to put mode 4 bonding slaves in promiscuous mode? 840 void 841 bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) 842 { . . . 878 /* use this port as agregator */ 879 port->aggregator_port_id = slave_id; 880 rte_eth_promiscuous_enable(slave_id); The Linux kernel mode bonding driver gets it working by assigning the bond/primary slave MAC address to the rest of the slaves. Is there a reason for not using this method? I tried this using my app on DPDK 16.04 on 82599, but could not get rx working. It would be great if someone could help me with this. Thanks, -Sujith
Re: [dpdk-dev] net/bonding - need for 8023ad slave to be in promisc mode
Hi Declan, Got your name from the maintainers' list. Could you please help me with this? Thanks, -Sujith On Mon, Feb 27, 2017 at 1:40 PM, sujith sankar wrote: > Hi folks, > > Could someone clarify the need to put mode 4 bonding slaves in promiscuous > mode? > > 840 void > 841 bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t > slave_id) > 842 { > . > . > . > 878 /* use this port as agregator */ > 879 port->aggregator_port_id = slave_id; > 880 rte_eth_promiscuous_enable(slave_id); > > > The Linux kernel mode bonding driver gets it working by assigning the > bond/primary slave MAC address to the rest of the slaves. Is there a reason > for not using this method? > > I tried this using my app on DPDK 16.04 on 82599, but could not get rx > working. It would be great if someone could help me with this. > > Thanks, > -Sujith
[dpdk-dev] net/virtio - question on multiqueue - hashing
Hi folks, In virtio multiqueue configuration, for a given 4-tuple, how could I figure out the index of the receive queue in which that flow would land? Some of the email threads I came across gave the impression that virtio does not implement RSS. My tests too gave similar results. Could someone kindly provide some clarity and help me with the steps? Thanks, -Sujith
[dpdk-dev] IXGBE VF on KVM - Transmit stalled after switch reboot
Hi, We are seeing a stall in packet transmission from VF after a network switch (Nexus 9000) restart. The packets sent out on ixgbe-vf are not seen on the wire. Is this expected when the switch restarts? Is a re-init of VF expected from PMD? The application, which is based on DPDK 16.04, is running inside an Ubuntu VM on KVM. It uses a VF that has been passed through to the VM and the PF is owned by Linux kernel mode driver. PF is able to transmit packets. VFs that are inside the VM and that are not claimed by DPDK are also working fine. I feel that there is a recovery sequence that is expected from the application/PMD in such a case. It would be great if IXGBE PMD maintainers or someone who is familiar with this could help us. Kindly let me know if you have questions. Thanks, -Sujith Sankar Avi Networks (India) Pvt Ltd.
[dpdk-dev] ixgbe - link state change detection of port-channel members triggered from Cisco Nexus 9000
Hi, While testing port-channels (LACP) on ixgbe, I observed that when port-channel member interfaces are brought down from Cisco Nexus 9000 switch, ixgbe PMD is not detecting it. It was seen that LSC interrupts are not getting generated. This behaviour is intermittent and is not seen with Linux kernel mode driver. We are using DPDK 16.04 in our code. Please find below the details of the NIC and switch. NIC firmware version : 0x8887 Switch : Cisco Nexus9000 C9372PX (observed the same on Nexus 7000 also) Switch firmware : 7.0(3)I1(3) This behaviour was not observed while testing with Cumulus or Netgear switches. Could the maintainers of ixgbe confirm if there are any such inter-operability problems between Cisco switches and Niantic cards? Also, is there any work-around for this? Thanks, -Sujith Sankar
Re: [dpdk-dev] ixgbe - link state change detection of port-channel members triggered from Cisco Nexus 9000
Hi all, It would be great if someone could help me with this. Thanks, -Sujith On Tue, Oct 3, 2017 at 5:23 PM, sujith sankar wrote: > Hi, > > While testing port-channels (LACP) on ixgbe, I observed that when > port-channel member interfaces are brought down from Cisco Nexus 9000 > switch, ixgbe PMD is not detecting it. It was seen that LSC > interrupts are not getting generated. This behaviour is intermittent > and is not seen with Linux kernel mode driver. > > We are using DPDK 16.04 in our code. > Please find below the details of the NIC and switch. > > NIC firmware version : 0x8887 > Switch : Cisco Nexus9000 C9372PX (observed the same on Nexus 7000 also) > Switch firmware : 7.0(3)I1(3) > > This behaviour was not observed while testing with Cumulus or Netgear > switches. > > Could the maintainers of ixgbe confirm if there are any such > inter-operability problems between Cisco switches and Niantic cards? > Also, is there any work-around for this? > > Thanks, > -Sujith Sankar
[dpdk-dev] Fwd: PMD for Broadcom/Emulex OCe14000 OCP Skyhawk-R
Hi all, Is PMD for Broadcom/Emulex OCe14000 OCP Skyhawk-R available? There are a few documents in Broadcom's site. But could not find the source code of it. I believe 6Wind team developed the PMD for Broadcom. But what is the status of it? Is it freely available? Tried to get some help from users alias, but could not. Could someone please help me with info on this? Thanks, -Sujith
Re: [dpdk-dev] Fwd: PMD for Broadcom/Emulex OCe14000 OCP Skyhawk-R
On Thu, Mar 8, 2018 at 12:50 PM, Vincent JARDIN wrote: > Le 07/03/2018 à 04:56, sujith sankar a écrit : >> >> Is PMD for Broadcom/Emulex OCe14000 OCP Skyhawk-R available? There >> are a few documents in Broadcom's site. But could not find the source >> code of it. > > > Right, it has not been upstreamed. Currently, it is even deprecated at 6WIND > for our new releases. > www.6wind.com/products/6windgate/6windgate-platfoarm-support/ > see the NIC section. > >> >> I believe 6Wind team developed the PMD for Broadcom. But what is the >> status of it? Is it freely available? > > > I guess you are referring to: > https://docs.broadcom.com/docs/12356248 > > This PMD is deprecated. We kept it only for old DPDK releases because it > relies on some specific SDK from Emulex/Skyhawk's designers! The PMD without > the SDK is useless. > >> >> Tried to get some help from users alias, but could not. >> Could someone please help me with info on this? > > > In fact, the best option is to use AF_XDP PMD if you need to support this > Emulex/SkyhawkNIC. Please, give a try to this AF_XDP PMD. Your benchmarks > will be welcomed. I guess it is better to invest time in improving AF_XDP > PMD, > http://dpdk.org/ml/archives/dev/2018-February/091502.html > Thanks Vincent ! Your inputs are much appreciated. Regards, -Sujith > best regards, > Vincent
[dpdk-dev] [PATCH] enicpmd: build changes for FreeBSD
This patch adds the changes required to build enic for FreeBSD Signed-off-by: Sujith Sankar --- lib/librte_eal/bsdapp/nic_uio/nic_uio.c | 1 + lib/librte_eal/common/include/rte_pci_dev_ids.h | 17 + 2 files changed, 18 insertions(+) diff --git a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c index 5ae8560..e649e32 100644 --- a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c +++ b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c @@ -113,6 +113,7 @@ struct pci_bdf { #define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev) {vend, dev}, #define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev) {vend, dev}, #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev) {vend, dev}, +#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev){vend, dev}, const struct device devices[] = { #include diff --git a/lib/librte_eal/common/include/rte_pci_dev_ids.h b/lib/librte_eal/common/include/rte_pci_dev_ids.h index 21d2eed..5d1b285 100644 --- a/lib/librte_eal/common/include/rte_pci_dev_ids.h +++ b/lib/librte_eal/common/include/rte_pci_dev_ids.h @@ -140,6 +140,10 @@ #define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev) #endif +#ifndef RTE_PCI_DEV_ID_DECL_ENIC +#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) +#endif + #ifndef PCI_VENDOR_ID_INTEL /** Vendor ID used by Intel devices */ #define PCI_VENDOR_ID_INTEL 0x8086 @@ -155,6 +159,11 @@ #define PCI_VENDOR_ID_VMWARE 0x15AD #endif +#ifndef PCI_VENDOR_ID_CISCO +/** Vendor ID used by Cisco VIC devices */ +#define PCI_VENDOR_ID_CISCO 0x1137 +#endif + / Physical EM devices from e1000_hw.h / #define E1000_DEV_ID_825420x1000 @@ -548,6 +557,14 @@ RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3) RTE_PCI_DEV_ID_DECL_FM10KVF(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_VF) +/** Cisco VIC devices **/ + +#define PCI_DEVICE_ID_CISCO_VIC_ENET 0x0043 /* ethernet vnic */ +#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF 0x0071 /* enet SRIOV VF */ + +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET) +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF) + /* * Undef all RTE_PCI_DEV_ID_DECL_* here. */ -- 1.9.1
[dpdk-dev] [PATCH] enic: add support for enic in nic_uio driver for FreeBSD
This patch adds support for enic in the nic_uio driver so that enic could be used on FreeBSD. Signed-off-by: Sujith Sankar --- lib/librte_eal/bsdapp/nic_uio/nic_uio.c | 1 + lib/librte_eal/common/include/rte_pci_dev_ids.h | 17 + 2 files changed, 18 insertions(+) diff --git a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c index 5ae8560..e649e32 100644 --- a/lib/librte_eal/bsdapp/nic_uio/nic_uio.c +++ b/lib/librte_eal/bsdapp/nic_uio/nic_uio.c @@ -113,6 +113,7 @@ struct pci_bdf { #define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev) {vend, dev}, #define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev) {vend, dev}, #define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev) {vend, dev}, +#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev){vend, dev}, const struct device devices[] = { #include diff --git a/lib/librte_eal/common/include/rte_pci_dev_ids.h b/lib/librte_eal/common/include/rte_pci_dev_ids.h index 21d2eed..5d1b285 100644 --- a/lib/librte_eal/common/include/rte_pci_dev_ids.h +++ b/lib/librte_eal/common/include/rte_pci_dev_ids.h @@ -140,6 +140,10 @@ #define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev) #endif +#ifndef RTE_PCI_DEV_ID_DECL_ENIC +#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) +#endif + #ifndef PCI_VENDOR_ID_INTEL /** Vendor ID used by Intel devices */ #define PCI_VENDOR_ID_INTEL 0x8086 @@ -155,6 +159,11 @@ #define PCI_VENDOR_ID_VMWARE 0x15AD #endif +#ifndef PCI_VENDOR_ID_CISCO +/** Vendor ID used by Cisco VIC devices */ +#define PCI_VENDOR_ID_CISCO 0x1137 +#endif + / Physical EM devices from e1000_hw.h / #define E1000_DEV_ID_825420x1000 @@ -548,6 +557,14 @@ RTE_PCI_DEV_ID_DECL_VMXNET3(PCI_VENDOR_ID_VMWARE, VMWARE_DEV_ID_VMXNET3) RTE_PCI_DEV_ID_DECL_FM10KVF(PCI_VENDOR_ID_INTEL, FM10K_DEV_ID_VF) +/** Cisco VIC devices **/ + +#define PCI_DEVICE_ID_CISCO_VIC_ENET 0x0043 /* ethernet vnic */ +#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF 0x0071 /* enet SRIOV VF */ + +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET) +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF) + /* * Undef all RTE_PCI_DEV_ID_DECL_* here. */ -- 1.9.1
[dpdk-dev] [PATCH v2 0/6] Cisco Systems Inc. VIC Ethernet PMD - ENIC PMD
ENIC PMD is the poll-mode driver for the Cisco Systems Inc. VIC to be used with DPDK suite. Sujith Sankar (6): ENIC PMD License ENIC PMD Makefile VNIC common code partially shared with ENIC kernel mode driver ENIC PMD specific code DPDK-ENIC PMD interface DPDK changes for accommodating ENIC PMD config/common_linuxapp |6 + lib/Makefile |1 + lib/librte_eal/linuxapp/eal/eal_pci_vfio.c |7 + lib/librte_eal/linuxapp/eal/include/eal_pci_init.h |1 + lib/librte_pmd_enic/LICENSE| 27 + lib/librte_pmd_enic/Makefile | 67 + lib/librte_pmd_enic/enic.h | 158 +++ lib/librte_pmd_enic/enic_clsf.c| 244 lib/librte_pmd_enic/enic_compat.h | 142 +++ lib/librte_pmd_enic/enic_etherdev.c| 620 + lib/librte_pmd_enic/enic_main.c| 1328 lib/librte_pmd_enic/enic_res.c | 221 lib/librte_pmd_enic/enic_res.h | 168 +++ lib/librte_pmd_enic/vnic/cq_desc.h | 126 ++ lib/librte_pmd_enic/vnic/cq_enet_desc.h| 261 lib/librte_pmd_enic/vnic/rq_enet_desc.h| 76 ++ lib/librte_pmd_enic/vnic/vnic_cq.c | 117 ++ lib/librte_pmd_enic/vnic/vnic_cq.h | 152 +++ lib/librte_pmd_enic/vnic/vnic_dev.c| 1081 lib/librte_pmd_enic/vnic/vnic_dev.h| 202 +++ lib/librte_pmd_enic/vnic/vnic_devcmd.h | 774 lib/librte_pmd_enic/vnic/vnic_enet.h | 78 ++ lib/librte_pmd_enic/vnic/vnic_intr.c | 83 ++ lib/librte_pmd_enic/vnic/vnic_intr.h | 126 ++ lib/librte_pmd_enic/vnic/vnic_nic.h| 88 ++ lib/librte_pmd_enic/vnic/vnic_resource.h | 97 ++ lib/librte_pmd_enic/vnic/vnic_rq.c | 246 lib/librte_pmd_enic/vnic/vnic_rq.h | 282 + lib/librte_pmd_enic/vnic/vnic_rss.c| 85 ++ lib/librte_pmd_enic/vnic/vnic_rss.h| 61 + lib/librte_pmd_enic/vnic/vnic_stats.h | 86 ++ lib/librte_pmd_enic/vnic/vnic_wq.c | 245 lib/librte_pmd_enic/vnic/vnic_wq.h | 283 + lib/librte_pmd_enic/vnic/wq_enet_desc.h| 114 ++ mk/rte.app.mk |4 + 35 files changed, 7657 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE create mode 100644 lib/librte_pmd_enic/Makefile create mode 100644 lib/librte_pmd_enic/enic.h create mode 100644 lib/librte_pmd_enic/enic_clsf.c create mode 100644 lib/librte_pmd_enic/enic_compat.h create mode 100644 lib/librte_pmd_enic/enic_etherdev.c create mode 100644 lib/librte_pmd_enic/enic_main.c create mode 100644 lib/librte_pmd_enic/enic_res.c create mode 100644 lib/librte_pmd_enic/enic_res.h create mode 100644 lib/librte_pmd_enic/vnic/cq_desc.h create mode 100644 lib/librte_pmd_enic/vnic/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_enet.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_nic.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_resource.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_stats.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.h create mode 100644 lib/librte_pmd_enic/vnic/wq_enet_desc.h -- 1.9.1
[dpdk-dev] [PATCH v2 1/6] ENIC PMD License
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/LICENSE | 27 +++ 1 file changed, 27 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE diff --git a/lib/librte_pmd_enic/LICENSE b/lib/librte_pmd_enic/LICENSE new file mode 100644 index 000..0ad2216 --- /dev/null +++ b/lib/librte_pmd_enic/LICENSE @@ -0,0 +1,27 @@ + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. -- 1.9.1
[dpdk-dev] [PATCH v2 2/6] ENIC PMD Makefile
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/Makefile | 67 1 file changed, 67 insertions(+) create mode 100644 lib/librte_pmd_enic/Makefile diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile new file mode 100644 index 000..2073cd6 --- /dev/null +++ b/lib/librte_pmd_enic/Makefile @@ -0,0 +1,67 @@ +# BSD LICENSE +# +# Copyright(c) 2010-2013 Intel Corporation. All rights reserved. +# 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 +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_enic.a + +CFLAGS += -I$(RTE_SDK)/lib/librte_hash/ -I$(RTE_SDK)/lib/librte_pmd_enic/ +CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/ +CFLAGS += -O3 -Wno-deprecated + +VPATH += $(RTE_SDK)/lib/librte_pmd_enic/src + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_main.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_clsf.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_cq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_wq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_dev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_intr.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_rq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_etherdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_res.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_rss.c + + +# this lib depends upon: +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_eal lib/librte_ether +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_mempool lib/librte_mbuf +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_net lib/librte_malloc + +include $(RTE_SDK)/mk/rte.lib.mk + -- 1.9.1
[dpdk-dev] [PATCH v2 3/6] VNIC common code partially shared with ENIC kernel mode driver
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/vnic/cq_desc.h | 126 lib/librte_pmd_enic/vnic/cq_enet_desc.h | 261 lib/librte_pmd_enic/vnic/rq_enet_desc.h | 76 +++ lib/librte_pmd_enic/vnic/vnic_cq.c | 117 lib/librte_pmd_enic/vnic/vnic_cq.h | 152 + lib/librte_pmd_enic/vnic/vnic_dev.c | 1081 ++ lib/librte_pmd_enic/vnic/vnic_dev.h | 202 ++ lib/librte_pmd_enic/vnic/vnic_devcmd.h | 774 + lib/librte_pmd_enic/vnic/vnic_enet.h | 78 +++ lib/librte_pmd_enic/vnic/vnic_intr.c | 83 +++ lib/librte_pmd_enic/vnic/vnic_intr.h | 126 lib/librte_pmd_enic/vnic/vnic_nic.h | 88 +++ lib/librte_pmd_enic/vnic/vnic_resource.h | 97 +++ lib/librte_pmd_enic/vnic/vnic_rq.c | 246 +++ lib/librte_pmd_enic/vnic/vnic_rq.h | 282 lib/librte_pmd_enic/vnic/vnic_rss.c | 85 +++ lib/librte_pmd_enic/vnic/vnic_rss.h | 61 ++ lib/librte_pmd_enic/vnic/vnic_stats.h| 86 +++ lib/librte_pmd_enic/vnic/vnic_wq.c | 245 +++ lib/librte_pmd_enic/vnic/vnic_wq.h | 283 lib/librte_pmd_enic/vnic/wq_enet_desc.h | 114 21 files changed, 4663 insertions(+) create mode 100644 lib/librte_pmd_enic/vnic/cq_desc.h create mode 100644 lib/librte_pmd_enic/vnic/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_enet.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_nic.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_resource.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_stats.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.h create mode 100644 lib/librte_pmd_enic/vnic/wq_enet_desc.h diff --git a/lib/librte_pmd_enic/vnic/cq_desc.h b/lib/librte_pmd_enic/vnic/cq_desc.h new file mode 100644 index 000..7dfb2b6 --- /dev/null +++ b/lib/librte_pmd_enic/vnic/cq_desc.h @@ -0,0 +1,126 @@ +/* + * Copyright 2008-2010 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id: cq_desc.h 129574 2013-04-26 22:11:14Z rfaucett $" + +#ifndef _CQ_DESC_H_ +#define _CQ_DESC_H_ + +/* + * Completion queue descriptor types + */ +enum cq_desc_types { + CQ_DESC_TYPE_WQ_ENET = 0, + CQ_DESC_TYPE_DESC_COPY = 1, + CQ_DESC_TYPE_WQ_EXCH = 2, + CQ_DESC_TYPE_RQ_ENET = 3, + CQ_DESC_TYPE_RQ_FCP = 4, + CQ_DESC_TYPE_IOMMU_MISS = 5, + CQ_DESC_TYPE_SGL = 6, + CQ_DESC_TYPE_CLASSIFIER = 7, + CQ_DESC_TYPE_TEST = 127, +}; + +/* Completion queue descriptor: 16B + * + * All completion queues have this basic layout. The + * type_specfic area is unique for each completion + * queue type. + */ +struct cq_desc { + __le16 completed_index; + __le16 q_number; + u8 type_specfic[11]; +
[dpdk-dev] [PATCH v2 4/6] ENIC PMD specific code
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic.h| 158 + lib/librte_pmd_enic/enic_clsf.c | 244 +++ lib/librte_pmd_enic/enic_compat.h | 142 lib/librte_pmd_enic/enic_main.c | 1328 + lib/librte_pmd_enic/enic_res.c| 221 ++ lib/librte_pmd_enic/enic_res.h| 168 + 6 files changed, 2261 insertions(+) create mode 100644 lib/librte_pmd_enic/enic.h create mode 100644 lib/librte_pmd_enic/enic_clsf.c create mode 100644 lib/librte_pmd_enic/enic_compat.h create mode 100644 lib/librte_pmd_enic/enic_main.c create mode 100644 lib/librte_pmd_enic/enic_res.c create mode 100644 lib/librte_pmd_enic/enic_res.h diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h new file mode 100644 index 000..b72c048 --- /dev/null +++ b/lib/librte_pmd_enic/enic.h @@ -0,0 +1,158 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#ifndef _ENIC_H_ +#define _ENIC_H_ + +#include "vnic_enet.h" +#include "vnic_dev.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_cq.h" +#include "vnic_intr.h" +#include "vnic_stats.h" +#include "vnic_nic.h" +#include "vnic_rss.h" +#include "enic_res.h" + +#define DRV_NAME "enic_pmd" +#define DRV_DESCRIPTION"Cisco VIC Ethernet NIC Poll-mode Driver" +#define DRV_VERSION"1.0.0.4" +#define DRV_COPYRIGHT "Copyright 2008-2014 Cisco Systems, Inc" + +#define ENIC_WQ_MAX8 +#define ENIC_RQ_MAX8 +#define ENIC_CQ_MAX(ENIC_WQ_MAX + ENIC_RQ_MAX) +#define ENIC_INTR_MAX (ENIC_CQ_MAX + 2) + +#define VLAN_ETH_HLEN 18 + +#define ENICPMD_SETTING(enic, f) ((enic->config.flags & VENETF_##f) ? 1 : 0) + +#define ENICPMD_BDF_LENGTH 13 /* :00:00.0'\0' */ +#define PKT_TX_TCP_UDP_CKSUM0x6000 +#define ENIC_CALC_IP_CKSUM 1 +#define ENIC_CALC_TCP_UDP_CKSUM 2 +#define ENIC_MAX_MTU9000 +#define PAGE_SIZE 4096 +#define PAGE_ROUND_UP(x) \ + unsigned long)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1))) + +#define ENICPMD_VFIO_PATH "/dev/vfio/vfio" +/*#define ENIC_DESC_COUNT_MAKE_ODD (x) do{if ((~(x)) & 1) { (x)--; } }while(0)*/ + +#define PCI_DEVICE_ID_CISCO_VIC_ENET 0x0043 /* ethernet vnic */ +#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF 0x0071 /* enet SRIOV VF */ + + +#define ENICPMD_FDIR_MAX 64 + +struct enic_fdir_node { + struct rte_fdir_filter filter; + u16 fltr_id; + u16 rq_index; +}; + +struct enic_fdir { + struct rte_eth_fdir stats; + struct rte_hash *hash; + struct enic_fdir_node *nodes[ENICPMD_FDIR_MAX]; +}; + +/* Per-instance private data structure */ +struct enic { + struct enic *next; + struct rte_pci_device *pdev; + struct vnic_enet_config config; + struct vnic_dev_bar bar0; + struct vnic_dev *vdev; + + struct rte_eth_dev *rte_dev; + struct enic_fdir fdir; + char bdf_name[ENICPMD_BDF_LENGTH]; + int dev_fd; + int iommu_group_fd; + int vfio_fd; + int iommu_groupid; + int eventfd; + u_int8_t mac_addr[ETH_ALEN]; + pthread_t err_intr_thread; + int promisc; + int allmulti; + int ig_vlan_strip_en; +
[dpdk-dev] [PATCH v2 5/6] DPDK-ENIC PMD interface
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic_etherdev.c | 620 1 file changed, 620 insertions(+) create mode 100644 lib/librte_pmd_enic/enic_etherdev.c diff --git a/lib/librte_pmd_enic/enic_etherdev.c b/lib/librte_pmd_enic/enic_etherdev.c new file mode 100644 index 000..90003f5 --- /dev/null +++ b/lib/librte_pmd_enic/enic_etherdev.c @@ -0,0 +1,620 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#include +#include + +#include +#include +#include +#include + +#include "vnic_intr.h" +#include "vnic_cq.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_enet.h" +#include "enic.h" + +#ifdef RTE_LIBRTE_ENIC_PMD_DEBUG_TRACE +#define ENICPMD_FUNC_TRACE()\ + do { \ + dev_trace(enic, "Entering %s\n", __func__); \ + } while (0) +#else +#define ENICPMD_FUNC_TRACE() +#endif + + +/* + * The set of PCI devices this driver supports + */ +static struct rte_pci_id pci_id_enic_map[] = { +#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, +#ifndef PCI_VENDOR_ID_CISCO +#define PCI_VENDOR_ID_CISCO0x1137 +#endif +#include "rte_pci_dev_ids.h" +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET) +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF) +{.vendor_id = 0, /* Sentinal */}, +}; + +int enicpmd_fdir_remove_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, + uint16_t soft_id) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_del_fltr(enic, fdir_filter); +} + +int enicpmd_fdir_add_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, uint16_t soft_id, + uint8_t queue, uint8_t drop) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_add_fltr(enic, fdir_filter, (uint16_t)queue, drop); +} + +void enicpmd_fdir_info_get(struct rte_eth_dev *eth_dev, + struct rte_eth_fdir *fdir) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + *fdir = enic->fdir.stats; +} + +void enicpmd_dev_tx_queue_release(void *txq) +{ + ENICPMD_FUNC_TRACE(); + enic_free_wq(txq); +} + +static int enicpmd_dev_setup_intr(struct enic *enic) +{ + int ret; + int index; + + ENICPMD_FUNC_TRACE(); + + /* Are we done with the init of all the queues? */ + for (index = 0; index < enic->cq_count; index++) { + if (!enic->cq[index].ctrl) + break; + } + + if (enic->cq_count != index) + return 0; + + ret = enic_alloc_intr_resources(enic); + if (ret) { + dev_err(enic, "alloc intr failed\n"); + return ret; + } + enic_init_vnic_resources(enic); + + ret = enic_setup_finish(enic); + if (ret) + dev_err(enic, "setup could not be finished\n"); + + return ret; +} + +int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, + uint16_t queue_idx, + uint16_t nb_desc, + unsigned int socket_id, + const struct rte_eth_txconf *tx_conf) +{ + int ret; + struct en
[dpdk-dev] [PATCH v2 6/6] DPDK changes for accommodating ENIC PMD
Signed-off-by: Sujith Sankar --- config/common_linuxapp | 6 ++ lib/Makefile | 1 + lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 7 +++ lib/librte_eal/linuxapp/eal/include/eal_pci_init.h | 1 + mk/rte.app.mk | 4 5 files changed, 19 insertions(+) diff --git a/config/common_linuxapp b/config/common_linuxapp index 57b61c9..6b5bac6 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -210,6 +210,12 @@ CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM=4 CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1 # +# Compile burst-oriented Cisco ENIC PMD driver +# +CONFIG_RTE_LIBRTE_ENIC_PMD=y +CONFIG_RTE_LIBRTE_ENIC_PMD_DEBUG_TRACE=n + +# # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y diff --git a/lib/Makefile b/lib/Makefile index e3237ff..1911790 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -43,6 +43,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ether DIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += librte_pmd_e1000 DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_ixgbe +DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_enic DIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += librte_pmd_i40e DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += librte_pmd_bond DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += librte_pmd_ring diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c index c776ddc..6bf8f2e 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c @@ -736,6 +736,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev) maps[i].offset = reg.offset; maps[i].size = reg.size; dev->mem_resource[i].addr = bar_addr; + dev->mem_resource[i].len = reg.size; } /* if secondary process, do not set up interrupts */ @@ -791,4 +792,10 @@ pci_vfio_is_enabled(void) { return vfio_cfg.vfio_enabled; } + +int +pci_vfio_container_fd(void) +{ + return vfio_cfg.vfio_container_fd; +} #endif diff --git a/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h b/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h index d758bee..c9e9e40 100644 --- a/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h +++ b/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h @@ -71,6 +71,7 @@ int pci_uio_map_resource(struct rte_pci_device *dev); int pci_vfio_enable(void); int pci_vfio_is_enabled(void); +int pci_vfio_container_fd(void); int pci_vfio_mp_sync_setup(void); /* map VFIO resource prototype */ diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 285b65c..95c652f 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -186,6 +186,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) LDLIBS += -lrte_pmd_vmxnet3_uio endif +ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) +LDLIBS += -lrte_pmd_enic +endif + ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) LDLIBS += -lrte_pmd_virtio_uio endif -- 1.9.1
[dpdk-dev] [PATCH v3 0/6] Cisco Systems Inc. VIC Ethernet PMD - ENIC PMD
ENIC PMD is the poll-mode driver for the Cisco Systems Inc. VIC to be used with DPDK suite. Sujith Sankar (6): ENIC PMD License ENIC PMD Makefile VNIC common code partially shared with ENIC kernel mode driver ENIC PMD specific code DPDK-ENIC PMD interface DPDK changes for accommodating ENIC PMD config/common_linuxapp |5 + lib/Makefile |1 + lib/librte_eal/linuxapp/eal/eal_pci_vfio.c |7 + lib/librte_eal/linuxapp/eal/include/eal_pci_init.h |1 + lib/librte_pmd_enic/LICENSE| 27 + lib/librte_pmd_enic/Makefile | 67 + lib/librte_pmd_enic/enic.h | 158 +++ lib/librte_pmd_enic/enic_clsf.c| 244 lib/librte_pmd_enic/enic_compat.h | 142 +++ lib/librte_pmd_enic/enic_etherdev.c| 613 + lib/librte_pmd_enic/enic_main.c| 1328 lib/librte_pmd_enic/enic_res.c | 221 lib/librte_pmd_enic/enic_res.h | 168 +++ lib/librte_pmd_enic/vnic/cq_desc.h | 126 ++ lib/librte_pmd_enic/vnic/cq_enet_desc.h| 261 lib/librte_pmd_enic/vnic/rq_enet_desc.h| 76 ++ lib/librte_pmd_enic/vnic/vnic_cq.c | 117 ++ lib/librte_pmd_enic/vnic/vnic_cq.h | 152 +++ lib/librte_pmd_enic/vnic/vnic_dev.c| 1081 lib/librte_pmd_enic/vnic/vnic_dev.h| 202 +++ lib/librte_pmd_enic/vnic/vnic_devcmd.h | 774 lib/librte_pmd_enic/vnic/vnic_enet.h | 78 ++ lib/librte_pmd_enic/vnic/vnic_intr.c | 83 ++ lib/librte_pmd_enic/vnic/vnic_intr.h | 126 ++ lib/librte_pmd_enic/vnic/vnic_nic.h| 88 ++ lib/librte_pmd_enic/vnic/vnic_resource.h | 97 ++ lib/librte_pmd_enic/vnic/vnic_rq.c | 246 lib/librte_pmd_enic/vnic/vnic_rq.h | 282 + lib/librte_pmd_enic/vnic/vnic_rss.c| 85 ++ lib/librte_pmd_enic/vnic/vnic_rss.h| 61 + lib/librte_pmd_enic/vnic/vnic_stats.h | 86 ++ lib/librte_pmd_enic/vnic/vnic_wq.c | 245 lib/librte_pmd_enic/vnic/vnic_wq.h | 283 + lib/librte_pmd_enic/vnic/wq_enet_desc.h| 114 ++ mk/rte.app.mk |4 + 35 files changed, 7649 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE create mode 100644 lib/librte_pmd_enic/Makefile create mode 100644 lib/librte_pmd_enic/enic.h create mode 100644 lib/librte_pmd_enic/enic_clsf.c create mode 100644 lib/librte_pmd_enic/enic_compat.h create mode 100644 lib/librte_pmd_enic/enic_etherdev.c create mode 100644 lib/librte_pmd_enic/enic_main.c create mode 100644 lib/librte_pmd_enic/enic_res.c create mode 100644 lib/librte_pmd_enic/enic_res.h create mode 100644 lib/librte_pmd_enic/vnic/cq_desc.h create mode 100644 lib/librte_pmd_enic/vnic/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_enet.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_nic.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_resource.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_stats.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.h create mode 100644 lib/librte_pmd_enic/vnic/wq_enet_desc.h -- 1.9.1
[dpdk-dev] [PATCH v3 1/6] ENIC PMD License
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/LICENSE | 27 +++ 1 file changed, 27 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE diff --git a/lib/librte_pmd_enic/LICENSE b/lib/librte_pmd_enic/LICENSE new file mode 100644 index 000..0ad2216 --- /dev/null +++ b/lib/librte_pmd_enic/LICENSE @@ -0,0 +1,27 @@ + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. -- 1.9.1
[dpdk-dev] [PATCH v3 2/6] ENIC PMD Makefile
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/Makefile | 67 1 file changed, 67 insertions(+) create mode 100644 lib/librte_pmd_enic/Makefile diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile new file mode 100644 index 000..25d8f31 --- /dev/null +++ b/lib/librte_pmd_enic/Makefile @@ -0,0 +1,67 @@ +# +# Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. +# Copyright 2007 Nuova Systems, Inc. All rights reserved. +# +# Copyright (c) 2014, Cisco Systems, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. 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. +# +# 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_enic.a + +CFLAGS += -I$(RTE_SDK)/lib/librte_hash/ -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/ +CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/ +CFLAGS += -O3 -Wno-deprecated + +VPATH += $(RTE_SDK)/lib/librte_pmd_enic/src + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_main.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_clsf.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_cq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_wq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_dev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_intr.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_rq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_etherdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_res.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_rss.c + + +# this lib depends upon: +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_eal lib/librte_ether +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_mempool lib/librte_mbuf +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_net lib/librte_malloc + +include $(RTE_SDK)/mk/rte.lib.mk + -- 1.9.1
[dpdk-dev] [PATCH v3 3/6] VNIC common code partially shared with ENIC kernel mode driver
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/vnic/cq_desc.h | 126 lib/librte_pmd_enic/vnic/cq_enet_desc.h | 261 lib/librte_pmd_enic/vnic/rq_enet_desc.h | 76 +++ lib/librte_pmd_enic/vnic/vnic_cq.c | 117 lib/librte_pmd_enic/vnic/vnic_cq.h | 152 + lib/librte_pmd_enic/vnic/vnic_dev.c | 1081 ++ lib/librte_pmd_enic/vnic/vnic_dev.h | 202 ++ lib/librte_pmd_enic/vnic/vnic_devcmd.h | 774 + lib/librte_pmd_enic/vnic/vnic_enet.h | 78 +++ lib/librte_pmd_enic/vnic/vnic_intr.c | 83 +++ lib/librte_pmd_enic/vnic/vnic_intr.h | 126 lib/librte_pmd_enic/vnic/vnic_nic.h | 88 +++ lib/librte_pmd_enic/vnic/vnic_resource.h | 97 +++ lib/librte_pmd_enic/vnic/vnic_rq.c | 246 +++ lib/librte_pmd_enic/vnic/vnic_rq.h | 282 lib/librte_pmd_enic/vnic/vnic_rss.c | 85 +++ lib/librte_pmd_enic/vnic/vnic_rss.h | 61 ++ lib/librte_pmd_enic/vnic/vnic_stats.h| 86 +++ lib/librte_pmd_enic/vnic/vnic_wq.c | 245 +++ lib/librte_pmd_enic/vnic/vnic_wq.h | 283 lib/librte_pmd_enic/vnic/wq_enet_desc.h | 114 21 files changed, 4663 insertions(+) create mode 100644 lib/librte_pmd_enic/vnic/cq_desc.h create mode 100644 lib/librte_pmd_enic/vnic/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_enet.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_nic.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_resource.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_stats.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.h create mode 100644 lib/librte_pmd_enic/vnic/wq_enet_desc.h diff --git a/lib/librte_pmd_enic/vnic/cq_desc.h b/lib/librte_pmd_enic/vnic/cq_desc.h new file mode 100644 index 000..7dfb2b6 --- /dev/null +++ b/lib/librte_pmd_enic/vnic/cq_desc.h @@ -0,0 +1,126 @@ +/* + * Copyright 2008-2010 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id: cq_desc.h 129574 2013-04-26 22:11:14Z rfaucett $" + +#ifndef _CQ_DESC_H_ +#define _CQ_DESC_H_ + +/* + * Completion queue descriptor types + */ +enum cq_desc_types { + CQ_DESC_TYPE_WQ_ENET = 0, + CQ_DESC_TYPE_DESC_COPY = 1, + CQ_DESC_TYPE_WQ_EXCH = 2, + CQ_DESC_TYPE_RQ_ENET = 3, + CQ_DESC_TYPE_RQ_FCP = 4, + CQ_DESC_TYPE_IOMMU_MISS = 5, + CQ_DESC_TYPE_SGL = 6, + CQ_DESC_TYPE_CLASSIFIER = 7, + CQ_DESC_TYPE_TEST = 127, +}; + +/* Completion queue descriptor: 16B + * + * All completion queues have this basic layout. The + * type_specfic area is unique for each completion + * queue type. + */ +struct cq_desc { + __le16 completed_index; + __le16 q_number; + u8 type_specfic[11]; +
[dpdk-dev] [PATCH v3 4/6] ENIC PMD specific code
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic.h| 158 + lib/librte_pmd_enic/enic_clsf.c | 244 +++ lib/librte_pmd_enic/enic_compat.h | 142 lib/librte_pmd_enic/enic_main.c | 1328 + lib/librte_pmd_enic/enic_res.c| 221 ++ lib/librte_pmd_enic/enic_res.h| 168 + 6 files changed, 2261 insertions(+) create mode 100644 lib/librte_pmd_enic/enic.h create mode 100644 lib/librte_pmd_enic/enic_clsf.c create mode 100644 lib/librte_pmd_enic/enic_compat.h create mode 100644 lib/librte_pmd_enic/enic_main.c create mode 100644 lib/librte_pmd_enic/enic_res.c create mode 100644 lib/librte_pmd_enic/enic_res.h diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h new file mode 100644 index 000..b72c048 --- /dev/null +++ b/lib/librte_pmd_enic/enic.h @@ -0,0 +1,158 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#ifndef _ENIC_H_ +#define _ENIC_H_ + +#include "vnic_enet.h" +#include "vnic_dev.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_cq.h" +#include "vnic_intr.h" +#include "vnic_stats.h" +#include "vnic_nic.h" +#include "vnic_rss.h" +#include "enic_res.h" + +#define DRV_NAME "enic_pmd" +#define DRV_DESCRIPTION"Cisco VIC Ethernet NIC Poll-mode Driver" +#define DRV_VERSION"1.0.0.4" +#define DRV_COPYRIGHT "Copyright 2008-2014 Cisco Systems, Inc" + +#define ENIC_WQ_MAX8 +#define ENIC_RQ_MAX8 +#define ENIC_CQ_MAX(ENIC_WQ_MAX + ENIC_RQ_MAX) +#define ENIC_INTR_MAX (ENIC_CQ_MAX + 2) + +#define VLAN_ETH_HLEN 18 + +#define ENICPMD_SETTING(enic, f) ((enic->config.flags & VENETF_##f) ? 1 : 0) + +#define ENICPMD_BDF_LENGTH 13 /* :00:00.0'\0' */ +#define PKT_TX_TCP_UDP_CKSUM0x6000 +#define ENIC_CALC_IP_CKSUM 1 +#define ENIC_CALC_TCP_UDP_CKSUM 2 +#define ENIC_MAX_MTU9000 +#define PAGE_SIZE 4096 +#define PAGE_ROUND_UP(x) \ + unsigned long)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1))) + +#define ENICPMD_VFIO_PATH "/dev/vfio/vfio" +/*#define ENIC_DESC_COUNT_MAKE_ODD (x) do{if ((~(x)) & 1) { (x)--; } }while(0)*/ + +#define PCI_DEVICE_ID_CISCO_VIC_ENET 0x0043 /* ethernet vnic */ +#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF 0x0071 /* enet SRIOV VF */ + + +#define ENICPMD_FDIR_MAX 64 + +struct enic_fdir_node { + struct rte_fdir_filter filter; + u16 fltr_id; + u16 rq_index; +}; + +struct enic_fdir { + struct rte_eth_fdir stats; + struct rte_hash *hash; + struct enic_fdir_node *nodes[ENICPMD_FDIR_MAX]; +}; + +/* Per-instance private data structure */ +struct enic { + struct enic *next; + struct rte_pci_device *pdev; + struct vnic_enet_config config; + struct vnic_dev_bar bar0; + struct vnic_dev *vdev; + + struct rte_eth_dev *rte_dev; + struct enic_fdir fdir; + char bdf_name[ENICPMD_BDF_LENGTH]; + int dev_fd; + int iommu_group_fd; + int vfio_fd; + int iommu_groupid; + int eventfd; + u_int8_t mac_addr[ETH_ALEN]; + pthread_t err_intr_thread; + int promisc; + int allmulti; + int ig_vlan_strip_en; +
[dpdk-dev] [PATCH v3 5/6] DPDK-ENIC PMD interface
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic_etherdev.c | 613 1 file changed, 613 insertions(+) create mode 100644 lib/librte_pmd_enic/enic_etherdev.c diff --git a/lib/librte_pmd_enic/enic_etherdev.c b/lib/librte_pmd_enic/enic_etherdev.c new file mode 100644 index 000..441c85a --- /dev/null +++ b/lib/librte_pmd_enic/enic_etherdev.c @@ -0,0 +1,613 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#include +#include + +#include +#include +#include +#include + +#include "vnic_intr.h" +#include "vnic_cq.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_enet.h" +#include "enic.h" + +#define ENICPMD_FUNC_TRACE() \ +RTE_LOG(DEBUG, PMD, "ENICPMD trace: %s\n", __func__) + +/* + * The set of PCI devices this driver supports + */ +static struct rte_pci_id pci_id_enic_map[] = { +#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, +#ifndef PCI_VENDOR_ID_CISCO +#define PCI_VENDOR_ID_CISCO0x1137 +#endif +#include "rte_pci_dev_ids.h" +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET) +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF) +{.vendor_id = 0, /* Sentinal */}, +}; + +static int enicpmd_fdir_remove_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, + uint16_t soft_id) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_del_fltr(enic, fdir_filter); +} + +static int enicpmd_fdir_add_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, uint16_t soft_id, + uint8_t queue, uint8_t drop) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_add_fltr(enic, fdir_filter, (uint16_t)queue, drop); +} + +static void enicpmd_fdir_info_get(struct rte_eth_dev *eth_dev, + struct rte_eth_fdir *fdir) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + *fdir = enic->fdir.stats; +} + +static void enicpmd_dev_tx_queue_release(void *txq) +{ + ENICPMD_FUNC_TRACE(); + enic_free_wq(txq); +} + +static int enicpmd_dev_setup_intr(struct enic *enic) +{ + int ret; + int index; + + ENICPMD_FUNC_TRACE(); + + /* Are we done with the init of all the queues? */ + for (index = 0; index < enic->cq_count; index++) { + if (!enic->cq[index].ctrl) + break; + } + + if (enic->cq_count != index) + return 0; + + ret = enic_alloc_intr_resources(enic); + if (ret) { + dev_err(enic, "alloc intr failed\n"); + return ret; + } + enic_init_vnic_resources(enic); + + ret = enic_setup_finish(enic); + if (ret) + dev_err(enic, "setup could not be finished\n"); + + return ret; +} + +static int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, + uint16_t queue_idx, + uint16_t nb_desc, + unsigned int socket_id, + const struct rte_eth_txconf *tx_conf) +{ + int ret; + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + eth_dev->data->tx_queues[queue_idx] = (void *)&enic->wq[queue_
[dpdk-dev] [PATCH v3 6/6] DPDK changes for accommodating ENIC PMD
Signed-off-by: Sujith Sankar --- config/common_linuxapp | 5 + lib/Makefile | 1 + lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 7 +++ lib/librte_eal/linuxapp/eal/include/eal_pci_init.h | 1 + mk/rte.app.mk | 4 5 files changed, 18 insertions(+) diff --git a/config/common_linuxapp b/config/common_linuxapp index 57b61c9..3c091e7 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -210,6 +210,11 @@ CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM=4 CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1 # +# Compile burst-oriented Cisco ENIC PMD driver +# +CONFIG_RTE_LIBRTE_ENIC_PMD=y + +# # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y diff --git a/lib/Makefile b/lib/Makefile index e3237ff..1911790 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -43,6 +43,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ether DIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += librte_pmd_e1000 DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_ixgbe +DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_enic DIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += librte_pmd_i40e DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += librte_pmd_bond DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += librte_pmd_ring diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c index c776ddc..6bf8f2e 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c @@ -736,6 +736,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev) maps[i].offset = reg.offset; maps[i].size = reg.size; dev->mem_resource[i].addr = bar_addr; + dev->mem_resource[i].len = reg.size; } /* if secondary process, do not set up interrupts */ @@ -791,4 +792,10 @@ pci_vfio_is_enabled(void) { return vfio_cfg.vfio_enabled; } + +int +pci_vfio_container_fd(void) +{ + return vfio_cfg.vfio_container_fd; +} #endif diff --git a/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h b/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h index d758bee..c9e9e40 100644 --- a/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h +++ b/lib/librte_eal/linuxapp/eal/include/eal_pci_init.h @@ -71,6 +71,7 @@ int pci_uio_map_resource(struct rte_pci_device *dev); int pci_vfio_enable(void); int pci_vfio_is_enabled(void); +int pci_vfio_container_fd(void); int pci_vfio_mp_sync_setup(void); /* map VFIO resource prototype */ diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 285b65c..95c652f 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -186,6 +186,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) LDLIBS += -lrte_pmd_vmxnet3_uio endif +ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) +LDLIBS += -lrte_pmd_enic +endif + ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) LDLIBS += -lrte_pmd_virtio_uio endif -- 1.9.1
[dpdk-dev] [PATCH v4 0/6] Cisco Systems Inc. VIC Ethernet PMD - ENIC PMD
ENIC PMD is the poll-mode driver for the Cisco Systems Inc. VIC to be used with DPDK suite. Sujith Sankar (6): ENIC PMD License ENIC PMD Makefile VNIC common code partially shared with ENIC kernel mode driver ENIC PMD specific code DPDK-ENIC PMD interface DPDK changes for accommodating ENIC PMD config/common_linuxapp |5 + lib/Makefile |1 + lib/librte_eal/linuxapp/eal/eal_pci_vfio.c |1 + lib/librte_pmd_enic/LICENSE| 27 + lib/librte_pmd_enic/Makefile | 67 ++ lib/librte_pmd_enic/enic.h | 157 lib/librte_pmd_enic/enic_clsf.c| 244 ++ lib/librte_pmd_enic/enic_compat.h | 142 lib/librte_pmd_enic/enic_etherdev.c| 613 ++ lib/librte_pmd_enic/enic_main.c| 1266 lib/librte_pmd_enic/enic_res.c | 221 + lib/librte_pmd_enic/enic_res.h | 168 lib/librte_pmd_enic/vnic/cq_desc.h | 126 +++ lib/librte_pmd_enic/vnic/cq_enet_desc.h| 261 ++ lib/librte_pmd_enic/vnic/rq_enet_desc.h| 76 ++ lib/librte_pmd_enic/vnic/vnic_cq.c | 117 +++ lib/librte_pmd_enic/vnic/vnic_cq.h | 152 lib/librte_pmd_enic/vnic/vnic_dev.c| 1063 +++ lib/librte_pmd_enic/vnic/vnic_dev.h| 202 + lib/librte_pmd_enic/vnic/vnic_devcmd.h | 774 + lib/librte_pmd_enic/vnic/vnic_enet.h | 78 ++ lib/librte_pmd_enic/vnic/vnic_intr.c | 83 ++ lib/librte_pmd_enic/vnic/vnic_intr.h | 126 +++ lib/librte_pmd_enic/vnic/vnic_nic.h| 88 ++ lib/librte_pmd_enic/vnic/vnic_resource.h | 97 +++ lib/librte_pmd_enic/vnic/vnic_rq.c | 246 ++ lib/librte_pmd_enic/vnic/vnic_rq.h | 282 +++ lib/librte_pmd_enic/vnic/vnic_rss.c| 85 ++ lib/librte_pmd_enic/vnic/vnic_rss.h| 61 ++ lib/librte_pmd_enic/vnic/vnic_stats.h | 86 ++ lib/librte_pmd_enic/vnic/vnic_wq.c | 245 ++ lib/librte_pmd_enic/vnic/vnic_wq.h | 283 +++ lib/librte_pmd_enic/vnic/wq_enet_desc.h| 114 +++ mk/rte.app.mk |4 + 34 files changed, 7561 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE create mode 100644 lib/librte_pmd_enic/Makefile create mode 100644 lib/librte_pmd_enic/enic.h create mode 100644 lib/librte_pmd_enic/enic_clsf.c create mode 100644 lib/librte_pmd_enic/enic_compat.h create mode 100644 lib/librte_pmd_enic/enic_etherdev.c create mode 100644 lib/librte_pmd_enic/enic_main.c create mode 100644 lib/librte_pmd_enic/enic_res.c create mode 100644 lib/librte_pmd_enic/enic_res.h create mode 100644 lib/librte_pmd_enic/vnic/cq_desc.h create mode 100644 lib/librte_pmd_enic/vnic/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_enet.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_nic.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_resource.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_stats.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.h create mode 100644 lib/librte_pmd_enic/vnic/wq_enet_desc.h -- 1.9.1
[dpdk-dev] [PATCH v4 1/6] ENIC PMD License
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/LICENSE | 27 +++ 1 file changed, 27 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE diff --git a/lib/librte_pmd_enic/LICENSE b/lib/librte_pmd_enic/LICENSE new file mode 100644 index 000..0ad2216 --- /dev/null +++ b/lib/librte_pmd_enic/LICENSE @@ -0,0 +1,27 @@ + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. -- 1.9.1
[dpdk-dev] [PATCH v4 2/6] ENIC PMD Makefile
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/Makefile | 67 1 file changed, 67 insertions(+) create mode 100644 lib/librte_pmd_enic/Makefile diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile new file mode 100644 index 000..25d8f31 --- /dev/null +++ b/lib/librte_pmd_enic/Makefile @@ -0,0 +1,67 @@ +# +# Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. +# Copyright 2007 Nuova Systems, Inc. All rights reserved. +# +# Copyright (c) 2014, Cisco Systems, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. 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. +# +# 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_enic.a + +CFLAGS += -I$(RTE_SDK)/lib/librte_hash/ -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/ +CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/ +CFLAGS += -O3 -Wno-deprecated + +VPATH += $(RTE_SDK)/lib/librte_pmd_enic/src + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_main.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_clsf.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_cq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_wq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_dev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_intr.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_rq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_etherdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_res.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_rss.c + + +# this lib depends upon: +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_eal lib/librte_ether +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_mempool lib/librte_mbuf +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_net lib/librte_malloc + +include $(RTE_SDK)/mk/rte.lib.mk + -- 1.9.1
[dpdk-dev] [PATCH v4 3/6] VNIC common code partially shared with ENIC kernel mode driver
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/vnic/cq_desc.h | 126 lib/librte_pmd_enic/vnic/cq_enet_desc.h | 261 lib/librte_pmd_enic/vnic/rq_enet_desc.h | 76 +++ lib/librte_pmd_enic/vnic/vnic_cq.c | 117 lib/librte_pmd_enic/vnic/vnic_cq.h | 152 + lib/librte_pmd_enic/vnic/vnic_dev.c | 1063 ++ lib/librte_pmd_enic/vnic/vnic_dev.h | 202 ++ lib/librte_pmd_enic/vnic/vnic_devcmd.h | 774 ++ lib/librte_pmd_enic/vnic/vnic_enet.h | 78 +++ lib/librte_pmd_enic/vnic/vnic_intr.c | 83 +++ lib/librte_pmd_enic/vnic/vnic_intr.h | 126 lib/librte_pmd_enic/vnic/vnic_nic.h | 88 +++ lib/librte_pmd_enic/vnic/vnic_resource.h | 97 +++ lib/librte_pmd_enic/vnic/vnic_rq.c | 246 +++ lib/librte_pmd_enic/vnic/vnic_rq.h | 282 lib/librte_pmd_enic/vnic/vnic_rss.c | 85 +++ lib/librte_pmd_enic/vnic/vnic_rss.h | 61 ++ lib/librte_pmd_enic/vnic/vnic_stats.h| 86 +++ lib/librte_pmd_enic/vnic/vnic_wq.c | 245 +++ lib/librte_pmd_enic/vnic/vnic_wq.h | 283 lib/librte_pmd_enic/vnic/wq_enet_desc.h | 114 21 files changed, 4645 insertions(+) create mode 100644 lib/librte_pmd_enic/vnic/cq_desc.h create mode 100644 lib/librte_pmd_enic/vnic/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_enet.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_nic.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_resource.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_stats.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.h create mode 100644 lib/librte_pmd_enic/vnic/wq_enet_desc.h diff --git a/lib/librte_pmd_enic/vnic/cq_desc.h b/lib/librte_pmd_enic/vnic/cq_desc.h new file mode 100644 index 000..7dfb2b6 --- /dev/null +++ b/lib/librte_pmd_enic/vnic/cq_desc.h @@ -0,0 +1,126 @@ +/* + * Copyright 2008-2010 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id: cq_desc.h 129574 2013-04-26 22:11:14Z rfaucett $" + +#ifndef _CQ_DESC_H_ +#define _CQ_DESC_H_ + +/* + * Completion queue descriptor types + */ +enum cq_desc_types { + CQ_DESC_TYPE_WQ_ENET = 0, + CQ_DESC_TYPE_DESC_COPY = 1, + CQ_DESC_TYPE_WQ_EXCH = 2, + CQ_DESC_TYPE_RQ_ENET = 3, + CQ_DESC_TYPE_RQ_FCP = 4, + CQ_DESC_TYPE_IOMMU_MISS = 5, + CQ_DESC_TYPE_SGL = 6, + CQ_DESC_TYPE_CLASSIFIER = 7, + CQ_DESC_TYPE_TEST = 127, +}; + +/* Completion queue descriptor: 16B + * + * All completion queues have this basic layout. The + * type_specfic area is unique for each completion + * queue type. + */ +struct cq_desc { + __le16 completed_index; + __le16 q_number; + u8 type_specfic[11]; +
[dpdk-dev] [PATCH v4 4/6] ENIC PMD specific code
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic.h| 157 + lib/librte_pmd_enic/enic_clsf.c | 244 +++ lib/librte_pmd_enic/enic_compat.h | 142 + lib/librte_pmd_enic/enic_main.c | 1266 + lib/librte_pmd_enic/enic_res.c| 221 +++ lib/librte_pmd_enic/enic_res.h| 168 + 6 files changed, 2198 insertions(+) create mode 100644 lib/librte_pmd_enic/enic.h create mode 100644 lib/librte_pmd_enic/enic_clsf.c create mode 100644 lib/librte_pmd_enic/enic_compat.h create mode 100644 lib/librte_pmd_enic/enic_main.c create mode 100644 lib/librte_pmd_enic/enic_res.c create mode 100644 lib/librte_pmd_enic/enic_res.h diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h new file mode 100644 index 000..5041dd1 --- /dev/null +++ b/lib/librte_pmd_enic/enic.h @@ -0,0 +1,157 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#ifndef _ENIC_H_ +#define _ENIC_H_ + +#include "vnic_enet.h" +#include "vnic_dev.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_cq.h" +#include "vnic_intr.h" +#include "vnic_stats.h" +#include "vnic_nic.h" +#include "vnic_rss.h" +#include "enic_res.h" + +#define DRV_NAME "enic_pmd" +#define DRV_DESCRIPTION"Cisco VIC Ethernet NIC Poll-mode Driver" +#define DRV_VERSION"1.0.0.4" +#define DRV_COPYRIGHT "Copyright 2008-2014 Cisco Systems, Inc" + +#define ENIC_WQ_MAX8 +#define ENIC_RQ_MAX8 +#define ENIC_CQ_MAX(ENIC_WQ_MAX + ENIC_RQ_MAX) +#define ENIC_INTR_MAX (ENIC_CQ_MAX + 2) + +#define VLAN_ETH_HLEN 18 + +#define ENICPMD_SETTING(enic, f) ((enic->config.flags & VENETF_##f) ? 1 : 0) + +#define ENICPMD_BDF_LENGTH 13 /* :00:00.0'\0' */ +#define PKT_TX_TCP_UDP_CKSUM0x6000 +#define ENIC_CALC_IP_CKSUM 1 +#define ENIC_CALC_TCP_UDP_CKSUM 2 +#define ENIC_MAX_MTU9000 +#define PAGE_SIZE 4096 +#define PAGE_ROUND_UP(x) \ + unsigned long)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1))) + +#define ENICPMD_VFIO_PATH "/dev/vfio/vfio" +/*#define ENIC_DESC_COUNT_MAKE_ODD (x) do{if ((~(x)) & 1) { (x)--; } }while(0)*/ + +#define PCI_DEVICE_ID_CISCO_VIC_ENET 0x0043 /* ethernet vnic */ +#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF 0x0071 /* enet SRIOV VF */ + + +#define ENICPMD_FDIR_MAX 64 + +struct enic_fdir_node { + struct rte_fdir_filter filter; + u16 fltr_id; + u16 rq_index; +}; + +struct enic_fdir { + struct rte_eth_fdir stats; + struct rte_hash *hash; + struct enic_fdir_node *nodes[ENICPMD_FDIR_MAX]; +}; + +/* Per-instance private data structure */ +struct enic { + struct enic *next; + struct rte_pci_device *pdev; + struct vnic_enet_config config; + struct vnic_dev_bar bar0; + struct vnic_dev *vdev; + + struct rte_eth_dev *rte_dev; + struct enic_fdir fdir; + char bdf_name[ENICPMD_BDF_LENGTH]; + int dev_fd; + int iommu_group_fd; + int iommu_groupid; + int eventfd; + u_int8_t mac_addr[ETH_ALEN]; + pthread_t err_intr_thread; + int promisc; + int allmulti; + int ig_vlan_strip_en; + int link
[dpdk-dev] [PATCH v4 5/6] DPDK-ENIC PMD interface
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic_etherdev.c | 613 1 file changed, 613 insertions(+) create mode 100644 lib/librte_pmd_enic/enic_etherdev.c diff --git a/lib/librte_pmd_enic/enic_etherdev.c b/lib/librte_pmd_enic/enic_etherdev.c new file mode 100644 index 000..441c85a --- /dev/null +++ b/lib/librte_pmd_enic/enic_etherdev.c @@ -0,0 +1,613 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#include +#include + +#include +#include +#include +#include + +#include "vnic_intr.h" +#include "vnic_cq.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_enet.h" +#include "enic.h" + +#define ENICPMD_FUNC_TRACE() \ +RTE_LOG(DEBUG, PMD, "ENICPMD trace: %s\n", __func__) + +/* + * The set of PCI devices this driver supports + */ +static struct rte_pci_id pci_id_enic_map[] = { +#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, +#ifndef PCI_VENDOR_ID_CISCO +#define PCI_VENDOR_ID_CISCO0x1137 +#endif +#include "rte_pci_dev_ids.h" +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET) +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF) +{.vendor_id = 0, /* Sentinal */}, +}; + +static int enicpmd_fdir_remove_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, + uint16_t soft_id) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_del_fltr(enic, fdir_filter); +} + +static int enicpmd_fdir_add_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, uint16_t soft_id, + uint8_t queue, uint8_t drop) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_add_fltr(enic, fdir_filter, (uint16_t)queue, drop); +} + +static void enicpmd_fdir_info_get(struct rte_eth_dev *eth_dev, + struct rte_eth_fdir *fdir) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + *fdir = enic->fdir.stats; +} + +static void enicpmd_dev_tx_queue_release(void *txq) +{ + ENICPMD_FUNC_TRACE(); + enic_free_wq(txq); +} + +static int enicpmd_dev_setup_intr(struct enic *enic) +{ + int ret; + int index; + + ENICPMD_FUNC_TRACE(); + + /* Are we done with the init of all the queues? */ + for (index = 0; index < enic->cq_count; index++) { + if (!enic->cq[index].ctrl) + break; + } + + if (enic->cq_count != index) + return 0; + + ret = enic_alloc_intr_resources(enic); + if (ret) { + dev_err(enic, "alloc intr failed\n"); + return ret; + } + enic_init_vnic_resources(enic); + + ret = enic_setup_finish(enic); + if (ret) + dev_err(enic, "setup could not be finished\n"); + + return ret; +} + +static int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, + uint16_t queue_idx, + uint16_t nb_desc, + unsigned int socket_id, + const struct rte_eth_txconf *tx_conf) +{ + int ret; + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + eth_dev->data->tx_queues[queue_idx] = (void *)&enic->wq[queue_
[dpdk-dev] [PATCH v4 6/6] DPDK changes for accommodating ENIC PMD
Signed-off-by: Sujith Sankar --- config/common_linuxapp | 5 + lib/Makefile | 1 + lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 1 + mk/rte.app.mk | 4 4 files changed, 11 insertions(+) diff --git a/config/common_linuxapp b/config/common_linuxapp index 86a0d15..542fff2 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -210,6 +210,11 @@ CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM=4 CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1 # +# Compile burst-oriented Cisco ENIC PMD driver +# +CONFIG_RTE_LIBRTE_ENIC_PMD=y + +# # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y diff --git a/lib/Makefile b/lib/Makefile index 204ef11..df17d78 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -43,6 +43,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ether DIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += librte_pmd_e1000 DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_ixgbe +DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_enic DIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += librte_pmd_i40e DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += librte_pmd_bond DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += librte_pmd_ring diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c index c776ddc..87e7862 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c @@ -736,6 +736,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev) maps[i].offset = reg.offset; maps[i].size = reg.size; dev->mem_resource[i].addr = bar_addr; + dev->mem_resource[i].len = reg.size; } /* if secondary process, do not set up interrupts */ diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 59468b0..bef823b 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -186,6 +186,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) LDLIBS += -lrte_pmd_vmxnet3_uio endif +ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) +LDLIBS += -lrte_pmd_enic +endif + ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) LDLIBS += -lrte_pmd_virtio_uio endif -- 1.9.1
[dpdk-dev] [PATCH v5 0/6] enicpmd: Cisco Systems Inc. VIC Ethernet PMD
ENIC PMD is the poll-mode driver for the Cisco Systems Inc. VIC to be used with DPDK suite. Sujith Sankar (6): enicpmd: License text enicpmd: Makefile enicpmd: VNIC common code partially shared with ENIC kernel mode driver enicpmd: pmd specific code enicpmd: DPDK-ENIC PMD interface enicpmd: DPDK changes for accommodating ENIC PMD config/common_linuxapp |5 + lib/Makefile |1 + lib/librte_pmd_enic/LICENSE | 27 + lib/librte_pmd_enic/Makefile | 67 ++ lib/librte_pmd_enic/enic.h | 157 lib/librte_pmd_enic/enic_clsf.c | 244 ++ lib/librte_pmd_enic/enic_compat.h| 142 lib/librte_pmd_enic/enic_etherdev.c | 613 +++ lib/librte_pmd_enic/enic_main.c | 1266 ++ lib/librte_pmd_enic/enic_res.c | 221 ++ lib/librte_pmd_enic/enic_res.h | 168 lib/librte_pmd_enic/vnic/cq_desc.h | 126 +++ lib/librte_pmd_enic/vnic/cq_enet_desc.h | 261 ++ lib/librte_pmd_enic/vnic/rq_enet_desc.h | 76 ++ lib/librte_pmd_enic/vnic/vnic_cq.c | 117 +++ lib/librte_pmd_enic/vnic/vnic_cq.h | 152 lib/librte_pmd_enic/vnic/vnic_dev.c | 1063 + lib/librte_pmd_enic/vnic/vnic_dev.h | 202 + lib/librte_pmd_enic/vnic/vnic_devcmd.h | 774 ++ lib/librte_pmd_enic/vnic/vnic_enet.h | 78 ++ lib/librte_pmd_enic/vnic/vnic_intr.c | 83 ++ lib/librte_pmd_enic/vnic/vnic_intr.h | 126 +++ lib/librte_pmd_enic/vnic/vnic_nic.h | 88 +++ lib/librte_pmd_enic/vnic/vnic_resource.h | 97 +++ lib/librte_pmd_enic/vnic/vnic_rq.c | 246 ++ lib/librte_pmd_enic/vnic/vnic_rq.h | 282 +++ lib/librte_pmd_enic/vnic/vnic_rss.c | 85 ++ lib/librte_pmd_enic/vnic/vnic_rss.h | 61 ++ lib/librte_pmd_enic/vnic/vnic_stats.h| 86 ++ lib/librte_pmd_enic/vnic/vnic_wq.c | 245 ++ lib/librte_pmd_enic/vnic/vnic_wq.h | 283 +++ lib/librte_pmd_enic/vnic/wq_enet_desc.h | 114 +++ mk/rte.app.mk|4 + 33 files changed, 7560 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE create mode 100644 lib/librte_pmd_enic/Makefile create mode 100644 lib/librte_pmd_enic/enic.h create mode 100644 lib/librte_pmd_enic/enic_clsf.c create mode 100644 lib/librte_pmd_enic/enic_compat.h create mode 100644 lib/librte_pmd_enic/enic_etherdev.c create mode 100644 lib/librte_pmd_enic/enic_main.c create mode 100644 lib/librte_pmd_enic/enic_res.c create mode 100644 lib/librte_pmd_enic/enic_res.h create mode 100644 lib/librte_pmd_enic/vnic/cq_desc.h create mode 100644 lib/librte_pmd_enic/vnic/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_enet.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_nic.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_resource.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_stats.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.h create mode 100644 lib/librte_pmd_enic/vnic/wq_enet_desc.h -- 1.9.1
[dpdk-dev] [PATCH v5 1/6] enicpmd: License text
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/LICENSE | 27 +++ 1 file changed, 27 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE diff --git a/lib/librte_pmd_enic/LICENSE b/lib/librte_pmd_enic/LICENSE new file mode 100644 index 000..0ad2216 --- /dev/null +++ b/lib/librte_pmd_enic/LICENSE @@ -0,0 +1,27 @@ + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. -- 1.9.1
[dpdk-dev] [PATCH v5 2/6] enicpmd: Makefile
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/Makefile | 67 1 file changed, 67 insertions(+) create mode 100644 lib/librte_pmd_enic/Makefile diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile new file mode 100644 index 000..25d8f31 --- /dev/null +++ b/lib/librte_pmd_enic/Makefile @@ -0,0 +1,67 @@ +# +# Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. +# Copyright 2007 Nuova Systems, Inc. All rights reserved. +# +# Copyright (c) 2014, Cisco Systems, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. 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. +# +# 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_enic.a + +CFLAGS += -I$(RTE_SDK)/lib/librte_hash/ -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/ +CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/ +CFLAGS += -O3 -Wno-deprecated + +VPATH += $(RTE_SDK)/lib/librte_pmd_enic/src + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_main.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_clsf.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_cq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_wq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_dev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_intr.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_rq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_etherdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_res.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_rss.c + + +# this lib depends upon: +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_eal lib/librte_ether +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_mempool lib/librte_mbuf +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_net lib/librte_malloc + +include $(RTE_SDK)/mk/rte.lib.mk + -- 1.9.1
[dpdk-dev] [PATCH v5 3/6] enicpmd: VNIC common code partially shared with ENIC kernel mode driver
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/vnic/cq_desc.h | 126 lib/librte_pmd_enic/vnic/cq_enet_desc.h | 261 lib/librte_pmd_enic/vnic/rq_enet_desc.h | 76 +++ lib/librte_pmd_enic/vnic/vnic_cq.c | 117 lib/librte_pmd_enic/vnic/vnic_cq.h | 152 + lib/librte_pmd_enic/vnic/vnic_dev.c | 1063 ++ lib/librte_pmd_enic/vnic/vnic_dev.h | 202 ++ lib/librte_pmd_enic/vnic/vnic_devcmd.h | 774 ++ lib/librte_pmd_enic/vnic/vnic_enet.h | 78 +++ lib/librte_pmd_enic/vnic/vnic_intr.c | 83 +++ lib/librte_pmd_enic/vnic/vnic_intr.h | 126 lib/librte_pmd_enic/vnic/vnic_nic.h | 88 +++ lib/librte_pmd_enic/vnic/vnic_resource.h | 97 +++ lib/librte_pmd_enic/vnic/vnic_rq.c | 246 +++ lib/librte_pmd_enic/vnic/vnic_rq.h | 282 lib/librte_pmd_enic/vnic/vnic_rss.c | 85 +++ lib/librte_pmd_enic/vnic/vnic_rss.h | 61 ++ lib/librte_pmd_enic/vnic/vnic_stats.h| 86 +++ lib/librte_pmd_enic/vnic/vnic_wq.c | 245 +++ lib/librte_pmd_enic/vnic/vnic_wq.h | 283 lib/librte_pmd_enic/vnic/wq_enet_desc.h | 114 21 files changed, 4645 insertions(+) create mode 100644 lib/librte_pmd_enic/vnic/cq_desc.h create mode 100644 lib/librte_pmd_enic/vnic/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_enet.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_nic.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_resource.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_stats.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.h create mode 100644 lib/librte_pmd_enic/vnic/wq_enet_desc.h diff --git a/lib/librte_pmd_enic/vnic/cq_desc.h b/lib/librte_pmd_enic/vnic/cq_desc.h new file mode 100644 index 000..7dfb2b6 --- /dev/null +++ b/lib/librte_pmd_enic/vnic/cq_desc.h @@ -0,0 +1,126 @@ +/* + * Copyright 2008-2010 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id: cq_desc.h 129574 2013-04-26 22:11:14Z rfaucett $" + +#ifndef _CQ_DESC_H_ +#define _CQ_DESC_H_ + +/* + * Completion queue descriptor types + */ +enum cq_desc_types { + CQ_DESC_TYPE_WQ_ENET = 0, + CQ_DESC_TYPE_DESC_COPY = 1, + CQ_DESC_TYPE_WQ_EXCH = 2, + CQ_DESC_TYPE_RQ_ENET = 3, + CQ_DESC_TYPE_RQ_FCP = 4, + CQ_DESC_TYPE_IOMMU_MISS = 5, + CQ_DESC_TYPE_SGL = 6, + CQ_DESC_TYPE_CLASSIFIER = 7, + CQ_DESC_TYPE_TEST = 127, +}; + +/* Completion queue descriptor: 16B + * + * All completion queues have this basic layout. The + * type_specfic area is unique for each completion + * queue type. + */ +struct cq_desc { + __le16 completed_index; + __le16 q_number; + u8 type_specfic[11]; +
[dpdk-dev] [PATCH v5 5/6] enicpmd: DPDK-ENIC PMD interface
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic_etherdev.c | 613 1 file changed, 613 insertions(+) create mode 100644 lib/librte_pmd_enic/enic_etherdev.c diff --git a/lib/librte_pmd_enic/enic_etherdev.c b/lib/librte_pmd_enic/enic_etherdev.c new file mode 100644 index 000..441c85a --- /dev/null +++ b/lib/librte_pmd_enic/enic_etherdev.c @@ -0,0 +1,613 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#include +#include + +#include +#include +#include +#include + +#include "vnic_intr.h" +#include "vnic_cq.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_enet.h" +#include "enic.h" + +#define ENICPMD_FUNC_TRACE() \ +RTE_LOG(DEBUG, PMD, "ENICPMD trace: %s\n", __func__) + +/* + * The set of PCI devices this driver supports + */ +static struct rte_pci_id pci_id_enic_map[] = { +#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, +#ifndef PCI_VENDOR_ID_CISCO +#define PCI_VENDOR_ID_CISCO0x1137 +#endif +#include "rte_pci_dev_ids.h" +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET) +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF) +{.vendor_id = 0, /* Sentinal */}, +}; + +static int enicpmd_fdir_remove_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, + uint16_t soft_id) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_del_fltr(enic, fdir_filter); +} + +static int enicpmd_fdir_add_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, uint16_t soft_id, + uint8_t queue, uint8_t drop) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_add_fltr(enic, fdir_filter, (uint16_t)queue, drop); +} + +static void enicpmd_fdir_info_get(struct rte_eth_dev *eth_dev, + struct rte_eth_fdir *fdir) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + *fdir = enic->fdir.stats; +} + +static void enicpmd_dev_tx_queue_release(void *txq) +{ + ENICPMD_FUNC_TRACE(); + enic_free_wq(txq); +} + +static int enicpmd_dev_setup_intr(struct enic *enic) +{ + int ret; + int index; + + ENICPMD_FUNC_TRACE(); + + /* Are we done with the init of all the queues? */ + for (index = 0; index < enic->cq_count; index++) { + if (!enic->cq[index].ctrl) + break; + } + + if (enic->cq_count != index) + return 0; + + ret = enic_alloc_intr_resources(enic); + if (ret) { + dev_err(enic, "alloc intr failed\n"); + return ret; + } + enic_init_vnic_resources(enic); + + ret = enic_setup_finish(enic); + if (ret) + dev_err(enic, "setup could not be finished\n"); + + return ret; +} + +static int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, + uint16_t queue_idx, + uint16_t nb_desc, + unsigned int socket_id, + const struct rte_eth_txconf *tx_conf) +{ + int ret; + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + eth_dev->data->tx_queues[queue_idx] = (void *)&enic->wq[queue_
[dpdk-dev] [PATCH v5 4/6] enicpmd: pmd specific code
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic.h| 157 + lib/librte_pmd_enic/enic_clsf.c | 244 +++ lib/librte_pmd_enic/enic_compat.h | 142 + lib/librte_pmd_enic/enic_main.c | 1266 + lib/librte_pmd_enic/enic_res.c| 221 +++ lib/librte_pmd_enic/enic_res.h| 168 + 6 files changed, 2198 insertions(+) create mode 100644 lib/librte_pmd_enic/enic.h create mode 100644 lib/librte_pmd_enic/enic_clsf.c create mode 100644 lib/librte_pmd_enic/enic_compat.h create mode 100644 lib/librte_pmd_enic/enic_main.c create mode 100644 lib/librte_pmd_enic/enic_res.c create mode 100644 lib/librte_pmd_enic/enic_res.h diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h new file mode 100644 index 000..5041dd1 --- /dev/null +++ b/lib/librte_pmd_enic/enic.h @@ -0,0 +1,157 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#ifndef _ENIC_H_ +#define _ENIC_H_ + +#include "vnic_enet.h" +#include "vnic_dev.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_cq.h" +#include "vnic_intr.h" +#include "vnic_stats.h" +#include "vnic_nic.h" +#include "vnic_rss.h" +#include "enic_res.h" + +#define DRV_NAME "enic_pmd" +#define DRV_DESCRIPTION"Cisco VIC Ethernet NIC Poll-mode Driver" +#define DRV_VERSION"1.0.0.4" +#define DRV_COPYRIGHT "Copyright 2008-2014 Cisco Systems, Inc" + +#define ENIC_WQ_MAX8 +#define ENIC_RQ_MAX8 +#define ENIC_CQ_MAX(ENIC_WQ_MAX + ENIC_RQ_MAX) +#define ENIC_INTR_MAX (ENIC_CQ_MAX + 2) + +#define VLAN_ETH_HLEN 18 + +#define ENICPMD_SETTING(enic, f) ((enic->config.flags & VENETF_##f) ? 1 : 0) + +#define ENICPMD_BDF_LENGTH 13 /* :00:00.0'\0' */ +#define PKT_TX_TCP_UDP_CKSUM0x6000 +#define ENIC_CALC_IP_CKSUM 1 +#define ENIC_CALC_TCP_UDP_CKSUM 2 +#define ENIC_MAX_MTU9000 +#define PAGE_SIZE 4096 +#define PAGE_ROUND_UP(x) \ + unsigned long)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1))) + +#define ENICPMD_VFIO_PATH "/dev/vfio/vfio" +/*#define ENIC_DESC_COUNT_MAKE_ODD (x) do{if ((~(x)) & 1) { (x)--; } }while(0)*/ + +#define PCI_DEVICE_ID_CISCO_VIC_ENET 0x0043 /* ethernet vnic */ +#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF 0x0071 /* enet SRIOV VF */ + + +#define ENICPMD_FDIR_MAX 64 + +struct enic_fdir_node { + struct rte_fdir_filter filter; + u16 fltr_id; + u16 rq_index; +}; + +struct enic_fdir { + struct rte_eth_fdir stats; + struct rte_hash *hash; + struct enic_fdir_node *nodes[ENICPMD_FDIR_MAX]; +}; + +/* Per-instance private data structure */ +struct enic { + struct enic *next; + struct rte_pci_device *pdev; + struct vnic_enet_config config; + struct vnic_dev_bar bar0; + struct vnic_dev *vdev; + + struct rte_eth_dev *rte_dev; + struct enic_fdir fdir; + char bdf_name[ENICPMD_BDF_LENGTH]; + int dev_fd; + int iommu_group_fd; + int iommu_groupid; + int eventfd; + u_int8_t mac_addr[ETH_ALEN]; + pthread_t err_intr_thread; + int promisc; + int allmulti; + int ig_vlan_strip_en; + int link
[dpdk-dev] [PATCH v5 6/6] enicpmd: DPDK changes for accommodating ENIC PMD
Signed-off-by: Sujith Sankar --- config/common_linuxapp | 5 + lib/Makefile | 1 + mk/rte.app.mk | 4 3 files changed, 10 insertions(+) diff --git a/config/common_linuxapp b/config/common_linuxapp index 86a0d15..542fff2 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -210,6 +210,11 @@ CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM=4 CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1 # +# Compile burst-oriented Cisco ENIC PMD driver +# +CONFIG_RTE_LIBRTE_ENIC_PMD=y + +# # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y diff --git a/lib/Makefile b/lib/Makefile index 204ef11..df17d78 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -43,6 +43,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ether DIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += librte_pmd_e1000 DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_ixgbe +DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_enic DIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += librte_pmd_i40e DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += librte_pmd_bond DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += librte_pmd_ring diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 59468b0..bef823b 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -186,6 +186,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) LDLIBS += -lrte_pmd_vmxnet3_uio endif +ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) +LDLIBS += -lrte_pmd_enic +endif + ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) LDLIBS += -lrte_pmd_virtio_uio endif -- 1.9.1
[dpdk-dev] [PATCH v6 0/6] enicpmd: Cisco Systems Inc. VIC Ethernet PMD
ENIC PMD is the poll-mode driver for the Cisco Systems Inc. VIC to be used with DPDK suite. Sujith Sankar (6): enicpmd: License text enicpmd: Makefile enicpmd: VNIC common code partially shared with ENIC kernel mode driver enicpmd: pmd specific code enicpmd: DPDK-ENIC PMD interface enicpmd: DPDK changes for accommodating ENIC PMD config/common_linuxapp |5 + lib/Makefile |1 + lib/librte_pmd_enic/LICENSE | 27 + lib/librte_pmd_enic/Makefile | 67 ++ lib/librte_pmd_enic/enic.h | 157 lib/librte_pmd_enic/enic_clsf.c | 244 ++ lib/librte_pmd_enic/enic_compat.h| 142 lib/librte_pmd_enic/enic_etherdev.c | 613 +++ lib/librte_pmd_enic/enic_main.c | 1266 ++ lib/librte_pmd_enic/enic_res.c | 221 ++ lib/librte_pmd_enic/enic_res.h | 168 lib/librte_pmd_enic/vnic/cq_desc.h | 126 +++ lib/librte_pmd_enic/vnic/cq_enet_desc.h | 261 ++ lib/librte_pmd_enic/vnic/rq_enet_desc.h | 76 ++ lib/librte_pmd_enic/vnic/vnic_cq.c | 117 +++ lib/librte_pmd_enic/vnic/vnic_cq.h | 152 lib/librte_pmd_enic/vnic/vnic_dev.c | 1063 + lib/librte_pmd_enic/vnic/vnic_dev.h | 203 + lib/librte_pmd_enic/vnic/vnic_devcmd.h | 774 ++ lib/librte_pmd_enic/vnic/vnic_enet.h | 78 ++ lib/librte_pmd_enic/vnic/vnic_intr.c | 83 ++ lib/librte_pmd_enic/vnic/vnic_intr.h | 126 +++ lib/librte_pmd_enic/vnic/vnic_nic.h | 88 +++ lib/librte_pmd_enic/vnic/vnic_resource.h | 97 +++ lib/librte_pmd_enic/vnic/vnic_rq.c | 246 ++ lib/librte_pmd_enic/vnic/vnic_rq.h | 282 +++ lib/librte_pmd_enic/vnic/vnic_rss.c | 85 ++ lib/librte_pmd_enic/vnic/vnic_rss.h | 61 ++ lib/librte_pmd_enic/vnic/vnic_stats.h| 86 ++ lib/librte_pmd_enic/vnic/vnic_wq.c | 245 ++ lib/librte_pmd_enic/vnic/vnic_wq.h | 283 +++ lib/librte_pmd_enic/vnic/wq_enet_desc.h | 114 +++ mk/rte.app.mk|4 + 33 files changed, 7561 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE create mode 100644 lib/librte_pmd_enic/Makefile create mode 100644 lib/librte_pmd_enic/enic.h create mode 100644 lib/librte_pmd_enic/enic_clsf.c create mode 100644 lib/librte_pmd_enic/enic_compat.h create mode 100644 lib/librte_pmd_enic/enic_etherdev.c create mode 100644 lib/librte_pmd_enic/enic_main.c create mode 100644 lib/librte_pmd_enic/enic_res.c create mode 100644 lib/librte_pmd_enic/enic_res.h create mode 100644 lib/librte_pmd_enic/vnic/cq_desc.h create mode 100644 lib/librte_pmd_enic/vnic/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_enet.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_nic.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_resource.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_stats.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.h create mode 100644 lib/librte_pmd_enic/vnic/wq_enet_desc.h -- 1.9.1
[dpdk-dev] [PATCH v6 1/6] enicpmd: License text
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/LICENSE | 27 +++ 1 file changed, 27 insertions(+) create mode 100644 lib/librte_pmd_enic/LICENSE diff --git a/lib/librte_pmd_enic/LICENSE b/lib/librte_pmd_enic/LICENSE new file mode 100644 index 000..46a27a4 --- /dev/null +++ b/lib/librte_pmd_enic/LICENSE @@ -0,0 +1,27 @@ + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. -- 1.9.1
[dpdk-dev] [PATCH v6 2/6] enicpmd: Makefile
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/Makefile | 67 1 file changed, 67 insertions(+) create mode 100644 lib/librte_pmd_enic/Makefile diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile new file mode 100644 index 000..e7bb11b --- /dev/null +++ b/lib/librte_pmd_enic/Makefile @@ -0,0 +1,67 @@ +# +# Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. +# Copyright 2007 Nuova Systems, Inc. All rights reserved. +# +# Copyright (c) 2014, Cisco Systems, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. 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. +# +# 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_enic.a + +CFLAGS += -I$(RTE_SDK)/lib/librte_hash/ -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/ +CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/ +CFLAGS += -O3 -Wno-deprecated + +VPATH += $(RTE_SDK)/lib/librte_pmd_enic/src + +# +# all source are stored in SRCS-y +# +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_main.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_clsf.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_cq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_wq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_dev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_intr.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_rq.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_etherdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_res.c +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic/vnic_rss.c + + +# this lib depends upon: +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_eal lib/librte_ether +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_mempool lib/librte_mbuf +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_net lib/librte_malloc + +include $(RTE_SDK)/mk/rte.lib.mk + -- 1.9.1
[dpdk-dev] [PATCH v6 3/6] enicpmd: VNIC common code partially shared with ENIC kernel mode driver
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/vnic/cq_desc.h | 126 lib/librte_pmd_enic/vnic/cq_enet_desc.h | 261 lib/librte_pmd_enic/vnic/rq_enet_desc.h | 76 +++ lib/librte_pmd_enic/vnic/vnic_cq.c | 117 lib/librte_pmd_enic/vnic/vnic_cq.h | 152 + lib/librte_pmd_enic/vnic/vnic_dev.c | 1063 ++ lib/librte_pmd_enic/vnic/vnic_dev.h | 203 ++ lib/librte_pmd_enic/vnic/vnic_devcmd.h | 774 ++ lib/librte_pmd_enic/vnic/vnic_enet.h | 78 +++ lib/librte_pmd_enic/vnic/vnic_intr.c | 83 +++ lib/librte_pmd_enic/vnic/vnic_intr.h | 126 lib/librte_pmd_enic/vnic/vnic_nic.h | 88 +++ lib/librte_pmd_enic/vnic/vnic_resource.h | 97 +++ lib/librte_pmd_enic/vnic/vnic_rq.c | 246 +++ lib/librte_pmd_enic/vnic/vnic_rq.h | 282 lib/librte_pmd_enic/vnic/vnic_rss.c | 85 +++ lib/librte_pmd_enic/vnic/vnic_rss.h | 61 ++ lib/librte_pmd_enic/vnic/vnic_stats.h| 86 +++ lib/librte_pmd_enic/vnic/vnic_wq.c | 245 +++ lib/librte_pmd_enic/vnic/vnic_wq.h | 283 lib/librte_pmd_enic/vnic/wq_enet_desc.h | 114 21 files changed, 4646 insertions(+) create mode 100644 lib/librte_pmd_enic/vnic/cq_desc.h create mode 100644 lib/librte_pmd_enic/vnic/cq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/rq_enet_desc.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_cq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_dev.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_devcmd.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_enet.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_intr.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_nic.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_resource.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rq.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_rss.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_stats.h create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.c create mode 100644 lib/librte_pmd_enic/vnic/vnic_wq.h create mode 100644 lib/librte_pmd_enic/vnic/wq_enet_desc.h diff --git a/lib/librte_pmd_enic/vnic/cq_desc.h b/lib/librte_pmd_enic/vnic/cq_desc.h new file mode 100644 index 000..c418967 --- /dev/null +++ b/lib/librte_pmd_enic/vnic/cq_desc.h @@ -0,0 +1,126 @@ +/* + * Copyright 2008-2010 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id: cq_desc.h 129574 2013-04-26 22:11:14Z rfaucett $" + +#ifndef _CQ_DESC_H_ +#define _CQ_DESC_H_ + +/* + * Completion queue descriptor types + */ +enum cq_desc_types { + CQ_DESC_TYPE_WQ_ENET = 0, + CQ_DESC_TYPE_DESC_COPY = 1, + CQ_DESC_TYPE_WQ_EXCH = 2, + CQ_DESC_TYPE_RQ_ENET = 3, + CQ_DESC_TYPE_RQ_FCP = 4, + CQ_DESC_TYPE_IOMMU_MISS = 5, + CQ_DESC_TYPE_SGL = 6, + CQ_DESC_TYPE_CLASSIFIER = 7, + CQ_DESC_TYPE_TEST = 127, +}; + +/* Completion queue descriptor: 16B + * + * All completion queues have this basic layout. The + * type_specfic area is unique for each completion + * queue type. + */ +struct cq_desc { + __le16 completed_index; + __le16 q_number; + u8 type_specfic[11]; +
[dpdk-dev] [PATCH v6 4/6] enicpmd: pmd specific code
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic.h| 157 + lib/librte_pmd_enic/enic_clsf.c | 244 +++ lib/librte_pmd_enic/enic_compat.h | 142 + lib/librte_pmd_enic/enic_main.c | 1266 + lib/librte_pmd_enic/enic_res.c| 221 +++ lib/librte_pmd_enic/enic_res.h| 168 + 6 files changed, 2198 insertions(+) create mode 100644 lib/librte_pmd_enic/enic.h create mode 100644 lib/librte_pmd_enic/enic_clsf.c create mode 100644 lib/librte_pmd_enic/enic_compat.h create mode 100644 lib/librte_pmd_enic/enic_main.c create mode 100644 lib/librte_pmd_enic/enic_res.c create mode 100644 lib/librte_pmd_enic/enic_res.h diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h new file mode 100644 index 000..9f80fc0 --- /dev/null +++ b/lib/librte_pmd_enic/enic.h @@ -0,0 +1,157 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#ifndef _ENIC_H_ +#define _ENIC_H_ + +#include "vnic_enet.h" +#include "vnic_dev.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_cq.h" +#include "vnic_intr.h" +#include "vnic_stats.h" +#include "vnic_nic.h" +#include "vnic_rss.h" +#include "enic_res.h" + +#define DRV_NAME "enic_pmd" +#define DRV_DESCRIPTION"Cisco VIC Ethernet NIC Poll-mode Driver" +#define DRV_VERSION"1.0.0.4" +#define DRV_COPYRIGHT "Copyright 2008-2014 Cisco Systems, Inc" + +#define ENIC_WQ_MAX8 +#define ENIC_RQ_MAX8 +#define ENIC_CQ_MAX(ENIC_WQ_MAX + ENIC_RQ_MAX) +#define ENIC_INTR_MAX (ENIC_CQ_MAX + 2) + +#define VLAN_ETH_HLEN 18 + +#define ENICPMD_SETTING(enic, f) ((enic->config.flags & VENETF_##f) ? 1 : 0) + +#define ENICPMD_BDF_LENGTH 13 /* :00:00.0'\0' */ +#define PKT_TX_TCP_UDP_CKSUM0x6000 +#define ENIC_CALC_IP_CKSUM 1 +#define ENIC_CALC_TCP_UDP_CKSUM 2 +#define ENIC_MAX_MTU9000 +#define PAGE_SIZE 4096 +#define PAGE_ROUND_UP(x) \ + unsigned long)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1))) + +#define ENICPMD_VFIO_PATH "/dev/vfio/vfio" +/*#define ENIC_DESC_COUNT_MAKE_ODD (x) do{if ((~(x)) & 1) { (x)--; } }while(0)*/ + +#define PCI_DEVICE_ID_CISCO_VIC_ENET 0x0043 /* ethernet vnic */ +#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF 0x0071 /* enet SRIOV VF */ + + +#define ENICPMD_FDIR_MAX 64 + +struct enic_fdir_node { + struct rte_fdir_filter filter; + u16 fltr_id; + u16 rq_index; +}; + +struct enic_fdir { + struct rte_eth_fdir stats; + struct rte_hash *hash; + struct enic_fdir_node *nodes[ENICPMD_FDIR_MAX]; +}; + +/* Per-instance private data structure */ +struct enic { + struct enic *next; + struct rte_pci_device *pdev; + struct vnic_enet_config config; + struct vnic_dev_bar bar0; + struct vnic_dev *vdev; + + struct rte_eth_dev *rte_dev; + struct enic_fdir fdir; + char bdf_name[ENICPMD_BDF_LENGTH]; + int dev_fd; + int iommu_group_fd; + int iommu_groupid; + int eventfd; + u_int8_t mac_addr[ETH_ALEN]; + pthread_t err_intr_thread; + int promisc; + int allmulti; + int ig_vlan_strip_en; + int link
[dpdk-dev] [PATCH v6 5/6] enicpmd: DPDK-ENIC PMD interface
Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic_etherdev.c | 613 1 file changed, 613 insertions(+) create mode 100644 lib/librte_pmd_enic/enic_etherdev.c diff --git a/lib/librte_pmd_enic/enic_etherdev.c b/lib/librte_pmd_enic/enic_etherdev.c new file mode 100644 index 000..d0577aa --- /dev/null +++ b/lib/librte_pmd_enic/enic_etherdev.c @@ -0,0 +1,613 @@ +/* + * Copyright 2008-2014 Cisco Systems, Inc. All rights reserved. + * Copyright 2007 Nuova Systems, Inc. All rights reserved. + * + * Copyright (c) 2014, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. 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. + * + * 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 HOLDER 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 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ +#ident "$Id$" + +#include +#include + +#include +#include +#include +#include + +#include "vnic_intr.h" +#include "vnic_cq.h" +#include "vnic_wq.h" +#include "vnic_rq.h" +#include "vnic_enet.h" +#include "enic.h" + +#define ENICPMD_FUNC_TRACE() \ + RTE_LOG(DEBUG, PMD, "ENICPMD trace: %s\n", __func__) + +/* + * The set of PCI devices this driver supports + */ +static struct rte_pci_id pci_id_enic_map[] = { +#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) {RTE_PCI_DEVICE(vend, dev)}, +#ifndef PCI_VENDOR_ID_CISCO +#define PCI_VENDOR_ID_CISCO0x1137 +#endif +#include "rte_pci_dev_ids.h" +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET) +RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_VIC_ENET_VF) +{.vendor_id = 0, /* Sentinal */}, +}; + +static int enicpmd_fdir_remove_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, + uint16_t soft_id) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_del_fltr(enic, fdir_filter); +} + +static int enicpmd_fdir_add_perfect_filter(struct rte_eth_dev *eth_dev, + struct rte_fdir_filter *fdir_filter, uint16_t soft_id, + uint8_t queue, uint8_t drop) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + return enic_fdir_add_fltr(enic, fdir_filter, (uint16_t)queue, drop); +} + +static void enicpmd_fdir_info_get(struct rte_eth_dev *eth_dev, + struct rte_eth_fdir *fdir) +{ + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + *fdir = enic->fdir.stats; +} + +static void enicpmd_dev_tx_queue_release(void *txq) +{ + ENICPMD_FUNC_TRACE(); + enic_free_wq(txq); +} + +static int enicpmd_dev_setup_intr(struct enic *enic) +{ + int ret; + int index; + + ENICPMD_FUNC_TRACE(); + + /* Are we done with the init of all the queues? */ + for (index = 0; index < enic->cq_count; index++) { + if (!enic->cq[index].ctrl) + break; + } + + if (enic->cq_count != index) + return 0; + + ret = enic_alloc_intr_resources(enic); + if (ret) { + dev_err(enic, "alloc intr failed\n"); + return ret; + } + enic_init_vnic_resources(enic); + + ret = enic_setup_finish(enic); + if (ret) + dev_err(enic, "setup could not be finished\n"); + + return ret; +} + +static int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, + uint16_t queue_idx, + uint16_t nb_desc, + unsigned int socket_id, + const struct rte_eth_txconf *tx_conf) +{ + int ret; + struct enic *enic = pmd_priv(eth_dev); + + ENICPMD_FUNC_TRACE(); + eth_dev->data->tx_queues[queue_idx] = (void *)&enic->wq[queue_
[dpdk-dev] [PATCH v6 6/6] enicpmd: DPDK changes for accommodating ENIC PMD
Signed-off-by: Sujith Sankar --- config/common_linuxapp | 5 + lib/Makefile | 1 + mk/rte.app.mk | 4 3 files changed, 10 insertions(+) diff --git a/config/common_linuxapp b/config/common_linuxapp index 6243d4b..51edbd9 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -210,6 +210,11 @@ CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM=4 CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1 # +# Compile burst-oriented Cisco ENIC PMD driver +# +CONFIG_RTE_LIBRTE_ENIC_PMD=y + +# # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y diff --git a/lib/Makefile b/lib/Makefile index 204ef11..53e55d9 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -43,6 +43,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ether DIRS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += librte_pmd_e1000 DIRS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += librte_pmd_ixgbe +DIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += librte_pmd_enic DIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += librte_pmd_i40e DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += librte_pmd_bond DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += librte_pmd_ring diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 59468b0..bef823b 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -186,6 +186,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_VMXNET3_PMD),y) LDLIBS += -lrte_pmd_vmxnet3_uio endif +ifeq ($(CONFIG_RTE_LIBRTE_ENIC_PMD),y) +LDLIBS += -lrte_pmd_enic +endif + ifeq ($(CONFIG_RTE_LIBRTE_VIRTIO_PMD),y) LDLIBS += -lrte_pmd_virtio_uio endif -- 1.9.1
[dpdk-dev] [PATCH] enicpmd: compilation error during inclusion of vfio.h
Inclusion of vfio.h was giving compilation errors if kernel version is less than 3.6.0 and if RTE_EAL_VFIO was on in config. Replaced inclusion of vfio.h with eal_vfio.h and replaced RTE_EAL_VFIO with VFIO_PRESENT in enicpmd code. Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/Makefile| 1 + lib/librte_pmd_enic/enic_main.c | 13 + 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile index d4c2f66..befc552 100644 --- a/lib/librte_pmd_enic/Makefile +++ b/lib/librte_pmd_enic/Makefile @@ -39,6 +39,7 @@ LIB = librte_pmd_enic.a CFLAGS += -I$(RTE_SDK)/lib/librte_hash/ -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/ CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/ +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal/ CFLAGS += -O3 -Wno-deprecated VPATH += $(RTE_SDK)/lib/librte_pmd_enic/src diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c index 4b857bb..f6f00d3 100644 --- a/lib/librte_pmd_enic/enic_main.c +++ b/lib/librte_pmd_enic/enic_main.c @@ -39,9 +39,6 @@ #include #include #include -#ifdef RTE_EAL_VFIO -#include -#endif #include #include @@ -631,7 +628,7 @@ int enic_enable(struct enic *enic) vnic_dev_enable_wait(enic->vdev); -#ifndef RTE_EAL_VFIO +#ifndef VFIO_PRESENT /* Register and enable error interrupt */ rte_intr_callback_register(&(enic->pdev->intr_handle), enic_intr_handler, (void *)enic->rte_dev); @@ -995,7 +992,7 @@ int enic_setup_finish(struct enic *enic) return 0; } -#ifdef RTE_EAL_VFIO +#ifdef VFIO_PRESENT static void enic_eventfd_init(struct enic *enic) { enic->eventfd = enic->pdev->intr_handle.fd; @@ -1033,7 +1030,7 @@ int enic_get_link_status(struct enic *enic) } -#ifdef RTE_EAL_VFIO +#ifdef VFIO_PRESENT static int enic_create_err_intr_thread(struct enic *enic) { pthread_attr_t intr_attr; @@ -,7 +1108,7 @@ static void enic_dev_deinit(struct enic *enic) if (eth_dev->data->mac_addrs) rte_free(eth_dev->data->mac_addrs); -#ifdef RTE_EAL_VFIO +#ifdef VFIO_PRESENT enic_clear_intr_mode(enic); #endif } @@ -1167,7 +1164,7 @@ static int enic_dev_init(struct enic *enic) */ enic_get_res_counts(enic); -#ifdef RTE_EAL_VFIO +#ifdef VFIO_PRESENT /* Set interrupt mode based on resource counts and system * capabilities */ -- 1.9.1
[dpdk-dev] [PATCH] enicpmd: replace the type u_int* with uint* to remove compilation errors on a few platforms
ENIC PMD was giving compilation errors on ppc_64-power8-linuxapp-gcc because of types such as u_int32_t. This patch replaces all those with uint32_t and similar ones. Reported-by: David Marchand Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic.h | 2 +- lib/librte_pmd_enic/enic_compat.h | 16 lib/librte_pmd_enic/enic_main.c| 18 +- lib/librte_pmd_enic/vnic/vnic_devcmd.h | 6 +++--- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h index 9f80fc0..6400d24 100644 --- a/lib/librte_pmd_enic/enic.h +++ b/lib/librte_pmd_enic/enic.h @@ -106,7 +106,7 @@ struct enic { int iommu_group_fd; int iommu_groupid; int eventfd; - u_int8_t mac_addr[ETH_ALEN]; + uint8_t mac_addr[ETH_ALEN]; pthread_t err_intr_thread; int promisc; int allmulti; diff --git a/lib/librte_pmd_enic/enic_compat.h b/lib/librte_pmd_enic/enic_compat.h index d22578e..7c62bf2 100644 --- a/lib/librte_pmd_enic/enic_compat.h +++ b/lib/librte_pmd_enic/enic_compat.h @@ -89,9 +89,9 @@ typedef unsigned intu32; typedef unsigned long long u64; typedef unsigned long long dma_addr_t; -static inline u_int32_t ioread32(volatile void *addr) +static inline uint32_t ioread32(volatile void *addr) { - return *(volatile u_int32_t *)addr; + return *(volatile uint32_t *)addr; } static inline u16 ioread16(volatile void *addr) @@ -99,14 +99,14 @@ static inline u16 ioread16(volatile void *addr) return *(volatile u16 *)addr; } -static inline u_int8_t ioread8(volatile void *addr) +static inline uint8_t ioread8(volatile void *addr) { - return *(volatile u_int8_t *)addr; + return *(volatile uint8_t *)addr; } -static inline void iowrite32(u_int32_t val, volatile void *addr) +static inline void iowrite32(uint32_t val, volatile void *addr) { - *(volatile u_int32_t *)addr = val; + *(volatile uint32_t *)addr = val; } static inline void iowrite16(u16 val, volatile void *addr) @@ -114,9 +114,9 @@ static inline void iowrite16(u16 val, volatile void *addr) *(volatile u16 *)addr = val; } -static inline void iowrite8(u_int8_t val, volatile void *addr) +static inline void iowrite8(uint8_t val, volatile void *addr) { - *(volatile u_int8_t *)addr = val; + *(volatile uint8_t *)addr = val; } static inline unsigned int readl(volatile void __iomem *addr) diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c index f6f00d3..853dd04 100644 --- a/lib/librte_pmd_enic/enic_main.c +++ b/lib/librte_pmd_enic/enic_main.c @@ -172,17 +172,17 @@ unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq) int enic_send_pkt(struct enic *enic, struct vnic_wq *wq, struct rte_mbuf *tx_pkt, unsigned short len, - u_int8_t sop, u_int8_t eop, - u_int16_t ol_flags, u_int16_t vlan_tag) + uint8_t sop, uint8_t eop, + uint16_t ol_flags, uint16_t vlan_tag) { struct wq_enet_desc *desc = vnic_wq_next_desc(wq); - u_int16_t mss = 0; - u_int16_t header_length = 0; - u_int8_t cq_entry = eop; - u_int8_t vlan_tag_insert = 0; + uint16_t mss = 0; + uint16_t header_length = 0; + uint8_t cq_entry = eop; + uint8_t vlan_tag_insert = 0; unsigned char *buf = (unsigned char *)(tx_pkt->buf_addr) + RTE_PKTMBUF_HEADROOM; - u_int64_t bus_addr = (dma_addr_t) + uint64_t bus_addr = (dma_addr_t) (tx_pkt->buf_physaddr + RTE_PKTMBUF_HEADROOM); if (sop) { @@ -342,8 +342,8 @@ static int enic_rq_alloc_buf(struct vnic_rq *rq) void *buf; dma_addr_t dma_addr; struct rq_enet_desc *desc = vnic_rq_next_desc(rq); - u_int8_t type = RQ_ENET_TYPE_ONLY_SOP; - u_int16_t len = ENIC_MAX_MTU + VLAN_ETH_HLEN; + uint8_t type = RQ_ENET_TYPE_ONLY_SOP; + uint16_t len = ENIC_MAX_MTU + VLAN_ETH_HLEN; u16 split_hdr_size = vnic_get_hdr_split_size(enic->vdev); struct rte_mbuf *mbuf = enic_rxmbuf_alloc(rq->mp); struct rte_mbuf *hdr_mbuf = NULL; diff --git a/lib/librte_pmd_enic/vnic/vnic_devcmd.h b/lib/librte_pmd_enic/vnic/vnic_devcmd.h index b4c87c1..e7ecf31 100644 --- a/lib/librte_pmd_enic/vnic/vnic_devcmd.h +++ b/lib/librte_pmd_enic/vnic/vnic_devcmd.h @@ -691,9 +691,9 @@ enum { #define FILTER_MAX_BUF_SIZE 100 /* Maximum size of buffer to CMD_ADD_FILTER */ struct filter_tlv { - u_int32_t type; - u_int32_t length; - u_int32_t val[0]; + uint32_t type; + uint32_t length; + uint32_t val[0]; }; enum { -- 1.9.1
[dpdk-dev] [PATCH v2] enicpmd: replace the type u_int* with uint* to remove compilation errors on a few platforms
ENIC PMD was giving compilation errors on ppc_64-power8-linuxapp-gcc because of types such as u_int32_t. This patch replaces all those with uint32_t and similar ones. Reported-by: David Marchand Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic.h | 2 +- lib/librte_pmd_enic/enic_compat.h | 24 lib/librte_pmd_enic/enic_main.c| 18 +- lib/librte_pmd_enic/vnic/vnic_devcmd.h | 6 +++--- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h index 9f80fc0..6400d24 100644 --- a/lib/librte_pmd_enic/enic.h +++ b/lib/librte_pmd_enic/enic.h @@ -106,7 +106,7 @@ struct enic { int iommu_group_fd; int iommu_groupid; int eventfd; - u_int8_t mac_addr[ETH_ALEN]; + uint8_t mac_addr[ETH_ALEN]; pthread_t err_intr_thread; int promisc; int allmulti; diff --git a/lib/librte_pmd_enic/enic_compat.h b/lib/librte_pmd_enic/enic_compat.h index d22578e..b3738ee 100644 --- a/lib/librte_pmd_enic/enic_compat.h +++ b/lib/librte_pmd_enic/enic_compat.h @@ -89,34 +89,34 @@ typedef unsigned intu32; typedef unsigned long long u64; typedef unsigned long long dma_addr_t; -static inline u_int32_t ioread32(volatile void *addr) +static inline uint32_t ioread32(volatile void *addr) { - return *(volatile u_int32_t *)addr; + return *(volatile uint32_t *)addr; } -static inline u16 ioread16(volatile void *addr) +static inline uint16_t ioread16(volatile void *addr) { - return *(volatile u16 *)addr; + return *(volatile uint16_t *)addr; } -static inline u_int8_t ioread8(volatile void *addr) +static inline uint8_t ioread8(volatile void *addr) { - return *(volatile u_int8_t *)addr; + return *(volatile uint8_t *)addr; } -static inline void iowrite32(u_int32_t val, volatile void *addr) +static inline void iowrite32(uint32_t val, volatile void *addr) { - *(volatile u_int32_t *)addr = val; + *(volatile uint32_t *)addr = val; } -static inline void iowrite16(u16 val, volatile void *addr) +static inline void iowrite16(uint16_t val, volatile void *addr) { - *(volatile u16 *)addr = val; + *(volatile uint16_t *)addr = val; } -static inline void iowrite8(u_int8_t val, volatile void *addr) +static inline void iowrite8(uint8_t val, volatile void *addr) { - *(volatile u_int8_t *)addr = val; + *(volatile uint8_t *)addr = val; } static inline unsigned int readl(volatile void __iomem *addr) diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c index f6f00d3..853dd04 100644 --- a/lib/librte_pmd_enic/enic_main.c +++ b/lib/librte_pmd_enic/enic_main.c @@ -172,17 +172,17 @@ unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq) int enic_send_pkt(struct enic *enic, struct vnic_wq *wq, struct rte_mbuf *tx_pkt, unsigned short len, - u_int8_t sop, u_int8_t eop, - u_int16_t ol_flags, u_int16_t vlan_tag) + uint8_t sop, uint8_t eop, + uint16_t ol_flags, uint16_t vlan_tag) { struct wq_enet_desc *desc = vnic_wq_next_desc(wq); - u_int16_t mss = 0; - u_int16_t header_length = 0; - u_int8_t cq_entry = eop; - u_int8_t vlan_tag_insert = 0; + uint16_t mss = 0; + uint16_t header_length = 0; + uint8_t cq_entry = eop; + uint8_t vlan_tag_insert = 0; unsigned char *buf = (unsigned char *)(tx_pkt->buf_addr) + RTE_PKTMBUF_HEADROOM; - u_int64_t bus_addr = (dma_addr_t) + uint64_t bus_addr = (dma_addr_t) (tx_pkt->buf_physaddr + RTE_PKTMBUF_HEADROOM); if (sop) { @@ -342,8 +342,8 @@ static int enic_rq_alloc_buf(struct vnic_rq *rq) void *buf; dma_addr_t dma_addr; struct rq_enet_desc *desc = vnic_rq_next_desc(rq); - u_int8_t type = RQ_ENET_TYPE_ONLY_SOP; - u_int16_t len = ENIC_MAX_MTU + VLAN_ETH_HLEN; + uint8_t type = RQ_ENET_TYPE_ONLY_SOP; + uint16_t len = ENIC_MAX_MTU + VLAN_ETH_HLEN; u16 split_hdr_size = vnic_get_hdr_split_size(enic->vdev); struct rte_mbuf *mbuf = enic_rxmbuf_alloc(rq->mp); struct rte_mbuf *hdr_mbuf = NULL; diff --git a/lib/librte_pmd_enic/vnic/vnic_devcmd.h b/lib/librte_pmd_enic/vnic/vnic_devcmd.h index b4c87c1..e7ecf31 100644 --- a/lib/librte_pmd_enic/vnic/vnic_devcmd.h +++ b/lib/librte_pmd_enic/vnic/vnic_devcmd.h @@ -691,9 +691,9 @@ enum { #define FILTER_MAX_BUF_SIZE 100 /* Maximum size of buffer to CMD_ADD_FILTER */ struct filter_tlv { - u_int32_t type; - u_int32_t length; - u_int32_t val[0]; + uint32_t type; + uint32_t length; + uint32_t val[0]; }; enum { -- 1.9.1
[dpdk-dev] [PATCH] enicpd: Warnings and one error when built using clang compiler
This patch fixes the warnings and error reported by clang compiler on Linux. Reported-by: Bruce Richardson Signed-off-by: Sujith Sankar --- lib/librte_pmd_enic/enic.h | 40 + lib/librte_pmd_enic/enic_compat.h | 1 + lib/librte_pmd_enic/enic_main.c | 31 +++- lib/librte_pmd_enic/vnic/vnic_dev.c | 19 ++ lib/librte_pmd_enic/vnic/vnic_dev.h | 9 + 5 files changed, 78 insertions(+), 22 deletions(-) diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h index 6400d24..f128e64 100644 --- a/lib/librte_pmd_enic/enic.h +++ b/lib/librte_pmd_enic/enic.h @@ -154,4 +154,44 @@ static inline struct enic *pmd_priv(struct rte_eth_dev *eth_dev) return (struct enic *)eth_dev->data->dev_private; } +extern int enic_fdir_add_fltr(struct enic *enic, + struct rte_fdir_filter *params, u16 queue, u8 drop); +extern int enic_fdir_del_fltr(struct enic *enic, + struct rte_fdir_filter *params); +extern void enic_free_wq(void *txq); +extern int enic_alloc_intr_resources(struct enic *enic); +extern int enic_setup_finish(struct enic *enic); +extern int enic_alloc_wq(struct enic *enic, uint16_t queue_idx, + unsigned int socket_id, uint16_t nb_desc); +extern void enic_start_wq(struct enic *enic, uint16_t queue_idx); +extern int enic_stop_wq(struct enic *enic, uint16_t queue_idx); +extern void enic_start_rq(struct enic *enic, uint16_t queue_idx); +extern int enic_stop_rq(struct enic *enic, uint16_t queue_idx); +extern void enic_free_rq(void *rxq); +extern int enic_alloc_rq(struct enic *enic, uint16_t queue_idx, + unsigned int socket_id, struct rte_mempool *mp, + uint16_t nb_desc); +extern int enic_set_rss_nic_cfg(struct enic *enic); +extern int enic_set_vnic_res(struct enic *enic); +extern void enic_set_hdr_split_size(struct enic *enic, u16 split_hdr_size); +extern int enic_enable(struct enic *enic); +extern int enic_disable(struct enic *enic); +extern void enic_remove(struct enic *enic); +extern int enic_get_link_status(struct enic *enic); +extern void enic_dev_stats_get(struct enic *enic, + struct rte_eth_stats *r_stats); +extern void enic_dev_stats_clear(struct enic *enic); +extern void enic_add_packet_filter(struct enic *enic); +extern void enic_set_mac_address(struct enic *enic, uint8_t *mac_addr); +extern void enic_del_mac_address(struct enic *enic); +extern unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq); +extern int enic_send_pkt(struct enic *enic, struct vnic_wq *wq, + struct rte_mbuf *tx_pkt, unsigned short len, + uint8_t sop, uint8_t eop, + uint16_t ol_flags, uint16_t vlan_tag); +extern int enic_poll(struct vnic_rq *rq, struct rte_mbuf **rx_pkts, + unsigned int budget, unsigned int *work_done); +extern int enic_probe(struct enic *enic); +extern int enic_clsf_init(struct enic *enic); +extern void enic_clsf_destroy(struct enic *enic); #endif /* _ENIC_H_ */ diff --git a/lib/librte_pmd_enic/enic_compat.h b/lib/librte_pmd_enic/enic_compat.h index b3738ee..b1af838 100644 --- a/lib/librte_pmd_enic/enic_compat.h +++ b/lib/librte_pmd_enic/enic_compat.h @@ -37,6 +37,7 @@ #define _ENIC_COMPAT_H_ #include +#include #include #include diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c index 853dd04..4bbf1e4 100644 --- a/lib/librte_pmd_enic/enic_main.c +++ b/lib/librte_pmd_enic/enic_main.c @@ -65,17 +65,17 @@ static inline int enic_is_sriov_vf(struct enic *enic) return enic->pdev->id.device_id == PCI_DEVICE_ID_CISCO_VIC_ENET_VF; } -static int is_zero_addr(char *addr) +static int is_zero_addr(uint8_t *addr) { return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]); } -static int is_mcast_addr(char *addr) +static int is_mcast_addr(uint8_t *addr) { return addr[0] & 1; } -static int is_eth_addr_valid(char *addr) +static int is_eth_addr_valid(uint8_t *addr) { return !is_mcast_addr(addr) && !is_zero_addr(addr); } @@ -105,7 +105,8 @@ static const struct rte_memzone *ring_dma_zone_reserve( if (mz) return mz; - return rte_memzone_reserve_aligned(z_name, (uint64_t) ring_size, + return rte_memzone_reserve_aligned((const char *)z_name, + (uint64_t) ring_size, socket_id, RTE_MEMZONE_1GB, ENIC_ALIGN); } @@ -430,14 +431,15 @@ static int enic_rq_indicate_buf(struct vnic_rq *rq, &ipv4_csum_ok, &ipv6, &ipv4, &ipv4_fragment, &fcs_ok); - if (packet_error) { - dev_err(enic, "packet error\n"); - return; - } - rx_pkt = (struct rte_mbuf *)buf->os_buf; buf->os_buf = NULL; + if (unlikely(packet_error)) { + dev_err(enic, "packet error\n"); + rx_pkt->data_len = 0; + return 0; +
[dpdk-dev] [PATCH] enic: Remove #ident at the beginning of the files
This patch removes the #ident strings at the beginning of the source files. Signed-off-by: Sujith Sankar --- drivers/net/enic/base/cq_desc.h | 1 - drivers/net/enic/base/cq_enet_desc.h | 1 - drivers/net/enic/base/rq_enet_desc.h | 1 - drivers/net/enic/base/vnic_cq.c | 1 - drivers/net/enic/base/vnic_cq.h | 1 - drivers/net/enic/base/vnic_dev.c | 1 - drivers/net/enic/base/vnic_dev.h | 1 - drivers/net/enic/base/vnic_devcmd.h | 1 - drivers/net/enic/base/vnic_enet.h | 1 - drivers/net/enic/base/vnic_intr.c | 1 - drivers/net/enic/base/vnic_intr.h | 1 - drivers/net/enic/base/vnic_nic.h | 1 - drivers/net/enic/base/vnic_resource.h | 1 - drivers/net/enic/base/vnic_rq.c | 1 - drivers/net/enic/base/vnic_rq.h | 1 - drivers/net/enic/base/vnic_rss.c | 1 - drivers/net/enic/base/vnic_rss.h | 1 - drivers/net/enic/base/vnic_stats.h| 1 - drivers/net/enic/base/vnic_wq.c | 1 - drivers/net/enic/base/vnic_wq.h | 1 - drivers/net/enic/base/wq_enet_desc.h | 1 - drivers/net/enic/enic.h | 1 - drivers/net/enic/enic_clsf.c | 1 - drivers/net/enic/enic_compat.h| 1 - drivers/net/enic/enic_ethdev.c| 1 - drivers/net/enic/enic_main.c | 1 - drivers/net/enic/enic_res.c | 1 - drivers/net/enic/enic_res.h | 1 - 28 files changed, 28 deletions(-) diff --git a/drivers/net/enic/base/cq_desc.h b/drivers/net/enic/base/cq_desc.h index c418967..f3ef6bb 100644 --- a/drivers/net/enic/base/cq_desc.h +++ b/drivers/net/enic/base/cq_desc.h @@ -31,7 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. * */ -#ident "$Id: cq_desc.h 129574 2013-04-26 22:11:14Z rfaucett $" #ifndef _CQ_DESC_H_ #define _CQ_DESC_H_ diff --git a/drivers/net/enic/base/cq_enet_desc.h b/drivers/net/enic/base/cq_enet_desc.h index 669a2b5..f9822a4 100644 --- a/drivers/net/enic/base/cq_enet_desc.h +++ b/drivers/net/enic/base/cq_enet_desc.h @@ -31,7 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. * */ -#ident "$Id: cq_enet_desc.h 160468 2014-02-18 09:50:15Z gvaradar $" #ifndef _CQ_ENET_DESC_H_ #define _CQ_ENET_DESC_H_ diff --git a/drivers/net/enic/base/rq_enet_desc.h b/drivers/net/enic/base/rq_enet_desc.h index f38ff2a..7292d9d 100644 --- a/drivers/net/enic/base/rq_enet_desc.h +++ b/drivers/net/enic/base/rq_enet_desc.h @@ -31,7 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. * */ -#ident "$Id: rq_enet_desc.h 59839 2010-09-27 20:36:31Z roprabhu $" #ifndef _RQ_ENET_DESC_H_ #define _RQ_ENET_DESC_H_ diff --git a/drivers/net/enic/base/vnic_cq.c b/drivers/net/enic/base/vnic_cq.c index cda97e4..2f65f35 100644 --- a/drivers/net/enic/base/vnic_cq.c +++ b/drivers/net/enic/base/vnic_cq.c @@ -31,7 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. * */ -#ident "$Id: vnic_cq.c 171146 2014-05-02 07:08:20Z ssujith $" #include "vnic_dev.h" #include "vnic_cq.h" diff --git a/drivers/net/enic/base/vnic_cq.h b/drivers/net/enic/base/vnic_cq.h index 0928d72..922391b 100644 --- a/drivers/net/enic/base/vnic_cq.h +++ b/drivers/net/enic/base/vnic_cq.h @@ -31,7 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. * */ -#ident "$Id: vnic_cq.h 173398 2014-05-19 09:17:02Z gvaradar $" #ifndef _VNIC_CQ_H_ #define _VNIC_CQ_H_ diff --git a/drivers/net/enic/base/vnic_dev.c b/drivers/net/enic/base/vnic_dev.c index f566734..6153864 100644 --- a/drivers/net/enic/base/vnic_dev.c +++ b/drivers/net/enic/base/vnic_dev.c @@ -31,7 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. * */ -#ident "$Id$" #include #include diff --git a/drivers/net/enic/base/vnic_dev.h b/drivers/net/enic/base/vnic_dev.h index f583357..113d6ac 100644 --- a/drivers/net/enic/base/vnic_dev.h +++ b/drivers/net/enic/base/vnic_dev.h @@ -31,7 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. * */ -#ident "$Id: vnic_dev.h 196958 2014-11-04 18:23:37Z xuywang $" #ifndef _VNIC_DEV_H_ #define _VNIC_DEV_H_ diff --git a/drivers/net/enic/base/vnic_devcmd.h b/drivers/net/enic/base/vnic_devcmd.h index e7ecf31..b3d5a6c 100644 --- a/drivers/net/enic/base/vnic_devcmd.h +++ b/drivers/net/enic/base/vnic_devcmd.h @@ -31,7 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. * */ -#ident "$Id: vnic_devcmd.h 173135 2014-05-16 03:14:07Z sanpilla $" #ifndef _VNIC_DEVCMD_H_ #define _VNIC_DEVCMD_H_ diff --git a/drivers/net/enic/base/vnic_enet.h b/drivers/net/enic/base/vnic_enet.h index 9d3cc07..cc34998 100644 --- a/drivers/net/enic/base/vnic_enet.h +++ b/drivers/net/enic/base/vnic_enet.h @@ -31,7 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. * */ -#ident "$Id: vnic_enet.h 175806 2014-06-04 19:31:17Z rfaucett $" #ifndef _VNIC_ENIC_H_ #define _VNIC_ENIC_H_ diff --git a/drivers/net/enic/base/vnic_intr.c b/drivers/net/enic/base/vnic_intr.c index 84368af..04bb426 100644 --- a/drivers/net/enic/base/vnic_intr.c +++ b/drivers/net/enic/base/vnic_intr.c @@ -31,7 +31,6 @@ * POSSIBILITY OF SUCH DAMAGE. * */ -#ident
[dpdk-dev] Questions on use of multiple NIC interfaces
Hi all, Could someone answer the following questions about the usage of multiple NIC interfaces with DPDK? 1. If my server has two identical Intel NICs, could I use both with DPDK and its applications? 2. If both the NIC cards could be used with DPDK, could I use them with separate instances of applications? E.g., NIC1 used by App1 and NIC2 used by App2. 3. If answer to qn no 2 is yes, does the driver take care to avoid reinitialising NIC1 when App2 tries to initialise NIC2? From what I?ve seen, DPDK calls the driver init for all the matching devices (vendor id and device id). Thanks, -Sujith
[dpdk-dev] Questions on use of multiple NIC interfaces
Thank you Vladimir ! -Sujith From: Vladimir Medvedkin mailto:medvedk...@gmail.com>> Date: Friday, 28 March 2014 3:13 pm To: "Sujith Sankar (ssujith)" mailto:ssujith at cisco.com>> Cc: "dev at dpdk.org<mailto:dev at dpdk.org>" mailto:dev at dpdk.org>> Subject: Re: [dpdk-dev] Questions on use of multiple NIC interfaces 1. Yes. 2. Yes. Look at programmer's guide section 16 Multi-process support. 3. You can use blacklist eal option. Regards, Vladimir 2014-03-28 13:25 GMT+04:00 Sujith Sankar (ssujith) mailto:ssujith at cisco.com>>: Hi all, Could someone answer the following questions about the usage of multiple NIC interfaces with DPDK? 1. If my server has two identical Intel NICs, could I use both with DPDK and its applications? 2. If both the NIC cards could be used with DPDK, could I use them with separate instances of applications? E.g., NIC1 used by App1 and NIC2 used by App2. 3. If answer to qn no 2 is yes, does the driver take care to avoid reinitialising NIC1 when App2 tries to initialise NIC2? From what I?ve seen, DPDK calls the driver init for all the matching devices (vendor id and device id). Thanks, -Sujith
[dpdk-dev] PMD for Cisco VIC Ethernet NIC - Request for guidelines for submission
Hi all, We have been working on development of poll-mode driver for Cisco VIC Ethernet NIC and integration of it with DPDK. We would like to submit this poll-mode driver (ENIC PMD) to the DPDK community so that it could be part of the DPDK tree. Could someone please provide the guidelines and steps to do this? As of now, ENIC PMD is being tested with DPDK 1.6.0r2. Is it alright to submit a patch for DPDK 1.6.0r2? One aspect of ENIC PMD is that it works with VFIO-PCI and not UIO. Hope this is acceptable. The following thread in dpdk-dev influenced this decision. http://dpdk.org/ml/archives/dev/2013-July/000373.html ENIC PMD uses one interrupt per interface and it is used by the NIC for signalling the driver in case of any error. Since this does not come in the fast path, it should be acceptable, isn?t it? Please give your suggestions and comments. Thanks, -Sujith
[dpdk-dev] PMD for Cisco VIC Ethernet NIC - Request for guidelines for submission
Thank you Anatoly ! I?ll take a look at it and get back in case of questions. -Sujith On 28/05/14 2:22 pm, "Burakov, Anatoly" wrote: >Hi Sujith, > >> One aspect of ENIC PMD is that it works with VFIO-PCI and not UIO. Hope >> this is acceptable. The following thread in dpdk-dev influenced this >>decision. >> http://dpdk.org/ml/archives/dev/2013-July/000373.html > >You may find this [1] patchset interesting. Basically, it adds native >support for VFIO to do the binding and unbinding in DPDK. Whether it fits >your purposes depends on your code, but hopefully you'll be able to >simplify your code. > >[1] http://dpdk.org/ml/archives/dev/2014-May/002568.html > >Best regards, >Anatoly Burakov >DPDK SW Engineer > > >
[dpdk-dev] [PATCH 3/7] ENIC PMD Makefile
Hi Neil, Thanks for the comments. I shall work on the modifications that you have suggested and get back with V2. Regards, -Sujith On 07/11/14 5:04 pm, "Neil Horman" wrote: >On Sat, Nov 08, 2014 at 01:35:43AM +0530, Sujith Sankar wrote: >> Signed-off-by: Sujith Sankar >> --- >> lib/librte_pmd_enic/Makefile | 66 >> >> 1 file changed, 66 insertions(+) >> create mode 100644 lib/librte_pmd_enic/Makefile >> >> diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile >> new file mode 100644 >> index 000..7605a8f >> --- /dev/null >> +++ b/lib/librte_pmd_enic/Makefile >> @@ -0,0 +1,66 @@ >> +# BSD LICENSE >> +# >> +# Copyright(c) 2010-2013 Intel Corporation. All rights reserved. >> +# 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 >> +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR >>TORT >> +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE >>USE >> +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH >>DAMAGE. >> +# >> + >> +include $(RTE_SDK)/mk/rte.vars.mk >> + >> +# >> +# library name >> +# >> +LIB = librte_pmd_enic.a >> + >> +CFLAGS += -I$(RTE_SDK)/lib/librte_hash/ >> +CFLAGS += -O3 -Wno-deprecated >> + >> +VPATH += $(RTE_SDK)/lib/librte_pmd_enic/src >> + >> +# >> +# all source are stored in SRCS-y >> +# >> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_main.c >> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_clsf.c >> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_cq.c >> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_wq.c >> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_dev.c >> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_intr.c >> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_rq.c >> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_etherdev.c >> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_res.c >> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_rss.c >> + >> + >> +# this lib depends upon: >> +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_eal >>lib/librte_ether >> +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_mempool >>lib/librte_mbuf >> +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_net >>lib/librte_malloc >> + >> +include $(RTE_SDK)/mk/rte.lib.mk >> + >> -- >> 1.9.1 >> >> > >Make this the last patch in your series, and merge it with the chunk from >the >last patch that adds the enic directory to the lib/Makefile, so that a >bisect >will build between these commits. > >Neil >
[dpdk-dev] [PATCH 7/7] Release notes for ENIC PMD 1.0.0.3
Hi Thomas, Thank you for the comments. I?ll work on moving the release notes to rst and add performance numbers with testpmd. Once I fix these and Neil?s comments, I shall get back with version 2. Thanks, -Sujith On 07/11/14 5:50 pm, "Thomas Monjalon" wrote: >Many informations in the release notes are not well adapted to an >integration. >Please could you rework it? >I'd like to create a doc directory for drivers (doc/drivers) as >doc/guides. >So this doc should be in rst format in order to be processed by sphinx and >published on the web site (like guides). >Could you also include a performance test report based on testpmd? > >Thanks a lot >-- >Thomas
[dpdk-dev] [PATCH 0/7] Cisco Systems Inc. VIC Ethernet PMD - ENIC PMD
Thomas, Let me work on that too. Thanks, -Sujith On 07/11/14 9:17 pm, "Thomas Monjalon" wrote: >Sujith, > >It seems that this PMD is based on DPDK 1.7. >Could you rebase it on HEAD? > >Thank you >-- >Thomas
[dpdk-dev] [PATCH 0/7] Cisco Systems Inc. VIC Ethernet PMD - ENIC PMD
Thomas, This patch is based on 1.7.1. Thought that is the latest. And I got the diff from origin. What made you feel that the patch is from 1.7? Regards, -Sujith On 07/11/14 9:17 pm, "Thomas Monjalon" wrote: >Sujith, > >It seems that this PMD is based on DPDK 1.7. >Could you rebase it on HEAD? > >Thank you >-- >Thomas
[dpdk-dev] [PATCH 0/7] Cisco Systems Inc. VIC Ethernet PMD - ENIC PMD
Thomas, It is our pleasure to be part of the community and to be contributing to it. Looking forward to a healthy and fruitful association. Thanks and Regards, -Sujith On 07/11/14 4:39 pm, "Thomas Monjalon" wrote: >2014-11-08 01:35, Sujith Sankar: >> ENIC PMD is the poll-mode driver for the Cisco Systems Inc. VIC to be >> used with DPDK suite. > >Great to see you on board! > >Thank you to contribute a new driver. > >-- >Thomas
[dpdk-dev] [PATCH 3/7] ENIC PMD Makefile
Neil, If I move the DPDK patch that accommodates ENIC PMD (that is the one that patches lib/Makefile) to the last in the series, builds between commits would succeed, wouldn?t it? Moving that to the last is anyway needed. Thanks, -Sujith On 07/11/14 9:16 pm, "Sujith Sankar (ssujith)" wrote: >Hi Neil, > >Thanks for the comments. I shall work on the modifications that you have >suggested and get back with V2. > >Regards, >-Sujith > >On 07/11/14 5:04 pm, "Neil Horman" wrote: > >>On Sat, Nov 08, 2014 at 01:35:43AM +0530, Sujith Sankar wrote: >>> Signed-off-by: Sujith Sankar >>> --- >>> lib/librte_pmd_enic/Makefile | 66 >>> >>> 1 file changed, 66 insertions(+) >>> create mode 100644 lib/librte_pmd_enic/Makefile >>> >>> diff --git a/lib/librte_pmd_enic/Makefile >>>b/lib/librte_pmd_enic/Makefile >>> new file mode 100644 >>> index 000..7605a8f >>> --- /dev/null >>> +++ b/lib/librte_pmd_enic/Makefile >>> @@ -0,0 +1,66 @@ >>> +# BSD LICENSE >>> +# >>> +# Copyright(c) 2010-2013 Intel Corporation. All rights reserved. >>> +# 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 >>> +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR >>>TORT >>> +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE >>>USE >>> +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH >>>DAMAGE. >>> +# >>> + >>> +include $(RTE_SDK)/mk/rte.vars.mk >>> + >>> +# >>> +# library name >>> +# >>> +LIB = librte_pmd_enic.a >>> + >>> +CFLAGS += -I$(RTE_SDK)/lib/librte_hash/ >>> +CFLAGS += -O3 -Wno-deprecated >>> + >>> +VPATH += $(RTE_SDK)/lib/librte_pmd_enic/src >>> + >>> +# >>> +# all source are stored in SRCS-y >>> +# >>> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_main.c >>> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_clsf.c >>> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_cq.c >>> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_wq.c >>> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_dev.c >>> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_intr.c >>> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_rq.c >>> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_etherdev.c >>> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += enic_res.c >>> +SRCS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += vnic_rss.c >>> + >>> + >>> +# this lib depends upon: >>> +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_eal >>>lib/librte_ether >>> +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_mempool >>>lib/librte_mbuf >>> +DEPDIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += lib/librte_net >>>lib/librte_malloc >>> + >>> +include $(RTE_SDK)/mk/rte.lib.mk >>> + >>> -- >>> 1.9.1 >>> >>> >> >>Make this the last patch in your series, and merge it with the chunk from >>the >>last patch that adds the enic directory to the lib/Makefile, so that a >>bisect >>will build between these commits. >> >>Neil >> >
[dpdk-dev] [PATCH 0/7] Cisco Systems Inc. VIC Ethernet PMD - ENIC PMD
Thanks for the clear response. I?ll take a look at it. Regards, -Sujith On 10/11/14 3:33 pm, "Thomas Monjalon" wrote: >2014-11-10 09:27, Sujith Sankar: >> On 07/11/14 9:17 pm, "Thomas Monjalon" >>wrote: >> >It seems that this PMD is based on DPDK 1.7. >> >Could you rebase it on HEAD? >> >> This patch is based on 1.7.1. Thought that is the latest. And I got >>the >> diff from origin. >> What made you feel that the patch is from 1.7? > >By saying 1.7, I meant 1.7.0 or 1.7.1. >In current HEAD (future 1.8.0), there is a lot of changes which make your >PMD >incompatible. That's why the rule is to base the patches on the latest >HEAD. > >Thanks for your efforts. >-- >Thomas
[dpdk-dev] [PATCH 4/7] VNIC common code
Thomas, These are files common to all flavours (user-space as well as kernel mode) of VIC drivers. I shall add this info to the commit logs. Let me rework the directory structure too. Thanks, -Sujith On 07/11/14 9:21 pm, "Thomas Monjalon" wrote: >2014-11-08 01:35, Sujith Sankar: >> lib/librte_pmd_enic/src/cq_desc.h | 122 >> lib/librte_pmd_enic/src/cq_enet_desc.h | 257 >> lib/librte_pmd_enic/src/rq_enet_desc.h | 72 +++ >> lib/librte_pmd_enic/src/vnic_cq.c | 113 >> lib/librte_pmd_enic/src/vnic_cq.h | 148 + >> lib/librte_pmd_enic/src/vnic_dev.c | 1077 >>+++ >> lib/librte_pmd_enic/src/vnic_dev.h | 198 ++ >> lib/librte_pmd_enic/src/vnic_devcmd.h | 770 ++ >> lib/librte_pmd_enic/src/vnic_enet.h | 74 +++ >> lib/librte_pmd_enic/src/vnic_intr.c | 79 +++ >> lib/librte_pmd_enic/src/vnic_intr.h | 122 >> lib/librte_pmd_enic/src/vnic_nic.h | 84 +++ >> lib/librte_pmd_enic/src/vnic_resource.h | 93 +++ >> lib/librte_pmd_enic/src/vnic_rq.c | 242 +++ >> lib/librte_pmd_enic/src/vnic_rq.h | 278 >> lib/librte_pmd_enic/src/vnic_rss.c | 81 +++ >> lib/librte_pmd_enic/src/vnic_rss.h | 57 ++ >> lib/librte_pmd_enic/src/vnic_stats.h| 82 +++ >> lib/librte_pmd_enic/src/vnic_wq.c | 241 +++ >> lib/librte_pmd_enic/src/vnic_wq.h | 279 >> lib/librte_pmd_enic/src/wq_enet_desc.h | 110 >> 21 files changed, 4579 insertions(+) > >What is the status of these files? >Are they copied from somewhere? >Please explain in the commit log. > >Could you move them in a subdirectory vnic/ or base/? > >Please could you remove the src/ subdirectory level? > >Thanks >-- >Thomas
[dpdk-dev] A query on the latency numbers
Hi all, In the documentation available on DPDK, I could find the performance numbers in terms of packets per second. Could someone point me to some documentation which gives performance gain of round trip time or packet processing time in terms of time, say, usecs? Also, what is the tool that is widely used for performance benchmarking in the context of DPDK (with and without user-space TCP/IP stack)? Thanks, -Sujith
[dpdk-dev] TCP/IP stack - options
Hi all, I'm new to DPDK and this group. In order to try out some of my applications on DPDK, I'd like to know a little bit about the options that are there for protocol processing. Could someone give info about the TCP/IP stacks that could be used with DPDK libraries and applications? Quick googling gave a few names (6Wind, rump kernel tcp/ip stack, etc). But some wise words from the group could go a long way in helping me out. Thanks in advance ! -Sujith
[dpdk-dev] TCP/IP stack - options
Hi Vincent, Sincere thanks to you for the email ! This is very helpful. I think I'll go with Rump kernel stack to start with, and might think about the other options later. Regards, -Sujith On 17/09/13 2:01 AM, "Vincent JARDIN" wrote: >Hi Sujith, > >NetBSD/Rump is the only open source TCP/IP stack for DPDK. Some people >may have tried to port LwIP too. As far as we know, only 6WIND has a >robust and fully compliant stack which provides socket APIs to the >applications on top of the DPDK. I'd be pleased to get a list of options >for the DPDK too: > - Rump/NetBSD thanks to Antti > - maybe LwIP TBC > - 6WINDGate's fast path TCP/IP stack >and to list them on dpdk.org. > >My 2 cents, > Vincent > >> Hi all, >> >> I'm new to DPDK and this group. >> >> In order to try out some of my applications on DPDK, I'd like to know a >> little bit about the options that are there for protocol processing. >> Could someone give info about the TCP/IP stacks that could be used with >> DPDK libraries and applications? Quick googling gave a few names >>(6Wind, >> rump kernel tcp/ip stack, etc). But some wise words from the group >>could >> go a long way in helping me out. >> >> Thanks in advance ! >> -Sujith > >
[dpdk-dev] TCP/IP stack - options
Thank you Gil. -Sujith On 17/09/13 6:39 PM, "Gil Hellmann" wrote: >Hi Sujith, > >To add to the respond given by Mr. Jardin, Wind River also has commercial >grade protocol stack that could be used with DPDK libraries and >application, it is part of Wind Rivers' INP (Intelligent Networking >Platform). > >Regards, >Gil Hellmann
[dpdk-dev] TCP/IP stack - options
Thanks Keith ! Your inputs are really helpful. I'll keep the contacts handy. Regards, -Sujith On 18/09/13 4:45 AM, "Wiles, Roger Keith" wrote: >Hi Sujith, > >Wind River also has a fully integrated TCP/IP stack with network >acceleration using DPKD with INP/AAE product. A few have ported lwIP to >DPDK, but these stacks are not fully integrated into the whole system >meaning the Linux host (at least I do not know of anyone that does). > >Wind River's INP product is a complete TCP/IP stack with many more >features and protocols backed by the largest embedded development company >in the world. We also have a very close relationship with Intel (as we >are wholly owned subsidiary of Intel) > >We have a patent pending socket layer acceleration design and many more >features. > >Please contact >steve.konish at windriver.com<mailto:steve.konish at windriver.com> or >Paul.Senyshyn at windriver.com<mailto:Paul.Senyshyn at windriver.com> for more >details.Keith Wiles, Principal Technologist for Networking member of the >CTO office, Wind River >direct 972.434.4136 mobile 940.213.5533 fax 000.000. >[Powering 30 Years of >Innovation]<http://www.windriver.com/announces/wr30/> > >On Sep 17, 2013, at 12:36 AM, Sujith Sankar (ssujith) >mailto:ssujith at cisco.com>> wrote: > >Hi Vincent, > >Sincere thanks to you for the email ! This is very helpful. >I think I'll go with Rump kernel stack to start with, and might think >about the other options later. > >Regards, >-Sujith > >On 17/09/13 2:01 AM, "Vincent JARDIN" >mailto:vincent.jardin at 6wind.com>> wrote: > >Hi Sujith, > >NetBSD/Rump is the only open source TCP/IP stack for DPDK. Some people >may have tried to port LwIP too. As far as we know, only 6WIND has a >robust and fully compliant stack which provides socket APIs to the >applications on top of the DPDK. I'd be pleased to get a list of options >for the DPDK too: > - Rump/NetBSD thanks to Antti > - maybe LwIP TBC > - 6WINDGate's fast path TCP/IP stack >and to list them on dpdk.org<http://dpdk.org>. > >My 2 cents, > Vincent > >Hi all, > >I'm new to DPDK and this group. > >In order to try out some of my applications on DPDK, I'd like to know a >little bit about the options that are there for protocol processing. >Could someone give info about the TCP/IP stacks that could be used with >DPDK libraries and applications? Quick googling gave a few names >(6Wind, >rump kernel tcp/ip stack, etc). But some wise words from the group >could >go a long way in helping me out. > >Thanks in advance ! >-Sujith > > > >
[dpdk-dev] Query on the use of FDIR feature
Hi, Could someone kindly give information about the following aspects of the use of FDIR? It is about adding of flow classification rule using fdir_add_perfect_filter() 1. For SCTP, what are the mandatory fields to be provided in struct rte_fdir_filter ? Is it enough if protocol and src and dst IP addresses are provided? 2. If vlan id is specified in struct rte_fdir_filter, what other fields are mandatory? 3. In the case of IPV6, is it enough if protocol, src and dst IPV6 addresses and src and dst L4 port numbers are provided? 4. Is it mandatory that the applications have to provide protocol, src and dst IPV4 addresses and port numbers when it is trying to add filter for IPV4? The programmers guide does not clarify these, and hence the email to the group. Thanks in advance, -Sujith
[dpdk-dev] [PATCH] enicpd: Warnings and one error when built using clang compiler
On 01/12/14 4:27 pm, "Bruce Richardson" wrote: >On Sat, Nov 29, 2014 at 12:47:37PM +0530, Sujith Sankar wrote: >> This patch fixes the warnings and error reported by clang compiler on >>Linux. >> >> Reported-by: Bruce Richardson >> Signed-off-by: Sujith Sankar > >This PMD now compiles up with clang on FreeBSD. The patch seems rather >large though, >are all these changes necessary for clang compilation? Yes. This patch has only the changes to fix compilation on clang, and it modifies enic code only. > >On the basis that this fixes the issue though: > >Acked-by: Bruce Richardson Thanks Bruce. > >> --- >> lib/librte_pmd_enic/enic.h | 40 >>+ >> lib/librte_pmd_enic/enic_compat.h | 1 + >> lib/librte_pmd_enic/enic_main.c | 31 +++- >> lib/librte_pmd_enic/vnic/vnic_dev.c | 19 ++ >> lib/librte_pmd_enic/vnic/vnic_dev.h | 9 + >> 5 files changed, 78 insertions(+), 22 deletions(-) >> >> diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h >> index 6400d24..f128e64 100644 >> --- a/lib/librte_pmd_enic/enic.h >> +++ b/lib/librte_pmd_enic/enic.h >> @@ -154,4 +154,44 @@ static inline struct enic *pmd_priv(struct >>rte_eth_dev *eth_dev) >> return (struct enic *)eth_dev->data->dev_private; >> } >> >> +extern int enic_fdir_add_fltr(struct enic *enic, >> +struct rte_fdir_filter *params, u16 queue, u8 drop); >> +extern int enic_fdir_del_fltr(struct enic *enic, >> +struct rte_fdir_filter *params); >> +extern void enic_free_wq(void *txq); >> +extern int enic_alloc_intr_resources(struct enic *enic); >> +extern int enic_setup_finish(struct enic *enic); >> +extern int enic_alloc_wq(struct enic *enic, uint16_t queue_idx, >> +unsigned int socket_id, uint16_t nb_desc); >> +extern void enic_start_wq(struct enic *enic, uint16_t queue_idx); >> +extern int enic_stop_wq(struct enic *enic, uint16_t queue_idx); >> +extern void enic_start_rq(struct enic *enic, uint16_t queue_idx); >> +extern int enic_stop_rq(struct enic *enic, uint16_t queue_idx); >> +extern void enic_free_rq(void *rxq); >> +extern int enic_alloc_rq(struct enic *enic, uint16_t queue_idx, >> +unsigned int socket_id, struct rte_mempool *mp, >> +uint16_t nb_desc); >> +extern int enic_set_rss_nic_cfg(struct enic *enic); >> +extern int enic_set_vnic_res(struct enic *enic); >> +extern void enic_set_hdr_split_size(struct enic *enic, u16 >>split_hdr_size); >> +extern int enic_enable(struct enic *enic); >> +extern int enic_disable(struct enic *enic); >> +extern void enic_remove(struct enic *enic); >> +extern int enic_get_link_status(struct enic *enic); >> +extern void enic_dev_stats_get(struct enic *enic, >> +struct rte_eth_stats *r_stats); >> +extern void enic_dev_stats_clear(struct enic *enic); >> +extern void enic_add_packet_filter(struct enic *enic); >> +extern void enic_set_mac_address(struct enic *enic, uint8_t *mac_addr); >> +extern void enic_del_mac_address(struct enic *enic); >> +extern unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq >>*wq); >> +extern int enic_send_pkt(struct enic *enic, struct vnic_wq *wq, >> +struct rte_mbuf *tx_pkt, unsigned short len, >> +uint8_t sop, uint8_t eop, >> +uint16_t ol_flags, uint16_t vlan_tag); >> +extern int enic_poll(struct vnic_rq *rq, struct rte_mbuf **rx_pkts, >> +unsigned int budget, unsigned int *work_done); >> +extern int enic_probe(struct enic *enic); >> +extern int enic_clsf_init(struct enic *enic); >> +extern void enic_clsf_destroy(struct enic *enic); >> #endif /* _ENIC_H_ */ >> diff --git a/lib/librte_pmd_enic/enic_compat.h >>b/lib/librte_pmd_enic/enic_compat.h >> index b3738ee..b1af838 100644 >> --- a/lib/librte_pmd_enic/enic_compat.h >> +++ b/lib/librte_pmd_enic/enic_compat.h >> @@ -37,6 +37,7 @@ >> #define _ENIC_COMPAT_H_ >> >> #include >> +#include >> >> #include >> #include >> diff --git a/lib/librte_pmd_enic/enic_main.c >>b/lib/librte_pmd_enic/enic_main.c >> index 853dd04..4bbf1e4 100644 >> --- a/lib/librte_pmd_enic/enic_main.c >> +++ b/lib/librte_pmd_enic/enic_main.c >> @@ -65,17 +65,17 @@ static inline int enic_is_sriov_vf(struct enic >>*enic) >> return enic->pdev->id.device_id == PCI_DEVICE_ID_CISCO_VIC_ENET_VF; >> } >> >> -static int is_zero_addr(char *addr) >> +static int is_zero_addr(uint8_t *addr) >>
[dpdk-dev] [PATCH] enic: fix warnings
*enic) > { >- unsigned int i; > int err; > struct rte_eth_dev *eth_dev = enic->rte_dev; > >@@ -1189,10 +1161,7 @@ static int enic_dev_init(struct enic *enic) > > int enic_probe(struct enic *enic) > { >- const char *bdf = enic->bdf_name; > struct rte_pci_device *pdev = enic->pdev; >- struct rte_eth_dev *eth_dev = enic->rte_dev; >- unsigned int i; > int err = -1; > > dev_info(enic, " Initializing ENIC PMD version %s\n", DRV_VERSION); >diff --git a/lib/librte_pmd_enic/vnic/vnic_cq.h >b/lib/librte_pmd_enic/vnic/vnic_cq.h >index 9ed9b1d..0928d72 100644 >--- a/lib/librte_pmd_enic/vnic/vnic_cq.h >+++ b/lib/librte_pmd_enic/vnic/vnic_cq.h >@@ -103,7 +103,6 @@ static inline unsigned int vnic_cq_service(struct >vnic_cq *cq, > u8 type, color; > struct rte_mbuf **rx_pkts = opaque; > unsigned int ret; >- unsigned int split_hdr_size = vnic_get_hdr_split_size(cq->vdev); > > cq_desc = (struct cq_desc *)((u8 *)cq->ring.descs + > cq->ring.desc_size * cq->to_clean); >diff --git a/lib/librte_pmd_enic/vnic/vnic_dev.c >b/lib/librte_pmd_enic/vnic/vnic_dev.c >index 682c9c9..21d5521 100644 >--- a/lib/librte_pmd_enic/vnic/vnic_dev.c >+++ b/lib/librte_pmd_enic/vnic/vnic_dev.c >@@ -267,7 +267,8 @@ void vnic_dev_clear_desc_ring(struct vnic_dev_ring >*ring) > memset(ring->descs, 0, ring->size); > } > >-int vnic_dev_alloc_desc_ring(struct vnic_dev *vdev, struct vnic_dev_ring >*ring, >+int vnic_dev_alloc_desc_ring(__attribute__((unused)) struct vnic_dev >*vdev, >+ struct vnic_dev_ring *ring, > unsigned int desc_count, unsigned int desc_size, unsigned int socket_id, > char *z_name) > { >@@ -305,7 +306,8 @@ int vnic_dev_alloc_desc_ring(struct vnic_dev *vdev, >struct vnic_dev_ring *ring, > return 0; > } > >-void vnic_dev_free_desc_ring(struct vnic_dev *vdev, struct vnic_dev_ring >*ring) >+void vnic_dev_free_desc_ring(__attribute__((unused)) struct vnic_dev >*vdev, >+ struct vnic_dev_ring *ring) > { > if (ring->descs) > ring->descs = NULL; >@@ -761,7 +763,7 @@ int vnic_dev_notify_setcmd(struct vnic_dev *vdev, > > int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr) > { >- void *notify_addr; >+ void *notify_addr = NULL; > dma_addr_t notify_pa; > char name[NAME_MAX]; > static u32 instance; >@@ -973,20 +975,6 @@ struct rte_pci_device *vnic_dev_get_pdev(struct >vnic_dev *vdev) > return vdev->pdev; > } > >-static int vnic_dev_cmd_status(struct vnic_dev *vdev, enum >vnic_devcmd_cmd cmd, >- int *status) >-{ >- u64 a0 = cmd, a1 = 0; >- int wait = 1000; >- int ret; >- >- ret = vnic_dev_cmd(vdev, CMD_STATUS, &a0, &a1, wait); >- if (!ret) >- *status = (int)a0; >- >- return ret; >-} >- > int vnic_dev_set_mac_addr(struct vnic_dev *vdev, u8 *mac_addr) > { > u64 a0, a1; >diff --git a/lib/librte_pmd_enic/vnic/vnic_dev.h >b/lib/librte_pmd_enic/vnic/vnic_dev.h >index 8cc036b..d1373a5 100644 >--- a/lib/librte_pmd_enic/vnic/vnic_dev.h >+++ b/lib/librte_pmd_enic/vnic/vnic_dev.h >@@ -48,14 +48,14 @@ > #ifndef readq > static inline u64 readq(void __iomem *reg) > { >- return ((u64)readl(reg + 0x4UL) << 32) | >+ return ((u64)readl((char *)reg + 0x4UL) << 32) | > (u64)readl(reg); > } > > static inline void writeq(u64 val, void __iomem *reg) > { > writel(val & 0x, reg); >- writel(val >> 32, reg + 0x4UL); >+ writel(val >> 32, (char *)reg + 0x4UL); > } > #endif > >diff --git a/lib/librte_pmd_enic/vnic/vnic_intr.c >b/lib/librte_pmd_enic/vnic/vnic_intr.c >index 9be3744..84368af 100644 >--- a/lib/librte_pmd_enic/vnic/vnic_intr.c >+++ b/lib/librte_pmd_enic/vnic/vnic_intr.c >@@ -76,8 +76,3 @@ void vnic_intr_clean(struct vnic_intr *intr) > { > iowrite32(0, &intr->ctrl->int_credits); > } >- >-void vnic_intr_raise(struct vnic_intr *intr) >-{ >- vnic_dev_raise_intr(intr->vdev, (u16)intr->index); >-} >-- >2.1.3 Acked-by: Sujith Sankar >
[dpdk-dev] [PATCH] enic: fix warnings
On 03/12/14 8:35 pm, "Thomas Monjalon" wrote: >2014-12-03 14:52, Sujith Sankar: >> >> On 02/12/14 8:29 pm, "Thomas Monjalon" >>wrote: >> >> >A lot of warnings were not seen because $(WERROR_FLAGS) was not set >> >in the Makefile. But they appear with toolchains that enforce more >>checks. >> > >> >-Wno-deprecated seems useless. >> >-Wno-strict-aliasing is added to avoid false positives. >> > >> >This patch cleans up unused variable, unused functions, wrong types, >> >static declarations, etc. A lot of functions have unused parameters; >> >it suggests that more clean-up could be needed. >> >> I shall look at it when I pull these changes to my repo. >> What other toolchains did you check with? > >It's tested with many distributions, example CentOS 6. >But adding the warnings as in this patch should be enough to test with >any toolchain. Thanks Thomas. I shall look at the unused vars and get back with clean-up patch. Your patch looks good. And I did a quick sanity test on my server, which went through fine. -Sujith > >-- >Thomas
[dpdk-dev] [PATCH] enic: fix warnings
On 02/12/14 8:29 pm, "Thomas Monjalon" wrote: >A lot of warnings were not seen because $(WERROR_FLAGS) was not set >in the Makefile. But they appear with toolchains that enforce more checks. > >-Wno-deprecated seems useless. >-Wno-strict-aliasing is added to avoid false positives. > >This patch cleans up unused variable, unused functions, wrong types, >static declarations, etc. A lot of functions have unused parameters; >it suggests that more clean-up could be needed. > >Signed-off-by: Thomas Monjalon >--- > lib/librte_pmd_enic/Makefile | 3 +- > lib/librte_pmd_enic/enic.h | 4 +- > lib/librte_pmd_enic/enic_ethdev.c| 20 - Thomas, the name of this file got modified. It was enic_etherdev.c in my submission. Any idea how this happened? I do not remember seeing a request for this. Thanks, -Sujith > lib/librte_pmd_enic/enic_main.c | 81 >+++- > lib/librte_pmd_enic/vnic/vnic_cq.h | 1 - > lib/librte_pmd_enic/vnic/vnic_dev.c | 22 +++--- > lib/librte_pmd_enic/vnic/vnic_dev.h | 4 +- > lib/librte_pmd_enic/vnic/vnic_intr.c | 5 --- > 8 files changed, 46 insertions(+), 94 deletions(-) > >diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile >index 948ec96..a2a623f 100644 >--- a/lib/librte_pmd_enic/Makefile >+++ b/lib/librte_pmd_enic/Makefile >@@ -39,7 +39,8 @@ LIB = librte_pmd_enic.a > > CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/ > CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/ >-CFLAGS += -O3 -Wno-deprecated >+CFLAGS += -O3 >+CFLAGS += $(WERROR_FLAGS) -Wno-strict-aliasing > > VPATH += $(RTE_SDK)/lib/librte_pmd_enic/src > >diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h >index f128e64..c43417c 100644 >--- a/lib/librte_pmd_enic/enic.h >+++ b/lib/librte_pmd_enic/enic.h >@@ -134,7 +134,7 @@ struct enic { > unsigned int intr_count; > }; > >-static inline unsigned int enic_cq_rq(struct enic *enic, unsigned int rq) >+static inline unsigned int enic_cq_rq(__rte_unused struct enic *enic, >unsigned int rq) > { > return rq; > } >@@ -144,7 +144,7 @@ static inline unsigned int enic_cq_wq(struct enic >*enic, unsigned int wq) > return enic->rq_count + wq; > } > >-static inline unsigned int enic_msix_err_intr(struct enic *enic) >+static inline unsigned int enic_msix_err_intr(__rte_unused struct enic >*enic) > { > return 0; > } >diff --git a/lib/librte_pmd_enic/enic_ethdev.c >b/lib/librte_pmd_enic/enic_ethdev.c >index f582152..9cb 100644 >--- a/lib/librte_pmd_enic/enic_ethdev.c >+++ b/lib/librte_pmd_enic/enic_ethdev.c >@@ -67,7 +67,7 @@ RTE_PCI_DEV_ID_DECL_ENIC(PCI_VENDOR_ID_CISCO, >PCI_DEVICE_ID_CISCO_VIC_ENET_VF) > > static int enicpmd_fdir_remove_perfect_filter(struct rte_eth_dev >*eth_dev, > struct rte_fdir_filter *fdir_filter, >- uint16_t soft_id) >+ __rte_unused uint16_t soft_id) > { > struct enic *enic = pmd_priv(eth_dev); > >@@ -76,7 +76,7 @@ static int enicpmd_fdir_remove_perfect_filter(struct >rte_eth_dev *eth_dev, > } > > static int enicpmd_fdir_add_perfect_filter(struct rte_eth_dev *eth_dev, >- struct rte_fdir_filter *fdir_filter, uint16_t soft_id, >+ struct rte_fdir_filter *fdir_filter, __rte_unused uint16_t soft_id, > uint8_t queue, uint8_t drop) > { > struct enic *enic = pmd_priv(eth_dev); >@@ -103,7 +103,7 @@ static void enicpmd_dev_tx_queue_release(void *txq) > static int enicpmd_dev_setup_intr(struct enic *enic) > { > int ret; >- int index; >+ unsigned int index; > > ENICPMD_FUNC_TRACE(); > >@@ -134,7 +134,7 @@ static int enicpmd_dev_tx_queue_setup(struct >rte_eth_dev *eth_dev, > uint16_t queue_idx, > uint16_t nb_desc, > unsigned int socket_id, >- const struct rte_eth_txconf *tx_conf) >+ __rte_unused const struct rte_eth_txconf *tx_conf) > { > int ret; > struct enic *enic = pmd_priv(eth_dev); >@@ -215,7 +215,7 @@ static int enicpmd_dev_rx_queue_setup(struct >rte_eth_dev *eth_dev, > uint16_t queue_idx, > uint16_t nb_desc, > unsigned int socket_id, >- const struct rte_eth_rxconf *rx_conf, >+ __rte_unused const struct rte_eth_rxconf *rx_conf, > struct rte_mempool *mp) > { > int ret; >@@ -334,7 +334,7 @@ static void enicpmd_dev_close(struct rte_eth_dev >*eth_dev) > } > > static int enicpmd_dev_link_update(struct rte_eth_dev *eth_dev, >- int wait_to_complete) >+ __rte_unused int wait_to_complete) > { > struct enic *enic = pmd_priv(eth_dev); > int ret; >@@ -428,7 +428,7 @@ static void enicpmd_dev_allmulticast_disable(struct >rte_eth_dev *eth_dev) > > static void enicpmd_add_mac_addr(struct rte_eth_dev *eth_dev, > struct ether_addr *mac_addr, >- uint32_t index, uint32_t pool) >+ __rte_unused uint32_t index, __rte_unused uint32_t pool) > { > struct enic *enic = pmd_priv(eth_dev); > >@@ -436,7 +436,7 @@ static void enicpmd_add_mac_addr(struct rte_et
[dpdk-dev] [PATCH] enic: fix warnings
On 04/12/14 4:18 pm, "Thomas Monjalon" wrote: >2014-12-04 10:29, Sujith Sankar: >> >> On 02/12/14 8:29 pm, "Thomas Monjalon" >>wrote: >> >> >A lot of warnings were not seen because $(WERROR_FLAGS) was not set >> >in the Makefile. But they appear with toolchains that enforce more >>checks. >> > >> >-Wno-deprecated seems useless. >> >-Wno-strict-aliasing is added to avoid false positives. >> > >> >This patch cleans up unused variable, unused functions, wrong types, >> >static declarations, etc. A lot of functions have unused parameters; >> >it suggests that more clean-up could be needed. >> > >> >Signed-off-by: Thomas Monjalon >> >--- >> > lib/librte_pmd_enic/Makefile | 3 +- >> > lib/librte_pmd_enic/enic.h | 4 +- >> > lib/librte_pmd_enic/enic_ethdev.c| 20 - >> >> Thomas, the name of this file got modified. It was enic_etherdev.c in >>my >> submission. >> Any idea how this happened? I do not remember seeing a request for >>this. > >Yes, sorry I forgot to request it. >I renamed the file to be consistent with other drivers. >Everywhere in DPDK we talk about ethdev for device operations, not >etherdev. Ok. Thank you. > >-- >Thomas
[dpdk-dev] [PATCH 0/2] enic fixes for clang compilation
On 05/12/14 9:27 pm, "Bruce Richardson" wrote: >Compiling latest DPDK with clang 3.3 on FreeBSD 10 shows up a number of >compilation >errors in the enic driver. These two small patches fix those errors. > >Bruce Richardson (2): > enic: fix initialization error with clang > enic: fix error with uninitialized variable. Sorry for the delay. Was away for a couple of days. Looks good. Thanks ! > > lib/librte_pmd_enic/enic_clsf.c | 2 +- > lib/librte_pmd_enic/vnic/vnic_dev.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >-- >2.1.0 >
[dpdk-dev] [PATCH] enic: corrected the usage of VFIO_PRESENT
On 16/12/14 4:54 am, "Thomas Monjalon" wrote: >2014-12-12 13:48, Sujith Sankar: >> This patch corrects the usage of the flag VFIO_PRESENT in enic driver. > >Please, could you explain why the flag VFIO_PRESENT was not well used? Without including eal_vfio.h, VFIO_PRESENT is not available in enic. Hence VFIO specific code in enic was not getting compiled and some errors were generated during run-time. > >> This has uncovered a few warnings, and this patch corrects those too. >[...] >> --- a/lib/librte_pmd_enic/enic_main.c >> +++ b/lib/librte_pmd_enic/enic_main.c >> @@ -39,6 +39,7 @@ >> #include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -46,6 +47,7 @@ >> #include >> #include >> #include >> +#include > >This header was not designed to be included by PMDs. >It will break compilation on BSD. Is there an alternative to make VFIO_PRESENT available in enic? Please advise. Thanks, -Sujith > >> #include "enic_compat.h" >> #include "enic.h" >> @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct >>rte_pci_device *hwdev, >> /* Nothing to be done */ >> } >> >> +#ifndef VFIO_PRESENT >> static void >> enic_intr_handler(__rte_unused struct rte_intr_handle *handle, >> void *arg) >> @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct >>rte_intr_handle *handle, >> >> enic_log_q_error(enic); >> } >> +#endif > >-- >Thomas
[dpdk-dev] [PATCH] enic: corrected the usage of VFIO_PRESENT
On 16/12/14 1:21 pm, "Qiu, Michael" wrote: >On 12/16/2014 12:13 PM, Sujith Sankar (ssujith) wrote: >> On 16/12/14 4:54 am, "Thomas Monjalon" >>wrote: >> >>> 2014-12-12 13:48, Sujith Sankar: >>>> This patch corrects the usage of the flag VFIO_PRESENT in enic driver. >>> Please, could you explain why the flag VFIO_PRESENT was not well used? >> Without including eal_vfio.h, VFIO_PRESENT is not available in enic. >> Hence VFIO specific code in enic was not getting compiled and some >>errors >> were generated during run-time. >> >>>> This has uncovered a few warnings, and this patch corrects those too. >>> [...] >>>> --- a/lib/librte_pmd_enic/enic_main.c >>>> +++ b/lib/librte_pmd_enic/enic_main.c >>>> @@ -39,6 +39,7 @@ >>>> #include >>>> #include >>>> #include >>>> +#include >>>> >>>> #include >>>> #include >>>> @@ -46,6 +47,7 @@ >>>> #include >>>> #include >>>> #include >>>> +#include >>> This header was not designed to be included by PMDs. >>> It will break compilation on BSD. >> Is there an alternative to make VFIO_PRESENT available in enic? Please >> advise. > >You can remove VFIO_PRESENT check, it all been done in eal, you can >check other nic pmds for reference. >And seems you done the interrupt logic all by your self? > >Thanks, >Michael Thanks for the comment, Michael. Without the code under VFIO_PRESENT flag, I was getting false notification of interrupt at the beginning (cat /proc/interrupts showed all 0s). Let me try to root cause it. I shall get back after some debugging and testing. There was one more reason behind doing interrupt logic in enic. No matter how many interrupts the user configures, enic pmd needs only one. There is no way to communicate that to the EAL. I thought doing interrupt login in enic could avoid registering that many interrupts. Thanks, -Sujith >> >> Thanks, >> -Sujith >> >>>> #include "enic_compat.h" >>>> #include "enic.h" >>>> @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct >>>> rte_pci_device *hwdev, >>>>/* Nothing to be done */ >>>> } >>>> >>>> +#ifndef VFIO_PRESENT >>>> static void >>>> enic_intr_handler(__rte_unused struct rte_intr_handle *handle, >>>>void *arg) >>>> @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct >>>> rte_intr_handle *handle, >>>> >>>>enic_log_q_error(enic); >>>> } >>>> +#endif >>> -- >>> Thomas >> >
[dpdk-dev] [PATCH] enic: corrected the usage of VFIO_PRESENT
On 16/12/14 3:52 pm, "Burakov, Anatoly" wrote: >> On 16/12/14 4:54 am, "Thomas Monjalon" >> wrote: >> >> >2014-12-12 13:48, Sujith Sankar: >> >> This patch corrects the usage of the flag VFIO_PRESENT in enic >>driver. >> > >> >Please, could you explain why the flag VFIO_PRESENT was not well used? >> >> Without including eal_vfio.h, VFIO_PRESENT is not available in enic. >> Hence VFIO specific code in enic was not getting compiled and some >>errors >> were generated during run-time. >> >> > >> >> This has uncovered a few warnings, and this patch corrects those too. >> >[...] >> >> --- a/lib/librte_pmd_enic/enic_main.c >> >> +++ b/lib/librte_pmd_enic/enic_main.c >> >> @@ -39,6 +39,7 @@ >> >> #include >> >> #include >> >> #include >> >> +#include >> >> >> >> #include >> >> #include >> >> @@ -46,6 +47,7 @@ >> >> #include >> >> #include >> >> #include >> >> +#include >> > >> >This header was not designed to be included by PMDs. >> >It will break compilation on BSD. >> >> Is there an alternative to make VFIO_PRESENT available in enic? Please >> advise. >> >> Thanks, >> -Sujith >> >> > >> >> #include "enic_compat.h" >> >> #include "enic.h" >> >> @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct >> >>rte_pci_device *hwdev, >> >> /* Nothing to be done */ >> >> } >> >> >> >> +#ifndef VFIO_PRESENT >> >> static void >> >> enic_intr_handler(__rte_unused struct rte_intr_handle *handle, >> >> void *arg) >> >> @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct >> >>rte_intr_handle *handle, >> >> >> >> enic_log_q_error(enic); >> >> } >> >> +#endif >> > >> >-- >> >Thomas > >Hi Sujith > >Thomas is correct, VFIO code is designed to be EAL-only (mainly because >it's Linuxapp-specific, and PMD's are intended to be cross-platform at >least when it comes to compilation). Whatever it is that you're working >around is better fixed in the EAL itself rather than in the PMD. I agree with you and Thomas. Let me find the root cause for the false trigger. Thanks, -Sujith > >Thanks, >Anatoly
[dpdk-dev] [PATCH] enic: corrected the usage of VFIO_PRESENT
On 16/12/14 4:06 pm, "Burakov, Anatoly" wrote: >> -Original Message- >> From: Sujith Sankar (ssujith) [mailto:ssujith at cisco.com] >> Sent: Tuesday, December 16, 2014 10:34 AM >> To: Burakov, Anatoly; Thomas Monjalon >> Cc: dev at dpdk.org >> Subject: Re: [dpdk-dev] [PATCH] enic: corrected the usage of >>VFIO_PRESENT >> >> >> >> On 16/12/14 3:52 pm, "Burakov, Anatoly" >> wrote: >> >> >> On 16/12/14 4:54 am, "Thomas Monjalon" >> >> >> wrote: >> >> >> >> >2014-12-12 13:48, Sujith Sankar: >> >> >> This patch corrects the usage of the flag VFIO_PRESENT in enic >> >>driver. >> >> > >> >> >Please, could you explain why the flag VFIO_PRESENT was not well >> used? >> >> >> >> Without including eal_vfio.h, VFIO_PRESENT is not available in enic. >> >> Hence VFIO specific code in enic was not getting compiled and some >> >>errors were generated during run-time. >> >> >> >> > >> >> >> This has uncovered a few warnings, and this patch corrects those >>too. >> >> >[...] >> >> >> --- a/lib/librte_pmd_enic/enic_main.c >> >> >> +++ b/lib/librte_pmd_enic/enic_main.c >> >> >> @@ -39,6 +39,7 @@ >> >> >> #include >> >> >> #include >> >> >> #include >> >> >> +#include >> >> >> >> >> >> #include >> >> >> #include >> >> >> @@ -46,6 +47,7 @@ >> >> >> #include >> >> >> #include >> >> >> #include >> >> >> +#include >> >> > >> >> >This header was not designed to be included by PMDs. >> >> >It will break compilation on BSD. >> >> >> >> Is there an alternative to make VFIO_PRESENT available in enic? >> >> Please advise. >> >> >> >> Thanks, >> >> -Sujith >> >> >> >> > >> >> >> #include "enic_compat.h" >> >> >> #include "enic.h" >> >> >> @@ -561,6 +563,7 @@ enic_free_consistent(__rte_unused struct >> >> >>rte_pci_device *hwdev, >> >> >>/* Nothing to be done */ >> >> >> } >> >> >> >> >> >> +#ifndef VFIO_PRESENT >> >> >> static void >> >> >> enic_intr_handler(__rte_unused struct rte_intr_handle *handle, >> >> >>void *arg) >> >> >> @@ -572,6 +575,7 @@ enic_intr_handler(__rte_unused struct >> >> >>rte_intr_handle *handle, >> >> >> >> >> >>enic_log_q_error(enic); >> >> >> } >> >> >> +#endif >> >> > >> >> >-- >> >> >Thomas >> > >> >Hi Sujith >> > >> >Thomas is correct, VFIO code is designed to be EAL-only (mainly because >> >it's Linuxapp-specific, and PMD's are intended to be cross-platform at >> >least when it comes to compilation). Whatever it is that you're working >> >around is better fixed in the EAL itself rather than in the PMD. >> >> I agree with you and Thomas. Let me find the root cause for the false >>trigger. >> >> Thanks, >> -Sujith >> > >You may find it in EAL VFIO interrupts code. When VFIO enables some >interrupt types, it manually sends a trigger. Normally, this "trigger" >just enables interrupts, but maybe for ENIC it's different. I therefore >suggest you to look there first. Ok. Thanks for the info, Anatoly. ENIC does not need that trigger. Let me take a look at that first. Thanks, -Sujith > >Thanks, >Anatoly
[dpdk-dev] [PATCH v6 5/6] enicpmd: DPDK-ENIC PMD interface
On 29/12/14 1:45 pm, "Wu, Jingjing" wrote: >Hi, ssujith > >> +.tx_queue_release = enicpmd_dev_tx_queue_release, >> +.dev_led_on = NULL, >> +.dev_led_off = NULL, >> +.flow_ctrl_get= NULL, >> +.flow_ctrl_set= NULL, >> +.priority_flow_ctrl_set = NULL, >> +.mac_addr_add = enicpmd_add_mac_addr, >> +.mac_addr_remove = enicpmd_remove_mac_addr, >> +.fdir_add_signature_filter= NULL, >> +.fdir_update_signature_filter = NULL, >> +.fdir_remove_signature_filter = NULL, >> +.fdir_infos_get = enicpmd_fdir_info_get, >> +.fdir_add_perfect_filter = enicpmd_fdir_add_perfect_filter, >> +.fdir_update_perfect_filter = enicpmd_fdir_add_perfect_filter, >> +.fdir_remove_perfect_filter = enicpmd_fdir_remove_perfect_filter, >> +.fdir_set_masks = NULL, >> +}; >> + > >I found that in perfect fdir is also supported in enic driver. > >During the R1.8 development, we defined a new dev_ops call filter_ctrl, >which can be used to control kinds of filters, flow director is included >too. Which is mentioned in >http://www.dpdk.org/ml/archives/dev/2014-September/005179.html . >In R1.8, filter_ctrl is only used by i40e driver. And we also planned use >it in the existing ixgbe/e1000 driver in the next days. The old APIs such >as fdir_add_perfect_filter, fdir_remove_perfect_filter can be replaced >then. Hi Jingjing, Thanks for the info and the link. I shall take a look at it. It looks like bringing in one interface for all filter related operations. I believe ENIC should also move to it. Thanks, -Sujith > >So, do you have any plan to migrate the fdir in enic to the filter_ctrl >API? > >Jingjing > >Thanks! > >> +struct enic *enicpmd_list_head = NULL; >> +/* Initialize the driver >> + * It returns 0 on success. >> + */ >> +static int eth_enicpmd_dev_init( >> +__attribute__((unused))struct eth_driver *eth_drv, >> +struct rte_eth_dev *eth_dev) >> +{ >> +struct rte_pci_device *pdev; >> +struct rte_pci_addr *addr; >> +struct enic *enic = pmd_priv(eth_dev); >> + >> +ENICPMD_FUNC_TRACE(); >> + >> +enic->rte_dev = eth_dev; >> +eth_dev->dev_ops = &enicpmd_eth_dev_ops; >> +eth_dev->rx_pkt_burst = &enicpmd_recv_pkts; >> +eth_dev->tx_pkt_burst = &enicpmd_xmit_pkts; >> + >> +pdev = eth_dev->pci_dev; >> +enic->pdev = pdev; >> +addr = &pdev->addr; >> + >> +snprintf(enic->bdf_name, ENICPMD_BDF_LENGTH, >> "%04x:%02x:%02x.%x", >> +addr->domain, addr->bus, addr->devid, addr->function); >> + >> +return enic_probe(enic); >> +} >> + >> +static struct eth_driver rte_enic_pmd = { >> +{ >> +.name = "rte_enic_pmd", >> +.id_table = pci_id_enic_map, >> +.drv_flags = RTE_PCI_DRV_NEED_MAPPING, >> +}, >> +.eth_dev_init = eth_enicpmd_dev_init, >> +.dev_private_size = sizeof(struct enic), }; >> + >> +/* Driver initialization routine. >> + * Invoked once at EAL init time. >> + * Register as the [Poll Mode] Driver of Cisco ENIC device. >> + */ >> +int rte_enic_pmd_init(const char *name __rte_unused, >> +const char *params __rte_unused) >> +{ >> +ENICPMD_FUNC_TRACE(); >> + >> +rte_eth_driver_register(&rte_enic_pmd); >> +return 0; >> +} >> + >> +static struct rte_driver rte_enic_driver = { >> +.type = PMD_PDEV, >> +.init = rte_enic_pmd_init, >> +}; >> + >> +PMD_REGISTER_DRIVER(rte_enic_driver); >> + >> -- >> 1.9.1 >
[dpdk-dev] PMD for Cisco VIC Ethernet NIC - Request for guidelines for submission
Hi Hobywan, Thanks for the email ! We?ve been working on performance benchmarking. Also, we felt that it would be better to push the driver after Anatoly?s patch (vfio-pci) got in so that we could make the necessary modification before submission. Now that 1.7.0 is out, we are hopeful of submitting the patch soon. Thanks, -Sujith From: Hobywan Kenoby mailto:hobyw...@hotmail.com>> Date: Thursday, 10 July 2014 1:37 am To: "Sujith Sankar (ssujith)" mailto:ssujith at cisco.com>>, "dev at dpdk.org<mailto:dev at dpdk.org>" mailto:dev at dpdk.org>> Subject: RE: [dpdk-dev] PMD for Cisco VIC Ethernet NIC - Request for guidelines for submission Hi Sujith, It was exciting to see open source code coming from Cisco ensuring a DPDK application can run on any platform and with any card I haven't seen your patch yet. What happened? HK > Date : Wed, 28 May 2014 08:06 > From : dev [mailto:dev-bounces at dpdk.org] > To : dev at dpdk.org<mailto:dev at dpdk.org> > Subject : [dpdk-dev] PMD for Cisco VIC Ethernet NIC - Request for guidelines > for submission > > > Hi all, > > We have been working on development of poll-mode driver for Cisco VIC > Ethernet NIC and integration of it with DPDK. We would like to submit this > poll-mode driver (ENIC PMD) to the DPDK community so that it could be part > of the DPDK tree. > > Could someone please provide the guidelines and steps to do this? As of > now, ENIC PMD is being tested with DPDK 1.6.0r2. Is it alright to submit a > patch for DPDK 1.6.0r2? > > One aspect of ENIC PMD is that it works with VFIO-PCI and not UIO. Hope > this is acceptable. The following thread in dpdk-dev influenced this > decision. > http://dpdk.org/ml/archives/dev/2013-July/000373.html > > ENIC PMD uses one interrupt per interface and it is used by the NIC for > signalling the driver in case of any error. Since this does not come in > the fast path, it should be acceptable, isn?t it? > > Please give your suggestions and comments. > > Thanks, > -Sujith
[dpdk-dev] PMD for Cisco VIC Ethernet NIC - Request for guidelines for submission
Hi Hobywan, We?re still working on benchmarking, and would share the numbers once we are done with it. Could you please elaborate on vectorisation functions? Thanks, -Sujith From: Hobywan Kenoby mailto:hobyw...@hotmail.com>> Date: Friday, 11 July 2014 6:46 pm To: "Sujith Sankar (ssujith)" mailto:ssujith at cisco.com>>, "dev at dpdk.org<mailto:dev at dpdk.org>" mailto:dev at dpdk.org>> Subject: RE: [dpdk-dev] PMD for Cisco VIC Ethernet NIC - Request for guidelines for submission Hi Sujith, It makes sens, using VFIO makes a far cleaner implementation. You worked on the performance, could you share some measurements ? Did you introduce vectorization functions as Intel did a while ago? There are allways tradeoffs between pps and latency, do you include documentation to configure the card for one or the other? HK From: ssujith at cisco.com<mailto:ssuj...@cisco.com> To: hobywank at hotmail.com<mailto:hobywank at hotmail.com>; dev at dpdk.org<mailto:dev at dpdk.org> Subject: Re: [dpdk-dev] PMD for Cisco VIC Ethernet NIC - Request for guidelines for submission Date: Fri, 11 Jul 2014 07:46:08 + Hi Hobywan, Thanks for the email ! We?ve been working on performance benchmarking. Also, we felt that it would be better to push the driver after Anatoly?s patch (vfio-pci) got in so that we could make the necessary modification before submission. Now that 1.7.0 is out, we are hopeful of submitting the patch soon. Thanks, -Sujith From: Hobywan Kenoby mailto:hobyw...@hotmail.com>> Date: Thursday, 10 July 2014 1:37 am To: "Sujith Sankar (ssujith)" mailto:ssujith at cisco.com>>, "dev at dpdk.org<mailto:dev at dpdk.org>" mailto:dev at dpdk.org>> Subject: RE: [dpdk-dev] PMD for Cisco VIC Ethernet NIC - Request for guidelines for submission Hi Sujith, It was exciting to see open source code coming from Cisco ensuring a DPDK application can run on any platform and with any card I haven't seen your patch yet. What happened? HK > Date : Wed, 28 May 2014 08:06 > From : dev [mailto:dev-bounces at dpdk.org] > To : dev at dpdk.org<mailto:dev at dpdk.org> > Subject : [dpdk-dev] PMD for Cisco VIC Ethernet NIC - Request for guidelines > for submission > > > Hi all, > > We have been working on development of poll-mode driver for Cisco VIC > Ethernet NIC and integration of it with DPDK. We would like to submit this > poll-mode driver (ENIC PMD) to the DPDK community so that it could be part > of the DPDK tree. > > Could someone please provide the guidelines and steps to do this? As of > now, ENIC PMD is being tested with DPDK 1.6.0r2. Is it alright to submit a > patch for DPDK 1.6.0r2? > > One aspect of ENIC PMD is that it works with VFIO-PCI and not UIO. Hope > this is acceptable. The following thread in dpdk-dev influenced this > decision. > http://dpdk.org/ml/archives/dev/2013-July/000373.html > > ENIC PMD uses one interrupt per interface and it is used by the NIC for > signalling the driver in case of any error. Since this does not come in > the fast path, it should be acceptable, isn?t it? > > Please give your suggestions and comments. > > Thanks, > -Sujith
[dpdk-dev] [PATCH 1/2] enic: silence log message
On 19/05/15 3:38 pm, "Bruce Richardson" wrote: >On Wed, Apr 08, 2015 at 10:37:49AM -0700, Stephen Hemminger wrote: >> From: Stephen Hemminger >> >> Silence is normal. drivers should speak only when spoken to and not >> be chatty. >> >> Signed-off-by: Stephen Hemminger > >Acked-by: Bruce Richardson > >> --- >> lib/librte_pmd_enic/enic_main.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/lib/librte_pmd_enic/enic_main.c >>b/lib/librte_pmd_enic/enic_main.c >> index 0892b3e..508621e 100644 >> --- a/lib/librte_pmd_enic/enic_main.c >> +++ b/lib/librte_pmd_enic/enic_main.c >> @@ -1048,8 +1048,6 @@ int enic_probe(struct enic *enic) >> struct rte_pci_device *pdev = enic->pdev; >> int err = -1; >> >> -dev_debug(enic, " Initializing ENIC PMD version %s\n", DRV_VERSION); >> - It would be good to retain this under RTE_LIBRTE_ENIC_DEBUG. >> enic->bar0.vaddr = (void *)pdev->mem_resource[0].addr; >> enic->bar0.len = pdev->mem_resource[0].len; >> >> -- >> 2.1.4 >>
[dpdk-dev] [PATCH v2 06/19] enic: move enic PMD to drivers/net directory
On 20/05/15 9:44 pm, "Thomas Monjalon" wrote: >2015-05-20 16:04, Richardson, Bruce: >> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com] >> > 2015-05-15 16:56, Bruce Richardson: >> > > move enic PMD to drivers/net directory >> > > >> > > Signed-off-by: Bruce Richardson >> > > --- >> > > drivers/net/Makefile |2 +- >> > > drivers/net/enic/LICENSE | 27 + >> > > drivers/net/enic/Makefile| 71 ++ >> > > drivers/net/enic/enic.h | 200 + >> > > drivers/net/enic/enic_clsf.c | 259 ++ >> > > drivers/net/enic/enic_compat.h | 147 >> > > drivers/net/enic/enic_ethdev.c | 640 +++ >> > > drivers/net/enic/enic_main.c | 1117 >> > ++ >> > > drivers/net/enic/enic_res.c | 219 + >> > > drivers/net/enic/enic_res.h | 168 >> > > drivers/net/enic/rte_pmd_enic_version.map|4 + >> > > drivers/net/enic/vnic/cq_desc.h | 126 +++ >> > > drivers/net/enic/vnic/cq_enet_desc.h | 261 ++ >> > > drivers/net/enic/vnic/rq_enet_desc.h | 76 ++ >> > > drivers/net/enic/vnic/vnic_cq.c | 117 +++ >> > > drivers/net/enic/vnic/vnic_cq.h | 151 >> > > drivers/net/enic/vnic/vnic_dev.c | 1054 >> > >> > > drivers/net/enic/vnic/vnic_dev.h | 212 + >> > > drivers/net/enic/vnic/vnic_devcmd.h | 774 >>++ >> > > drivers/net/enic/vnic/vnic_enet.h| 78 ++ >> > > drivers/net/enic/vnic/vnic_intr.c| 78 ++ >> > > drivers/net/enic/vnic/vnic_intr.h| 126 +++ >> > > drivers/net/enic/vnic/vnic_nic.h | 88 ++ >> > > drivers/net/enic/vnic/vnic_resource.h| 97 +++ >> > > drivers/net/enic/vnic/vnic_rq.c | 245 ++ >> > > drivers/net/enic/vnic/vnic_rq.h | 282 +++ >> > > drivers/net/enic/vnic/vnic_rss.c | 85 ++ >> > > drivers/net/enic/vnic/vnic_rss.h | 61 ++ >> > > drivers/net/enic/vnic/vnic_stats.h | 86 ++ >> > > drivers/net/enic/vnic/vnic_wq.c | 245 ++ >> > > drivers/net/enic/vnic/vnic_wq.h | 283 +++ >> > > drivers/net/enic/vnic/wq_enet_desc.h | 114 +++ >> > >> > I think that vnic/ should be renamed to base/ >> >> Yes, I was wondering about that. However, this wasn't a driver I was >>familiar with and its origins, so I left it as-is. > >Sujith imported it with this message: >"VNIC common code partially shared with ENIC kernel mode driver" >http://dpdk.org/ml/archives/dev/2014-November/008716.html Please go ahead with the renaming. Is this just for uniformity? Is there any other reason? Thanks, -Sujith >
[dpdk-dev] [PATCH 1/2] enic: silence log message
Stephen, The enic debug flag is off by default. So it is going to print the version only if the user wants it to. Isn?t that fine? Thanks, -Sujith From: Stephen Hemminger Date: Wednesday, 20 May 2015 11:17 pm To: "Sujith Sankar (ssujith)" Cc: Bruce Richardson , "dev at dpdk.org" , Stephen Hemminger Subject: Re: [dpdk-dev] [PATCH 1/2] enic: silence log message Other drivers are quiet, why does this one need to be noisy On Wed, May 20, 2015 at 9:30 AM, Sujith Sankar (ssujith) wrote: On 19/05/15 3:38 pm, "Bruce Richardson" wrote: >On Wed, Apr 08, 2015 at 10:37:49AM -0700, Stephen Hemminger wrote: >> From: Stephen Hemminger >> >> Silence is normal. drivers should speak only when spoken to and not >> be chatty. >> >> Signed-off-by: Stephen Hemminger > >Acked-by: Bruce Richardson > >> --- >> lib/librte_pmd_enic/enic_main.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/lib/librte_pmd_enic/enic_main.c >>b/lib/librte_pmd_enic/enic_main.c >> index 0892b3e..508621e 100644 >> --- a/lib/librte_pmd_enic/enic_main.c >> +++ b/lib/librte_pmd_enic/enic_main.c >> @@ -1048,8 +1048,6 @@ int enic_probe(struct enic *enic) >> struct rte_pci_device *pdev = enic->pdev; >> int err = -1; >> >> -dev_debug(enic, " Initializing ENIC PMD version %s\n", >>DRV_VERSION); >> - It would be good to retain this under RTE_LIBRTE_ENIC_DEBUG. >> enic->bar0.vaddr = (void *)pdev->mem_resource[0].addr; >> enic->bar0.len = pdev->mem_resource[0].len; >> >> -- >> 2.1.4 >>
[dpdk-dev] [PATCH 00/16] [RFC] [VFIO] Add VFIO support to DPDK
Hi Anatoly, Has anything happened in this front? Do you see running of DPDK in guest OS on KVM with physical NIC passed through to it happening soon? Thanks, -Sujith On 02/05/14 2:28 pm, "Burakov, Anatoly" wrote: >Hi Stephen, > >> Will this work in guest? or only on bare metal? > >VFIO is Linux-only, and in theory will be able to work on the guest, but >not at the moment, since it requires IOMMU. There was a GSoC proposal for >KVM to do IOMMU implementation, and there were a few AMD IOMMU-emulation >patches floating around the KVM lists for some time, but nothing has made >it into release yet. > >Best regards, >Anatoly Burakov >DPDK SW Engineer > >-- >Intel Shannon Limited >Registered in Ireland >Registered Office: Collinstown Industrial Park, Leixlip, County Kildare >Registered Number: 308263 >Business address: Dromore House, East Park, Shannon, Co. Clare > > >
[dpdk-dev] [PATCH 00/16] [RFC] [VFIO] Add VFIO support to DPDK
Anatoly, Thanks for the quick response ! I am able do PCI passthrough and use the NIC in the guest OS. What I?m trying to do is run DPDK in the guest and make use of the passed-through NIC. Without using VFIO, could I achieve this? Thanks, -Sujith On 08/09/14 1:51 pm, "Burakov, Anatoly" wrote: >Hi Sujith > >Not that I know of, no. There are other ways to run physical NICs in a VM >though, you don't require VFIO for that. > >Thanks, >Anatoly > >-Original Message- >From: Sujith Sankar (ssujith) [mailto:ssujith at cisco.com] >Sent: Monday, September 8, 2014 9:20 AM >To: Burakov, Anatoly; Stephen Hemminger >Cc: dev at dpdk.org >Subject: Re: [dpdk-dev] [PATCH 00/16] [RFC] [VFIO] Add VFIO support to >DPDK > >Hi Anatoly, > >Has anything happened in this front? Do you see running of DPDK in guest >OS on KVM with physical NIC passed through to it happening soon? > >Thanks, >-Sujith > >On 02/05/14 2:28 pm, "Burakov, Anatoly" wrote: > >>Hi Stephen, >> >>> Will this work in guest? or only on bare metal? >> >>VFIO is Linux-only, and in theory will be able to work on the guest, >>but not at the moment, since it requires IOMMU. There was a GSoC >>proposal for KVM to do IOMMU implementation, and there were a few AMD >>IOMMU-emulation patches floating around the KVM lists for some time, >>but nothing has made it into release yet. >> >>Best regards, >>Anatoly Burakov >>DPDK SW Engineer >> >>-- >>Intel Shannon Limited >>Registered in Ireland >>Registered Office: Collinstown Industrial Park, Leixlip, County Kildare >>Registered Number: 308263 Business address: Dromore House, East Park, >>Shannon, Co. Clare >> >> >> >
[dpdk-dev] [PATCH 00/16] [RFC] [VFIO] Add VFIO support to DPDK
Thank you Anatoly ! I?ll do that and get back in case of questions. Regards, -Sujith On 08/09/14 2:00 pm, "Burakov, Anatoly" wrote: >Hi Sujith > >Of course you can. Just use the igb_uio driver instead. Refer to the >Getting Started Guide from Intel, it'll walk you through the steps, >although they are basically the same as for VFIO. > >Thanks, >Anatoly > >-----Original Message- >From: Sujith Sankar (ssujith) [mailto:ssujith at cisco.com] >Sent: Monday, September 8, 2014 9:28 AM >To: Burakov, Anatoly; Stephen Hemminger >Cc: dev at dpdk.org >Subject: Re: [dpdk-dev] [PATCH 00/16] [RFC] [VFIO] Add VFIO support to >DPDK > >Anatoly, >Thanks for the quick response ! > >I am able do PCI passthrough and use the NIC in the guest OS. >What I?m trying to do is run DPDK in the guest and make use of the >passed-through NIC. Without using VFIO, could I achieve this? > >Thanks, >-Sujith > >On 08/09/14 1:51 pm, "Burakov, Anatoly" wrote: > >>Hi Sujith >> >>Not that I know of, no. There are other ways to run physical NICs in a >>VM though, you don't require VFIO for that. >> >>Thanks, >>Anatoly >> >>-Original Message- >>From: Sujith Sankar (ssujith) [mailto:ssujith at cisco.com] >>Sent: Monday, September 8, 2014 9:20 AM >>To: Burakov, Anatoly; Stephen Hemminger >>Cc: dev at dpdk.org >>Subject: Re: [dpdk-dev] [PATCH 00/16] [RFC] [VFIO] Add VFIO support to >>DPDK >> >>Hi Anatoly, >> >>Has anything happened in this front? Do you see running of DPDK in >>guest OS on KVM with physical NIC passed through to it happening soon? >> >>Thanks, >>-Sujith >> >>On 02/05/14 2:28 pm, "Burakov, Anatoly" >>wrote: >> >>>Hi Stephen, >>> >>>> Will this work in guest? or only on bare metal? >>> >>>VFIO is Linux-only, and in theory will be able to work on the guest, >>>but not at the moment, since it requires IOMMU. There was a GSoC >>>proposal for KVM to do IOMMU implementation, and there were a few AMD >>>IOMMU-emulation patches floating around the KVM lists for some time, >>>but nothing has made it into release yet. >>> >>>Best regards, >>>Anatoly Burakov >>>DPDK SW Engineer >>> >>>-- >>>Intel Shannon Limited >>>Registered in Ireland >>>Registered Office: Collinstown Industrial Park, Leixlip, County >>>Kildare Registered Number: 308263 Business address: Dromore House, >>>East Park, Shannon, Co. Clare >>> >>> >>> >> >
[dpdk-dev] [PATCH] enic: disable debug traces
On 07/04/15 11:10 pm, "Thomas Monjalon" wrote: >The function name is printed in each enic_ethdev function. >Disable it by default with a new build option. > >Signed-off-by: Thomas Monjalon >--- > config/common_bsdapp | 1 + > config/common_linuxapp| 1 + > lib/librte_pmd_enic/enic_ethdev.c | 4 > 3 files changed, 6 insertions(+) > >diff --git a/config/common_bsdapp b/config/common_bsdapp >index a8ba484..c2374c0 100644 >--- a/config/common_bsdapp >+++ b/config/common_bsdapp >@@ -214,6 +214,7 @@ CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS=1 > # Compile burst-oriented Cisco ENIC PMD driver > # > CONFIG_RTE_LIBRTE_ENIC_PMD=y >+CONFIG_RTE_LIBRTE_ENIC_DEBUG=n > > # > # Compile burst-oriented VIRTIO PMD driver >diff --git a/config/common_linuxapp b/config/common_linuxapp >index 0b25f34..0078dc9 100644 >--- a/config/common_linuxapp >+++ b/config/common_linuxapp >@@ -211,6 +211,7 @@ CONFIG_RTE_LIBRTE_MLX4_SOFT_COUNTERS=1 > # Compile burst-oriented Cisco ENIC PMD driver > # > CONFIG_RTE_LIBRTE_ENIC_PMD=y >+CONFIG_RTE_LIBRTE_ENIC_DEBUG=n > > # > # Compile burst-oriented VIRTIO PMD driver >diff --git a/lib/librte_pmd_enic/enic_ethdev.c >b/lib/librte_pmd_enic/enic_ethdev.c >index 4950ede..18fadfb 100644 >--- a/lib/librte_pmd_enic/enic_ethdev.c >+++ b/lib/librte_pmd_enic/enic_ethdev.c >@@ -48,8 +48,12 @@ > #include "vnic_enet.h" > #include "enic.h" > >+#ifdef RTE_LIBRTE_ENIC_DEBUG > #define ENICPMD_FUNC_TRACE() \ > RTE_LOG(DEBUG, PMD, "ENICPMD trace: %s\n", __func__) >+#else >+#define ENICPMD_FUNC_TRACE() do {} while (0) >+#endif > > /* > * The set of PCI devices this driver supports >-- >2.2.2 > Acked-by: Sujith Sankar >