introduces ppfe network PMD
Subsystems (3)
cover introduces ppfe network PMD
This series introduces ppfe (programmable packet forwarding engine) network poll mode driver for NXP SoC ls1012a.
First patch of this series move OF library code from dpaa bus to a common folder as PPFE also uses the same library for getting information from the device tree.
This patch is included in this series so that compilation by CI don't break.
Gagandeep Singh (12):
net/ppfe: introduce ppfe net poll mode driver
doc: add guide for ppfe net PMD
net/ppfe: support dynamic logging
net/ppfe: add HW specific macros and operations net/ppfe: add MAC and host interface initialisation net/ppfe: add device start stop operations net/ppfe: add queue setup and release operations net/ppfe: add burst enqueue and dequeue operations net/ppfe: add supported packet types and basic statistics net/ppfe: add MTU and MAC address set operations net/ppfe: add allmulticast and promiscuous net/ppfe: add link status update
Hemant Agrawal (1):
common/dpaax: moving OF lib code from dpaa bus
MAINTAINERS | 7 +
config/common_base | 5 +
config/common_linux | 5 +
doc/guides/nics/features/ppfe.ini | 17 +
doc/guides/nics/index.rst | 1 +
doc/guides/nics/ppfe.rst | 175 +++
drivers/bus/dpaa/Makefile | 2 +-
drivers/bus/dpaa/base/qbman/dpaa_sys.h | 1 +
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/compat.h | 1 -
drivers/bus/dpaa/include/fman.h | 1 +
drivers/bus/dpaa/include/fsl_usd.h | 1 +
drivers/bus/dpaa/meson.build | 1 -
drivers/bus/dpaa/rte_dpaa_bus.h | 2 +-
drivers/bus/fslmc/Makefile | 1 +
drivers/common/dpaax/Makefile | 10 +-
.../dpaa/include => common/dpaax}/dpaa_list.h | 0
drivers/common/dpaax/dpaax_logs.h | 10 +
drivers/common/dpaax/meson.build | 5 +-
.../{bus/dpaa/base/fman => common/dpaax}/of.c | 61 +-
.../{bus/dpaa/include => common/dpaax}/of.h | 27 +-
.../common/dpaax/rte_common_dpaax_version.map | 18 +
drivers/crypto/caam_jr/Makefile | 2 +
drivers/crypto/dpaa2_sec/Makefile | 2 +-
drivers/crypto/dpaa_sec/Makefile | 1 +
drivers/event/dpaa/Makefile | 1 +
drivers/event/dpaa2/Makefile | 1 +
drivers/mempool/dpaa/Makefile | 1 +
drivers/mempool/dpaa2/Makefile | 1 +
drivers/net/Makefile | 1 +
drivers/net/dpaa/Makefile | 1 +
drivers/net/dpaa2/Makefile | 1 +
drivers/net/meson.build | 1 +
drivers/net/ppfe/Makefile | 36 +
drivers/net/ppfe/base/cbus.h | 66 +
drivers/net/ppfe/base/cbus/bmu.h | 41 +
drivers/net/ppfe/base/cbus/class_csr.h | 277 ++++
drivers/net/ppfe/base/cbus/emac_mtip.h | 231 ++++
drivers/net/ppfe/base/cbus/gpi.h | 77 ++
drivers/net/ppfe/base/cbus/hif.h | 86 ++
drivers/net/ppfe/base/cbus/hif_nocpy.h | 36 +
drivers/net/ppfe/base/cbus/tmu_csr.h | 154 +++
drivers/net/ppfe/base/cbus/util_csr.h | 47 +
drivers/net/ppfe/base/pfe.h | 422 ++++++
drivers/net/ppfe/meson.build | 16 +
drivers/net/ppfe/pfe_eth.h | 78 ++
drivers/net/ppfe/pfe_hal.c | 597 +++++++++
drivers/net/ppfe/pfe_hif.c | 857 ++++++++++++
drivers/net/ppfe/pfe_hif.h | 156 +++
drivers/net/ppfe/pfe_hif_lib.c | 557 ++++++++
drivers/net/ppfe/pfe_hif_lib.h | 181 +++
drivers/net/ppfe/pfe_logs.h | 30 +
drivers/net/ppfe/pfe_mod.h | 59 +
drivers/net/ppfe/ppfe_ethdev.c | 1182 +++++++++++++++++
drivers/net/ppfe/rte_pmd_ppfe_version.map | 4 +
drivers/raw/dpaa2_cmdif/Makefile | 1 +
drivers/raw/dpaa2_qdma/Makefile | 1 +
mk/rte.app.mk | 1 +
58 files changed, 5513 insertions(+), 46 deletions(-)
create mode 100644 doc/guides/nics/features/ppfe.ini
create mode 100644 doc/guides/nics/ppfe.rst
rename drivers/{bus/dpaa/include => common/dpaax}/dpaa_list.h (100%)
rename drivers/{bus/dpaa/base/fman => common/dpaax}/of.c (88%)
rename drivers/{bus/dpaa/include => common/dpaax}/of.h (86%)
create mode 100644 drivers/net/ppfe/Makefile
create mode 100644 drivers/net/ppfe/base/cbus.h
create mode 100644 drivers/net/ppfe/base/cbus/bmu.h
create mode 100644 drivers/net/ppfe/base/cbus/class_csr.h
create mode 100644 drivers/net/ppfe/base/cbus/emac_mtip.h
create mode 100644 drivers/net/ppfe/base/cbus/gpi.h
create mode 100644 drivers/net/ppfe/base/cbus/hif.h
create mode 100644 drivers/net/ppfe/base/cbus/hif_nocpy.h
create mode 100644 drivers/net/ppfe/base/cbus/tmu_csr.h
create mode 100644 drivers/net/ppfe/base/cbus/util_csr.h
create mode 100644 drivers/net/ppfe/base/pfe.h
create mode 100644 drivers/net/ppfe/meson.build
create mode 100644 drivers/net/ppfe/pfe_eth.h
create mode 100644 drivers/net/ppfe/pfe_hal.c
create mode 100644 drivers/net/ppfe/pfe_hif.c
create mode 100644 drivers/net/ppfe/pfe_hif.h
create mode 100644 drivers/net/ppfe/pfe_hif_lib.c
create mode 100644 drivers/net/ppfe/pfe_hif_lib.h
create mode 100644 drivers/net/ppfe/pfe_logs.h
create mode 100644 drivers/net/ppfe/pfe_mod.h
create mode 100644 drivers/net/ppfe/ppfe_ethdev.c
create mode 100644 drivers/net/ppfe/rte_pmd_ppfe_version.mapSignature · 1 line
2.17.1
PATCH 1/13 common/dpaax: moving OF lib code from dpaa bus
From: Hemant Agrawal <[email protected]>
This code is being shared by more than 1 type of driver. Common is most appropriate place for it.
---
drivers/bus/dpaa/Makefile | 2 +-
drivers/bus/dpaa/base/qbman/dpaa_sys.h | 1 +
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/compat.h | 1 -
drivers/bus/dpaa/include/fman.h | 1 +
drivers/bus/dpaa/include/fsl_usd.h | 1 +
drivers/bus/dpaa/meson.build | 1 -
drivers/bus/dpaa/rte_dpaa_bus.h | 2 +-
drivers/bus/fslmc/Makefile | 1 +
drivers/common/dpaax/Makefile | 10 +--
.../dpaa/include => common/dpaax}/dpaa_list.h | 0
drivers/common/dpaax/dpaax_logs.h | 10 +++
drivers/common/dpaax/meson.build | 5 +-
.../{bus/dpaa/base/fman => common/dpaax}/of.c | 61 ++++++++++---------
.../{bus/dpaa/include => common/dpaax}/of.h | 27 ++++++--
.../common/dpaax/rte_common_dpaax_version.map | 18 ++++++
drivers/crypto/caam_jr/Makefile | 2 +
drivers/crypto/dpaa2_sec/Makefile | 2 +-
drivers/crypto/dpaa_sec/Makefile | 1 +
drivers/event/dpaa/Makefile | 1 +
drivers/event/dpaa2/Makefile | 1 +
drivers/mempool/dpaa/Makefile | 1 +
drivers/mempool/dpaa2/Makefile | 1 +
drivers/net/dpaa/Makefile | 1 +
drivers/net/dpaa2/Makefile | 1 +
drivers/raw/dpaa2_cmdif/Makefile | 1 +
drivers/raw/dpaa2_qdma/Makefile | 1 +
27 files changed, 110 insertions(+), 46 deletions(-)
rename drivers/{bus/dpaa/include => common/dpaax}/dpaa_list.h (100%)
rename drivers/{bus/dpaa/base/fman => common/dpaax}/of.c (88%)
rename drivers/{bus/dpaa/include => common/dpaax}/of.h (86%)drivers/bus/dpaa/Makefile +1 -1
@@ -17,6 +17,7 @@ CFLAGS += -Wno-cast-qual CFLAGS += -I$(RTE_BUS_DPAA)/ CFLAGS += -I$(RTE_BUS_DPAA)/include CFLAGS += -I$(RTE_BUS_DPAA)/base/qbman +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include # versioning export map
@@ -32,7 +33,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \ base/fman/fman.c \ base/fman/fman_hw.c \ - base/fman/of.c \ base/fman/netcfg_layer.c \ base/qbman/process.c \ base/qbman/bman.c \
drivers/bus/dpaa/base/qbman/dpaa_sys.h +1 -0
@@ -8,6 +8,7 @@#ifndef __DPAA_SYS_H#define __DPAA_SYS_H +#include <compat.h> #include <of.h> /* For 2-element tables related to cache-inhibited and cache-enabled mappings */
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -32,6 +32,7 @@#include <rte_bus.h> #include <rte_mbuf_pool_ops.h> +#include <of.h> #include <rte_dpaa_bus.h> #include <rte_dpaa_logs.h> #include <dpaax_iova_table.h>
@@ -39,7 +40,6 @@#include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> #include <netcfg.h> int dpaa_logtype_bus;
drivers/bus/dpaa/include/compat.h +0 -1
@@ -390,7 +390,6 @@ static inline unsigned long get_zeroed_page(gfp_t __foo __rte_unused)#define atomic_dec_return (v) rte_atomic32_sub_return(v, 1)#define atomic_sub_and_test (i, v) (rte_atomic32_sub_return(v, i) == 0) -#include <dpaa_list.h> #include <dpaa_bits.h> #endif /* __COMPAT_H */
drivers/bus/dpaa/include/fman.h +1 -0
@@ -15,6 +15,7 @@#include <rte_ether.h> #include <compat.h> +#include <dpaa_list.h> #ifndef FMAN_DEVICE_PATH #define FMAN_DEVICE_PATH "/dev/mem"
drivers/bus/dpaa/include/fsl_usd.h +1 -0
@@ -9,6 +9,7 @@#define __FSL_USD_H#include <compat.h> +#include <dpaa_list.h> #include <fsl_qman.h> #ifdef __cplusplus
drivers/bus/dpaa/meson.build +0 -1
@@ -12,7 +12,6 @@ deps += ['common_dpaax', 'eventdev'] sources = files('base/fman/fman.c', 'base/fman/fman_hw.c', 'base/fman/netcfg_layer.c', - 'base/fman/of.c', 'base/qbman/bman.c', 'base/qbman/bman_driver.c', 'base/qbman/dpaa_alloc.c',
drivers/bus/dpaa/rte_dpaa_bus.h +1 -1
@@ -10,10 +10,10 @@#include <rte_mempool.h> #include <dpaax_iova_table.h> +#include <of.h> #include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> #include <netcfg.h> #define DPAA_MEMPOOL_OPS_NAME "dpaa"
drivers/bus/fslmc/Makefile +1 -0
@@ -16,6 +16,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev
drivers/common/dpaax/Makefile +6 -4
@@ -12,6 +12,10 @@ LIB = librte_common_dpaax.a CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -Wno-pointer-arith +CFLAGS += -Wno-cast-qual + +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax # versioning export map EXPORT_MAP := rte_common_dpaax_version.map
@@ -22,10 +26,8 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # -SRCS-y += dpaax_iova_table.c +SRCS-y += dpaax_iova_table.c of.c LDLIBS += -lrte_eal -SYMLINK-y-include += dpaax_iova_table.h - -include $(RTE_SDK)/mk/rte.lib.mk +include $(RTE_SDK)/mk/rte.lib.mk
drivers/common/dpaax/dpaa_list.h renamed from drivers/bus/dpaa/include/dpaa_list.h +0 -0
drivers/common/dpaax/dpaax_logs.h +10 -0
@@ -9,6 +9,16 @@extern int dpaax_logger; +#ifdef RTE_LIBRTE_DPAAX_DEBUG +#define DPAAX_HWWARN(cond, fmt, args...) \ + do {\ + if (cond) \ + DPAAX_LOG(DEBUG, "WARN: " fmt, ##args); \ + } while (0) +#else +#define DPAAX_HWWARN(cond, fmt, args...) do { } while (0) +#endif + #define DPAAX_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaax_logger, "dpaax: " fmt "\n", \ ##args)
drivers/common/dpaax/meson.build +4 -1
@@ -8,6 +8,9 @@ if not is_linux reason = 'only supported on linux' endif -sources = files('dpaax_iova_table.c') +sources = files('dpaax_iova_table.c', 'of.c') cflags += ['-D_GNU_SOURCE'] +if cc.has_argument('-Wno-cast-qual') + cflags += '-Wno-cast-qual' +endif
drivers/common/dpaax/of.c renamed from drivers/bus/dpaa/base/fman/of.c +31 -30
225 lines not on this page · raw message
drivers/common/dpaax/of.h renamed from drivers/bus/dpaa/include/of.h +22 -5
@@ -8,7 +8,24 @@#ifndef __OF_H#define __OF_H -#include <compat.h> +#include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <stdbool.h> +#include <stdlib.h> +#include <inttypes.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <dirent.h> +#include <fcntl.h> +#include <glob.h> +#include <errno.h> +#include <ctype.h> +#include <unistd.h> +#include <limits.h> +#include <inttypes.h> +#include <rte_common.h> +#include <dpaa_list.h> #ifndef OF_INIT_DEFAULT_PATH #define OF_INIT_DEFAULT_PATH "/proc/device-tree"
@@ -89,7 +106,7 @@ struct dt_file {const struct device_node *of_find_compatible_node (const struct device_node *from, -const char *type__always_unused , + const char *type __rte_unused,const char *compatible) __attribute__((nonnull (3 )));
@@ -102,7 +119,7 @@ const void *of_get_property(const struct device_node *from, const char *name, size_t *lenp) __attribute__((nonnull(2)));bool of_device_is_available (const struct device_node *dev_node); -const struct device_node *of_find_node_by_phandle (phandle ph); +const struct device_node *of_find_node_by_phandle (uint64_t ph);const struct device_node *of_get_parent (const struct device_node *dev_node);
@@ -122,7 +139,7 @@ const uint32_t *of_get_address(const struct device_node *dev_node, size_t idx, uint64_t *size, uint32_t *flags);uint64_t of_translate_address (const struct device_node *dev_node, -const u32 *addr) __attribute__((nonnull)); +const uint32_t *addr) __attribute__((nonnull));bool of_device_is_compatible (const struct device_node *dev_node,const char *compatible);
@@ -147,7 +164,7 @@ static inline int of_init(void)/* Read a numeric property according to its size and return it as a 64-bit * value. */ -static inline uint64_t of_read_number (const __be32 *cell,int size) +static inline uint64_t of_read_number (const uint32_t *cell,int size) {uint64_t r =0 ;
drivers/common/dpaax/rte_common_dpaax_version.map +18 -0
@@ -9,3 +9,21 @@ DPDK_18.11 { local: *; }; + +DPDK_19.11 { + global: + of_device_is_available; + of_device_is_compatible; + of_find_compatible_node; + of_find_node_by_phandle; + of_get_address; + of_get_mac_address; + of_get_parent; + of_get_property; + of_init_path; + of_n_addr_cells; + of_translate_address; + of_get_next_child; + + local: *; +} DPDK_18.11;
drivers/crypto/caam_jr/Makefile +2 -0
@@ -17,6 +17,7 @@ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/caam_jr #sharing the hw flib headers from dpaa2_sec pmd CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/
@@ -37,6 +38,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr_uio.c LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_cryptodev +LDLIBS += -lrte_common_dpaax LDLIBS += -lrte_bus_dpaa LDLIBS += -lrte_bus_vdev
drivers/crypto/dpaa2_sec/Makefile +1 -1
@@ -19,7 +19,7 @@ ifeq ($(shell test $(GCC_VERSION) -gt 70 && echo 1), 1) CFLAGS += -Wno-implicit-fallthrough endif endif - +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/ CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/
drivers/crypto/dpaa_sec/Makefile +1 -0
@@ -16,6 +16,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa_sec/ #sharing the hw flib headers from dpaa2_sec pmd CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/
drivers/event/dpaa/Makefile +1 -0
@@ -19,6 +19,7 @@ CFLAGS += -I$(RTE_SDK_DPAA)/include CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include EXPORT_MAP := rte_pmd_dpaa_event_version.map
drivers/event/dpaa2/Makefile +1 -0
@@ -17,6 +17,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/portal CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa2 +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_eal -lrte_eventdev LDLIBS += -lrte_bus_fslmc -lrte_mempool_dpaa2 -lrte_pmd_dpaa2 LDLIBS += -lrte_bus_vdev
drivers/mempool/dpaa/Makefile +1 -0
@@ -12,6 +12,7 @@ CFLAGS := -I$(SRCDIR) $(CFLAGS) CFLAGS += -O3 $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa CFLAGS += -I$(RTE_SDK)/lib/librte_mempool
drivers/mempool/dpaa2/Makefile +1 -0
@@ -12,6 +12,7 @@ LIB = librte_mempool_dpaa2.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include # versioning export map
drivers/net/dpaa/Makefile +1 -0
@@ -19,6 +19,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/base/qbman CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
drivers/net/dpaa2/Makefile +1 -0
@@ -12,6 +12,7 @@ LIB = librte_pmd_dpaa2.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc
drivers/raw/dpaa2_cmdif/Makefile +1 -0
@@ -14,6 +14,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_bus_vdev
drivers/raw/dpaa2_qdma/Makefile +1 -0
@@ -14,6 +14,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_eal
Signature · 1 line
2.17.1
PATCH 2/13 net/ppfe: introduce ppfe net poll mode driver
In reply to Gagandeep Singhppfe (programmable packet forwarding engine)
is a network poll mode driver for NXP SoC
ls1012a.
This patch introduces the framework of ppfe
driver with basic functions of initialisation
and teardown.
--- MAINTAINERS | 6 + config/common_base | 5 + config/common_linux | 5 + doc/guides/nics/features/ppfe.ini | 8 + drivers/net/Makefile | 1 + drivers/net/meson.build | 1 + drivers/net/ppfe/Makefile | 28 ++ drivers/net/ppfe/meson.build | 11 + drivers/net/ppfe/pfe_eth.h | 77 +++++ drivers/net/ppfe/pfe_mod.h | 51 ++++ drivers/net/ppfe/ppfe_ethdev.c | 329 ++++++++++++++++++++++ drivers/net/ppfe/rte_pmd_ppfe_version.map | 4 + mk/rte.app.mk | 1 + 13 files changed, 527 insertions(+) create mode 100644 doc/guides/nics/features/ppfe.ini create mode 100644 drivers/net/ppfe/Makefile create mode 100644 drivers/net/ppfe/meson.build create mode 100644 drivers/net/ppfe/pfe_eth.h create mode 100644 drivers/net/ppfe/pfe_mod.h create mode 100644 drivers/net/ppfe/ppfe_ethdev.c create mode 100644 drivers/net/ppfe/rte_pmd_ppfe_version.map
MAINTAINERS +6 -0
@@ -781,6 +781,12 @@ F: drivers/net/enetc/ F: doc/guides/nics/enetc.rst F: doc/guides/nics/features/enetc.ini +NXP ppfe +M: Gagandeep Singh <[email protected]> +M: Akhil Goyal <[email protected]> +F: drivers/net/ppfe/ +F: doc/guides/nics/features/ppfe.ini + QLogic bnx2x M: Rasesh Mody <[email protected]> M: Shahed Shaikh <[email protected]>
config/common_base +5 -0
@@ -224,6 +224,11 @@ CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX=n CONFIG_RTE_LIBRTE_CXGBE_TPUT=y +# +# Compile burst-oriented NXP PPFE PMD driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=n + # NXP DPAA Bus CONFIG_RTE_LIBRTE_DPAA_BUS=n CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n
config/common_linux +5 -0
@@ -59,6 +59,11 @@ CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV=y # CONFIG_RTE_LIBRTE_ENETC_PMD=y +# +# NXP PPFE PMD Driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=y + # # HINIC PMD driver #
doc/guides/nics/features/ppfe.ini new file +8 -0
@@ -0,0 +1,8 @@ +; +; Supported features of the 'ppfe' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Linux VFIO = Y +ARMv8 = Y
drivers/net/Makefile +1 -0
@@ -49,6 +49,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += null DIRS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx DIRS-$(CONFIG_RTE_LIBRTE_OCTEONTX2_PMD) += octeontx2 DIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += pcap +DIRS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += ppfe DIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += ring DIRS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc
drivers/net/meson.build +1 -0
@@ -37,6 +37,7 @@ drivers = ['af_packet', 'octeontx', 'octeontx2', 'pcap', + 'ppfe', 'ring', 'sfc', 'softnic',
drivers/net/ppfe/Makefile new file +28 -0
@@ -0,0 +1,28 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2019 NXP +# + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_ppfe.a + +CFLAGS += -O3 $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax + +EXPORT_MAP := rte_pmd_ppfe_version.map +LIBABIVER := 1 + +# Interfaces with DPDK +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += ppfe_ethdev.c + +LDLIBS += -lrte_bus_vdev +LDLIBS += -lrte_bus_dpaa +LDLIBS += -lrte_common_dpaax +LDLIBS += -lrte_eal +LDLIBS += -lrte_ethdev -lrte_kvargs + +include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/ppfe/meson.build new file +11 -0
@@ -0,0 +1,11 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2019 NXP + +if host_machine.system() != 'linux' + build = false +endif +deps += ['bus_dpaa'] + +sources = files('ppfe_ethdev.c') + +includes += include_directories('../../bus/dpaa/include/')
drivers/net/ppfe/pfe_eth.h new file +77 -0
77 lines not on this page · raw message
drivers/net/ppfe/pfe_mod.h new file +51 -0
51 lines not on this page · raw message
drivers/net/ppfe/ppfe_ethdev.c new file +329 -0
329 lines not on this page · raw message
drivers/net/ppfe/rte_pmd_ppfe_version.map new file +4 -0
@@ -0,0 +1,4 @@ +DPDK_19.11 { + + local: *; +};
mk/rte.app.mk +1 -0
@@ -161,6 +161,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond _LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe ifeq ($(CONFIG_RTE_LIBRTE_DPAA_BUS),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA_PMD) += -lrte_pmd_dpaa +_LDLIBS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += -lrte_pmd_ppfe endif ifeq ($(CONFIG_RTE_EAL_VFIO)$(CONFIG_RTE_LIBRTE_FSLMC_BUS),yy) _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v1 02/13] net/ppfe: introduce ppfe net poll mode driver
config/common_base CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n · line 230
Quoted 10 lines · On Mon, 26 Aug 2019 18:32:35 +0530 Gagandeep Singh <[email protected]> wrote:
config/common_base +4
-0@@ -224,6 +224,11 @@ CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX=n CONFIG_RTE_LIBRTE_CXGBE_TPUT=y +# +# Compile burst-oriented NXP PPFE PMD driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=n
This driver should use the common naming convention for Poll Mode Drivers.
s/CONFIG_RTE_LIBRTE_PPFE_PMD/CONFIG_RTE_LIBRTE_PMD_PPFE/
Re: [dpdk-dev] [PATCH v1 02/13] net/ppfe: introduce ppfe net poll mode driver
Quoted 9 lines · Stephen Hemminger
Quoted 6 lines · On Mon, 26 Aug 2019 18:32:35 +0530 Gagandeep Singh <[email protected]> wrote:
config/common_base +0
-0@@ -224,6 +224,11 @@ CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX=n CONFIG_RTE_LIBRTE_CXGBE_TPUT=y
Quoted 9 lines
config/common_base CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n · line 230
Quoted 4 lines
config/common_base +4
-0+# +# Compile burst-oriented NXP PPFE PMD driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=nThis driver should use the common naming convention for Poll Mode Drivers.
s/CONFIG_RTE_LIBRTE_PPFE_PMD/CONFIG_RTE_LIBRTE_PMD_PPFE/
Unfortunately we have both as naming convention, and *unintentionally* it become virtual ones PMD_XXXX (PMD_RING), physical ones (IXGBE_PMD), although this PMD registers itself as virtual, it is a physical PMD and I think exiting config option is good (PPFE_PMD).
We can update config names to be consistent but not sure if it worth it, changing name for users/costumers which may break their scripts, automation etc. taking into account that it was like this since beginning,
And now we are planning to switch to meson, these config option won't be used directly, so I think we can keep them as they are.
Re: [dpdk-dev] [PATCH v1 02/13] net/ppfe: introduce ppfe net poll mode driver
Quoted 25 lines · Ferruh Yigit
Quoted 9 lines · Stephen Hemminger
Quoted 6 lines · On Mon, 26 Aug 2019 18:32:35 +0530 Gagandeep Singh <[email protected]> wrote:
config/common_base +0
-0@@ -224,6 +224,11 @@ CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX=n CONFIG_RTE_LIBRTE_CXGBE_TPUT=yQuoted 9 lines
config/common_base CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n · line 230
Quoted 4 lines
config/common_base +4
-0+# +# Compile burst-oriented NXP PPFE PMD driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=nThis driver should use the common naming convention for Poll Mode Drivers.
s/CONFIG_RTE_LIBRTE_PPFE_PMD/CONFIG_RTE_LIBRTE_PMD_PPFE/
Unfortunately we have both as naming convention, and *unintentionally* it become virtual ones
PMD_XXXX(PMD_RING), physical ones (IXGBE_PMD), although this PMD registers itself as virtual, it is a physical PMD and I think exiting config option is good (PPFE_PMD).
Quoted 6 lines
We can update config names to be consistent but not sure if it worth it, changing name for users/costumers which may break their scripts, automation etc. taking into account that it was like this since beginning,
And now we are planning to switch to meson, these config option won't be used directly, so I think we can keep them as they are.
... and the meson default is PMD at the end as for physical PMDs.
Re: [dpdk-dev] [PATCH v1 02/13] net/ppfe: introduce ppfe net poll mode driver
Quoted 26 lines · Bruce Richardson
Quoted 25 lines · Ferruh Yigit
Quoted 9 lines · Stephen Hemminger
Quoted 6 lines · On Mon, 26 Aug 2019 18:32:35 +0530 Gagandeep Singh <[email protected]> wrote:
config/common_base +0
-0@@ -224,6 +224,11 @@ CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX=n CONFIG_RTE_LIBRTE_CXGBE_TPUT=yQuoted 9 lines
config/common_base CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n · line 230
Quoted 4 lines
config/common_base +4
-0+# +# Compile burst-oriented NXP PPFE PMD driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=nThis driver should use the common naming convention for Poll Mode Drivers.
s/CONFIG_RTE_LIBRTE_PPFE_PMD/CONFIG_RTE_LIBRTE_PMD_PPFE/
Unfortunately we have both as naming convention, and *unintentionally* it become virtual ones
PMD_XXXX(PMD_RING), physical ones (IXGBE_PMD), although this PMD registers itself as virtual, it is a physical PMD and I think exiting config option is good (PPFE_PMD).
Quoted 9 lines
Quoted 6 lines
We can update config names to be consistent but not sure if it worth it, changing name for users/costumers which may break their scripts, automation etc. taking into account that it was like this since beginning,
And now we are planning to switch to meson, these config option won't be used directly, so I think we can keep them as they are.
... and the meson default is PMD at the end as for physical PMDs.
Does meson need them?
I was thinking these PMD build enable/disable configs will go away with meson.
Re: [dpdk-dev] [PATCH v1 02/13] net/ppfe: introduce ppfe net poll mode driver
Quoted 31 lines · Ferruh Yigit
Quoted 30 lines · Bruce Richardson
Quoted 29 lines · Ferruh Yigit
Quoted 9 lines · Stephen Hemminger
Quoted 6 lines · On Mon, 26 Aug 2019 18:32:35 +0530 Gagandeep Singh <[email protected]> wrote:
config/common_base +0
-0@@ -224,6 +224,11 @@ CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX=n CONFIG_RTE_LIBRTE_CXGBE_TPUT=yQuoted 9 lines
config/common_base CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n · line 230
Quoted 4 lines
config/common_base +4
-0+# +# Compile burst-oriented NXP PPFE PMD driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=nThis driver should use the common naming convention for Poll Mode Drivers.
s/CONFIG_RTE_LIBRTE_PPFE_PMD/CONFIG_RTE_LIBRTE_PMD_PPFE/
Unfortunately we have both as naming convention, and *unintentionally* it become virtual ones
PMD_XXXX(PMD_RING), physical ones (IXGBE_PMD), although this PMD registers itself as virtual, it is a physical PMD and I think exiting config option is good (PPFE_PMD).We can update config names to be consistent but not sure if it worth it, changing name for users/costumers which may break their scripts, automation etc. taking into account that it was like this since beginning,
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
And now we are planning to switch to meson, these config option won't be used directly, so I think we can keep them as they are.
... and the meson default is PMD at the end as for physical PMDs.
Does meson need them?
I was thinking these PMD build enable/disable configs will go away with meson.
They are not needed for meson, but they are needed for some C code so that applications or other drivers can have #ifdefs based on the presence of some other driver. Therefore, for each library or driver which will be built we add the appropriate RTE_LIBRTE_... #define to the config.h file.
/Bruce
Re: [dpdk-dev] [PATCH v1 02/13] net/ppfe: introduce ppfe net poll mode driver
Quoted 38 lines · Bruce Richardson
Quoted 37 lines · Ferruh Yigit
Quoted 35 lines · Bruce Richardson
Quoted 25 lines · Ferruh Yigit
Quoted 9 lines · Stephen Hemminger
Quoted 6 lines · On Mon, 26 Aug 2019 18:32:35 +0530 Gagandeep Singh <[email protected]> wrote:
config/common_base +0
-0@@ -224,6 +224,11 @@ CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX=n CONFIG_RTE_LIBRTE_CXGBE_TPUT=yQuoted 9 lines
config/common_base CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n · line 230
Quoted 4 lines
config/common_base +4
-0+# +# Compile burst-oriented NXP PPFE PMD driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=nThis driver should use the common naming convention for Poll Mode Drivers.
s/CONFIG_RTE_LIBRTE_PPFE_PMD/CONFIG_RTE_LIBRTE_PMD_PPFE/
Unfortunately we have both as naming convention, and *unintentionally* it become virtual ones
PMD_XXXX(PMD_RING), physical ones (IXGBE_PMD), although this PMD registers itself as virtual, it is a physical PMD and I think exiting config option is good (PPFE_PMD).Quoted 6 lines
We can update config names to be consistent but not sure if it worth it, changing name for users/costumers which may break their scripts, automation etc. taking into account that it was like this since beginning,
And now we are planning to switch to meson, these config option won't be used directly, so I think we can keep them as they are.
... and the meson default is PMD at the end as for physical PMDs.
Quoted 7 lines
Quoted 2 lines
Does meson need them?
I was thinking these PMD build enable/disable configs will go away with meson.They are not needed for meson, but they are needed for some C code so that applications or other drivers can have #ifdefs based on the presence of some other driver. Therefore, for each library or driver which will be built we add the appropriate
RTE_LIBRTE_... #define to theconfig.hfile.
I think only physical ones are used in C files, so using XXX_PMD syntax for everything will work for meson. And +1 to switch to this convention with meson.
PATCH 3/13 doc: add guide for ppfe net PMD
In reply to Gagandeep SinghThis patch add documentation for ppfe network
poll mode driver.
PPFE is a hardware programmable packet
forwarding engine to provide high performance
ethernet interfaces.
--- MAINTAINERS | 1 + doc/guides/nics/features/ppfe.ini | 1 + doc/guides/nics/index.rst | 1 + doc/guides/nics/ppfe.rst | 168 ++++++++++++++++++++++++++++++ 4 files changed, 171 insertions(+) create mode 100644 doc/guides/nics/ppfe.rst
MAINTAINERS +1 -0
@@ -784,6 +784,7 @@ F: doc/guides/nics/features/enetc.ini NXP ppfe M: Gagandeep Singh <[email protected]> M: Akhil Goyal <[email protected]> +F: doc/guides/nics/ppfe.rst F: drivers/net/ppfe/ F: doc/guides/nics/features/ppfe.ini
doc/guides/nics/features/ppfe.ini +1 -0
@@ -6,3 +6,4 @@ [Features] Linux VFIO = Y ARMv8 = Y +Usage doc = Y
doc/guides/nics/index.rst +1 -0
@@ -47,6 +47,7 @@ Network Interface Controller Drivers nfp octeontx octeontx2 + ppfe qede sfc_efx softnic
doc/guides/nics/ppfe.rst new file +168 -0
168 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 4/13 net/ppfe: support dynamic logging
In reply to Gagandeep SinghThis patch introduces logging for the ppfe PMD.
--- drivers/net/ppfe/pfe_logs.h | 30 ++++++++++++++++ drivers/net/ppfe/ppfe_ethdev.c | 65 +++++++++++++++++++++++++++------- 2 files changed, 82 insertions(+), 13 deletions(-) create mode 100644 drivers/net/ppfe/pfe_logs.h
drivers/net/ppfe/pfe_logs.h new file +30 -0
@@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _PFE_LOGS_H_ +#define _PFE_LOGS_H_ + +/* PMD related logs */ + +#define PFE_PMD_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, "%s(): " fmt "\n",\ + __func__, ##args) + +#define PMD_INIT_FUNC_TRACE () PFE_PMD_LOG(DEBUG, " >>") + +#define PFE_PMD_DEBUG(fmt, args...) \ + PFE_PMD_LOG(DEBUG, fmt, ## args) +#define PFE_PMD_ERR(fmt, args...) \ + PFE_PMD_LOG(ERR, fmt, ## args) +#define PFE_PMD_INFO(fmt, args...) \ + PFE_PMD_LOG(INFO, fmt, ## args) + +#define PFE_PMD_WARN(fmt, args...) \ + PFE_PMD_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define PFE_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#endif /* _PFE_LOGS_H_ */
drivers/net/ppfe/ppfe_ethdev.c +52 -13
174 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 5/13 net/ppfe: add HW specific macros and operations
In reply to Gagandeep SinghThis patch add some hardware specific macros
and functions that will be used by the driver.
--- drivers/net/ppfe/base/cbus.h | 66 +++++ drivers/net/ppfe/base/cbus/bmu.h | 41 +++ drivers/net/ppfe/base/cbus/class_csr.h | 277 ++++++++++++++++++++ drivers/net/ppfe/base/cbus/emac_mtip.h | 231 +++++++++++++++++ drivers/net/ppfe/base/cbus/gpi.h | 77 ++++++ drivers/net/ppfe/base/cbus/hif.h | 86 +++++++ drivers/net/ppfe/base/cbus/hif_nocpy.h | 36 +++ drivers/net/ppfe/base/cbus/tmu_csr.h | 154 +++++++++++ drivers/net/ppfe/base/cbus/util_csr.h | 47 ++++ drivers/net/ppfe/base/pfe.h | 339 +++++++++++++++++++++++++ 10 files changed, 1354 insertions(+) create mode 100644 drivers/net/ppfe/base/cbus.h create mode 100644 drivers/net/ppfe/base/cbus/bmu.h create mode 100644 drivers/net/ppfe/base/cbus/class_csr.h create mode 100644 drivers/net/ppfe/base/cbus/emac_mtip.h create mode 100644 drivers/net/ppfe/base/cbus/gpi.h create mode 100644 drivers/net/ppfe/base/cbus/hif.h create mode 100644 drivers/net/ppfe/base/cbus/hif_nocpy.h create mode 100644 drivers/net/ppfe/base/cbus/tmu_csr.h create mode 100644 drivers/net/ppfe/base/cbus/util_csr.h create mode 100644 drivers/net/ppfe/base/pfe.h
drivers/net/ppfe/base/cbus.h new file +66 -0
@@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _CBUS_H_ +#define _CBUS_H_ + +#include <compat.h> + +#define EMAC1_BASE_ADDR (CBUS_BASE_ADDR + 0x200000) +#define EGPI1_BASE_ADDR (CBUS_BASE_ADDR + 0x210000) +#define EMAC2_BASE_ADDR (CBUS_BASE_ADDR + 0x220000) +#define EGPI2_BASE_ADDR (CBUS_BASE_ADDR + 0x230000) +#define BMU1_BASE_ADDR (CBUS_BASE_ADDR + 0x240000) +#define BMU2_BASE_ADDR (CBUS_BASE_ADDR + 0x250000) +#define ARB_BASE_ADDR (CBUS_BASE_ADDR + 0x260000) +#define DDR_CONFIG_BASE_ADDR (CBUS_BASE_ADDR + 0x270000) +#define HIF_BASE_ADDR (CBUS_BASE_ADDR + 0x280000) +#define HGPI_BASE_ADDR (CBUS_BASE_ADDR + 0x290000) +#define LMEM_BASE_ADDR (CBUS_BASE_ADDR + 0x300000) +#define LMEM_SIZE 0x10000 +#define LMEM_END (LMEM_BASE_ADDR + LMEM_SIZE) +#define TMU_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x310000) +#define CLASS_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x320000) +#define HIF_NOCPY_BASE_ADDR (CBUS_BASE_ADDR + 0x350000) +#define UTIL_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x360000) +#define CBUS_GPT_BASE_ADDR (CBUS_BASE_ADDR + 0x370000) + +/* +* defgroup XXX_MEM_ACCESS_ADDR PE memory access through CSR +* XXX_MEM_ACCESS_ADDR register bit definitions. +*/ +#define PE_MEM_ACCESS_WRITE BIT(31)/* Internal Memory Write. */ +#define PE_MEM_ACCESS_IMEM BIT(15) +#define PE_MEM_ACCESS_DMEM BIT(16) + +/* Byte Enables of the Internal memory access. These are interpred in BE */ +#define PE_MEM_ACCESS_BYTE_ENABLE (offset, size) \ + ({ typeof(size) size_ = (size); \ + (((BIT(size_) - 1) << (4 - (offset) - (size_))) & 0xf) << 24; }) + +#include "cbus/emac_mtip.h" +#include "cbus/gpi.h" +#include "cbus/bmu.h" +#include "cbus/hif.h" +#include "cbus/tmu_csr.h" +#include "cbus/class_csr.h" +#include "cbus/hif_nocpy.h" +#include "cbus/util_csr.h" + +/* PFE cores states */ +#define CORE_DISABLE 0x00000000 +#define CORE_ENABLE 0x00000001 +#define CORE_SW_RESET 0x00000002 + +/* LMEM defines */ +#define LMEM_HDR_SIZE 0x0010 +#define LMEM_BUF_SIZE_LN2 0x7 +#define LMEM_BUF_SIZE BIT(LMEM_BUF_SIZE_LN2) + +/* DDR defines */ +#define DDR_HDR_SIZE 0x0100 +#define DDR_BUF_SIZE_LN2 0xb +#define DDR_BUF_SIZE BIT(DDR_BUF_SIZE_LN2) + +#endif /* _CBUS_H_ */
drivers/net/ppfe/base/cbus/bmu.h new file +41 -0
41 lines not on this page · raw message
drivers/net/ppfe/base/cbus/class_csr.h new file +277 -0
277 lines not on this page · raw message
drivers/net/ppfe/base/cbus/emac_mtip.h new file +231 -0
231 lines not on this page · raw message
drivers/net/ppfe/base/cbus/gpi.h new file +77 -0
77 lines not on this page · raw message
drivers/net/ppfe/base/cbus/hif.h new file +86 -0
86 lines not on this page · raw message
drivers/net/ppfe/base/cbus/hif_nocpy.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _HIF_NOCPY_H_ +#define _HIF_NOCPY_H_ + +#define HIF_NOCPY_VERSION (HIF_NOCPY_BASE_ADDR + 0x00) +#define HIF_NOCPY_TX_CTRL (HIF_NOCPY_BASE_ADDR + 0x04) +#define HIF_NOCPY_TX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x08) +#define HIF_NOCPY_TX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x0c) +#define HIF_NOCPY_TX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x10) +#define HIF_NOCPY_TX_STATUS (HIF_NOCPY_BASE_ADDR + 0x14) +#define HIF_NOCPY_RX_CTRL (HIF_NOCPY_BASE_ADDR + 0x20) +#define HIF_NOCPY_RX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x24) +#define HIF_NOCPY_RX_STATUS (HIF_NOCPY_BASE_ADDR + 0x30) +#define HIF_NOCPY_INT_SRC (HIF_NOCPY_BASE_ADDR + 0x34) +#define HIF_NOCPY_INT_ENABLE (HIF_NOCPY_BASE_ADDR + 0x38) +#define HIF_NOCPY_POLL_CTRL (HIF_NOCPY_BASE_ADDR + 0x3c) +#define HIF_NOCPY_RX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x40) +#define HIF_NOCPY_RX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x44) +#define HIF_NOCPY_TX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x48) +#define HIF_NOCPY_RX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x4c) +#define HIF_NOCPY_RX_INQ0_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x50) +#define HIF_NOCPY_RX_INQ1_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x54) +#define HIF_NOCPY_TX_PORT_NO (HIF_NOCPY_BASE_ADDR + 0x60) +#define HIF_NOCPY_LMEM_ALLOC_ADDR (HIF_NOCPY_BASE_ADDR + 0x64) +#define HIF_NOCPY_CLASS_ADDR (HIF_NOCPY_BASE_ADDR + 0x68) +#define HIF_NOCPY_TMU_PORT0_ADDR (HIF_NOCPY_BASE_ADDR + 0x70) +#define HIF_NOCPY_TMU_PORT1_ADDR (HIF_NOCPY_BASE_ADDR + 0x74) +#define HIF_NOCPY_TMU_PORT2_ADDR (HIF_NOCPY_BASE_ADDR + 0x7c) +#define HIF_NOCPY_TMU_PORT3_ADDR (HIF_NOCPY_BASE_ADDR + 0x80) +#define HIF_NOCPY_TMU_PORT4_ADDR (HIF_NOCPY_BASE_ADDR + 0x84) +#define HIF_NOCPY_INT_COAL (HIF_NOCPY_BASE_ADDR + 0x90) + +#endif /* _HIF_NOCPY_H_ */
drivers/net/ppfe/base/cbus/tmu_csr.h new file +154 -0
154 lines not on this page · raw message
drivers/net/ppfe/base/cbus/util_csr.h new file +47 -0
47 lines not on this page · raw message
drivers/net/ppfe/base/pfe.h new file +339 -0
339 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 6/13 net/ppfe: add MAC and host interface initialisation
In reply to Gagandeep SinghHIF or host interface is responsible for transmit and receive packets between physical ethernet interfaces and HIF library defined logical interfaces.
This patch initialise that host interface and MAC.
--- drivers/net/ppfe/Makefile | 8 + drivers/net/ppfe/base/pfe.h | 83 +++++ drivers/net/ppfe/meson.build | 9 +- drivers/net/ppfe/pfe_hal.c | 597 +++++++++++++++++++++++++++++++++ drivers/net/ppfe/pfe_hif.c | 257 ++++++++++++++ drivers/net/ppfe/pfe_hif.h | 106 ++++++ drivers/net/ppfe/pfe_hif_lib.c | 18 + drivers/net/ppfe/pfe_hif_lib.h | 162 +++++++++ drivers/net/ppfe/pfe_mod.h | 5 + drivers/net/ppfe/ppfe_ethdev.c | 151 ++++++++- 10 files changed, 1393 insertions(+), 3 deletions(-) create mode 100644 drivers/net/ppfe/pfe_hal.c create mode 100644 drivers/net/ppfe/pfe_hif.c create mode 100644 drivers/net/ppfe/pfe_hif.h create mode 100644 drivers/net/ppfe/pfe_hif_lib.c create mode 100644 drivers/net/ppfe/pfe_hif_lib.h
drivers/net/ppfe/Makefile +8 -0
@@ -10,14 +10,22 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB = librte_pmd_ppfe.a CFLAGS += -O3 $(WERROR_FLAGS) +CFLAGS += -Wno-pointer-arith CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/net/ppfe/base/ CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax EXPORT_MAP := rte_pmd_ppfe_version.map LIBABIVER := 1 +# depends on v2p APIs which uses experimental API +CFLAGS += -DALLOW_EXPERIMENTAL_API + # Interfaces with DPDK SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += ppfe_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hal.c +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hif_lib.c +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hif.c LDLIBS += -lrte_bus_vdev LDLIBS += -lrte_bus_dpaa
drivers/net/ppfe/base/pfe.h +83 -0
93 lines not on this page · raw message
drivers/net/ppfe/meson.build +7 -2
@@ -6,6 +6,11 @@ if host_machine.system() != 'linux' endif deps += ['bus_dpaa'] -sources = files('ppfe_ethdev.c') +sources = files('ppfe_ethdev.c', + 'pfe_hal.c', + 'pfe_hif_lib.c', + 'pfe_hif.c') -includes += include_directories('../../bus/dpaa/include/') +allow_experimental_apis = true + +includes += include_directories('base','../../bus/dpaa/include/')
drivers/net/ppfe/pfe_hal.c new file +597 -0
597 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.c new file +257 -0
257 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.h new file +106 -0
106 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.c new file +18 -0
@@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#include "pfe_logs.h" +#include "pfe_mod.h" + +int pfe_hif_lib_init(__rte_unused struct pfe *pfe) +{ +PMD_INIT_FUNC_TRACE (); + +return 0 ; +} + +void pfe_hif_lib_exit(__rte_unused struct pfe *pfe) +{ +PMD_INIT_FUNC_TRACE (); +}
drivers/net/ppfe/pfe_hif_lib.h new file +162 -0
162 lines not on this page · raw message
drivers/net/ppfe/pfe_mod.h +5 -0
@@ -7,6 +7,9 @@struct pfe ; +#include "pfe.h" +#include "pfe_hif.h" +#include "pfe_hif_lib.h" #include "pfe_eth.h" #define PHYID_MAX_VAL 32
@@ -16,6 +19,8 @@ struct pfe {void *ddr_baseaddr;uint64_t ddr_size;void *cbus_baseaddr; +struct ls1012a_pfe_platform_data platform_data; +struct pfe_hif hif;struct pfe_eth eth;int mdio_muxval[PHYID_MAX_VAL ];uint8_t nb_devs;
drivers/net/ppfe/ppfe_ethdev.c +150 -1
223 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 7/13 net/ppfe: add device start stop operations
In reply to Gagandeep SinghThis patch adds device start, stop and close
operations.
--- drivers/net/ppfe/Makefile | 2 +- drivers/net/ppfe/pfe_eth.h | 1 + drivers/net/ppfe/pfe_hif.c | 136 +++++++++++++ drivers/net/ppfe/pfe_hif.h | 41 ++++ drivers/net/ppfe/pfe_hif_lib.c | 350 ++++++++++++++++++++++++++++++++- drivers/net/ppfe/pfe_hif_lib.h | 11 ++ drivers/net/ppfe/pfe_mod.h | 1 + drivers/net/ppfe/ppfe_ethdev.c | 187 ++++++++++++++++++ 8 files changed, 727 insertions(+), 2 deletions(-)
drivers/net/ppfe/Makefile +1 -1
@@ -30,7 +30,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hif.c LDLIBS += -lrte_bus_vdev LDLIBS += -lrte_bus_dpaa LDLIBS += -lrte_common_dpaax -LDLIBS += -lrte_eal +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool LDLIBS += -lrte_ethdev -lrte_kvargs include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/ppfe/pfe_eth.h +1 -0
@@ -53,6 +53,7 @@ struct ls1012a_pfe_platform_data {struct pfe_eth_priv_s {struct pfe *pfe; +struct hif_client_s client;int low_tmu_q;int high_tmu_q;struct rte_eth_dev *ndev;
drivers/net/ppfe/pfe_hif.c +136 -0
142 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.h +41 -0
59 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.c +349 -1
359 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.h +11 -0
@@ -5,6 +5,8 @@#ifndef _PFE_HIF_LIB_H_#define _PFE_HIF_LIB_H_ +#include "pfe_hif.h" +#define HIF_CL_REQ_TIMEOUT 10#define GFP_DMA_PFE 0
@@ -158,5 +160,14 @@ extern unsigned int emac_txq_cnt;int pfe_hif_lib_init (struct pfe *pfe);void pfe_hif_lib_exit (struct pfe *pfe); +int hif_lib_client_register (struct hif_client_s *client); +int hif_lib_client_unregister (struct hif_client_s *client); +void hif_lib_indicate_client (struct hif_client_s *client,int event,int data); +int hif_lib_event_handler_start (struct hif_client_s *client,int event,int + data); +void *hif_lib_tx_get_next_complete (struct hif_client_s *client,int qno, +unsigned int *flags,int count); +int pfe_hif_shm_init (struct hif_shm *hif_shm,struct rte_mempool *mb_pool); +void pfe_hif_shm_clean (struct hif_shm *hif_shm);#endif /* _PFE_HIF_LIB_H_ */
drivers/net/ppfe/pfe_mod.h +1 -0
@@ -22,6 +22,7 @@ struct pfe {struct ls1012a_pfe_platform_data platform_data;struct pfe_hif hif;struct pfe_eth eth; +struct hif_client_s *hif_client[HIF_CLIENTS_MAX ];int mdio_muxval[PHYID_MAX_VAL ];uint8_t nb_devs;uint8_t max_intf;
drivers/net/ppfe/ppfe_ethdev.c +187 -0
211 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 8/13 net/ppfe: add queue setup and release operations
In reply to Gagandeep SinghThis patch add RX/TX queue setup operations and supported checksum offloads.
--- doc/guides/nics/features/ppfe.ini | 2 + doc/guides/nics/ppfe.rst | 1 + drivers/net/ppfe/pfe_hif.c | 114 ++++++++++++++++++++++++++++++ drivers/net/ppfe/pfe_hif.h | 1 + drivers/net/ppfe/pfe_hif_lib.c | 48 +++++++++++++ drivers/net/ppfe/ppfe_ethdev.c | 100 +++++++++++++++++++++++++- 6 files changed, 263 insertions(+), 3 deletions(-)
doc/guides/nics/features/ppfe.ini +2 -0
@@ -4,6 +4,8 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +L3 checksum offload = Y +L4 checksum offload = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +1 -0
@@ -91,6 +91,7 @@ pfe.ko is required for PHY initialisation. PPFE Features ~~~~~~~~~~~~~~ +- L3/L4 checksum offload - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/pfe_hif.c +114 -0
120 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.h +1 -0
@@ -143,5 +143,6 @@ void hif_process_client_req(struct pfe_hif *hif, int req, int data1, intint pfe_hif_init (struct pfe *pfe);void pfe_hif_exit (struct pfe *pfe);void pfe_hif_rx_idle (struct pfe_hif *hif); +int pfe_hif_init_buffers (struct pfe_hif *hif);#endif /* _PFE_HIF_H_ */
drivers/net/ppfe/pfe_hif_lib.c +48 -0
54 lines not on this page · raw message
drivers/net/ppfe/ppfe_ethdev.c +97 -3
124 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 9/13 net/ppfe: add burst enqueue and dequeue operations
In reply to Gagandeep SinghThis patch add burst enqueue and dequeue operations to the ppfe PMD.
--- drivers/net/ppfe/pfe_hif.c | 350 +++++++++++++++++++++++++++++++++ drivers/net/ppfe/pfe_hif.h | 8 + drivers/net/ppfe/pfe_hif_lib.c | 143 ++++++++++++++ drivers/net/ppfe/pfe_hif_lib.h | 8 + drivers/net/ppfe/pfe_mod.h | 2 + drivers/net/ppfe/ppfe_ethdev.c | 140 +++++++++++++ 6 files changed, 651 insertions(+)
drivers/net/ppfe/pfe_hif.c +350 -0
@@ -45,6 +45,37 @@ static void pfe_hif_free_descr(struct pfe_hif *hif)rte_free (hif->descr_baseaddr_v); } +/* pfe_hif_release_buffers */ +static void pfe_hif_release_buffers (struct pfe_hif *hif) +{ +struct hif_desc *desc; +uint32_t i =0 ; +struct rte_mbuf *mbuf; +struct rte_pktmbuf_pool_private *mb_priv; + + hif->rx_base = hif->descr_baseaddr_v; + +/*Free Rx buffers */ + desc = hif->rx_base; + mb_priv =rte_mempool_get_priv (hif->shm->pool); +for (i =0 ; i < hif->rx_ring_size; i++) { +if (readl (&desc->data)) { +if (i < hif->shm->rx_buf_pool_cnt && + !hif->shm->rx_buf_pool[i]) { + mbuf = hif->rx_buf_vaddr[i] +PFE_PKT_HEADER_SZ + -sizeof (struct rte_mbuf ) + -RTE_PKTMBUF_HEADROOM + - mb_priv->mbuf_priv_size; + hif->shm->rx_buf_pool[i] = mbuf; + } + } +writel (0 , &desc->data); +writel (0 , &desc->status); +writel (0 , &desc->ctrl); + desc++; + } +} +/* * pfe_hif_init_buffers * This function initializes the HIF Rx/Tx ring descriptors and
@@ -258,6 +289,322 @@ static void pfe_hif_client_unregister(struct pfe_hif *hif, u32 client_id)rte_spinlock_unlock (&hif->tx_lock); } +/* +* client_put_rxpacket- +*/ +static struct rte_mbuf *client_put_rxpacket (struct hif_rx_queue *queue, +void *pkt,u32 len, +u32 flags,u32 client_ctrl, +struct rte_mempool *pool, +u32 *rem_len) +{ +struct rx_queue_desc *desc = queue->base + queue->write_idx; +struct rte_mbuf *mbuf =NULL ; + + +if (readl (&desc->ctrl) &CL_DESC_OWN ) { + mbuf =rte_cpu_to_le_64 (rte_pktmbuf_alloc (pool)); +if (unlikely (!mbuf)) { +PFE_PMD_WARN ("Buffer allocation failure\n" ); +return NULL ; + } + + desc->data = pkt; + desc->client_ctrl = client_ctrl; +/* +* Ensure everything else is written to DDR before +* writing bd->ctrl +*/ +rte_wmb (); +writel (CL_DESC_BUF_LEN (len) | flags, &desc->ctrl); + queue->write_idx = (queue->write_idx +1 ) + & (queue->size -1 ); + + *rem_len = mbuf->buf_len; + } + +return mbuf; +} + +/* +* pfe_hif_rx_process- +* This function does pfe hif rx queue processing. +* Dequeue packet from Rx queue and send it to corresponding client queue +*/ +int pfe_hif_rx_process (struct pfe *pfe,int budget) +{ +struct hif_desc *desc; +struct hif_hdr *pkt_hdr; +struct __hif_hdr hif_hdr; +void *free_buf; +int rtc, len, rx_processed =0 ; +struct __hif_desc local_desc; +int flags =0 , wait_for_last =0 , retry =0 ; +unsigned int buf_size =0 ; +struct rte_mbuf *mbuf =NULL ; +struct pfe_hif *hif = &pfe->hif; + +rte_spinlock_lock (&hif->lock); + + rtc = hif->rxtoclean_index; + +while (rx_processed < budget) { + desc = hif->rx_base + rtc; + +__memcpy12 (&local_desc, desc); + +/* ACK pending Rx interrupt */ +if (local_desc.ctrl &BD_CTRL_DESC_EN ) { +if (unlikely (wait_for_last)) +continue ; +else +break ; + } + + len =BD_BUF_LEN (local_desc.ctrl); + pkt_hdr = (struct hif_hdr *)hif->rx_buf_vaddr[rtc]; + +/* Track last HIF header received */ +if (!hif->started) { + hif->started =1 ; + +__memcpy8 (&hif_hdr, pkt_hdr); + + hif->qno = hif_hdr.hdr.q_num; + hif->client_id = hif_hdr.hdr.client_id; + hif->client_ctrl = (hif_hdr.hdr.client_ctrl1 <<16 ) | + hif_hdr.hdr.client_ctrl; + flags =CL_DESC_FIRST ; + + }else { + flags =0 ; + } + +if (local_desc.ctrl &BD_CTRL_LIFM ) { + flags |=CL_DESC_LAST ; + wait_for_last =0 ; + }else { + wait_for_last =1 ; + } + +/* Check for valid client id and still registered */ +if (hif->client_id >=HIF_CLIENTS_MAX || + !(test_bit (hif->client_id, + &hif->shm->g_client_status[0 ]))) { +PFE_PMD_INFO ("packet with invalid client id %d qnum %d" , + hif->client_id, hif->qno); + + free_buf = hif->rx_buf_addr[rtc]; + + goto pkt_drop; + } + +/* Check to valid queue number */ +if (hif->client[hif->client_id].rx_qn <= hif->qno) { +PFE_DP_LOG (DEBUG ,"packet with invalid queue: %d" , + hif->qno); + hif->qno =0 ; + } + +retry: + mbuf = +client_put_rxpacket (&hif->client[hif->client_id].rx_q[hif->qno], + (void *)pkt_hdr, len, flags, + hif->client_ctrl, hif->shm->pool, + &buf_size); + +if (unlikely (!mbuf)) { +if (!retry) { +pfe_tx_do_cleanup (pfe); + retry =1 ; + goto retry; + } + rx_processed = budget; + +if (flags &CL_DESC_FIRST ) + hif->started =0 ; + +PFE_DP_LOG (DEBUG ,"No buffers" ); +break ; + }else { + retry =0 ; + } + + free_buf = (void *)(size_t )rte_pktmbuf_iova (mbuf); + free_buf = free_buf -PFE_PKT_HEADER_SZ ; + +/*Fill free buffer in the descriptor */ + hif->rx_buf_addr[rtc] = free_buf; + hif->rx_buf_vaddr[rtc] = (void *)((size_t )mbuf->buf_addr + + mbuf->data_off -PFE_PKT_HEADER_SZ ); + hif->rx_buf_len[rtc] = buf_size -RTE_PKTMBUF_HEADROOM ; + +pkt_drop: +writel (DDR_PHYS_TO_PFE (free_buf), &desc->data); +/* +* Ensure everything else is written to DDR before +* writing bd->ctrl +*/ +rte_wmb (); +writel ((BD_CTRL_PKT_INT_EN |BD_CTRL_LIFM |BD_CTRL_DIR | +BD_CTRL_DESC_EN |BD_BUF_LEN (hif->rx_buf_len[rtc])), + &desc->ctrl); + + rtc = (rtc +1 ) & (hif->rx_ring_size -1 ); + +if (local_desc.ctrl &BD_CTRL_LIFM ) { +if (!(hif->client_ctrl &HIF_CTRL_RX_CONTINUED )) + rx_processed++; + + hif->started =0 ; + } + } + + + hif->rxtoclean_index = rtc; +rte_spinlock_unlock (&hif->lock); + +/* we made some progress, re-start rx dma in case it stopped */ +hif_rx_dma_start (); + +return rx_processed; +} + +/* +* client_ack_txpacket- +* This function ack the Tx packet in the give client Tx queue by resetting +* ownership bit in the descriptor. +*/ +static int client_ack_txpacket (struct pfe_hif *hif,unsigned int client_id, +unsigned int q_no) +{ +struct hif_tx_queue *queue = &hif->client[client_id].tx_q[q_no]; +struct tx_queue_desc *desc = queue->base + queue->ack_idx; + +if (readl (&desc->ctrl) &CL_DESC_OWN ) { +writel ((readl (&desc->ctrl) & ~CL_DESC_OWN ), &desc->ctrl); + queue->ack_idx = (queue->ack_idx +1 ) & (queue->size -1 ); + +return 0 ; + + }else { +/*This should not happen */ +PFE_PMD_ERR ("%d %d %d %d %d %p %d" , + hif->txtosend, hif->txtoclean, hif->txavail, + client_id, q_no, queue, queue->ack_idx); +return 1 ; + } +} + +static void __hif_tx_done_process (struct pfe *pfe,int count) +{ +struct hif_desc *desc; +struct hif_desc_sw *desc_sw; +unsigned int ttc, tx_avl; +int pkts_done[HIF_CLIENTS_MAX ] = {0 ,0 }; +struct pfe_hif *hif = &pfe->hif; + + ttc = hif->txtoclean; + tx_avl = hif->txavail; + +while ((tx_avl < hif->tx_ring_size) && count--) { + desc = hif->tx_base + ttc; + +if (readl (&desc->ctrl) &BD_CTRL_DESC_EN ) +break ; + + desc_sw = &hif->tx_sw_queue[ttc]; + +if (desc_sw->client_id >HIF_CLIENTS_MAX ) +PFE_PMD_ERR ("Invalid cl id %d" , desc_sw->client_id); + + pkts_done[desc_sw->client_id]++; + +client_ack_txpacket (hif, desc_sw->client_id, desc_sw->q_no); + + ttc = (ttc +1 ) & (hif->tx_ring_size -1 ); + tx_avl++; + } + +if (pkts_done[0 ]) +hif_lib_indicate_client (pfe->hif_client[0 ],EVENT_TXDONE_IND , +0 ); +if (pkts_done[1 ]) +hif_lib_indicate_client (pfe->hif_client[1 ],EVENT_TXDONE_IND , +0 ); + hif->txtoclean = ttc; + hif->txavail = tx_avl; +} + +static inline void hif_tx_done_process (struct pfe *pfe,int count) +{ +struct pfe_hif *hif = &pfe->hif; +rte_spinlock_lock (&hif->tx_lock); +__hif_tx_done_process (pfe, count); +rte_spinlock_unlock (&hif->tx_lock); +} + +void pfe_tx_do_cleanup (struct pfe *pfe) +{ +hif_tx_done_process (pfe,HIF_TX_DESC_NT ); +} + +/* +* __hif_xmit_pkt - +* This function puts one packet in the HIF Tx queue +*/ +void hif_xmit_pkt (struct pfe_hif *hif,unsigned int client_id,unsigned int + q_no,void *data,u32 len,unsigned int flags) +{ +struct hif_desc *desc; +struct hif_desc_sw *desc_sw; + + desc = hif->tx_base + hif->txtosend; + desc_sw = &hif->tx_sw_queue[hif->txtosend]; + + desc_sw->len = len; + desc_sw->client_id = client_id; + desc_sw->q_no = q_no; + desc_sw->flags = flags; + +writel ((u32 )DDR_PHYS_TO_PFE (data), &desc->data); + + hif->txtosend = (hif->txtosend +1 ) & (hif->tx_ring_size -1 ); + hif->txavail--; + +if ((!((flags &HIF_DATA_VALID ) && (flags & +HIF_LAST_BUFFER )))) + goto skip_tx; + +/* +* Ensure everything else is written to DDR before +* writing bd->ctrl +*/ +rte_wmb (); + +do { + desc_sw = &hif->tx_sw_queue[hif->txtoflush]; + desc = hif->tx_base + hif->txtoflush; + +if (desc_sw->flags &HIF_LAST_BUFFER ) { +writel ((BD_CTRL_LIFM | +BD_CTRL_BRFETCH_DISABLE |BD_CTRL_RTFETCH_DISABLE + |BD_CTRL_PARSE_DISABLE |BD_CTRL_DESC_EN | +BD_BUF_LEN (desc_sw->len)), + &desc->ctrl); + }else { +writel ((BD_CTRL_DESC_EN | +BD_BUF_LEN (desc_sw->len)), &desc->ctrl); + } + hif->txtoflush = (hif->txtoflush +1 ) & (hif->tx_ring_size -1 ); + } +while (hif->txtoflush != hif->txtosend) + ; + +skip_tx: +return ; +} +void hif_process_client_req (struct pfe_hif *hif,int req, int data1, __rte_unused int data2) {
@@ -500,6 +847,9 @@ void pfe_hif_exit(struct pfe *pfe)hif_rx_disable ();hif_tx_disable (); +pfe_hif_release_buffers (hif); +pfe_hif_shm_clean (hif->shm); +pfe_hif_free_descr (hif); pfe->hif.setuped =0 ; }
drivers/net/ppfe/pfe_hif.h +8 -0
@@ -138,11 +138,19 @@ struct pfe_hif {struct rte_device *dev; }; +void hif_xmit_pkt (struct pfe_hif *hif,unsigned int client_id,unsigned int + q_no,void *data,u32 len,unsigned int flags);void hif_process_client_req (struct pfe_hif *hif,int req,int data1,int data2);int pfe_hif_init (struct pfe *pfe);void pfe_hif_exit (struct pfe *pfe);void pfe_hif_rx_idle (struct pfe_hif *hif); +int pfe_hif_rx_process (struct pfe *pfe,int budget);int pfe_hif_init_buffers (struct pfe_hif *hif); +void pfe_tx_do_cleanup (struct pfe *pfe); + +#define __memcpy8 (dst, src) memcpy(dst, src, 8) +#define __memcpy12 (dst, src) memcpy(dst, src, 12) +#define __memcpy (dst, src, len) memcpy(dst, src, len)#endif /* _PFE_HIF_H_ */
drivers/net/ppfe/pfe_hif_lib.c +143 -0
149 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.h +8 -0
@@ -162,6 +162,9 @@ int pfe_hif_lib_init(struct pfe *pfe);void pfe_hif_lib_exit (struct pfe *pfe);int hif_lib_client_register (struct hif_client_s *client);int hif_lib_client_unregister (struct hif_client_s *client); +void hif_lib_xmit_pkt (struct hif_client_s *client,unsigned int qno, +void *data,void *data1,unsigned int len, +u32 client_ctrl,unsigned int flags,void *client_data);void hif_lib_indicate_client (struct hif_client_s *client,int event,int data);int hif_lib_event_handler_start (struct hif_client_s *client,int event,int data);
@@ -170,4 +173,9 @@ void *hif_lib_tx_get_next_complete(struct hif_client_s *client, int qno,int pfe_hif_shm_init (struct hif_shm *hif_shm,struct rte_mempool *mb_pool);void pfe_hif_shm_clean (struct hif_shm *hif_shm); +int hif_lib_receive_pkt (struct hif_client_rx_queue *queue, +struct rte_mempool *pool, +struct rte_mbuf **rx_pkts, +uint16_t nb_pkts); +#endif /* _PFE_HIF_LIB_H_ */
drivers/net/ppfe/pfe_mod.h +2 -0
@@ -7,6 +7,8 @@struct pfe ; +#include <rte_ethdev.h> +#include "pfe.h" #include "pfe_hif.h" #include "pfe_hif_lib.h"
drivers/net/ppfe/ppfe_ethdev.c +140 -0
170 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 10/13 net/ppfe: add supported packet types and basic statistics
In reply to Gagandeep SinghThis patch add support for supported packet types by the platform andbasic statistics like numbers of packets/bytes receive and transmit.
--- doc/guides/nics/features/ppfe.ini | 2 ++ doc/guides/nics/ppfe.rst | 2 ++ drivers/net/ppfe/ppfe_ethdev.c | 43 +++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+)
doc/guides/nics/features/ppfe.ini +2 -0
@@ -6,6 +6,8 @@ [Features] L3 checksum offload = Y L4 checksum offload = Y +Packet type parsing = Y +Basic stats = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +2 -0
@@ -92,6 +92,8 @@ PPFE Features ~~~~~~~~~~~~~~ - L3/L4 checksum offload +- Packet type parsing +- Basic stats - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +43 -0
55 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 11/13 net/ppfe: add MTU and MAC address set operations
In reply to Gagandeep SinghTo update MAC address or MTU, operations are added to the driver.
--- doc/guides/nics/features/ppfe.ini | 1 + doc/guides/nics/ppfe.rst | 1 + drivers/net/ppfe/ppfe_ethdev.c | 62 +++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+)
doc/guides/nics/features/ppfe.ini +1 -0
@@ -8,6 +8,7 @@ L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y Basic stats = Y +MTU update = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +1 -0
@@ -94,6 +94,7 @@ PPFE Features - L3/L4 checksum offload - Packet type parsing - Basic stats +- MTU update - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +62 -0
92 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 12/13 net/ppfe: add allmulticast and promiscuous
In reply to Gagandeep SinghThis patch adds support to enable multicast and
promiscuous mode.
--- doc/guides/nics/features/ppfe.ini | 2 ++ doc/guides/nics/ppfe.rst | 2 ++ drivers/net/ppfe/ppfe_ethdev.c | 36 +++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+)
doc/guides/nics/features/ppfe.ini +2 -0
@@ -9,6 +9,8 @@ L4 checksum offload = Y Packet type parsing = Y Basic stats = Y MTU update = Y +Promiscuous mode = Y +Allmulticast mode = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +2 -0
@@ -95,6 +95,8 @@ PPFE Features - Packet type parsing - Basic stats - MTU update +- Promiscuous mode +- Allmulticast mode - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +36 -0
@@ -541,6 +541,39 @@ pfe_supported_ptypes_get(struct rte_eth_dev *dev)return NULL ; } +static void +pfe_promiscuous_enable (struct rte_eth_dev *dev) +{ +struct pfe_eth_priv_s *priv = dev->data->dev_private; + + priv->promisc =1 ; + dev->data->promiscuous =1 ; +gemac_enable_copy_all (priv->EMAC_baseaddr); +} + +static void +pfe_promiscuous_disable (struct rte_eth_dev *dev) +{ +struct pfe_eth_priv_s *priv = dev->data->dev_private; + + priv->promisc =0 ; + dev->data->promiscuous =0 ; +gemac_disable_copy_all (priv->EMAC_baseaddr); +} + +static void +pfe_allmulticast_enable (struct rte_eth_dev *dev) +{ +struct pfe_eth_priv_s *priv = dev->data->dev_private; +struct pfe_mac_addr hash_addr;/* hash register structure */ + +/* Set the hash to rx all multicast frames */ + hash_addr.bottom =0xFFFFFFFF ; + hash_addr.top =0xFFFFFFFF ; +gemac_set_hash (priv->EMAC_baseaddr, &hash_addr); + dev->data->all_multicast =1 ; +} +static int pfe_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) {
@@ -624,6 +657,9 @@ static const struct eth_dev_ops ops = { .tx_queue_setup = pfe_tx_queue_setup, .tx_queue_release = pfe_tx_queue_release, .dev_supported_ptypes_get = pfe_supported_ptypes_get, + .promiscuous_enable = pfe_promiscuous_enable, + .promiscuous_disable = pfe_promiscuous_disable, + .allmulticast_enable = pfe_allmulticast_enable, .mtu_set = pfe_mtu_set, .mac_addr_set = pfe_dev_set_mac_addr, .stats_get = pfe_stats_get,
Signature · 1 line
2.17.1
PATCH 13/13 net/ppfe: add link status update
In reply to Gagandeep SinghThis patch add link related operations like link update, up and down.
--- doc/guides/nics/features/ppfe.ini | 1 + doc/guides/nics/ppfe.rst | 1 + drivers/net/ppfe/ppfe_ethdev.c | 103 ++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+)
doc/guides/nics/features/ppfe.ini +1 -0
@@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +Link status = Y L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y
doc/guides/nics/ppfe.rst +1 -0
@@ -97,6 +97,7 @@ PPFE Features - MTU update - Promiscuous mode - Allmulticast mode +- Link status - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +103 -0
130 lines not on this page · raw message
Signature · 1 line
2.17.1
Hi Ferruh,
Quoted 27 lines
Subject: [PATCH v1 00/13] introduces ppfe network PMD
This series introduces ppfe (programmable packet forwarding engine) network poll mode driver for NXP SoC ls1012a.
First patch of this series move OF library code from dpaa bus to a common folder as PPFE also uses the same library for getting information from the device tree.
This patch is included in this series so that compilation by CI don't break.Gagandeep Singh (12):
net/ppfe: introduce ppfe net poll mode driver
doc: add guide for ppfe net PMD
net/ppfe: support dynamic logging
net/ppfe: add HW specific macros and operations net/ppfe: add MAC and host interface initialisation net/ppfe: add device start stop operations net/ppfe: add queue setup and release operations net/ppfe: add burst enqueue and dequeue operations net/ppfe: add supported packet types and basic statistics net/ppfe: add MTU and MAC address set operations net/ppfe: add allmulticast and promiscuous net/ppfe: add link status update
Quoted 3 lines
Hemant Agrawal (1):
common/dpaax: moving OF lib code from dpaa bus
We are seeing DPDK compilation break on CENTOS in CI test reports. One of the error is " error: unknown pragma ignored [-Werror,-Wunknown-pragmas]" with clang version 3.4.2 which is pretty old and it seems this version of clang is not supporting the function level optimization.
Do you know why we are using such an old version of clang? Can you please suggest how can I fix this issue?
Thanks,
Gagan
v2 cover introduces ppfe network PMD
In reply to Gagandeep SinghThis series introduces ppfe (programmable packet forwarding engine) network poll mode driver for NXP SoC ls1012a.
First patch of this series move OF library code from dpaa bus to a common folder as PPFE also uses the same library for getting information from the device tree.
This patch is included in this series so that compilation by CI don't break.
V2 Change-log:
* fix compilation break for clang3.4 and gcc 4.8
* fix checkpatch errors
Gagandeep Singh (12):
net/ppfe: introduce ppfe net poll mode driver
doc: add guide for ppfe net PMD
net/ppfe: support dynamic logging
net/ppfe: add HW specific macros and operations net/ppfe: add MAC and host interface initialisation net/ppfe: add device start stop operations net/ppfe: add queue setup and release operations net/ppfe: add burst enqueue and dequeue operations net/ppfe: add supported packet types and basic statistics net/ppfe: add MTU and MAC address set operations net/ppfe: add allmulticast and promiscuous net/ppfe: add link status update
Hemant Agrawal (1):
common/dpaax: moving OF lib code from dpaa bus
MAINTAINERS | 7 +
config/common_base | 5 +
config/common_linux | 5 +
doc/guides/nics/features/ppfe.ini | 17 +
doc/guides/nics/index.rst | 1 +
doc/guides/nics/ppfe.rst | 175 +++
drivers/bus/dpaa/Makefile | 2 +-
drivers/bus/dpaa/base/qbman/dpaa_sys.h | 1 +
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/compat.h | 1 -
drivers/bus/dpaa/include/fman.h | 1 +
drivers/bus/dpaa/include/fsl_usd.h | 1 +
drivers/bus/dpaa/meson.build | 1 -
drivers/bus/dpaa/rte_dpaa_bus.h | 2 +-
drivers/bus/fslmc/Makefile | 1 +
drivers/common/dpaax/Makefile | 10 +-
.../dpaa/include => common/dpaax}/dpaa_list.h | 0
drivers/common/dpaax/dpaax_logs.h | 10 +
drivers/common/dpaax/meson.build | 5 +-
.../{bus/dpaa/base/fman => common/dpaax}/of.c | 61 +-
.../{bus/dpaa/include => common/dpaax}/of.h | 27 +-
.../common/dpaax/rte_common_dpaax_version.map | 18 +
drivers/crypto/caam_jr/Makefile | 2 +
drivers/crypto/dpaa2_sec/Makefile | 2 +-
drivers/crypto/dpaa_sec/Makefile | 1 +
drivers/event/dpaa/Makefile | 1 +
drivers/event/dpaa2/Makefile | 1 +
drivers/mempool/dpaa/Makefile | 1 +
drivers/mempool/dpaa2/Makefile | 1 +
drivers/net/Makefile | 1 +
drivers/net/dpaa/Makefile | 1 +
drivers/net/dpaa2/Makefile | 1 +
drivers/net/meson.build | 1 +
drivers/net/ppfe/Makefile | 36 +
drivers/net/ppfe/base/cbus.h | 66 +
drivers/net/ppfe/base/cbus/bmu.h | 41 +
drivers/net/ppfe/base/cbus/class_csr.h | 277 ++++
drivers/net/ppfe/base/cbus/emac_mtip.h | 231 ++++
drivers/net/ppfe/base/cbus/gpi.h | 77 ++
drivers/net/ppfe/base/cbus/hif.h | 86 ++
drivers/net/ppfe/base/cbus/hif_nocpy.h | 36 +
drivers/net/ppfe/base/cbus/tmu_csr.h | 154 +++
drivers/net/ppfe/base/cbus/util_csr.h | 47 +
drivers/net/ppfe/base/pfe.h | 422 ++++++
drivers/net/ppfe/meson.build | 16 +
drivers/net/ppfe/pfe_eth.h | 78 ++
drivers/net/ppfe/pfe_hal.c | 596 +++++++++
drivers/net/ppfe/pfe_hif.c | 848 ++++++++++++
drivers/net/ppfe/pfe_hif.h | 156 +++
drivers/net/ppfe/pfe_hif_lib.c | 557 ++++++++
drivers/net/ppfe/pfe_hif_lib.h | 181 +++
drivers/net/ppfe/pfe_logs.h | 30 +
drivers/net/ppfe/pfe_mod.h | 59 +
drivers/net/ppfe/ppfe_ethdev.c | 1183 +++++++++++++++++
drivers/net/ppfe/rte_pmd_ppfe_version.map | 4 +
drivers/raw/dpaa2_cmdif/Makefile | 1 +
drivers/raw/dpaa2_qdma/Makefile | 1 +
mk/rte.app.mk | 1 +
58 files changed, 5504 insertions(+), 46 deletions(-)
create mode 100644 doc/guides/nics/features/ppfe.ini
create mode 100644 doc/guides/nics/ppfe.rst
rename drivers/{bus/dpaa/include => common/dpaax}/dpaa_list.h (100%)
rename drivers/{bus/dpaa/base/fman => common/dpaax}/of.c (88%)
rename drivers/{bus/dpaa/include => common/dpaax}/of.h (86%)
create mode 100644 drivers/net/ppfe/Makefile
create mode 100644 drivers/net/ppfe/base/cbus.h
create mode 100644 drivers/net/ppfe/base/cbus/bmu.h
create mode 100644 drivers/net/ppfe/base/cbus/class_csr.h
create mode 100644 drivers/net/ppfe/base/cbus/emac_mtip.h
create mode 100644 drivers/net/ppfe/base/cbus/gpi.h
create mode 100644 drivers/net/ppfe/base/cbus/hif.h
create mode 100644 drivers/net/ppfe/base/cbus/hif_nocpy.h
create mode 100644 drivers/net/ppfe/base/cbus/tmu_csr.h
create mode 100644 drivers/net/ppfe/base/cbus/util_csr.h
create mode 100644 drivers/net/ppfe/base/pfe.h
create mode 100644 drivers/net/ppfe/meson.build
create mode 100644 drivers/net/ppfe/pfe_eth.h
create mode 100644 drivers/net/ppfe/pfe_hal.c
create mode 100644 drivers/net/ppfe/pfe_hif.c
create mode 100644 drivers/net/ppfe/pfe_hif.h
create mode 100644 drivers/net/ppfe/pfe_hif_lib.c
create mode 100644 drivers/net/ppfe/pfe_hif_lib.h
create mode 100644 drivers/net/ppfe/pfe_logs.h
create mode 100644 drivers/net/ppfe/pfe_mod.h
create mode 100644 drivers/net/ppfe/ppfe_ethdev.c
create mode 100644 drivers/net/ppfe/rte_pmd_ppfe_version.mapSignature · 1 line
2.17.1
PATCH v2 1/13 common/dpaax: moving OF lib code from dpaa bus
From: Hemant Agrawal <[email protected]>
This code is being shared by more than 1 type of driver. Common is most appropriate place for it.
---
drivers/bus/dpaa/Makefile | 2 +-
drivers/bus/dpaa/base/qbman/dpaa_sys.h | 1 +
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/compat.h | 1 -
drivers/bus/dpaa/include/fman.h | 1 +
drivers/bus/dpaa/include/fsl_usd.h | 1 +
drivers/bus/dpaa/meson.build | 1 -
drivers/bus/dpaa/rte_dpaa_bus.h | 2 +-
drivers/bus/fslmc/Makefile | 1 +
drivers/common/dpaax/Makefile | 10 +--
.../dpaa/include => common/dpaax}/dpaa_list.h | 0
drivers/common/dpaax/dpaax_logs.h | 10 +++
drivers/common/dpaax/meson.build | 5 +-
.../{bus/dpaa/base/fman => common/dpaax}/of.c | 61 ++++++++++---------
.../{bus/dpaa/include => common/dpaax}/of.h | 27 ++++++--
.../common/dpaax/rte_common_dpaax_version.map | 18 ++++++
drivers/crypto/caam_jr/Makefile | 2 +
drivers/crypto/dpaa2_sec/Makefile | 2 +-
drivers/crypto/dpaa_sec/Makefile | 1 +
drivers/event/dpaa/Makefile | 1 +
drivers/event/dpaa2/Makefile | 1 +
drivers/mempool/dpaa/Makefile | 1 +
drivers/mempool/dpaa2/Makefile | 1 +
drivers/net/dpaa/Makefile | 1 +
drivers/net/dpaa2/Makefile | 1 +
drivers/raw/dpaa2_cmdif/Makefile | 1 +
drivers/raw/dpaa2_qdma/Makefile | 1 +
27 files changed, 110 insertions(+), 46 deletions(-)
rename drivers/{bus/dpaa/include => common/dpaax}/dpaa_list.h (100%)
rename drivers/{bus/dpaa/base/fman => common/dpaax}/of.c (88%)
rename drivers/{bus/dpaa/include => common/dpaax}/of.h (86%)drivers/bus/dpaa/Makefile +1 -1
@@ -17,6 +17,7 @@ CFLAGS += -Wno-cast-qual CFLAGS += -I$(RTE_BUS_DPAA)/ CFLAGS += -I$(RTE_BUS_DPAA)/include CFLAGS += -I$(RTE_BUS_DPAA)/base/qbman +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include # versioning export map
@@ -32,7 +33,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \ base/fman/fman.c \ base/fman/fman_hw.c \ - base/fman/of.c \ base/fman/netcfg_layer.c \ base/qbman/process.c \ base/qbman/bman.c \
drivers/bus/dpaa/base/qbman/dpaa_sys.h +1 -0
@@ -8,6 +8,7 @@#ifndef __DPAA_SYS_H#define __DPAA_SYS_H +#include <compat.h> #include <of.h> /* For 2-element tables related to cache-inhibited and cache-enabled mappings */
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -32,6 +32,7 @@#include <rte_bus.h> #include <rte_mbuf_pool_ops.h> +#include <of.h> #include <rte_dpaa_bus.h> #include <rte_dpaa_logs.h> #include <dpaax_iova_table.h>
@@ -39,7 +40,6 @@#include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> #include <netcfg.h> int dpaa_logtype_bus;
drivers/bus/dpaa/include/compat.h +0 -1
@@ -390,7 +390,6 @@ static inline unsigned long get_zeroed_page(gfp_t __foo __rte_unused)#define atomic_dec_return (v) rte_atomic32_sub_return(v, 1)#define atomic_sub_and_test (i, v) (rte_atomic32_sub_return(v, i) == 0) -#include <dpaa_list.h> #include <dpaa_bits.h> #endif /* __COMPAT_H */
drivers/bus/dpaa/include/fman.h +1 -0
@@ -15,6 +15,7 @@#include <rte_ether.h> #include <compat.h> +#include <dpaa_list.h> #ifndef FMAN_DEVICE_PATH #define FMAN_DEVICE_PATH "/dev/mem"
drivers/bus/dpaa/include/fsl_usd.h +1 -0
@@ -9,6 +9,7 @@#define __FSL_USD_H#include <compat.h> +#include <dpaa_list.h> #include <fsl_qman.h> #ifdef __cplusplus
drivers/bus/dpaa/meson.build +0 -1
@@ -12,7 +12,6 @@ deps += ['common_dpaax', 'eventdev'] sources = files('base/fman/fman.c', 'base/fman/fman_hw.c', 'base/fman/netcfg_layer.c', - 'base/fman/of.c', 'base/qbman/bman.c', 'base/qbman/bman_driver.c', 'base/qbman/dpaa_alloc.c',
drivers/bus/dpaa/rte_dpaa_bus.h +1 -1
@@ -10,10 +10,10 @@#include <rte_mempool.h> #include <dpaax_iova_table.h> +#include <of.h> #include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> #include <netcfg.h> #define DPAA_MEMPOOL_OPS_NAME "dpaa"
drivers/bus/fslmc/Makefile +1 -0
@@ -16,6 +16,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev
drivers/common/dpaax/Makefile +6 -4
@@ -12,6 +12,10 @@ LIB = librte_common_dpaax.a CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -Wno-pointer-arith +CFLAGS += -Wno-cast-qual + +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax # versioning export map EXPORT_MAP := rte_common_dpaax_version.map
@@ -22,10 +26,8 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # -SRCS-y += dpaax_iova_table.c +SRCS-y += dpaax_iova_table.c of.c LDLIBS += -lrte_eal -SYMLINK-y-include += dpaax_iova_table.h - -include $(RTE_SDK)/mk/rte.lib.mk +include $(RTE_SDK)/mk/rte.lib.mk
drivers/common/dpaax/dpaa_list.h renamed from drivers/bus/dpaa/include/dpaa_list.h +0 -0
drivers/common/dpaax/dpaax_logs.h +10 -0
@@ -9,6 +9,16 @@extern int dpaax_logger; +#ifdef RTE_LIBRTE_DPAAX_DEBUG +#define DPAAX_HWWARN(cond, fmt, args...) \ + do {\ + if (cond) \ + DPAAX_LOG(DEBUG, "WARN: " fmt, ##args); \ + } while (0) +#else +#define DPAAX_HWWARN(cond, fmt, args...) do { } while (0) +#endif + #define DPAAX_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaax_logger, "dpaax: " fmt "\n", \ ##args)
drivers/common/dpaax/meson.build +4 -1
@@ -8,6 +8,9 @@ if not is_linux reason = 'only supported on linux' endif -sources = files('dpaax_iova_table.c') +sources = files('dpaax_iova_table.c', 'of.c') cflags += ['-D_GNU_SOURCE'] +if cc.has_argument('-Wno-cast-qual') + cflags += '-Wno-cast-qual' +endif
drivers/common/dpaax/of.c renamed from drivers/bus/dpaa/base/fman/of.c +31 -30
225 lines not on this page · raw message
drivers/common/dpaax/of.h renamed from drivers/bus/dpaa/include/of.h +22 -5
@@ -8,7 +8,24 @@#ifndef __OF_H#define __OF_H -#include <compat.h> +#include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <stdbool.h> +#include <stdlib.h> +#include <inttypes.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <dirent.h> +#include <fcntl.h> +#include <glob.h> +#include <errno.h> +#include <ctype.h> +#include <unistd.h> +#include <limits.h> +#include <inttypes.h> +#include <rte_common.h> +#include <dpaa_list.h> #ifndef OF_INIT_DEFAULT_PATH #define OF_INIT_DEFAULT_PATH "/proc/device-tree"
@@ -89,7 +106,7 @@ struct dt_file {const struct device_node *of_find_compatible_node (const struct device_node *from, -const char *type__always_unused , + const char *type __rte_unused,const char *compatible) __attribute__((nonnull (3 )));
@@ -102,7 +119,7 @@ const void *of_get_property(const struct device_node *from, const char *name, size_t *lenp) __attribute__((nonnull(2)));bool of_device_is_available (const struct device_node *dev_node); -const struct device_node *of_find_node_by_phandle (phandle ph); +const struct device_node *of_find_node_by_phandle (uint64_t ph);const struct device_node *of_get_parent (const struct device_node *dev_node);
@@ -122,7 +139,7 @@ const uint32_t *of_get_address(const struct device_node *dev_node, size_t idx, uint64_t *size, uint32_t *flags);uint64_t of_translate_address (const struct device_node *dev_node, -const u32 *addr) __attribute__((nonnull)); +const uint32_t *addr) __attribute__((nonnull));bool of_device_is_compatible (const struct device_node *dev_node,const char *compatible);
@@ -147,7 +164,7 @@ static inline int of_init(void)/* Read a numeric property according to its size and return it as a 64-bit * value. */ -static inline uint64_t of_read_number (const __be32 *cell,int size) +static inline uint64_t of_read_number (const uint32_t *cell,int size) {uint64_t r =0 ;
drivers/common/dpaax/rte_common_dpaax_version.map +18 -0
@@ -9,3 +9,21 @@ DPDK_18.11 { local: *; }; + +DPDK_19.11 { + global: + of_device_is_available; + of_device_is_compatible; + of_find_compatible_node; + of_find_node_by_phandle; + of_get_address; + of_get_mac_address; + of_get_parent; + of_get_property; + of_init_path; + of_n_addr_cells; + of_translate_address; + of_get_next_child; + + local: *; +} DPDK_18.11;
drivers/crypto/caam_jr/Makefile +2 -0
@@ -17,6 +17,7 @@ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/caam_jr #sharing the hw flib headers from dpaa2_sec pmd CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/
@@ -37,6 +38,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr_uio.c LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_cryptodev +LDLIBS += -lrte_common_dpaax LDLIBS += -lrte_bus_dpaa LDLIBS += -lrte_bus_vdev
drivers/crypto/dpaa2_sec/Makefile +1 -1
@@ -19,7 +19,7 @@ ifeq ($(shell test $(GCC_VERSION) -gt 70 && echo 1), 1) CFLAGS += -Wno-implicit-fallthrough endif endif - +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/ CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/
drivers/crypto/dpaa_sec/Makefile +1 -0
@@ -16,6 +16,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa_sec/ #sharing the hw flib headers from dpaa2_sec pmd CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/
drivers/event/dpaa/Makefile +1 -0
@@ -19,6 +19,7 @@ CFLAGS += -I$(RTE_SDK_DPAA)/include CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include EXPORT_MAP := rte_pmd_dpaa_event_version.map
drivers/event/dpaa2/Makefile +1 -0
@@ -17,6 +17,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/portal CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa2 +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_eal -lrte_eventdev LDLIBS += -lrte_bus_fslmc -lrte_mempool_dpaa2 -lrte_pmd_dpaa2 LDLIBS += -lrte_bus_vdev
drivers/mempool/dpaa/Makefile +1 -0
@@ -12,6 +12,7 @@ CFLAGS := -I$(SRCDIR) $(CFLAGS) CFLAGS += -O3 $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa CFLAGS += -I$(RTE_SDK)/lib/librte_mempool
drivers/mempool/dpaa2/Makefile +1 -0
@@ -12,6 +12,7 @@ LIB = librte_mempool_dpaa2.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include # versioning export map
drivers/net/dpaa/Makefile +1 -0
@@ -19,6 +19,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/base/qbman CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
drivers/net/dpaa2/Makefile +1 -0
@@ -12,6 +12,7 @@ LIB = librte_pmd_dpaa2.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc
drivers/raw/dpaa2_cmdif/Makefile +1 -0
@@ -14,6 +14,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_bus_vdev
drivers/raw/dpaa2_qdma/Makefile +1 -0
@@ -14,6 +14,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_eal
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v2 01/13] common/dpaax: moving OF lib code from dpaa bus
Quoted 6 lines · Gagandeep Singh
From: Hemant Agrawal <[email protected]>
This code is being shared by more than 1 type of driver. Common is most appropriate place for it.
Signed-off-by Hemant Agrawal <[email protected]>
<...>
drivers/bus/dpaa/dpaa_bus.c line 35
Quoted 5 lines
drivers/bus/dpaa/dpaa_bus.c +1
-0@@ -32,6 +32,7 @@#include <rte_bus.h> #include <rte_mbuf_pool_ops.h> +#include <of.h>
Is there any risk of this is conflicting with the linux 'of.h', does it make sense to rename it to something like 'dpaa_of.h' ?
PATCH v2 2/13 net/ppfe: introduce ppfe net poll mode driver
In reply to Gagandeep Singhppfe (programmable packet forwarding engine)
is a network poll mode driver for NXP SoC
ls1012a.
This patch introduces the framework of ppfe
driver with basic functions of initialisation
and teardown.
--- MAINTAINERS | 6 + config/common_base | 5 + config/common_linux | 5 + doc/guides/nics/features/ppfe.ini | 8 + drivers/net/Makefile | 1 + drivers/net/meson.build | 1 + drivers/net/ppfe/Makefile | 28 ++ drivers/net/ppfe/meson.build | 11 + drivers/net/ppfe/pfe_eth.h | 77 +++++ drivers/net/ppfe/pfe_mod.h | 51 ++++ drivers/net/ppfe/ppfe_ethdev.c | 329 ++++++++++++++++++++++ drivers/net/ppfe/rte_pmd_ppfe_version.map | 4 + mk/rte.app.mk | 1 + 13 files changed, 527 insertions(+) create mode 100644 doc/guides/nics/features/ppfe.ini create mode 100644 drivers/net/ppfe/Makefile create mode 100644 drivers/net/ppfe/meson.build create mode 100644 drivers/net/ppfe/pfe_eth.h create mode 100644 drivers/net/ppfe/pfe_mod.h create mode 100644 drivers/net/ppfe/ppfe_ethdev.c create mode 100644 drivers/net/ppfe/rte_pmd_ppfe_version.map
MAINTAINERS +6 -0
@@ -781,6 +781,12 @@ F: drivers/net/enetc/ F: doc/guides/nics/enetc.rst F: doc/guides/nics/features/enetc.ini +NXP ppfe +M: Gagandeep Singh <[email protected]> +M: Akhil Goyal <[email protected]> +F: drivers/net/ppfe/ +F: doc/guides/nics/features/ppfe.ini + QLogic bnx2x M: Rasesh Mody <[email protected]> M: Shahed Shaikh <[email protected]>
config/common_base +5 -0
@@ -224,6 +224,11 @@ CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX=n CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX=n CONFIG_RTE_LIBRTE_CXGBE_TPUT=y +# +# Compile burst-oriented NXP PPFE PMD driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=n + # NXP DPAA Bus CONFIG_RTE_LIBRTE_DPAA_BUS=n CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n
config/common_linux +5 -0
@@ -59,6 +59,11 @@ CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV=y # CONFIG_RTE_LIBRTE_ENETC_PMD=y +# +# NXP PPFE PMD Driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=y + # # HINIC PMD driver #
doc/guides/nics/features/ppfe.ini new file +8 -0
@@ -0,0 +1,8 @@ +; +; Supported features of the 'ppfe' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Linux VFIO = Y +ARMv8 = Y
drivers/net/Makefile +1 -0
@@ -49,6 +49,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += null DIRS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx DIRS-$(CONFIG_RTE_LIBRTE_OCTEONTX2_PMD) += octeontx2 DIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += pcap +DIRS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += ppfe DIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += ring DIRS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc
drivers/net/meson.build +1 -0
@@ -37,6 +37,7 @@ drivers = ['af_packet', 'octeontx', 'octeontx2', 'pcap', + 'ppfe', 'ring', 'sfc', 'softnic',
drivers/net/ppfe/Makefile new file +28 -0
@@ -0,0 +1,28 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2019 NXP +# + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_ppfe.a + +CFLAGS += -O3 $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax + +EXPORT_MAP := rte_pmd_ppfe_version.map +LIBABIVER := 1 + +# Interfaces with DPDK +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += ppfe_ethdev.c + +LDLIBS += -lrte_bus_vdev +LDLIBS += -lrte_bus_dpaa +LDLIBS += -lrte_common_dpaax +LDLIBS += -lrte_eal +LDLIBS += -lrte_ethdev -lrte_kvargs + +include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/ppfe/meson.build new file +11 -0
@@ -0,0 +1,11 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2019 NXP + +if host_machine.system() != 'linux' + build = false +endif +deps += ['bus_dpaa'] + +sources = files('ppfe_ethdev.c') + +includes += include_directories('../../bus/dpaa/include/')
drivers/net/ppfe/pfe_eth.h new file +77 -0
77 lines not on this page · raw message
drivers/net/ppfe/pfe_mod.h new file +51 -0
51 lines not on this page · raw message
drivers/net/ppfe/ppfe_ethdev.c new file +329 -0
329 lines not on this page · raw message
drivers/net/ppfe/rte_pmd_ppfe_version.map new file +4 -0
@@ -0,0 +1,4 @@ +DPDK_19.11 { + + local: *; +};
mk/rte.app.mk +1 -0
@@ -161,6 +161,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond _LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe ifeq ($(CONFIG_RTE_LIBRTE_DPAA_BUS),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA_PMD) += -lrte_pmd_dpaa +_LDLIBS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += -lrte_pmd_ppfe endif ifeq ($(CONFIG_RTE_EAL_VFIO)$(CONFIG_RTE_LIBRTE_FSLMC_BUS),yy) _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v2 02/13] net/ppfe: introduce ppfe net poll mode driver
Quoted 11 lines · Gagandeep Singh
ppfe (programmable packet forwarding engine) is a network poll mode driver for NXP SoC ls1012a.
This patch introduces the framework of ppfe driver with basic functions of initialisation and teardown.
Signed-off-by Gagandeep Singh <[email protected]>Signed-off-by Akhil Goyal <[email protected]>Acked-by Nipun Gupta <[email protected]>
<...>
doc/guides/nics/features/ppfe.ini line 8
Quoted 9 lines
doc/guides/nics/features/ppfe.ini new file +8
-0@@ -0,0 +1,8 @@ +; +; Supported features of the 'ppfe' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Linux VFIO = Y +ARMv8 = Y
Only arm? Should this be reflected to config file? like enabling it only in 'common_armv8a_linux'.
<...>
drivers/net/ppfe/pfe_eth.h line 74
Quoted 2 lines
drivers/net/ppfe/pfe_eth.h new file +2
-0+struct pfe_eth { +struct pfe_eth_priv_s *eth_priv[3 ];
Why hardcoded 3? Can it use PFE_CDEV_ETH_COUNT (if they are for same thing) ?
<...>
drivers/net/ppfe/pfe_mod.h line 27
Quoted 3 lines
drivers/net/ppfe/pfe_mod.h new file +3
-0+ +/* for link status and IOCTL support using pfe character device +* XXX: Should be kept in sync with Kernel module
How can we know if it is in sync with kernel module, is there any check in the code?
drivers/net/ppfe/pfe_mod.h line 36
Quoted 9 lines
+ */
drivers/net/ppfe/pfe_mod.h new file +8
-0+ +/* Extracted from ls1012a_pfe_platform_data, there are 3 interfaces which are +* supported by PFE driver. Should be updated if number of eth devices are +* changed. +*/ +#define PFE_CDEV_ETH_COUNT 3 + +#define PFE_CDEV_PATH "/dev/pfe_us_cdev"
Can you please add a comment why this char device is used?
<...>
Quoted 1 line
+struct pfe
*g_pfe;
Any reason to not make this static?
Quoted 1 line
+unsigned int
pfe_svr=SVR_LS1012A_REV1;
There are some checks for this in hal layer, should this be a runtime option instead of hardcoded in the .c file?
<...>
drivers/net/ppfe/ppfe_ethdev.c line 76
Quoted 7 lines
drivers/net/ppfe/ppfe_ethdev.c new file +7
-0+/* pfe_eth_exit +*/ +static void +pfe_eth_exit (struct rte_eth_dev *dev,struct pfe *pfe) +{ +/* Close the device file for link status */ +pfe_eth_close_cdev (dev->data->dev_private);
You may want to do stop before close.
drivers/net/ppfe/ppfe_ethdev.c line 82
Quoted 6 lines
drivers/net/ppfe/ppfe_ethdev.c new file +6
-0+ +rte_eth_dev_release_port (dev); + pfe->nb_devs--; +} + +/* pfe_eth_init_one
Comment is wrong, and not sure commenting the function name is that useful
Quoted 2 lines
+ */
+static intpfe_eth_init(struct rte_vdev_device *vdev, struct pfe *pfe, int id)
Please apply same syntax to function prototypes.
drivers/net/ppfe/ppfe_ethdev.c line 92
Quoted 8 lines
drivers/net/ppfe/ppfe_ethdev.c new file +8
-0+{ +struct rte_eth_dev_data *data =NULL ; +struct rte_eth_dev *eth_dev =NULL ; +struct pfe_eth_priv_s *priv =NULL ; +int err; + +if (id >= pfe->max_intf) +return -EINVAL ;
Can this happen at this stage?
drivers/net/ppfe/ppfe_ethdev.c line 105
Quoted 13 lines
drivers/net/ppfe/ppfe_ethdev.c new file +13
-0+ + data =rte_zmalloc (NULL ,sizeof (*data),64 ); +if (data ==NULL ) +return -ENOMEM ; + + eth_dev =rte_eth_vdev_allocate (vdev,sizeof (*priv)); +if (eth_dev ==NULL ) { +rte_free (data); +return -ENOMEM ; + } + + priv = eth_dev->data->dev_private; +rte_memcpy (data, eth_dev->data,sizeof (*data));
Why you allocate and copy to 'data', as far as I can see you are not using it at all J Unless I am missing something.
<...>
drivers/net/ppfe/ppfe_ethdev.c line 140
Quoted 11 lines
drivers/net/ppfe/ppfe_ethdev.c new file +11
-0+ +/* For link status, open the PFE CDEV; Error from this function +* is silently ignored; In case of error, the link status will not +* be available. +*/ +pfe_eth_open_cdev (priv); +rte_eth_dev_probing_finish (eth_dev); + +return 0 ; +err0: +rte_free (data);
Need to release the 'eth_dev', rte_eth_dev_release_port()
drivers/net/ppfe/ppfe_ethdev.c line 152
Quoted 12 lines
drivers/net/ppfe/ppfe_ethdev.c new file +12
-0+return err; +} + +/* Parse integer from integer argument */ +static int +parse_integer_arg(const char *key __rte_unused, +const char *value,void *extra_args) +{ +int *i = (int *)extra_args; + + *i =atoi (value); +if (*i <0 )
If you are trying to detect the error, atoi is not working that way, 'strtol' can be better option for that.
Quoted 10 lines
drivers/net/ppfe/ppfe_ethdev.c new file +10
-0+return -1 ; + +return 0 ; +} + +static int +pfe_parse_vdev_init_params (struct pfe_vdev_init_params *params, +struct rte_vdev_device *dev) +{ +struct rte_kvargs *kvlist =NULL ;
drivers/net/ppfe/ppfe_ethdev.c line 172
Quoted 10 lines
drivers/net/ppfe/ppfe_ethdev.c new file +10
-0+int ret =0 ; + +static const char *const pfe_vdev_valid_params[] = { +PPFE_VDEV_GEM_ID_ARG , +NULL + }; + +const char *input_args =rte_vdev_device_args (dev); +if (params ==NULL ) +return -EINVAL ;
This is a static function and only used once, not sure about verifying the input param, although it won't hurt.
drivers/net/ppfe/ppfe_ethdev.c line 175
Quoted 3 lines
drivers/net/ppfe/ppfe_ethdev.c new file +3
-0+ + +if (input_args) {
Not sure if 'input_args' can bu NULL at all, but anyway, what about retun immediately if it is NULL, it can reduce the indentation.
Also if the PPFE_VDEV_GEM_ID_ARG is optional and you want to check if user provided it or not, you should check the value of the 'input_args' instead of its address I think.
Quoted 20 lines
drivers/net/ppfe/ppfe_ethdev.c new file +20
-0+ kvlist =rte_kvargs_parse (input_args, pfe_vdev_valid_params); +if (kvlist ==NULL ) +return -1 ; + + ret =rte_kvargs_process (kvlist, +PPFE_VDEV_GEM_ID_ARG , + &parse_integer_arg, + ¶ms->gem_id); +if (ret <0 ) + goto free_kvlist; + } + +free_kvlist: +rte_kvargs_free (kvlist); +return ret; +} + +static int +pmd_pfe_probe (struct rte_vdev_device *vdev) +{
drivers/net/ppfe/ppfe_ethdev.c line 205
Quoted 10 lines
drivers/net/ppfe/ppfe_ethdev.c new file +10
-0+const u32 *prop; +const struct device_node *np; +const char *name; +const uint32_t *addr; +uint64_t cbus_addr, ddr_size, cbus_size; +int rc =-1 , fd =-1 , gem_id; +unsigned int interface_count =0 ; +size_t size =0 ; +struct pfe_vdev_init_params init_params = { +-1
I would prefer designated initializes to make it more clear, up to you.
Quoted 5 lines
drivers/net/ppfe/ppfe_ethdev.c new file +5
-0+ }; + + name =rte_vdev_device_name (vdev); + rc =pfe_parse_vdev_init_params (&init_params, vdev); +if (rc <0 )
drivers/net/ppfe/ppfe_ethdev.c line 220
Quoted 10 lines
drivers/net/ppfe/ppfe_ethdev.c new file +10
-0+return -EINVAL ; + +if (g_pfe) { +if (g_pfe->nb_devs >= g_pfe->max_intf) +return -EINVAL ; + + goto eth_init; + } + + g_pfe =rte_zmalloc (NULL ,sizeof (*g_pfe),64 );
If 64 is for cache line, may be better to use macro for it.
drivers/net/ppfe/ppfe_ethdev.c line 222
Quoted 2 lines
drivers/net/ppfe/ppfe_ethdev.c new file +2
-0+if (g_pfe ==NULL ) +return -EINVAL ;
Is there a value of dynamically allocate the g_pfe, it is already global, so why not define it statically? May be secondary process can have benefit from allocating in shared memory but you are not using shared process as far as I can see.
Quoted 24 lines
drivers/net/ppfe/ppfe_ethdev.c new file +24
-0+ +/* Load the device-tree driver */ + rc =of_init (); +if (rc) + goto err; + + np =of_find_compatible_node (NULL ,NULL ,"fsl,pfe" ); +if (!np) { + rc = -EINVAL ; + goto err; + } + + addr =of_get_address (np,0 , &cbus_size,NULL ); +if (!addr) + goto err; + + cbus_addr =of_translate_address (np, addr); +if (!cbus_addr) + goto err; + + + addr =of_get_address (np,1 , &ddr_size,NULL ); +if (!addr) + goto err;
drivers/net/ppfe/ppfe_ethdev.c line 256
Quoted 10 lines
drivers/net/ppfe/ppfe_ethdev.c new file +10
-0+ + g_pfe->ddr_phys_baseaddr =of_translate_address (np, addr); +if (!g_pfe->ddr_phys_baseaddr) + goto err; + + g_pfe->ddr_size = ddr_size; + + fd =open ("/dev/mem" ,O_RDWR ); + g_pfe->cbus_baseaddr =mmap (NULL , cbus_size,PROT_READ |PROT_WRITE , +MAP_SHARED , fd, cbus_addr);
Above reads device information from a device tree file and creates a new mapping for its address space. I wonder if device can be probbed as we do the pcie devices, do you have to depend on the 'of', can't the driver registered for a pysical device?
<...>
drivers/net/ppfe/ppfe_ethdev.c line 294
Quoted 10 lines
drivers/net/ppfe/ppfe_ethdev.c new file +10
-0+ rc =pfe_eth_init (vdev, g_pfe, gem_id); +if (rc <0 ) + goto err_eth; +else + g_pfe->nb_devs++; + +return 0 ; + +err_eth: +err_prop:
Should 'munmap' here? and close fd?
<...>
drivers/net/ppfe/ppfe_ethdev.c line 328
Quoted 2 lines
drivers/net/ppfe/ppfe_ethdev.c new file +2
-0+RTE_PMD_REGISTER_VDEV (PFE_PMD , pmd_pfe_drv); +RTE_PMD_REGISTER_ALIAS (PFE_PMD , eth_pfe);
Please drop the alias, that is for compatibility for old pmds.
Quoted 1 line
+RTE_PMD_REGISTER_PARAM_STRING(PFE_PMD, "intf=<int> ");
Better to use 'PPFE_VDEV_GEM_ID_ARG' macro here to prevent typos etc...
Re: [dpdk-dev] [PATCH v2 02/13] net/ppfe: introduce ppfe net poll mode driver
Hi Ferruh,
I have incorporated most of your comments in V3 of this series. I'll send the series by today. For those, which will not be included in this version, I have added some comments, please see inline.
Quoted 8 lines
<...>
drivers/net/ppfe/pfe_mod.h line 27
Quoted 3 lines
drivers/net/ppfe/pfe_mod.h new file +3
-0+ +/* for link status and IOCTL support using pfe character device +* XXX: Should be kept in sync with Kernel module How can we know if it is in sync with kernel module, is there any check in the code?
There is no check for this in the code, but it is mandatory to load "pfe.ko" kernel Module to run PFFE driver, I have added this requirement in document under prerequisites section.
<...>
Quoted 5 lines
Quoted 2 lines
+unsigned int
pfe_svr=SVR_LS1012A_REV1;There are some checks for this in hal layer, should this be a runtime option instead of hardcoded in the .c file?
I agree with you, It should be a runtime option. Is it ok, if I send a separate patch for this? It may take some time as I have to look into the manual to find possible ways to get svr value from the HW. I'll add a comment here for this.
<...>
Quoted 5 lines
drivers/net/ppfe/ppfe_ethdev.c
Quoted 4 lines
drivers/net/ppfe/ppfe_ethdev.c new file +4
-0+ g_pfe->ddr_size = ddr_size; + + fd =open ("/dev/mem" ,O_RDWR ); + g_pfe->cbus_baseaddr = mmap(NULL, cbus_size, PROT_READ |
PROT_WRITE,
Quoted 8 lines
drivers/net/ppfe/ppfe_ethdev.c line 256
Quoted 1 line
drivers/net/ppfe/ppfe_ethdev.c new file +1
-0+ MAP_SHARED, fd, cbus_addr);Above reads device information from a device tree file and creates a new mapping
for its address space. I wonder if device can be probbed as we do the pcie devices, do you have to depend on the 'of', can't the driver registered for a pysical device?
These eth devices are actual Virtual interfaces created by Client driver (a part
of the ppfe driver). Actually, HW provides a single interface (Host interface), which is the only device accessible by the userspace driver for enqueue and dequeue and ppfe driver create two virtual interfaces out of this single host interface. Also, this device is not on pcie bus.
Thanks,
Gagan
PATCH v2 3/13 doc: add guide for ppfe net PMD
In reply to Gagandeep SinghThis patch add documentation for ppfe network
poll mode driver.
PPFE is a hardware programmable packet
forwarding engine to provide high performance
ethernet interfaces.
--- MAINTAINERS | 1 + doc/guides/nics/features/ppfe.ini | 1 + doc/guides/nics/index.rst | 1 + doc/guides/nics/ppfe.rst | 168 ++++++++++++++++++++++++++++++ 4 files changed, 171 insertions(+) create mode 100644 doc/guides/nics/ppfe.rst
MAINTAINERS +1 -0
@@ -784,6 +784,7 @@ F: doc/guides/nics/features/enetc.ini NXP ppfe M: Gagandeep Singh <[email protected]> M: Akhil Goyal <[email protected]> +F: doc/guides/nics/ppfe.rst F: drivers/net/ppfe/ F: doc/guides/nics/features/ppfe.ini
doc/guides/nics/features/ppfe.ini +1 -0
@@ -6,3 +6,4 @@ [Features] Linux VFIO = Y ARMv8 = Y +Usage doc = Y
doc/guides/nics/index.rst +1 -0
@@ -47,6 +47,7 @@ Network Interface Controller Drivers nfp octeontx octeontx2 + ppfe qede sfc_efx softnic
doc/guides/nics/ppfe.rst new file +168 -0
168 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v2 03/13] doc: add guide for ppfe net PMD
Quoted 10 lines · Gagandeep Singh
This patch add documentation for ppfe network poll mode driver.
PPFE is a hardware programmable packet forwarding engine to provide high performance ethernet interfaces.
Signed-off-by Gagandeep Singh <[email protected]>Acked-by Nipun Gupta <[email protected]>Acked-by Akhil Goyal <[email protected]>
<...>
Quoted 46 lines
doc/guides/nics/ppfe.rst new file +46
-0+PPFE Overview +~~~~~~~~~~~~~~ + +PPFE is a hardware programmable packet forwarding engine to provide +high performance Ethernet interfaces. The diagram below shows a +system level overview of PPFE: + +.. code-block:: console + + ====================================================+=============== + US +-----------------------------------------+ | Kernel Space + | | | + | PPFE Ethernet Driver | | + +-----------------------------------------+ | + ^ | ^ | | + PPFE RXQ| |TXQ RXQ| |TXQ | + PMD | | | | | + | v | v | +----------+ + +---------+ +----------+ | | pfe.ko | + | pfe_eth0| | pfe_eth1 | | +----------+ + +---------+ +----------+ | + ^ | ^ | | + TXQ| |RXQ TXQ| |RXQ | + | | | | | + | v | v | + +------------------------+ | + | | | + | PPFE HIF driver | | + +------------------------+ | + ^ | | + RX | TX | | + RING| RING| | + | v | + +--------------+ | + | | | + ==================| HIF |==================+=============== + +-----------+ +--------------+ + | | | | HW + | PPFE +--------------+ | + | +-----+ +-----+ | + | | MAC | | MAC | | + | | | | | | + +-------+-----+----------------+-----+----+ + | PHY | | PHY | + +-----+ +-----+ +
doc/guides/nics/ppfe.rst line 83
Quoted 10 lines
doc/guides/nics/ppfe.rst new file +10
-0+ +The HIF, PPFE, MAC and PHY are the hardware blocks, the pfe.ko is a kernel +module, the PPFE HIF driver and the PPFE ethernet driver combined represent +as DPDK PPFE poll mode driver are running in the userspace. + +The PPFE hardware supports one HIF (host interface) RX ring and one TX ring +to send and receive packets through packet forwarding engine. Both network +interface traffic is multiplexed and send over HIF queue. + +pfe_eth0 and pfe_eth1 are logical ethernet interfaces, created by HIF client
Is it always fixed size logical interface, eth0 & eth1? There is following comment in the code, is it something else:
"
/* Extracted from ls1012a_pfe_platform_data, there are 3 interfaces which are
* supported by PFE driver. Should be updated if number of eth devices are
* changed.
*/
#define PFE_CDEV_ETH_COUNT 3
"
doc/guides/nics/ppfe.rst line 89
Quoted 6 lines
doc/guides/nics/ppfe.rst new file +6
-0+driver. HIF driver is responsible for send and receive packets between +host interface and these logical interfaces. PPFE ethernet driver is a +hardware independent and register with the HIF client driver to transmit and +receive packets from HIF via logical interfaces. + +pfe.ko is required for PHY initialisation.
Is char device "/dev/pfe_us_cdev" created by this kernel module?
<...>
doc/guides/nics/ppfe.rst line 162
Quoted 13 lines
doc/guides/nics/ppfe.rst new file +13
-0+Driver compilation and testing +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Follow instructions available in the document +:ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` +to launch **testpmd** + +Additionally, PPFE driver need `--vdev` as an input with value `eth_pfe` to execute DPDK application, +see the command below: + + .. code-block:: console + + <dpdk app> <EAL args> --vdev="eth_pfe0" --vdev="eth_pfe1" -- ...
Can you please document the "intf" (PPFE_VDEV_GEM_ID_ARG) device argument?
Re: [dpdk-dev] [PATCH v2 03/13] doc: add guide for ppfe net PMD
In reply to Gagandeep SinghQuoted 7 lines · Gagandeep Singh
This patch add documentation for ppfe network poll mode driver.
PPFE is a hardware programmable packet forwarding engine to provide high performance ethernet interfaces.
Quoted 8 lines
Signed-off-by Gagandeep Singh <[email protected]>Acked-by Nipun Gupta <[email protected]>Acked-by Akhil Goyal <[email protected]>--- MAINTAINERS | 1 + doc/guides/nics/features/ppfe.ini | 1 + doc/guides/nics/index.rst | 1 + doc/guides/nics/ppfe.rst | 168 ++++++++++++++++++++++++++++++
Can you please update 19.11 release notes and document new driver?
PATCH v2 4/13 net/ppfe: support dynamic logging
In reply to Gagandeep SinghThis patch introduces logging for the ppfe PMD.
--- drivers/net/ppfe/pfe_logs.h | 30 ++++++++++++++++ drivers/net/ppfe/ppfe_ethdev.c | 65 +++++++++++++++++++++++++++------- 2 files changed, 82 insertions(+), 13 deletions(-) create mode 100644 drivers/net/ppfe/pfe_logs.h
drivers/net/ppfe/pfe_logs.h new file +30 -0
@@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _PFE_LOGS_H_ +#define _PFE_LOGS_H_ + +/* PMD related logs */ + +#define PFE_PMD_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, "%s(): " fmt "\n",\ + __func__, ##args) + +#define PMD_INIT_FUNC_TRACE () PFE_PMD_LOG(DEBUG, " >>") + +#define PFE_PMD_DEBUG(fmt, args...) \ + PFE_PMD_LOG(DEBUG, fmt, ## args) +#define PFE_PMD_ERR(fmt, args...) \ + PFE_PMD_LOG(ERR, fmt, ## args) +#define PFE_PMD_INFO(fmt, args...) \ + PFE_PMD_LOG(INFO, fmt, ## args) + +#define PFE_PMD_WARN(fmt, args...) \ + PFE_PMD_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define PFE_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#endif /* _PFE_LOGS_H_ */
drivers/net/ppfe/ppfe_ethdev.c +52 -13
174 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v2 04/13] net/ppfe: support dynamic logging
Quoted 20 lines · Gagandeep Singh
This patch introduces logging for the ppfe PMD.
Signed-off-by Gagandeep Singh <[email protected]>Acked-by Nipun Gupta <[email protected]>Acked-by Akhil Goyal <[email protected]>--- drivers/net/ppfe/pfe_logs.h | 30 ++++++++++++++++ drivers/net/ppfe/ppfe_ethdev.c | 65 +++++++++++++++++++++++++++------- 2 files changed, 82 insertions(+), 13 deletions(-) create mode 100644 drivers/net/ppfe/pfe_logs.hdrivers/net/ppfe/pfe_logs.h new file +3
-0@@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/
drivers/net/ppfe/pfe_logs.h line 13
Quoted 10 lines
drivers/net/ppfe/pfe_logs.h new file +10
-0+ +#ifndef _PFE_LOGS_H_ +#define _PFE_LOGS_H_ + +/* PMD related logs */ + +#define PFE_PMD_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, "%s(): " fmt "\n",\ + __func__, ##args) +
Please don't use 'RTE_LOGTYPE_PMD' log type but register a dynamic one for the driver.
PATCH v2 5/13 net/ppfe: add HW specific macros and operations
In reply to Gagandeep SinghThis patch add some hardware specific macros
and functions that will be used by the driver.
--- drivers/net/ppfe/base/cbus.h | 66 +++++ drivers/net/ppfe/base/cbus/bmu.h | 41 +++ drivers/net/ppfe/base/cbus/class_csr.h | 277 ++++++++++++++++++++ drivers/net/ppfe/base/cbus/emac_mtip.h | 231 +++++++++++++++++ drivers/net/ppfe/base/cbus/gpi.h | 77 ++++++ drivers/net/ppfe/base/cbus/hif.h | 86 +++++++ drivers/net/ppfe/base/cbus/hif_nocpy.h | 36 +++ drivers/net/ppfe/base/cbus/tmu_csr.h | 154 +++++++++++ drivers/net/ppfe/base/cbus/util_csr.h | 47 ++++ drivers/net/ppfe/base/pfe.h | 339 +++++++++++++++++++++++++ 10 files changed, 1354 insertions(+) create mode 100644 drivers/net/ppfe/base/cbus.h create mode 100644 drivers/net/ppfe/base/cbus/bmu.h create mode 100644 drivers/net/ppfe/base/cbus/class_csr.h create mode 100644 drivers/net/ppfe/base/cbus/emac_mtip.h create mode 100644 drivers/net/ppfe/base/cbus/gpi.h create mode 100644 drivers/net/ppfe/base/cbus/hif.h create mode 100644 drivers/net/ppfe/base/cbus/hif_nocpy.h create mode 100644 drivers/net/ppfe/base/cbus/tmu_csr.h create mode 100644 drivers/net/ppfe/base/cbus/util_csr.h create mode 100644 drivers/net/ppfe/base/pfe.h
drivers/net/ppfe/base/cbus.h new file +66 -0
@@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _CBUS_H_ +#define _CBUS_H_ + +#include <compat.h> + +#define EMAC1_BASE_ADDR (CBUS_BASE_ADDR + 0x200000) +#define EGPI1_BASE_ADDR (CBUS_BASE_ADDR + 0x210000) +#define EMAC2_BASE_ADDR (CBUS_BASE_ADDR + 0x220000) +#define EGPI2_BASE_ADDR (CBUS_BASE_ADDR + 0x230000) +#define BMU1_BASE_ADDR (CBUS_BASE_ADDR + 0x240000) +#define BMU2_BASE_ADDR (CBUS_BASE_ADDR + 0x250000) +#define ARB_BASE_ADDR (CBUS_BASE_ADDR + 0x260000) +#define DDR_CONFIG_BASE_ADDR (CBUS_BASE_ADDR + 0x270000) +#define HIF_BASE_ADDR (CBUS_BASE_ADDR + 0x280000) +#define HGPI_BASE_ADDR (CBUS_BASE_ADDR + 0x290000) +#define LMEM_BASE_ADDR (CBUS_BASE_ADDR + 0x300000) +#define LMEM_SIZE 0x10000 +#define LMEM_END (LMEM_BASE_ADDR + LMEM_SIZE) +#define TMU_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x310000) +#define CLASS_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x320000) +#define HIF_NOCPY_BASE_ADDR (CBUS_BASE_ADDR + 0x350000) +#define UTIL_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x360000) +#define CBUS_GPT_BASE_ADDR (CBUS_BASE_ADDR + 0x370000) + +/* +* defgroup XXX_MEM_ACCESS_ADDR PE memory access through CSR +* XXX_MEM_ACCESS_ADDR register bit definitions. +*/ +#define PE_MEM_ACCESS_WRITE BIT(31)/* Internal Memory Write. */ +#define PE_MEM_ACCESS_IMEM BIT(15) +#define PE_MEM_ACCESS_DMEM BIT(16) + +/* Byte Enables of the Internal memory access. These are interpred in BE */ +#define PE_MEM_ACCESS_BYTE_ENABLE (offset, size) \ + ({ typeof(size) size_ = (size); \ + (((BIT(size_) - 1) << (4 - (offset) - (size_))) & 0xf) << 24; }) + +#include "cbus/emac_mtip.h" +#include "cbus/gpi.h" +#include "cbus/bmu.h" +#include "cbus/hif.h" +#include "cbus/tmu_csr.h" +#include "cbus/class_csr.h" +#include "cbus/hif_nocpy.h" +#include "cbus/util_csr.h" + +/* PFE cores states */ +#define CORE_DISABLE 0x00000000 +#define CORE_ENABLE 0x00000001 +#define CORE_SW_RESET 0x00000002 + +/* LMEM defines */ +#define LMEM_HDR_SIZE 0x0010 +#define LMEM_BUF_SIZE_LN2 0x7 +#define LMEM_BUF_SIZE BIT(LMEM_BUF_SIZE_LN2) + +/* DDR defines */ +#define DDR_HDR_SIZE 0x0100 +#define DDR_BUF_SIZE_LN2 0xb +#define DDR_BUF_SIZE BIT(DDR_BUF_SIZE_LN2) + +#endif /* _CBUS_H_ */
drivers/net/ppfe/base/cbus/bmu.h new file +41 -0
41 lines not on this page · raw message
drivers/net/ppfe/base/cbus/class_csr.h new file +277 -0
277 lines not on this page · raw message
drivers/net/ppfe/base/cbus/emac_mtip.h new file +231 -0
231 lines not on this page · raw message
drivers/net/ppfe/base/cbus/gpi.h new file +77 -0
77 lines not on this page · raw message
drivers/net/ppfe/base/cbus/hif.h new file +86 -0
86 lines not on this page · raw message
drivers/net/ppfe/base/cbus/hif_nocpy.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _HIF_NOCPY_H_ +#define _HIF_NOCPY_H_ + +#define HIF_NOCPY_VERSION (HIF_NOCPY_BASE_ADDR + 0x00) +#define HIF_NOCPY_TX_CTRL (HIF_NOCPY_BASE_ADDR + 0x04) +#define HIF_NOCPY_TX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x08) +#define HIF_NOCPY_TX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x0c) +#define HIF_NOCPY_TX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x10) +#define HIF_NOCPY_TX_STATUS (HIF_NOCPY_BASE_ADDR + 0x14) +#define HIF_NOCPY_RX_CTRL (HIF_NOCPY_BASE_ADDR + 0x20) +#define HIF_NOCPY_RX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x24) +#define HIF_NOCPY_RX_STATUS (HIF_NOCPY_BASE_ADDR + 0x30) +#define HIF_NOCPY_INT_SRC (HIF_NOCPY_BASE_ADDR + 0x34) +#define HIF_NOCPY_INT_ENABLE (HIF_NOCPY_BASE_ADDR + 0x38) +#define HIF_NOCPY_POLL_CTRL (HIF_NOCPY_BASE_ADDR + 0x3c) +#define HIF_NOCPY_RX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x40) +#define HIF_NOCPY_RX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x44) +#define HIF_NOCPY_TX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x48) +#define HIF_NOCPY_RX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x4c) +#define HIF_NOCPY_RX_INQ0_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x50) +#define HIF_NOCPY_RX_INQ1_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x54) +#define HIF_NOCPY_TX_PORT_NO (HIF_NOCPY_BASE_ADDR + 0x60) +#define HIF_NOCPY_LMEM_ALLOC_ADDR (HIF_NOCPY_BASE_ADDR + 0x64) +#define HIF_NOCPY_CLASS_ADDR (HIF_NOCPY_BASE_ADDR + 0x68) +#define HIF_NOCPY_TMU_PORT0_ADDR (HIF_NOCPY_BASE_ADDR + 0x70) +#define HIF_NOCPY_TMU_PORT1_ADDR (HIF_NOCPY_BASE_ADDR + 0x74) +#define HIF_NOCPY_TMU_PORT2_ADDR (HIF_NOCPY_BASE_ADDR + 0x7c) +#define HIF_NOCPY_TMU_PORT3_ADDR (HIF_NOCPY_BASE_ADDR + 0x80) +#define HIF_NOCPY_TMU_PORT4_ADDR (HIF_NOCPY_BASE_ADDR + 0x84) +#define HIF_NOCPY_INT_COAL (HIF_NOCPY_BASE_ADDR + 0x90) + +#endif /* _HIF_NOCPY_H_ */
drivers/net/ppfe/base/cbus/tmu_csr.h new file +154 -0
154 lines not on this page · raw message
drivers/net/ppfe/base/cbus/util_csr.h new file +47 -0
47 lines not on this page · raw message
drivers/net/ppfe/base/pfe.h new file +339 -0
339 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 6/13 net/ppfe: add MAC and host interface initialisation
In reply to Gagandeep SinghHIF or host interface is responsible for transmit and receive packets between physical ethernet interfaces and HIF library defined logical interfaces.
This patch initialise that host interface and MAC.
--- drivers/net/ppfe/Makefile | 8 + drivers/net/ppfe/base/pfe.h | 83 +++++ drivers/net/ppfe/meson.build | 9 +- drivers/net/ppfe/pfe_hal.c | 596 +++++++++++++++++++++++++++++++++ drivers/net/ppfe/pfe_hif.c | 248 ++++++++++++++ drivers/net/ppfe/pfe_hif.h | 106 ++++++ drivers/net/ppfe/pfe_hif_lib.c | 18 + drivers/net/ppfe/pfe_hif_lib.h | 162 +++++++++ drivers/net/ppfe/pfe_mod.h | 5 + drivers/net/ppfe/ppfe_ethdev.c | 151 ++++++++- 10 files changed, 1383 insertions(+), 3 deletions(-) create mode 100644 drivers/net/ppfe/pfe_hal.c create mode 100644 drivers/net/ppfe/pfe_hif.c create mode 100644 drivers/net/ppfe/pfe_hif.h create mode 100644 drivers/net/ppfe/pfe_hif_lib.c create mode 100644 drivers/net/ppfe/pfe_hif_lib.h
drivers/net/ppfe/Makefile +8 -0
@@ -10,14 +10,22 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB = librte_pmd_ppfe.a CFLAGS += -O3 $(WERROR_FLAGS) +CFLAGS += -Wno-pointer-arith CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/net/ppfe/base/ CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax EXPORT_MAP := rte_pmd_ppfe_version.map LIBABIVER := 1 +# depends on v2p APIs which uses experimental API +CFLAGS += -DALLOW_EXPERIMENTAL_API + # Interfaces with DPDK SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += ppfe_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hal.c +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hif_lib.c +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hif.c LDLIBS += -lrte_bus_vdev LDLIBS += -lrte_bus_dpaa
drivers/net/ppfe/base/pfe.h +83 -0
93 lines not on this page · raw message
drivers/net/ppfe/meson.build +7 -2
@@ -6,6 +6,11 @@ if host_machine.system() != 'linux' endif deps += ['bus_dpaa'] -sources = files('ppfe_ethdev.c') +sources = files('ppfe_ethdev.c', + 'pfe_hal.c', + 'pfe_hif_lib.c', + 'pfe_hif.c') -includes += include_directories('../../bus/dpaa/include/') +allow_experimental_apis = true + +includes += include_directories('base','../../bus/dpaa/include/')
drivers/net/ppfe/pfe_hal.c new file +596 -0
596 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.c new file +248 -0
248 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.h new file +106 -0
106 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.c new file +18 -0
@@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#include "pfe_logs.h" +#include "pfe_mod.h" + +int pfe_hif_lib_init(__rte_unused struct pfe *pfe) +{ +PMD_INIT_FUNC_TRACE (); + +return 0 ; +} + +void pfe_hif_lib_exit(__rte_unused struct pfe *pfe) +{ +PMD_INIT_FUNC_TRACE (); +}
drivers/net/ppfe/pfe_hif_lib.h new file +162 -0
162 lines not on this page · raw message
drivers/net/ppfe/pfe_mod.h +5 -0
@@ -7,6 +7,9 @@struct pfe ; +#include "pfe.h" +#include "pfe_hif.h" +#include "pfe_hif_lib.h" #include "pfe_eth.h" #define PHYID_MAX_VAL 32
@@ -16,6 +19,8 @@ struct pfe {void *ddr_baseaddr;uint64_t ddr_size;void *cbus_baseaddr; +struct ls1012a_pfe_platform_data platform_data; +struct pfe_hif hif;struct pfe_eth eth;int mdio_muxval[PHYID_MAX_VAL ];uint8_t nb_devs;
drivers/net/ppfe/ppfe_ethdev.c +150 -1
223 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v2 06/13] net/ppfe: add MAC and host interface initialisation
Quoted 9 lines · Gagandeep Singh
HIF or host interface is responsible for transmit and receive packets between physical ethernet interfaces and HIF library defined logical interfaces.
This patch initialise that host interface and MAC.
Signed-off-by Gagandeep Singh <[email protected]>Signed-off-by Akhil Goyal <[email protected]>Acked-by Nipun Gupta <[email protected]>
<...>
Quoted 4 lines
drivers/net/ppfe/Makefile +0
-0@@ -10,14 +10,22 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB = librte_pmd_ppfe.a CFLAGS += -O3 $(WERROR_FLAGS)
drivers/net/ppfe/Makefile include $(RTE_SDK)/mk/rte.vars.mk · line 22
Quoted 10 lines
drivers/net/ppfe/Makefile +4
-0+CFLAGS += -Wno-pointer-arith CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/net/ppfe/base/ CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax EXPORT_MAP := rte_pmd_ppfe_version.map LIBABIVER := 1 +# depends on v2p APIs which uses experimental API +CFLAGS += -DALLOW_EXPERIMENTAL_API
Can you please list of experimental APIs used in the make and meson files, as comment. That may help us to trace when to remove this flag as APIs promoted to non experimental state.
PATCH v2 7/13 net/ppfe: add device start stop operations
In reply to Gagandeep SinghThis patch adds device start, stop and close
operations.
--- drivers/net/ppfe/Makefile | 2 +- drivers/net/ppfe/pfe_eth.h | 1 + drivers/net/ppfe/pfe_hif.c | 136 +++++++++++++ drivers/net/ppfe/pfe_hif.h | 41 ++++ drivers/net/ppfe/pfe_hif_lib.c | 350 ++++++++++++++++++++++++++++++++- drivers/net/ppfe/pfe_hif_lib.h | 11 ++ drivers/net/ppfe/pfe_mod.h | 1 + drivers/net/ppfe/ppfe_ethdev.c | 187 ++++++++++++++++++ 8 files changed, 727 insertions(+), 2 deletions(-)
drivers/net/ppfe/Makefile +1 -1
@@ -30,7 +30,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hif.c LDLIBS += -lrte_bus_vdev LDLIBS += -lrte_bus_dpaa LDLIBS += -lrte_common_dpaax -LDLIBS += -lrte_eal +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool LDLIBS += -lrte_ethdev -lrte_kvargs include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/ppfe/pfe_eth.h +1 -0
@@ -53,6 +53,7 @@ struct ls1012a_pfe_platform_data {struct pfe_eth_priv_s {struct pfe *pfe; +struct hif_client_s client;int low_tmu_q;int high_tmu_q;struct rte_eth_dev *ndev;
drivers/net/ppfe/pfe_hif.c +136 -0
142 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.h +41 -0
59 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.c +349 -1
359 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.h +11 -0
@@ -5,6 +5,8 @@#ifndef _PFE_HIF_LIB_H_#define _PFE_HIF_LIB_H_ +#include "pfe_hif.h" +#define HIF_CL_REQ_TIMEOUT 10#define GFP_DMA_PFE 0
@@ -158,5 +160,14 @@ extern unsigned int emac_txq_cnt;int pfe_hif_lib_init (struct pfe *pfe);void pfe_hif_lib_exit (struct pfe *pfe); +int hif_lib_client_register (struct hif_client_s *client); +int hif_lib_client_unregister (struct hif_client_s *client); +void hif_lib_indicate_client (struct hif_client_s *client,int event,int data); +int hif_lib_event_handler_start (struct hif_client_s *client,int event,int + data); +void *hif_lib_tx_get_next_complete (struct hif_client_s *client,int qno, +unsigned int *flags,int count); +int pfe_hif_shm_init (struct hif_shm *hif_shm,struct rte_mempool *mb_pool); +void pfe_hif_shm_clean (struct hif_shm *hif_shm);#endif /* _PFE_HIF_LIB_H_ */
drivers/net/ppfe/pfe_mod.h +1 -0
@@ -22,6 +22,7 @@ struct pfe {struct ls1012a_pfe_platform_data platform_data;struct pfe_hif hif;struct pfe_eth eth; +struct hif_client_s *hif_client[HIF_CLIENTS_MAX ];int mdio_muxval[PHYID_MAX_VAL ];uint8_t nb_devs;uint8_t max_intf;
drivers/net/ppfe/ppfe_ethdev.c +187 -0
211 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 8/13 net/ppfe: add queue setup and release operations
In reply to Gagandeep SinghThis patch add RX/TX queue setup operations and supported checksum offloads.
--- doc/guides/nics/features/ppfe.ini | 2 + doc/guides/nics/ppfe.rst | 1 + drivers/net/ppfe/pfe_hif.c | 114 ++++++++++++++++++++++++++++++ drivers/net/ppfe/pfe_hif.h | 1 + drivers/net/ppfe/pfe_hif_lib.c | 48 +++++++++++++ drivers/net/ppfe/ppfe_ethdev.c | 100 +++++++++++++++++++++++++- 6 files changed, 263 insertions(+), 3 deletions(-)
doc/guides/nics/features/ppfe.ini +2 -0
@@ -4,6 +4,8 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +L3 checksum offload = Y +L4 checksum offload = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +1 -0
@@ -91,6 +91,7 @@ pfe.ko is required for PHY initialisation. PPFE Features ~~~~~~~~~~~~~~ +- L3/L4 checksum offload - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/pfe_hif.c +114 -0
120 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.h +1 -0
@@ -143,5 +143,6 @@ void hif_process_client_req(struct pfe_hif *hif, int req, int data1, intint pfe_hif_init (struct pfe *pfe);void pfe_hif_exit (struct pfe *pfe);void pfe_hif_rx_idle (struct pfe_hif *hif); +int pfe_hif_init_buffers (struct pfe_hif *hif);#endif /* _PFE_HIF_H_ */
drivers/net/ppfe/pfe_hif_lib.c +48 -0
54 lines not on this page · raw message
drivers/net/ppfe/ppfe_ethdev.c +97 -3
124 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 9/13 net/ppfe: add burst enqueue and dequeue operations
In reply to Gagandeep SinghThis patch add burst enqueue and dequeue operations to the ppfe PMD.
--- drivers/net/ppfe/pfe_hif.c | 350 +++++++++++++++++++++++++++++++++ drivers/net/ppfe/pfe_hif.h | 8 + drivers/net/ppfe/pfe_hif_lib.c | 143 ++++++++++++++ drivers/net/ppfe/pfe_hif_lib.h | 8 + drivers/net/ppfe/pfe_mod.h | 2 + drivers/net/ppfe/ppfe_ethdev.c | 141 +++++++++++++ 6 files changed, 652 insertions(+)
drivers/net/ppfe/pfe_hif.c +350 -0
@@ -41,6 +41,37 @@ static void pfe_hif_free_descr(struct pfe_hif *hif)rte_free (hif->descr_baseaddr_v); } +/* pfe_hif_release_buffers */ +static void pfe_hif_release_buffers (struct pfe_hif *hif) +{ +struct hif_desc *desc; +uint32_t i =0 ; +struct rte_mbuf *mbuf; +struct rte_pktmbuf_pool_private *mb_priv; + + hif->rx_base = hif->descr_baseaddr_v; + +/*Free Rx buffers */ + desc = hif->rx_base; + mb_priv =rte_mempool_get_priv (hif->shm->pool); +for (i =0 ; i < hif->rx_ring_size; i++) { +if (readl (&desc->data)) { +if (i < hif->shm->rx_buf_pool_cnt && + !hif->shm->rx_buf_pool[i]) { + mbuf = hif->rx_buf_vaddr[i] +PFE_PKT_HEADER_SZ + -sizeof (struct rte_mbuf ) + -RTE_PKTMBUF_HEADROOM + - mb_priv->mbuf_priv_size; + hif->shm->rx_buf_pool[i] = mbuf; + } + } +writel (0 , &desc->data); +writel (0 , &desc->status); +writel (0 , &desc->ctrl); + desc++; + } +} +/* * pfe_hif_init_buffers * This function initializes the HIF Rx/Tx ring descriptors and
@@ -254,6 +285,322 @@ static void pfe_hif_client_unregister(struct pfe_hif *hif, u32 client_id)rte_spinlock_unlock (&hif->tx_lock); } +/* +* client_put_rxpacket- +*/ +static struct rte_mbuf *client_put_rxpacket (struct hif_rx_queue *queue, +void *pkt,u32 len, +u32 flags,u32 client_ctrl, +struct rte_mempool *pool, +u32 *rem_len) +{ +struct rx_queue_desc *desc = queue->base + queue->write_idx; +struct rte_mbuf *mbuf =NULL ; + + +if (readl (&desc->ctrl) &CL_DESC_OWN ) { + mbuf =rte_cpu_to_le_64 (rte_pktmbuf_alloc (pool)); +if (unlikely (!mbuf)) { +PFE_PMD_WARN ("Buffer allocation failure\n" ); +return NULL ; + } + + desc->data = pkt; + desc->client_ctrl = client_ctrl; +/* +* Ensure everything else is written to DDR before +* writing bd->ctrl +*/ +rte_wmb (); +writel (CL_DESC_BUF_LEN (len) | flags, &desc->ctrl); + queue->write_idx = (queue->write_idx +1 ) + & (queue->size -1 ); + + *rem_len = mbuf->buf_len; + } + +return mbuf; +} + +/* +* pfe_hif_rx_process- +* This function does pfe hif rx queue processing. +* Dequeue packet from Rx queue and send it to corresponding client queue +*/ +int pfe_hif_rx_process (struct pfe *pfe,int budget) +{ +struct hif_desc *desc; +struct hif_hdr *pkt_hdr; +struct __hif_hdr hif_hdr; +void *free_buf; +int rtc, len, rx_processed =0 ; +struct __hif_desc local_desc; +int flags =0 , wait_for_last =0 , retry =0 ; +unsigned int buf_size =0 ; +struct rte_mbuf *mbuf =NULL ; +struct pfe_hif *hif = &pfe->hif; + +rte_spinlock_lock (&hif->lock); + + rtc = hif->rxtoclean_index; + +while (rx_processed < budget) { + desc = hif->rx_base + rtc; + +__memcpy12 (&local_desc, desc); + +/* ACK pending Rx interrupt */ +if (local_desc.ctrl &BD_CTRL_DESC_EN ) { +if (unlikely (wait_for_last)) +continue ; +else +break ; + } + + len =BD_BUF_LEN (local_desc.ctrl); + pkt_hdr = (struct hif_hdr *)hif->rx_buf_vaddr[rtc]; + +/* Track last HIF header received */ +if (!hif->started) { + hif->started =1 ; + +__memcpy8 (&hif_hdr, pkt_hdr); + + hif->qno = hif_hdr.hdr.q_num; + hif->client_id = hif_hdr.hdr.client_id; + hif->client_ctrl = (hif_hdr.hdr.client_ctrl1 <<16 ) | + hif_hdr.hdr.client_ctrl; + flags =CL_DESC_FIRST ; + + }else { + flags =0 ; + } + +if (local_desc.ctrl &BD_CTRL_LIFM ) { + flags |=CL_DESC_LAST ; + wait_for_last =0 ; + }else { + wait_for_last =1 ; + } + +/* Check for valid client id and still registered */ +if (hif->client_id >=HIF_CLIENTS_MAX || + !(test_bit (hif->client_id, + &hif->shm->g_client_status[0 ]))) { +PFE_PMD_INFO ("packet with invalid client id %d qnum %d" , + hif->client_id, hif->qno); + + free_buf = hif->rx_buf_addr[rtc]; + + goto pkt_drop; + } + +/* Check to valid queue number */ +if (hif->client[hif->client_id].rx_qn <= hif->qno) { +PFE_DP_LOG (DEBUG ,"packet with invalid queue: %d" , + hif->qno); + hif->qno =0 ; + } + +retry: + mbuf = +client_put_rxpacket (&hif->client[hif->client_id].rx_q[hif->qno], + (void *)pkt_hdr, len, flags, + hif->client_ctrl, hif->shm->pool, + &buf_size); + +if (unlikely (!mbuf)) { +if (!retry) { +pfe_tx_do_cleanup (pfe); + retry =1 ; + goto retry; + } + rx_processed = budget; + +if (flags &CL_DESC_FIRST ) + hif->started =0 ; + +PFE_DP_LOG (DEBUG ,"No buffers" ); +break ; + } + + retry =0 ; + + free_buf = (void *)(size_t )rte_pktmbuf_iova (mbuf); + free_buf = free_buf -PFE_PKT_HEADER_SZ ; + +/*Fill free buffer in the descriptor */ + hif->rx_buf_addr[rtc] = free_buf; + hif->rx_buf_vaddr[rtc] = (void *)((size_t )mbuf->buf_addr + + mbuf->data_off -PFE_PKT_HEADER_SZ ); + hif->rx_buf_len[rtc] = buf_size -RTE_PKTMBUF_HEADROOM ; + +pkt_drop: +writel (DDR_PHYS_TO_PFE (free_buf), &desc->data); +/* +* Ensure everything else is written to DDR before +* writing bd->ctrl +*/ +rte_wmb (); +writel ((BD_CTRL_PKT_INT_EN |BD_CTRL_LIFM |BD_CTRL_DIR | +BD_CTRL_DESC_EN |BD_BUF_LEN (hif->rx_buf_len[rtc])), + &desc->ctrl); + + rtc = (rtc +1 ) & (hif->rx_ring_size -1 ); + +if (local_desc.ctrl &BD_CTRL_LIFM ) { +if (!(hif->client_ctrl &HIF_CTRL_RX_CONTINUED )) + rx_processed++; + + hif->started =0 ; + } + } + + + hif->rxtoclean_index = rtc; +rte_spinlock_unlock (&hif->lock); + +/* we made some progress, re-start rx dma in case it stopped */ +hif_rx_dma_start (); + +return rx_processed; +} + +/* +* client_ack_txpacket- +* This function ack the Tx packet in the give client Tx queue by resetting +* ownership bit in the descriptor. +*/ +static int client_ack_txpacket (struct pfe_hif *hif,unsigned int client_id, +unsigned int q_no) +{ +struct hif_tx_queue *queue = &hif->client[client_id].tx_q[q_no]; +struct tx_queue_desc *desc = queue->base + queue->ack_idx; + +if (readl (&desc->ctrl) &CL_DESC_OWN ) { +writel ((readl (&desc->ctrl) & ~CL_DESC_OWN ), &desc->ctrl); + queue->ack_idx = (queue->ack_idx +1 ) & (queue->size -1 ); + +return 0 ; + + }else { +/*This should not happen */ +PFE_PMD_ERR ("%d %d %d %d %d %p %d" , + hif->txtosend, hif->txtoclean, hif->txavail, + client_id, q_no, queue, queue->ack_idx); +return 1 ; + } +} + +static void __hif_tx_done_process (struct pfe *pfe,int count) +{ +struct hif_desc *desc; +struct hif_desc_sw *desc_sw; +unsigned int ttc, tx_avl; +int pkts_done[HIF_CLIENTS_MAX ] = {0 ,0 }; +struct pfe_hif *hif = &pfe->hif; + + ttc = hif->txtoclean; + tx_avl = hif->txavail; + +while ((tx_avl < hif->tx_ring_size) && count--) { + desc = hif->tx_base + ttc; + +if (readl (&desc->ctrl) &BD_CTRL_DESC_EN ) +break ; + + desc_sw = &hif->tx_sw_queue[ttc]; + +if (desc_sw->client_id >HIF_CLIENTS_MAX ) +PFE_PMD_ERR ("Invalid cl id %d" , desc_sw->client_id); + + pkts_done[desc_sw->client_id]++; + +client_ack_txpacket (hif, desc_sw->client_id, desc_sw->q_no); + + ttc = (ttc +1 ) & (hif->tx_ring_size -1 ); + tx_avl++; + } + +if (pkts_done[0 ]) +hif_lib_indicate_client (pfe->hif_client[0 ],EVENT_TXDONE_IND , +0 ); +if (pkts_done[1 ]) +hif_lib_indicate_client (pfe->hif_client[1 ],EVENT_TXDONE_IND , +0 ); + hif->txtoclean = ttc; + hif->txavail = tx_avl; +} + +static inline void hif_tx_done_process (struct pfe *pfe,int count) +{ +struct pfe_hif *hif = &pfe->hif; +rte_spinlock_lock (&hif->tx_lock); +__hif_tx_done_process (pfe, count); +rte_spinlock_unlock (&hif->tx_lock); +} + +void pfe_tx_do_cleanup (struct pfe *pfe) +{ +hif_tx_done_process (pfe,HIF_TX_DESC_NT ); +} + +/* +* __hif_xmit_pkt - +* This function puts one packet in the HIF Tx queue +*/ +void hif_xmit_pkt (struct pfe_hif *hif,unsigned int client_id,unsigned int + q_no,void *data,u32 len,unsigned int flags) +{ +struct hif_desc *desc; +struct hif_desc_sw *desc_sw; + + desc = hif->tx_base + hif->txtosend; + desc_sw = &hif->tx_sw_queue[hif->txtosend]; + + desc_sw->len = len; + desc_sw->client_id = client_id; + desc_sw->q_no = q_no; + desc_sw->flags = flags; + +writel ((u32 )DDR_PHYS_TO_PFE (data), &desc->data); + + hif->txtosend = (hif->txtosend +1 ) & (hif->tx_ring_size -1 ); + hif->txavail--; + +if ((!((flags &HIF_DATA_VALID ) && (flags & +HIF_LAST_BUFFER )))) + goto skip_tx; + +/* +* Ensure everything else is written to DDR before +* writing bd->ctrl +*/ +rte_wmb (); + +do { + desc_sw = &hif->tx_sw_queue[hif->txtoflush]; + desc = hif->tx_base + hif->txtoflush; + +if (desc_sw->flags &HIF_LAST_BUFFER ) { +writel ((BD_CTRL_LIFM | +BD_CTRL_BRFETCH_DISABLE |BD_CTRL_RTFETCH_DISABLE + |BD_CTRL_PARSE_DISABLE |BD_CTRL_DESC_EN | +BD_BUF_LEN (desc_sw->len)), + &desc->ctrl); + }else { +writel ((BD_CTRL_DESC_EN | +BD_BUF_LEN (desc_sw->len)), &desc->ctrl); + } + hif->txtoflush = (hif->txtoflush +1 ) & (hif->tx_ring_size -1 ); + } +while (hif->txtoflush != hif->txtosend) + ; + +skip_tx: +return ; +} +void hif_process_client_req (struct pfe_hif *hif,int req, int data1, __rte_unused int data2) {
@@ -491,6 +838,9 @@ void pfe_hif_exit(struct pfe *pfe)hif_rx_disable ();hif_tx_disable (); +pfe_hif_release_buffers (hif); +pfe_hif_shm_clean (hif->shm); +pfe_hif_free_descr (hif); pfe->hif.setuped =0 ; }
drivers/net/ppfe/pfe_hif.h +8 -0
@@ -138,11 +138,19 @@ struct pfe_hif {struct rte_device *dev; }; +void hif_xmit_pkt (struct pfe_hif *hif,unsigned int client_id,unsigned int + q_no,void *data,u32 len,unsigned int flags);void hif_process_client_req (struct pfe_hif *hif,int req,int data1,int data2);int pfe_hif_init (struct pfe *pfe);void pfe_hif_exit (struct pfe *pfe);void pfe_hif_rx_idle (struct pfe_hif *hif); +int pfe_hif_rx_process (struct pfe *pfe,int budget);int pfe_hif_init_buffers (struct pfe_hif *hif); +void pfe_tx_do_cleanup (struct pfe *pfe); + +#define __memcpy8 (dst, src) memcpy(dst, src, 8) +#define __memcpy12 (dst, src) memcpy(dst, src, 12) +#define __memcpy (dst, src, len) memcpy(dst, src, len)#endif /* _PFE_HIF_H_ */
drivers/net/ppfe/pfe_hif_lib.c +143 -0
149 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.h +8 -0
@@ -162,6 +162,9 @@ int pfe_hif_lib_init(struct pfe *pfe);void pfe_hif_lib_exit (struct pfe *pfe);int hif_lib_client_register (struct hif_client_s *client);int hif_lib_client_unregister (struct hif_client_s *client); +void hif_lib_xmit_pkt (struct hif_client_s *client,unsigned int qno, +void *data,void *data1,unsigned int len, +u32 client_ctrl,unsigned int flags,void *client_data);void hif_lib_indicate_client (struct hif_client_s *client,int event,int data);int hif_lib_event_handler_start (struct hif_client_s *client,int event,int data);
@@ -170,4 +173,9 @@ void *hif_lib_tx_get_next_complete(struct hif_client_s *client, int qno,int pfe_hif_shm_init (struct hif_shm *hif_shm,struct rte_mempool *mb_pool);void pfe_hif_shm_clean (struct hif_shm *hif_shm); +int hif_lib_receive_pkt (struct hif_client_rx_queue *queue, +struct rte_mempool *pool, +struct rte_mbuf **rx_pkts, +uint16_t nb_pkts); +#endif /* _PFE_HIF_LIB_H_ */
drivers/net/ppfe/pfe_mod.h +2 -0
@@ -7,6 +7,8 @@struct pfe ; +#include <rte_ethdev.h> +#include "pfe.h" #include "pfe_hif.h" #include "pfe_hif_lib.h"
drivers/net/ppfe/ppfe_ethdev.c +141 -0
171 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 10/13 net/ppfe: add supported packet types and basic statistics
In reply to Gagandeep SinghThis patch add support for supported packet types by the platform andbasic statistics like numbers of packets/bytes receive and transmit.
--- doc/guides/nics/features/ppfe.ini | 2 ++ doc/guides/nics/ppfe.rst | 2 ++ drivers/net/ppfe/ppfe_ethdev.c | 43 +++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+)
doc/guides/nics/features/ppfe.ini +2 -0
@@ -6,6 +6,8 @@ [Features] L3 checksum offload = Y L4 checksum offload = Y +Packet type parsing = Y +Basic stats = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +2 -0
@@ -92,6 +92,8 @@ PPFE Features ~~~~~~~~~~~~~~ - L3/L4 checksum offload +- Packet type parsing +- Basic stats - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +43 -0
55 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 11/13 net/ppfe: add MTU and MAC address set operations
In reply to Gagandeep SinghTo update MAC address or MTU, operations are added to the driver.
--- doc/guides/nics/features/ppfe.ini | 1 + doc/guides/nics/ppfe.rst | 1 + drivers/net/ppfe/ppfe_ethdev.c | 62 +++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+)
doc/guides/nics/features/ppfe.ini +1 -0
@@ -8,6 +8,7 @@ L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y Basic stats = Y +MTU update = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +1 -0
@@ -94,6 +94,7 @@ PPFE Features - L3/L4 checksum offload - Packet type parsing - Basic stats +- MTU update - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +62 -0
92 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 12/13 net/ppfe: add allmulticast and promiscuous
In reply to Gagandeep SinghThis patch adds support to enable multicast and
promiscuous mode.
--- doc/guides/nics/features/ppfe.ini | 2 ++ doc/guides/nics/ppfe.rst | 2 ++ drivers/net/ppfe/ppfe_ethdev.c | 36 +++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+)
doc/guides/nics/features/ppfe.ini +2 -0
@@ -9,6 +9,8 @@ L4 checksum offload = Y Packet type parsing = Y Basic stats = Y MTU update = Y +Promiscuous mode = Y +Allmulticast mode = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +2 -0
@@ -95,6 +95,8 @@ PPFE Features - Packet type parsing - Basic stats - MTU update +- Promiscuous mode +- Allmulticast mode - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +36 -0
@@ -542,6 +542,39 @@ pfe_supported_ptypes_get(struct rte_eth_dev *dev)return NULL ; } +static void +pfe_promiscuous_enable (struct rte_eth_dev *dev) +{ +struct pfe_eth_priv_s *priv = dev->data->dev_private; + + priv->promisc =1 ; + dev->data->promiscuous =1 ; +gemac_enable_copy_all (priv->EMAC_baseaddr); +} + +static void +pfe_promiscuous_disable (struct rte_eth_dev *dev) +{ +struct pfe_eth_priv_s *priv = dev->data->dev_private; + + priv->promisc =0 ; + dev->data->promiscuous =0 ; +gemac_disable_copy_all (priv->EMAC_baseaddr); +} + +static void +pfe_allmulticast_enable (struct rte_eth_dev *dev) +{ +struct pfe_eth_priv_s *priv = dev->data->dev_private; +struct pfe_mac_addr hash_addr;/* hash register structure */ + +/* Set the hash to rx all multicast frames */ + hash_addr.bottom =0xFFFFFFFF ; + hash_addr.top =0xFFFFFFFF ; +gemac_set_hash (priv->EMAC_baseaddr, &hash_addr); + dev->data->all_multicast =1 ; +} +static int pfe_mtu_set (struct rte_eth_dev *dev,uint16_t mtu) {
@@ -625,6 +658,9 @@ static const struct eth_dev_ops ops = { .tx_queue_setup = pfe_tx_queue_setup, .tx_queue_release = pfe_tx_queue_release, .dev_supported_ptypes_get = pfe_supported_ptypes_get, + .promiscuous_enable = pfe_promiscuous_enable, + .promiscuous_disable = pfe_promiscuous_disable, + .allmulticast_enable = pfe_allmulticast_enable, .mtu_set = pfe_mtu_set, .mac_addr_set = pfe_dev_set_mac_addr, .stats_get = pfe_stats_get,
Signature · 1 line
2.17.1
PATCH v2 13/13 net/ppfe: add link status update
In reply to Gagandeep SinghThis patch add link related operations like link update, up and down.
--- doc/guides/nics/features/ppfe.ini | 1 + doc/guides/nics/ppfe.rst | 1 + drivers/net/ppfe/ppfe_ethdev.c | 103 ++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+)
doc/guides/nics/features/ppfe.ini +1 -0
@@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +Link status = Y L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y
doc/guides/nics/ppfe.rst +1 -0
@@ -97,6 +97,7 @@ PPFE Features - MTU update - Promiscuous mode - Allmulticast mode +- Link status - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +103 -0
130 lines not on this page · raw message
Signature · 1 line
2.17.1
Quoted 29 lines · Gagandeep Singh
This series introduces ppfe (programmable packet forwarding engine) network poll mode driver for NXP SoC ls1012a.
First patch of this series move OF library code from dpaa bus to a common folder as PPFE also uses the same library for getting information from the device tree.
This patch is included in this series so that compilation by CI don't break.V2 Change-log:
* fix compilation break for clang3.4 and gcc 4.8
* fix checkpatch errorsGagandeep Singh (12):
net/ppfe: introduce ppfe net poll mode driver
doc: add guide for ppfe net PMD
net/ppfe: support dynamic logging
net/ppfe: add HW specific macros and operations net/ppfe: add MAC and host interface initialisation net/ppfe: add device start stop operations net/ppfe: add queue setup and release operations net/ppfe: add burst enqueue and dequeue operations net/ppfe: add supported packet types and basic statistics net/ppfe: add MTU and MAC address set operations net/ppfe: add allmulticast and promiscuous net/ppfe: add link status update
Quoted 3 lines
Hemant Agrawal (1):
common/dpaax: moving OF lib code from dpaa bus
Hi Gagandeep, Hemant,
There has been some ethdev API changes in next-net and driver needs to comply with them, can you please send a new version rebasing latest next-net?
Meanwhile I put some comments to patches, please check them as well, I am planning to do another round on next version.
Thanks,
ferruh
Hi Ferruh,
Quoted 20 lines
Quoted 14 lines
Gagandeep Singh (12):
net/ppfe: introduce ppfe net poll mode driver
doc: add guide for ppfe net PMD
net/ppfe: support dynamic logging
net/ppfe: add HW specific macros and operations net/ppfe: add MAC and host interface initialisation net/ppfe: add device start stop operations net/ppfe: add queue setup and release operations net/ppfe: add burst enqueue and dequeue operations net/ppfe: add supported packet types and basic statistics net/ppfe: add MTU and MAC address set operations net/ppfe: add allmulticast and promiscuous net/ppfe: add link status updateQuoted 3 lines
Hemant Agrawal (1):
common/dpaax: moving OF lib code from dpaa busHi Gagandeep, Hemant,
Quoted 8 lines
There has been some ethdev API changes in next-net and driver needs to comply with them, can you please send a new version rebasing latest next-net?
Meanwhile I put some comments to patches, please check them as well, I am planning to do another round on next version.
Thanks,
ferruh
I saw your comments, will handle them in next version of this series.
Thanks,
Gagan
v3 cover introduces ppfe network PMD
In reply to Gagandeep SinghThis series introduces ppfe (programmable packet forwarding engine) network poll mode driver for NXP SoC ls1012a.
First patch of this series move OF library code from dpaa bus to a common folder as PPFE also uses the same library for getting information from the device tree.
This patch is included in this series so that compilation by CI don't break.
V2 Change-log:
* fix compilation break for clang3.4 and gcc 4.8
* fix checkpatch errors
V3 Change-log:
* Release notes updated for PPFE PMD
* Experimental APIs list added in Makefile and meson
* Dynamic logging added
* PPFE documentation is updated for kernel module "pfe.ko" and parameter "intf" is mentioned.
* of.h and of.c are renamed to dpaa_of.h and dpaa_of.c
* enable PPFE compilation only in 'common_armv8a_linux'
* PFE_CDEV_ETH_COUNT updated 2, as only 2 eth devices supported.
* Comment updated for "pfe_us_cdev" device
* functions prototype updated
* intf params value check added during parsing and unwanted port id checks removed.
* unwanted dev->data memcpy removed.
* munmap and rte_eth_dev_release_port added in error case
* atoi replaced with strtol
* add static to global variable g_pfe
Gagandeep Singh (13):
net/ppfe: introduce ppfe net poll mode driver
doc: add guide for ppfe net PMD
net/ppfe: support dynamic logging
net/ppfe: add HW specific macros and operations net/ppfe: add MAC and host interface initialisation net/ppfe: add device start stop operations net/ppfe: add queue setup and release operations net/ppfe: add burst enqueue and dequeue operations net/ppfe: add supported packet types and basic statistics net/ppfe: add MTU and MAC address set operations net/ppfe: add allmulticast and promiscuous net/ppfe: add link status update
doc: add NXP PPFE PMD in release notes
Hemant Agrawal (1):
common/dpaax: moving OF lib code from dpaa bus
MAINTAINERS | 7 +
config/common_armv8a_linux | 5 +
config/common_base | 5 +
doc/guides/nics/features/ppfe.ini | 17 +
doc/guides/nics/index.rst | 1 +
doc/guides/nics/ppfe.rst | 180 +++
doc/guides/rel_notes/release_19_11.rst | 5 +
drivers/bus/dpaa/Makefile | 2 +-
drivers/bus/dpaa/base/fman/fman.c | 2 +-
drivers/bus/dpaa/base/fman/netcfg_layer.c | 2 +-
drivers/bus/dpaa/base/qbman/dpaa_sys.h | 3 +-
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/compat.h | 1 -
drivers/bus/dpaa/include/fman.h | 1 +
drivers/bus/dpaa/include/fsl_usd.h | 1 +
drivers/bus/dpaa/meson.build | 1 -
drivers/bus/dpaa/rte_dpaa_bus.h | 2 +-
drivers/bus/fslmc/Makefile | 1 +
drivers/common/dpaax/Makefile | 10 +-
.../dpaa/include => common/dpaax}/dpaa_list.h | 0
.../base/fman/of.c => common/dpaax/dpaa_of.c} | 63 +-
.../include/of.h => common/dpaax/dpaa_of.h} | 27 +-
drivers/common/dpaax/dpaax_logs.h | 10 +
drivers/common/dpaax/meson.build | 5 +-
.../common/dpaax/rte_common_dpaax_version.map | 18 +
drivers/crypto/caam_jr/Makefile | 2 +
drivers/crypto/caam_jr/caam_jr.c | 2 +-
drivers/crypto/dpaa2_sec/Makefile | 2 +-
drivers/crypto/dpaa_sec/Makefile | 1 +
drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
drivers/event/dpaa/Makefile | 1 +
drivers/event/dpaa2/Makefile | 1 +
drivers/mempool/dpaa/Makefile | 1 +
drivers/mempool/dpaa2/Makefile | 1 +
drivers/net/Makefile | 1 +
drivers/net/dpaa/Makefile | 1 +
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa2/Makefile | 1 +
drivers/net/meson.build | 1 +
drivers/net/ppfe/Makefile | 38 +
drivers/net/ppfe/base/cbus.h | 66 +
drivers/net/ppfe/base/cbus/bmu.h | 41 +
drivers/net/ppfe/base/cbus/class_csr.h | 277 ++++
drivers/net/ppfe/base/cbus/emac_mtip.h | 231 ++++
drivers/net/ppfe/base/cbus/gpi.h | 77 ++
drivers/net/ppfe/base/cbus/hif.h | 86 ++
drivers/net/ppfe/base/cbus/hif_nocpy.h | 36 +
drivers/net/ppfe/base/cbus/tmu_csr.h | 154 +++
drivers/net/ppfe/base/cbus/util_csr.h | 47 +
drivers/net/ppfe/base/pfe.h | 422 ++++++
drivers/net/ppfe/meson.build | 19 +
drivers/net/ppfe/pfe_eth.h | 74 +
drivers/net/ppfe/pfe_hal.c | 635 +++++++++
drivers/net/ppfe/pfe_hif.c | 868 ++++++++++++
drivers/net/ppfe/pfe_hif.h | 156 +++
drivers/net/ppfe/pfe_hif_lib.c | 576 ++++++++
drivers/net/ppfe/pfe_hif_lib.h | 181 +++
drivers/net/ppfe/pfe_logs.h | 31 +
drivers/net/ppfe/pfe_mod.h | 64 +
drivers/net/ppfe/ppfe_ethdev.c | 1186 +++++++++++++++++
drivers/net/ppfe/rte_pmd_ppfe_version.map | 4 +
drivers/raw/dpaa2_cmdif/Makefile | 1 +
drivers/raw/dpaa2_qdma/Makefile | 1 +
mk/rte.app.mk | 1 +
65 files changed, 5610 insertions(+), 54 deletions(-)
create mode 100644 doc/guides/nics/features/ppfe.ini
create mode 100644 doc/guides/nics/ppfe.rst
rename drivers/{bus/dpaa/include => common/dpaax}/dpaa_list.h (100%)
rename drivers/{bus/dpaa/base/fman/of.c => common/dpaax/dpaa_of.c} (88%)
rename drivers/{bus/dpaa/include/of.h => common/dpaax/dpaa_of.h} (86%)
create mode 100644 drivers/net/ppfe/Makefile
create mode 100644 drivers/net/ppfe/base/cbus.h
create mode 100644 drivers/net/ppfe/base/cbus/bmu.h
create mode 100644 drivers/net/ppfe/base/cbus/class_csr.h
create mode 100644 drivers/net/ppfe/base/cbus/emac_mtip.h
create mode 100644 drivers/net/ppfe/base/cbus/gpi.h
create mode 100644 drivers/net/ppfe/base/cbus/hif.h
create mode 100644 drivers/net/ppfe/base/cbus/hif_nocpy.h
create mode 100644 drivers/net/ppfe/base/cbus/tmu_csr.h
create mode 100644 drivers/net/ppfe/base/cbus/util_csr.h
create mode 100644 drivers/net/ppfe/base/pfe.h
create mode 100644 drivers/net/ppfe/meson.build
create mode 100644 drivers/net/ppfe/pfe_eth.h
create mode 100644 drivers/net/ppfe/pfe_hal.c
create mode 100644 drivers/net/ppfe/pfe_hif.c
create mode 100644 drivers/net/ppfe/pfe_hif.h
create mode 100644 drivers/net/ppfe/pfe_hif_lib.c
create mode 100644 drivers/net/ppfe/pfe_hif_lib.h
create mode 100644 drivers/net/ppfe/pfe_logs.h
create mode 100644 drivers/net/ppfe/pfe_mod.h
create mode 100644 drivers/net/ppfe/ppfe_ethdev.c
create mode 100644 drivers/net/ppfe/rte_pmd_ppfe_version.mapSignature · 1 line
2.17.1
PATCH v3 1/14 common/dpaax: moving OF lib code from dpaa bus
From: Hemant Agrawal <[email protected]>
This code is being shared by more than 1 type of driver. Common is most appropriate place for it.
---
drivers/bus/dpaa/Makefile | 2 +-
drivers/bus/dpaa/base/fman/fman.c | 2 +-
drivers/bus/dpaa/base/fman/netcfg_layer.c | 2 +-
drivers/bus/dpaa/base/qbman/dpaa_sys.h | 3 +-
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/compat.h | 1 -
drivers/bus/dpaa/include/fman.h | 1 +
drivers/bus/dpaa/include/fsl_usd.h | 1 +
drivers/bus/dpaa/meson.build | 1 -
drivers/bus/dpaa/rte_dpaa_bus.h | 2 +-
drivers/bus/fslmc/Makefile | 1 +
drivers/common/dpaax/Makefile | 10 +--
.../dpaa/include => common/dpaax}/dpaa_list.h | 0
.../base/fman/of.c => common/dpaax/dpaa_of.c} | 63 ++++++++++---------
.../include/of.h => common/dpaax/dpaa_of.h} | 27 ++++++--
drivers/common/dpaax/dpaax_logs.h | 10 +++
drivers/common/dpaax/meson.build | 5 +-
.../common/dpaax/rte_common_dpaax_version.map | 18 ++++++
drivers/crypto/caam_jr/Makefile | 2 +
drivers/crypto/caam_jr/caam_jr.c | 2 +-
drivers/crypto/dpaa2_sec/Makefile | 2 +-
drivers/crypto/dpaa_sec/Makefile | 1 +
drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
drivers/event/dpaa/Makefile | 1 +
drivers/event/dpaa2/Makefile | 1 +
drivers/mempool/dpaa/Makefile | 1 +
drivers/mempool/dpaa2/Makefile | 1 +
drivers/net/dpaa/Makefile | 1 +
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa2/Makefile | 1 +
drivers/raw/dpaa2_cmdif/Makefile | 1 +
drivers/raw/dpaa2_qdma/Makefile | 1 +
33 files changed, 118 insertions(+), 54 deletions(-)
rename drivers/{bus/dpaa/include => common/dpaax}/dpaa_list.h (100%)
rename drivers/{bus/dpaa/base/fman/of.c => common/dpaax/dpaa_of.c} (88%)
rename drivers/{bus/dpaa/include/of.h => common/dpaax/dpaa_of.h} (86%)drivers/bus/dpaa/Makefile +1 -1
@@ -17,6 +17,7 @@ CFLAGS += -Wno-cast-qual CFLAGS += -I$(RTE_BUS_DPAA)/ CFLAGS += -I$(RTE_BUS_DPAA)/include CFLAGS += -I$(RTE_BUS_DPAA)/base/qbman +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include # versioning export map
@@ -32,7 +33,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \ base/fman/fman.c \ base/fman/fman_hw.c \ - base/fman/of.c \ base/fman/netcfg_layer.c \ base/qbman/process.c \ base/qbman/bman.c \
drivers/bus/dpaa/base/fman/fman.c +1 -1
@@ -11,7 +11,7 @@/* This header declares the driver interface we implement */ #include <fman.h> -#include <of.h> +#include <dpaa_of.h> #include <rte_malloc.h> #include <rte_dpaa_logs.h> #include <rte_string_fns.h>
drivers/bus/dpaa/base/fman/netcfg_layer.c +1 -1
@@ -5,7 +5,7 @@* */ #include <inttypes.h> -#include <of.h> +#include <dpaa_of.h> #include <net/if.h> #include <sys/ioctl.h> #include <error.h>
drivers/bus/dpaa/base/qbman/dpaa_sys.h +2 -1
@@ -8,7 +8,8 @@#ifndef __DPAA_SYS_H#define __DPAA_SYS_H -#include <of.h> +#include <compat.h> +#include <dpaa_of.h> /* For 2-element tables related to cache-inhibited and cache-enabled mappings */ #define DPAA_PORTAL_CE 0
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -32,6 +32,7 @@#include <rte_bus.h> #include <rte_mbuf_pool_ops.h> +#include <dpaa_of.h> #include <rte_dpaa_bus.h> #include <rte_dpaa_logs.h> #include <dpaax_iova_table.h>
@@ -39,7 +40,6 @@#include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> #include <netcfg.h> int dpaa_logtype_bus;
drivers/bus/dpaa/include/compat.h +0 -1
@@ -390,7 +390,6 @@ static inline unsigned long get_zeroed_page(gfp_t __foo __rte_unused)#define atomic_dec_return (v) rte_atomic32_sub_return(v, 1)#define atomic_sub_and_test (i, v) (rte_atomic32_sub_return(v, i) == 0) -#include <dpaa_list.h> #include <dpaa_bits.h> #endif /* __COMPAT_H */
drivers/bus/dpaa/include/fman.h +1 -0
@@ -15,6 +15,7 @@#include <rte_ether.h> #include <compat.h> +#include <dpaa_list.h> #ifndef FMAN_DEVICE_PATH #define FMAN_DEVICE_PATH "/dev/mem"
drivers/bus/dpaa/include/fsl_usd.h +1 -0
@@ -9,6 +9,7 @@#define __FSL_USD_H#include <compat.h> +#include <dpaa_list.h> #include <fsl_qman.h> #ifdef __cplusplus
drivers/bus/dpaa/meson.build +0 -1
@@ -12,7 +12,6 @@ deps += ['common_dpaax', 'eventdev'] sources = files('base/fman/fman.c', 'base/fman/fman_hw.c', 'base/fman/netcfg_layer.c', - 'base/fman/of.c', 'base/qbman/bman.c', 'base/qbman/bman_driver.c', 'base/qbman/dpaa_alloc.c',
drivers/bus/dpaa/rte_dpaa_bus.h +1 -1
@@ -10,10 +10,10 @@#include <rte_mempool.h> #include <dpaax_iova_table.h> +#include <dpaa_of.h> #include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> #include <netcfg.h> #define DPAA_MEMPOOL_OPS_NAME "dpaa"
drivers/bus/fslmc/Makefile +1 -0
@@ -16,6 +16,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev
drivers/common/dpaax/Makefile +6 -4
@@ -12,6 +12,10 @@ LIB = librte_common_dpaax.a CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -Wno-pointer-arith +CFLAGS += -Wno-cast-qual + +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax # versioning export map EXPORT_MAP := rte_common_dpaax_version.map
@@ -22,10 +26,8 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # -SRCS-y += dpaax_iova_table.c +SRCS-y += dpaax_iova_table.c dpaa_of.c LDLIBS += -lrte_eal -SYMLINK-y-include += dpaax_iova_table.h - -include $(RTE_SDK)/mk/rte.lib.mk +include $(RTE_SDK)/mk/rte.lib.mk
drivers/common/dpaax/dpaa_list.h renamed from drivers/bus/dpaa/include/dpaa_list.h +0 -0
drivers/common/dpaax/dpaa_of.c renamed from drivers/bus/dpaa/base/fman/of.c +32 -31
227 lines not on this page · raw message
drivers/common/dpaax/dpaa_of.h renamed from drivers/bus/dpaa/include/of.h +22 -5
@@ -8,7 +8,24 @@#ifndef __OF_H#define __OF_H -#include <compat.h> +#include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <stdbool.h> +#include <stdlib.h> +#include <inttypes.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <dirent.h> +#include <fcntl.h> +#include <glob.h> +#include <errno.h> +#include <ctype.h> +#include <unistd.h> +#include <limits.h> +#include <inttypes.h> +#include <rte_common.h> +#include <dpaa_list.h> #ifndef OF_INIT_DEFAULT_PATH #define OF_INIT_DEFAULT_PATH "/proc/device-tree"
@@ -89,7 +106,7 @@ struct dt_file {const struct device_node *of_find_compatible_node (const struct device_node *from, -const char *type__always_unused , + const char *type __rte_unused,const char *compatible) __attribute__((nonnull (3 )));
@@ -102,7 +119,7 @@ const void *of_get_property(const struct device_node *from, const char *name, size_t *lenp) __attribute__((nonnull(2)));bool of_device_is_available (const struct device_node *dev_node); -const struct device_node *of_find_node_by_phandle (phandle ph); +const struct device_node *of_find_node_by_phandle (uint64_t ph);const struct device_node *of_get_parent (const struct device_node *dev_node);
@@ -122,7 +139,7 @@ const uint32_t *of_get_address(const struct device_node *dev_node, size_t idx, uint64_t *size, uint32_t *flags);uint64_t of_translate_address (const struct device_node *dev_node, -const u32 *addr) __attribute__((nonnull)); +const uint32_t *addr) __attribute__((nonnull));bool of_device_is_compatible (const struct device_node *dev_node,const char *compatible);
@@ -147,7 +164,7 @@ static inline int of_init(void)/* Read a numeric property according to its size and return it as a 64-bit * value. */ -static inline uint64_t of_read_number (const __be32 *cell,int size) +static inline uint64_t of_read_number (const uint32_t *cell,int size) {uint64_t r =0 ;
drivers/common/dpaax/dpaax_logs.h +10 -0
@@ -9,6 +9,16 @@extern int dpaax_logger; +#ifdef RTE_LIBRTE_DPAAX_DEBUG +#define DPAAX_HWWARN(cond, fmt, args...) \ + do {\ + if (cond) \ + DPAAX_LOG(DEBUG, "WARN: " fmt, ##args); \ + } while (0) +#else +#define DPAAX_HWWARN(cond, fmt, args...) do { } while (0) +#endif + #define DPAAX_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaax_logger, "dpaax: " fmt "\n", \ ##args)
drivers/common/dpaax/meson.build +4 -1
@@ -8,6 +8,9 @@ if not is_linux reason = 'only supported on linux' endif -sources = files('dpaax_iova_table.c') +sources = files('dpaax_iova_table.c', 'dpaa_of.c') cflags += ['-D_GNU_SOURCE'] +if cc.has_argument('-Wno-cast-qual') + cflags += '-Wno-cast-qual' +endif
drivers/common/dpaax/rte_common_dpaax_version.map +18 -0
@@ -9,3 +9,21 @@ DPDK_18.11 { local: *; }; + +DPDK_19.11 { + global: + of_device_is_available; + of_device_is_compatible; + of_find_compatible_node; + of_find_node_by_phandle; + of_get_address; + of_get_mac_address; + of_get_parent; + of_get_property; + of_init_path; + of_n_addr_cells; + of_translate_address; + of_get_next_child; + + local: *; +} DPDK_18.11;
drivers/crypto/caam_jr/Makefile +2 -0
@@ -17,6 +17,7 @@ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/caam_jr #sharing the hw flib headers from dpaa2_sec pmd CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/
@@ -37,6 +38,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr_uio.c LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_cryptodev +LDLIBS += -lrte_common_dpaax LDLIBS += -lrte_bus_dpaa LDLIBS += -lrte_bus_vdev
drivers/crypto/caam_jr/caam_jr.c +1 -1
@@ -27,7 +27,7 @@/* RTA header files */ #include <hw/desc/common.h> #include <hw/desc/algo.h> -#include <of.h> +#include <dpaa_of.h> #define CAAM_JR_DBG 0#define CRYPTODEV_NAME_CAAM_JR_PMD crypto_caam_jr
drivers/crypto/dpaa2_sec/Makefile +1 -1
@@ -19,7 +19,7 @@ ifeq ($(shell test $(GCC_VERSION) -gt 70 && echo 1), 1) CFLAGS += -Wno-implicit-fallthrough endif endif - +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/ CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/
drivers/crypto/dpaa_sec/Makefile +1 -0
@@ -16,6 +16,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa_sec/ #sharing the hw flib headers from dpaa2_sec pmd CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/
drivers/crypto/dpaa_sec/dpaa_sec.c +1 -1
@@ -27,7 +27,7 @@#include <fsl_usd.h> #include <fsl_qman.h> -#include <of.h> +#include <dpaa_of.h> /* RTA header files */ #include <hw/desc/common.h>
drivers/event/dpaa/Makefile +1 -0
@@ -19,6 +19,7 @@ CFLAGS += -I$(RTE_SDK_DPAA)/include CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include EXPORT_MAP := rte_pmd_dpaa_event_version.map
drivers/event/dpaa2/Makefile +1 -0
@@ -17,6 +17,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/portal CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa2 +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_eal -lrte_eventdev LDLIBS += -lrte_bus_fslmc -lrte_mempool_dpaa2 -lrte_pmd_dpaa2 LDLIBS += -lrte_bus_vdev
drivers/mempool/dpaa/Makefile +1 -0
@@ -12,6 +12,7 @@ CFLAGS := -I$(SRCDIR) $(CFLAGS) CFLAGS += -O3 $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa CFLAGS += -I$(RTE_SDK)/lib/librte_mempool
drivers/mempool/dpaa2/Makefile +1 -0
@@ -12,6 +12,7 @@ LIB = librte_mempool_dpaa2.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include # versioning export map
drivers/net/dpaa/Makefile +1 -0
@@ -19,6 +19,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/base/qbman CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
drivers/net/dpaa/dpaa_ethdev.h +1 -1
@@ -15,7 +15,7 @@#include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> +#include <dpaa_of.h> #include <netcfg.h> #define MAX_DPAA_CORES 4
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -44,7 +44,7 @@#include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> +#include <dpaa_of.h> #include <netcfg.h> #define DPAA_MBUF_TO_CONTIG_FD (_mbuf, _fd, _bpid) \
drivers/net/dpaa2/Makefile +1 -0
@@ -12,6 +12,7 @@ LIB = librte_pmd_dpaa2.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc
drivers/raw/dpaa2_cmdif/Makefile +1 -0
@@ -14,6 +14,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_bus_vdev
drivers/raw/dpaa2_qdma/Makefile +1 -0
@@ -14,6 +14,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_eal
Signature · 1 line
2.17.1
PATCH v3 2/14 net/ppfe: introduce ppfe net poll mode driver
In reply to Gagandeep Singhppfe (programmable packet forwarding engine)
is a network poll mode driver for NXP SoC
ls1012a.
This patch introduces the framework of ppfe
driver with basic functions of initialisation
and teardown.
--- MAINTAINERS | 6 + config/common_armv8a_linux | 5 + config/common_base | 5 + doc/guides/nics/features/ppfe.ini | 8 + drivers/net/Makefile | 1 + drivers/net/meson.build | 1 + drivers/net/ppfe/Makefile | 28 ++ drivers/net/ppfe/meson.build | 11 + drivers/net/ppfe/pfe_eth.h | 73 +++++ drivers/net/ppfe/pfe_mod.h | 56 ++++ drivers/net/ppfe/ppfe_ethdev.c | 322 ++++++++++++++++++++++ drivers/net/ppfe/rte_pmd_ppfe_version.map | 4 + mk/rte.app.mk | 1 + 13 files changed, 521 insertions(+) create mode 100644 doc/guides/nics/features/ppfe.ini create mode 100644 drivers/net/ppfe/Makefile create mode 100644 drivers/net/ppfe/meson.build create mode 100644 drivers/net/ppfe/pfe_eth.h create mode 100644 drivers/net/ppfe/pfe_mod.h create mode 100644 drivers/net/ppfe/ppfe_ethdev.c create mode 100644 drivers/net/ppfe/rte_pmd_ppfe_version.map
MAINTAINERS +6 -0
@@ -787,6 +787,12 @@ F: drivers/net/enetc/ F: doc/guides/nics/enetc.rst F: doc/guides/nics/features/enetc.ini +NXP ppfe +M: Gagandeep Singh <[email protected]> +M: Akhil Goyal <[email protected]> +F: drivers/net/ppfe/ +F: doc/guides/nics/features/ppfe.ini + QLogic bnx2x M: Rasesh Mody <[email protected]> M: Shahed Shaikh <[email protected]>
config/common_armv8a_linux +5 -0
@@ -36,4 +36,9 @@ CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n CONFIG_RTE_LIBRTE_AVP_PMD=n CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=n +# +# NXP PPFE PMD Driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=y + CONFIG_RTE_SCHED_VECTOR=n
config/common_base +5 -0
@@ -218,6 +218,11 @@ CONFIG_RTE_LIBRTE_BNXT_PMD=y # CONFIG_RTE_LIBRTE_CXGBE_PMD=y +# +# Compile burst-oriented NXP PPFE PMD driver +# +CONFIG_RTE_LIBRTE_PPFE_PMD=n + # NXP DPAA Bus CONFIG_RTE_LIBRTE_DPAA_BUS=n CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n
doc/guides/nics/features/ppfe.ini new file +8 -0
@@ -0,0 +1,8 @@ +; +; Supported features of the 'ppfe' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Linux VFIO = Y +ARMv8 = Y
drivers/net/Makefile +1 -0
@@ -50,6 +50,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += null DIRS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx DIRS-$(CONFIG_RTE_LIBRTE_OCTEONTX2_PMD) += octeontx2 DIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += pcap +DIRS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += ppfe DIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += ring DIRS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc
drivers/net/meson.build +1 -0
@@ -38,6 +38,7 @@ drivers = ['af_packet', 'octeontx', 'octeontx2', 'pcap', + 'ppfe', 'ring', 'sfc', 'softnic',
drivers/net/ppfe/Makefile new file +28 -0
@@ -0,0 +1,28 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2019 NXP +# + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_ppfe.a + +CFLAGS += -O3 $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax + +EXPORT_MAP := rte_pmd_ppfe_version.map +LIBABIVER := 1 + +# Interfaces with DPDK +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += ppfe_ethdev.c + +LDLIBS += -lrte_bus_vdev +LDLIBS += -lrte_bus_dpaa +LDLIBS += -lrte_common_dpaax +LDLIBS += -lrte_eal +LDLIBS += -lrte_ethdev -lrte_kvargs + +include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/ppfe/meson.build new file +11 -0
@@ -0,0 +1,11 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2019 NXP + +if host_machine.system() != 'linux' + build = false +endif +deps += ['bus_dpaa'] + +sources = files('ppfe_ethdev.c') + +includes += include_directories('../../bus/dpaa/include/')
drivers/net/ppfe/pfe_eth.h new file +73 -0
73 lines not on this page · raw message
drivers/net/ppfe/pfe_mod.h new file +56 -0
56 lines not on this page · raw message
drivers/net/ppfe/ppfe_ethdev.c new file +322 -0
322 lines not on this page · raw message
drivers/net/ppfe/rte_pmd_ppfe_version.map new file +4 -0
@@ -0,0 +1,4 @@ +DPDK_19.11 { + + local: *; +};
mk/rte.app.mk +1 -0
@@ -161,6 +161,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond _LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe ifeq ($(CONFIG_RTE_LIBRTE_DPAA_BUS),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA_PMD) += -lrte_pmd_dpaa +_LDLIBS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += -lrte_pmd_ppfe endif ifeq ($(CONFIG_RTE_EAL_VFIO)$(CONFIG_RTE_LIBRTE_FSLMC_BUS),yy) _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v3 02/14] net/ppfe: introduce ppfe net poll mode driver
Quoted 11 lines · Gagandeep Singh
ppfe (programmable packet forwarding engine) is a network poll mode driver for NXP SoC ls1012a.
This patch introduces the framework of ppfe driver with basic functions of initialisation and teardown.
Signed-off-by Gagandeep Singh <[email protected]>Signed-off-by Akhil Goyal <[email protected]>Acked-by Nipun Gupta <[email protected]>
<...>
Quoted 4 lines
drivers/net/ppfe/Makefile new file +3
-0@@ -0,0 +1,28 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2019 NXP +#
drivers/net/ppfe/Makefile line 13
Quoted 10 lines
drivers/net/ppfe/Makefile new file +10
-0+ +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_ppfe.a + +CFLAGS += -O3 $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/
This driver is a virtual driver and using something like 'cbus', btw, out of curiosity would you mind giving some detail what cbus is?
In that case why need to include 'bus/dpaa' files? Is this PMD depends on 'dpaa' bus? Or should some 'bus/dpaa' files indeed be in the 'common/dpaax'?
Re: [dpdk-dev] [PATCH v3 02/14] net/ppfe: introduce ppfe net poll mode driver
Quoted 12 lines
<...>
Quoted 9 lines
drivers/net/ppfe/Makefile new file +8
-0@@ -0,0 +1,28 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2019 NXP +# + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name
Quoted 8 lines
drivers/net/ppfe/Makefile line 13
Quoted 5 lines
drivers/net/ppfe/Makefile new file +5
-0+# +LIB = librte_pmd_ppfe.a + +CFLAGS += -O3 $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/This driver is a virtual driver and using something like 'cbus', btw, out of curiosity would you mind giving some detail what cbus is?
cbus (crate bus) is a NXP PFE IP internal bus. To access other IPs (mac, hif, bmu etc.) registers, we use base address of cbus and then we use HIF (host interface) to create virtual interfaces, which then used by the driver.
Quoted 3 lines
In that case why need to include 'bus/dpaa' files? Is this PMD depends on 'dpaa' bus? Or should some 'bus/dpaa' files indeed be in the 'common/dpaax'?
PFE driver shouldn't be dependent on dpaa bus. There are some common functions and macros defined in dpaa/compat.h and pfe driver is dependent on it.
I will remove the dependency on dpaa bus and move the compat.h to common/dpaax.
PATCH v3 3/14 doc: add guide for ppfe net PMD
In reply to Gagandeep SinghThis patch add documentation for ppfe network
poll mode driver.
PPFE is a hardware programmable packet
forwarding engine to provide high performance
ethernet interfaces.
--- MAINTAINERS | 1 + doc/guides/nics/features/ppfe.ini | 1 + doc/guides/nics/index.rst | 1 + doc/guides/nics/ppfe.rst | 173 ++++++++++++++++++++++++++++++ 4 files changed, 176 insertions(+) create mode 100644 doc/guides/nics/ppfe.rst
MAINTAINERS +1 -0
@@ -790,6 +790,7 @@ F: doc/guides/nics/features/enetc.ini NXP ppfe M: Gagandeep Singh <[email protected]> M: Akhil Goyal <[email protected]> +F: doc/guides/nics/ppfe.rst F: drivers/net/ppfe/ F: doc/guides/nics/features/ppfe.ini
doc/guides/nics/features/ppfe.ini +1 -0
@@ -6,3 +6,4 @@ [Features] Linux VFIO = Y ARMv8 = Y +Usage doc = Y
doc/guides/nics/index.rst +1 -0
@@ -48,6 +48,7 @@ Network Interface Controller Drivers nfp octeontx octeontx2 + ppfe qede sfc_efx softnic
doc/guides/nics/ppfe.rst new file +173 -0
173 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v3 03/14] doc: add guide for ppfe net PMD
Quoted 10 lines · Gagandeep Singh
This patch add documentation for ppfe network poll mode driver.
PPFE is a hardware programmable packet forwarding engine to provide high performance ethernet interfaces.
Signed-off-by Gagandeep Singh <[email protected]>Acked-by Nipun Gupta <[email protected]>Acked-by Akhil Goyal <[email protected]>
<...>
Quoted 6 lines
doc/guides/nics/ppfe.rst new file +6
-0+Driver compilation and testing +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Follow instructions available in the document +:ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` +to launch **testpmd**
doc/guides/nics/ppfe.rst line 167
Quoted 10 lines
doc/guides/nics/ppfe.rst new file +10
-0+ +Additionally, PPFE driver needs `--vdev` as an input with value `eth_pfe` +to execute DPDK application. There is an optional parameter `intf` available +to specify port ID. PPFE driver supports only two interfaces, so valid values +for `intf` are 0 and 1. +see the command below: + + .. code-block:: console + + <dpdk app> <EAL args> --vdev="eth_pfe0,intf=0" --vdev="eth_pfe1,intf=1" -- ...
Previously "eth_" was the prefix for the virtual devices, we have renamed it to "net_" [1], for this new PMD, can you please use 'net_pfe' for consistency?
Also the driver name is 'ppfe', it is under 'net/ppfe' folder, but the device name is 'pfe'. Is there any specific reason for this?
Would it be better to stick 'pfe' or 'ppfe' everywhere?
[1]
That is why we have alias device names, to keep backward compatibility for "eth_".
Re: [dpdk-dev] [PATCH v3 03/14] doc: add guide for ppfe net PMD
Quoted 20 lines
<...>
Quoted 6 lines
doc/guides/nics/ppfe.rst new file +6
-0+Driver compilation and testing +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Follow instructions available in the document +:ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` +to launch **testpmd**doc/guides/nics/ppfe.rst
Quoted 10 lines
doc/guides/nics/ppfe.rst new file +10
-0+ +Additionally, PPFE driver needs `--vdev` as an input with value `eth_pfe` +to execute DPDK application. There is an optional parameter `intf` available +to specify port ID. PPFE driver supports only two interfaces, so valid values +for `intf` are 0 and 1. +see the command below: + + .. code-block:: console + + <dpdk app> <EAL args> --vdev="eth_pfe0,intf=0" --vdev="eth_pfe1,intf=1"-- ...
Quoted 6 lines
Previously "
eth_" was the prefix for the virtual devices, we have renamed it to "net_" [1], for this new PMD, can you please use 'net_pfe' for consistency?Also the driver name is 'ppfe', it is under 'net/ppfe' folder, but the device name is 'pfe'. Is there any specific reason for this?
Would it be better to stick 'pfe' or 'ppfe' everywhere?
Ok, I will change the interfaces names to net_pfe and will rename the ppfe to pfe everywhere.
Quoted 4 lines
[1]
That is why we have alias device names, to keep backward compatibility for "eth_".
PATCH v3 4/14 net/ppfe: support dynamic logging
In reply to Gagandeep SinghThis patch introduces logging for the ppfe PMD.
--- drivers/net/ppfe/pfe_logs.h | 31 +++++++++++++++ drivers/net/ppfe/ppfe_ethdev.c | 69 ++++++++++++++++++++++++++++------ 2 files changed, 88 insertions(+), 12 deletions(-) create mode 100644 drivers/net/ppfe/pfe_logs.h
drivers/net/ppfe/pfe_logs.h new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _PFE_LOGS_H_ +#define _PFE_LOGS_H_ + +extern int ppfe_logtype_pmd; + +/* PMD related logs */ +#define PFE_PMD_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, ppfe_logtype_pmd, "ppfe_net: %s()" \ + fmt "\n", __func__, ##args) + +#define PMD_INIT_FUNC_TRACE () PFE_PMD_LOG(DEBUG, " >>") + +#define PFE_PMD_DEBUG(fmt, args...) \ + PFE_PMD_LOG(DEBUG, fmt, ## args) +#define PFE_PMD_ERR(fmt, args...) \ + PFE_PMD_LOG(ERR, fmt, ## args) +#define PFE_PMD_INFO(fmt, args...) \ + PFE_PMD_LOG(INFO, fmt, ## args) + +#define PFE_PMD_WARN(fmt, args...) \ + PFE_PMD_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define PFE_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#endif /* _PFE_LOGS_H_ */
drivers/net/ppfe/ppfe_ethdev.c +57 -12
180 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 5/14 net/ppfe: add HW specific macros and operations
In reply to Gagandeep SinghThis patch add some hardware specific macros
and functions that will be used by the driver.
--- drivers/net/ppfe/base/cbus.h | 66 +++++ drivers/net/ppfe/base/cbus/bmu.h | 41 +++ drivers/net/ppfe/base/cbus/class_csr.h | 277 ++++++++++++++++++++ drivers/net/ppfe/base/cbus/emac_mtip.h | 231 +++++++++++++++++ drivers/net/ppfe/base/cbus/gpi.h | 77 ++++++ drivers/net/ppfe/base/cbus/hif.h | 86 +++++++ drivers/net/ppfe/base/cbus/hif_nocpy.h | 36 +++ drivers/net/ppfe/base/cbus/tmu_csr.h | 154 +++++++++++ drivers/net/ppfe/base/cbus/util_csr.h | 47 ++++ drivers/net/ppfe/base/pfe.h | 339 +++++++++++++++++++++++++ 10 files changed, 1354 insertions(+) create mode 100644 drivers/net/ppfe/base/cbus.h create mode 100644 drivers/net/ppfe/base/cbus/bmu.h create mode 100644 drivers/net/ppfe/base/cbus/class_csr.h create mode 100644 drivers/net/ppfe/base/cbus/emac_mtip.h create mode 100644 drivers/net/ppfe/base/cbus/gpi.h create mode 100644 drivers/net/ppfe/base/cbus/hif.h create mode 100644 drivers/net/ppfe/base/cbus/hif_nocpy.h create mode 100644 drivers/net/ppfe/base/cbus/tmu_csr.h create mode 100644 drivers/net/ppfe/base/cbus/util_csr.h create mode 100644 drivers/net/ppfe/base/pfe.h
drivers/net/ppfe/base/cbus.h new file +66 -0
@@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _CBUS_H_ +#define _CBUS_H_ + +#include <compat.h> + +#define EMAC1_BASE_ADDR (CBUS_BASE_ADDR + 0x200000) +#define EGPI1_BASE_ADDR (CBUS_BASE_ADDR + 0x210000) +#define EMAC2_BASE_ADDR (CBUS_BASE_ADDR + 0x220000) +#define EGPI2_BASE_ADDR (CBUS_BASE_ADDR + 0x230000) +#define BMU1_BASE_ADDR (CBUS_BASE_ADDR + 0x240000) +#define BMU2_BASE_ADDR (CBUS_BASE_ADDR + 0x250000) +#define ARB_BASE_ADDR (CBUS_BASE_ADDR + 0x260000) +#define DDR_CONFIG_BASE_ADDR (CBUS_BASE_ADDR + 0x270000) +#define HIF_BASE_ADDR (CBUS_BASE_ADDR + 0x280000) +#define HGPI_BASE_ADDR (CBUS_BASE_ADDR + 0x290000) +#define LMEM_BASE_ADDR (CBUS_BASE_ADDR + 0x300000) +#define LMEM_SIZE 0x10000 +#define LMEM_END (LMEM_BASE_ADDR + LMEM_SIZE) +#define TMU_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x310000) +#define CLASS_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x320000) +#define HIF_NOCPY_BASE_ADDR (CBUS_BASE_ADDR + 0x350000) +#define UTIL_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x360000) +#define CBUS_GPT_BASE_ADDR (CBUS_BASE_ADDR + 0x370000) + +/* +* defgroup XXX_MEM_ACCESS_ADDR PE memory access through CSR +* XXX_MEM_ACCESS_ADDR register bit definitions. +*/ +#define PE_MEM_ACCESS_WRITE BIT(31)/* Internal Memory Write. */ +#define PE_MEM_ACCESS_IMEM BIT(15) +#define PE_MEM_ACCESS_DMEM BIT(16) + +/* Byte Enables of the Internal memory access. These are interpred in BE */ +#define PE_MEM_ACCESS_BYTE_ENABLE (offset, size) \ + ({ typeof(size) size_ = (size); \ + (((BIT(size_) - 1) << (4 - (offset) - (size_))) & 0xf) << 24; }) + +#include "cbus/emac_mtip.h" +#include "cbus/gpi.h" +#include "cbus/bmu.h" +#include "cbus/hif.h" +#include "cbus/tmu_csr.h" +#include "cbus/class_csr.h" +#include "cbus/hif_nocpy.h" +#include "cbus/util_csr.h" + +/* PFE cores states */ +#define CORE_DISABLE 0x00000000 +#define CORE_ENABLE 0x00000001 +#define CORE_SW_RESET 0x00000002 + +/* LMEM defines */ +#define LMEM_HDR_SIZE 0x0010 +#define LMEM_BUF_SIZE_LN2 0x7 +#define LMEM_BUF_SIZE BIT(LMEM_BUF_SIZE_LN2) + +/* DDR defines */ +#define DDR_HDR_SIZE 0x0100 +#define DDR_BUF_SIZE_LN2 0xb +#define DDR_BUF_SIZE BIT(DDR_BUF_SIZE_LN2) + +#endif /* _CBUS_H_ */
drivers/net/ppfe/base/cbus/bmu.h new file +41 -0
41 lines not on this page · raw message
drivers/net/ppfe/base/cbus/class_csr.h new file +277 -0
277 lines not on this page · raw message
drivers/net/ppfe/base/cbus/emac_mtip.h new file +231 -0
231 lines not on this page · raw message
drivers/net/ppfe/base/cbus/gpi.h new file +77 -0
77 lines not on this page · raw message
drivers/net/ppfe/base/cbus/hif.h new file +86 -0
86 lines not on this page · raw message
drivers/net/ppfe/base/cbus/hif_nocpy.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _HIF_NOCPY_H_ +#define _HIF_NOCPY_H_ + +#define HIF_NOCPY_VERSION (HIF_NOCPY_BASE_ADDR + 0x00) +#define HIF_NOCPY_TX_CTRL (HIF_NOCPY_BASE_ADDR + 0x04) +#define HIF_NOCPY_TX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x08) +#define HIF_NOCPY_TX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x0c) +#define HIF_NOCPY_TX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x10) +#define HIF_NOCPY_TX_STATUS (HIF_NOCPY_BASE_ADDR + 0x14) +#define HIF_NOCPY_RX_CTRL (HIF_NOCPY_BASE_ADDR + 0x20) +#define HIF_NOCPY_RX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x24) +#define HIF_NOCPY_RX_STATUS (HIF_NOCPY_BASE_ADDR + 0x30) +#define HIF_NOCPY_INT_SRC (HIF_NOCPY_BASE_ADDR + 0x34) +#define HIF_NOCPY_INT_ENABLE (HIF_NOCPY_BASE_ADDR + 0x38) +#define HIF_NOCPY_POLL_CTRL (HIF_NOCPY_BASE_ADDR + 0x3c) +#define HIF_NOCPY_RX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x40) +#define HIF_NOCPY_RX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x44) +#define HIF_NOCPY_TX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x48) +#define HIF_NOCPY_RX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x4c) +#define HIF_NOCPY_RX_INQ0_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x50) +#define HIF_NOCPY_RX_INQ1_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x54) +#define HIF_NOCPY_TX_PORT_NO (HIF_NOCPY_BASE_ADDR + 0x60) +#define HIF_NOCPY_LMEM_ALLOC_ADDR (HIF_NOCPY_BASE_ADDR + 0x64) +#define HIF_NOCPY_CLASS_ADDR (HIF_NOCPY_BASE_ADDR + 0x68) +#define HIF_NOCPY_TMU_PORT0_ADDR (HIF_NOCPY_BASE_ADDR + 0x70) +#define HIF_NOCPY_TMU_PORT1_ADDR (HIF_NOCPY_BASE_ADDR + 0x74) +#define HIF_NOCPY_TMU_PORT2_ADDR (HIF_NOCPY_BASE_ADDR + 0x7c) +#define HIF_NOCPY_TMU_PORT3_ADDR (HIF_NOCPY_BASE_ADDR + 0x80) +#define HIF_NOCPY_TMU_PORT4_ADDR (HIF_NOCPY_BASE_ADDR + 0x84) +#define HIF_NOCPY_INT_COAL (HIF_NOCPY_BASE_ADDR + 0x90) + +#endif /* _HIF_NOCPY_H_ */
drivers/net/ppfe/base/cbus/tmu_csr.h new file +154 -0
154 lines not on this page · raw message
drivers/net/ppfe/base/cbus/util_csr.h new file +47 -0
47 lines not on this page · raw message
drivers/net/ppfe/base/pfe.h new file +339 -0
339 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 6/14 net/ppfe: add MAC and host interface initialisation
In reply to Gagandeep SinghHIF or host interface is responsible for transmit and receive packets between physical ethernet interfaces and HIF library defined logical interfaces.
This patch initialise that host interface and MAC.
--- drivers/net/ppfe/Makefile | 10 + drivers/net/ppfe/base/pfe.h | 83 +++++ drivers/net/ppfe/meson.build | 12 +- drivers/net/ppfe/pfe_hal.c | 635 +++++++++++++++++++++++++++++++++ drivers/net/ppfe/pfe_hif.c | 256 +++++++++++++ drivers/net/ppfe/pfe_hif.h | 106 ++++++ drivers/net/ppfe/pfe_hif_lib.c | 20 ++ drivers/net/ppfe/pfe_hif_lib.h | 162 +++++++++ drivers/net/ppfe/pfe_mod.h | 5 + drivers/net/ppfe/ppfe_ethdev.c | 153 +++++++- 10 files changed, 1439 insertions(+), 3 deletions(-) create mode 100644 drivers/net/ppfe/pfe_hal.c create mode 100644 drivers/net/ppfe/pfe_hif.c create mode 100644 drivers/net/ppfe/pfe_hif.h create mode 100644 drivers/net/ppfe/pfe_hif_lib.c create mode 100644 drivers/net/ppfe/pfe_hif_lib.h
drivers/net/ppfe/Makefile +10 -0
@@ -10,14 +10,24 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB = librte_pmd_ppfe.a CFLAGS += -O3 $(WERROR_FLAGS) +CFLAGS += -Wno-pointer-arith CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/net/ppfe/base/ CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax EXPORT_MAP := rte_pmd_ppfe_version.map LIBABIVER := 1 +# Driver uses below experimental APIs +# rte_mem_iova2virt +# rte_mem_virt2memseg +CFLAGS += -DALLOW_EXPERIMENTAL_API + # Interfaces with DPDK SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += ppfe_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hal.c +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hif_lib.c +SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hif.c LDLIBS += -lrte_bus_vdev LDLIBS += -lrte_bus_dpaa
drivers/net/ppfe/base/pfe.h +83 -0
93 lines not on this page · raw message
drivers/net/ppfe/meson.build +10 -2
@@ -6,6 +6,14 @@ if host_machine.system() != 'linux' endif deps += ['bus_dpaa'] -sources = files('ppfe_ethdev.c') +sources = files('ppfe_ethdev.c', + 'pfe_hal.c', + 'pfe_hif_lib.c', + 'pfe_hif.c') -includes += include_directories('../../bus/dpaa/include/') +# Driver uses below experimental APIs +# rte_mem_iova2virt +# rte_mem_virt2memseg +allow_experimental_apis = true + +includes += include_directories('base','../../bus/dpaa/include/')
drivers/net/ppfe/pfe_hal.c new file +635 -0
635 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.c new file +256 -0
256 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.h new file +106 -0
106 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.c new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#include "pfe_logs.h" +#include "pfe_mod.h" + +int +pfe_hif_lib_init(__rte_unused struct pfe *pfe) +{ +PMD_INIT_FUNC_TRACE (); + +return 0 ; +} + +void +pfe_hif_lib_exit(__rte_unused struct pfe *pfe) +{ +PMD_INIT_FUNC_TRACE (); +}
drivers/net/ppfe/pfe_hif_lib.h new file +162 -0
162 lines not on this page · raw message
drivers/net/ppfe/pfe_mod.h +5 -0
@@ -7,6 +7,9 @@struct pfe ; +#include "pfe.h" +#include "pfe_hif.h" +#include "pfe_hif_lib.h" #include "pfe_eth.h" #define PHYID_MAX_VAL 32
@@ -42,6 +45,8 @@ struct pfe {uint64_t ddr_size;void *cbus_baseaddr;uint64_t cbus_size; +struct ls1012a_pfe_platform_data platform_data; +struct pfe_hif hif;struct pfe_eth eth;int mdio_muxval[PHYID_MAX_VAL ];uint8_t nb_devs;
drivers/net/ppfe/ppfe_ethdev.c +152 -1
222 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 7/14 net/ppfe: add device start stop operations
In reply to Gagandeep SinghThis patch adds device start, stop and close
operations.
--- drivers/net/ppfe/Makefile | 2 +- drivers/net/ppfe/pfe_eth.h | 1 + drivers/net/ppfe/pfe_hif.c | 139 +++++++++++++ drivers/net/ppfe/pfe_hif.h | 41 ++++ drivers/net/ppfe/pfe_hif_lib.c | 362 ++++++++++++++++++++++++++++++++- drivers/net/ppfe/pfe_hif_lib.h | 11 + drivers/net/ppfe/pfe_mod.h | 1 + drivers/net/ppfe/ppfe_ethdev.c | 181 +++++++++++++++++ 8 files changed, 736 insertions(+), 2 deletions(-)
drivers/net/ppfe/Makefile +1 -1
@@ -32,7 +32,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PPFE_PMD) += pfe_hif.c LDLIBS += -lrte_bus_vdev LDLIBS += -lrte_bus_dpaa LDLIBS += -lrte_common_dpaax -LDLIBS += -lrte_eal +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool LDLIBS += -lrte_ethdev -lrte_kvargs include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/ppfe/pfe_eth.h +1 -0
@@ -53,6 +53,7 @@ struct ls1012a_pfe_platform_data {struct pfe_eth_priv_s {struct pfe *pfe; +struct hif_client_s client;int low_tmu_q;int high_tmu_q;struct rte_eth_dev *ndev;
drivers/net/ppfe/pfe_hif.c +139 -0
145 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.h +41 -0
59 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.c +361 -1
372 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.h +11 -0
@@ -5,6 +5,8 @@#ifndef _PFE_HIF_LIB_H_#define _PFE_HIF_LIB_H_ +#include "pfe_hif.h" +#define HIF_CL_REQ_TIMEOUT 10#define GFP_DMA_PFE 0
@@ -158,5 +160,14 @@ extern unsigned int emac_txq_cnt;int pfe_hif_lib_init (struct pfe *pfe);void pfe_hif_lib_exit (struct pfe *pfe); +int hif_lib_client_register (struct hif_client_s *client); +int hif_lib_client_unregister (struct hif_client_s *client); +void hif_lib_indicate_client (struct hif_client_s *client,int event,int data); +int hif_lib_event_handler_start (struct hif_client_s *client,int event,int + data); +void *hif_lib_tx_get_next_complete (struct hif_client_s *client,int qno, +unsigned int *flags,int count); +int pfe_hif_shm_init (struct hif_shm *hif_shm,struct rte_mempool *mb_pool); +void pfe_hif_shm_clean (struct hif_shm *hif_shm);#endif /* _PFE_HIF_LIB_H_ */
drivers/net/ppfe/pfe_mod.h +1 -0
@@ -48,6 +48,7 @@ struct pfe {struct ls1012a_pfe_platform_data platform_data;struct pfe_hif hif;struct pfe_eth eth; +struct hif_client_s *hif_client[HIF_CLIENTS_MAX ];int mdio_muxval[PHYID_MAX_VAL ];uint8_t nb_devs;uint8_t max_intf;
drivers/net/ppfe/ppfe_ethdev.c +181 -0
210 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v3 07/14] net/ppfe: add device start stop operations
Quoted 6 lines · Gagandeep Singh
This patch adds device start, stop and close
operations.Signed-off-by Gagandeep Singh <[email protected]>Signed-off-by Akhil Goyal <[email protected]>Acked-by Nipun Gupta <[email protected]>
<...>
drivers/net/ppfe/ppfe_ethdev.c pfe_eth_exit(struct rte_eth_dev *dev, struct pfe *pfe) · line 287
Quoted 12 lines
drivers/net/ppfe/ppfe_ethdev.c +12
-0+static int +pfe_eth_info (struct rte_eth_dev *dev, +struct rte_eth_dev_info *dev_info) +{ +struct pfe_eth_priv_s *internals = dev->data->dev_private; + + dev_info->if_index = internals->id; + dev_info->max_mac_addrs =PPFE_MAX_MACS ; + dev_info->max_rx_pktlen =JUMBO_FRAME_SIZE ; + dev_info->max_rx_queues = dev->data->nb_rx_queues; + dev_info->max_tx_queues = dev->data->nb_tx_queues; + dev_info->min_rx_bufsize =HIF_RX_PKT_MIN_SIZE ;
Since set MTU supported in this patchet, it can be good to set 'min_mtu' & 'max_mtu' too.
Re: [dpdk-dev] [PATCH v3 07/14] net/ppfe: add device start stop operations
Quoted 19 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Friday, October 4, 2019 9:13 PM
To: Gagandeep Singh <[email protected]>; [email protected]
Cc: [email protected]; Akhil Goyal <[email protected]>
Subject: Re: [PATCH v3 07/14] net/ppfe: add device start stop operationsQuoted 6 lines · Gagandeep Singh
This patch adds device start, stop and close
operations.Signed-off-by Gagandeep Singh <[email protected]>Signed-off-by Akhil Goyal <[email protected]>Acked-by Nipun Gupta <[email protected]><...>
Quoted 15 lines
drivers/net/ppfe/ppfe_ethdev.c pfe_eth_exit(struct rte_eth_dev *dev, struct pfe *pfe) · line 287
Quoted 12 lines
drivers/net/ppfe/ppfe_ethdev.c +12
-0+static int +pfe_eth_info (struct rte_eth_dev *dev, +struct rte_eth_dev_info *dev_info) +{ +struct pfe_eth_priv_s *internals = dev->data->dev_private; + + dev_info->if_index = internals->id; + dev_info->max_mac_addrs =PPFE_MAX_MACS ; + dev_info->max_rx_pktlen =JUMBO_FRAME_SIZE ; + dev_info->max_rx_queues = dev->data->nb_rx_queues; + dev_info->max_tx_queues = dev->data->nb_tx_queues; + dev_info->min_rx_bufsize =HIF_RX_PKT_MIN_SIZE ;Since set MTU supported in this patchet, it can be good to set '
min_mtu' & 'max_mtu' too.
Ok.
PATCH v3 8/14 net/ppfe: add queue setup and release operations
In reply to Gagandeep SinghThis patch add RX/TX queue setup operations and supported checksum offloads.
--- doc/guides/nics/features/ppfe.ini | 2 + doc/guides/nics/ppfe.rst | 1 + drivers/net/ppfe/pfe_hif.c | 115 ++++++++++++++++++++++++++++++ drivers/net/ppfe/pfe_hif.h | 1 + drivers/net/ppfe/pfe_hif_lib.c | 50 +++++++++++++ drivers/net/ppfe/ppfe_ethdev.c | 93 ++++++++++++++++++++++++ 6 files changed, 262 insertions(+)
doc/guides/nics/features/ppfe.ini +2 -0
@@ -4,6 +4,8 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +L3 checksum offload = Y +L4 checksum offload = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +1 -0
@@ -93,6 +93,7 @@ the kernel layer for link status. PPFE Features ~~~~~~~~~~~~~~ +- L3/L4 checksum offload - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/pfe_hif.c +115 -0
121 lines not on this page · raw message
drivers/net/ppfe/pfe_hif.h +1 -0
@@ -143,5 +143,6 @@ void hif_process_client_req(struct pfe_hif *hif, int req, int data1, intint pfe_hif_init (struct pfe *pfe);void pfe_hif_exit (struct pfe *pfe);void pfe_hif_rx_idle (struct pfe_hif *hif); +int pfe_hif_init_buffers (struct pfe_hif *hif);#endif /* _PFE_HIF_H_ */
drivers/net/ppfe/pfe_hif_lib.c +50 -0
56 lines not on this page · raw message
drivers/net/ppfe/ppfe_ethdev.c +93 -0
115 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 9/14 net/ppfe: add burst enqueue and dequeue operations
In reply to Gagandeep SinghThis patch add burst enqueue and dequeue operations to the ppfe PMD.
--- drivers/net/ppfe/pfe_hif.c | 360 ++++++++++++++++++++++++++++++++- drivers/net/ppfe/pfe_hif.h | 8 + drivers/net/ppfe/pfe_hif_lib.c | 146 +++++++++++++ drivers/net/ppfe/pfe_hif_lib.h | 8 + drivers/net/ppfe/pfe_mod.h | 2 + drivers/net/ppfe/ppfe_ethdev.c | 140 +++++++++++++ 6 files changed, 663 insertions(+), 1 deletion(-)
drivers/net/ppfe/pfe_hif.c +359 -1
@@ -43,6 +43,38 @@ pfe_hif_free_descr(struct pfe_hif *hif)rte_free (hif->descr_baseaddr_v); } +/* pfe_hif_release_buffers */ +static void +pfe_hif_release_buffers (struct pfe_hif *hif) +{ +struct hif_desc *desc; +uint32_t i =0 ; +struct rte_mbuf *mbuf; +struct rte_pktmbuf_pool_private *mb_priv; + + hif->rx_base = hif->descr_baseaddr_v; + +/*Free Rx buffers */ + desc = hif->rx_base; + mb_priv =rte_mempool_get_priv (hif->shm->pool); +for (i =0 ; i < hif->rx_ring_size; i++) { +if (readl (&desc->data)) { +if (i < hif->shm->rx_buf_pool_cnt && + !hif->shm->rx_buf_pool[i]) { + mbuf = hif->rx_buf_vaddr[i] +PFE_PKT_HEADER_SZ + -sizeof (struct rte_mbuf ) + -RTE_PKTMBUF_HEADROOM + - mb_priv->mbuf_priv_size; + hif->shm->rx_buf_pool[i] = mbuf; + } + } +writel (0 , &desc->data); +writel (0 , &desc->status); +writel (0 , &desc->ctrl); + desc++; + } +} +/* * pfe_hif_init_buffers * This function initializes the HIF Rx/Tx ring descriptors and
@@ -259,9 +291,332 @@ pfe_hif_client_unregister(struct pfe_hif *hif, u32 client_id)rte_spinlock_unlock (&hif->tx_lock); } +/* +* client_put_rxpacket- +*/ +static struct rte_mbuf * +client_put_rxpacket (struct hif_rx_queue *queue, +void *pkt,u32 len, +u32 flags,u32 client_ctrl, +struct rte_mempool *pool, +u32 *rem_len) +{ +struct rx_queue_desc *desc = queue->base + queue->write_idx; +struct rte_mbuf *mbuf =NULL ; + + +if (readl (&desc->ctrl) &CL_DESC_OWN ) { + mbuf =rte_cpu_to_le_64 (rte_pktmbuf_alloc (pool)); +if (unlikely (!mbuf)) { +PFE_PMD_WARN ("Buffer allocation failure\n" ); +return NULL ; + } + + desc->data = pkt; + desc->client_ctrl = client_ctrl; +/* +* Ensure everything else is written to DDR before +* writing bd->ctrl +*/ +rte_wmb (); +writel (CL_DESC_BUF_LEN (len) | flags, &desc->ctrl); + queue->write_idx = (queue->write_idx +1 ) + & (queue->size -1 ); + + *rem_len = mbuf->buf_len; + } + +return mbuf; +} + +/* +* pfe_hif_rx_process- +* This function does pfe hif rx queue processing. +* Dequeue packet from Rx queue and send it to corresponding client queue +*/ +int +pfe_hif_rx_process (struct pfe *pfe,int budget) +{ +struct hif_desc *desc; +struct hif_hdr *pkt_hdr; +struct __hif_hdr hif_hdr; +void *free_buf; +int rtc, len, rx_processed =0 ; +struct __hif_desc local_desc; +int flags =0 , wait_for_last =0 , retry =0 ; +unsigned int buf_size =0 ; +struct rte_mbuf *mbuf =NULL ; +struct pfe_hif *hif = &pfe->hif; + +rte_spinlock_lock (&hif->lock); + + rtc = hif->rxtoclean_index; + +while (rx_processed < budget) { + desc = hif->rx_base + rtc; + +__memcpy12 (&local_desc, desc); + +/* ACK pending Rx interrupt */ +if (local_desc.ctrl &BD_CTRL_DESC_EN ) { +if (unlikely (wait_for_last)) +continue ; +else +break ; + } + + len =BD_BUF_LEN (local_desc.ctrl); + pkt_hdr = (struct hif_hdr *)hif->rx_buf_vaddr[rtc]; + +/* Track last HIF header received */ +if (!hif->started) { + hif->started =1 ; + +__memcpy8 (&hif_hdr, pkt_hdr); + + hif->qno = hif_hdr.hdr.q_num; + hif->client_id = hif_hdr.hdr.client_id; + hif->client_ctrl = (hif_hdr.hdr.client_ctrl1 <<16 ) | + hif_hdr.hdr.client_ctrl; + flags =CL_DESC_FIRST ; + + }else { + flags =0 ; + } + +if (local_desc.ctrl &BD_CTRL_LIFM ) { + flags |=CL_DESC_LAST ; + wait_for_last =0 ; + }else { + wait_for_last =1 ; + } + +/* Check for valid client id and still registered */ +if (hif->client_id >=HIF_CLIENTS_MAX || + !(test_bit (hif->client_id, + &hif->shm->g_client_status[0 ]))) { +PFE_PMD_INFO ("packet with invalid client id %d qnum %d" , + hif->client_id, hif->qno); + + free_buf = hif->rx_buf_addr[rtc]; + + goto pkt_drop; + } + +/* Check to valid queue number */ +if (hif->client[hif->client_id].rx_qn <= hif->qno) { +PFE_DP_LOG (DEBUG ,"packet with invalid queue: %d" , + hif->qno); + hif->qno =0 ; + } + +retry: + mbuf = +client_put_rxpacket (&hif->client[hif->client_id].rx_q[hif->qno], + (void *)pkt_hdr, len, flags, + hif->client_ctrl, hif->shm->pool, + &buf_size); + +if (unlikely (!mbuf)) { +if (!retry) { +pfe_tx_do_cleanup (pfe); + retry =1 ; + goto retry; + } + rx_processed = budget; + +if (flags &CL_DESC_FIRST ) + hif->started =0 ; + +PFE_DP_LOG (DEBUG ,"No buffers" ); +break ; + } + + retry =0 ; + + free_buf = (void *)(size_t )rte_pktmbuf_iova (mbuf); + free_buf = free_buf -PFE_PKT_HEADER_SZ ; + +/*Fill free buffer in the descriptor */ + hif->rx_buf_addr[rtc] = free_buf; + hif->rx_buf_vaddr[rtc] = (void *)((size_t )mbuf->buf_addr + + mbuf->data_off -PFE_PKT_HEADER_SZ ); + hif->rx_buf_len[rtc] = buf_size -RTE_PKTMBUF_HEADROOM ; + +pkt_drop: +writel (DDR_PHYS_TO_PFE (free_buf), &desc->data); +/* +* Ensure everything else is written to DDR before +* writing bd->ctrl +*/ +rte_wmb (); +writel ((BD_CTRL_PKT_INT_EN |BD_CTRL_LIFM |BD_CTRL_DIR | +BD_CTRL_DESC_EN |BD_BUF_LEN (hif->rx_buf_len[rtc])), + &desc->ctrl); + + rtc = (rtc +1 ) & (hif->rx_ring_size -1 ); + +if (local_desc.ctrl &BD_CTRL_LIFM ) { +if (!(hif->client_ctrl &HIF_CTRL_RX_CONTINUED )) + rx_processed++; + + hif->started =0 ; + } + } + + + hif->rxtoclean_index = rtc; +rte_spinlock_unlock (&hif->lock); + +/* we made some progress, re-start rx dma in case it stopped */ +hif_rx_dma_start (); + +return rx_processed; +} + +/* +* client_ack_txpacket- +* This function ack the Tx packet in the give client Tx queue by resetting +* ownership bit in the descriptor. +*/ +static int +client_ack_txpacket (struct pfe_hif *hif,unsigned int client_id, +unsigned int q_no) +{ +struct hif_tx_queue *queue = &hif->client[client_id].tx_q[q_no]; +struct tx_queue_desc *desc = queue->base + queue->ack_idx; + +if (readl (&desc->ctrl) &CL_DESC_OWN ) { +writel ((readl (&desc->ctrl) & ~CL_DESC_OWN ), &desc->ctrl); + queue->ack_idx = (queue->ack_idx +1 ) & (queue->size -1 ); + +return 0 ; + + }else { +/*This should not happen */ +PFE_PMD_ERR ("%d %d %d %d %d %p %d" , + hif->txtosend, hif->txtoclean, hif->txavail, + client_id, q_no, queue, queue->ack_idx); +return 1 ; + } +} + +static void +__hif_tx_done_process (struct pfe *pfe,int count) +{ +struct hif_desc *desc; +struct hif_desc_sw *desc_sw; +unsigned int ttc, tx_avl; +int pkts_done[HIF_CLIENTS_MAX ] = {0 ,0 }; +struct pfe_hif *hif = &pfe->hif; + + ttc = hif->txtoclean; + tx_avl = hif->txavail; + +while ((tx_avl < hif->tx_ring_size) && count--) { + desc = hif->tx_base + ttc; + +if (readl (&desc->ctrl) &BD_CTRL_DESC_EN ) +break ; + + desc_sw = &hif->tx_sw_queue[ttc]; + +if (desc_sw->client_id >HIF_CLIENTS_MAX ) +PFE_PMD_ERR ("Invalid cl id %d" , desc_sw->client_id); + + pkts_done[desc_sw->client_id]++; + +client_ack_txpacket (hif, desc_sw->client_id, desc_sw->q_no); + + ttc = (ttc +1 ) & (hif->tx_ring_size -1 ); + tx_avl++; + } + +if (pkts_done[0 ]) +hif_lib_indicate_client (pfe->hif_client[0 ],EVENT_TXDONE_IND , +0 ); +if (pkts_done[1 ]) +hif_lib_indicate_client (pfe->hif_client[1 ],EVENT_TXDONE_IND , +0 ); + hif->txtoclean = ttc; + hif->txavail = tx_avl; +} + +static inline void +hif_tx_done_process (struct pfe *pfe,int count) +{ +struct pfe_hif *hif = &pfe->hif; +rte_spinlock_lock (&hif->tx_lock); +__hif_tx_done_process (pfe, count); +rte_spinlock_unlock (&hif->tx_lock); +} + +void +pfe_tx_do_cleanup (struct pfe *pfe) +{ +hif_tx_done_process (pfe,HIF_TX_DESC_NT ); +} + +/* +* __hif_xmit_pkt - +* This function puts one packet in the HIF Tx queue +*/ +void +hif_xmit_pkt (struct pfe_hif *hif,unsigned int client_id,unsigned int + q_no,void *data,u32 len,unsigned int flags) +{ +struct hif_desc *desc; +struct hif_desc_sw *desc_sw; + + desc = hif->tx_base + hif->txtosend; + desc_sw = &hif->tx_sw_queue[hif->txtosend]; + + desc_sw->len = len; + desc_sw->client_id = client_id; + desc_sw->q_no = q_no; + desc_sw->flags = flags; + +writel ((u32 )DDR_PHYS_TO_PFE (data), &desc->data); + + hif->txtosend = (hif->txtosend +1 ) & (hif->tx_ring_size -1 ); + hif->txavail--; + +if ((!((flags &HIF_DATA_VALID ) && (flags & +HIF_LAST_BUFFER )))) + goto skip_tx; + +/* +* Ensure everything else is written to DDR before +* writing bd->ctrl +*/ +rte_wmb (); + +do { + desc_sw = &hif->tx_sw_queue[hif->txtoflush]; + desc = hif->tx_base + hif->txtoflush; + +if (desc_sw->flags &HIF_LAST_BUFFER ) { +writel ((BD_CTRL_LIFM | +BD_CTRL_BRFETCH_DISABLE |BD_CTRL_RTFETCH_DISABLE + |BD_CTRL_PARSE_DISABLE |BD_CTRL_DESC_EN | +BD_BUF_LEN (desc_sw->len)), + &desc->ctrl); + }else { +writel ((BD_CTRL_DESC_EN | +BD_BUF_LEN (desc_sw->len)), &desc->ctrl); + } + hif->txtoflush = (hif->txtoflush +1 ) & (hif->tx_ring_size -1 ); + } +while (hif->txtoflush != hif->txtosend) + ; + +skip_tx: +return ; +} +void hif_process_client_req (struct pfe_hif *hif,int req, - int data1, __rte_unused int data2) + int data1, __rte_unused int data2) {unsigned int client_id = data1;
@@ -503,6 +858,9 @@ pfe_hif_exit(struct pfe *pfe)hif_rx_disable ();hif_tx_disable (); +pfe_hif_release_buffers (hif); +pfe_hif_shm_clean (hif->shm); +pfe_hif_free_descr (hif); pfe->hif.setuped =0 ; }
drivers/net/ppfe/pfe_hif.h +8 -0
@@ -138,11 +138,19 @@ struct pfe_hif {struct rte_device *dev; }; +void hif_xmit_pkt (struct pfe_hif *hif,unsigned int client_id,unsigned int + q_no,void *data,u32 len,unsigned int flags);void hif_process_client_req (struct pfe_hif *hif,int req,int data1,int data2);int pfe_hif_init (struct pfe *pfe);void pfe_hif_exit (struct pfe *pfe);void pfe_hif_rx_idle (struct pfe_hif *hif); +int pfe_hif_rx_process (struct pfe *pfe,int budget);int pfe_hif_init_buffers (struct pfe_hif *hif); +void pfe_tx_do_cleanup (struct pfe *pfe); + +#define __memcpy8 (dst, src) memcpy(dst, src, 8) +#define __memcpy12 (dst, src) memcpy(dst, src, 12) +#define __memcpy (dst, src, len) memcpy(dst, src, len)#endif /* _PFE_HIF_H_ */
drivers/net/ppfe/pfe_hif_lib.c +146 -0
152 lines not on this page · raw message
drivers/net/ppfe/pfe_hif_lib.h +8 -0
@@ -162,6 +162,9 @@ int pfe_hif_lib_init(struct pfe *pfe);void pfe_hif_lib_exit (struct pfe *pfe);int hif_lib_client_register (struct hif_client_s *client);int hif_lib_client_unregister (struct hif_client_s *client); +void hif_lib_xmit_pkt (struct hif_client_s *client,unsigned int qno, +void *data,void *data1,unsigned int len, +u32 client_ctrl,unsigned int flags,void *client_data);void hif_lib_indicate_client (struct hif_client_s *client,int event,int data);int hif_lib_event_handler_start (struct hif_client_s *client,int event,int data);
@@ -170,4 +173,9 @@ void *hif_lib_tx_get_next_complete(struct hif_client_s *client, int qno,int pfe_hif_shm_init (struct hif_shm *hif_shm,struct rte_mempool *mb_pool);void pfe_hif_shm_clean (struct hif_shm *hif_shm); +int hif_lib_receive_pkt (struct hif_client_rx_queue *queue, +struct rte_mempool *pool, +struct rte_mbuf **rx_pkts, +uint16_t nb_pkts); +#endif /* _PFE_HIF_LIB_H_ */
drivers/net/ppfe/pfe_mod.h +2 -0
@@ -7,6 +7,8 @@struct pfe ; +#include <rte_ethdev.h> +#include "pfe.h" #include "pfe_hif.h" #include "pfe_hif_lib.h"
drivers/net/ppfe/ppfe_ethdev.c +140 -0
170 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 10/14 net/ppfe: add supported packet types and basic statistics
In reply to Gagandeep SinghThis patch add support for supported packet types by the platform andbasic statistics like numbers of packets/bytes receive and transmit.
--- doc/guides/nics/features/ppfe.ini | 2 ++ doc/guides/nics/ppfe.rst | 2 ++ drivers/net/ppfe/ppfe_ethdev.c | 43 +++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+)
doc/guides/nics/features/ppfe.ini +2 -0
@@ -6,6 +6,8 @@ [Features] L3 checksum offload = Y L4 checksum offload = Y +Packet type parsing = Y +Basic stats = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +2 -0
@@ -94,6 +94,8 @@ PPFE Features ~~~~~~~~~~~~~~ - L3/L4 checksum offload +- Packet type parsing +- Basic stats - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +43 -0
55 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 11/14 net/ppfe: add MTU and MAC address set operations
In reply to Gagandeep SinghTo update MAC address or MTU, operations are added to the driver.
--- doc/guides/nics/features/ppfe.ini | 1 + doc/guides/nics/ppfe.rst | 1 + drivers/net/ppfe/ppfe_ethdev.c | 63 +++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+)
doc/guides/nics/features/ppfe.ini +1 -0
@@ -8,6 +8,7 @@ L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y Basic stats = Y +MTU update = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +1 -0
@@ -96,6 +96,7 @@ PPFE Features - L3/L4 checksum offload - Packet type parsing - Basic stats +- MTU update - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +63 -0
93 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 12/14 net/ppfe: add allmulticast and promiscuous
In reply to Gagandeep SinghThis patch adds support to enable multicast and
promiscuous mode.
--- doc/guides/nics/features/ppfe.ini | 2 ++ doc/guides/nics/ppfe.rst | 2 ++ drivers/net/ppfe/ppfe_ethdev.c | 42 +++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+)
doc/guides/nics/features/ppfe.ini +2 -0
@@ -9,6 +9,8 @@ L4 checksum offload = Y Packet type parsing = Y Basic stats = Y MTU update = Y +Promiscuous mode = Y +Allmulticast mode = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/ppfe.rst +2 -0
@@ -97,6 +97,8 @@ PPFE Features - Packet type parsing - Basic stats - MTU update +- Promiscuous mode +- Allmulticast mode - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +42 -0
54 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 13/14 net/ppfe: add link status update
In reply to Gagandeep SinghThis patch add link related operations like link update, up and down.
--- doc/guides/nics/features/ppfe.ini | 1 + doc/guides/nics/ppfe.rst | 1 + drivers/net/ppfe/ppfe_ethdev.c | 106 ++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+)
doc/guides/nics/features/ppfe.ini +1 -0
@@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +Link status = Y L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y
doc/guides/nics/ppfe.rst +1 -0
@@ -99,6 +99,7 @@ PPFE Features - MTU update - Promiscuous mode - Allmulticast mode +- Link status - ARMv8 Supported PPFE SoCs
drivers/net/ppfe/ppfe_ethdev.c +106 -0
133 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v3 13/14] net/ppfe: add link status update
Quoted 6 lines · Gagandeep Singh
This patch add link related operations like link update, up and down.
Signed-off-by Gagandeep Singh <[email protected]>Acked-by Nipun Gupta <[email protected]>Acked-by Akhil Goyal <[email protected]>
<...>
drivers/net/ppfe/ppfe_ethdev.c pfe_supported_ptypes_get(struct rte_eth_dev *dev) · line 575
Quoted 4 lines
drivers/net/ppfe/ppfe_ethdev.c +4
-0+ +static int +pfe_eth_link_update (struct rte_eth_dev *dev, + int wait_to_complete __rte_unused)
nitpicking but, this can be single line ...
Re: [dpdk-dev] [PATCH v3 13/14] net/ppfe: add link status update
Quoted 17 lines
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Friday, October 4, 2019 9:13 PM
To: Gagandeep Singh <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [PATCH v3 13/14] net/ppfe: add link status updateQuoted 6 lines · Gagandeep Singh
This patch add link related operations like link update, up and down.
Signed-off-by Gagandeep Singh <[email protected]>Acked-by Nipun Gupta <[email protected]>Acked-by Akhil Goyal <[email protected]>
Quoted 8 lines
<...>
drivers/net/ppfe/ppfe_ethdev.c pfe_supported_ptypes_get(struct rte_eth_dev *dev) · line 575
Quoted 4 lines
drivers/net/ppfe/ppfe_ethdev.c +4
-0+ +static int +pfe_eth_link_update (struct rte_eth_dev *dev, + int wait_to_complete __rte_unused)nitpicking but, this can be single line ...
Sure.
PATCH v3 14/14 doc: add NXP PPFE PMD in release notes
In reply to Gagandeep SinghUpdate release notes for NXP PPFE driver supported for 19.11.
--- doc/guides/rel_notes/release_19_11.rst | 5 +++++ 1 file changed, 5 insertions(+)
doc/guides/rel_notes/release_19_11.rst +5 -0
@@ -88,6 +88,11 @@ New Features Added support for the ``RTE_ETH_DEV_CLOSE_REMOVE`` flag. +* **Added NXP PPFE PMD.** + + Added the new PPFE driver for the NXP LS1012A platform. See the + :doc:`../nics/ppfe` NIC driver guide for more details on this new driver. + Removed Items -------------
Signature · 1 line
2.17.1
v4 cover introduces pfe network PMD
In reply to Gagandeep SinghThis series introduces pfe (packet forwarding engine) network poll mode driver for NXP SoC ls1012a.
First patch of this series move OF library code from dpaa bus to a common folder as PFE also uses the same library for getting information from the device tree.
This patch is included in this series so that compilation by CI don't break.
V2 Change-log:
* fix compilation break for clang3.4 and gcc 4.8
* fix checkpatch errors
V3 Change-log:
* Release notes updated for PPFE PMD
* Experimental APIs list added in Makefile and meson
* Dynamic logging added
* PPFE documentation is updated for kernel module "pfe.ko" and parameter "intf" is mentioned.
* of.h and of.c are renamed to dpaa_of.h and dpaa_of.c
* enable PPFE compilation only in 'common_armv8a_linux'
* PFE_CDEV_ETH_COUNT updated 2, as only 2 eth devices supported.
* Comment updated for "pfe_us_cdev" device
* functions prototype updated
* intf params value check added during parsing and unwanted port id checks removed.
* unwanted dev->data memcpy removed.
* munmap and rte_eth_dev_release_port added in error case
* atoi replaced with strtol
* add static to global variable g_pfe
V4 Change-log:
* DPAA dependency removed by moving compat.h from bus/dpaa/include to common/dpaax
* Updated interface name to net_pfe in document
* Updated driver name to PFE from PPFE everywhere for consistency
* min_mtu and max_mtu added
Gagandeep Singh (13):
net/pfe: introduce pfe net poll mode driver
doc: add guide for pfe net PMD
net/pfe: support dynamic logging
net/pfe: add HW specific macros and operations net/pfe: add MAC and host interface initialisation net/pfe: add device start stop operations net/pfe: add queue setup and release operations net/pfe: add burst enqueue and dequeue operations net/pfe: add supported packet types and basic statistics net/pfe: add MTU and MAC address set operations net/pfe: add allmulticast and promiscuous net/pfe: add link status update
doc: add NXP PFE PMD in release notes
Hemant Agrawal (1):
common/dpaax: moving OF lib code from dpaa bus
MAINTAINERS | 7 +
config/common_armv8a_linux | 5 +
config/common_base | 5 +
doc/guides/nics/features/pfe.ini | 17 +
doc/guides/nics/index.rst | 1 +
doc/guides/nics/pfe.rst | 180 +++
doc/guides/rel_notes/release_19_11.rst | 5 +
drivers/bus/dpaa/Makefile | 2 +-
drivers/bus/dpaa/base/fman/fman.c | 2 +-
drivers/bus/dpaa/base/fman/netcfg_layer.c | 2 +-
drivers/bus/dpaa/base/qbman/dpaa_sys.h | 3 +-
drivers/bus/dpaa/base/qbman/qman.c | 2 +
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/fman.h | 1 +
drivers/bus/dpaa/include/fsl_usd.h | 1 +
drivers/bus/dpaa/meson.build | 1 -
drivers/bus/dpaa/rte_dpaa_bus.h | 2 +-
drivers/bus/fslmc/Makefile | 1 +
drivers/common/dpaax/Makefile | 10 +-
.../dpaa/include => common/dpaax}/compat.h | 3 -
.../dpaa/include => common/dpaax}/dpaa_list.h | 0
.../base/fman/of.c => common/dpaax/dpaa_of.c} | 63 +-
.../include/of.h => common/dpaax/dpaa_of.h} | 27 +-
drivers/common/dpaax/dpaax_logs.h | 10 +
drivers/common/dpaax/meson.build | 5 +-
.../common/dpaax/rte_common_dpaax_version.map | 18 +
drivers/crypto/caam_jr/Makefile | 2 +
drivers/crypto/caam_jr/caam_jr.c | 2 +-
drivers/crypto/dpaa2_sec/Makefile | 2 +-
drivers/crypto/dpaa_sec/Makefile | 1 +
drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
drivers/event/dpaa/Makefile | 1 +
drivers/event/dpaa2/Makefile | 1 +
drivers/mempool/dpaa/Makefile | 1 +
drivers/mempool/dpaa2/Makefile | 1 +
drivers/net/Makefile | 1 +
drivers/net/dpaa/Makefile | 1 +
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa2/Makefile | 1 +
drivers/net/meson.build | 1 +
drivers/net/pfe/Makefile | 37 +
drivers/net/pfe/base/cbus.h | 66 +
drivers/net/pfe/base/cbus/bmu.h | 41 +
drivers/net/pfe/base/cbus/class_csr.h | 277 ++++
drivers/net/pfe/base/cbus/emac_mtip.h | 231 ++++
drivers/net/pfe/base/cbus/gpi.h | 77 ++
drivers/net/pfe/base/cbus/hif.h | 86 ++
drivers/net/pfe/base/cbus/hif_nocpy.h | 36 +
drivers/net/pfe/base/cbus/tmu_csr.h | 154 +++
drivers/net/pfe/base/cbus/util_csr.h | 47 +
drivers/net/pfe/base/pfe.h | 422 ++++++
drivers/net/pfe/meson.build | 19 +
drivers/net/pfe/pfe_eth.h | 76 ++
drivers/net/pfe/pfe_ethdev.c | 1192 +++++++++++++++++
drivers/net/pfe/pfe_hal.c | 629 +++++++++
drivers/net/pfe/pfe_hif.c | 868 ++++++++++++
drivers/net/pfe/pfe_hif.h | 156 +++
drivers/net/pfe/pfe_hif_lib.c | 576 ++++++++
drivers/net/pfe/pfe_hif_lib.h | 181 +++
drivers/net/pfe/pfe_logs.h | 31 +
drivers/net/pfe/pfe_mod.h | 64 +
drivers/net/pfe/rte_pmd_pfe_version.map | 4 +
drivers/raw/dpaa2_cmdif/Makefile | 1 +
drivers/raw/dpaa2_qdma/Makefile | 1 +
mk/rte.app.mk | 1 +
66 files changed, 5613 insertions(+), 56 deletions(-)
create mode 100644 doc/guides/nics/features/pfe.ini
create mode 100644 doc/guides/nics/pfe.rst
rename drivers/{bus/dpaa/include => common/dpaax}/compat.h (99%)
rename drivers/{bus/dpaa/include => common/dpaax}/dpaa_list.h (100%)
rename drivers/{bus/dpaa/base/fman/of.c => common/dpaax/dpaa_of.c} (88%)
rename drivers/{bus/dpaa/include/of.h => common/dpaax/dpaa_of.h} (86%)
create mode 100644 drivers/net/pfe/Makefile
create mode 100644 drivers/net/pfe/base/cbus.h
create mode 100644 drivers/net/pfe/base/cbus/bmu.h
create mode 100644 drivers/net/pfe/base/cbus/class_csr.h
create mode 100644 drivers/net/pfe/base/cbus/emac_mtip.h
create mode 100644 drivers/net/pfe/base/cbus/gpi.h
create mode 100644 drivers/net/pfe/base/cbus/hif.h
create mode 100644 drivers/net/pfe/base/cbus/hif_nocpy.h
create mode 100644 drivers/net/pfe/base/cbus/tmu_csr.h
create mode 100644 drivers/net/pfe/base/cbus/util_csr.h
create mode 100644 drivers/net/pfe/base/pfe.h
create mode 100644 drivers/net/pfe/meson.build
create mode 100644 drivers/net/pfe/pfe_eth.h
create mode 100644 drivers/net/pfe/pfe_ethdev.c
create mode 100644 drivers/net/pfe/pfe_hal.c
create mode 100644 drivers/net/pfe/pfe_hif.c
create mode 100644 drivers/net/pfe/pfe_hif.h
create mode 100644 drivers/net/pfe/pfe_hif_lib.c
create mode 100644 drivers/net/pfe/pfe_hif_lib.h
create mode 100644 drivers/net/pfe/pfe_logs.h
create mode 100644 drivers/net/pfe/pfe_mod.h
create mode 100644 drivers/net/pfe/rte_pmd_pfe_version.mapSignature · 1 line
2.17.1
PATCH v4 1/14 common/dpaax: moving OF lib code from dpaa bus
From: Hemant Agrawal <[email protected]>
This code is being shared by more than 1 type of driver. Common is most appropriate place for it.
---
drivers/bus/dpaa/Makefile | 2 +-
drivers/bus/dpaa/base/fman/fman.c | 2 +-
drivers/bus/dpaa/base/fman/netcfg_layer.c | 2 +-
drivers/bus/dpaa/base/qbman/dpaa_sys.h | 3 +-
drivers/bus/dpaa/base/qbman/qman.c | 2 +
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/fman.h | 1 +
drivers/bus/dpaa/include/fsl_usd.h | 1 +
drivers/bus/dpaa/meson.build | 1 -
drivers/bus/dpaa/rte_dpaa_bus.h | 2 +-
drivers/bus/fslmc/Makefile | 1 +
drivers/common/dpaax/Makefile | 10 +--
.../dpaa/include => common/dpaax}/compat.h | 3 -
.../dpaa/include => common/dpaax}/dpaa_list.h | 0
.../base/fman/of.c => common/dpaax/dpaa_of.c} | 63 ++++++++++---------
.../include/of.h => common/dpaax/dpaa_of.h} | 27 ++++++--
drivers/common/dpaax/dpaax_logs.h | 10 +++
drivers/common/dpaax/meson.build | 5 +-
.../common/dpaax/rte_common_dpaax_version.map | 18 ++++++
drivers/crypto/caam_jr/Makefile | 2 +
drivers/crypto/caam_jr/caam_jr.c | 2 +-
drivers/crypto/dpaa2_sec/Makefile | 2 +-
drivers/crypto/dpaa_sec/Makefile | 1 +
drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
drivers/event/dpaa/Makefile | 1 +
drivers/event/dpaa2/Makefile | 1 +
drivers/mempool/dpaa/Makefile | 1 +
drivers/mempool/dpaa2/Makefile | 1 +
drivers/net/dpaa/Makefile | 1 +
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa2/Makefile | 1 +
drivers/raw/dpaa2_cmdif/Makefile | 1 +
drivers/raw/dpaa2_qdma/Makefile | 1 +
34 files changed, 120 insertions(+), 56 deletions(-)
rename drivers/{bus/dpaa/include => common/dpaax}/compat.h (99%)
rename drivers/{bus/dpaa/include => common/dpaax}/dpaa_list.h (100%)
rename drivers/{bus/dpaa/base/fman/of.c => common/dpaax/dpaa_of.c} (88%)
rename drivers/{bus/dpaa/include/of.h => common/dpaax/dpaa_of.h} (86%)drivers/bus/dpaa/Makefile +1 -1
@@ -17,6 +17,7 @@ CFLAGS += -Wno-cast-qual CFLAGS += -I$(RTE_BUS_DPAA)/ CFLAGS += -I$(RTE_BUS_DPAA)/include CFLAGS += -I$(RTE_BUS_DPAA)/base/qbman +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include # versioning export map
@@ -32,7 +33,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \ SRCS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += \ base/fman/fman.c \ base/fman/fman_hw.c \ - base/fman/of.c \ base/fman/netcfg_layer.c \ base/qbman/process.c \ base/qbman/bman.c \
drivers/bus/dpaa/base/fman/fman.c +1 -1
@@ -11,7 +11,7 @@/* This header declares the driver interface we implement */ #include <fman.h> -#include <of.h> +#include <dpaa_of.h> #include <rte_malloc.h> #include <rte_dpaa_logs.h> #include <rte_string_fns.h>
drivers/bus/dpaa/base/fman/netcfg_layer.c +1 -1
@@ -5,7 +5,7 @@* */ #include <inttypes.h> -#include <of.h> +#include <dpaa_of.h> #include <net/if.h> #include <sys/ioctl.h> #include <error.h>
drivers/bus/dpaa/base/qbman/dpaa_sys.h +2 -1
@@ -8,7 +8,8 @@#ifndef __DPAA_SYS_H#define __DPAA_SYS_H -#include <of.h> +#include <compat.h> +#include <dpaa_of.h> /* For 2-element tables related to cache-inhibited and cache-enabled mappings */ #define DPAA_PORTAL_CE 0
drivers/bus/dpaa/base/qbman/qman.c +2 -0
@@ -11,6 +11,8 @@#include <rte_eventdev.h> #include <rte_byteorder.h> +#include <dpaa_bits.h> +/* Compilation constants */ #define DQRR_MAXFILL 15#define EQCR_ITHRESH 4/* if EQCR congests, interrupt threshold */
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -32,6 +32,7 @@#include <rte_bus.h> #include <rte_mbuf_pool_ops.h> +#include <dpaa_of.h> #include <rte_dpaa_bus.h> #include <rte_dpaa_logs.h> #include <dpaax_iova_table.h>
@@ -39,7 +40,6 @@#include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> #include <netcfg.h> int dpaa_logtype_bus;
drivers/bus/dpaa/include/fman.h +1 -0
@@ -15,6 +15,7 @@#include <rte_ether.h> #include <compat.h> +#include <dpaa_list.h> #ifndef FMAN_DEVICE_PATH #define FMAN_DEVICE_PATH "/dev/mem"
drivers/bus/dpaa/include/fsl_usd.h +1 -0
@@ -10,6 +10,7 @@#define __FSL_USD_H#include <compat.h> +#include <dpaa_list.h> #include <fsl_qman.h> #ifdef __cplusplus
drivers/bus/dpaa/meson.build +0 -1
@@ -12,7 +12,6 @@ deps += ['common_dpaax', 'eventdev'] sources = files('base/fman/fman.c', 'base/fman/fman_hw.c', 'base/fman/netcfg_layer.c', - 'base/fman/of.c', 'base/qbman/bman.c', 'base/qbman/bman_driver.c', 'base/qbman/dpaa_alloc.c',
drivers/bus/dpaa/rte_dpaa_bus.h +1 -1
@@ -10,10 +10,10 @@#include <rte_mempool.h> #include <dpaax_iova_table.h> +#include <dpaa_of.h> #include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> #include <netcfg.h> #define DPAA_MEMPOOL_OPS_NAME "dpaa"
drivers/bus/fslmc/Makefile +1 -0
@@ -16,6 +16,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev
drivers/common/dpaax/Makefile +6 -4
@@ -12,6 +12,10 @@ LIB = librte_common_dpaax.a CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -Wno-pointer-arith +CFLAGS += -Wno-cast-qual + +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax # versioning export map EXPORT_MAP := rte_common_dpaax_version.map
@@ -22,10 +26,8 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # -SRCS-y += dpaax_iova_table.c +SRCS-y += dpaax_iova_table.c dpaa_of.c LDLIBS += -lrte_eal -SYMLINK-y-include += dpaax_iova_table.h - -include $(RTE_SDK)/mk/rte.lib.mk +include $(RTE_SDK)/mk/rte.lib.mk
drivers/common/dpaax/compat.h renamed from drivers/bus/dpaa/include/compat.h +0 -3
@@ -390,7 +390,4 @@ static inline unsigned long get_zeroed_page(gfp_t __foo __rte_unused)#define atomic_dec_return (v) rte_atomic32_sub_return(v, 1)#define atomic_sub_and_test (i, v) (rte_atomic32_sub_return(v, i) == 0) -#include <dpaa_list.h> -#include <dpaa_bits.h> -#endif /* __COMPAT_H */
drivers/common/dpaax/dpaa_list.h renamed from drivers/bus/dpaa/include/dpaa_list.h +0 -0
drivers/common/dpaax/dpaa_of.c renamed from drivers/bus/dpaa/base/fman/of.c +32 -31
227 lines not on this page · raw message
drivers/common/dpaax/dpaa_of.h renamed from drivers/bus/dpaa/include/of.h +22 -5
@@ -8,7 +8,24 @@#ifndef __OF_H#define __OF_H -#include <compat.h> +#include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <stdbool.h> +#include <stdlib.h> +#include <inttypes.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <dirent.h> +#include <fcntl.h> +#include <glob.h> +#include <errno.h> +#include <ctype.h> +#include <unistd.h> +#include <limits.h> +#include <inttypes.h> +#include <rte_common.h> +#include <dpaa_list.h> #ifndef OF_INIT_DEFAULT_PATH #define OF_INIT_DEFAULT_PATH "/proc/device-tree"
@@ -89,7 +106,7 @@ struct dt_file {const struct device_node *of_find_compatible_node (const struct device_node *from, -const char *type__always_unused , + const char *type __rte_unused,const char *compatible) __attribute__((nonnull (3 )));
@@ -102,7 +119,7 @@ const void *of_get_property(const struct device_node *from, const char *name, size_t *lenp) __attribute__((nonnull(2)));bool of_device_is_available (const struct device_node *dev_node); -const struct device_node *of_find_node_by_phandle (phandle ph); +const struct device_node *of_find_node_by_phandle (uint64_t ph);const struct device_node *of_get_parent (const struct device_node *dev_node);
@@ -122,7 +139,7 @@ const uint32_t *of_get_address(const struct device_node *dev_node, size_t idx, uint64_t *size, uint32_t *flags);uint64_t of_translate_address (const struct device_node *dev_node, -const u32 *addr) __attribute__((nonnull)); +const uint32_t *addr) __attribute__((nonnull));bool of_device_is_compatible (const struct device_node *dev_node,const char *compatible);
@@ -147,7 +164,7 @@ static inline int of_init(void)/* Read a numeric property according to its size and return it as a 64-bit * value. */ -static inline uint64_t of_read_number (const __be32 *cell,int size) +static inline uint64_t of_read_number (const uint32_t *cell,int size) {uint64_t r =0 ;
drivers/common/dpaax/dpaax_logs.h +10 -0
@@ -9,6 +9,16 @@extern int dpaax_logger; +#ifdef RTE_LIBRTE_DPAAX_DEBUG +#define DPAAX_HWWARN(cond, fmt, args...) \ + do {\ + if (cond) \ + DPAAX_LOG(DEBUG, "WARN: " fmt, ##args); \ + } while (0) +#else +#define DPAAX_HWWARN(cond, fmt, args...) do { } while (0) +#endif + #define DPAAX_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaax_logger, "dpaax: " fmt "\n", \ ##args)
drivers/common/dpaax/meson.build +4 -1
@@ -8,6 +8,9 @@ if not is_linux reason = 'only supported on linux' endif -sources = files('dpaax_iova_table.c') +sources = files('dpaax_iova_table.c', 'dpaa_of.c') cflags += ['-D_GNU_SOURCE'] +if cc.has_argument('-Wno-cast-qual') + cflags += '-Wno-cast-qual' +endif
drivers/common/dpaax/rte_common_dpaax_version.map +18 -0
@@ -9,3 +9,21 @@ DPDK_18.11 { local: *; }; + +DPDK_19.11 { + global: + of_device_is_available; + of_device_is_compatible; + of_find_compatible_node; + of_find_node_by_phandle; + of_get_address; + of_get_mac_address; + of_get_parent; + of_get_property; + of_init_path; + of_n_addr_cells; + of_translate_address; + of_get_next_child; + + local: *; +} DPDK_18.11;
drivers/crypto/caam_jr/Makefile +2 -0
@@ -17,6 +17,7 @@ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/caam_jr #sharing the hw flib headers from dpaa2_sec pmd CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/
@@ -37,6 +38,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_CAAM_JR) += caam_jr_uio.c LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_cryptodev +LDLIBS += -lrte_common_dpaax LDLIBS += -lrte_bus_dpaa LDLIBS += -lrte_bus_vdev
drivers/crypto/caam_jr/caam_jr.c +1 -1
@@ -27,7 +27,7 @@/* RTA header files */ #include <hw/desc/common.h> #include <hw/desc/algo.h> -#include <of.h> +#include <dpaa_of.h> #define CAAM_JR_DBG 0#define CRYPTODEV_NAME_CAAM_JR_PMD crypto_caam_jr
drivers/crypto/dpaa2_sec/Makefile +1 -1
@@ -19,7 +19,7 @@ ifeq ($(shell test $(GCC_VERSION) -gt 70 && echo 1), 1) CFLAGS += -Wno-implicit-fallthrough endif endif - +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/ CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/
drivers/crypto/dpaa_sec/Makefile +1 -0
@@ -16,6 +16,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa_sec/ #sharing the hw flib headers from dpaa2_sec pmd CFLAGS += -I$(RTE_SDK)/drivers/crypto/dpaa2_sec/
drivers/crypto/dpaa_sec/dpaa_sec.c +1 -1
@@ -27,7 +27,7 @@#include <fsl_usd.h> #include <fsl_qman.h> -#include <of.h> +#include <dpaa_of.h> /* RTA header files */ #include <hw/desc/common.h>
drivers/event/dpaa/Makefile +1 -0
@@ -19,6 +19,7 @@ CFLAGS += -I$(RTE_SDK_DPAA)/include CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include EXPORT_MAP := rte_pmd_dpaa_event_version.map
drivers/event/dpaa2/Makefile +1 -0
@@ -17,6 +17,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/portal CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa2 +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_eal -lrte_eventdev LDLIBS += -lrte_bus_fslmc -lrte_mempool_dpaa2 -lrte_pmd_dpaa2 LDLIBS += -lrte_bus_vdev
drivers/mempool/dpaa/Makefile +1 -0
@@ -12,6 +12,7 @@ CFLAGS := -I$(SRCDIR) $(CFLAGS) CFLAGS += -O3 $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa CFLAGS += -I$(RTE_SDK)/lib/librte_mempool
drivers/mempool/dpaa2/Makefile +1 -0
@@ -12,6 +12,7 @@ LIB = librte_mempool_dpaa2.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include # versioning export map
drivers/net/dpaa/Makefile +1 -0
@@ -19,6 +19,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/base/qbman CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include
drivers/net/dpaa/dpaa_ethdev.h +1 -1
@@ -15,7 +15,7 @@#include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> +#include <dpaa_of.h> #include <netcfg.h> #define MAX_DPAA_CORES 4
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -44,7 +44,7 @@#include <fsl_usd.h> #include <fsl_qman.h> #include <fsl_bman.h> -#include <of.h> +#include <dpaa_of.h> #include <netcfg.h> #define DPAA_MBUF_TO_CONTIG_FD (_mbuf, _fd, _bpid) \
drivers/net/dpaa2/Makefile +1 -0
@@ -12,6 +12,7 @@ LIB = librte_pmd_dpaa2.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc
drivers/raw/dpaa2_cmdif/Makefile +1 -0
@@ -14,6 +14,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_bus_vdev
drivers/raw/dpaa2_qdma/Makefile +1 -0
@@ -14,6 +14,7 @@ CFLAGS += $(WERROR_FLAGS) CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax LDLIBS += -lrte_bus_fslmc LDLIBS += -lrte_eal
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v4 01/14] common/dpaax: moving OF lib code from dpaa bus
Quoted 6 lines · Gagandeep Singh
From: Hemant Agrawal <[email protected]>
This code is being shared by more than 1 type of driver. Common is most appropriate place for it.
Signed-off-by Hemant Agrawal <[email protected]>
<...>
Quoted 13 lines
drivers/common/dpaax/rte_common_dpaax_version.map +5
-0@@ -9,3 +9,21 @@ DPDK_18.11 { local: *; }; + +DPDK_19.11 { + global: + of_device_is_available; + of_device_is_compatible;
drivers/common/dpaax/rte_common_dpaax_version.map DPDK_18.11 { · line 26
Quoted 10 lines
drivers/common/dpaax/rte_common_dpaax_version.map +10
-0+ of_find_compatible_node; + of_find_node_by_phandle; + of_get_address; + of_get_mac_address; + of_get_parent; + of_get_property; + of_init_path; + of_n_addr_cells; + of_translate_address; + of_get_next_child;
Seems forgot to remove following APIs from 'bus/dpaa' .map file, if it is just .map file update, I can do while merging.
of_find_compatible_nodeof_get_mac_addressof_get_property
drivers/common/dpaax/rte_common_dpaax_version.map DPDK_18.11 { · line 28
Quoted 2 lines
drivers/common/dpaax/rte_common_dpaax_version.map +2
-0+ + local: *;
No need the "local: *;" on the blocks other than first block.
PATCH v4 2/14 net/pfe: introduce pfe net poll mode driver
In reply to Gagandeep Singhpfe (packet forwarding engine) is a network
poll mode driver for NXP SoC ls1012a.
This patch introduces the framework of pfe
driver with basic functions of initialisation
and teardown.
--- MAINTAINERS | 6 + config/common_armv8a_linux | 5 + config/common_base | 5 + doc/guides/nics/features/pfe.ini | 8 + drivers/net/Makefile | 1 + drivers/net/meson.build | 1 + drivers/net/pfe/Makefile | 27 ++ drivers/net/pfe/meson.build | 9 + drivers/net/pfe/pfe_eth.h | 73 ++++++ drivers/net/pfe/pfe_ethdev.c | 322 ++++++++++++++++++++++++ drivers/net/pfe/pfe_mod.h | 56 +++++ drivers/net/pfe/rte_pmd_pfe_version.map | 4 + mk/rte.app.mk | 1 + 13 files changed, 518 insertions(+) create mode 100644 doc/guides/nics/features/pfe.ini create mode 100644 drivers/net/pfe/Makefile create mode 100644 drivers/net/pfe/meson.build create mode 100644 drivers/net/pfe/pfe_eth.h create mode 100644 drivers/net/pfe/pfe_ethdev.c create mode 100644 drivers/net/pfe/pfe_mod.h create mode 100644 drivers/net/pfe/rte_pmd_pfe_version.map
MAINTAINERS +6 -0
@@ -787,6 +787,12 @@ F: drivers/net/enetc/ F: doc/guides/nics/enetc.rst F: doc/guides/nics/features/enetc.ini +NXP pfe +M: Gagandeep Singh <[email protected]> +M: Akhil Goyal <[email protected]> +F: drivers/net/pfe/ +F: doc/guides/nics/features/pfe.ini + QLogic bnx2x M: Rasesh Mody <[email protected]> M: Shahed Shaikh <[email protected]>
config/common_armv8a_linux +5 -0
@@ -36,4 +36,9 @@ CONFIG_RTE_LIBRTE_SFC_EFX_PMD=n CONFIG_RTE_LIBRTE_AVP_PMD=n CONFIG_RTE_LIBRTE_PMD_IOAT_RAWDEV=n +# +# NXP PFE PMD Driver +# +CONFIG_RTE_LIBRTE_PFE_PMD=y + CONFIG_RTE_SCHED_VECTOR=n
config/common_base +5 -0
@@ -218,6 +218,11 @@ CONFIG_RTE_LIBRTE_BNXT_PMD=y # CONFIG_RTE_LIBRTE_CXGBE_PMD=y +# +# Compile burst-oriented NXP PFE PMD driver +# +CONFIG_RTE_LIBRTE_PFE_PMD=n + # NXP DPAA Bus CONFIG_RTE_LIBRTE_DPAA_BUS=n CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n
doc/guides/nics/features/pfe.ini new file +8 -0
@@ -0,0 +1,8 @@ +; +; Supported features of the 'pfe' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Linux VFIO = Y +ARMv8 = Y
drivers/net/Makefile +1 -0
@@ -50,6 +50,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += null DIRS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx DIRS-$(CONFIG_RTE_LIBRTE_OCTEONTX2_PMD) += octeontx2 DIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += pcap +DIRS-$(CONFIG_RTE_LIBRTE_PFE_PMD) += pfe DIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += ring DIRS-$(CONFIG_RTE_LIBRTE_SFC_EFX_PMD) += sfc
drivers/net/meson.build +1 -0
@@ -38,6 +38,7 @@ drivers = ['af_packet', 'octeontx', 'octeontx2', 'pcap', + 'pfe', 'qede', 'ring', 'sfc',
drivers/net/pfe/Makefile new file +27 -0
@@ -0,0 +1,27 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2019 NXP +# + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_pmd_pfe.a + +CFLAGS += -O3 $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax + +EXPORT_MAP := rte_pmd_pfe_version.map +LIBABIVER := 1 + +# Interfaces with DPDK +SRCS-$(CONFIG_RTE_LIBRTE_PFE_PMD) += pfe_ethdev.c + +LDLIBS += -lrte_bus_vdev +LDLIBS += -lrte_bus_dpaa +LDLIBS += -lrte_common_dpaax +LDLIBS += -lrte_eal +LDLIBS += -lrte_ethdev -lrte_kvargs + +include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/pfe/meson.build new file +9 -0
@@ -0,0 +1,9 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2019 NXP + +if host_machine.system() != 'linux' + build = false +endif +deps += ['bus_dpaa'] + +sources = files('pfe_ethdev.c')
drivers/net/pfe/pfe_eth.h new file +73 -0
73 lines not on this page · raw message
drivers/net/pfe/pfe_ethdev.c new file +322 -0
322 lines not on this page · raw message
drivers/net/pfe/pfe_mod.h new file +56 -0
56 lines not on this page · raw message
drivers/net/pfe/rte_pmd_pfe_version.map new file +4 -0
@@ -0,0 +1,4 @@ +DPDK_19.11 { + + local: *; +};
mk/rte.app.mk +1 -0
@@ -201,6 +201,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null _LDLIBS-$(CONFIG_RTE_LIBRTE_OCTEONTX2_PMD) += -lrte_pmd_octeontx2 -lm _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap -lpcap +_LDLIBS-$(CONFIG_RTE_LIBRTE_PFE_PMD) += -lrte_pmd_pfe _LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lrte_pmd_qede _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y)
Signature · 1 line
2.17.1
PATCH v4 3/14 doc: add guide for pfe net PMD
In reply to Gagandeep SinghThis patch add documentation for pfe network
poll mode driver.
PFE is a hardware programmable packet
forwarding engine to provide high performance
ethernet interfaces.
--- MAINTAINERS | 1 + doc/guides/nics/features/pfe.ini | 1 + doc/guides/nics/index.rst | 1 + doc/guides/nics/pfe.rst | 173 +++++++++++++++++++++++++++++++ 4 files changed, 176 insertions(+) create mode 100644 doc/guides/nics/pfe.rst
MAINTAINERS +1 -0
@@ -790,6 +790,7 @@ F: doc/guides/nics/features/enetc.ini NXP pfe M: Gagandeep Singh <[email protected]> M: Akhil Goyal <[email protected]> +F: doc/guides/nics/pfe.rst F: drivers/net/pfe/ F: doc/guides/nics/features/pfe.ini
doc/guides/nics/features/pfe.ini +1 -0
@@ -6,3 +6,4 @@ [Features] Linux VFIO = Y ARMv8 = Y +Usage doc = Y
doc/guides/nics/index.rst +1 -0
@@ -48,6 +48,7 @@ Network Interface Controller Drivers nfp octeontx octeontx2 + pfe qede sfc_efx softnic
doc/guides/nics/pfe.rst new file +173 -0
173 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v4 4/14 net/pfe: support dynamic logging
In reply to Gagandeep SinghThis patch introduces logging for the pfe PMD.
--- drivers/net/pfe/pfe_ethdev.c | 69 +++++++++++++++++++++++++++++------- drivers/net/pfe/pfe_logs.h | 31 ++++++++++++++++ 2 files changed, 88 insertions(+), 12 deletions(-) create mode 100644 drivers/net/pfe/pfe_logs.h
drivers/net/pfe/pfe_ethdev.c +57 -12
@@ -7,6 +7,7 @@#include <rte_bus_vdev.h> #include <dpaa_of.h> +#include "pfe_logs.h" #include "pfe_mod.h" #define PFE_MAX_MACS 1/*we can support upto 4 MACs per IF*/
@@ -23,20 +24,26 @@ static struct pfe *g_pfe;*/ unsigned int pfe_svr =SVR_LS1012A_REV1 ; +int pfe_logtype_pmd; +static void pfe_soc_version_get (void ) {FILE *svr_file =NULL ;unsigned int svr_ver =0 ; +PMD_INIT_FUNC_TRACE (); + svr_file =fopen (PFE_SOC_ID_FILE ,"r" ); -if (!svr_file) +if (!svr_file) { +PFE_PMD_ERR ("Unable to open SoC device" );return ;/* Not supported on this infra */ + }if (fscanf (svr_file,"svr:%x" , &svr_ver) >0 ) pfe_svr = svr_ver;else -printf ("Unable to read SoC device" ); +PFE_PMD_ERR ("Unable to read SoC device" );fclose (svr_file); }
@@ -51,6 +58,9 @@ pfe_eth_open_cdev(struct pfe_eth_priv_s *priv) pfe_cdev_fd =open (PFE_CDEV_PATH ,O_RDONLY );if (pfe_cdev_fd <0 ) { +PFE_PMD_WARN ("Unable to open PFE device file (%s).\n" , +PFE_CDEV_PATH ); +PFE_PMD_WARN ("Link status update will not be available.\n" ); priv->link_fd =PFE_CDEV_INVALID_FD ;return -1 ; }
@@ -75,6 +85,8 @@ pfe_eth_close_cdev(struct pfe_eth_priv_s *priv)static void pfe_eth_exit (struct rte_eth_dev *dev,struct pfe *pfe) { +PMD_INIT_FUNC_TRACE (); +/* Close the device file for link status */ pfe_eth_close_cdev (dev->data->dev_private);
@@ -110,6 +122,8 @@ pfe_eth_init(struct rte_vdev_device *vdev, struct pfe *pfe, int id) eth_dev->data->mac_addrs =rte_zmalloc ("mac_addr" ,ETHER_ADDR_LEN *PFE_MAX_MACS ,0 );if (eth_dev->data->mac_addrs ==NULL ) { +PFE_PMD_ERR ("Failed to allocate mem %d to store MAC addresses" , +ETHER_ADDR_LEN *PFE_MAX_MACS ); err = -ENOMEM ; goto err0; }
@@ -142,8 +156,10 @@ parse_integer_arg(const char *key __rte_unused, errno =0 ; i =strtol (value, &end,10 ); -if (*end !=0 || errno !=0 || i <0 || i >1 ) +if (*end !=0 || errno !=0 || i <0 || i >1 ) { +PFE_PMD_ERR ("Supported Port IDS are 0 and 1" );return -EINVAL ; + } *((uint32_t *)extra_args) = i;
@@ -199,10 +215,15 @@ pmd_pfe_probe(struct rte_vdev_device *vdev)if (rc <0 )return -EINVAL ; +RTE_LOG (INFO ,PMD ,"Initializing pmd_pfe for %s Given gem-id %d\n" , + name, init_params.gem_id); +if (g_pfe) { -if (g_pfe->nb_devs >= g_pfe->max_intf) +if (g_pfe->nb_devs >= g_pfe->max_intf) { +PFE_PMD_ERR ("PFE %d dev already created Max is %d" , + g_pfe->nb_devs, g_pfe->max_intf);return -EINVAL ; - + } goto eth_init; }
@@ -212,31 +233,40 @@ pmd_pfe_probe(struct rte_vdev_device *vdev)/* Load the device-tree driver */ rc =of_init (); -if (rc) +if (rc) { +PFE_PMD_ERR ("of_init failed with ret: %d" , rc); goto err; + } np =of_find_compatible_node (NULL ,NULL ,"fsl,pfe" );if (!np) { +PFE_PMD_ERR ("Invalid device node" ); rc = -EINVAL ; goto err; } addr =of_get_address (np,0 , &cbus_size,NULL ); -if (!addr) +if (!addr) { +PFE_PMD_ERR ("of_get_address cannot return qman address\n" ); goto err; - + } cbus_addr =of_translate_address (np, addr); -if (!cbus_addr) +if (!cbus_addr) { +PFE_PMD_ERR ("of_translate_address failed\n" ); goto err; - + } addr =of_get_address (np,1 , &ddr_size,NULL ); -if (!addr) +if (!addr) { +PFE_PMD_ERR ("of_get_address cannot return qman address\n" ); goto err; + } g_pfe->ddr_phys_baseaddr =of_translate_address (np, addr); -if (!g_pfe->ddr_phys_baseaddr) +if (!g_pfe->ddr_phys_baseaddr) { +PFE_PMD_ERR ("of_translate_address failed\n" ); goto err; + } g_pfe->ddr_size = ddr_size; g_pfe->cbus_size = cbus_size;
@@ -246,6 +276,7 @@ pmd_pfe_probe(struct rte_vdev_device *vdev) MAP_SHARED, fd, cbus_addr);close (fd);if (g_pfe->cbus_baseaddr ==MAP_FAILED ) { +PFE_PMD_ERR ("Can not map cbus base" ); rc = -EINVAL ; goto err; }
@@ -253,15 +284,20 @@ pmd_pfe_probe(struct rte_vdev_device *vdev)/* Read interface count */ prop =of_get_property (np,"fsl,pfe-num-interfaces" , &size);if (!prop) { +PFE_PMD_ERR ("Failed to read number of interfaces" ); rc = -ENXIO ; goto err_prop; } interface_count =rte_be_to_cpu_32 ((unsigned int )*prop);if (interface_count <=0 ) { +PFE_PMD_ERR ("No ethernet interface count : %d" , + interface_count); rc = -ENXIO ; goto err_prop; } +PFE_PMD_INFO ("num interfaces = %d " , interface_count); + g_pfe->max_intf = interface_count;pfe_soc_version_get (); eth_init:
@@ -299,6 +335,8 @@ pmd_pfe_remove(struct rte_vdev_device *vdev)if (name ==NULL )return -EINVAL ; +PFE_PMD_INFO ("Closing eventdev sw device %s" , name); +if (!g_pfe)return 0 ;
@@ -320,3 +358,10 @@ struct rte_vdev_driver pmd_pfe_drv = {RTE_PMD_REGISTER_VDEV (PFE_NAME_PMD , pmd_pfe_drv);RTE_PMD_REGISTER_PARAM_STRING (PFE_NAME_PMD ,PFE_VDEV_GEM_ID_ARG "=<int> " ); + +RTE_INIT (pfe_pmd_init_log) +{ + pfe_logtype_pmd =rte_log_register ("pmd.net.pfe" ); +if (pfe_logtype_pmd >=0 ) +rte_log_set_level (pfe_logtype_pmd,RTE_LOG_NOTICE ); +}
drivers/net/pfe/pfe_logs.h new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _PFE_LOGS_H_ +#define _PFE_LOGS_H_ + +extern int pfe_logtype_pmd; + +/* PMD related logs */ +#define PFE_PMD_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, pfe_logtype_pmd, "pfe_net: %s()" \ + fmt "\n", __func__, ##args) + +#define PMD_INIT_FUNC_TRACE () PFE_PMD_LOG(DEBUG, " >>") + +#define PFE_PMD_DEBUG(fmt, args...) \ + PFE_PMD_LOG(DEBUG, fmt, ## args) +#define PFE_PMD_ERR(fmt, args...) \ + PFE_PMD_LOG(ERR, fmt, ## args) +#define PFE_PMD_INFO(fmt, args...) \ + PFE_PMD_LOG(INFO, fmt, ## args) + +#define PFE_PMD_WARN(fmt, args...) \ + PFE_PMD_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define PFE_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#endif /* _PFE_LOGS_H_ */
Signature · 1 line
2.17.1
PATCH v4 5/14 net/pfe: add HW specific macros and operations
In reply to Gagandeep SinghThis patch add some hardware specific macros
and functions that will be used by the driver.
--- drivers/net/pfe/base/cbus.h | 66 +++++ drivers/net/pfe/base/cbus/bmu.h | 41 ++++ drivers/net/pfe/base/cbus/class_csr.h | 277 +++++++++++++++++++++ drivers/net/pfe/base/cbus/emac_mtip.h | 231 ++++++++++++++++++ drivers/net/pfe/base/cbus/gpi.h | 77 ++++++ drivers/net/pfe/base/cbus/hif.h | 86 +++++++ drivers/net/pfe/base/cbus/hif_nocpy.h | 36 +++ drivers/net/pfe/base/cbus/tmu_csr.h | 154 ++++++++++++ drivers/net/pfe/base/cbus/util_csr.h | 47 ++++ drivers/net/pfe/base/pfe.h | 339 ++++++++++++++++++++++++++ 10 files changed, 1354 insertions(+) create mode 100644 drivers/net/pfe/base/cbus.h create mode 100644 drivers/net/pfe/base/cbus/bmu.h create mode 100644 drivers/net/pfe/base/cbus/class_csr.h create mode 100644 drivers/net/pfe/base/cbus/emac_mtip.h create mode 100644 drivers/net/pfe/base/cbus/gpi.h create mode 100644 drivers/net/pfe/base/cbus/hif.h create mode 100644 drivers/net/pfe/base/cbus/hif_nocpy.h create mode 100644 drivers/net/pfe/base/cbus/tmu_csr.h create mode 100644 drivers/net/pfe/base/cbus/util_csr.h create mode 100644 drivers/net/pfe/base/pfe.h
drivers/net/pfe/base/cbus.h new file +66 -0
@@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _CBUS_H_ +#define _CBUS_H_ + +#include <compat.h> + +#define EMAC1_BASE_ADDR (CBUS_BASE_ADDR + 0x200000) +#define EGPI1_BASE_ADDR (CBUS_BASE_ADDR + 0x210000) +#define EMAC2_BASE_ADDR (CBUS_BASE_ADDR + 0x220000) +#define EGPI2_BASE_ADDR (CBUS_BASE_ADDR + 0x230000) +#define BMU1_BASE_ADDR (CBUS_BASE_ADDR + 0x240000) +#define BMU2_BASE_ADDR (CBUS_BASE_ADDR + 0x250000) +#define ARB_BASE_ADDR (CBUS_BASE_ADDR + 0x260000) +#define DDR_CONFIG_BASE_ADDR (CBUS_BASE_ADDR + 0x270000) +#define HIF_BASE_ADDR (CBUS_BASE_ADDR + 0x280000) +#define HGPI_BASE_ADDR (CBUS_BASE_ADDR + 0x290000) +#define LMEM_BASE_ADDR (CBUS_BASE_ADDR + 0x300000) +#define LMEM_SIZE 0x10000 +#define LMEM_END (LMEM_BASE_ADDR + LMEM_SIZE) +#define TMU_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x310000) +#define CLASS_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x320000) +#define HIF_NOCPY_BASE_ADDR (CBUS_BASE_ADDR + 0x350000) +#define UTIL_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x360000) +#define CBUS_GPT_BASE_ADDR (CBUS_BASE_ADDR + 0x370000) + +/* +* defgroup XXX_MEM_ACCESS_ADDR PE memory access through CSR +* XXX_MEM_ACCESS_ADDR register bit definitions. +*/ +#define PE_MEM_ACCESS_WRITE BIT(31)/* Internal Memory Write. */ +#define PE_MEM_ACCESS_IMEM BIT(15) +#define PE_MEM_ACCESS_DMEM BIT(16) + +/* Byte Enables of the Internal memory access. These are interpred in BE */ +#define PE_MEM_ACCESS_BYTE_ENABLE (offset, size) \ + ({ typeof(size) size_ = (size); \ + (((BIT(size_) - 1) << (4 - (offset) - (size_))) & 0xf) << 24; }) + +#include "cbus/emac_mtip.h" +#include "cbus/gpi.h" +#include "cbus/bmu.h" +#include "cbus/hif.h" +#include "cbus/tmu_csr.h" +#include "cbus/class_csr.h" +#include "cbus/hif_nocpy.h" +#include "cbus/util_csr.h" + +/* PFE cores states */ +#define CORE_DISABLE 0x00000000 +#define CORE_ENABLE 0x00000001 +#define CORE_SW_RESET 0x00000002 + +/* LMEM defines */ +#define LMEM_HDR_SIZE 0x0010 +#define LMEM_BUF_SIZE_LN2 0x7 +#define LMEM_BUF_SIZE BIT(LMEM_BUF_SIZE_LN2) + +/* DDR defines */ +#define DDR_HDR_SIZE 0x0100 +#define DDR_BUF_SIZE_LN2 0xb +#define DDR_BUF_SIZE BIT(DDR_BUF_SIZE_LN2) + +#endif /* _CBUS_H_ */
drivers/net/pfe/base/cbus/bmu.h new file +41 -0
41 lines not on this page · raw message
drivers/net/pfe/base/cbus/class_csr.h new file +277 -0
277 lines not on this page · raw message
drivers/net/pfe/base/cbus/emac_mtip.h new file +231 -0
231 lines not on this page · raw message
drivers/net/pfe/base/cbus/gpi.h new file +77 -0
77 lines not on this page · raw message
drivers/net/pfe/base/cbus/hif.h new file +86 -0
86 lines not on this page · raw message
drivers/net/pfe/base/cbus/hif_nocpy.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#ifndef _HIF_NOCPY_H_ +#define _HIF_NOCPY_H_ + +#define HIF_NOCPY_VERSION (HIF_NOCPY_BASE_ADDR + 0x00) +#define HIF_NOCPY_TX_CTRL (HIF_NOCPY_BASE_ADDR + 0x04) +#define HIF_NOCPY_TX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x08) +#define HIF_NOCPY_TX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x0c) +#define HIF_NOCPY_TX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x10) +#define HIF_NOCPY_TX_STATUS (HIF_NOCPY_BASE_ADDR + 0x14) +#define HIF_NOCPY_RX_CTRL (HIF_NOCPY_BASE_ADDR + 0x20) +#define HIF_NOCPY_RX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x24) +#define HIF_NOCPY_RX_STATUS (HIF_NOCPY_BASE_ADDR + 0x30) +#define HIF_NOCPY_INT_SRC (HIF_NOCPY_BASE_ADDR + 0x34) +#define HIF_NOCPY_INT_ENABLE (HIF_NOCPY_BASE_ADDR + 0x38) +#define HIF_NOCPY_POLL_CTRL (HIF_NOCPY_BASE_ADDR + 0x3c) +#define HIF_NOCPY_RX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x40) +#define HIF_NOCPY_RX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x44) +#define HIF_NOCPY_TX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x48) +#define HIF_NOCPY_RX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x4c) +#define HIF_NOCPY_RX_INQ0_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x50) +#define HIF_NOCPY_RX_INQ1_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x54) +#define HIF_NOCPY_TX_PORT_NO (HIF_NOCPY_BASE_ADDR + 0x60) +#define HIF_NOCPY_LMEM_ALLOC_ADDR (HIF_NOCPY_BASE_ADDR + 0x64) +#define HIF_NOCPY_CLASS_ADDR (HIF_NOCPY_BASE_ADDR + 0x68) +#define HIF_NOCPY_TMU_PORT0_ADDR (HIF_NOCPY_BASE_ADDR + 0x70) +#define HIF_NOCPY_TMU_PORT1_ADDR (HIF_NOCPY_BASE_ADDR + 0x74) +#define HIF_NOCPY_TMU_PORT2_ADDR (HIF_NOCPY_BASE_ADDR + 0x7c) +#define HIF_NOCPY_TMU_PORT3_ADDR (HIF_NOCPY_BASE_ADDR + 0x80) +#define HIF_NOCPY_TMU_PORT4_ADDR (HIF_NOCPY_BASE_ADDR + 0x84) +#define HIF_NOCPY_INT_COAL (HIF_NOCPY_BASE_ADDR + 0x90) + +#endif /* _HIF_NOCPY_H_ */
drivers/net/pfe/base/cbus/tmu_csr.h new file +154 -0
154 lines not on this page · raw message
drivers/net/pfe/base/cbus/util_csr.h new file +47 -0
47 lines not on this page · raw message
drivers/net/pfe/base/pfe.h new file +339 -0
339 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v4 6/14 net/pfe: add MAC and host interface initialisation
In reply to Gagandeep SinghHIF or host interface is responsible for transmit and receive packets between physical ethernet interfaces and HIF library defined logical interfaces.
This patch initialise that host interface and MAC.
--- drivers/net/pfe/Makefile | 10 + drivers/net/pfe/base/pfe.h | 83 +++++ drivers/net/pfe/meson.build | 12 +- drivers/net/pfe/pfe_eth.h | 2 + drivers/net/pfe/pfe_ethdev.c | 153 ++++++++- drivers/net/pfe/pfe_hal.c | 629 ++++++++++++++++++++++++++++++++++ drivers/net/pfe/pfe_hif.c | 256 ++++++++++++++ drivers/net/pfe/pfe_hif.h | 106 ++++++ drivers/net/pfe/pfe_hif_lib.c | 20 ++ drivers/net/pfe/pfe_hif_lib.h | 162 +++++++++ drivers/net/pfe/pfe_mod.h | 5 + 11 files changed, 1436 insertions(+), 2 deletions(-) create mode 100644 drivers/net/pfe/pfe_hal.c create mode 100644 drivers/net/pfe/pfe_hif.c create mode 100644 drivers/net/pfe/pfe_hif.h create mode 100644 drivers/net/pfe/pfe_hif_lib.c create mode 100644 drivers/net/pfe/pfe_hif_lib.h
drivers/net/pfe/Makefile +10 -0
@@ -10,13 +10,23 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB = librte_pmd_pfe.a CFLAGS += -O3 $(WERROR_FLAGS) +CFLAGS += -Wno-pointer-arith +CFLAGS += -I$(RTE_SDK)/drivers/net/pfe/base/ CFLAGS += -I$(RTE_SDK)/drivers/common/dpaax EXPORT_MAP := rte_pmd_pfe_version.map LIBABIVER := 1 +# Driver uses below experimental APIs +# rte_mem_iova2virt +# rte_mem_virt2memseg +CFLAGS += -DALLOW_EXPERIMENTAL_API + # Interfaces with DPDK SRCS-$(CONFIG_RTE_LIBRTE_PFE_PMD) += pfe_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_PFE_PMD) += pfe_hal.c +SRCS-$(CONFIG_RTE_LIBRTE_PFE_PMD) += pfe_hif_lib.c +SRCS-$(CONFIG_RTE_LIBRTE_PFE_PMD) += pfe_hif.c LDLIBS += -lrte_bus_vdev LDLIBS += -lrte_bus_dpaa
drivers/net/pfe/base/pfe.h +83 -0
93 lines not on this page · raw message
drivers/net/pfe/meson.build +11 -1
@@ -6,4 +6,14 @@ if host_machine.system() != 'linux' endif deps += ['bus_dpaa'] -sources = files('pfe_ethdev.c') +sources = files('pfe_ethdev.c', + 'pfe_hal.c', + 'pfe_hif_lib.c', + 'pfe_hif.c') + +# Driver uses below experimental APIs +# rte_mem_iova2virt +# rte_mem_virt2memseg +allow_experimental_apis = true + +includes += include_directories('base')
drivers/net/pfe/pfe_eth.h +2 -0
@@ -17,6 +17,8 @@ extern unsigned int pfe_svr;#define SVR_LS1012A_REV2 0x87040020#define SVR_LS1012A_REV1 0x87040010 +#define PFE_ETH_OVERHEAD (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN) +#define MAX_MTU_ON_REV1 1878struct ls1012a_eth_platform_data {/* device specific information */ u32 device_flags;
drivers/net/pfe/pfe_ethdev.c +152 -1
222 lines not on this page · raw message
drivers/net/pfe/pfe_hal.c new file +629 -0
629 lines not on this page · raw message
drivers/net/pfe/pfe_hif.c new file +256 -0
256 lines not on this page · raw message
drivers/net/pfe/pfe_hif.h new file +106 -0
106 lines not on this page · raw message
drivers/net/pfe/pfe_hif_lib.c new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2019 NXP +*/ + +#include "pfe_logs.h" +#include "pfe_mod.h" + +int +pfe_hif_lib_init(__rte_unused struct pfe *pfe) +{ +PMD_INIT_FUNC_TRACE (); + +return 0 ; +} + +void +pfe_hif_lib_exit(__rte_unused struct pfe *pfe) +{ +PMD_INIT_FUNC_TRACE (); +}
drivers/net/pfe/pfe_hif_lib.h new file +162 -0
162 lines not on this page · raw message
drivers/net/pfe/pfe_mod.h +5 -0
@@ -7,6 +7,9 @@struct pfe ; +#include "pfe.h" +#include "pfe_hif.h" +#include "pfe_hif_lib.h" #include "pfe_eth.h" #define PHYID_MAX_VAL 32
@@ -42,6 +45,8 @@ struct pfe {uint64_t ddr_size;void *cbus_baseaddr;uint64_t cbus_size; +struct ls1012a_pfe_platform_data platform_data; +struct pfe_hif hif;struct pfe_eth eth;int mdio_muxval[PHYID_MAX_VAL ];uint8_t nb_devs;
Signature · 1 line
2.17.1
PATCH v4 7/14 net/pfe: add device start stop operations
In reply to Gagandeep SinghThis patch adds device start, stop and close
operations.
--- drivers/net/pfe/Makefile | 2 +- drivers/net/pfe/pfe_eth.h | 1 + drivers/net/pfe/pfe_ethdev.c | 184 +++++++++++++++++ drivers/net/pfe/pfe_hif.c | 139 +++++++++++++ drivers/net/pfe/pfe_hif.h | 41 ++++ drivers/net/pfe/pfe_hif_lib.c | 362 +++++++++++++++++++++++++++++++++- drivers/net/pfe/pfe_hif_lib.h | 11 ++ drivers/net/pfe/pfe_mod.h | 1 + 8 files changed, 739 insertions(+), 2 deletions(-)
drivers/net/pfe/Makefile +1 -1
@@ -31,7 +31,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PFE_PMD) += pfe_hif.c LDLIBS += -lrte_bus_vdev LDLIBS += -lrte_bus_dpaa LDLIBS += -lrte_common_dpaax -LDLIBS += -lrte_eal +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool LDLIBS += -lrte_ethdev -lrte_kvargs include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/pfe/pfe_eth.h +1 -0
@@ -55,6 +55,7 @@ struct ls1012a_pfe_platform_data {struct pfe_eth_priv_s {struct pfe *pfe; +struct hif_client_s client;int low_tmu_q;int high_tmu_q;struct rte_eth_dev *ndev;
drivers/net/pfe/pfe_ethdev.c +184 -0
213 lines not on this page · raw message
drivers/net/pfe/pfe_hif.c +139 -0
145 lines not on this page · raw message
drivers/net/pfe/pfe_hif.h +41 -0
59 lines not on this page · raw message
drivers/net/pfe/pfe_hif_lib.c +361 -1
372 lines not on this page · raw message
drivers/net/pfe/pfe_hif_lib.h +11 -0
@@ -5,6 +5,8 @@#ifndef _PFE_HIF_LIB_H_#define _PFE_HIF_LIB_H_ +#include "pfe_hif.h" +#define HIF_CL_REQ_TIMEOUT 10#define GFP_DMA_PFE 0
@@ -158,5 +160,14 @@ extern unsigned int emac_txq_cnt;int pfe_hif_lib_init (struct pfe *pfe);void pfe_hif_lib_exit (struct pfe *pfe); +int hif_lib_client_register (struct hif_client_s *client); +int hif_lib_client_unregister (struct hif_client_s *client); +void hif_lib_indicate_client (struct hif_client_s *client,int event,int data); +int hif_lib_event_handler_start (struct hif_client_s *client,int event,int + data); +void *hif_lib_tx_get_next_complete (struct hif_client_s *client,int qno, +unsigned int *flags,int count); +int pfe_hif_shm_init (struct hif_shm *hif_shm,struct rte_mempool *mb_pool); +void pfe_hif_shm_clean (struct hif_shm *hif_shm);#endif /* _PFE_HIF_LIB_H_ */
drivers/net/pfe/pfe_mod.h +1 -0
@@ -48,6 +48,7 @@ struct pfe {struct ls1012a_pfe_platform_data platform_data;struct pfe_hif hif;struct pfe_eth eth; +struct hif_client_s *hif_client[HIF_CLIENTS_MAX ];int mdio_muxval[PHYID_MAX_VAL ];uint8_t nb_devs;uint8_t max_intf;
Signature · 1 line
2.17.1
PATCH v4 8/14 net/pfe: add queue setup and release operations
In reply to Gagandeep SinghThis patch add RX/TX queue setup operations and supported checksum offloads.
--- doc/guides/nics/features/pfe.ini | 2 + doc/guides/nics/pfe.rst | 1 + drivers/net/pfe/pfe_ethdev.c | 93 +++++++++++++++++++++++++ drivers/net/pfe/pfe_hif.c | 115 +++++++++++++++++++++++++++++++ drivers/net/pfe/pfe_hif.h | 1 + drivers/net/pfe/pfe_hif_lib.c | 50 ++++++++++++++ 6 files changed, 262 insertions(+)
doc/guides/nics/features/pfe.ini +2 -0
@@ -4,6 +4,8 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +L3 checksum offload = Y +L4 checksum offload = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/pfe.rst +1 -0
@@ -93,6 +93,7 @@ the kernel layer for link status. PFE Features ~~~~~~~~~~~~ +- L3/L4 checksum offload - ARMv8 Supported PFE SoCs
drivers/net/pfe/pfe_ethdev.c +93 -0
117 lines not on this page · raw message
drivers/net/pfe/pfe_hif.c +115 -0
121 lines not on this page · raw message
drivers/net/pfe/pfe_hif.h +1 -0
@@ -143,5 +143,6 @@ void hif_process_client_req(struct pfe_hif *hif, int req, int data1, intint pfe_hif_init (struct pfe *pfe);void pfe_hif_exit (struct pfe *pfe);void pfe_hif_rx_idle (struct pfe_hif *hif); +int pfe_hif_init_buffers (struct pfe_hif *hif);#endif /* _PFE_HIF_H_ */
drivers/net/pfe/pfe_hif_lib.c +50 -0
56 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v4 9/14 net/pfe: add burst enqueue and dequeue operations
In reply to Gagandeep SinghThis patch add burst enqueue and dequeue operations to the pfe PMD.
--- drivers/net/pfe/pfe_ethdev.c | 140 +++++++++++++ drivers/net/pfe/pfe_hif.c | 360 +++++++++++++++++++++++++++++++++- drivers/net/pfe/pfe_hif.h | 8 + drivers/net/pfe/pfe_hif_lib.c | 146 ++++++++++++++ drivers/net/pfe/pfe_hif_lib.h | 8 + drivers/net/pfe/pfe_mod.h | 2 + 6 files changed, 663 insertions(+), 1 deletion(-)
drivers/net/pfe/pfe_ethdev.c +140 -0
@@ -2,6 +2,7 @@* Copyright 2019 NXP */ +#include <sys/epoll.h> #include <rte_kvargs.h> #include <rte_ethdev_vdev.h> #include <rte_bus_vdev.h>
@@ -137,6 +138,119 @@ pfe_eth_event_handler(void *data, int event, __rte_unused int qno)return 0 ; } +static uint16_t +pfe_recv_pkts_on_intr (void *rxq,struct rte_mbuf **rx_pkts,uint16_t nb_pkts) +{ +struct hif_client_rx_queue *queue = rxq; +struct pfe_eth_priv_s *priv = queue->priv; +struct epoll_event epoll_ev; +uint64_t ticks =1 ;/* 1 msec */ +int ret; +int have_something, work_done; + +#define RESET_STATUS (HIF_INT | HIF_RXPKT_INT) + +/*TODO can we remove this cleanup from here?*/ +pfe_tx_do_cleanup (priv->pfe); + have_something =pfe_hif_rx_process (priv->pfe, nb_pkts); + work_done =hif_lib_receive_pkt (rxq, priv->pfe->hif.shm->pool, + rx_pkts, nb_pkts); + +if (!have_something || !work_done) { +writel (RESET_STATUS ,HIF_INT_SRC ); +writel (readl (HIF_INT_ENABLE ) |HIF_RXPKT_INT ,HIF_INT_ENABLE ); + ret =epoll_wait (priv->pfe->hif.epoll_fd, &epoll_ev,1 , ticks); +if (ret <0 && errno !=EINTR ) +PFE_PMD_ERR ("epoll_wait fails with %d\n" , errno); + } + +return work_done; +} + +static uint16_t +pfe_recv_pkts (void *rxq,struct rte_mbuf **rx_pkts,uint16_t nb_pkts) +{ +struct hif_client_rx_queue *queue = rxq; +struct pfe_eth_priv_s *priv = queue->priv; +struct rte_mempool *pool; + +/*TODO can we remove this cleanup from here?*/ +pfe_tx_do_cleanup (priv->pfe); +pfe_hif_rx_process (priv->pfe, nb_pkts); + pool = priv->pfe->hif.shm->pool; + +return hif_lib_receive_pkt (rxq, pool, rx_pkts, nb_pkts); +} + +static uint16_t +pfe_xmit_pkts (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts) +{ +struct hif_client_tx_queue *queue = tx_queue; +struct pfe_eth_priv_s *priv = queue->priv; +struct rte_eth_stats *stats = &priv->stats; +int i; + +for (i =0 ; i < nb_pkts; i++) { +if (tx_pkts[i]->nb_segs >1 ) { +struct rte_mbuf *mbuf; +int j; + +hif_lib_xmit_pkt (&priv->client, queue->queue_id, + (void *)(size_t )rte_pktmbuf_iova (tx_pkts[i]), + tx_pkts[i]->buf_addr + tx_pkts[i]->data_off, + tx_pkts[i]->data_len,0x0 ,HIF_FIRST_BUFFER , + tx_pkts[i]); + + mbuf = tx_pkts[i]->next; +for (j =0 ; j < (tx_pkts[i]->nb_segs -2 ); j++) { +hif_lib_xmit_pkt (&priv->client, queue->queue_id, + (void *)(size_t )rte_pktmbuf_iova (mbuf), + mbuf->buf_addr + mbuf->data_off, + mbuf->data_len, +0x0 ,0x0 , mbuf); + mbuf = mbuf->next; + } + +hif_lib_xmit_pkt (&priv->client, queue->queue_id, + (void *)(size_t )rte_pktmbuf_iova (mbuf), + mbuf->buf_addr + mbuf->data_off, + mbuf->data_len, +0x0 ,HIF_LAST_BUFFER |HIF_DATA_VALID , + mbuf); + }else { +hif_lib_xmit_pkt (&priv->client, queue->queue_id, + (void *)(size_t )rte_pktmbuf_iova (tx_pkts[i]), + tx_pkts[i]->buf_addr + tx_pkts[i]->data_off, + tx_pkts[i]->pkt_len,0 /*ctrl*/ , +HIF_FIRST_BUFFER |HIF_LAST_BUFFER | +HIF_DATA_VALID , + tx_pkts[i]); + } + stats->obytes += tx_pkts[i]->pkt_len; +hif_tx_dma_start (); + } + stats->opackets += nb_pkts; +pfe_tx_do_cleanup (priv->pfe); + +return nb_pkts; +} + +static uint16_t +pfe_dummy_xmit_pkts(__rte_unused void *tx_queue, + __rte_unused struct rte_mbuf **tx_pkts, + __rte_unused uint16_t nb_pkts) +{ +return 0 ; +} + +static uint16_t +pfe_dummy_recv_pkts(__rte_unused void *rxq, + __rte_unused struct rte_mbuf **rx_pkts, + __rte_unused uint16_t nb_pkts) +{ +return 0 ; +} +static int pfe_eth_open (struct rte_eth_dev *dev) {
@@ -174,6 +288,21 @@ pfe_eth_open(struct rte_eth_dev *dev) " failed", client->id); goto err0; } + }else { +/* Freeing the packets if already exists */ +int ret =0 ; +struct rte_mbuf *rx_pkts[32 ]; +/* TODO multiqueue support */ + ret =hif_lib_receive_pkt (&client->rx_q[0 ], + hif_shm->pool, rx_pkts,32 ); +while (ret) { +int i; +for (i =0 ; i < ret; i++) +rte_pktmbuf_free (rx_pkts[i]); + ret =hif_lib_receive_pkt (&client->rx_q[0 ], + hif_shm->pool, + rx_pkts,32 ); + } } }else {/* Register client driver with HIF */
@@ -197,6 +326,14 @@ pfe_eth_open(struct rte_eth_dev *dev) } } rc =pfe_eth_start (priv); + dev->rx_pkt_burst = &pfe_recv_pkts; + dev->tx_pkt_burst = &pfe_xmit_pkts; +/* If no prefetch is configured. */ +if (getenv ("PFE_INTR_SUPPORT" )) { + dev->rx_pkt_burst = &pfe_recv_pkts_on_intr; +PFE_PMD_INFO ("PFE INTERRUPT Mode enabled" ); + } + err0:return rc;
@@ -243,6 +380,9 @@ pfe_eth_stop(struct rte_eth_dev *dev/*, int wake*/)gemac_disable (priv->EMAC_baseaddr);gpi_disable (priv->GPI_baseaddr); + + dev->rx_pkt_burst = &pfe_dummy_recv_pkts; + dev->tx_pkt_burst = &pfe_dummy_xmit_pkts; } static void
drivers/net/pfe/pfe_hif.c +359 -1
380 lines not on this page · raw message
drivers/net/pfe/pfe_hif.h +8 -0
@@ -138,11 +138,19 @@ struct pfe_hif {struct rte_device *dev; }; +void hif_xmit_pkt (struct pfe_hif *hif,unsigned int client_id,unsigned int + q_no,void *data,u32 len,unsigned int flags);void hif_process_client_req (struct pfe_hif *hif,int req,int data1,int data2);int pfe_hif_init (struct pfe *pfe);void pfe_hif_exit (struct pfe *pfe);void pfe_hif_rx_idle (struct pfe_hif *hif); +int pfe_hif_rx_process (struct pfe *pfe,int budget);int pfe_hif_init_buffers (struct pfe_hif *hif); +void pfe_tx_do_cleanup (struct pfe *pfe); + +#define __memcpy8 (dst, src) memcpy(dst, src, 8) +#define __memcpy12 (dst, src) memcpy(dst, src, 12) +#define __memcpy (dst, src, len) memcpy(dst, src, len)#endif /* _PFE_HIF_H_ */
drivers/net/pfe/pfe_hif_lib.c +146 -0
152 lines not on this page · raw message
drivers/net/pfe/pfe_hif_lib.h +8 -0
@@ -162,6 +162,9 @@ int pfe_hif_lib_init(struct pfe *pfe);void pfe_hif_lib_exit (struct pfe *pfe);int hif_lib_client_register (struct hif_client_s *client);int hif_lib_client_unregister (struct hif_client_s *client); +void hif_lib_xmit_pkt (struct hif_client_s *client,unsigned int qno, +void *data,void *data1,unsigned int len, +u32 client_ctrl,unsigned int flags,void *client_data);void hif_lib_indicate_client (struct hif_client_s *client,int event,int data);int hif_lib_event_handler_start (struct hif_client_s *client,int event,int data);
@@ -170,4 +173,9 @@ void *hif_lib_tx_get_next_complete(struct hif_client_s *client, int qno,int pfe_hif_shm_init (struct hif_shm *hif_shm,struct rte_mempool *mb_pool);void pfe_hif_shm_clean (struct hif_shm *hif_shm); +int hif_lib_receive_pkt (struct hif_client_rx_queue *queue, +struct rte_mempool *pool, +struct rte_mbuf **rx_pkts, +uint16_t nb_pkts); +#endif /* _PFE_HIF_LIB_H_ */
drivers/net/pfe/pfe_mod.h +2 -0
@@ -7,6 +7,8 @@struct pfe ; +#include <rte_ethdev.h> +#include "pfe.h" #include "pfe_hif.h" #include "pfe_hif_lib.h"
Signature · 1 line
2.17.1
PATCH v4 10/14 net/pfe: add supported packet types and basic statistics
In reply to Gagandeep SinghThis patch add support for supported packet types by the platform andbasic statistics like numbers of packets/bytes receive and transmit.
--- doc/guides/nics/features/pfe.ini | 2 ++ doc/guides/nics/pfe.rst | 2 ++ drivers/net/pfe/pfe_ethdev.c | 43 ++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+)
doc/guides/nics/features/pfe.ini +2 -0
@@ -6,6 +6,8 @@ [Features] L3 checksum offload = Y L4 checksum offload = Y +Packet type parsing = Y +Basic stats = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/pfe.rst +2 -0
@@ -94,6 +94,8 @@ PFE Features ~~~~~~~~~~~~ - L3/L4 checksum offload +- Packet type parsing +- Basic stats - ARMv8 Supported PFE SoCs
drivers/net/pfe/pfe_ethdev.c +43 -0
55 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v4 11/14 net/pfe: add MTU and MAC address set operations
In reply to Gagandeep SinghTo update MAC address or MTU, operations are added to the driver.
--- doc/guides/nics/features/pfe.ini | 1 + doc/guides/nics/pfe.rst | 1 + drivers/net/pfe/pfe_ethdev.c | 71 +++++++++++++++++++++++++++++++- 3 files changed, 71 insertions(+), 2 deletions(-)
doc/guides/nics/features/pfe.ini +1 -0
@@ -8,6 +8,7 @@ L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y Basic stats = Y +MTU update = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/pfe.rst +1 -0
@@ -96,6 +96,7 @@ PFE Features - L3/L4 checksum offload - Packet type parsing - Basic stats +- MTU update - ARMv8 Supported PFE SoCs
drivers/net/pfe/pfe_ethdev.c +69 -2
111 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v4 12/14 net/pfe: add allmulticast and promiscuous
In reply to Gagandeep SinghThis patch adds support to enable multicast and
promiscuous mode.
--- doc/guides/nics/features/pfe.ini | 2 ++ doc/guides/nics/pfe.rst | 2 ++ drivers/net/pfe/pfe_ethdev.c | 42 ++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+)
doc/guides/nics/features/pfe.ini +2 -0
@@ -9,6 +9,8 @@ L4 checksum offload = Y Packet type parsing = Y Basic stats = Y MTU update = Y +Promiscuous mode = Y +Allmulticast mode = Y Linux VFIO = Y ARMv8 = Y Usage doc = Y
doc/guides/nics/pfe.rst +2 -0
@@ -97,6 +97,8 @@ PFE Features - Packet type parsing - Basic stats - MTU update +- Promiscuous mode +- Allmulticast mode - ARMv8 Supported PFE SoCs
drivers/net/pfe/pfe_ethdev.c +42 -0
54 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v4 13/14 net/pfe: add link status update
In reply to Gagandeep SinghThis patch add link related operations like link update, up and down.
--- doc/guides/nics/features/pfe.ini | 1 + doc/guides/nics/pfe.rst | 1 + drivers/net/pfe/pfe_ethdev.c | 105 +++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+)
doc/guides/nics/features/pfe.ini +1 -0
@@ -4,6 +4,7 @@ ; Refer to default.ini for the full list of available PMD features. ; [Features] +Link status = Y L3 checksum offload = Y L4 checksum offload = Y Packet type parsing = Y
doc/guides/nics/pfe.rst +1 -0
@@ -99,6 +99,7 @@ PFE Features - MTU update - Promiscuous mode - Allmulticast mode +- Link status - ARMv8 Supported PFE SoCs
drivers/net/pfe/pfe_ethdev.c +105 -0
132 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v4 14/14 doc: add NXP PFE PMD in release notes
In reply to Gagandeep SinghUpdate release notes for NXP PFE driver supported for 19.11.
--- doc/guides/rel_notes/release_19_11.rst | 5 +++++ 1 file changed, 5 insertions(+)
doc/guides/rel_notes/release_19_11.rst +5 -0
@@ -93,6 +93,11 @@ New Features gives ability to print port supported ptypes in different protocol layers. +* **Added NXP PFE PMD.** + + Added the new PFE driver for the NXP LS1012A platform. See the + :doc:`../nics/pfe` NIC driver guide for more details on this new driver. + Removed Items -------------
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v4 00/14] introduces pfe network PMD
In reply to Gagandeep Singh10/10/2019 08:32, Gagandeep Singh:
Quoted 6 lines
Gagandeep Singh (13):
net/pfe: introduce pfe net poll mode driver
doc: add guide for pfe net PMD
net/pfe: support dynamic logging
net/pfe: add HW specific macros and operations net/pfe: add MAC and host interface initialisation
Quoted 8 lines
net/pfe: add device start stop operations net/pfe: add queue setup and release operations net/pfe: add burst enqueue and dequeue operations net/pfe: add supported packet types and basic statistics net/pfe: add MTU and MAC address set operations net/pfe: add allmulticast and promiscuous net/pfe: add link status update
doc: add NXP PFE PMD in release notes
Patches introducing the doc and release notes can be squashed in the patch introducing the driver.
Re: [dpdk-dev] [PATCH v4 00/14] introduces pfe network PMD
Quoted 16 lines · Thomas Monjalon
10/10/2019 08:32, Gagandeep Singh:
Quoted 6 lines
Gagandeep Singh (13):
net/pfe: introduce pfe net poll mode driver
doc: add guide for pfe net PMD
net/pfe: support dynamic logging
net/pfe: add HW specific macros and operations net/pfe: add MAC and host interface initialisationQuoted 8 lines
net/pfe: add device start stop operations net/pfe: add queue setup and release operations net/pfe: add burst enqueue and dequeue operations net/pfe: add supported packet types and basic statistics net/pfe: add MTU and MAC address set operations net/pfe: add allmulticast and promiscuous net/pfe: add link status update
doc: add NXP PFE PMD in release notes
Quoted 2 lines
Patches introducing the doc and release notes can be squashed in the patch introducing the driver.
+1, I will do while merging.
Re: [dpdk-dev] [PATCH v4 00/14] introduces pfe network PMD
In reply to Gagandeep SinghQuoted 55 lines · Gagandeep Singh
This series introduces pfe (packet forwarding engine) network poll mode driver for NXP SoC ls1012a.
First patch of this series move OF library code from dpaa bus to a common folder as PFE also uses the same library for getting information from the device tree.
This patch is included in this series so that compilation by CI don't break.V2 Change-log:
* fix compilation break for clang3.4 and gcc 4.8
* fix checkpatch errorsV3 Change-log:
* Release notes updated for PPFE PMD
* Experimental APIs list added inMakefileand meson
* Dynamic logging added
* PPFE documentation is updated for kernel module "pfe.ko" and parameter "intf" is mentioned.
*of.handof.care renamed todpaa_of.handdpaa_of.c
* enable PPFE compilation only in 'common_armv8a_linux'
*PFE_CDEV_ETH_COUNTupdated 2, as only 2 eth devices supported.
* Comment updated for "pfe_us_cdev" device
* functions prototype updated
* intf params value check added during parsing and unwanted port id checks removed.
* unwanteddev->datamemcpy removed.
* munmap andrte_eth_dev_release_portadded in error case
* atoi replaced with strtol
* add static to global variableg_pfeV4 Change-log:
* DPAA dependency removed by movingcompat.hfrom bus/dpaa/include to common/dpaax
* Updated interface name tonet_pfein document
* Updated driver name to PFE from PPFE everywhere for consistency
*min_mtuandmax_mtuaddedGagandeep Singh (13):
net/pfe: introduce pfe net poll mode driver
doc: add guide for pfe net PMD
net/pfe: support dynamic logging
net/pfe: add HW specific macros and operations net/pfe: add MAC and host interface initialisation net/pfe: add device start stop operations net/pfe: add queue setup and release operations net/pfe: add burst enqueue and dequeue operations net/pfe: add supported packet types and basic statistics net/pfe: add MTU and MAC address set operations net/pfe: add allmulticast and promiscuous net/pfe: add link status update
doc: add NXP PFE PMD in release notes
Quoted 2 lines
Hemant Agrawal (1):
common/dpaax: moving OF lib code from dpaa bus
Series applied to dpdk-next-net/master, thanks.
Please add web patch to announce the new PMD.
Re: [dpdk-dev] [PATCH v4 00/14] introduces pfe network PMD
10/10/2019 19:47, Ferruh Yigit:
Quoted 16 lines · Gagandeep Singh
Quoted 15 lines
Gagandeep Singh (13):
net/pfe: introduce pfe net poll mode driver
doc: add guide for pfe net PMD
net/pfe: support dynamic logging
net/pfe: add HW specific macros and operations net/pfe: add MAC and host interface initialisation net/pfe: add device start stop operations net/pfe: add queue setup and release operations net/pfe: add burst enqueue and dequeue operations net/pfe: add supported packet types and basic statistics net/pfe: add MTU and MAC address set operations net/pfe: add allmulticast and promiscuous net/pfe: add link status update
doc: add NXP PFE PMD in release notes
Quoted 4 lines
Quoted 2 lines
Hemant Agrawal (1):
common/dpaax: moving OF lib code from dpaa busSeries applied to dpdk-next-net/master, thanks.
While rebasing on top of master, I had to do some changes to the meson files in following commits:
common/dpaax: moving OF lib code from dpaa bus net/pfe: add MAC and host interface initialisation
--- a/drivers/common/dpaax/meson.build
+++ b/drivers/common/dpaax/meson.build
+if cc.has_argument('-Wno-pointer-arith')
+ cflags += '-Wno-pointer-arith'
+ endif
--- a/drivers/crypto/caam_jr/meson.build
+++ b/drivers/crypto/caam_jr/meson.build
includes += include_directories('../../bus/dpaa/include/')
+includes += include_directories('../../common/dpaax/')
includes += include_directories('../../common/dpaax/caamflib/')
--- a/drivers/crypto/dpaa_sec/meson.build
+++ b/drivers/crypto/dpaa_sec/meson.build
includes += include_directories('../../bus/dpaa/include')
+includes += include_directories('../../common/dpaax')
includes += include_directories('../../common/dpaax/caamflib/')
--- a/drivers/net/pfe/meson.build
+++ b/drivers/net/pfe/meson.build
+if cc.has_argument('-Wno-pointer-arith')
+ cflags += '-Wno-pointer-arith'
+endif
2 notes:
- You should fix your pointer arithmetics instead of disabling warnings
- Having 3 compat.h files in fslmc and dpaax is an horror for includes