Skip to contentSkip to conversation

Cisco Systems Inc. VIC Ethernet PMD - ENIC PMD

PATCH Superseded Sujith Sankar 2 participants 12 messages Nov 25, 2014 5 messages not in the archive Library code

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 cover 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
Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): 1416933018-23415-1-git-send-email-ssujith-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH v4 1/6 ENIC PMD License

---
 lib/librte_pmd_enic/LICENSE | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 lib/librte_pmd_enic/LICENSE
lib/librte_pmd_enic/LICENSE new file +27 -0
new file mode 100644
index 0000000..0ad2216
@@ -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.
Signature · 1 line
1.9.1
#3 lore raw
In reply to a message not in the archive

Hello Sujith,

- This is a comment for the whole patchset.
Patch subjects and commitlogs should comply with the "Contribute by sending patches" section of http://dpdk.org/dev.

I would say, all your patches should be prefixed with "enic: ".

- By the way, can you add some performance numbers as a reference in the cover letter ?

Thanks.

Signature · 1 line
David Marchand
Quoted 82 lines · Sujith Sankar

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

A message that is not in the archive (sent off-list or not yet received): CALwxeUt57Qay8YQTB1yLaKsjcP1dWCZ_+0v1vdENxoP-=N_j6A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#5 lore raw

Hi David,

As suggested, I shall make the modification in the subject in v6.

About performance numbers, I¹m working on ENIC PMD documentation (in rst format), and it will have performance numbers along with some other relevant details.

Thanks,
-Sujith

From:  David Marchand <[email protected]>
Date:  Tuesday, 25 November 2014 3:35 pm
To:  "Sujith Sankar (ssujith)" <[email protected]>

Cc: "[email protected]" <[email protected]>, "Prasad Rao (prrao)" <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v4 0/6] Cisco Systems Inc. VIC Ethernet
PMD - ENIC PMD

Hello Sujith,

- This is a comment for the whole patchset.
Patch subjects and commitlogs should comply with the "Contribute by sending patches" section of http://dpdk.org/dev.

I would say, all your patches should be prefixed with "enic: ".

- By the way, can you add some performance numbers as a reference in the cover letter ?

Thanks.

Signature · 4 lines
David Marchand


On Tue, Nov 25, 2014 at 5:30 PM, Sujith Sankar

<[email protected]> wrote:

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 <http://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

#6 lore raw

PATCH v4 2/6 ENIC PMD Makefile

In reply to a message not in the archive
---
 lib/librte_pmd_enic/Makefile | 67 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 lib/librte_pmd_enic/Makefile
lib/librte_pmd_enic/Makefile new file +67 -0
new file mode 100644
index 0000000..25d8f31
@@ -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
+
Signature · 1 line
1.9.1
#7 lore raw

PATCH v4 3/6 VNIC common code partially shared with ENIC kernel mode driver

In reply to a message not in the archive
---
 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
lib/librte_pmd_enic/vnic/cq_desc.h new file +126 -0
new file mode 100644
index 0000000..7dfb2b6
@@ -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];
+	u8 type_color;
+};
+
+#define CQ_DESC_TYPE_BITS        4
+#define CQ_DESC_TYPE_MASK        ((1 << CQ_DESC_TYPE_BITS) - 1)
+#define CQ_DESC_COLOR_MASK       1
+#define CQ_DESC_COLOR_SHIFT      7
+#define CQ_DESC_Q_NUM_BITS       10
+#define CQ_DESC_Q_NUM_MASK       ((1 << CQ_DESC_Q_NUM_BITS) - 1)
+#define CQ_DESC_COMP_NDX_BITS    12
+#define CQ_DESC_COMP_NDX_MASK    ((1 << CQ_DESC_COMP_NDX_BITS) - 1)
+
+static inline void cq_color_enc(struct cq_desc *desc, const u8 color)
+{
+	if (color)
+		desc->type_color |=  (1 << CQ_DESC_COLOR_SHIFT);
+	else
+		desc->type_color &= ~(1 << CQ_DESC_COLOR_SHIFT);
+}
+
+static inline void cq_desc_enc(struct cq_desc *desc,
+	const u8 type, const u8 color, const u16 q_number,
+	const u16 completed_index)
+{
+	desc->type_color = (type & CQ_DESC_TYPE_MASK) |
+		((color & CQ_DESC_COLOR_MASK) << CQ_DESC_COLOR_SHIFT);
+	desc->q_number = cpu_to_le16(q_number & CQ_DESC_Q_NUM_MASK);
+	desc->completed_index = cpu_to_le16(completed_index &
+		CQ_DESC_COMP_NDX_MASK);
+}
+
+static inline void cq_desc_dec(const struct cq_desc *desc_arg,
+	u8 *type, u8 *color, u16 *q_number, u16 *completed_index)
+{
+	const struct cq_desc *desc = desc_arg;
+	const u8 type_color = desc->type_color;
+
+	*color = (type_color >> CQ_DESC_COLOR_SHIFT) & CQ_DESC_COLOR_MASK;
+
+	/*
+	 * Make sure color bit is read from desc *before* other fields
+	 * are read from desc.  Hardware guarantees color bit is last
+	 * bit (byte) written.  Adding the rmb() prevents the compiler
+	 * and/or CPU from reordering the reads which would potentially
+	 * result in reading stale values.
+	 */
+
+	rmb();
+
+	*type = type_color & CQ_DESC_TYPE_MASK;
+	*q_number = le16_to_cpu(desc->q_number) & CQ_DESC_Q_NUM_MASK;
+	*completed_index = le16_to_cpu(desc->completed_index) &
+		CQ_DESC_COMP_NDX_MASK;
+}
+
+static inline void cq_color_dec(const struct cq_desc *desc_arg, u8 *color)
+{
+	volatile const struct cq_desc *desc = desc_arg;
+
+	*color = (desc->type_color >> CQ_DESC_COLOR_SHIFT) & CQ_DESC_COLOR_MASK;
+}
+
+#endif /* _CQ_DESC_H_ */
lib/librte_pmd_enic/vnic/cq_enet_desc.h new file +261 -0

261 lines not on this page · raw message

lib/librte_pmd_enic/vnic/rq_enet_desc.h new file +76 -0

76 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_cq.c new file +117 -0

117 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_cq.h new file +152 -0

152 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_dev.c new file +1063 -0

1,063 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_dev.h new file +202 -0

202 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_devcmd.h new file +774 -0

774 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_enet.h new file +78 -0

78 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_intr.c new file +83 -0

83 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_intr.h new file +126 -0

68 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_nic.h new file +88 -0

88 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_resource.h new file +97 -0

97 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_rq.c new file +246 -0

246 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_rq.h new file +282 -0

282 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_rss.c new file +85 -0

85 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_rss.h new file +61 -0

61 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_stats.h new file +86 -0

86 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_wq.c new file +245 -0

245 lines not on this page · raw message

lib/librte_pmd_enic/vnic/vnic_wq.h new file +283 -0

283 lines not on this page · raw message

lib/librte_pmd_enic/vnic/wq_enet_desc.h new file +114 -0

114 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.9.1

Part of the diff is not shown here. View the raw message.

#8 lore raw

PATCH v4 4/6 ENIC PMD specific code

In reply to a message not in the archive
---
 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
lib/librte_pmd_enic/enic.h new file +157 -0
new file mode 100644
index 0000000..5041dd1
@@ -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_MAX		8
+#define ENIC_RQ_MAX		8
+#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   /* 0000:00:00.0'\0' */
+#define PKT_TX_TCP_UDP_CKSUM    0x6000
+#define ENIC_CALC_IP_CKSUM      1
+#define ENIC_CALC_TCP_UDP_CKSUM 2
+#define ENIC_MAX_MTU            9000
+#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_status;
+	u8 hw_ip_checksum;
+
+	unsigned int flags;
+	unsigned int priv_flags;
+
+	/* work queue */
+	struct vnic_wq wq[ENIC_WQ_MAX];
+	unsigned int wq_count;
+
+	/* receive queue */
+	struct vnic_rq rq[ENIC_RQ_MAX];
+	unsigned int rq_count;
+
+	/* completion queue */
+	struct vnic_cq cq[ENIC_CQ_MAX];
+	unsigned int cq_count;
+
+	/* interrupt resource */
+	struct vnic_intr intr;
+	unsigned int intr_count;
+};
+
+static inline unsigned int enic_cq_rq(struct enic *enic, unsigned int rq)
+{
+	return rq;
+}
+
+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)
+{
+	return 0;
+}
+
+static inline struct enic *pmd_priv(struct rte_eth_dev *eth_dev)
+{
+	return (struct enic *)eth_dev->data->dev_private;
+}
+
+#endif /* _ENIC_H_ */
lib/librte_pmd_enic/enic_clsf.c new file +244 -0

244 lines not on this page · raw message

lib/librte_pmd_enic/enic_compat.h new file +142 -0

142 lines not on this page · raw message

lib/librte_pmd_enic/enic_main.c new file +1266 -0

1,266 lines not on this page · raw message

lib/librte_pmd_enic/enic_res.c new file +221 -0

221 lines not on this page · raw message

lib/librte_pmd_enic/enic_res.h new file +168 -0

168 lines not on this page · raw message

Signature · 1 line
1.9.1
#9 lore raw

PATCH v4 5/6 DPDK-ENIC PMD interface

In reply to a message not in the archive
---
 lib/librte_pmd_enic/enic_etherdev.c | 613 ++++++++++++++++++++++++++++++++++++
 1 file changed, 613 insertions(+)
 create mode 100644 lib/librte_pmd_enic/enic_etherdev.c
lib/librte_pmd_enic/enic_etherdev.c new file +613 -0
new file mode 100644
index 0000000..441c85a
@@ -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 <stdio.h>
+#include <stdint.h>
+
+#include <rte_dev.h>
+#include <rte_pci.h>
+#include <rte_ethdev.h>
+#include <rte_string_fns.h>
+
+#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_CISCO	0x1137
+#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_idx];
+
+	ret = enic_alloc_wq(enic, queue_idx, socket_id, nb_desc);
+	if (ret) {
+		dev_err(enic, "error in allocating wq\n");
+		return ret;
+	}
+
+	return enicpmd_dev_setup_intr(enic);
+}
+
+static int enicpmd_dev_tx_queue_start(struct rte_eth_dev *eth_dev,
+	uint16_t queue_idx)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+
+	enic_start_wq(enic, queue_idx);
+
+	return 0;
+}
+
+static int enicpmd_dev_tx_queue_stop(struct rte_eth_dev *eth_dev,
+	uint16_t queue_idx)
+{
+	int ret;
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+
+	ret = enic_stop_wq(enic, queue_idx);
+	if (ret)
+		dev_err(enic, "error in stopping wq %d\n", queue_idx);
+
+	return ret;
+}
+
+static int enicpmd_dev_rx_queue_start(struct rte_eth_dev *eth_dev,
+	uint16_t queue_idx)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+
+	enic_start_rq(enic, queue_idx);
+
+	return 0;
+}
+
+static int enicpmd_dev_rx_queue_stop(struct rte_eth_dev *eth_dev,
+	uint16_t queue_idx)
+{
+	int ret;
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+
+	ret = enic_stop_rq(enic, queue_idx);
+	if (ret)
+		dev_err(enic, "error in stopping rq %d\n", queue_idx);
+
+	return ret;
+}
+
+static void enicpmd_dev_rx_queue_release(void *rxq)
+{
+	ENICPMD_FUNC_TRACE();
+	enic_free_rq(rxq);
+}
+
+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,
+	struct rte_mempool *mp)
+{
+	int ret;
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	eth_dev->data->rx_queues[queue_idx] = (void *)&enic->rq[queue_idx];
+
+	ret = enic_alloc_rq(enic, queue_idx, socket_id, mp, nb_desc);
+	if (ret) {
+		dev_err(enic, "error in allocating rq\n");
+		return ret;
+	}
+
+	return enicpmd_dev_setup_intr(enic);
+}
+
+static int enicpmd_vlan_filter_set(struct rte_eth_dev *eth_dev,
+	uint16_t vlan_id, int on)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	if (on)
+		enic_add_vlan(enic, vlan_id);
+	else
+		enic_del_vlan(enic, vlan_id);
+	return 0;
+}
+
+static void enicpmd_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+
+	if (mask & ETH_VLAN_STRIP_MASK) {
+		if (eth_dev->data->dev_conf.rxmode.hw_vlan_strip)
+			enic->ig_vlan_strip_en = 1;
+		else
+			enic->ig_vlan_strip_en = 0;
+	}
+	enic_set_rss_nic_cfg(enic);
+
+
+	if (mask & ETH_VLAN_FILTER_MASK) {
+		dev_warning(enic,
+			"Configuration of VLAN filter is not supported\n");
+	}
+
+	if (mask & ETH_VLAN_EXTEND_MASK) {
+		dev_warning(enic,
+			"Configuration of extended VLAN is not supported\n");
+	}
+}
+
+static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
+{
+	int ret;
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	ret = enic_set_vnic_res(enic);
+	if (ret) {
+		dev_err(enic, "Set vNIC resource num  failed, aborting\n");
+		return ret;
+	}
+
+	if (eth_dev->data->dev_conf.rxmode.split_hdr_size &&
+		eth_dev->data->dev_conf.rxmode.header_split) {
+		/* Enable header-data-split */
+		enic_set_hdr_split_size(enic,
+			eth_dev->data->dev_conf.rxmode.split_hdr_size);
+	}
+
+	enic->hw_ip_checksum = eth_dev->data->dev_conf.rxmode.hw_ip_checksum;
+	return 0;
+}
+
+/* Start the device.
+ * It returns 0 on success.
+ */
+static int enicpmd_dev_start(struct rte_eth_dev *eth_dev)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	return enic_enable(enic);
+}
+
+/*
+ * Stop device: disable rx and tx functions to allow for reconfiguring.
+ */
+static void enicpmd_dev_stop(struct rte_eth_dev *eth_dev)
+{
+	struct rte_eth_link link;
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	enic_disable(enic);
+	memset(&link, 0, sizeof(link));
+	rte_atomic64_cmpset((uint64_t *)&eth_dev->data->dev_link,
+		*(uint64_t *)&eth_dev->data->dev_link,
+		*(uint64_t *)&link);
+}
+
+/*
+ * Stop device.
+ */
+static void enicpmd_dev_close(struct rte_eth_dev *eth_dev)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	enic_remove(enic);
+}
+
+static int enicpmd_dev_link_update(struct rte_eth_dev *eth_dev,
+	int wait_to_complete)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+	int ret;
+	int link_status = 0;
+
+	ENICPMD_FUNC_TRACE();
+	link_status = enic_get_link_status(enic);
+	ret = (link_status == enic->link_status);
+	enic->link_status = link_status;
+	eth_dev->data->dev_link.link_status = link_status;
+	eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
+	eth_dev->data->dev_link.link_speed = vnic_dev_port_speed(enic->vdev);
+	return ret;
+}
+
+static void enicpmd_dev_stats_get(struct rte_eth_dev *eth_dev,
+	struct rte_eth_stats *stats)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	enic_dev_stats_get(enic, stats);
+}
+
+static void enicpmd_dev_stats_reset(struct rte_eth_dev *eth_dev)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	enic_dev_stats_clear(enic);
+}
+
+static void enicpmd_dev_info_get(struct rte_eth_dev *eth_dev,
+	struct rte_eth_dev_info *device_info)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	device_info->max_rx_queues = enic->rq_count;
+	device_info->max_tx_queues = enic->wq_count;
+	device_info->min_rx_bufsize = ENIC_MIN_MTU;
+	device_info->max_rx_pktlen = enic->config.mtu;
+	device_info->max_mac_addrs = 1;
+	device_info->rx_offload_capa =
+		DEV_RX_OFFLOAD_VLAN_STRIP |
+		DEV_RX_OFFLOAD_IPV4_CKSUM |
+		DEV_RX_OFFLOAD_UDP_CKSUM  |
+		DEV_RX_OFFLOAD_TCP_CKSUM;
+	device_info->tx_offload_capa =
+		DEV_TX_OFFLOAD_VLAN_INSERT |
+		DEV_TX_OFFLOAD_IPV4_CKSUM  |
+		DEV_TX_OFFLOAD_UDP_CKSUM   |
+		DEV_TX_OFFLOAD_TCP_CKSUM;
+}
+
+static void enicpmd_dev_promiscuous_enable(struct rte_eth_dev *eth_dev)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	enic->promisc = 1;
+	enic_add_packet_filter(enic);
+}
+
+static void enicpmd_dev_promiscuous_disable(struct rte_eth_dev *eth_dev)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	enic->promisc = 0;
+	enic_add_packet_filter(enic);
+}
+
+static void enicpmd_dev_allmulticast_enable(struct rte_eth_dev *eth_dev)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	enic->allmulti = 1;
+	enic_add_packet_filter(enic);
+}
+
+static void enicpmd_dev_allmulticast_disable(struct rte_eth_dev *eth_dev)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	enic->allmulti = 0;
+	enic_add_packet_filter(enic);
+}
+
+static void enicpmd_add_mac_addr(struct rte_eth_dev *eth_dev,
+	struct ether_addr *mac_addr,
+	uint32_t index, uint32_t pool)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	enic_set_mac_address(enic, mac_addr->addr_bytes);
+}
+
+static void enicpmd_remove_mac_addr(struct rte_eth_dev *eth_dev, uint32_t index)
+{
+	struct enic *enic = pmd_priv(eth_dev);
+
+	ENICPMD_FUNC_TRACE();
+	enic_del_mac_address(enic);
+}
+
+
+static uint16_t enicpmd_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+	uint16_t nb_pkts)
+{
+	unsigned int index;
+	unsigned int frags;
+	unsigned int pkt_len;
+	unsigned int seg_len;
+	unsigned int inc_len;
+	unsigned int nb_segs;
+	struct rte_mbuf *tx_pkt;
+	struct vnic_wq *wq = (struct vnic_wq *)tx_queue;
+	struct enic *enic = vnic_dev_priv(wq->vdev);
+	unsigned char *buf;
+	unsigned short vlan_id;
+	unsigned short ol_flags;
+
+	for (index = 0; index < nb_pkts; index++) {
+		tx_pkt = *tx_pkts++;
+		inc_len = 0;
+		nb_segs = tx_pkt->nb_segs;
+		if (nb_segs > vnic_wq_desc_avail(wq)) {
+			/* wq cleanup and try again */
+			if (!enic_cleanup_wq(enic, wq) ||
+				(nb_segs > vnic_wq_desc_avail(wq)))
+				return index;
+		}
+		pkt_len = tx_pkt->pkt_len;
+		vlan_id = tx_pkt->vlan_tci;
+		ol_flags = tx_pkt->ol_flags;
+		for (frags = 0; inc_len < pkt_len; frags++) {
+			if (!tx_pkt)
+				break;
+			seg_len = tx_pkt->data_len;
+			inc_len += seg_len;
+			if (enic_send_pkt(enic, wq, tx_pkt,
+				    (unsigned short)seg_len, !frags,
+				    (pkt_len == inc_len), ol_flags, vlan_id)) {
+				break;
+			}
+			tx_pkt = tx_pkt->next;
+		}
+	}
+
+	enic_cleanup_wq(enic, wq);
+	return index;
+}
+
+static uint16_t enicpmd_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
+	uint16_t nb_pkts)
+{
+	struct vnic_rq *rq = (struct vnic_rq *)rx_queue;
+	unsigned int work_done;
+
+	if (enic_poll(rq, rx_pkts, (unsigned int)nb_pkts, &work_done))
+		dev_err(enic, "error in enicpmd poll\n");
+
+	return work_done;
+}
+
+static struct eth_dev_ops enicpmd_eth_dev_ops = {
+	.dev_configure        = enicpmd_dev_configure,
+	.dev_start            = enicpmd_dev_start,
+	.dev_stop             = enicpmd_dev_stop,
+	.dev_set_link_up      = NULL,
+	.dev_set_link_down    = NULL,
+	.dev_close            = enicpmd_dev_close,
+	.promiscuous_enable   = enicpmd_dev_promiscuous_enable,
+	.promiscuous_disable  = enicpmd_dev_promiscuous_disable,
+	.allmulticast_enable  = enicpmd_dev_allmulticast_enable,
+	.allmulticast_disable = enicpmd_dev_allmulticast_disable,
+	.link_update          = enicpmd_dev_link_update,
+	.stats_get            = enicpmd_dev_stats_get,
+	.stats_reset          = enicpmd_dev_stats_reset,
+	.queue_stats_mapping_set = NULL,
+	.dev_infos_get        = enicpmd_dev_info_get,
+	.mtu_set              = NULL,
+	.vlan_filter_set      = enicpmd_vlan_filter_set,
+	.vlan_tpid_set        = NULL,
+	.vlan_offload_set     = enicpmd_vlan_offload_set,
+	.vlan_strip_queue_set = NULL,
+	.rx_queue_start       = enicpmd_dev_rx_queue_start,
+	.rx_queue_stop        = enicpmd_dev_rx_queue_stop,
+	.tx_queue_start       = enicpmd_dev_tx_queue_start,
+	.tx_queue_stop        = enicpmd_dev_tx_queue_stop,
+	.rx_queue_setup       = enicpmd_dev_rx_queue_setup,
+	.rx_queue_release     = enicpmd_dev_rx_queue_release,
+	.rx_queue_count       = NULL,
+	.rx_descriptor_done   = NULL,
+	.tx_queue_setup       = enicpmd_dev_tx_queue_setup,
+	.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,
+};
+
+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);
+
Signature · 1 line
1.9.1
#10 lore raw

PATCH v4 6/6 DPDK changes for accommodating ENIC PMD

In reply to a message not in the archive
---
 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(+)
config/common_linuxapp +5 -0
index 86a0d15..542fff2 100644
@@ -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
lib/Makefile +1 -0
index 204ef11..df17d78 100644
@@ -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
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +1 -0
index c776ddc..87e7862 100644
@@ -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 */
mk/rte.app.mk +4 -0
index 59468b0..bef823b 100644
@@ -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
Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): 1416933018-23415-7-git-send-email-ssujith-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org

#12 lore raw

Re: [PATCH v4 6/6] DPDK changes for accommodating ENIC PMD

Hello Sujith,

Quoted 7 lines · Sujith Sankar
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +0 -0
index c776ddc..87e7862 100644

lib/librte_eal/linuxapp/eal/eal_pci_vfio.c pci_vfio_map_resource(struct rte_pci_device *dev) · line 742

Quoted 7 lines
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +1 -0
@@ -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 */

I still think this part is wrong.
The length should have been populated by pci_parse_sysfs_resource(). Are you sure this length is 0 ?

Can you do give me the result of cat /sys/bus/pci/devices/$your_device_pci_address/resource ?

Thanks.

Signature · 1 line
David Marchand

A message that is not in the archive (sent off-list or not yet received): CALwxeUtiCb5vOyFFmd3UeOa0ohCZSP71K6jrRrYSaWPhVRWrBw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#14 lore raw

Re: [PATCH v4 6/6] DPDK changes for accommodating ENIC PMD

David,

I tested it now, and it looks like the length is proper in dev->men_resource[0].len without this change.
Not sure what changed in my workspace as I clearly remember seeing it wrong and hence added the extra statement in the lib.

I shall remove it in v5.
Thanks for pointing it out, David.

Regards,
-Sujith

From:  David Marchand <[email protected]>
Date:  Tuesday, 25 November 2014 3:32 pm
To:  "Sujith Sankar (ssujith)" <[email protected]>

Cc: "[email protected]" <[email protected]>, "Prasad Rao (prrao)" <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v4 6/6] DPDK changes for accommodating
ENIC PMD

Hello Sujith,

On Tue, Nov 25, 2014 at 5:30 PM, Sujith Sankar <[email protected]> wrote:

(quoted diff) +0 -0

b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
index c776ddc..87e7862 100644

lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +1 -0
@@ -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 */

I still think this part is wrong.
The length should have been populated by pci_parse_sysfs_resource(). Are you sure this length is 0 ?

Can you do give me the result of cat /sys/bus/pci/devices/$your_device_pci_address/resource ?

Thanks.

Signature · 1 line
David Marchand

A message that is not in the archive (sent off-list or not yet received): D09A5A39.28A10%[email protected]

#16 lore raw

Re: [PATCH v4 6/6] DPDK changes for accommodating ENIC PMD

On Tue, Nov 25, 2014 at 11:46 AM, Sujith Sankar (ssujith) <[email protected]

Quoted 11 lines

wrote:

David,

I tested it now, and it looks like the length is proper in dev->men_resource[0].len without this change.
Not sure what changed in my workspace as I clearly remember seeing it wrong and hence added the extra statement in the lib.

I shall remove it in v5.

Ok, thank you Sujith.

Signature · 1 line
David Marchand