net/ark: PMD for Atomic Rules Arkville driver stub
PATCH v4 1/7 net/ark: PMD for Atomic Rules Arkville driver stub
Enable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this time
v4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-biones dev init to avoid compiler warnings
v3:
* Split large patch into several smaller ones
--- MAINTAINERS | 8 + config/common_base | 10 + config/defconfig_arm-armv7a-linuxapp-gcc | 1 + config/defconfig_ppc_64-power8-linuxapp-gcc | 1 + doc/guides/nics/ark.rst | 242 +++++++++++++++++++++ doc/guides/nics/features/ark.ini | 15 ++ doc/guides/nics/index.rst | 1 + drivers/net/Makefile | 1 + drivers/net/ark/Makefile | 62 ++++++ drivers/net/ark/ark_debug.h | 71 +++++++ drivers/net/ark/ark_ethdev.c | 316 ++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev.h | 39 ++++ drivers/net/ark/ark_global.h | 108 ++++++++++ drivers/net/ark/rte_pmd_ark_version.map | 4 + mk/rte.app.mk | 1 + 15 files changed, 880 insertions(+) create mode 100644 doc/guides/nics/ark.rst create mode 100644 doc/guides/nics/features/ark.ini create mode 100644 drivers/net/ark/Makefile create mode 100644 drivers/net/ark/ark_debug.h create mode 100644 drivers/net/ark/ark_ethdev.c create mode 100644 drivers/net/ark/ark_ethdev.h create mode 100644 drivers/net/ark/ark_global.h create mode 100644 drivers/net/ark/rte_pmd_ark_version.map
MAINTAINERS +8 -0
@@ -278,6 +278,14 @@ M: Evgeny Schemeilin <[email protected]> F: drivers/net/ena/ F: doc/guides/nics/ena.rst +Atomic Rules ARK +M: Shepard Siegel <[email protected]> +M: Ed Czeck <[email protected]> +M: John Miller <[email protected]> +F: drivers/net/ark/ +F: doc/guides/nics/ark.rst +F: doc/guides/nics/features/ark.ini + Broadcom bnxt M: Stephen Hurd <[email protected]> M: Ajit Khaparde <[email protected]>
config/common_base +10 -0
@@ -353,6 +353,16 @@ CONFIG_RTE_LIBRTE_QEDE_FW="" CONFIG_RTE_LIBRTE_PMD_AF_PACKET=n # +# Compile ARK PMD +# +CONFIG_RTE_LIBRTE_ARK_PMD=y +CONFIG_RTE_LIBRTE_ARK_PAD_TX=y +CONFIG_RTE_LIBRTE_ARK_DEBUG_RX=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_TX=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE=n + +# # Compile the TAP PMD # It is enabled by default for Linux only. #
config/defconfig_arm-armv7a-linuxapp-gcc +1 -0
@@ -61,6 +61,7 @@ CONFIG_RTE_SCHED_VECTOR=n # cannot use those on ARM CONFIG_RTE_KNI_KMOD=n +CONFIG_RTE_LIBRTE_ARK_PMD=n CONFIG_RTE_LIBRTE_EM_PMD=n CONFIG_RTE_LIBRTE_IGB_PMD=n CONFIG_RTE_LIBRTE_CXGBE_PMD=n
config/defconfig_ppc_64-power8-linuxapp-gcc +1 -0
@@ -48,6 +48,7 @@ CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=n # Note: Initially, all of the PMD drivers compilation are turned off on Power # Will turn on them only after the successful testing on Power +CONFIG_RTE_LIBRTE_ARK_PMD=n CONFIG_RTE_LIBRTE_IXGBE_PMD=n CONFIG_RTE_LIBRTE_I40E_PMD=n CONFIG_RTE_LIBRTE_VIRTIO_PMD=y
doc/guides/nics/ark.rst new file +242 -0
242 lines not on this page · raw message
doc/guides/nics/features/ark.ini new file +15 -0
@@ -0,0 +1,15 @@ +; +; Supported features of the 'ark' poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Queue start/stop = Y +Jumbo frame = Y +Scattered Rx = Y +Basic stats = Y +Stats per queue = Y +FW version = Y +Linux UIO = Y +x86-64 = Y +Usage doc = Y
doc/guides/nics/index.rst +1 -0
@@ -36,6 +36,7 @@ Network Interface Controller Drivers :numbered: overview + ark bnx2x bnxt cxgbe
drivers/net/Makefile +1 -0
@@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet +DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark DIRS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += bonding DIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe
drivers/net/ark/Makefile new file +62 -0
62 lines not on this page · raw message
drivers/net/ark/ark_debug.h new file +71 -0
71 lines not on this page · raw message
drivers/net/ark/ark_ethdev.c new file +316 -0
316 lines not on this page · raw message
drivers/net/ark/ark_ethdev.h new file +39 -0
@@ -0,0 +1,39 @@ +/*- +* BSD LICENSE +* +* Copyright (c) 2015-2017 Atomic Rules LLC +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of copyright holder nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _ARK_ETHDEV_H_ +#define _ARK_ETHDEV_H_ + +/* STUB */ + +#endif
drivers/net/ark/ark_global.h new file +108 -0
108 lines not on this page · raw message
drivers/net/ark/rte_pmd_ark_version.map new file +4 -0
@@ -0,0 +1,4 @@ +DPDK_2.0 { + local: *; + +};
mk/rte.app.mk +1 -0
@@ -104,6 +104,7 @@ ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) # plugins (link only if static libraries) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet +_LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += -lrte_pmd_ark _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz _LDLIBS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += -lrte_pmd_bnxt _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond
Signature · 1 line
1.9.1
PATCH v4 2/7 net/ark: HW API part 1 of 3
Provide C-level interface for Arkville's internal HW resources mpu, pktdir, and rqp modules
--- drivers/net/ark/Makefile | 4 + drivers/net/ark/ark_mpu.c | 181 +++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_mpu.h | 143 ++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktdir.c | 83 ++++++++++++++++++++ drivers/net/ark/ark_pktdir.h | 68 ++++++++++++++++ drivers/net/ark/ark_rqp.c | 91 ++++++++++++++++++++++ drivers/net/ark/ark_rqp.h | 75 ++++++++++++++++++ 7 files changed, 645 insertions(+) create mode 100644 drivers/net/ark/ark_mpu.c create mode 100644 drivers/net/ark/ark_mpu.h create mode 100644 drivers/net/ark/ark_pktdir.c create mode 100644 drivers/net/ark/ark_pktdir.h create mode 100644 drivers/net/ark/ark_rqp.c create mode 100644 drivers/net/ark/ark_rqp.h
drivers/net/ark/Makefile +4 -0
@@ -46,7 +46,11 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # + SRCS-y += ark_ethdev.c +SRCS-y += ark_pktdir.c +SRCS-y += ark_mpu.c +SRCS-y += ark_rqp.c # this lib depends upon:
drivers/net/ark/ark_mpu.c new file +181 -0
181 lines not on this page · raw message
drivers/net/ark/ark_mpu.h new file +143 -0
143 lines not on this page · raw message
drivers/net/ark/ark_pktdir.c new file +83 -0
83 lines not on this page · raw message
drivers/net/ark/ark_pktdir.h new file +68 -0
68 lines not on this page · raw message
drivers/net/ark/ark_rqp.c new file +91 -0
91 lines not on this page · raw message
drivers/net/ark/ark_rqp.h new file +75 -0
75 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v4 3/7 net/ark: HW API part 2 of 3
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources ddm and udm modules
--- drivers/net/ark/Makefile | 3 +- drivers/net/ark/ark_ddm.c | 151 +++++++++++++++++++++++++++++++ drivers/net/ark/ark_ddm.h | 154 +++++++++++++++++++++++++++++++ drivers/net/ark/ark_udm.c | 226 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_udm.h | 184 +++++++++++++++++++++++++++++++++++++ 5 files changed, 717 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ark/ark_ddm.c create mode 100644 drivers/net/ark/ark_ddm.h create mode 100644 drivers/net/ark/ark_udm.c create mode 100644 drivers/net/ark/ark_udm.h
drivers/net/ark/Makefile +2 -1
@@ -50,9 +50,10 @@ LIBABIVER := 1 SRCS-y += ark_ethdev.c SRCS-y += ark_pktdir.c SRCS-y += ark_mpu.c +SRCS-y += ark_ddm.c +SRCS-y += ark_udm.c SRCS-y += ark_rqp.c - # this lib depends upon: DEPDIRS-y += lib/librte_mbuf DEPDIRS-y += lib/librte_ether
drivers/net/ark/ark_ddm.c new file +151 -0
151 lines not on this page · raw message
drivers/net/ark/ark_ddm.h new file +154 -0
154 lines not on this page · raw message
drivers/net/ark/ark_udm.c new file +226 -0
226 lines not on this page · raw message
drivers/net/ark/ark_udm.h new file +184 -0
184 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v4 4/7 net/ark: HW API part 3 of 3
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources pktgen and pktchk modules
--- drivers/net/ark/Makefile | 3 +- drivers/net/ark/ark_pktchkr.c | 472 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktchkr.h | 114 ++++++++++ drivers/net/ark/ark_pktgen.c | 491 ++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktgen.h | 106 +++++++++ 5 files changed, 1185 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ark/ark_pktchkr.c create mode 100644 drivers/net/ark/ark_pktchkr.h create mode 100644 drivers/net/ark/ark_pktgen.c create mode 100644 drivers/net/ark/ark_pktgen.h
drivers/net/ark/Makefile +2 -1
@@ -46,8 +46,9 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # - SRCS-y += ark_ethdev.c +SRCS-y += ark_pktgen.c +SRCS-y += ark_pktchkr.c SRCS-y += ark_pktdir.c SRCS-y += ark_mpu.c SRCS-y += ark_ddm.c
drivers/net/ark/ark_pktchkr.c new file +472 -0
472 lines not on this page · raw message
drivers/net/ark/ark_pktchkr.h new file +114 -0
114 lines not on this page · raw message
drivers/net/ark/ark_pktgen.c new file +491 -0
491 lines not on this page · raw message
drivers/net/ark/ark_pktgen.h new file +106 -0
106 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v4 5/7 net/ark: Packet TX support initial version
In reply to Ed Czeck* Core TX packet moving functions
* Flesh out ark_adapter struct to support TX code
(not all fields used at this patch
--- drivers/net/ark/Makefile | 1 + drivers/net/ark/ark_ethdev.c | 15 ++ drivers/net/ark/ark_ethdev.h | 2 +- drivers/net/ark/ark_ethdev_tx.c | 507 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev_tx.h | 62 +++++ drivers/net/ark/ark_global.h | 28 +++ 6 files changed, 614 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ark/ark_ethdev_tx.c create mode 100644 drivers/net/ark/ark_ethdev_tx.h
drivers/net/ark/Makefile +1 -0
@@ -47,6 +47,7 @@ LIBABIVER := 1 # all source are stored in SRCS-y # SRCS-y += ark_ethdev.c +SRCS-y += ark_ethdev_tx.c SRCS-y += ark_pktgen.c SRCS-y += ark_pktchkr.c SRCS-y += ark_pktdir.c
drivers/net/ark/ark_ethdev.c +15 -0
@@ -114,6 +114,21 @@ static void eth_ark_dev_info_get(struct rte_eth_dev *dev, .dev_infos_get = eth_ark_dev_info_get, }; +int +ark_get_port_id (struct rte_eth_dev *dev,struct ark_adapter *ark) +{ +int n = ark->num_ports; +int i; + +/* There has to be a smarter way to do this ... */ +for (i =0 ; i < n; i++) { +if (ark->port[i].eth_dev == dev) +return i; + } +ARK_DEBUG_TRACE ("ARK: Device is NOT associated with a port !!" ); +return -1 ; +} +static int eth_ark_dev_init(struct rte_eth_dev *dev __rte_unused) {
drivers/net/ark/ark_ethdev.h +1 -1
@@ -34,6 +34,6 @@#ifndef _ARK_ETHDEV_H_#define _ARK_ETHDEV_H_ -/* STUB */ +int ark_get_port_id (struct rte_eth_dev *dev,struct ark_adapter *ark);#endif
drivers/net/ark/ark_ethdev_tx.c new file +507 -0
507 lines not on this page · raw message
drivers/net/ark/ark_ethdev_tx.h new file +62 -0
62 lines not on this page · raw message
drivers/net/ark/ark_global.h +28 -0
@@ -47,6 +47,10 @@#include <rte_dev.h> #include <rte_version.h> +#include "ark_pktdir.h" +#include "ark_pktgen.h" +#include "ark_pktchkr.h" +#define ETH_ARK_ARG_MAXLEN 64#define ARK_SYSCTRL_BASE 0x0#define ARK_PKTGEN_BASE 0x10000
@@ -88,6 +92,12 @@ struct ark_adapter {/* User extension private data */ void *user_data; +/* Pointers to packet generator and checker */ +int start_pg; +ark_pkt_gen_t pg; +ark_pkt_chkr_t pc; +ark_pkt_dir_t pd; +struct ark_port port[ARK_MAX_PORTS ];int num_ports;
@@ -101,6 +111,24 @@ struct ark_adapter {/* Application Bar */ uint8_t *a_bar; + +/* Arkville demo block offsets */ +def_ptr (sys_ctrl, sysctrl); +def_ptr (pkt_gen, pktgen); +def_ptr (mpu_rx, mpurx); +def_ptr (UDM , udm); +def_ptr (mpu_tx, mputx); +def_ptr (DDM , ddm); +def_ptr (CMAC , cmac); +def_ptr (external, external); +def_ptr (pkt_dir, pktdir); +def_ptr (pkt_chkr, pktchkr); + +int started; +uint16_t rx_queues; +uint16_t tx_queues; + +struct ark_rqpace_t *rqpacing; };typedef uint32_t *ark_t ;
Signature · 1 line
1.9.1
PATCH v4 6/7 net/ark: Packet RX support initial version
In reply to Ed Czeck* Core RX packet moving functions
--- drivers/net/ark/Makefile | 1 + drivers/net/ark/ark_ethdev_rx.c | 681 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev_rx.h | 67 ++++ 3 files changed, 749 insertions(+) create mode 100644 drivers/net/ark/ark_ethdev_rx.c create mode 100644 drivers/net/ark/ark_ethdev_rx.h
drivers/net/ark/Makefile +1 -0
@@ -47,6 +47,7 @@ LIBABIVER := 1 # all source are stored in SRCS-y # SRCS-y += ark_ethdev.c +SRCS-y += ark_ethdev_rx.c SRCS-y += ark_ethdev_tx.c SRCS-y += ark_pktgen.c SRCS-y += ark_pktchkr.c
drivers/net/ark/ark_ethdev_rx.c new file +681 -0
681 lines not on this page · raw message
drivers/net/ark/ark_ethdev_rx.h new file +67 -0
67 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v4 7/7 net/ark: Arkville PMD component integration
In reply to Ed Czeck* Flesh out device configuration
* Add links dev_ops
* allow dynamic extension loading
--- drivers/net/ark/ark_ethdev.c | 712 ++++++++++++++++++++++++++++++++++++++++++- drivers/net/ark/ark_ext.h | 79 +++++ drivers/net/ark/ark_global.h | 23 ++ 3 files changed, 813 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ark/ark_ext.h
drivers/net/ark/ark_ethdev.c +711 -1
@@ -41,14 +41,42 @@#include "ark_global.h" #include "ark_debug.h" #include "ark_ethdev.h" +#include "ark_ethdev_tx.h" +#include "ark_ethdev_rx.h" +#include "ark_mpu.h" +#include "ark_ddm.h" +#include "ark_udm.h" +#include "ark_rqp.h" +#include "ark_pktdir.h" +#include "ark_pktgen.h" +#include "ark_pktchkr.h" /* Internal prototypes */ static int eth_ark_check_args (const char *params);static int eth_ark_dev_init (struct rte_eth_dev *dev); +static int ark_config_device (struct rte_eth_dev *dev);static int eth_ark_dev_uninit (struct rte_eth_dev *eth_dev);static int eth_ark_dev_configure (struct rte_eth_dev *dev); +static int eth_ark_dev_start (struct rte_eth_dev *dev); +static void eth_ark_dev_stop (struct rte_eth_dev *dev); +static void eth_ark_dev_close (struct rte_eth_dev *dev);static void eth_ark_dev_info_get (struct rte_eth_dev *dev,struct rte_eth_dev_info *dev_info); +static int eth_ark_dev_link_update (struct rte_eth_dev *dev, +int wait_to_complete); +static int eth_ark_dev_set_link_up (struct rte_eth_dev *dev); +static int eth_ark_dev_set_link_down (struct rte_eth_dev *dev); +static void eth_ark_dev_stats_get (struct rte_eth_dev *dev, +struct rte_eth_stats *stats); +static void eth_ark_dev_stats_reset (struct rte_eth_dev *dev); +static void eth_ark_set_default_mac_addr (struct rte_eth_dev *dev, +struct ether_addr *mac_addr); +static void eth_ark_macaddr_add (struct rte_eth_dev *dev, +struct ether_addr *mac_addr, +uint32_t index, +uint32_t pool); +static void eth_ark_macaddr_remove (struct rte_eth_dev *dev, +uint32_t index);#define ARK_DEV_TO_PCI (eth_dev) \ RTE_DEV_TO_PCI((eth_dev)->device)
@@ -111,7 +139,32 @@ static void eth_ark_dev_info_get(struct rte_eth_dev *dev,static const struct eth_dev_ops ark_eth_dev_ops = { .dev_configure = eth_ark_dev_configure, + .dev_start = eth_ark_dev_start, + .dev_stop = eth_ark_dev_stop, + .dev_close = eth_ark_dev_close, + .dev_infos_get = eth_ark_dev_info_get, + + .rx_queue_setup = eth_ark_dev_rx_queue_setup, + .rx_queue_count = eth_ark_dev_rx_queue_count, + .tx_queue_setup = eth_ark_tx_queue_setup, + + .link_update = eth_ark_dev_link_update, + .dev_set_link_up = eth_ark_dev_set_link_up, + .dev_set_link_down = eth_ark_dev_set_link_down, + + .rx_queue_start = eth_ark_rx_start_queue, + .rx_queue_stop = eth_ark_rx_stop_queue, + + .tx_queue_start = eth_ark_tx_queue_start, + .tx_queue_stop = eth_ark_tx_queue_stop, + + .stats_get = eth_ark_dev_stats_get, + .stats_reset = eth_ark_dev_stats_reset, + + .mac_addr_add = eth_ark_macaddr_add, + .mac_addr_remove = eth_ark_macaddr_remove, + .mac_addr_set = eth_ark_set_default_mac_addr, };int
@@ -129,8 +182,86 @@ static void eth_ark_dev_info_get(struct rte_eth_dev *dev,return -1 ; } +static +int +check_for_ext(struct rte_eth_dev *dev __rte_unused, + struct ark_adapter *ark __rte_unused) +{ +int found =0 ; + +/* Get the env */ +const char *dllpath =getenv ("ARK_EXT_PATH" ); + +if (dllpath ==NULL ) { +ARK_DEBUG_TRACE ("ARK EXT NO dll path specified\n" ); +return 0 ; + } +ARK_DEBUG_TRACE ("ARK EXT found dll path at %s\n" , dllpath); + +/* Open and load the .so */ + ark->d_handle =dlopen (dllpath,RTLD_LOCAL |RTLD_LAZY ); +if (ark->d_handle ==NULL ) +PMD_DRV_LOG (ERR ,"Could not load user extension %s\n" , dllpath); +else +ARK_DEBUG_TRACE ("SUCCESS: loaded user extension %s\n" , dllpath); + +/* Get the entry points */ + ark->user_ext.dev_init = + (void *(*)(struct rte_eth_dev *,void *,int )) +dlsym (ark->d_handle,"dev_init" ); +ARK_DEBUG_TRACE ("device ext init pointer = %p\n" , + ark->user_ext.dev_init); + ark->user_ext.dev_get_port_count = + (int (*)(struct rte_eth_dev *,void *)) +dlsym (ark->d_handle,"dev_get_port_count" ); + ark->user_ext.dev_uninit = + (void (*)(struct rte_eth_dev *,void *)) +dlsym (ark->d_handle,"dev_uninit" ); + ark->user_ext.dev_configure = + (int (*)(struct rte_eth_dev *,void *)) +dlsym (ark->d_handle,"dev_configure" ); + ark->user_ext.dev_start = + (int (*)(struct rte_eth_dev *,void *)) +dlsym (ark->d_handle,"dev_start" ); + ark->user_ext.dev_stop = + (void (*)(struct rte_eth_dev *,void *)) +dlsym (ark->d_handle,"dev_stop" ); + ark->user_ext.dev_close = + (void (*)(struct rte_eth_dev *,void *)) +dlsym (ark->d_handle,"dev_close" ); + ark->user_ext.link_update = + (int (*)(struct rte_eth_dev *,int ,void *)) +dlsym (ark->d_handle,"link_update" ); + ark->user_ext.dev_set_link_up = + (int (*)(struct rte_eth_dev *,void *)) +dlsym (ark->d_handle,"dev_set_link_up" ); + ark->user_ext.dev_set_link_down = + (int (*)(struct rte_eth_dev *,void *)) +dlsym (ark->d_handle,"dev_set_link_down" ); + ark->user_ext.stats_get = + (void (*)(struct rte_eth_dev *,struct rte_eth_stats *, +void *)) +dlsym (ark->d_handle,"stats_get" ); + ark->user_ext.stats_reset = + (void (*)(struct rte_eth_dev *,void *)) +dlsym (ark->d_handle,"stats_reset" ); + ark->user_ext.mac_addr_add = + (void (*)(struct rte_eth_dev *,struct ether_addr *,uint32_t , +uint32_t ,void *)) +dlsym (ark->d_handle,"mac_addr_add" ); + ark->user_ext.mac_addr_remove = + (void (*)(struct rte_eth_dev *,uint32_t ,void *)) +dlsym (ark->d_handle,"mac_addr_remove" ); + ark->user_ext.mac_addr_set = + (void (*)(struct rte_eth_dev *,struct ether_addr *, +void *)) +dlsym (ark->d_handle,"mac_addr_set" ); + +return found; +} +static int -eth_ark_dev_init(struct rte_eth_dev *dev __rte_unused) +eth_ark_dev_init (struct rte_eth_dev *dev) {struct ark_adapter *ark = (struct ark_adapter *)dev->data->dev_private;
@@ -142,6 +273,8 @@ static void eth_ark_dev_info_get(struct rte_eth_dev *dev,ARK_DEBUG_TRACE ("eth_ark_dev_init(struct rte_eth_dev *dev)\n" ); gark[0 ] = ark; +/* Check to see if there is an extension that we need to load */ +check_for_ext (dev, ark); pci_dev =ARK_DEV_TO_PCI (dev);rte_eth_copy_pci_info (dev, pci_dev);
@@ -150,24 +283,265 @@ static void eth_ark_dev_info_get(struct rte_eth_dev *dev,else PMD_DRV_LOG (INFO ,"No Device args found\n" ); +/* Use dummy function until setup */ + dev->rx_pkt_burst = ð_ark_recv_pkts_noop; + dev->tx_pkt_burst = ð_ark_xmit_pkts_noop; ark->bar0 = (uint8_t *)pci_dev->mem_resource[0 ].addr; ark->a_bar = (uint8_t *)pci_dev->mem_resource[2 ].addr; + ark->sysctrl.v = (void *)&ark->bar0[ARK_SYSCTRL_BASE ]; + ark->mpurx.v = (void *)&ark->bar0[ARK_MPU_RX_BASE ]; + ark->udm.v = (void *)&ark->bar0[ARK_UDM_BASE ]; + ark->mputx.v = (void *)&ark->bar0[ARK_MPU_TX_BASE ]; + ark->ddm.v = (void *)&ark->bar0[ARK_DDM_BASE ]; + ark->cmac.v = (void *)&ark->bar0[ARK_CMAC_BASE ]; + ark->external.v = (void *)&ark->bar0[ARK_EXTERNAL_BASE ]; + ark->pktdir.v = (void *)&ark->bar0[ARK_PKTDIR_BASE ]; + ark->pktgen.v = (void *)&ark->bar0[ARK_PKTGEN_BASE ]; + ark->pktchkr.v = (void *)&ark->bar0[ARK_PKTCHKR_BASE ]; + + ark->rqpacing = + (struct ark_rqpace_t *)(ark->bar0 +ARK_RCPACING_BASE ); + ark->started =0 ; + +ARK_DEBUG_TRACE + ("Sys Ctrl Const = 0x%x HW Commit_ID: %08x\n" , + ark->sysctrl.t32[4 ], +rte_be_to_cpu_32 (ark->sysctrl.t32[0x20 /4 ])); +PMD_DRV_LOG (INFO ,"ARKP PMD HW Commit_ID: %08x\n" , +rte_be_to_cpu_32 (ark->sysctrl.t32[0x20 /4 ])); + +/* If HW sanity test fails, return an error */ +if (ark->sysctrl.t32[4 ] !=0xcafef00d ) { +PMD_DRV_LOG (ERR , +"HW Sanity test has failed, expected constant" +" 0x%x, read 0x%x (%s)\n" , +0xcafef00d , + ark->sysctrl.t32[4 ], __func__); +return -1 ; + } + +PMD_DRV_LOG (INFO , +"HW Sanity test has PASSED, expected constant" +" 0x%x, read 0x%x (%s)\n" , +0xcafef00d , ark->sysctrl.t32[4 ], __func__); + +/* We are a single function multi-port device. */ +const unsigned int numa_node =rte_socket_id (); +struct ether_addr adr; + + ret =ark_config_device (dev); dev->dev_ops = &ark_eth_dev_ops; + dev->data->mac_addrs =rte_zmalloc ("ark" ,ETHER_ADDR_LEN ,0 ); +if (!dev->data->mac_addrs) { +PMD_DRV_LOG (ERR , +"Failed to allocated memory for storing mac address" + ); + } +ether_addr_copy ((struct ether_addr *)&adr, &dev->data->mac_addrs[0 ]); + +if (ark->user_ext.dev_init) { + ark->user_data = ark->user_ext.dev_init (dev, ark->a_bar,0 ); +if (!ark->user_data) { +PMD_DRV_LOG (INFO , +"Failed to initialize PMD extension!" +" continuing without it\n" ); +memset (&ark->user_ext,0 ,sizeof (struct ark_user_ext )); +dlclose (ark->d_handle); + } + } + +/* +* We will create additional devices based on the number of requested +* ports +*/ +int pc =1 ; +int p; + +if (ark->user_ext.dev_get_port_count) { + pc = ark->user_ext.dev_get_port_count (dev, ark->user_data); + ark->num_ports = pc; + }else { + ark->num_ports =1 ; + } +for (p =0 ; p < pc; p++) { +struct ark_port *port; + + port = &ark->port[p]; +struct rte_eth_dev_data *data =NULL ; + + port->id = p; + +char name[RTE_ETH_NAME_MAX_LEN ]; + +snprintf (name,sizeof (name),"arketh%d" , + dev->data->port_id + p); + +if (p ==0 ) { +/* First port is already allocated by DPDK */ + port->eth_dev = ark->eth_dev; +continue ; + } + +/* reserve an ethdev entry */ + port->eth_dev =rte_eth_dev_allocate (name); +if (!port->eth_dev) { +PMD_DRV_LOG (ERR , +"Could not allocate eth_dev for port %d\n" , + p); + goto error; + } + + data =rte_zmalloc_socket (name,sizeof (*data),0 , numa_node); +if (!data) { +PMD_DRV_LOG (ERR , +"Could not allocate eth_dev for port %d\n" , + p); + goto error; + } + data->port_id = ark->eth_dev->data->port_id + p; + port->eth_dev->data = data; + port->eth_dev->device = &pci_dev->device; + port->eth_dev->data->dev_private = ark; + port->eth_dev->driver = ark->eth_dev->driver; + port->eth_dev->dev_ops = ark->eth_dev->dev_ops; + port->eth_dev->tx_pkt_burst = ark->eth_dev->tx_pkt_burst; + port->eth_dev->rx_pkt_burst = ark->eth_dev->rx_pkt_burst; + +rte_eth_copy_pci_info (port->eth_dev, pci_dev); + + port->eth_dev->data->mac_addrs = +rte_zmalloc (name,ETHER_ADDR_LEN ,0 ); +if (!port->eth_dev->data->mac_addrs) { +PMD_DRV_LOG (ERR , +"Memory allocation for MAC failed!" +" Exiting.\n" ); + goto error; + } +ether_addr_copy (&adr, + &port->eth_dev->data->mac_addrs[0 ]); + +if (ark->user_ext.dev_init) + ark->user_data = + ark->user_ext.dev_init (dev, ark->a_bar, p); + } +return ret; + + error: +if (dev->data->mac_addrs) +rte_free (dev->data->mac_addrs); + +for (p =0 ; p < pc; p++) { +if (ark->port[p].eth_dev->data) +rte_free (ark->port[p].eth_dev->data); +if (ark->port[p].eth_dev->data->mac_addrs) +rte_free (ark->port[p].eth_dev->data->mac_addrs); + } + +return -1 ; +} + +/* +*Initial device configuration when device is opened +* setup the DDM, and UDM +* Called once per PCIE device +*/ +static int +ark_config_device (struct rte_eth_dev *dev) +{ +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; +uint16_t num_q, i; +struct ark_mpu_t *mpu; + +/* +* Make sure that the packet director, generator and checker are in a +* known state +*/ + ark->start_pg =0 ; + ark->pg =ark_pktgen_init (ark->pktgen.v,0 ,1 ); +ark_pktgen_reset (ark->pg); + ark->pc =ark_pktchkr_init (ark->pktchkr.v,0 ,1 ); +ark_pktchkr_stop (ark->pc); + ark->pd =ark_pktdir_init (ark->pktdir.v); + +/* Verify HW */ +if (ark_udm_verify (ark->udm.v)) +return -1 ; +if (ark_ddm_verify (ark->ddm.v)) +return -1 ; + +/* UDM */ +if (ark_udm_reset (ark->udm.v)) { +PMD_DRV_LOG (ERR ,"Unable to stop and reset UDM\n" ); +return -1 ; + } +/* Keep in reset until the MPU are cleared */ + +/* MPU reset */ + mpu = ark->mpurx.v; + num_q =ark_api_num_queues (mpu); + ark->rx_queues = num_q; +for (i =0 ; i < num_q; i++) { +ark_mpu_reset (mpu); + mpu =RTE_PTR_ADD (mpu,ARK_MPU_QOFFSET ); + } + +ark_udm_stop (ark->udm.v,0 ); +ark_udm_configure (ark->udm.v, +RTE_PKTMBUF_HEADROOM , +RTE_MBUF_DEFAULT_DATAROOM , +ARK_RX_WRITE_TIME_NS ); +ark_udm_stats_reset (ark->udm.v); +ark_udm_stop (ark->udm.v,0 ); + +/* TX -- DDM */ +if (ark_ddm_stop (ark->ddm.v,1 )) +PMD_DRV_LOG (ERR ,"Unable to stop DDM\n" ); + + mpu = ark->mputx.v; + num_q =ark_api_num_queues (mpu); + ark->tx_queues = num_q; +for (i =0 ; i < num_q; i++) { +ark_mpu_reset (mpu); + mpu =RTE_PTR_ADD (mpu,ARK_MPU_QOFFSET ); + } + +ark_ddm_reset (ark->ddm.v); +ark_ddm_stats_reset (ark->ddm.v); + +ark_ddm_stop (ark->ddm.v,0 ); +ark_rqp_stats_reset (ark->rqpacing); + +return 0 ; }static int eth_ark_dev_uninit (struct rte_eth_dev *dev) { +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; +if (rte_eal_process_type () !=RTE_PROC_PRIMARY )return 0 ; +if (ark->user_ext.dev_uninit) + ark->user_ext.dev_uninit (dev, ark->user_data); + +ark_pktgen_uninit (ark->pg); +ark_pktchkr_uninit (ark->pc); + dev->dev_ops =NULL ; dev->rx_pkt_burst =NULL ; dev->tx_pkt_burst =NULL ; +if (dev->data->mac_addrs) +rte_free (dev->data->mac_addrs); +if (dev->data) +rte_free (dev->data); +return 0 ; }
@@ -175,16 +549,214 @@ static void eth_ark_dev_info_get(struct rte_eth_dev *dev, eth_ark_dev_configure(struct rte_eth_dev *dev __rte_unused) {ARK_DEBUG_TRACE ("ARKP: In %s\n" , __func__); +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; + +eth_ark_dev_set_link_up (dev); +if (ark->user_ext.dev_configure) +return ark->user_ext.dev_configure (dev, ark->user_data);return 0 ; } +static void * +delay_pg_start (void *arg) +{ +struct ark_adapter *ark = (struct ark_adapter *)arg; + +/* This function is used exclusively for regression testing, We +* perform a blind sleep here to ensure that the external test +* application has time to setup the test before we generate packets +*/ +usleep (100000 ); +ark_pktgen_run (ark->pg); +return NULL ; +} + +static int +eth_ark_dev_start (struct rte_eth_dev *dev) +{ +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; +int i; + +ARK_DEBUG_TRACE ("ARKP: In eth_ark_dev_start\n" ); + +/* RX Side */ +/* start UDM */ +ark_udm_start (ark->udm.v); + +for (i =0 ; i < dev->data->nb_rx_queues; i++) +eth_ark_rx_start_queue (dev, i); + +/* TX Side */ +for (i =0 ; i < dev->data->nb_tx_queues; i++) +eth_ark_tx_queue_start (dev, i); + +/* start DDM */ +ark_ddm_start (ark->ddm.v); + + ark->started =1 ; +/* set xmit and receive function */ + dev->rx_pkt_burst = ð_ark_recv_pkts; + dev->tx_pkt_burst = ð_ark_xmit_pkts; + +if (ark->start_pg) +ark_pktchkr_run (ark->pc); + +if (ark->start_pg && (ark_get_port_id (dev, ark) ==0 )) { +pthread_t thread; + +/* Delay packet generatpr start allow the hardware to be ready +* This is only used for sanity checking with internal generator +*/ +pthread_create (&thread,NULL , delay_pg_start, ark); + } + +if (ark->user_ext.dev_start) + ark->user_ext.dev_start (dev, ark->user_data); + +return 0 ; +} + +static void +eth_ark_dev_stop (struct rte_eth_dev *dev) +{ +uint16_t i; +int status; +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; +struct ark_mpu_t *mpu; + +ARK_DEBUG_TRACE ("ARKP: In eth_ark_dev_stop\n" ); + +if (ark->started ==0 ) +return ; + ark->started =0 ; + +/* Stop the extension first */ +if (ark->user_ext.dev_stop) + ark->user_ext.dev_stop (dev, ark->user_data); + +/* Stop the packet generator */ +if (ark->start_pg) +ark_pktgen_pause (ark->pg); + + dev->rx_pkt_burst = ð_ark_recv_pkts_noop; + dev->tx_pkt_burst = ð_ark_xmit_pkts_noop; + +/* STOP TX Side */ +for (i =0 ; i < dev->data->nb_tx_queues; i++) { + status =eth_ark_tx_queue_stop (dev, i); +if (status !=0 ) { +uint8_t port = dev->data->port_id; +PMD_DRV_LOG (ERR , +"ARKP tx_queue stop anomaly" +" port %u, queue %u\n" , + port, i); + } + } + +/* Stop DDM */ +/* Wait up to 0.1 second. each stop is upto 1000 * 10 useconds */ +for (i =0 ; i <10 ; i++) { + status =ark_ddm_stop (ark->ddm.v,1 ); +if (status ==0 ) +break ; + } +if (status || i !=0 ) { +PMD_DRV_LOG (ERR ,"DDM stop anomaly. status:" +" %d iter: %u. (%s)\n" , + status, + i, + __func__); +ark_ddm_dump (ark->ddm.v,"Stop anomaly" ); + + mpu = ark->mputx.v; +for (i =0 ; i < ark->tx_queues; i++) { +ark_mpu_dump (mpu,"DDM failure dump" , i); + mpu =RTE_PTR_ADD (mpu,ARK_MPU_QOFFSET ); + } + } + +/* STOP RX Side */ +/* Stop UDM multiple tries attempted */ +for (i =0 ; i <10 ; i++) { + status =ark_udm_stop (ark->udm.v,1 ); +if (status ==0 ) +break ; + } +if (status || i !=0 ) { +PMD_DRV_LOG (ERR ,"UDM stop anomaly. status %d iter: %u. (%s)\n" , + status, i, __func__); +ark_udm_dump (ark->udm.v,"Stop anomaly" ); + + mpu = ark->mpurx.v; +for (i =0 ; i < ark->rx_queues; i++) { +ark_mpu_dump (mpu,"UDM Stop anomaly" , i); + mpu =RTE_PTR_ADD (mpu,ARK_MPU_QOFFSET ); + } + } + +ark_udm_dump_stats (ark->udm.v,"Post stop" ); +ark_udm_dump_perf (ark->udm.v,"Post stop" ); + +for (i =0 ; i < dev->data->nb_tx_queues; i++) +eth_ark_rx_dump_queue (dev, i, __func__); + +/* Stop the packet checker if it is running */ +if (ark->start_pg) { +ark_pktchkr_dump_stats (ark->pc); +ark_pktchkr_stop (ark->pc); + } +} + +static void +eth_ark_dev_close (struct rte_eth_dev *dev) +{ +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; +uint16_t i; + +if (ark->user_ext.dev_close) + ark->user_ext.dev_close (dev, ark->user_data); + +eth_ark_dev_stop (dev); +eth_ark_udm_force_close (dev); + +/* +* TODO This should only be called once for the device during shutdown +*/ +ark_rqp_dump (ark->rqpacing); + +for (i =0 ; i < dev->data->nb_tx_queues; i++) { +eth_ark_tx_queue_release (dev->data->tx_queues[i]); + dev->data->tx_queues[i] =0 ; + } + +for (i =0 ; i < dev->data->nb_rx_queues; i++) { +eth_ark_dev_rx_queue_release (dev->data->rx_queues[i]); + dev->data->rx_queues[i] =0 ; + } +} +static void eth_ark_dev_info_get (struct rte_eth_dev *dev,struct rte_eth_dev_info *dev_info) { +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; +struct ark_mpu_t *tx_mpu =RTE_PTR_ADD (ark->bar0,ARK_MPU_TX_BASE ); +struct ark_mpu_t *rx_mpu =RTE_PTR_ADD (ark->bar0,ARK_MPU_RX_BASE ); + +uint16_t ports = ark->num_ports; +/* device specific configuration */ memset (dev_info,0 ,sizeof (*dev_info)); + dev_info->max_rx_queues =ark_api_num_queues_per_port (rx_mpu, ports); + dev_info->max_tx_queues =ark_api_num_queues_per_port (tx_mpu, ports); + dev_info->max_mac_addrs =0 ; + dev_info->if_index =0 ; dev_info->max_rx_pktlen = (16 *1024 ) -128 ; dev_info->min_rx_bufsize =1024 ;
@@ -208,6 +780,121 @@ static void eth_ark_dev_info_get(struct rte_eth_dev *dev, dev_info->pci_dev =ARK_DEV_TO_PCI (dev); } +static int +eth_ark_dev_link_update (struct rte_eth_dev *dev,int wait_to_complete) +{ +ARK_DEBUG_TRACE ("ARKP: link status = %d\n" , + dev->data->dev_link.link_status); +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; + +if (ark->user_ext.link_update) { +return ark->user_ext.link_update + (dev, wait_to_complete, + ark->user_data); + } +return 0 ; +} + +static int +eth_ark_dev_set_link_up (struct rte_eth_dev *dev) +{ + dev->data->dev_link.link_status =1 ; +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; + +if (ark->user_ext.dev_set_link_up) +return ark->user_ext.dev_set_link_up (dev, ark->user_data); +return 0 ; +} + +static int +eth_ark_dev_set_link_down (struct rte_eth_dev *dev) +{ + dev->data->dev_link.link_status =0 ; +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; + +if (ark->user_ext.dev_set_link_down) +return ark->user_ext.dev_set_link_down (dev, ark->user_data); +return 0 ; +} + +static void +eth_ark_dev_stats_get (struct rte_eth_dev *dev,struct rte_eth_stats *stats) +{ +uint16_t i; +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; + + stats->ipackets =0 ; + stats->ibytes =0 ; + stats->opackets =0 ; + stats->obytes =0 ; + stats->imissed =0 ; + stats->oerrors =0 ; + +for (i =0 ; i < dev->data->nb_tx_queues; i++) +eth_tx_queue_stats_get (dev->data->tx_queues[i], stats); +for (i =0 ; i < dev->data->nb_rx_queues; i++) +eth_rx_queue_stats_get (dev->data->rx_queues[i], stats); +if (ark->user_ext.stats_get) + ark->user_ext.stats_get (dev, stats, ark->user_data); +} + +static void +eth_ark_dev_stats_reset (struct rte_eth_dev *dev) +{ +uint16_t i; +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; + +for (i =0 ; i < dev->data->nb_tx_queues; i++) +eth_tx_queue_stats_reset (dev->data->rx_queues[i]); +for (i =0 ; i < dev->data->nb_rx_queues; i++) +eth_rx_queue_stats_reset (dev->data->rx_queues[i]); +if (ark->user_ext.stats_reset) + ark->user_ext.stats_reset (dev, ark->user_data); +} + +static void +eth_ark_macaddr_add (struct rte_eth_dev *dev, +struct ether_addr *mac_addr, +uint32_t index, +uint32_t pool) +{ +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; + +if (ark->user_ext.mac_addr_add) + ark->user_ext.mac_addr_add (dev, + mac_addr, + index, + pool, + ark->user_data); +} + +static void +eth_ark_macaddr_remove (struct rte_eth_dev *dev,uint32_t index) +{ +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; + +if (ark->user_ext.mac_addr_remove) + ark->user_ext.mac_addr_remove (dev, index, ark->user_data); +} + +static void +eth_ark_set_default_mac_addr (struct rte_eth_dev *dev, +struct ether_addr *mac_addr) +{ +struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; + +if (ark->user_ext.mac_addr_set) + ark->user_ext.mac_addr_set (dev, mac_addr, ark->user_data); +} +static inline int process_pktdir_arg (const char *key,const char *value, void *extra_args __rte_unused)
@@ -251,6 +938,12 @@ static void eth_ark_dev_info_get(struct rte_eth_dev *dev,unsigned int k_idx;struct rte_kvargs_pair *pair =NULL ; +/* +* TODO: the index of gark[index] should be associated with phy dev +* map +*/ +struct ark_adapter *ark = gark[0 ]; + kvlist =rte_kvargs_parse (params, valid_arguments);if (kvlist ==NULL )return 0 ;
@@ -285,8 +978,25 @@ static void eth_ark_dev_info_get(struct rte_eth_dev *dev,PMD_DRV_LOG (ERR ,"Unable to parse arg %s\n" ,ARK_PKTCHKR_ARG ); } +/* Setup the packet director */ +ark_pktdir_setup (ark->pd, pkt_dir_v);ARK_DEBUG_TRACE ("INFO: packet director set to 0x%x\n" , pkt_dir_v); +/* Setup the packet generator */ +if (pkt_gen_args[0 ]) { +PMD_DRV_LOG (INFO ,"Setting up the packet generator\n" ); +ark_pktgen_parse (pkt_gen_args); +ark_pktgen_reset (ark->pg); +ark_pktgen_setup (ark->pg); + ark->start_pg =1 ; + } + +/* Setup the packet checker */ +if (pkt_chkr_args[0 ]) { +ark_pktchkr_parse (pkt_chkr_args); +ark_pktchkr_setup (ark->pc); + } +return 1 ; }
drivers/net/ark/ark_ext.h new file +79 -0
79 lines not on this page · raw message
drivers/net/ark/ark_global.h +23 -0
@@ -88,6 +88,28 @@ struct ark_port {int id; }; +struct ark_user_ext { +void *(*dev_init)(struct rte_eth_dev *,void *abar,int port_id); +void (*dev_uninit)(struct rte_eth_dev *,void *); +int (*dev_get_port_count)(struct rte_eth_dev *,void *); +int (*dev_configure)(struct rte_eth_dev *,void *); +int (*dev_start)(struct rte_eth_dev *,void *); +void (*dev_stop)(struct rte_eth_dev *,void *); +void (*dev_close)(struct rte_eth_dev *,void *); +int (*link_update)(struct rte_eth_dev *,int wait_to_complete,void *); +int (*dev_set_link_up)(struct rte_eth_dev *,void *); +int (*dev_set_link_down)(struct rte_eth_dev *,void *); +void (*stats_get)(struct rte_eth_dev *,struct rte_eth_stats *,void *); +void (*stats_reset)(struct rte_eth_dev *,void *); +void (*mac_addr_add)(struct rte_eth_dev *, +struct ether_addr *, +uint32_t , +uint32_t , +void *); +void (*mac_addr_remove)(struct rte_eth_dev *,uint32_t ,void *); +void (*mac_addr_set)(struct rte_eth_dev *,struct ether_addr *,void *); +}; +struct ark_adapter {/* User extension private data */ void *user_data;
@@ -105,6 +127,7 @@ struct ark_adapter {struct rte_eth_dev *eth_dev;void *d_handle; +struct ark_user_ext user_ext;/* Our Bar 0 */ uint8_t *bar0;
Signature · 1 line
1.9.1
Quoted 4 lines · Ed Czeck
Enable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this time
Can you please send new version of patchset as reply to previous version, using --in-reply-to ?
This helps to see all patches in same mail tread and helps seeing previous comments, also in mail archive all versions stays in same place.
Quoted 11 lines
v4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-biones dev init to avoid compiler warningsv3:
* Split large patch into several smaller onesSigned-off-by Ed Czeck <[email protected]>---
<...>
config/defconfig_ppc_64-power8-linuxapp-gcc CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=n · line 51
Quoted 9 lines
config/defconfig_ppc_64-power8-linuxapp-gcc +1
-0@@ -48,6 +48,7 @@ CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=n # Note: Initially, all of the PMD drivers compilation are turned off on Power # Will turn on them only after the successful testing on Power +CONFIG_RTE_LIBRTE_ARK_PMD=n
Is it not tested or known that it is not supported?
Quoted 3 lines
config/defconfig_ppc_64-power8-linuxapp-gcc +0
-0CONFIG_RTE_LIBRTE_IXGBE_PMD=n CONFIG_RTE_LIBRTE_I40E_PMD=n CONFIG_RTE_LIBRTE_VIRTIO_PMD=y
<...>
Quoted 17 lines
config/defconfig_ppc_64-power8-linuxapp-gcc +17
-0+Configuration Information +------------------------- + +**DPDK Configuration Parameters** + + The following configuration options are available for the ARK PMD: + + * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion + of the ARK PMD driver in the DPDK compilation. + + * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y): When enabled TX + packets are padded to 60 bytes to support downstream MACS. + + * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug + logging and internal checking of RX ingress logic within the ARK PMD driver. + + * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
config/defconfig_ppc_64-power8-linuxapp-gcc
Quoted 10 lines
config/defconfig_ppc_64-power8-linuxapp-gcc +10
-0+ logging and internal checking of TX egress logic within the ARK PMD driver. + + * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug + logging of detailed packet and performance statistics gathered in + the PMD and FPGA. + + * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug + logging of detailed PMD events and status. + +
Can you also please document the device arguments in this file?
Device Parameters
-----------------
"Pkt_gen"
"Pkt_chkr"
"Pkt_dir"
Also perhaps you can include these device arguments in below "Usage Example" section of this document.
It can be good to document expected format/dataset for these arguments.
Quoted 11 lines
config/defconfig_ppc_64-power8-linuxapp-gcc +11
-0+Building DPDK +------------- + +See the :ref:`DPDK Getting Started Guide for Linux <linux_gsg>` for +instructions on how to build DPDK. + +By default the ARK PMD library will be built into the DPDK library. + +For configuring and using UIO and VFIO frameworks, please also refer :ref:`the +documentation that comes with DPDK suite <linux_gsg>`. +
<...>
Quoted 8 lines
doc/guides/nics/features/ark.ini new file +2
-0@@ -0,0 +1,15 @@ +; +; Supported features of the 'ark' poll mode driver.
doc/guides/nics/features/ark.ini line 12
Quoted 10 lines
doc/guides/nics/features/ark.ini new file +10
-0+; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Queue start/stop = Y +Jumbo frame = Y +Scattered Rx = Y +Basic stats = Y +Stats per queue = Y +FW version = Y
Features can be added with the patch that adds functionality. I believe above features not supported with current patch.
Quoted 3 lines
doc/guides/nics/features/ark.ini new file +3
-0+Linux UIO = Y +x86-64 = Y +Usage doc = Y
<...>
doc/guides/nics/features/ark.ini
Quoted 4 lines
doc/guides/nics/features/ark.ini new file +4
-0+# +# all source are stored in SRCS-y +# +SRCS-y += ark_ethdev.c
Please use SRCS-y only in comment, for actual usage please prefer:
SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD)
doc/guides/nics/features/ark.ini
Quoted 4 lines
doc/guides/nics/features/ark.ini new file +4
-0+ + +# this lib depends upon: +DEPDIRS-y += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD)
Quoted 1 line
+DEPDIRS-y +=
lib/librte_ether
<...>
doc/guides/nics/features/ark.ini
Quoted 5 lines
doc/guides/nics/features/ark.ini new file +5
-0+#define ARK_TRACE_ON(fmt, ...) \ + PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__) + +#define ARK_TRACE_OFF(fmt, ...) \ + do {if (0) PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__); } while (0)
why not just "do { } while(0)" ?
doc/guides/nics/features/ark.ini
Quoted 4 lines
doc/guides/nics/features/ark.ini new file +4
-0+ +/* Debug macro for reporting Packet stats */ +#ifdef RTE_LIBRTE_ARK_DEBUG_STATS +#define ARK_DEBUG_STATS(fmt, ...) ARK_TRACE_ON(fmt, ##__VA_ARGS__)
This is debug option but prints only "ERR" level log, shouldn't this be DEBUG.
Also there are dpdk wide log level option, helps optimizing out some code, if you use only ERR type, you won't be benefiting from it.
Quoted 14 lines
doc/guides/nics/features/ark.ini new file +14
-0+#else +#define ARK_DEBUG_STATS(fmt, ...) ARK_TRACE_OFF(fmt, ##__VA_ARGS__) +#endif + +/* Debug macro for tracing full behavior*/ +#ifdef RTE_LIBRTE_ARK_DEBUG_TRACE +#define ARK_DEBUG_TRACE(fmt, ...) ARK_TRACE_ON(fmt, ##__VA_ARGS__) +#else +#define ARK_DEBUG_TRACE(fmt, ...) ARK_TRACE_OFF(fmt, ##__VA_ARGS__) +#endif + +/* tracing including the function name */ +#define PMD_DRV_LOG(level, fmt, args...) \ + RTE_LOG(level, PMD, "%s(): " fmt, __func__, ## args)
<...>
doc/guides/nics/features/ark.ini
Quoted 2 lines
doc/guides/nics/features/ark.ini new file +2
-0+static int +eth_ark_dev_init(struct rte_eth_dev *dev __rte_unused)
__rte_unused not required.
doc/guides/nics/features/ark.ini
Quoted 10 lines
doc/guides/nics/features/ark.ini new file +10
-0+{ + struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; + struct rte_pci_device *pci_dev; + int ret = -1; + + ark->eth_dev = dev; + + ARK_DEBUG_TRACE("eth_ark_dev_init(struct rte_eth_dev *dev)\n"); + gark[0] = ark;
Is it OK to have this hardcoded index "0"? When there are two instance of this device, this value be overwritten by second one.
doc/guides/nics/features/ark.ini
Quoted 3 lines
doc/guides/nics/features/ark.ini new file +3
-0+ + pci_dev = ARK_DEV_TO_PCI(dev); + rte_eth_copy_pci_info(dev, pci_dev);
dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
Quoted 14 lines
doc/guides/nics/features/ark.ini new file +14
-0+ + if (pci_dev->device.devargs) + eth_ark_check_args(pci_dev->device.devargs->args); + else + PMD_DRV_LOG(INFO, "No Device args found\n"); + + + ark->bar0 = (uint8_t *)pci_dev->mem_resource[0].addr; + ark->a_bar = (uint8_t *)pci_dev->mem_resource[2].addr; + + dev->dev_ops = &ark_eth_dev_ops; + + return ret; +}
<...>
doc/guides/nics/features/ark.ini
Quoted 6 lines
doc/guides/nics/features/ark.ini new file +6
-0+static void +eth_ark_dev_info_get(struct rte_eth_dev *dev, + struct rte_eth_dev_info *dev_info) +{ + /* device specific configuration */ + memset(dev_info, 0, sizeof(*dev_info));
memset not required, since already done by ethdev abstraction layer, specially desc_lim values already overwritten below.
doc/guides/nics/features/ark.ini
Quoted 3 lines
doc/guides/nics/features/ark.ini new file +3
-0+ + dev_info->max_rx_pktlen = (16 * 1024) - 128; + dev_info->min_rx_bufsize = 1024;
Using some macros instead of hardcoded values helps to understand values.
<...>
doc/guides/nics/features/ark.ini
Quoted 6 lines
doc/guides/nics/features/ark.ini new file +6
-0+static inline int +process_pktdir_arg(const char *key, const char *value, + void *extra_args __rte_unused) +{ + ARK_DEBUG_TRACE("In process_pktdir_arg, key = %s, value = %s\n", + key, value);
The general usage of DEBUG_TRACE is providing backtrace log, function enterance / exit informations. I guess, that is why it has been controlled by different config option.
Here what you need looks like regular debugging functions, PMD_DRV_LOG / RTE_LOG variant.
Quoted 4 lines
doc/guides/nics/features/ark.ini new file +4
-0+ pkt_dir_v = strtol(value, NULL, 16); + ARK_DEBUG_TRACE("pkt_dir_v = 0x%x\n", pkt_dir_v); + return 0; +}
<...>
doc/guides/nics/features/ark.ini
Quoted 7 lines
doc/guides/nics/features/ark.ini new file +7
-0+ + while (fgets(line, sizeof(line), file)) { + if (first) { + strncpy(args, line, ARK_MAX_ARG_LEN); + first = 0; + } else { + strncat(args, line, ARK_MAX_ARG_LEN);
Can this overflow args variable? Any way to prevent possible crash?
What happens if somebody, by accident, provides a file as device argument which is larger than 256 bytes?
Quoted 7 lines
doc/guides/nics/features/ark.ini new file +7
-0+ } + } + ARK_DEBUG_TRACE("file = %s\n", args); + fclose(file); + return 0; +} +
<...>
Quoted 6 lines
+/*
+ * Although Arkville is a physical device we take advantage of the virtual
+ * device initialization as a per test runtime initialization for
+ * regression testing. Parameters are passed into the virtual device to
+ * configure the packet generator, packet director and packet checker.
+ */
Why not providing these arguments via physical device?
Can you please give more detail about your use case? This still looks wrong to me.
Quoted 5 lines
doc/guides/nics/features/ark.ini new file +5
-0+static struct rte_vdev_driver pmd_ark_drv = { + .probe = pmd_ark_probe, + .remove = pmd_ark_remove, +}; +
<...>
drivers/net/ark/rte_pmd_ark_version.map line 1
Quoted 7 lines
drivers/net/ark/rte_pmd_ark_version.map new file +1
-0@@ -0,0 +1,4 @@ +DPDK_2.0 {
s/DPDK_2.0/DPDK_17.05
Quoted 3 lines
drivers/net/ark/rte_pmd_ark_version.map new file +3
-0+ local: *; + +};
<...>
Re: [PATCH v4 2/7] net/ark: HW API part 1 of 3
In reply to Ed CzeckQuoted 2 lines · Ed Czeck
Provide C-level interface for Arkville's internal HW resources mpu, pktdir, and rqp modules
For patch title, instead of using " HW API part x of y", can you please describe the content of the patch, like:
" net/ark: HW API for MPU, pktdir, and RQP modules"
Quoted 2 lines
Signed-off-by Ed Czeck <[email protected]>
<...>
Re: [PATCH v4 7/7] net/ark: Arkville PMD component integration
In reply to Ed CzeckQuoted 7 lines · Ed Czeck
* Flesh out device configuration
* Add linksdev_ops
* allow dynamic extension loadingSigned-off-by Shepard Siegel <[email protected]>Signed-off-by John Miller <[email protected]>Signed-off-by Ed Czeck <[email protected]>
<...>
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 186
Quoted 8 lines
int
drivers/net/ark/ark_ethdev.c +2
-0@@ -129,8 +182,86 @@ static void eth_ark_dev_info_get(struct rte_eth_dev *dev,return -1 ; } +static +int
Can be in same line.
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 188
Quoted 2 lines
drivers/net/ark/ark_ethdev.c +2
-0+check_for_ext(struct rte_eth_dev *dev __rte_unused, + struct ark_adapter *ark __rte_unused)
__rte_unused can go away
Quoted 8 lines
drivers/net/ark/ark_ethdev.c +8
-0+{ +int found =0 ; + +/* Get the env */ +const char *dllpath =getenv ("ARK_EXT_PATH" ); + +if (dllpath ==NULL ) { +ARK_DEBUG_TRACE ("ARK EXT NO dll path specified\n" );
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 206
Quoted 10 lines
drivers/net/ark/ark_ethdev.c +10
-0+return 0 ; + } +ARK_DEBUG_TRACE ("ARK EXT found dll path at %s\n" , dllpath); + +/* Open and load the .so */ + ark->d_handle =dlopen (dllpath,RTLD_LOCAL |RTLD_LAZY ); +if (ark->d_handle ==NULL ) +PMD_DRV_LOG (ERR ,"Could not load user extension %s\n" , dllpath); +else +ARK_DEBUG_TRACE ("SUCCESS: loaded user extension %s\n" , dllpath);
Hi Ed,
Can you give some more details on "user extension" that loaded dynamically?
How much the driver depends on it, what happens if the library is missing?
And how do you deliver that shared library?
Quoted 10 lines
drivers/net/ark/ark_ethdev.c +10
-0+ +/* Get the entry points */ + ark->user_ext.dev_init = + (void *(*)(struct rte_eth_dev *,void *,int )) +dlsym (ark->d_handle,"dev_init" ); +ARK_DEBUG_TRACE ("device ext init pointer = %p\n" , + ark->user_ext.dev_init); + ark->user_ext.dev_get_port_count = + (int (*)(struct rte_eth_dev *,void *)) +dlsym (ark->d_handle,"dev_get_port_count" );
<...>
Re: [PATCH v4 5/7] net/ark: Packet TX support initial version
In reply to Ed CzeckQuoted 5 lines · Ed Czeck
* Core TX packet moving functions
* Flesh outark_adapterstruct to support TX code
(not all fields used at this patchSigned-off-by Ed Czeck <[email protected]>
<...>
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 127
Quoted 11 lines
drivers/net/ark/ark_ethdev.c +11
-0+int +ark_get_port_id (struct rte_eth_dev *dev,struct ark_adapter *ark) +{ +int n = ark->num_ports; +int i; + +/* There has to be a smarter way to do this ... */ +for (i =0 ; i < n; i++) { +if (ark->port[i].eth_dev == dev) +return i; + }
Is this function to get dev->data->port_id ?
"struct ark_adapter" is private date per eth_dev, it is possible to keep port_id per ark, no need to keep whole array on each ark, if I am now missing anything ...
Quoted 4 lines
drivers/net/ark/ark_ethdev.c +4
-0+ARK_DEBUG_TRACE ("ARK: Device is NOT associated with a port !!" ); +return -1 ; +} +
<...>
drivers/net/ark/ark_ethdev_tx.c line 48
Quoted 3 lines
drivers/net/ark/ark_ethdev_tx.c new file +3
-0+ +#ifdef RTE_LIBRTE_ARK_PAD_TX +#define ARK_TX_PAD_TO_60 1
Why not using RTE_LIBRTE_ARK_PAD_TX directly, but creating another macro?
drivers/net/ark/ark_ethdev_tx.c line 56
Quoted 8 lines
drivers/net/ark/ark_ethdev_tx.c new file +8
-0+#else +#define ARK_TX_PAD_TO_60 0 +#endif + + +#ifdef RTE_LIBRTE_ARK_DEBUG_TX +#define ARK_TX_DEBUG 1 +#define ARK_TX_DEBUG_JUMBO 1
Is it possible to handle RTE_LIBRTE_ARK_DEBUG_TX in log.h file to create a ..LOG_TX macro and use it, instead of dealing here with new macros?
Quoted 4 lines
drivers/net/ark/ark_ethdev_tx.c new file +4
-0+#else +#define ARK_TX_DEBUG 0 +#define ARK_TX_DEBUG_JUMBO 0 +#endif
<...>
drivers/net/ark/ark_ethdev_tx.h line 43
Quoted 8 lines
drivers/net/ark/ark_ethdev_tx.h new file +8
-0+ +#include <stdint.h> + +/* Forward declarations */ +struct rte_mbuf ; +struct rte_eth_dev ; +struct rte_eth_stats ; +struct rte_eth_txconf ;
Why not include relevant headers, instead of these struct declarations.
<...>
Re: [PATCH v4 6/7] net/ark: Packet RX support initial version
In reply to Ed CzeckQuoted 3 lines · Ed Czeck
* Core RX packet moving functions
Signed-off-by Ed Czeck <[email protected]>
<...>
drivers/net/ark/ark_ethdev_rx.c line 49
Quoted 3 lines
drivers/net/ark/ark_ethdev_rx.c new file +3
-0+#ifdef RTE_LIBRTE_ARK_DEBUG_RX +#define ARK_RX_DEBUG 1 +#define ARK_FULL_DEBUG 1
This macro is not used.
Quoted 14 lines · Ed Czeck
Enable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this timev4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-biones dev init to avoid compiler warningsv3:
* Split large patch into several smaller onesSigned-off-by Ed Czeck <[email protected]>
<...>
drivers/net/ark/Makefile line 60
Quoted 3 lines
drivers/net/ark/Makefile new file +3
-0+ +LDLIBS += lpthread +LDLIBS += ldl
These needs to be with "-", otherwise giving build errors.
LDLIBS += -lpthread
LDLIBS += -ldl
<...>
In the next patch set, v5 the following are addressed.
Quoted 7 lines
Quoted 3 lines
+CONFIG_RTE_LIBRTE_ARK_PMD=n
Is it not tested or known that it is not supported?
Quoted 3 lines
CONFIG_RTE_LIBRTE_IXGBE_PMD=n
CONFIG_RTE_LIBRTE_I40E_PMD=n
CONFIG_RTE_LIBRTE_VIRTIO_PMD=y
The Ark/PMD is not supported on those architectures at this time. This is
also reflected in doc/guides/nic/ark.rst
Quoted 6 lines
Can you also please document the device arguments in this file? Device Parameters
-----------------
"Pkt_gen"
"Pkt_chkr"
"Pkt_dir"
doc/guides/nic/ark.rst has been update to include documentation for these arguments.
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +0
-0
b/doc/guides/nics/features/ark.ini
Quoted 3 lines
...
Features can be added with the patch that adds functionality. I believe above features not supported with current patch.
The ark.ini file has been removed in this patch and will be added in a later patch
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+# +SRCS-y += ark_ethdev.cPlease use SRCS-y only in comment, for actual usage please prefer:
SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD)
Changed per request.
Quoted 7 lines
drivers/net/ark/ark_debug.h line 50
Quoted 6 lines
drivers/net/ark/ark_debug.h new file +5
-0+#define ARK_TRACE_ON (fmt, ...) \ + PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__) + +#define ARK_TRACE_OFF (fmt, ...) \ + do {if (0) PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__); } while (0)why not just "do { } while(0)" ?
A do while body always executes at least once. The if (0) is required.
Quoted 4 lines
This is debug option but prints only "ERR" level log, shouldn't this be DEBUG.
Also there are dpdk wide log level option, helps optimizing out some code, if you use only ERR type, you won't be benefiting from it.
Changed to DEBUG
Quoted 2 lines
__rte_unusednot required.
Removed.
Quoted 4 lines
drivers/net/ark/ark_ethdev.c line 128
Quoted 2 lines
drivers/net/ark/ark_ethdev.c new file +2
-0+ARK_DEBUG_TRACE ("eth_ark_dev_init(struct rte_eth_dev *dev)\n" ); + gark[0 ] = ark;Is it OK to have this hardcoded index "0"? When there are two instance of this device, this value be overwritten by second one.
Code refactored moving this variable from global scope to instance specific.
Quoted 1 line
dev->data->dev_flags|=RTE_ETH_DEV_DETACHABLE;
I do not understand your comment.
Quoted 3 lines
memset not required, since already done by ethdev abstraction layer, specially
desc_limvalues already overwritten below.
Deleted.
Quoted 4 lines
drivers/net/ark/ark_ethdev.c line 174
Quoted 3 lines
drivers/net/ark/ark_ethdev.c new file +2
-0+ dev_info->max_rx_pktlen = (16 *1024 ) -128 ; + dev_info->min_rx_bufsize =1024 ;Using some macros instead of hardcoded values helps to understand values.
Done
Quoted 7 lines
The general usage of
DEBUG_TRACEis providing backtrace log, function enterance / exit informations. I guess, that is why it has been controlled by different config option.
Here what you need looks like regular debugging functions,PMD_DRV_LOG/RTE_LOGvariant.
I'm unclear on your request or comment. Are you suggesting that we use the dpdk versions of debug? The advantage of a local version is that they can be enabled without all the debug traces.
Quoted 3 lines
Can this overflow args variable? Any way to prevent possible crash? What happens if somebody, by accident, provides a file as device argument which is larger than 256 bytes?
Code has been fixed to avoid overflow.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
+/*
+ * Although Arkville is a physical device we take advantage of the
virtual
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
+ * device initialization as a per test runtime initialization for
+ * regression testing. Parameters are passed into the virtual device
to
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
+ * configure the packet generator, packet director and packet checker.
+ */
Why not providing these arguments via physical device?
Code has been changed to use dev arg instead of vdev args.
Quoted 2 lines
Quoted 1 line
+++ b/drivers/net/ark/rte_pmd_ark_version.map
s/DPDK_2.0/DPDK_17.05
Fixed.
Re: [PATCH v4 2/7] net/ark: HW API part 1 of 3
In reply to Ferruh YigitQuoted 7 lines · Ferruh Yigit
For patch title, instead of using " HW API part x of y", can you please describe the content of the patch, like:
" net/ark: HW API for MPU, pktdir, and RQP modules"
Done
Re: [PATCH v4 5/7] net/ark: Packet TX support initial version
In reply to Ferruh YigitQuoted 9 lines · Ferruh Yigit
On 3/23/2017 1:03 AM, Ed Czeck wrote:
Is this function to get
dev->data->port_id?"struct
ark_adapter" is private date pereth_dev, it is possible to keepport_idper ark, no need to keep whole array on each ark, if I am now missing anything ...
Code changed to grab port from private data
Quoted 2 lines
Why not using
RTE_LIBRTE_ARK_PAD_TXdirectly, but creating another macro?
This macro is either defined as 1 or nothing. We are changing from these states to 1 or 0. Is there a preferred style or example that we should study?
Quoted 3 lines
Is it possible to handle
RTE_LIBRTE_ARK_DEBUG_TXinlog.hfile to create a ..LOG_TX macro and use it, instead of dealing here with new macros?
We are reviewing the use of debug and macro internally. Is there
a preferred style or example that we should study?
Quoted 7 lines
drivers/net/ark/ark_ethdev_tx.h line 43
Quoted 5 lines
drivers/net/ark/ark_ethdev_tx.h new file +5
-0+/* Forward declarations */ +struct rte_mbuf ; +struct rte_eth_dev ; +struct rte_eth_stats ; +struct rte_eth_txconf ;Why not include relevant headers, instead of these struct declarations.
The use of bare declaration is all that is needed, since the header only
uses pointers to these structs, and the full include is not needed. Full
header included were added.
Re: [PATCH v4 6/7] net/ark: Packet RX support initial version
In reply to Ferruh YigitQuoted 7 lines · Ferruh Yigit
drivers/net/ark/ark_ethdev_rx.c line 49
Quoted 5 lines
drivers/net/ark/ark_ethdev_rx.c new file +3
-0+#ifdef RTE_LIBRTE_ARK_DEBUG_RX +#define ARK_RX_DEBUG 1 +#define ARK_FULL_DEBUG 1This macro is not used.
Macro removed
Re: [PATCH v4 7/7] net/ark: Arkville PMD component integration
In reply to Ferruh YigitQuoted 7 lines · Ferruh Yigit
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 186
Quoted 5 lines
drivers/net/ark/ark_ethdev.c +2
-0+static +intCan be in same line.
Fixed
Quoted 5 lines
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 188
Quoted 3 lines
drivers/net/ark/ark_ethdev.c +2
-0+check_for_ext(struct rte_eth_dev *dev __rte_unused, + struct ark_adapter *ark __rte_unused)
__rte_unusedcan go away
Fixed
Quoted 3 lines
Hi Ed,
Can you give some more details on "user extension" that loaded
dynamically?
Quoted 5 lines
How much the driver depends on it, what happens if the library is missing?
And how do you deliver that shared library?
Dynamic libraries arem optional user provided extensions to the PMD. The
driver funcations correctly without one. Here is the blurb from our doc
file: doc/guides/nics/ark.rst
The ARK PMD user extensions are a feature of Arkville’s DPDK net/ark poll mode driver, allowing users to add their
own code to extend the net/ark functionality without
having to make source code changes to the driver. One motivation for this capability is that while DPDK provides a rich set of functions to interact with NIC-like capabilities (e.g. MAC addresses and statistics), the Arkville RTL IP does not include a MAC. Users can supply their own MAC or custom FPGA applications, which may require control from the PMD. The user extension is the means providing the control between the user's FPGA application and the existing DPDK features via the PMD.
PATCH v5 1/7 net/ark: PMD for Atomic Rules Arkville driver stub
In reply to Ed CzeckEnable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this time
v5:
* Address comments from Ferruh Yigit <[email protected]>
* Added documentation on driver args
* Makefile fixes
* Safe argument processing
* vdev args to dev args
v4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-bones dev init to avoid compiler warnings
v3:
* Split large patch into several smaller ones
--- MAINTAINERS | 8 + config/common_base | 10 + config/defconfig_arm-armv7a-linuxapp-gcc | 1 + config/defconfig_ppc_64-power8-linuxapp-gcc | 1 + doc/guides/nics/ark.rst | 310 ++++++++++++++++++++++++++++ doc/guides/nics/index.rst | 1 + drivers/net/Makefile | 1 + drivers/net/ark/Makefile | 62 ++++++ drivers/net/ark/ark_debug.h | 71 +++++++ drivers/net/ark/ark_ethdev.c | 294 ++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev.h | 39 ++++ drivers/net/ark/ark_global.h | 116 +++++++++++ drivers/net/ark/rte_pmd_ark_version.map | 4 + mk/rte.app.mk | 1 + 14 files changed, 919 insertions(+) create mode 100644 doc/guides/nics/ark.rst create mode 100644 drivers/net/ark/Makefile create mode 100644 drivers/net/ark/ark_debug.h create mode 100644 drivers/net/ark/ark_ethdev.c create mode 100644 drivers/net/ark/ark_ethdev.h create mode 100644 drivers/net/ark/ark_global.h create mode 100644 drivers/net/ark/rte_pmd_ark_version.map
MAINTAINERS +8 -0
@@ -278,6 +278,14 @@ M: Evgeny Schemeilin <[email protected]> F: drivers/net/ena/ F: doc/guides/nics/ena.rst +Atomic Rules ARK +M: Shepard Siegel <[email protected]> +M: Ed Czeck <[email protected]> +M: John Miller <[email protected]> +F: drivers/net/ark/ +F: doc/guides/nics/ark.rst +F: doc/guides/nics/features/ark.ini + Broadcom bnxt M: Stephen Hurd <[email protected]> M: Ajit Khaparde <[email protected]>
config/common_base +10 -0
@@ -353,6 +353,16 @@ CONFIG_RTE_LIBRTE_QEDE_FW="" CONFIG_RTE_LIBRTE_PMD_AF_PACKET=n # +# Compile ARK PMD +# +CONFIG_RTE_LIBRTE_ARK_PMD=y +CONFIG_RTE_LIBRTE_ARK_PAD_TX=y +CONFIG_RTE_LIBRTE_ARK_DEBUG_RX=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_TX=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE=n + +# # Compile the TAP PMD # It is enabled by default for Linux only. #
config/defconfig_arm-armv7a-linuxapp-gcc +1 -0
@@ -61,6 +61,7 @@ CONFIG_RTE_SCHED_VECTOR=n # cannot use those on ARM CONFIG_RTE_KNI_KMOD=n +CONFIG_RTE_LIBRTE_ARK_PMD=n CONFIG_RTE_LIBRTE_EM_PMD=n CONFIG_RTE_LIBRTE_IGB_PMD=n CONFIG_RTE_LIBRTE_CXGBE_PMD=n
config/defconfig_ppc_64-power8-linuxapp-gcc +1 -0
@@ -48,6 +48,7 @@ CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=n # Note: Initially, all of the PMD drivers compilation are turned off on Power # Will turn on them only after the successful testing on Power +CONFIG_RTE_LIBRTE_ARK_PMD=n CONFIG_RTE_LIBRTE_IXGBE_PMD=n CONFIG_RTE_LIBRTE_I40E_PMD=n CONFIG_RTE_LIBRTE_VIRTIO_PMD=y
doc/guides/nics/ark.rst new file +310 -0
310 lines not on this page · raw message
doc/guides/nics/index.rst +1 -0
@@ -36,6 +36,7 @@ Network Interface Controller Drivers :numbered: overview + ark bnx2x bnxt cxgbe
drivers/net/Makefile +1 -0
@@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet +DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark DIRS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += bonding DIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe
drivers/net/ark/Makefile new file +62 -0
62 lines not on this page · raw message
drivers/net/ark/ark_debug.h new file +71 -0
71 lines not on this page · raw message
drivers/net/ark/ark_ethdev.c new file +294 -0
294 lines not on this page · raw message
drivers/net/ark/ark_ethdev.h new file +39 -0
@@ -0,0 +1,39 @@ +/*- +* BSD LICENSE +* +* Copyright (c) 2015-2017 Atomic Rules LLC +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* * Neither the name of copyright holder nor the names of its +* contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _ARK_ETHDEV_H_ +#define _ARK_ETHDEV_H_ + +/* STUB */ + +#endif
drivers/net/ark/ark_global.h new file +116 -0
116 lines not on this page · raw message
drivers/net/ark/rte_pmd_ark_version.map new file +4 -0
@@ -0,0 +1,4 @@ +DPDK_17.05 { + local: *; + +};
mk/rte.app.mk +1 -0
@@ -104,6 +104,7 @@ ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) # plugins (link only if static libraries) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet +_LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += -lrte_pmd_ark _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz _LDLIBS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += -lrte_pmd_bnxt _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond
Signature · 1 line
1.9.1
PATCH v5 2/7 net/ark: provide api to hardware module mpu, rqp, and pktdir
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources mpu, pktdir, and rqp modules
--- drivers/net/ark/Makefile | 4 +- drivers/net/ark/ark_mpu.c | 181 +++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_mpu.h | 148 +++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktdir.c | 80 +++++++++++++++++++ drivers/net/ark/ark_pktdir.h | 63 +++++++++++++++ drivers/net/ark/ark_rqp.c | 91 ++++++++++++++++++++++ drivers/net/ark/ark_rqp.h | 77 ++++++++++++++++++ 7 files changed, 643 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ark/ark_mpu.c create mode 100644 drivers/net/ark/ark_mpu.h create mode 100644 drivers/net/ark/ark_pktdir.c create mode 100644 drivers/net/ark/ark_pktdir.h create mode 100644 drivers/net/ark/ark_rqp.c create mode 100644 drivers/net/ark/ark_rqp.h
drivers/net/ark/Makefile +3 -1
@@ -47,7 +47,9 @@ LIBABIVER := 1 # all source are stored in SRCS-y # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c - +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += lib/librte_mbuf
drivers/net/ark/ark_mpu.c new file +181 -0
181 lines not on this page · raw message
drivers/net/ark/ark_mpu.h new file +148 -0
148 lines not on this page · raw message
drivers/net/ark/ark_pktdir.c new file +80 -0
80 lines not on this page · raw message
drivers/net/ark/ark_pktdir.h new file +63 -0
63 lines not on this page · raw message
drivers/net/ark/ark_rqp.c new file +91 -0
91 lines not on this page · raw message
drivers/net/ark/ark_rqp.h new file +77 -0
77 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 3/7 net/ark: provide API hardware module udm and ddm
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources ddm and udm modules
--- drivers/net/ark/Makefile | 4 +- drivers/net/ark/ark_ddm.c | 151 +++++++++++++++++++++++++++++++ drivers/net/ark/ark_ddm.h | 158 ++++++++++++++++++++++++++++++++ drivers/net/ark/ark_udm.c | 226 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_udm.h | 187 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 725 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ark/ark_ddm.c create mode 100644 drivers/net/ark/ark_ddm.h create mode 100644 drivers/net/ark/ark_udm.c create mode 100644 drivers/net/ark/ark_udm.h
drivers/net/ark/Makefile +3 -1
@@ -46,10 +46,12 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c -SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_udm.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += lib/librte_mbuf
drivers/net/ark/ark_ddm.c new file +151 -0
151 lines not on this page · raw message
drivers/net/ark/ark_ddm.h new file +158 -0
158 lines not on this page · raw message
drivers/net/ark/ark_udm.c new file +226 -0
226 lines not on this page · raw message
drivers/net/ark/ark_udm.h new file +187 -0
187 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 4/7 net/ark: prrovide api for hardware module pktchkr and pktgen
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources pktchkr and pktgen
--- drivers/net/ark/Makefile | 2 + drivers/net/ark/ark_pktchkr.c | 472 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktchkr.h | 118 ++++++++++ drivers/net/ark/ark_pktgen.c | 491 ++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktgen.h | 110 ++++++++++ 5 files changed, 1193 insertions(+) create mode 100644 drivers/net/ark/ark_pktchkr.c create mode 100644 drivers/net/ark/ark_pktchkr.h create mode 100644 drivers/net/ark/ark_pktgen.c create mode 100644 drivers/net/ark/ark_pktgen.h
drivers/net/ark/Makefile +2 -0
@@ -49,7 +49,9 @@ LIBABIVER := 1 SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktgen.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_udm.c
drivers/net/ark/ark_pktchkr.c new file +472 -0
472 lines not on this page · raw message
drivers/net/ark/ark_pktchkr.h new file +118 -0
118 lines not on this page · raw message
drivers/net/ark/ark_pktgen.c new file +491 -0
491 lines not on this page · raw message
drivers/net/ark/ark_pktgen.h new file +110 -0
110 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 5/7 net/ark: Packet TX support initial version
In reply to Ed Czeck* Core TX packet moving functions
* Flesh out ark_adapter struct to support TX code
(not all fields used at this patch
--- drivers/net/ark/Makefile | 1 + drivers/net/ark/ark_ethdev_tx.c | 507 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev_tx.h | 59 +++++ drivers/net/ark/ark_global.h | 28 +++ 4 files changed, 595 insertions(+) create mode 100644 drivers/net/ark/ark_ethdev_tx.c create mode 100644 drivers/net/ark/ark_ethdev_tx.h
drivers/net/ark/Makefile +1 -0
@@ -48,6 +48,7 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_tx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c
drivers/net/ark/ark_ethdev_tx.c new file +507 -0
507 lines not on this page · raw message
drivers/net/ark/ark_ethdev_tx.h new file +59 -0
59 lines not on this page · raw message
drivers/net/ark/ark_global.h +28 -0
@@ -47,6 +47,10 @@#include <rte_dev.h> #include <rte_version.h> +#include "ark_pktdir.h" +#include "ark_pktgen.h" +#include "ark_pktchkr.h" +#define ETH_ARK_ARG_MAXLEN 64#define ARK_SYSCTRL_BASE 0x0#define ARK_PKTGEN_BASE 0x10000
@@ -91,6 +95,12 @@ struct ark_adapter {/* User extension private data */ void *user_data; +/* Pointers to packet generator and checker */ +int start_pg; +ark_pkt_gen_t pg; +ark_pkt_chkr_t pc; +ark_pkt_dir_t pd; +struct ark_port port[ARK_MAX_PORTS ];int num_ports;
@@ -109,6 +119,24 @@ struct ark_adapter {/* Application Bar */ uint8_t *a_bar; + +/* Arkville demo block offsets */ +def_ptr (sys_ctrl, sysctrl); +def_ptr (pkt_gen, pktgen); +def_ptr (mpu_rx, mpurx); +def_ptr (UDM , udm); +def_ptr (mpu_tx, mputx); +def_ptr (DDM , ddm); +def_ptr (CMAC , cmac); +def_ptr (external, external); +def_ptr (pkt_dir, pktdir); +def_ptr (pkt_chkr, pktchkr); + +int started; +uint16_t rx_queues; +uint16_t tx_queues; + +struct ark_rqpace_t *rqpacing; };typedef uint32_t *ark_t ;
Signature · 1 line
1.9.1
PATCH v5 6/7 net/ark: Packet RX support initial version
In reply to Ed Czeck* Core RX packet moving functions
--- drivers/net/ark/Makefile | 1 + drivers/net/ark/ark_ethdev_rx.c | 680 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev_rx.h | 67 ++++ 3 files changed, 748 insertions(+) create mode 100644 drivers/net/ark/ark_ethdev_rx.c create mode 100644 drivers/net/ark/ark_ethdev_rx.h
drivers/net/ark/Makefile +1 -0
@@ -48,6 +48,7 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_rx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_tx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c
drivers/net/ark/ark_ethdev_rx.c new file +680 -0
680 lines not on this page · raw message
drivers/net/ark/ark_ethdev_rx.h new file +67 -0
67 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v5 7/7 net/ark: Arkville PMD component integration
In reply to Ed Czeck* Flesh out device configuration
* Add links dev_ops
* allow dynamic extension loading
Conflicts:
drivers/net/ark/ark_ethdev.c
--- doc/guides/nics/features/ark.ini | 15 + drivers/net/ark/ark_ethdev.c | 707 ++++++++++++++++++++++++++++++++++++++- drivers/net/ark/ark_ext.h | 79 +++++ drivers/net/ark/ark_global.h | 23 ++ 4 files changed, 818 insertions(+), 6 deletions(-) create mode 100644 doc/guides/nics/features/ark.ini create mode 100644 drivers/net/ark/ark_ext.h
doc/guides/nics/features/ark.ini new file +15 -0
@@ -0,0 +1,15 @@ +; +; Supported features of the 'ark' poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Queue start/stop = Y +Jumbo frame = Y +Scattered Rx = Y +Basic stats = Y +Stats per queue = Y +FW version = Y +Linux UIO = Y +x86-64 = Y +Usage doc = Y
drivers/net/ark/ark_ethdev.c +701 -6
794 lines not on this page · raw message
drivers/net/ark/ark_ext.h new file +79 -0
79 lines not on this page · raw message
drivers/net/ark/ark_global.h +23 -0
@@ -91,6 +91,28 @@ struct ark_port {int id; }; +struct ark_user_ext { +void *(*dev_init)(struct rte_eth_dev *,void *abar,int port_id); +void (*dev_uninit)(struct rte_eth_dev *,void *); +int (*dev_get_port_count)(struct rte_eth_dev *,void *); +int (*dev_configure)(struct rte_eth_dev *,void *); +int (*dev_start)(struct rte_eth_dev *,void *); +void (*dev_stop)(struct rte_eth_dev *,void *); +void (*dev_close)(struct rte_eth_dev *,void *); +int (*link_update)(struct rte_eth_dev *,int wait_to_complete,void *); +int (*dev_set_link_up)(struct rte_eth_dev *,void *); +int (*dev_set_link_down)(struct rte_eth_dev *,void *); +void (*stats_get)(struct rte_eth_dev *,struct rte_eth_stats *,void *); +void (*stats_reset)(struct rte_eth_dev *,void *); +void (*mac_addr_add)(struct rte_eth_dev *, +struct ether_addr *, +uint32_t , +uint32_t , +void *); +void (*mac_addr_remove)(struct rte_eth_dev *,uint32_t ,void *); +void (*mac_addr_set)(struct rte_eth_dev *,struct ether_addr *,void *); +}; +struct ark_adapter {/* User extension private data */ void *user_data;
@@ -113,6 +135,7 @@ struct ark_adapter {struct rte_eth_dev *eth_dev;void *d_handle; +struct ark_user_ext user_ext;/* Our Bar 0 */ uint8_t *bar0;
Signature · 1 line
1.9.1
Re: [PATCH v4 7/7] net/ark: Arkville PMD component integration
In reply to Ed CzeckQuoted 33 lines · Ed Czeck
Quoted 7 lines · On Thu, Mar 23, 2017 at 8:13 AM, Ferruh Yigit <[email protected]…
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 186
Quoted 5 lines
drivers/net/ark/ark_ethdev.c +2
-0+static +intCan be in same line.
Fixed
Quoted 5 lines
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 188
Quoted 3 lines
drivers/net/ark/ark_ethdev.c +2
-0+check_for_ext(struct rte_eth_dev *dev __rte_unused, + struct ark_adapter *ark __rte_unused)
__rte_unusedcan go awayFixed
Quoted 3 lines
Hi Ed,
Can you give some more details on "user extension" that loaded
dynamically?
Quoted 5 lines
How much the driver depends on it, what happens if the library is missing?
And how do you deliver that shared library?
Dynamic libraries arem optional user provided extensions to the PMD. The
driver funcations correctly without one. Here is the blurb from our
doc file:doc/guides/nics/ark.rst
Quoted 11 lines
The ARK PMD user extensions are a feature of Arkville’s DPDK net/ark poll mode driver, allowing users to add their
own code to extend the net/ark functionality without
having to make source code changes to the driver. One motivation for this capability is that while DPDK provides a rich set of functions to interact with NIC-like capabilities (e.g. MAC addresses and statistics), the Arkville RTL IP does not include a MAC. Users can supply their own MAC or custom FPGA applications, which may require control from the PMD. The user extension is the means providing the control between the user's FPGA application and the existing DPDK features via the PMD.
There is no discussion related to this dependency, I guess we can continue to reviewing patches.
Anyone believes this must be discussed more, please chime in.
Quoted 8 lines · Ed Czeck
Quoted 6 lines
drivers/net/ark/ark_debug.h line 50
Quoted 5 lines
drivers/net/ark/ark_debug.h new file +5
-0+#define ARK_TRACE_ON (fmt, ...) \ + PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__) + +#define ARK_TRACE_OFF (fmt, ...) \ + do {if (0) PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__); } while (0)why not just "do { } while(0)" ?
A do while body always executes at least once. The if (0) is required.
Are you sure about this?
I believe "do { } while(0)" also removed completely during compile.
Quoted 3 lines
Quoted 1 line
dev->data->dev_flags|=RTE_ETH_DEV_DETACHABLE;I do not understand your comment.
This flag also should be added, all eth devices by are detachable.
Quoted 9 lines
Quoted 5 lines
The general usage of
DEBUG_TRACEis providing backtrace log, function enterance / exit informations. I guess, that is why it has been controlled by different config option.
Here what you need looks like regular debugging functions,PMD_DRV_LOG/RTE_LOGvariant.I'm unclear on your request or comment. Are you suggesting that we use the dpdk versions of debug? The advantage of a local version is that they can be enabled without all the debug traces.
In many drivers there are independent log macros, two of them are:
1) PMD_.._TRACE
2) PMD_.._LOG
Those above controlled by different config option.
As name suggest, first one lets you to get function trace logs, many PMDs don't use them, since you can get this information from debugger.
Second one is PMD wise log macro, controlled by its specific config option.
It is possible enable / disable tracing logs (1), without effecting general logging macros (2).
In ARK PMD, both ARK_DEBUG_TRACE and PMD_DRV_LOG macros are used for regular logging.
a) I believe it is wrong to use ARK_DEBUG_TRACE for regular logging, all should be PMD_DRV_LOG
b) And PMD_DRV_LOG should be controlled by a config option.
As far as I can see ARK_DEBUG_TRACE never used for tracing really, so you can rename all occurrences to PMD_DRV_LOG, and remove ARK_DEBUG_TRACE and its config option.
And introduce a config option for PMD_DRV_LOG
Quoted 22 lines · Ed Czeck
Enable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this timev5:
* Address comments from Ferruh Yigit <[email protected]>
* Added documentation on driver args
*Makefilefixes
* Safe argument processing
* vdev args to dev argsv4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-bones dev init to avoid compiler warningsv3:
* Split large patch into several smaller onesSigned-off-by Ed Czeck <[email protected]>Signed-off-by John Miller <[email protected]>
<...>
Quoted 4 lines
doc/guides/nics/ark.rst new file +4
-0+Device Parameters +------------------- + +The ARK PMD supports a series of parameters that are used for packet routing
doc/guides/nics/ark.rst line 115
Quoted 10 lines
doc/guides/nics/ark.rst new file +10
-0+and for internal packet generation and packet checking. This section describes +the supported parameters. These features are primarily used for +diagnostics, testing, and performance verification. The nominal use +of Arkville does not require any configuration using these parameters. + +"Pkt_dir" + +The Packet Director controls connectivity between the Packet Generator, +Packet Checker, UDM, DDM, and external ingress and egress interfaces for +diagnostic purposes. It includes an internal loopback path from the DDM to the UDM.
What are UDM and DDM are?
doc/guides/nics/ark.rst line 119
Quoted 4 lines
doc/guides/nics/ark.rst new file +4
-0+ +NOTE: Packets from the packet generator to the UDM are all directed to UDM RX +queue 0. Packets looped back from the DDM to the UDM are directed to the same +queue number they originated from.
So a packet generator is part of this PMD.
Isn't it overkill for PMD to have packet generator feauture. Is it really needs to be part of PMD? Can be an option to use external packet generators?
Quoted 13 lines
doc/guides/nics/ark.rst new file +13
-0+ +bit 24: enRxChk (default 0) +bit 20: enDDMChk (default 1) +bit 16: enPGIngress (default 1) +bit 12: enPGEgress (default 0) +bit 8: enExtIngress (default 1) +bit 4: enDDMEgress (default 1) +bit 0: enIntLpbk (default 0) + +Power On state +0x00110110 + +These bits control which diagnostic paths are enabled. Refer to the PktDirector block
doc/guides/nics/ark.rst line 142
Quoted 10 lines
doc/guides/nics/ark.rst new file +10
-0+diagram in the Arkville documentation. + +Format: +Pkt_dir=0x00110110 + +"Pkt_gen" + +The packet generator parameter takes a file as its argument. The file contains configuration +parameters used internally for regression testing and are not intended to be published at this +level.
If these config options are not planned to use by public, should the stripped from public version of the PMD? Is there a benefit to keep them in dpdk repo?
Quoted 14 lines
doc/guides/nics/ark.rst new file +14
-0+ +Format: +Pkt_gen=./config/pg.conf + +"Pkt_chkr" + +The packet checker parameter takes a file as its argument. The file contains configuration +parameters used internally for regression testing and are not intended to be published at this +level. + +Format: +Pkt_chkr=./config/pc.conf + +
<...>
drivers/net/ark/ark_ethdev.c line 50
Quoted 8 lines
drivers/net/ark/ark_ethdev.c new file +8
-0+ +/* Internal prototypes */ +static int eth_ark_check_args (struct ark_adapter *ark,const char *params); +static int eth_ark_dev_init (struct rte_eth_dev *dev); +static int eth_ark_dev_uninit (struct rte_eth_dev *eth_dev); +static int eth_ark_dev_configure (struct rte_eth_dev *dev); +static void eth_ark_dev_info_get (struct rte_eth_dev *dev, +struct rte_eth_dev_info *dev_info);
This may be personal, but I am for reordering functions and removing static function declerations, its your call.
drivers/net/ark/ark_ethdev.c line 53
Quoted 3 lines
drivers/net/ark/ark_ethdev.c new file +3
-0+ +#define ARK_DEV_TO_PCI (eth_dev) \ + RTE_DEV_TO_PCI((eth_dev)->device)
This macro can go to header file, ark_ethdev.h perhaps?
<...>
Quoted 7 lines
drivers/net/ark/ark_ethdev.c new file +7
-0+ +if (pci_dev->device.devargs) +eth_ark_check_args (ark, pci_dev->device.devargs->args); +else +PMD_DRV_LOG (INFO ,"No Device args found\n" ); + +
drivers/net/ark/ark_ethdev.c line 142
Quoted 10 lines
drivers/net/ark/ark_ethdev.c new file +10
-0+ ark->bar0 = (uint8_t *)pci_dev->mem_resource[0 ].addr; + ark->a_bar = (uint8_t *)pci_dev->mem_resource[2 ].addr; + + dev->dev_ops = &ark_eth_dev_ops; + +/* We process our args last as they require everything to be setup */ +if (pci_dev->device.devargs) +eth_ark_check_args (ark, pci_dev->device.devargs->args); +else +PMD_DRV_LOG (INFO ,"No Device args found\n" );
This is duplicate, please check ~10 lines above.
Should check the return value of the function, is it OK to continue if invalid devargs provided by user?
drivers/net/ark/ark_ethdev.c line 151
Quoted 9 lines
drivers/net/ark/ark_ethdev.c new file +9
-0+ +return ret; +} + +static int +eth_ark_dev_uninit (struct rte_eth_dev *dev) +{ +if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) +return 0 ;
Should primary process check also required in eth_ark_dev_init() ?
Quoted 6 lines
drivers/net/ark/ark_ethdev.c new file +6
-0+ + dev->dev_ops =NULL ; + dev->rx_pkt_burst =NULL ; + dev->tx_pkt_burst =NULL ; +return 0 ; +}
<...>
drivers/net/ark/ark_ethdev.c line 264
Quoted 6 lines
drivers/net/ark/ark_ethdev.c new file +6
-0+ +if (rte_kvargs_process (kvlist, +ARK_PKTDIR_ARG , + &process_pktdir_arg, + ark) !=0 ) { +PMD_DRV_LOG (ERR ,"Unable to parse arg %s\n" ,ARK_PKTDIR_ARG );
No error returned for this case?
Quoted 1 line
+RTE_PMD_REGISTER_PCI(eth_ark, rte_ark_pmd.pci_drv);
Net device names updated, eth_xxx -> net_xxx. This should be net_ark.
Re: [PATCH v5 2/7] net/ark: provide api to hardware module mpu, rqp, and pktdir
In reply to Ed CzeckQuoted 2 lines · Ed Czeck
Provide C-level interface for Arkville's internal HW resources mpu, pktdir, and rqp modules
At least in commit log, and if possible in documentation, can you please mention what mpu, rqp stands for, and perhaps describe them briefly?
Same for other hardware module patches.
Quoted 2 lines
Signed-off-by Ed Czeck <[email protected]>
<...>
Re: [PATCH v5 6/7] net/ark: Packet RX support initial version
In reply to Ed CzeckQuoted 3 lines · Ed Czeck
* Core RX packet moving functions
Signed-off-by Ed Czeck <[email protected]>
<...>
Quoted 1 line
+/* TODO pick a better function name */
Is it possible to do now :) Thanks.
Quoted 5 lines
drivers/net/ark/ark_ethdev_rx.c new file +5
-0+static int +eth_ark_rx_hw_setup (struct rte_eth_dev *dev, +struct ark_rx_queue *queue, + uint16_t rx_queue_id __rte_unused, uint16_t rx_queue_idx) +{
<...>
drivers/net/ark/ark_ethdev_rx.c line 666
Quoted 5 lines
drivers/net/ark/ark_ethdev_rx.c new file +5
-0+ +/* Only used in debug */ +static void +dump_mbuf_data (struct rte_mbuf *mbuf,uint16_t lo,uint16_t hi) +{
There is already a rte_pktmbuf_dump(), does it works for you?
<...>
drivers/net/ark/ark_ethdev_rx.h line 44
Quoted 6 lines
drivers/net/ark/ark_ethdev_rx.h new file +6
-0+/* Forward declarations */ +struct rte_mbuf ; +struct rte_mempool ; +struct rte_eth_dev ; +struct rte_eth_stats ; +struct rte_eth_rxconf ;
Same comment with Tx patch, these structs can be removed by including proper dpdk headers.
Re: [PATCH v5 7/7] net/ark: Arkville PMD component integration
In reply to Ed CzeckQuoted 7 lines · Ed Czeck
* Flesh out device configuration
* Add linksdev_ops
* allow dynamic extension loadingSigned-off-by Shepard Siegel <[email protected]>Signed-off-by John Miller <[email protected]>Signed-off-by Ed Czeck <[email protected]>
<...>
doc/guides/nics/features/ark.ini line 12
Quoted 8 lines
+[Features]
doc/guides/nics/features/ark.ini new file +6
-0+Queue start/stop = Y +Jumbo frame = Y +Scattered Rx = Y +Basic stats = Y +Stats per queue = Y +FW version = Y
FW version is not required, as far as I can see, it requires fw_version_get eth_dev_ops implemented.
<...>
Quoted 4 lines
drivers/net/ark/ark_ethdev.c +4
-0+/* We are a single function multi-port device. */ +const unsigned int numa_node =rte_socket_id (); +struct ether_addr adr; +
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 315
Quoted 10 lines
drivers/net/ark/ark_ethdev.c +8
-0+ ret =ark_config_device (dev); dev->dev_ops = &ark_eth_dev_ops; + dev->data->mac_addrs =rte_zmalloc ("ark" ,ETHER_ADDR_LEN ,0 ); +if (!dev->data->mac_addrs) { +PMD_DRV_LOG (ERR , +"Failed to allocated memory for storing mac address" + ); + } +ether_addr_copy ((struct ether_addr *)&adr, &dev->data->mac_addrs[0 ]);
"adr" has random value at this point, right? Why to copy it?
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 339
Quoted 6 lines
drivers/net/ark/ark_ethdev.c +6
-0+/* +* We will create additional devices based on the number of requested +* ports +*/ +int pc =1 ; +int p;
I am aware some people prefer the declaring variables close to context, which is good idea, but if I remember correct, there was a patchset, from Adrien, to make DPDK C99 compatible, will this break it?
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 345
Quoted 6 lines
drivers/net/ark/ark_ethdev.c +6
-0+ +if (ark->user_ext.dev_get_port_count) { + pc = ark->user_ext.dev_get_port_count (dev, ark->user_data); + ark->num_ports = pc; + }else { + ark->num_ports =1 ;
Because pc has default value of "1", this if statement can be simplified.
Quoted 27 lines
drivers/net/ark/ark_ethdev.c +27
-0+ } +for (p =0 ; p < pc; p++) { +struct ark_port *port; + + port = &ark->port[p]; +struct rte_eth_dev_data *data =NULL ; + + port->id = p; + +char name[RTE_ETH_NAME_MAX_LEN ]; + +snprintf (name,sizeof (name),"arketh%d" , + dev->data->port_id + p); + +if (p ==0 ) { +/* First port is already allocated by DPDK */ + port->eth_dev = ark->eth_dev; +continue ; + } + +/* reserve an ethdev entry */ + port->eth_dev =rte_eth_dev_allocate (name); +if (!port->eth_dev) { +PMD_DRV_LOG (ERR , +"Could not allocate eth_dev for port %d\n" , + p); + goto error;
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 382
Quoted 10 lines
drivers/net/ark/ark_ethdev.c +10
-0+ } + + data =rte_zmalloc_socket (name,sizeof (*data),0 , numa_node); +if (!data) { +PMD_DRV_LOG (ERR , +"Could not allocate eth_dev for port %d\n" , + p); + goto error; + } + data->port_id = ark->eth_dev->data->port_id + p;
"ark->eth_dev->data->port_id" is port_id of the first physical ARK device, and it looks like each device may have multiple ports and "p" is the port_id within same device.
Quoted 1 line
From DPDK point of view,
port_idis a global value incremented one by
each eth port, so port_id is a unique value, why adding these two values?
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 383
Quoted 1 line
drivers/net/ark/ark_ethdev.c +1
-0+ port->eth_dev->data = data;
Why overwriting existing data value?
Quoted 24 lines
drivers/net/ark/ark_ethdev.c +24
-0+ port->eth_dev->device = &pci_dev->device; + port->eth_dev->data->dev_private = ark; + port->eth_dev->driver = ark->eth_dev->driver; + port->eth_dev->dev_ops = ark->eth_dev->dev_ops; + port->eth_dev->tx_pkt_burst = ark->eth_dev->tx_pkt_burst; + port->eth_dev->rx_pkt_burst = ark->eth_dev->rx_pkt_burst; + +rte_eth_copy_pci_info (port->eth_dev, pci_dev); + + port->eth_dev->data->mac_addrs = +rte_zmalloc (name,ETHER_ADDR_LEN ,0 ); +if (!port->eth_dev->data->mac_addrs) { +PMD_DRV_LOG (ERR , +"Memory allocation for MAC failed!" +" Exiting.\n" ); + goto error; + } +ether_addr_copy (&adr, + &port->eth_dev->data->mac_addrs[0 ]); + +if (ark->user_ext.dev_init) + ark->user_data = + ark->user_ext.dev_init (dev, ark->a_bar, p); + }
<...>
Quoted 13 lines
static int
eth_ark_dev_uninit(struct rte_eth_dev *dev)
{drivers/net/ark/ark_ethdev.c +7
-0+struct ark_adapter *ark = + (struct ark_adapter *)dev->data->dev_private; +if (rte_eal_process_type () !=RTE_PROC_PRIMARY )return 0 ; +if (ark->user_ext.dev_uninit) + ark->user_ext.dev_uninit (dev, ark->user_data); + +ark_pktgen_uninit (ark->pg);
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 522
Quoted 10 lines
drivers/net/ark/ark_ethdev.c +7
-0+ark_pktchkr_uninit (ark->pc); + dev->dev_ops =NULL ; dev->rx_pkt_burst =NULL ; dev->tx_pkt_burst =NULL ; +if (dev->data->mac_addrs) +rte_free (dev->data->mac_addrs); +if (dev->data) +rte_free (dev->data); +
Shouldn't uninit go thorough all ports ("for (p = 0; p < pc; p++) ") and uninit them all?
Quoted 3 lines
return 0;
}
<...>
Quoted 15 lines
drivers/net/ark/ark_ext.h new file +15
-0+/* +* The following functions are optional and are directly mapped +* from the DPDK PMD ops structure. +* Each function if implemented is called after the ARK PMD +* implementation executes. +*/ +int dev_configure (struct rte_eth_dev *dev,void *user_data); +int dev_start (struct rte_eth_dev *dev,void *user_data); +void dev_stop (struct rte_eth_dev *dev,void *user_data); +void dev_close (struct rte_eth_dev *dev,void *user_data); +int link_update (struct rte_eth_dev *dev,int wait_to_complete, +void *user_data); +int dev_set_link_up (struct rte_eth_dev *dev,void *user_data); +int dev_set_link_down (struct rte_eth_dev *dev,void *user_data); +void stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
drivers/net/ark/ark_ext.h line 77
Quoted 10 lines
drivers/net/ark/ark_ext.h new file +10
-0+ void *user_data); +void stats_reset (struct rte_eth_dev *dev,void *user_data); +void mac_addr_add (struct rte_eth_dev *dev, +struct ether_addr *macadr, +uint32_t index, +uint32_t pool, +void *user_data); +void mac_addr_remove (struct rte_eth_dev *dev,uint32_t index,void *user_data); +void mac_addr_set (struct rte_eth_dev *dev,struct ether_addr *mac_addr, +void *user_data);
Where these functions are implemented? Do we need these declerations?
Quoted 17 lines · Ed Czeck
Enable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this timev5:
* Address comments from Ferruh Yigit <[email protected]>
* Added documentation on driver args
*Makefilefixes
* Safe argument processing
* vdev args to dev argsv4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-bones dev init to avoid compiler warnings
Quoted 5 lines
v3:
* Split large patch into several smaller onesSigned-off-by Ed Czeck <[email protected]>Signed-off-by John Miller <[email protected]>
Because of a makefile update in the tree [1] related dependency resolving, can you please rebase driver on top of latest next-net, taking mentioned modifications into account?
Thanks,
ferruh
[1]
http://dpdk.org/browse/dpdk/commit/?id=feb9f680cd2c1df3d47bf4c05dc872467176e1e3
Re: [PATCH v5 7/7] net/ark: Arkville PMD component integration
In reply to Ferruh YigitQuoted 8 lines · Ferruh Yigit
Quoted 7 lines · Ed Czeck
* Flesh out device configuration
* Add linksdev_ops
* allow dynamic extension loadingSigned-off-by Shepard Siegel <[email protected]>Signed-off-by John Miller <[email protected]>Signed-off-by Ed Czeck <[email protected]>
[...]
Quoted 10 lines
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 339
Quoted 6 lines
drivers/net/ark/ark_ethdev.c +6
-0+/* +* We will create additional devices based on the number of requested +* ports +*/ +int pc =1 ; +int p;I am aware some people prefer the declaring variables close to context, which is good idea, but if I remember correct, there was a patchset, from Adrien, to make DPDK C99 compatible, will this break it?
[...]
Only replying to this part, declaring variables anywhere is fine since C99, so no problem. This is not the preferred style in DPDK as abusing this sometimes makes the code less readable (can lead to super large functions without consistent code blocks).
Signature · 2 lines
Adrien Mazarguil 6WIND
Re: [PATCH v5 2/7] net/ark: provide api to hardware module mpu, rqp, and pktdir
In reply to Ferruh YigitQuoted 10 lines · Ferruh Yigit
Quoted 2 lines · Ed Czeck
Provide C-level interface for Arkville's internal HW resources mpu, pktdir, and rqp modules
At least in commit log, and if possible in documentation, can you please mention what mpu, rqp stands for, and perhaps describe them briefly?
Same for other hardware module patches.
Comments added in header files and commit messages.
Thanks
Ed.
Quoted 9 lines · Ferruh Yigit
Quoted 7 lines · Ed Czeck
Quoted 6 lines
drivers/net/ark/ark_debug.h line 50
Quoted 5 lines
drivers/net/ark/ark_debug.h new file +5
-0+#define ARK_TRACE_ON (fmt, ...) \ + PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__) + +#define ARK_TRACE_OFF (fmt, ...) \ + do {if (0) PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__); } while (0)why not just "do { } while(0)" ?
Quoted 6 lines
Quoted 1 line
A do while body always executes at least once. The if (0) is required.
Are you sure about this?
I believe "do { } while(0)" also removed completely during compile.
I verified that the if (0) is required.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
dev->data->dev_flags|=RTE_ETH_DEV_DETACHABLE;I do not understand your comment.
This flag also should be added, all eth devices by are detachable.
Flag has been added.
Quoted 34 lines
Quoted 11 lines
Quoted 7 lines
The general usage of
DEBUG_TRACEis providing backtrace log, function enterance / exit informations. I guess, that is why it has been controlled by different config option.
Here what you need looks like regular debugging functions,PMD_DRV_LOG/RTE_LOGvariant.I'm unclear on your request or comment. Are you suggesting that we use the dpdk versions of debug? The advantage of a local version is that they can be enabled without all the debug traces.
In many drivers there are independent log macros, two of them are:
1) PMD_.._TRACE
2) PMD_.._LOGThose above controlled by different config option.
As name suggest, first one lets you to get function trace logs, many PMDs don't use them, since you can get this information from debugger.
Second one is PMD wise log macro, controlled by its specific config option.
It is possible enable / disable tracing logs (1), without effecting general logging macros (2).
In ARK PMD, both
ARK_DEBUG_TRACEandPMD_DRV_LOGmacros are used for regular logging.a) I believe it is wrong to use
ARK_DEBUG_TRACEfor regular logging, all should bePMD_DRV_LOGb) And
PMD_DRV_LOGshould be controlled by a config option.
Quoted 7 lines
As far as I can see
ARK_DEBUG_TRACEnever used for tracing really, so you can rename all occurrences toPMD_DRV_LOG, and removeARK_DEBUG_TRACEand its config option.And introduce a config option for
PMD_DRV_LOGThank you. I refactored the messaging and logging code to a set of
macros named PMD_<XX>_LOG, where XX is one of {DEBUG, STATS, RX, TX,DRV}. This follows the code pattern from the Intel PMDs. Much of the logging has been changed throughout the other patches as well.
Re: [PATCH v5 6/7] net/ark: Packet RX support initial version
In reply to Ferruh YigitQuoted 4 lines · Ferruh Yigit
Quoted 2 lines · Ed Czeck
* Core RX packet moving functions
Quoted 8 lines
Quoted 1 line
Signed-off-by Ed Czeck <[email protected]><...>
Quoted 1 line
+/* TODO pick a better function name */
Is it possible to do now :) Thanks.
Done.
Quoted 9 lines
drivers/net/ark/ark_ethdev_rx.c line 666
Quoted 7 lines
drivers/net/ark/ark_ethdev_rx.c new file +5
-0+ +/* Only used in debug */ +static void +dump_mbuf_data (struct rte_mbuf *mbuf,uint16_t lo,uint16_t hi) +{There is already a
rte_pktmbuf_dump(), does it works for you?
The rte_pktmbuf_dump() function dumps data based on the data_off field. My
use here is to examine data in the headroom of an mbuf. A comment was
added before this function to explain the difference.
Quoted 12 lines
<...>
drivers/net/ark/ark_ethdev_rx.h line 44
Quoted 6 lines
drivers/net/ark/ark_ethdev_rx.h new file +6
-0+/* Forward declarations */ +struct rte_mbuf ; +struct rte_mempool ; +struct rte_eth_dev ; +struct rte_eth_stats ; +struct rte_eth_rxconf ;Same comment with Tx patch, these structs can be removed by including proper dpdk headers.
Done
Thanks
Ed.
Quoted 25 lines · Ferruh Yigit
Quoted 17 lines · Ed Czeck
Enable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this timev5:
* Address comments from Ferruh Yigit <[email protected]>
* Added documentation on driver args
*Makefilefixes
* Safe argument processing
* vdev args to dev argsv4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-bones dev init to avoid compiler warningsQuoted 5 lines
v3:
* Split large patch into several smaller onesSigned-off-by Ed Czeck <[email protected]>Signed-off-by John Miller <[email protected]>
Quoted 6 lines
<...>
doc/guides/nics/ark.rst
Quoted 4 lines
doc/guides/nics/ark.rst new file +4
-0+Device Parameters +------------------- + +The ARK PMD supports a series of parameters that are used for packet
routing
Quoted 1 line
Quoted 1 line
+and for internal packet generation and packet checking. This section
describes
Quoted 8 lines
doc/guides/nics/ark.rst
Quoted 8 lines
doc/guides/nics/ark.rst new file +8
-0+the supported parameters. These features are primarily used for +diagnostics, testing, and performance verification. The nominal use +of Arkville does not require any configuration using these parameters. + +"Pkt_dir" + +The Packet Director controls connectivity between the Packet Generator, +Packet Checker, UDM, DDM, and external ingress and egress interfaces
for
Quoted 1 line
Quoted 1 line
+diagnostic purposes. It includes an internal loopback path from the
DDM to the UDM.
Quoted 2 lines
What are UDM and DDM are?
These are clarified in the doc, mostly by removing reference to them.
Quoted 4 lines
Review
Quoted 4 lines
(quoted diff) +2
-0+ +NOTE: Packets from the packet generator to the UDM are all directed to
UDM RX
Quoted 1 line
Quoted 1 line
+queue 0. Packets looped back from the DDM to the UDM are directed to
the same
Quoted 8 lines
Quoted 1 line
+queue number they originated from.
So a packet generator is part of this PMD.
Isn't it overkill for PMD to have packet generator feauture. Is it really needs to be part of PMD? Can be an option to use external packet generators?
The packet generator is part of the arkville hardware. The configuration
file is needed to control it behaviors. Its really not part of the PMD,
just a control hook in the PMD to have access into the FPGA hardware.
Quoted 4 lines
Review
Quoted 4 lines
(quoted diff) +2
-0+ +The packet generator parameter takes a file as its argument. The file
contains configuration
Quoted 1 line
Quoted 1 line
+parameters used internally for regression testing and are not intended
to be published at this
Quoted 5 lines
Quoted 1 line
+level.
If these config options are not planned to use by public, should the stripped from public version of the PMD? Is there a benefit to keep them in dpdk repo?
Internally, we have had this discussion. The features/control are very useful for diagnostic and isolating Arkville hardware from customer logic. Our solution is to have a small set of features as device arguments. For the nominal case these will not be used. However, if there is a special case, we would like to have the option available to access them without dropping in a different PMD.
Quoted 5 lines
drivers/net/ark/ark_ethdev.c
Quoted 5 lines
drivers/net/ark/ark_ethdev.c new file +3
-0+ +/* Internal prototypes */ +static int eth_ark_check_args(struct ark_adapter *ark, const char
*params);
Quoted 8 lines
drivers/net/ark/ark_ethdev.c line 50
Quoted 5 lines
drivers/net/ark/ark_ethdev.c new file +5
-0+static int eth_ark_dev_init (struct rte_eth_dev *dev); +static int eth_ark_dev_uninit (struct rte_eth_dev *eth_dev); +static int eth_ark_dev_configure (struct rte_eth_dev *dev); +static void eth_ark_dev_info_get (struct rte_eth_dev *dev, +struct rte_eth_dev_info *dev_info);This may be personal, but I am for reordering functions and removing static function declarations, its your call.
I'm leaving the order as is. I like to think that there might be a
balance between static prototype declarations and reading the code.
Quoted 7 lines
drivers/net/ark/ark_ethdev.c line 53
Quoted 5 lines
drivers/net/ark/ark_ethdev.c new file +3
-0+ +#define ARK_DEV_TO_PCI (eth_dev) \ + RTE_DEV_TO_PCI((eth_dev)->device)This macro can go to header file,
ark_ethdev.hperhaps?
Moved to .h file
Quoted 4 lines
<...>
Quoted 13 lines
drivers/net/ark/ark_ethdev.c
Quoted 13 lines
drivers/net/ark/ark_ethdev.c new file +13
-0+ +if (pci_dev->device.devargs) +eth_ark_check_args (ark, pci_dev->device.devargs->args); +else +PMD_DRV_LOG (INFO ,"No Device args found\n" ); + + + ark->bar0 = (uint8_t *)pci_dev->mem_resource[0 ].addr; + ark->a_bar = (uint8_t *)pci_dev->mem_resource[2 ].addr; + + dev->dev_ops = &ark_eth_dev_ops; + +/* We process our args last as they require everything to be
setup */
Quoted 6 lines
drivers/net/ark/ark_ethdev.c line 130
Quoted 4 lines
drivers/net/ark/ark_ethdev.c new file +4
-0+if (pci_dev->device.devargs) +eth_ark_check_args (ark, pci_dev->device.devargs->args); +else +PMD_DRV_LOG (INFO ,"No Device args found\n" );This is duplicate, please check ~10 lines above.
Duplicate code removed.
Quoted 4 lines
Should check the return value of the function, is it OK to continue if invalid devargs provided by user?
Return values are now checked.
Quoted 13 lines
drivers/net/ark/ark_ethdev.c line 151
Quoted 11 lines
drivers/net/ark/ark_ethdev.c new file +9
-0+ +return ret; +} + +static int +eth_ark_dev_uninit (struct rte_eth_dev *dev) +{ +if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) +return 0 ;Should primary process check also required in
eth_ark_dev_init()?
See comments in patch 7 for a explanation.
Quoted 8 lines
drivers/net/ark/ark_ethdev.c
Quoted 8 lines
drivers/net/ark/ark_ethdev.c new file +6
-0+ +if (rte_kvargs_process (kvlist, +ARK_PKTDIR_ARG , + &process_pktdir_arg, + ark) !=0 ) { + PMD_DRV_LOG(ERR, "Unable to parse arg %s\n",
ARK_PKTDIR_ARG);
Quoted 2 lines
No error returned for this case?
Error are properly handled in this function and it caller.
Quoted 6 lines
Quoted 3 lines
+RTE_PMD_REGISTER_PCI(eth_ark, rte_ark_pmd.pci_drv);
Net device names updated,
eth_xxx->net_xxx. This should benet_ark.
Updated to net_ark
Thanks,
Ed.
Re: [PATCH v5 7/7] net/ark: Arkville PMD component integration
In reply to Ferruh YigitQuoted 9 lines · Ferruh Yigit
Quoted 7 lines · Ed Czeck
* Flesh out device configuration
* Add linksdev_ops
* allow dynamic extension loadingSigned-off-by Shepard Siegel <[email protected]>Signed-off-by John Miller <[email protected]>Signed-off-by Ed Czeck <[email protected]>
Quoted 7 lines
<...>
Quoted 1 line
+FW version = Y
FW version is not required, as far as I can see, it requires
fw_version_geteth_dev_opsimplemented.
Entry removed.
Quoted 14 lines
<...>
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev,
Quoted 11 lines
drivers/net/ark/ark_ethdev.c +9
-0+/* We are a single function multi-port device. */ +const unsigned int numa_node =rte_socket_id (); +struct ether_addr adr; + + ret =ark_config_device (dev); dev->dev_ops = &ark_eth_dev_ops; + dev->data->mac_addrs =rte_zmalloc ("ark" ,ETHER_ADDR_LEN ,0 ); +if (!dev->data->mac_addrs) { + PMD_DRV_LOG(ERR, + "Failed to allocated memory for storing mac
Quoted 8 lines
address"
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev,
Quoted 3 lines
drivers/net/ark/ark_ethdev.c +3
-0+ ); + } + ether_addr_copy((struct ether_addr *)&adr,&dev->data->mac_addrs[0]);
"adr" has random value at this point, right? Why to copy it?
Code removed. The mac address is left as 0, since arkville does not
include a mac.
Quoted 7 lines
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 339
Quoted 2 lines
drivers/net/ark/ark_ethdev.c +2
-0+int pc =1 ; +int p;I am aware some people prefer the declaring variables close to context, which is good idea, but if I remember correct, there was a patchset, from Adrien, to make DPDK C99 compatible, will this break it?
I moved the declarations to the top of the function to match the dpdk style.
Quoted 10 lines
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev,
Quoted 3 lines
drivers/net/ark/ark_ethdev.c +3
-0+ +if (ark->user_ext.dev_get_port_count) { + pc = ark->user_ext.dev_get_port_count(dev,
ark->user_data);drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 345
Quoted 3 lines
drivers/net/ark/ark_ethdev.c +3
-0+ ark->num_ports = pc; + }else { + ark->num_ports =1 ;Because pc has default value of "1", this if statement can be simplified.
Code has been simplified to 3 lines.
Quoted 37 lines
Quoted 16 lines
drivers/net/ark/ark_ethdev.c +15
-0+ } +for (p =0 ; p < pc; p++) { +struct ark_port *port; + + port = &ark->port[p]; +struct rte_eth_dev_data *data =NULL ; + + port->id = p; + +char name[RTE_ETH_NAME_MAX_LEN ]; + +snprintf (name,sizeof (name),"arketh%d" , + dev->data->port_id + p); + +if (p ==0 ) {drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev,
Quoted 10 lines
drivers/net/ark/ark_ethdev.c +10
-0+/* First port is already allocated by DPDK */ + port->eth_dev = ark->eth_dev; +continue ; + } + +/* reserve an ethdev entry */ + port->eth_dev =rte_eth_dev_allocate (name); +if (!port->eth_dev) { + PMD_DRV_LOG(ERR, + "Could not allocate eth_dev for port%d\n",
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev,
Quoted 5 lines
drivers/net/ark/ark_ethdev.c +5
-0+ p); + goto error; + } + + data = rte_zmalloc_socket(name, sizeof(*data), 0,
numa_node);drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev,
Quoted 3 lines
drivers/net/ark/ark_ethdev.c +3
-0+if (!data) { + PMD_DRV_LOG(ERR, + "Could not allocate eth_dev for port%d\n",
Quoted 9 lines
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 382
Quoted 4 lines
drivers/net/ark/ark_ethdev.c +4
-0+ p); + goto error; + } + data->port_id = ark->eth_dev->data->port_id + p;"
ark->eth_dev->data->port_id" isport_idof the first physical ARK device, and it looks like each device may have multiple ports and "p" is theport_idwithin same device.
Arkville is a single PCIE function with 1 or more ports, lets call this p. After initialization each there will be p additional devices, and each device will have exactly 1 port.
We now understand the features of the rte_eth_dev_allocate(), and have simplified this code avoid the unnecessary copies.
Quoted 14 lines
From DPDK point of view,
port_idis a global value incremented one by each eth port, soport_idis a unique value, why adding these two values?Quoted 1 line
+
port->eth_dev->data= data;Why overwriting existing data value?
Quoted 5 lines
drivers/net/ark/ark_ethdev.c +4
-0+ port->eth_dev->device = &pci_dev->device; + + ark->user_ext.dev_init (dev, ark->a_bar, p); + }
Unnecessary coping has been removed.
Quoted 11 lines
<...>
Quoted 3 lines
static int
eth_ark_dev_uninit(struct rte_eth_dev *dev)
{Shouldn't uninit go thorough all ports ("for (p = 0; p < pc; p++) ") and uninit them all?
Arkville has one PCIE function, during initialization we determine the
number of ports, and from that one device for each port will be created.
At the end, there will be p devices, each with one port. So during device
uninit, there is only 1 port.
Quoted 28 lines
<...>
Quoted 13 lines
drivers/net/ark/ark_ext.h new file +13
-0+/* +* The following functions are optional and are directly mapped +* from the DPDK PMD ops structure. +* Each function if implemented is called after the ARK PMD +* implementation executes. +*/ +int dev_configure (struct rte_eth_dev *dev,void *user_data); +int dev_start (struct rte_eth_dev *dev,void *user_data); +void dev_stop (struct rte_eth_dev *dev,void *user_data); +void dev_close (struct rte_eth_dev *dev,void *user_data); +int link_update (struct rte_eth_dev *dev,int wait_to_complete, +void *user_data); +int dev_set_link_up (struct rte_eth_dev *dev,void *user_data);drivers/net/ark/ark_ext.h
Quoted 10 lines
drivers/net/ark/ark_ext.h new file +10
-0+int dev_set_link_down (struct rte_eth_dev *dev,void *user_data); +void stats_get (struct rte_eth_dev *dev,struct rte_eth_stats *stats, +void *user_data); +void stats_reset (struct rte_eth_dev *dev,void *user_data); +void mac_addr_add (struct rte_eth_dev *dev, +struct ether_addr *macadr, +uint32_t index, +uint32_t pool, +void *user_data); +void mac_addr_remove(struct rte_eth_dev *dev, uint32_t index, void
*user_data);
Quoted 5 lines
drivers/net/ark/ark_ext.h line 77
Quoted 2 lines
drivers/net/ark/ark_ext.h new file +2
-0+void mac_addr_set (struct rte_eth_dev *dev,struct ether_addr *mac_addr, +void *user_data);Where these functions are implemented? Do we need these declarations?
The following comment has been added to this file, which addresses your question.
/*
* This is the template file for users who which to define a dynamic
* extension to the Arkville PMD. User's who create an extension
* should include this file and define the necessary and desired
* functions.
* Only 1 function is required for an extension, dev_init(); all other
* functions prototyped in this file are optional.
*/
Thanks
Ed.
PATCH v6 1/7 net/ark: PMD for Atomic Rules Arkville driver stub
In reply to Ed CzeckEnable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this time
v6:
* Address review comments
* Unify messaging, logging and debug macros to ark_logs.h
v5:
* Address comments from Ferruh Yigit <[email protected]>
* Added documentation on driver args
* Makefile fixes
* Safe argument processing
* vdev args to dev args
v4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-bones dev init to avoid compiler warnings
v3:
* Split large patch into several smaller ones
--- MAINTAINERS | 8 + config/common_base | 10 + config/defconfig_arm-armv7a-linuxapp-gcc | 1 + config/defconfig_ppc_64-power8-linuxapp-gcc | 1 + doc/guides/nics/ark.rst | 296 ++++++++++++++++++++++++++++ doc/guides/nics/index.rst | 1 + drivers/net/Makefile | 2 + drivers/net/ark/Makefile | 62 ++++++ drivers/net/ark/ark_ethdev.c | 288 +++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev.h | 41 ++++ drivers/net/ark/ark_global.h | 116 +++++++++++ drivers/net/ark/ark_logs.h | 119 +++++++++++ drivers/net/ark/rte_pmd_ark_version.map | 4 + mk/rte.app.mk | 1 + 14 files changed, 950 insertions(+) create mode 100644 doc/guides/nics/ark.rst create mode 100644 drivers/net/ark/Makefile create mode 100644 drivers/net/ark/ark_ethdev.c create mode 100644 drivers/net/ark/ark_ethdev.h create mode 100644 drivers/net/ark/ark_global.h create mode 100644 drivers/net/ark/ark_logs.h create mode 100644 drivers/net/ark/rte_pmd_ark_version.map
MAINTAINERS +8 -0
@@ -277,6 +277,14 @@ M: Evgeny Schemeilin <[email protected]> F: drivers/net/ena/ F: doc/guides/nics/ena.rst +Atomic Rules ARK +M: Shepard Siegel <[email protected]> +M: Ed Czeck <[email protected]> +M: John Miller <[email protected]> +F: drivers/net/ark/ +F: doc/guides/nics/ark.rst +F: doc/guides/nics/features/ark.ini + Broadcom bnxt M: Stephen Hurd <[email protected]> M: Ajit Khaparde <[email protected]>
config/common_base +10 -0
@@ -353,6 +353,16 @@ CONFIG_RTE_LIBRTE_QEDE_FW="" CONFIG_RTE_LIBRTE_PMD_AF_PACKET=n # +# Compile ARK PMD +# +CONFIG_RTE_LIBRTE_ARK_PMD=y +CONFIG_RTE_LIBRTE_ARK_PAD_TX=y +CONFIG_RTE_LIBRTE_ARK_DEBUG_RX=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_TX=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE=n + +# # Compile the TAP PMD # It is enabled by default for Linux only. #
config/defconfig_arm-armv7a-linuxapp-gcc +1 -0
@@ -61,6 +61,7 @@ CONFIG_RTE_SCHED_VECTOR=n # cannot use those on ARM CONFIG_RTE_KNI_KMOD=n +CONFIG_RTE_LIBRTE_ARK_PMD=n CONFIG_RTE_LIBRTE_EM_PMD=n CONFIG_RTE_LIBRTE_IGB_PMD=n CONFIG_RTE_LIBRTE_CXGBE_PMD=n
config/defconfig_ppc_64-power8-linuxapp-gcc +1 -0
@@ -48,6 +48,7 @@ CONFIG_RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT=n # Note: Initially, all of the PMD drivers compilation are turned off on Power # Will turn on them only after the successful testing on Power +CONFIG_RTE_LIBRTE_ARK_PMD=n CONFIG_RTE_LIBRTE_IXGBE_PMD=n CONFIG_RTE_LIBRTE_I40E_PMD=n CONFIG_RTE_LIBRTE_VIRTIO_PMD=y
doc/guides/nics/ark.rst new file +296 -0
296 lines not on this page · raw message
doc/guides/nics/index.rst +1 -0
@@ -36,6 +36,7 @@ Network Interface Controller Drivers :numbered: overview + ark bnx2x bnxt cxgbe
drivers/net/Makefile +2 -0
@@ -36,6 +36,8 @@ core-libs += librte_net librte_kvargs DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet DEPDIRS-af_packet = $(core-libs) +DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark +DEPDIRS-ark = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x DEPDIRS-bnx2x = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += bonding
drivers/net/ark/Makefile new file +62 -0
62 lines not on this page · raw message
drivers/net/ark/ark_ethdev.c new file +288 -0
288 lines not on this page · raw message
drivers/net/ark/ark_ethdev.h new file +41 -0
41 lines not on this page · raw message
drivers/net/ark/ark_global.h new file +116 -0
116 lines not on this page · raw message
drivers/net/ark/ark_logs.h new file +119 -0
119 lines not on this page · raw message
drivers/net/ark/rte_pmd_ark_version.map new file +4 -0
@@ -0,0 +1,4 @@ +DPDK_17.05 { + local: *; + +};
mk/rte.app.mk +1 -0
@@ -103,6 +103,7 @@ ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) # plugins (link only if static libraries) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet +_LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += -lrte_pmd_ark _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz _LDLIBS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += -lrte_pmd_bnxt _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond
Signature · 1 line
1.9.1
PATCH v6 2/7 net/ark: Provide API for hardware modules mpu, rqp, and pktdir
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources mpu, (Memory Prefetch Unit) pktdir (Packet director), and rqp (Request Pacer) modules
v6:
* Unify messaging and logging
* Expand comments
--- drivers/net/ark/Makefile | 4 +- drivers/net/ark/ark_mpu.c | 181 +++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_mpu.h | 154 ++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktdir.c | 80 +++++++++++++++++++ drivers/net/ark/ark_pktdir.h | 70 +++++++++++++++++ drivers/net/ark/ark_rqp.c | 91 ++++++++++++++++++++++ drivers/net/ark/ark_rqp.h | 84 ++++++++++++++++++++ 7 files changed, 663 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ark/ark_mpu.c create mode 100644 drivers/net/ark/ark_mpu.h create mode 100644 drivers/net/ark/ark_pktdir.c create mode 100644 drivers/net/ark/ark_pktdir.h create mode 100644 drivers/net/ark/ark_rqp.c create mode 100644 drivers/net/ark/ark_rqp.h
drivers/net/ark/Makefile +3 -1
@@ -47,7 +47,9 @@ LIBABIVER := 1 # all source are stored in SRCS-y # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c - +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += lib/librte_mbuf
drivers/net/ark/ark_mpu.c new file +181 -0
181 lines not on this page · raw message
drivers/net/ark/ark_mpu.h new file +154 -0
154 lines not on this page · raw message
drivers/net/ark/ark_pktdir.c new file +80 -0
80 lines not on this page · raw message
drivers/net/ark/ark_pktdir.h new file +70 -0
70 lines not on this page · raw message
drivers/net/ark/ark_rqp.c new file +91 -0
91 lines not on this page · raw message
drivers/net/ark/ark_rqp.h new file +84 -0
84 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v6 3/7 net/ark: Provide API for hardware modules udm and ddm
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources ddm (Downstream Data Mover) and udm (Upstream Data Mover) modules
v6:
* Unify messaging and logging
--- drivers/net/ark/Makefile | 4 +- drivers/net/ark/ark_ddm.c | 151 +++++++++++++++++++++++++++++++ drivers/net/ark/ark_ddm.h | 177 ++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_udm.c | 226 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_udm.h | 192 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 749 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ark/ark_ddm.c create mode 100644 drivers/net/ark/ark_ddm.h create mode 100644 drivers/net/ark/ark_udm.c create mode 100644 drivers/net/ark/ark_udm.h
drivers/net/ark/Makefile +3 -1
@@ -46,10 +46,12 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c -SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_udm.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += lib/librte_mbuf
drivers/net/ark/ark_ddm.c new file +151 -0
151 lines not on this page · raw message
drivers/net/ark/ark_ddm.h new file +177 -0
177 lines not on this page · raw message
drivers/net/ark/ark_udm.c new file +226 -0
226 lines not on this page · raw message
drivers/net/ark/ark_udm.h new file +192 -0
192 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v6 4/7 net/ark: Provide API for hardware modules pktchkr and pktgen
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources pktchkr and pktgen
v6:
* bug fix handing empty dev arguments.
* Unify messaging and logging
* Improve comments
--- drivers/net/ark/Makefile | 2 + drivers/net/ark/ark_pktchkr.c | 474 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktchkr.h | 117 ++++++++++ drivers/net/ark/ark_pktgen.c | 496 ++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktgen.h | 108 +++++++++ 5 files changed, 1197 insertions(+) create mode 100644 drivers/net/ark/ark_pktchkr.c create mode 100644 drivers/net/ark/ark_pktchkr.h create mode 100644 drivers/net/ark/ark_pktgen.c create mode 100644 drivers/net/ark/ark_pktgen.h
drivers/net/ark/Makefile +2 -0
@@ -49,7 +49,9 @@ LIBABIVER := 1 SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktgen.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_udm.c
drivers/net/ark/ark_pktchkr.c new file +474 -0
474 lines not on this page · raw message
drivers/net/ark/ark_pktchkr.h new file +117 -0
117 lines not on this page · raw message
drivers/net/ark/ark_pktgen.c new file +496 -0
496 lines not on this page · raw message
drivers/net/ark/ark_pktgen.h new file +108 -0
108 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v6 5/7 net/ark: Packet TX support initial version
In reply to Ed Czeck* Core TX packet moving functions
* Flesh out ark_adapter struct to support TX code
(not all fields used at this patch
v6:
* Unify messages and logging
* improve comments
* Use of PRIu32 format where needed
--- drivers/net/ark/Makefile | 1 + drivers/net/ark/ark_ethdev_tx.c | 468 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev_tx.h | 59 +++++ drivers/net/ark/ark_global.h | 28 +++ 4 files changed, 556 insertions(+) create mode 100644 drivers/net/ark/ark_ethdev_tx.c create mode 100644 drivers/net/ark/ark_ethdev_tx.h
drivers/net/ark/Makefile +1 -0
@@ -48,6 +48,7 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_tx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c
drivers/net/ark/ark_ethdev_tx.c new file +468 -0
468 lines not on this page · raw message
drivers/net/ark/ark_ethdev_tx.h new file +59 -0
59 lines not on this page · raw message
drivers/net/ark/ark_global.h +28 -0
@@ -47,6 +47,10 @@#include <rte_dev.h> #include <rte_version.h> +#include "ark_pktdir.h" +#include "ark_pktgen.h" +#include "ark_pktchkr.h" +#define ETH_ARK_ARG_MAXLEN 64#define ARK_SYSCTRL_BASE 0x0#define ARK_PKTGEN_BASE 0x10000
@@ -91,6 +95,12 @@ struct ark_adapter {/* User extension private data */ void *user_data; +/* Pointers to packet generator and checker */ +int start_pg; +ark_pkt_gen_t pg; +ark_pkt_chkr_t pc; +ark_pkt_dir_t pd; +struct ark_port port[ARK_MAX_PORTS ];int num_ports;
@@ -109,6 +119,24 @@ struct ark_adapter {/* Application Bar */ uint8_t *a_bar; + +/* Arkville demo block offsets */ +def_ptr (sys_ctrl, sysctrl); +def_ptr (pkt_gen, pktgen); +def_ptr (mpu_rx, mpurx); +def_ptr (UDM , udm); +def_ptr (mpu_tx, mputx); +def_ptr (DDM , ddm); +def_ptr (CMAC , cmac); +def_ptr (external, external); +def_ptr (pkt_dir, pktdir); +def_ptr (pkt_chkr, pktchkr); + +int started; +uint16_t rx_queues; +uint16_t tx_queues; + +struct ark_rqpace_t *rqpacing; };typedef uint32_t *ark_t ;
Signature · 1 line
1.9.1
PATCH v6 6/7 net/ark: Packet RX support initial version
In reply to Ed Czeck* Core RX packet moving functions
v6:
* Unify messaging and logging
* Use PRIu32 format where needed
* Address review comments
--- drivers/net/ark/Makefile | 1 + drivers/net/ark/ark_ethdev_rx.c | 672 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev_rx.h | 65 ++++ 3 files changed, 738 insertions(+) create mode 100644 drivers/net/ark/ark_ethdev_rx.c create mode 100644 drivers/net/ark/ark_ethdev_rx.h
drivers/net/ark/Makefile +1 -0
@@ -48,6 +48,7 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_rx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_tx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c
drivers/net/ark/ark_ethdev_rx.c new file +672 -0
672 lines not on this page · raw message
drivers/net/ark/ark_ethdev_rx.h new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v6 7/7 net/ark: Arkville PMD component integration
In reply to Ed Czeck* Flesh out device configuration
* Add links dev_ops
* allow dynamic extension loading
v6:
* Address review issues
* Unify messages and logging
* Improved error capturing
--- doc/guides/nics/features/ark.ini | 14 + drivers/net/ark/ark_ethdev.c | 679 ++++++++++++++++++++++++++++++++++++++- drivers/net/ark/ark_ext.h | 115 +++++++ drivers/net/ark/ark_global.h | 25 +- 4 files changed, 827 insertions(+), 6 deletions(-) create mode 100644 doc/guides/nics/features/ark.ini create mode 100644 drivers/net/ark/ark_ext.h
doc/guides/nics/features/ark.ini new file +14 -0
@@ -0,0 +1,14 @@ +; +; Supported features of the 'ark' poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Queue start/stop = Y +Jumbo frame = Y +Scattered Rx = Y +Basic stats = Y +Stats per queue = Y +Linux UIO = Y +x86-64 = Y +Usage doc = Y
drivers/net/ark/ark_ethdev.c +677 -2
767 lines not on this page · raw message
drivers/net/ark/ark_ext.h new file +115 -0
115 lines not on this page · raw message
drivers/net/ark/ark_global.h +21 -4
@@ -86,9 +86,26 @@void *v; \ }name -struct ark_port { -struct rte_eth_dev *eth_dev; -int id; +struct ark_user_ext { +void *(*dev_init)(struct rte_eth_dev *,void *abar,int port_id); +void (*dev_uninit)(struct rte_eth_dev *,void *); +int (*dev_get_port_count)(struct rte_eth_dev *,void *); +int (*dev_configure)(struct rte_eth_dev *,void *); +int (*dev_start)(struct rte_eth_dev *,void *); +void (*dev_stop)(struct rte_eth_dev *,void *); +void (*dev_close)(struct rte_eth_dev *,void *); +int (*link_update)(struct rte_eth_dev *,int wait_to_complete,void *); +int (*dev_set_link_up)(struct rte_eth_dev *,void *); +int (*dev_set_link_down)(struct rte_eth_dev *,void *); +void (*stats_get)(struct rte_eth_dev *,struct rte_eth_stats *,void *); +void (*stats_reset)(struct rte_eth_dev *,void *); +void (*mac_addr_add)(struct rte_eth_dev *, +struct ether_addr *, +uint32_t , +uint32_t , +void *); +void (*mac_addr_remove)(struct rte_eth_dev *,uint32_t ,void *); +void (*mac_addr_set)(struct rte_eth_dev *,struct ether_addr *,void *); };struct ark_adapter {
@@ -101,7 +118,6 @@ struct ark_adapter {ark_pkt_chkr_t pc;ark_pkt_dir_t pd; -struct ark_port port[ARK_MAX_PORTS ];int num_ports;/* Packet generator/checker args */
@@ -113,6 +129,7 @@ struct ark_adapter {struct rte_eth_dev *eth_dev;void *d_handle; +struct ark_user_ext user_ext;/* Our Bar 0 */ uint8_t *bar0;
Signature · 1 line
1.9.1
Quoted 18 lines · Ed Czeck
On Tue, Mar 28, 2017 at 8:58 AM, Ferruh Yigit <[email protected] <mailto:[email protected]>> wrote:
On 3/23/2017 7:46 PM, Ed Czeck wrote: >> > +#define ARK_TRACE_ON(fmt, ...) \ >> > + PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__) >> > + >> > +#define ARK_TRACE_OFF(fmt, ...) \ >> > + do {if (0) PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__); } while (0) >> why not just "do { } while(0)" ? > > A do while body always executes at least once. The if (0) is required. Are you sure about this? I believe "do { } while(0)" also removed completely during compile.
Quoted 1 line
I verified that the if (0) is required.
I have seen a comment added in next version:
/* This pattern allows compiler check arguments even if disabled */
This clarifies the usage, and if(0), thanks.
Re: [PATCH v6 7/7] net/ark: Arkville PMD component integration
In reply to Ed CzeckQuoted 12 lines · Ed Czeck
* Flesh out device configuration
* Add linksdev_ops
* allow dynamic extension loadingv6:
* Address review issues
* Unify messages and logging
* Improved error capturingSigned-off-by Shepard Siegel <[email protected]>Signed-off-by John Miller <[email protected]>Signed-off-by Ed Czeck <[email protected]>
<...>
Quoted 4 lines
drivers/net/ark/ark_ethdev.c +4
-0+/* Setup the packet generator */ +if (ark->pkt_gen_args) { +PMD_DRV_LOG (INFO ,"Setting up the packet generator\n" ); +ark_pktgen_parse (ark->pkt_gen_args);
drivers/net/ark/ark_ethdev.c static void eth_ark_dev_info_get(struct rte_eth_dev *dev, · line 952
Quoted 10 lines
drivers/net/ark/ark_ethdev.c +10
-0+ark_pktgen_reset (ark->pg); +ark_pktgen_setup (ark->pg); + ark->start_pg =1 ; + } + +/* Setup the packet checker */ +if (ark->pkt_chkr_args) { +ark_pktchkr_parse (ark->pkt_chkr_args); +ark_pktchkr_setup (ark->pc); + }
This cause build error [1] with clang, which seems a valid one.
[1].../drivers/net/ark/ark_ethdev.c:940:11: error: address of array 'ark->pkt_gen_args' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
if (ark->pkt_gen_args) {
~~ ~~~~~^~~~~~~~~~~~
.../drivers/net/ark/ark_ethdev.c:949:11: error: address of array
'ark->pkt_chkr_args' will always evaluate to 'true'
[-Werror,-Wpointer-bool-conversion]
if (ark->pkt_chkr_args) {
~~ ~~~~~^~~~~~~~~~~~~PATCH v7 1/7 net/ark: stub PMD for Atomic Rules Arkville
In reply to Ed CzeckEnable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this time
v6:
* Address review comments
* Unify messaging, logging and debug macros to ark_logs.h
v5:
* Address comments from Ferruh Yigit <[email protected]>
* Added documentation on driver args
* Makefile fixes
* Safe argument processing
* vdev args to dev args
v4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-bones dev init to avoid compiler warnings
v3:
* Split large patch into several smaller ones
--- MAINTAINERS | 8 + config/common_base | 10 ++ config/defconfig_arm-armv7a-linuxapp-gcc | 1 + doc/guides/nics/ark.rst | 296 +++++++++++++++++++++++++++++++ doc/guides/nics/index.rst | 1 + drivers/net/Makefile | 2 + drivers/net/ark/Makefile | 56 ++++++ drivers/net/ark/ark_ethdev.c | 288 ++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev.h | 41 +++++ drivers/net/ark/ark_global.h | 116 ++++++++++++ drivers/net/ark/ark_logs.h | 119 +++++++++++++ drivers/net/ark/rte_pmd_ark_version.map | 4 + mk/rte.app.mk | 1 + 13 files changed, 943 insertions(+) create mode 100644 doc/guides/nics/ark.rst create mode 100644 drivers/net/ark/Makefile create mode 100644 drivers/net/ark/ark_ethdev.c create mode 100644 drivers/net/ark/ark_ethdev.h create mode 100644 drivers/net/ark/ark_global.h create mode 100644 drivers/net/ark/ark_logs.h create mode 100644 drivers/net/ark/rte_pmd_ark_version.map
MAINTAINERS +8 -0
@@ -278,6 +278,14 @@ M: Evgeny Schemeilin <[email protected]> F: drivers/net/ena/ F: doc/guides/nics/ena.rst +Atomic Rules ARK +M: Shepard Siegel <[email protected]> +M: Ed Czeck <[email protected]> +M: John Miller <[email protected]> +F: drivers/net/ark/ +F: doc/guides/nics/ark.rst +F: doc/guides/nics/features/ark.ini + Broadcom bnxt M: Stephen Hurd <[email protected]> M: Ajit Khaparde <[email protected]>
config/common_base +10 -0
@@ -385,6 +385,16 @@ CONFIG_RTE_LIBRTE_QEDE_FW="" CONFIG_RTE_LIBRTE_PMD_AF_PACKET=n # +# Compile ARK PMD +# +CONFIG_RTE_LIBRTE_ARK_PMD=y +CONFIG_RTE_LIBRTE_ARK_PAD_TX=y +CONFIG_RTE_LIBRTE_ARK_DEBUG_RX=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_TX=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE=n + +# # Compile WRS accelerated virtual port (AVP) guest PMD driver # CONFIG_RTE_LIBRTE_AVP_PMD=n
config/defconfig_arm-armv7a-linuxapp-gcc +1 -0
@@ -61,6 +61,7 @@ CONFIG_RTE_SCHED_VECTOR=n # cannot use those on ARM CONFIG_RTE_KNI_KMOD=n +CONFIG_RTE_LIBRTE_ARK_PMD=n CONFIG_RTE_LIBRTE_EM_PMD=n CONFIG_RTE_LIBRTE_IGB_PMD=n CONFIG_RTE_LIBRTE_CXGBE_PMD=n
doc/guides/nics/ark.rst new file +296 -0
296 lines not on this page · raw message
doc/guides/nics/index.rst +1 -0
@@ -36,6 +36,7 @@ Network Interface Controller Drivers :numbered: overview + ark avp bnx2x bnxt
drivers/net/Makefile +2 -0
@@ -36,6 +36,8 @@ core-libs += librte_net librte_kvargs DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet DEPDIRS-af_packet = $(core-libs) +DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark +DEPDIRS-ark = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_AVP_PMD) += avp DEPDIRS-avp = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x
drivers/net/ark/Makefile new file +56 -0
56 lines not on this page · raw message
drivers/net/ark/ark_ethdev.c new file +288 -0
288 lines not on this page · raw message
drivers/net/ark/ark_ethdev.h new file +41 -0
41 lines not on this page · raw message
drivers/net/ark/ark_global.h new file +116 -0
116 lines not on this page · raw message
drivers/net/ark/ark_logs.h new file +119 -0
119 lines not on this page · raw message
drivers/net/ark/rte_pmd_ark_version.map new file +4 -0
@@ -0,0 +1,4 @@ +DPDK_17.05 { + local: *; + +};
mk/rte.app.mk +1 -0
@@ -102,6 +102,7 @@ ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) # plugins (link only if static libraries) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet +_LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += -lrte_pmd_ark _LDLIBS-$(CONFIG_RTE_LIBRTE_AVP_PMD) += -lrte_pmd_avp _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz _LDLIBS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += -lrte_pmd_bnxt
Signature · 1 line
1.9.1
PATCH v7 2/7 net/ark: provide API for hardware modules mpu rqp and pktdir
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources mpu, (Memory Prefetch Unit) pktdir (Packet director), and rqp (Request Pacer) modules
v6:
* Unify messaging and logging
* Expand comments
--- drivers/net/ark/Makefile | 4 +- drivers/net/ark/ark_mpu.c | 181 +++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_mpu.h | 154 ++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktdir.c | 80 +++++++++++++++++++ drivers/net/ark/ark_pktdir.h | 70 +++++++++++++++++ drivers/net/ark/ark_rqp.c | 91 ++++++++++++++++++++++ drivers/net/ark/ark_rqp.h | 84 ++++++++++++++++++++ 7 files changed, 663 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ark/ark_mpu.c create mode 100644 drivers/net/ark/ark_mpu.h create mode 100644 drivers/net/ark/ark_pktdir.c create mode 100644 drivers/net/ark/ark_pktdir.h create mode 100644 drivers/net/ark/ark_rqp.c create mode 100644 drivers/net/ark/ark_rqp.h
drivers/net/ark/Makefile +3 -1
@@ -47,7 +47,9 @@ LIBABIVER := 1 # all source are stored in SRCS-y # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c - +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c # this lib depends upon: LDLIBS += -lpthread
drivers/net/ark/ark_mpu.c new file +181 -0
181 lines not on this page · raw message
drivers/net/ark/ark_mpu.h new file +154 -0
154 lines not on this page · raw message
drivers/net/ark/ark_pktdir.c new file +80 -0
80 lines not on this page · raw message
drivers/net/ark/ark_pktdir.h new file +70 -0
70 lines not on this page · raw message
drivers/net/ark/ark_rqp.c new file +91 -0
91 lines not on this page · raw message
drivers/net/ark/ark_rqp.h new file +84 -0
84 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v7 3/7 net/ark: provide API for hardware modules udm and ddm
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources ddm (Downstream Data Mover) and udm (Upstream Data Mover) modules
v6:
* Unify messaging and logging
--- drivers/net/ark/Makefile | 4 +- drivers/net/ark/ark_ddm.c | 151 +++++++++++++++++++++++++++++++ drivers/net/ark/ark_ddm.h | 177 ++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_udm.c | 226 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_udm.h | 192 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 749 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ark/ark_ddm.c create mode 100644 drivers/net/ark/ark_ddm.h create mode 100644 drivers/net/ark/ark_udm.c create mode 100644 drivers/net/ark/ark_udm.h
drivers/net/ark/Makefile +3 -1
@@ -46,10 +46,12 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c -SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_udm.c # this lib depends upon: LDLIBS += -lpthread
drivers/net/ark/ark_ddm.c new file +151 -0
151 lines not on this page · raw message
drivers/net/ark/ark_ddm.h new file +177 -0
177 lines not on this page · raw message
drivers/net/ark/ark_udm.c new file +226 -0
226 lines not on this page · raw message
drivers/net/ark/ark_udm.h new file +192 -0
192 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v7 4/7 net/ark: provide API for hardware modules pktchkr and pktgen
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources pktchkr and pktgen
v6:
* bug fix handing empty dev arguments.
* Unify messaging and logging
* Improve comments
--- drivers/net/ark/Makefile | 2 + drivers/net/ark/ark_pktchkr.c | 474 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktchkr.h | 117 ++++++++++ drivers/net/ark/ark_pktgen.c | 496 ++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktgen.h | 108 +++++++++ 5 files changed, 1197 insertions(+) create mode 100644 drivers/net/ark/ark_pktchkr.c create mode 100644 drivers/net/ark/ark_pktchkr.h create mode 100644 drivers/net/ark/ark_pktgen.c create mode 100644 drivers/net/ark/ark_pktgen.h
drivers/net/ark/Makefile +2 -0
@@ -49,7 +49,9 @@ LIBABIVER := 1 SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktgen.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_udm.c
drivers/net/ark/ark_pktchkr.c new file +474 -0
474 lines not on this page · raw message
drivers/net/ark/ark_pktchkr.h new file +117 -0
117 lines not on this page · raw message
drivers/net/ark/ark_pktgen.c new file +496 -0
496 lines not on this page · raw message
drivers/net/ark/ark_pktgen.h new file +108 -0
108 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v7 5/7 net/ark: packet Tx support initial version
In reply to Ed Czeck* Core TX packet moving functions
* Flesh out ark_adapter struct to support TX code
(not all fields used at this patch
v6:
* Unify messages and logging
* improve comments
* Use of PRIu32 format where needed
--- drivers/net/ark/Makefile | 1 + drivers/net/ark/ark_ethdev_tx.c | 468 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev_tx.h | 59 +++++ drivers/net/ark/ark_global.h | 28 +++ 4 files changed, 556 insertions(+) create mode 100644 drivers/net/ark/ark_ethdev_tx.c create mode 100644 drivers/net/ark/ark_ethdev_tx.h
drivers/net/ark/Makefile +1 -0
@@ -48,6 +48,7 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_tx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c
drivers/net/ark/ark_ethdev_tx.c new file +468 -0
468 lines not on this page · raw message
drivers/net/ark/ark_ethdev_tx.h new file +59 -0
59 lines not on this page · raw message
drivers/net/ark/ark_global.h +28 -0
@@ -47,6 +47,10 @@#include <rte_dev.h> #include <rte_version.h> +#include "ark_pktdir.h" +#include "ark_pktgen.h" +#include "ark_pktchkr.h" +#define ETH_ARK_ARG_MAXLEN 64#define ARK_SYSCTRL_BASE 0x0#define ARK_PKTGEN_BASE 0x10000
@@ -91,6 +95,12 @@ struct ark_adapter {/* User extension private data */ void *user_data; +/* Pointers to packet generator and checker */ +int start_pg; +ark_pkt_gen_t pg; +ark_pkt_chkr_t pc; +ark_pkt_dir_t pd; +struct ark_port port[ARK_MAX_PORTS ];int num_ports;
@@ -109,6 +119,24 @@ struct ark_adapter {/* Application Bar */ uint8_t *a_bar; + +/* Arkville demo block offsets */ +def_ptr (sys_ctrl, sysctrl); +def_ptr (pkt_gen, pktgen); +def_ptr (mpu_rx, mpurx); +def_ptr (UDM , udm); +def_ptr (mpu_tx, mputx); +def_ptr (DDM , ddm); +def_ptr (CMAC , cmac); +def_ptr (external, external); +def_ptr (pkt_dir, pktdir); +def_ptr (pkt_chkr, pktchkr); + +int started; +uint16_t rx_queues; +uint16_t tx_queues; + +struct ark_rqpace_t *rqpacing; };typedef uint32_t *ark_t ;
Signature · 1 line
1.9.1
PATCH v7 6/7 net/ark: packet Rx support initial version
In reply to Ed Czeck* Core RX packet moving functions
v6:
* Unify messaging and logging
* Use PRIu32 format where needed
* Address review comments
--- drivers/net/ark/Makefile | 1 + drivers/net/ark/ark_ethdev_rx.c | 672 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev_rx.h | 65 ++++ 3 files changed, 738 insertions(+) create mode 100644 drivers/net/ark/ark_ethdev_rx.c create mode 100644 drivers/net/ark/ark_ethdev_rx.h
drivers/net/ark/Makefile +1 -0
@@ -48,6 +48,7 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_rx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_tx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c
drivers/net/ark/ark_ethdev_rx.c new file +672 -0
672 lines not on this page · raw message
drivers/net/ark/ark_ethdev_rx.h new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v7 7/7 net/ark: arkville PMD component integration
In reply to Ed Czeck* Flesh out device configuration
* Add links dev_ops
* allow dynamic extension loading
v7:
* Address clang compile issue
v6:
* Address review issues
* Unify messages and logging
* Improved error capturing
--- doc/guides/nics/features/ark.ini | 14 + drivers/net/ark/ark_ethdev.c | 679 ++++++++++++++++++++++++++++++++++++++- drivers/net/ark/ark_ext.h | 115 +++++++ drivers/net/ark/ark_global.h | 25 +- 4 files changed, 827 insertions(+), 6 deletions(-) create mode 100644 doc/guides/nics/features/ark.ini create mode 100644 drivers/net/ark/ark_ext.h
doc/guides/nics/features/ark.ini new file +14 -0
@@ -0,0 +1,14 @@ +; +; Supported features of the 'ark' poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Queue start/stop = Y +Jumbo frame = Y +Scattered Rx = Y +Basic stats = Y +Stats per queue = Y +Linux UIO = Y +x86-64 = Y +Usage doc = Y
drivers/net/ark/ark_ethdev.c +677 -2
767 lines not on this page · raw message
drivers/net/ark/ark_ext.h new file +115 -0
115 lines not on this page · raw message
drivers/net/ark/ark_global.h +21 -4
@@ -86,9 +86,26 @@void *v; \ }name -struct ark_port { -struct rte_eth_dev *eth_dev; -int id; +struct ark_user_ext { +void *(*dev_init)(struct rte_eth_dev *,void *abar,int port_id); +void (*dev_uninit)(struct rte_eth_dev *,void *); +int (*dev_get_port_count)(struct rte_eth_dev *,void *); +int (*dev_configure)(struct rte_eth_dev *,void *); +int (*dev_start)(struct rte_eth_dev *,void *); +void (*dev_stop)(struct rte_eth_dev *,void *); +void (*dev_close)(struct rte_eth_dev *,void *); +int (*link_update)(struct rte_eth_dev *,int wait_to_complete,void *); +int (*dev_set_link_up)(struct rte_eth_dev *,void *); +int (*dev_set_link_down)(struct rte_eth_dev *,void *); +void (*stats_get)(struct rte_eth_dev *,struct rte_eth_stats *,void *); +void (*stats_reset)(struct rte_eth_dev *,void *); +void (*mac_addr_add)(struct rte_eth_dev *, +struct ether_addr *, +uint32_t , +uint32_t , +void *); +void (*mac_addr_remove)(struct rte_eth_dev *,uint32_t ,void *); +void (*mac_addr_set)(struct rte_eth_dev *,struct ether_addr *,void *); };struct ark_adapter {
@@ -101,7 +118,6 @@ struct ark_adapter {ark_pkt_chkr_t pc;ark_pkt_dir_t pd; -struct ark_port port[ARK_MAX_PORTS ];int num_ports;/* Packet generator/checker args */
@@ -113,6 +129,7 @@ struct ark_adapter {struct rte_eth_dev *eth_dev;void *d_handle; +struct ark_user_ext user_ext;/* Our Bar 0 */ uint8_t *bar0;
Signature · 1 line
1.9.1
Re: [PATCH v7 1/7] net/ark: stub PMD for Atomic Rules Arkville
In reply to Ed CzeckQuoted 21 lines · Ed Czeck
Enable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this timev6:
* Address review comments
* Unify messaging, logging and debug macros toark_logs.hv5:
* Address comments from Ferruh Yigit <[email protected]>
* Added documentation on driver args
*Makefilefixes
* Safe argument processing
* vdev args to dev argsv4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-bones dev init to avoid compiler warnings
Quoted 5 lines
v3:
* Split large patch into several smaller onesSigned-off-by Ed Czeck <[email protected]>Signed-off-by John Miller <[email protected]>
Hi Ed,
Can you please update release notes [1] to announce the ARK PMD?
Apart from that, overall PMD looks good to me.
Still I suggest pushing the PMD integration to RC2 phase, to give more chance for reviews.
If PMD gets acked before that time, we can integrate earlier. If there is no objection till RC2, it gets merged in RC2.
This means less time for testing after integration, is merging on RC2 will leave you enough time for testing?
Thanks,
ferruh
[1]doc/guides/rel_notes/release_17_05.rst
Re: [PATCH v7 1/7] net/ark: stub PMD for Atomic Rules Arkville
Hi Ferruh,
Thank you for the terrific news.
Ed is traveling today; we agree with you that pushing to RC2 will allow more chance for reviews with little or no other impact. We will update the release notes [1] to announce ARK PMD on Tuesday by 5PM EDT.
As an aside, I want to mention that Atomic Rules has joined LF/DPDK as a Silver Member. I've been in contact with Tim and Thomas on this. Atomic Rules will included in some of the press around next week's ONS event. We are honored to be part of this group!
-Shep for the Atomic Rules team
Shepard Siegel, CTO
atomicrules.com
Quoted 53 lines · Ferruh Yigit
Quoted 21 lines · Ed Czeck
Enable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this timev6:
* Address review comments
* Unify messaging, logging and debug macros toark_logs.hv5:
* Address comments from Ferruh Yigit <[email protected]>
* Added documentation on driver args
*Makefilefixes
* Safe argument processing
* vdev args to dev argsv4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-bones dev init to avoid compiler warningsQuoted 5 lines
v3:
* Split large patch into several smaller onesSigned-off-by Ed Czeck <[email protected]>Signed-off-by John Miller <[email protected]>Hi Ed,
Can you please update release notes [1] to announce the ARK PMD?
Apart from that, overall PMD looks good to me.
Still I suggest pushing the PMD integration to RC2 phase, to give more chance for reviews.
If PMD gets acked before that time, we can integrate earlier. If there is no objection till RC2, it gets merged in RC2.
This means less time for testing after integration, is merging on RC2 will leave you enough time for testing?
Thanks,
ferruh[1]
doc/guides/rel_notes/release_17_05.rst
PATCH v8 1/7 net/ark: stub PMD for Atomic Rules Arkville
In reply to Ed CzeckEnable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this time
v8:
* Update to allow patch application from dpdk-next-net
v6:
* Address review comments
* Unify messaging, logging and debug macros to ark_logs.h
v5:
* Address comments from Ferruh Yigit <[email protected]>
* Added documentation on driver args
* Makefile fixes
* Safe argument processing
* vdev args to dev args
v4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-bones dev init to avoid compiler warnings
v3:
* Split large patch into several smaller ones
--- MAINTAINERS | 8 + config/common_base | 10 ++ config/defconfig_arm-armv7a-linuxapp-gcc | 1 + doc/guides/nics/ark.rst | 296 +++++++++++++++++++++++++++++++ doc/guides/nics/index.rst | 1 + drivers/net/Makefile | 2 + drivers/net/ark/Makefile | 55 ++++++ drivers/net/ark/ark_ethdev.c | 288 ++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev.h | 41 +++++ drivers/net/ark/ark_global.h | 110 ++++++++++++ drivers/net/ark/ark_logs.h | 119 +++++++++++++ drivers/net/ark/rte_pmd_ark_version.map | 4 + mk/rte.app.mk | 1 + 13 files changed, 936 insertions(+) create mode 100644 doc/guides/nics/ark.rst create mode 100644 drivers/net/ark/Makefile create mode 100644 drivers/net/ark/ark_ethdev.c create mode 100644 drivers/net/ark/ark_ethdev.h create mode 100644 drivers/net/ark/ark_global.h create mode 100644 drivers/net/ark/ark_logs.h create mode 100644 drivers/net/ark/rte_pmd_ark_version.map
MAINTAINERS +8 -0
@@ -281,6 +281,14 @@ M: Evgeny Schemeilin <[email protected]> F: drivers/net/ena/ F: doc/guides/nics/ena.rst +Atomic Rules ARK +M: Shepard Siegel <[email protected]> +M: Ed Czeck <[email protected]> +M: John Miller <[email protected]> +F: drivers/net/ark/ +F: doc/guides/nics/ark.rst +F: doc/guides/nics/features/ark.ini + Broadcom bnxt M: Stephen Hurd <[email protected]> M: Ajit Khaparde <[email protected]>
config/common_base +10 -0
@@ -364,6 +364,16 @@ CONFIG_RTE_LIBRTE_QEDE_FW="" CONFIG_RTE_LIBRTE_PMD_AF_PACKET=n # +# Compile ARK PMD +# +CONFIG_RTE_LIBRTE_ARK_PMD=y +CONFIG_RTE_LIBRTE_ARK_PAD_TX=y +CONFIG_RTE_LIBRTE_ARK_DEBUG_RX=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_TX=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS=n +CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE=n + +# # Compile WRS accelerated virtual port (AVP) guest PMD driver # CONFIG_RTE_LIBRTE_AVP_PMD=n
config/defconfig_arm-armv7a-linuxapp-gcc +1 -0
@@ -61,6 +61,7 @@ CONFIG_RTE_SCHED_VECTOR=n # cannot use those on ARM CONFIG_RTE_KNI_KMOD=n +CONFIG_RTE_LIBRTE_ARK_PMD=n CONFIG_RTE_LIBRTE_EM_PMD=n CONFIG_RTE_LIBRTE_IGB_PMD=n CONFIG_RTE_LIBRTE_CXGBE_PMD=n
doc/guides/nics/ark.rst new file +296 -0
296 lines not on this page · raw message
doc/guides/nics/index.rst +1 -0
@@ -36,6 +36,7 @@ Network Interface Controller Drivers :numbered: overview + ark avp bnx2x bnxt
drivers/net/Makefile +2 -0
@@ -36,6 +36,8 @@ core-libs += librte_net librte_kvargs DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet DEPDIRS-af_packet = $(core-libs) +DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark +DEPDIRS-ark = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_AVP_PMD) += avp DEPDIRS-avp = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += bnx2x
drivers/net/ark/Makefile new file +55 -0
55 lines not on this page · raw message
drivers/net/ark/ark_ethdev.c new file +288 -0
288 lines not on this page · raw message
drivers/net/ark/ark_ethdev.h new file +41 -0
41 lines not on this page · raw message
drivers/net/ark/ark_global.h new file +110 -0
110 lines not on this page · raw message
drivers/net/ark/ark_logs.h new file +119 -0
119 lines not on this page · raw message
drivers/net/ark/rte_pmd_ark_version.map new file +4 -0
@@ -0,0 +1,4 @@ +DPDK_17.05 { + local: *; + +};
mk/rte.app.mk +1 -0
@@ -104,6 +104,7 @@ _LDLIBS-$(CONFIG_RTE_DRIVER_MEMPOOL_RING) += -lrte_mempool_ring _LDLIBS-$(CONFIG_RTE_DRIVER_MEMPOOL_STACK) += -lrte_mempool_stack _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet +_LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += -lrte_pmd_ark _LDLIBS-$(CONFIG_RTE_LIBRTE_AVP_PMD) += -lrte_pmd_avp _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz _LDLIBS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += -lrte_pmd_bnxt
Signature · 1 line
1.9.1
PATCH v8 2/7 net/ark: provide API for hardware modules mpu rqp and pktdir
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources mpu, (Memory Prefetch Unit) pktdir (Packet director), and rqp (Request Pacer) modules
v6:
* Unify messaging and logging
* Expand comments
Conflicts:
drivers/net/ark/Makefile
--- drivers/net/ark/Makefile | 3 + drivers/net/ark/ark_mpu.c | 181 +++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_mpu.h | 154 ++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktdir.c | 80 +++++++++++++++++++ drivers/net/ark/ark_pktdir.h | 70 +++++++++++++++++ drivers/net/ark/ark_rqp.c | 91 ++++++++++++++++++++++ drivers/net/ark/ark_rqp.h | 84 ++++++++++++++++++++ 7 files changed, 663 insertions(+) create mode 100644 drivers/net/ark/ark_mpu.c create mode 100644 drivers/net/ark/ark_mpu.h create mode 100644 drivers/net/ark/ark_pktdir.c create mode 100644 drivers/net/ark/ark_pktdir.h create mode 100644 drivers/net/ark/ark_rqp.c create mode 100644 drivers/net/ark/ark_rqp.h
drivers/net/ark/Makefile +3 -0
@@ -47,6 +47,9 @@ LIBABIVER := 1 # all source are stored in SRCS-y # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c # this lib depends upon: LDLIBS += -lpthread
drivers/net/ark/ark_mpu.c new file +181 -0
181 lines not on this page · raw message
drivers/net/ark/ark_mpu.h new file +154 -0
154 lines not on this page · raw message
drivers/net/ark/ark_pktdir.c new file +80 -0
80 lines not on this page · raw message
drivers/net/ark/ark_pktdir.h new file +70 -0
70 lines not on this page · raw message
drivers/net/ark/ark_rqp.c new file +91 -0
91 lines not on this page · raw message
drivers/net/ark/ark_rqp.h new file +84 -0
84 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v8 3/7 net/ark: provide API for hardware modules udm and ddm
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources ddm (Downstream Data Mover) and udm (Upstream Data Mover) modules
v6:
* Unify messaging and logging
--- drivers/net/ark/Makefile | 2 + drivers/net/ark/ark_ddm.c | 151 +++++++++++++++++++++++++++++++ drivers/net/ark/ark_ddm.h | 177 ++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_udm.c | 226 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_udm.h | 192 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 748 insertions(+) create mode 100644 drivers/net/ark/ark_ddm.c create mode 100644 drivers/net/ark/ark_ddm.h create mode 100644 drivers/net/ark/ark_udm.c create mode 100644 drivers/net/ark/ark_udm.h
drivers/net/ark/Makefile +2 -0
@@ -46,10 +46,12 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_udm.c # this lib depends upon: LDLIBS += -lpthread
drivers/net/ark/ark_ddm.c new file +151 -0
151 lines not on this page · raw message
drivers/net/ark/ark_ddm.h new file +177 -0
177 lines not on this page · raw message
drivers/net/ark/ark_udm.c new file +226 -0
226 lines not on this page · raw message
drivers/net/ark/ark_udm.h new file +192 -0
192 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v8 4/7 net/ark: provide API for hardware modules pktchkr and pktgen
In reply to Ed CzeckProvide C-level interface for Arkville's internal HW resources pktchkr and pktgen
v6:
* bug fix handing empty dev arguments.
* Unify messaging and logging
* Improve comments
--- drivers/net/ark/Makefile | 2 + drivers/net/ark/ark_pktchkr.c | 474 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktchkr.h | 117 ++++++++++ drivers/net/ark/ark_pktgen.c | 496 ++++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_pktgen.h | 108 +++++++++ 5 files changed, 1197 insertions(+) create mode 100644 drivers/net/ark/ark_pktchkr.c create mode 100644 drivers/net/ark/ark_pktchkr.h create mode 100644 drivers/net/ark/ark_pktgen.c create mode 100644 drivers/net/ark/ark_pktgen.h
drivers/net/ark/Makefile +2 -0
@@ -49,7 +49,9 @@ LIBABIVER := 1 SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktgen.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_rqp.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_udm.c
drivers/net/ark/ark_pktchkr.c new file +474 -0
474 lines not on this page · raw message
drivers/net/ark/ark_pktchkr.h new file +117 -0
117 lines not on this page · raw message
drivers/net/ark/ark_pktgen.c new file +496 -0
496 lines not on this page · raw message
drivers/net/ark/ark_pktgen.h new file +108 -0
108 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v8 5/7 net/ark: packet Tx support initial version
In reply to Ed Czeck* Core TX packet moving functions
* Flesh out ark_adapter struct to support TX code
(not all fields used at this patch
v6:
* Unify messages and logging
* improve comments
* Use of PRIu32 format where needed
Conflicts:
drivers/net/ark/ark_global.h
--- drivers/net/ark/Makefile | 1 + drivers/net/ark/ark_ethdev_tx.c | 468 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev_tx.h | 59 +++++ drivers/net/ark/ark_global.h | 28 +++ 4 files changed, 556 insertions(+) create mode 100644 drivers/net/ark/ark_ethdev_tx.c create mode 100644 drivers/net/ark/ark_ethdev_tx.h
drivers/net/ark/Makefile +1 -0
@@ -48,6 +48,7 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_tx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktdir.c
drivers/net/ark/ark_ethdev_tx.c new file +468 -0
468 lines not on this page · raw message
drivers/net/ark/ark_ethdev_tx.h new file +59 -0
59 lines not on this page · raw message
drivers/net/ark/ark_global.h +28 -0
@@ -47,6 +47,10 @@#include <rte_dev.h> #include <rte_version.h> +#include "ark_pktdir.h" +#include "ark_pktgen.h" +#include "ark_pktchkr.h" +#define ETH_ARK_ARG_MAXLEN 64#define ARK_SYSCTRL_BASE 0x0#define ARK_PKTGEN_BASE 0x10000
@@ -86,6 +90,12 @@ struct ark_adapter {/* User extension private data */ void *user_data; +/* Pointers to packet generator and checker */ +int start_pg; +ark_pkt_gen_t pg; +ark_pkt_chkr_t pc; +ark_pkt_dir_t pd; +int num_ports;/* Packet generator/checker args */
@@ -103,6 +113,24 @@ struct ark_adapter {/* Application Bar */ uint8_t *a_bar; + +/* Arkville demo block offsets */ +def_ptr (sys_ctrl, sysctrl); +def_ptr (pkt_gen, pktgen); +def_ptr (mpu_rx, mpurx); +def_ptr (UDM , udm); +def_ptr (mpu_tx, mputx); +def_ptr (DDM , ddm); +def_ptr (CMAC , cmac); +def_ptr (external, external); +def_ptr (pkt_dir, pktdir); +def_ptr (pkt_chkr, pktchkr); + +int started; +uint16_t rx_queues; +uint16_t tx_queues; + +struct ark_rqpace_t *rqpacing; };typedef uint32_t *ark_t ;
Signature · 1 line
1.9.1
PATCH v8 6/7 net/ark: packet Rx support initial version
In reply to Ed Czeck* Core RX packet moving functions
v6:
* Unify messaging and logging
* Use PRIu32 format where needed
* Address review comments
--- drivers/net/ark/Makefile | 1 + drivers/net/ark/ark_ethdev_rx.c | 672 ++++++++++++++++++++++++++++++++++++++++ drivers/net/ark/ark_ethdev_rx.h | 65 ++++ 3 files changed, 738 insertions(+) create mode 100644 drivers/net/ark/ark_ethdev_rx.c create mode 100644 drivers/net/ark/ark_ethdev_rx.h
drivers/net/ark/Makefile +1 -0
@@ -48,6 +48,7 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ddm.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev.c +SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_rx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_ethdev_tx.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_mpu.c SRCS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark_pktchkr.c
drivers/net/ark/ark_ethdev_rx.c new file +672 -0
672 lines not on this page · raw message
drivers/net/ark/ark_ethdev_rx.h new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v8 7/7 net/ark: arkville PMD component integration
In reply to Ed Czeck* Flesh out device configuration
* Add links dev_ops
* allow dynamic extension loading
* update release notes and feature listing
v8:
* update release notes
v7:
* Address clang compile issue
v6:
* Address review issues
* Unify messages and logging
* Improved error capturing
Conflicts:
drivers/net/ark/ark_global.h
--- doc/guides/nics/features/ark.ini | 14 + doc/guides/rel_notes/release_17_05.rst | 7 +- drivers/net/ark/ark_ethdev.c | 679 ++++++++++++++++++++++++++++++++- drivers/net/ark/ark_ext.h | 115 ++++++ drivers/net/ark/ark_global.h | 23 ++ 5 files changed, 835 insertions(+), 3 deletions(-) create mode 100644 doc/guides/nics/features/ark.ini create mode 100644 drivers/net/ark/ark_ext.h
doc/guides/nics/features/ark.ini new file +14 -0
@@ -0,0 +1,14 @@ +; +; Supported features of the 'ark' poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Queue start/stop = Y +Jumbo frame = Y +Scattered Rx = Y +Basic stats = Y +Stats per queue = Y +Linux UIO = Y +x86-64 = Y +Usage doc = Y
doc/guides/rel_notes/release_17_05.rst +6 -1
@@ -142,6 +142,12 @@ New Features performance enhancements viz. configurable TX data ring, Receive Data Ring, ability to register memory regions. +* **Added Atomic Rules Arkville PMD.** + + Added a new poll mode driver for the Arkville family of + devices from Atomic Rules. The net/ark PMD supports line-rate + agnostic, multi-queue data movement on Arkville core FPGA instances. + * **Updated the tap driver.** * Support MTU modification.
@@ -153,7 +159,6 @@ New Features * Generic flow API support for Ethernet, VLAN, IPv4, IPv6, UDP and TCP pattern items with DROP, QUEUE and PASSTHRU actions for ingress traffic. - Resolved Issues ---------------
drivers/net/ark/ark_ethdev.c +677 -2
767 lines not on this page · raw message
drivers/net/ark/ark_ext.h new file +115 -0
115 lines not on this page · raw message
drivers/net/ark/ark_global.h +23 -0
@@ -86,6 +86,28 @@void *v; \ }name +struct ark_user_ext { +void *(*dev_init)(struct rte_eth_dev *,void *abar,int port_id); +void (*dev_uninit)(struct rte_eth_dev *,void *); +int (*dev_get_port_count)(struct rte_eth_dev *,void *); +int (*dev_configure)(struct rte_eth_dev *,void *); +int (*dev_start)(struct rte_eth_dev *,void *); +void (*dev_stop)(struct rte_eth_dev *,void *); +void (*dev_close)(struct rte_eth_dev *,void *); +int (*link_update)(struct rte_eth_dev *,int wait_to_complete,void *); +int (*dev_set_link_up)(struct rte_eth_dev *,void *); +int (*dev_set_link_down)(struct rte_eth_dev *,void *); +void (*stats_get)(struct rte_eth_dev *,struct rte_eth_stats *,void *); +void (*stats_reset)(struct rte_eth_dev *,void *); +void (*mac_addr_add)(struct rte_eth_dev *, +struct ether_addr *, +uint32_t , +uint32_t , +void *); +void (*mac_addr_remove)(struct rte_eth_dev *,uint32_t ,void *); +void (*mac_addr_set)(struct rte_eth_dev *,struct ether_addr *,void *); +}; +struct ark_adapter {/* User extension private data */ void *user_data;
@@ -107,6 +129,7 @@ struct ark_adapter {struct rte_eth_dev *eth_dev;void *d_handle; +struct ark_user_ext user_ext;/* Our Bar 0 */ uint8_t *bar0;
Signature · 1 line
1.9.1
Re: [PATCH v7 1/7] net/ark: stub PMD for Atomic Rules Arkville
In reply to Ferruh YigitHi Ferruh,
The patch series was updated to apply on the latest dpdk-next-net (d7f06ea2)
Quoted 6 lines · Ferruh Yigit
Quoted 1 line · Ed Czeck
Enable Arkville on supported configurations
Can you please update release notes [1] to announce the ARK PMD?
Release note have been updated in patch 7/7.
Quoted 4 lines
Apart from that, overall PMD looks good to me.
Still I suggest pushing the PMD integration to RC2 phase, to give more chance for reviews.
We at Atomic Rules are fine with moving this in RC2. When do you expect that to occur?
Quoted 5 lines
If PMD gets acked before that time, we can integrate earlier. If there is no objection till RC2, it gets merged in RC2.
This means less time for testing after integration, is merging on RC2 will leave you enough time for testing?
We have been continually testing with the latest code from dpdk-next-net. Aside from occasional merge issues, the core dpdk code which we depend upon remains stable.
Quoted 8 lines
Thanks,
ferruh[1]
doc/guides/rel_notes/release_17_05.rst
Re: [PATCH v8 1/7] net/ark: stub PMD for Atomic Rules Arkville
In reply to Ed CzeckQuoted 24 lines · Ed Czeck
Enable Arkville on supported configurations
Add overview documentation
Minimum driver support for valid compile
Arkville PMD is not supported on ARM or PowerPC at this timev8:
* Update to allow patch application from dpdk-next-netv6:
* Address review comments
* Unify messaging, logging and debug macros toark_logs.hv5:
* Address comments from Ferruh Yigit <[email protected]>
* Added documentation on driver args
*Makefilefixes
* Safe argument processing
* vdev args to dev argsv4:
* Address issues report from review
* Add internal comments on driver arg
* provide a bare-bones dev init to avoid compiler warnings
Quoted 5 lines
v3:
* Split large patch into several smaller onesSigned-off-by Ed Czeck <[email protected]>Signed-off-by John Miller <[email protected]>
Series applied to dpdk-next-net/master, thanks.