Octeon Tx/Tx2 Endpoint pmd
Subsystems (2)
cover Octeon Tx/Tx2 Endpoint pmd
From: "Nalla Pradeep" <[email protected]>
This patch set contains PMD with minimal set of operations that can drive both Octeon Tx and Tx2 in endpoint.
Nalla, Pradeep (15):
net/octeontx_ep: add build and doc infrastructure net/octeontx_ep: add ethdev probe and remove net/octeontx_ep: add device init and uninit net/octeontx_ep: Added basic device setup. net/octeontx_ep: Add dev info get and configure net/octeontx_ep: Added rxq setup and release net/octeontx_ep: Added tx queue setup and release net/octeontx_ep: Setting up iq and oq registers net/octeontx_ep: Added dev start and stop net/octeontx_ep: Receive data path function added net/octeontx_ep: Transmit data path function added net/octeontx_ep: INFO PTR mode support added. net/octeontx_ep: stats get/reset and link update net/octeontx_ep: rx queue interrupt net/octeontx_ep: Input output reset.
MAINTAINERS | 9 + doc/guides/nics/features/octeontx_ep.ini | 8 + doc/guides/nics/index.rst | 1 + doc/guides/nics/octeontx_ep.rst | 32 + drivers/common/octeontx2/otx2_common.h | 3 + drivers/net/meson.build | 1 + drivers/net/octeontx_ep/meson.build | 24 + drivers/net/octeontx_ep/otx2_ep_vf.c | 537 ++++++++++ drivers/net/octeontx_ep/otx2_ep_vf.h | 56 ++ drivers/net/octeontx_ep/otx_ep_common.h | 568 +++++++++++ drivers/net/octeontx_ep/otx_ep_ethdev.c | 852 ++++++++++++++++ drivers/net/octeontx_ep/otx_ep_rxtx.c | 1146 ++++++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_rxtx.h | 51 + drivers/net/octeontx_ep/otx_ep_vf.c | 609 ++++++++++++ drivers/net/octeontx_ep/otx_ep_vf.h | 198 ++++ drivers/net/octeontx_ep/version.map | 4 + 16 files changed, 4099 insertions(+) create mode 100644 doc/guides/nics/features/octeontx_ep.ini create mode 100644 doc/guides/nics/octeontx_ep.rst create mode 100644 drivers/net/octeontx_ep/meson.build create mode 100644 drivers/net/octeontx_ep/otx2_ep_vf.c create mode 100644 drivers/net/octeontx_ep/otx2_ep_vf.h create mode 100644 drivers/net/octeontx_ep/otx_ep_common.h create mode 100644 drivers/net/octeontx_ep/otx_ep_ethdev.c create mode 100644 drivers/net/octeontx_ep/otx_ep_rxtx.c create mode 100644 drivers/net/octeontx_ep/otx_ep_rxtx.h create mode 100644 drivers/net/octeontx_ep/otx_ep_vf.c create mode 100644 drivers/net/octeontx_ep/otx_ep_vf.h create mode 100644 drivers/net/octeontx_ep/version.map
Signature · 1 line
2.17.1
PATCH 1/15 net/octeontx_ep: add build and doc infrastructure
From: "Nalla Pradeep" <[email protected]>
Adding bare minimum PMD library and doc build infrastructure and claim the maintainership for octeontx end point PMD.
--- MAINTAINERS | 9 +++++++ doc/guides/nics/features/octeontx_ep.ini | 8 ++++++ doc/guides/nics/index.rst | 1 + doc/guides/nics/octeontx_ep.rst | 32 ++++++++++++++++++++++++ drivers/net/meson.build | 1 + drivers/net/octeontx_ep/meson.build | 8 ++++++ drivers/net/octeontx_ep/otx_ep_ethdev.c | 3 +++ drivers/net/octeontx_ep/version.map | 4 +++ 8 files changed, 66 insertions(+) create mode 100644 doc/guides/nics/features/octeontx_ep.ini create mode 100644 doc/guides/nics/octeontx_ep.rst create mode 100644 drivers/net/octeontx_ep/meson.build create mode 100644 drivers/net/octeontx_ep/otx_ep_ethdev.c create mode 100644 drivers/net/octeontx_ep/version.map
MAINTAINERS +9 -0
@@ -762,6 +762,15 @@ T: git://dpdk.org/next/dpdk-next-crypto F: drivers/common/octeontx2/otx2_sec* F: drivers/net/octeontx2/otx2_ethdev_sec* +Marvell OCTEON TX EP - endpoint +M: Nalla Pradeep <[email protected]> +M: Radha Mohan Chintakuntla <[email protected]> +M: Veerasenareddy Burru <[email protected]> +T: git://dpdk.org/next/dpdk-next-net-mrvl +F: drivers/net/octeontx_ep/ +F: doc/guides/nics/features/octeontx_ep.ini +F: doc/guides/nics/octeontx_ep.rst + Mellanox mlx4 M: Matan Azrad <[email protected]> M: Shahaf Shuler <[email protected]>
doc/guides/nics/features/octeontx_ep.ini new file +8 -0
@@ -0,0 +1,8 @@ +; +; Supported features of the 'octeontx_ep' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Linux VFIO = Y +Usage doc = Y
doc/guides/nics/index.rst +1 -0
@@ -50,6 +50,7 @@ Network Interface Controller Drivers null octeontx octeontx2 + octeontx_ep pfe qede sfc_efx
doc/guides/nics/octeontx_ep.rst new file +32 -0
@@ -0,0 +1,32 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(C) 2019 Marvell International Ltd. + +OCTEON TX EP Poll Mode driver +=========================== + +The OCTEON TX EP ETHDEV PMD (**librte_pmd_octeontx_ep**) provides poll mode ethdev +driver support for **Marvell OCTEON TX2** and **Cavium OCTEON TX** families of +adapters as well as for their virtual functions (VF) in SR-IOV context. + +More information can be found at `Marvell Official Website +<https://www.marvell.com/embedded-processors/infrastructure-processors>`_. + +Features +-------- + +Features of the OCTEON TX EP Ethdev PMD are: + + +Prerequisites +------------- + +See :doc:`../platform/octeontx2` and `../platform/octeontx` for setup information. + +Compile time Config Options +--------------------------- + +The following options may be modified in the ``config`` file. + +- ``CONFIG_RTE_LIBRTE_OCTEONTX_EP_PMD`` (default ``y``) + + Toggle compilation of the ``librte_pmd_octeontx_ep`` driver.
drivers/net/meson.build +1 -0
@@ -42,6 +42,7 @@ drivers = ['af_packet', 'null', 'octeontx', 'octeontx2', + 'octeontx_ep', 'pcap', 'pfe', 'qede',
drivers/net/octeontx_ep/meson.build new file +8 -0
@@ -0,0 +1,8 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(C) 2019 Marvell International Ltd. +# + +sources = files( + 'otx_ep_ethdev.c', + ) +
drivers/net/octeontx_ep/otx_ep_ethdev.c new file +3 -0
@@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2019 Marvell International Ltd. +*/
drivers/net/octeontx_ep/version.map new file +4 -0
@@ -0,0 +1,4 @@ +DPDK_20.0 { + + local: *; +};
Signature · 1 line
2.17.1
PATCH 2/15 net/octeontx_ep: add ethdev probe and remove
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
add basic PCIe ethdev probe and remove.
--- drivers/common/octeontx2/otx2_common.h | 3 ++ drivers/net/octeontx_ep/meson.build | 13 ++++++ drivers/net/octeontx_ep/otx_ep_common.h | 14 ++++++ drivers/net/octeontx_ep/otx_ep_ethdev.c | 62 +++++++++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_vf.h | 9 ++++ 5 files changed, 101 insertions(+) create mode 100644 drivers/net/octeontx_ep/otx_ep_common.h create mode 100644 drivers/net/octeontx_ep/otx_ep_vf.h
drivers/common/octeontx2/otx2_common.h +3 -0
@@ -136,6 +136,9 @@ extern int otx2_logtype_ree;#define PCI_DEVID_OCTEONTX2_RVU_CPT_VF 0xA0FE#define PCI_DEVID_OCTEONTX2_RVU_AF_VF 0xA0f8#define PCI_DEVID_OCTEONTX2_DPI_VF 0xA081 +#define PCI_DEVID_OCTEONTX2_EP_NET_VF 0xB203/* OCTEON TX2 EP mode */ +/* OCTEON TX2 98xx EP mode */ +#define PCI_DEVID_98XX_EP_NET_VF 0xB103#define PCI_DEVID_OCTEONTX2_EP_VF 0xB203/* OCTEON TX2 EP mode */ #define PCI_DEVID_OCTEONTX2_RVU_SDP_PF 0xA0f6#define PCI_DEVID_OCTEONTX2_RVU_SDP_VF 0xA0f7
drivers/net/octeontx_ep/meson.build +13 -0
@@ -6,3 +6,16 @@ sources = files( 'otx_ep_ethdev.c', ) +extra_flags = [] +# This integrated controller runs only on a arm64 machine, remove 32bit warnings +if not dpdk_conf.get('RTE_ARCH_64') + extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast'] +endif + +foreach flag: extra_flags + if cc.has_argument(flag) + cflags += flag + endif +endforeach + +includes += include_directories('../../common/octeontx2')
drivers/net/octeontx_ep/otx_ep_common.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2019 Marvell International Ltd. +*/ +#ifndef _OTX_EP_COMMON_H_ +#define _OTX_EP_COMMON_H_ + +/* OTX_EP EP VF device data structure */ +struct otx_ep_device { +/* PCI device pointer */ +struct rte_pci_device *pdev; + +struct rte_eth_dev *eth_dev; +}; +#endif /* _OTX_EP_COMMON_H_ */
drivers/net/octeontx_ep/otx_ep_ethdev.c +62 -0
65 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_vf.h new file +9 -0
@@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2019 Marvell International Ltd. +*/ +#ifndef _OTX_EP_VF_H_ +#define _OTX_EP_VF_H_ + +#define PCI_DEVID_OCTEONTX_EP_VF 0xa303 + +#endif /*_OTX_EP_VF_H_ */
Signature · 1 line
2.17.1
PATCH 3/15 net/octeontx_ep: add device init and uninit
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Add basic init and uninit function which includes
initializing fields of ethdev private structure.
--- drivers/net/octeontx_ep/otx_ep_common.h | 22 ++++++ drivers/net/octeontx_ep/otx_ep_ethdev.c | 99 ++++++++++++++++++++++++- 2 files changed, 117 insertions(+), 4 deletions(-)
drivers/net/octeontx_ep/otx_ep_common.h +22 -0
@@ -4,11 +4,33 @@#ifndef _OTX_EP_COMMON_H_#define _OTX_EP_COMMON_H_ +#define otx_ep_printf(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, \ + fmt, ##args) + +#define otx_ep_info(fmt, args...) \ + otx_ep_printf(INFO, fmt, ##args) + +#define otx_ep_err(fmt, args...) \ + otx_ep_printf(ERR, fmt, ##args) + +#define otx_ep_dbg(fmt, args...) \ + otx_ep_printf(DEBUG, fmt, ##args) +/* OTX_EP EP VF device data structure */ struct otx_ep_device {/* PCI device pointer */ struct rte_pci_device *pdev; +uint16_t chip_id; +uint16_t vf_num;struct rte_eth_dev *eth_dev; + +int port_id; + +/* Memory mapped h/w address */ +uint8_t *hw_addr; + +int port_configured; };#endif /* _OTX_EP_COMMON_H_ */
drivers/net/octeontx_ep/otx_ep_ethdev.c +95 -4
115 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 4/15 net/octeontx_ep: Added basic device setup.
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Functions to setup device, basic IQ and OQ registers are added.
--- drivers/net/octeontx_ep/meson.build | 2 + drivers/net/octeontx_ep/otx2_ep_vf.c | 138 +++++++++++++++++++++ drivers/net/octeontx_ep/otx2_ep_vf.h | 11 ++ drivers/net/octeontx_ep/otx_ep_common.h | 87 +++++++++++++ drivers/net/octeontx_ep/otx_ep_ethdev.c | 10 ++ drivers/net/octeontx_ep/otx_ep_vf.c | 154 ++++++++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_vf.h | 33 +++++ 7 files changed, 435 insertions(+) create mode 100644 drivers/net/octeontx_ep/otx2_ep_vf.c create mode 100644 drivers/net/octeontx_ep/otx2_ep_vf.h create mode 100644 drivers/net/octeontx_ep/otx_ep_vf.c
drivers/net/octeontx_ep/meson.build +2 -0
@@ -4,6 +4,8 @@ sources = files( 'otx_ep_ethdev.c', + 'otx_ep_vf.c', + 'otx2_ep_vf.c', ) extra_flags = []
drivers/net/octeontx_ep/otx2_ep_vf.c new file +138 -0
138 lines not on this page · raw message
drivers/net/octeontx_ep/otx2_ep_vf.h new file +11 -0
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2019 Marvell International Ltd. +*/ +#ifndef _OTX2_EP_VF_H_ +#define _OTX2_EP_VF_H_ + +int +otx2_ep_vf_setup_device (struct otx_ep_device *sdpvf); + +#endif /*_OTX2_EP_VF_H_ */ +
drivers/net/octeontx_ep/otx_ep_common.h +87 -0
105 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_ethdev.c +10 -0
@@ -9,6 +9,7 @@#include "otx2_common.h" #include "otx_ep_common.h" #include "otx_ep_vf.h" +#include "otx2_ep_vf.h" #define OTX_EP_DEV (_eth_dev) ((_eth_dev)->data->dev_private) static int
@@ -21,10 +22,12 @@ otx_ep_chip_specific_setup(struct otx_ep_device *otx_epvf)switch (dev_id) {case PCI_DEVID_OCTEONTX_EP_VF : otx_epvf->chip_id =PCI_DEVID_OCTEONTX_EP_VF ; + ret =otx_ep_vf_setup_device (otx_epvf);break ;case PCI_DEVID_OCTEONTX2_EP_NET_VF :case PCI_DEVID_98XX_EP_NET_VF : otx_epvf->chip_id = dev_id; + ret =otx2_ep_vf_setup_device (otx_epvf);break ;default :otx_ep_err ("Unsupported device\n" );
@@ -46,6 +49,13 @@ otx_epdev_init(struct otx_ep_device *otx_epvf) goto setup_fail; } +if (otx_epvf->fn_list.setup_device_regs (otx_epvf)) { +otx_ep_err ("Failed to configure device registers\n" ); + goto setup_fail; + } + +otx_ep_info ("OTX_EP Device is Ready\n" ); +return 0 ; setup_fail:
drivers/net/octeontx_ep/otx_ep_vf.c new file +154 -0
154 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_vf.h +33 -0
@@ -4,6 +4,39 @@#ifndef _OTX_EP_VF_H_#define _OTX_EP_VF_H_ +#define OTX_EP_RING_OFFSET (0x1ull << 17) + +/* OTX_EP VF IQ Registers */ +#define OTX_EP_R_IN_CONTROL_START (0x10000) +#define OTX_EP_R_IN_CONTROL (ring) \ + (OTX_EP_R_IN_CONTROL_START + ((ring) * OTX_EP_RING_OFFSET)) + +/* OTX_EP VF IQ Masks */ +#define OTX_EP_R_IN_CTL_RPVF_MASK (0xF) +#define OTX_EP_R_IN_CTL_RPVF_POS (48) + +#define OTX_EP_R_IN_CTL_IDLE (0x1ull << 28) +#define OTX_EP_R_IN_CTL_RDSIZE (0x3ull << 25)/* Setting to max(4) */ +#define OTX_EP_R_IN_CTL_IS_64B (0x1ull << 24) +#define OTX_EP_R_IN_CTL_ESR (0x1ull << 1) +/* OTX_EP VF OQ Registers */ +#define OTX_EP_R_OUT_CONTROL_START (0x10150) +#define OTX_EP_R_OUT_CONTROL (ring) \ + (OTX_EP_R_OUT_CONTROL_START + ((ring) * OTX_EP_RING_OFFSET)) +/* OTX_EP VF OQ Masks */ +#define OTX_EP_R_OUT_CTL_ES_I (1ull << 34) +#define OTX_EP_R_OUT_CTL_NSR_I (1ull << 33) +#define OTX_EP_R_OUT_CTL_ROR_I (1ull << 32) +#define OTX_EP_R_OUT_CTL_ES_D (1ull << 30) +#define OTX_EP_R_OUT_CTL_NSR_D (1ull << 29) +#define OTX_EP_R_OUT_CTL_ROR_D (1ull << 28) +#define OTX_EP_R_OUT_CTL_ES_P (1ull << 26) +#define OTX_EP_R_OUT_CTL_NSR_P (1ull << 25) +#define OTX_EP_R_OUT_CTL_ROR_P (1ull << 24) +#define OTX_EP_R_OUT_CTL_IMODE (1ull << 23) +#define PCI_DEVID_OCTEONTX_EP_VF 0xa303 +int +otx_ep_vf_setup_device (struct otx_ep_device *otx_ep);#endif /*_OTX_EP_VF_H_ */
Signature · 1 line
2.17.1
PATCH 5/15 net/octeontx_ep: Add dev info get and configure
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Add device information get and device configure operations.
--- drivers/net/octeontx_ep/otx_ep_common.h | 15 +++++ drivers/net/octeontx_ep/otx_ep_ethdev.c | 80 +++++++++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_rxtx.h | 10 ++++ 3 files changed, 105 insertions(+) create mode 100644 drivers/net/octeontx_ep/otx_ep_rxtx.h
drivers/net/octeontx_ep/otx_ep_common.h +15 -0
@@ -7,9 +7,12 @@#define OTX_EP_MAX_RINGS_PER_VF (8)#define OTX_EP_CFG_IO_QUEUES OTX_EP_MAX_RINGS_PER_VF#define OTX_EP_64BYTE_INSTR (64) +#define OTX_EP_MIN_IQ_DESCRIPTORS (128) +#define OTX_EP_MIN_OQ_DESCRIPTORS (128)#define OTX_EP_MAX_IQ_DESCRIPTORS (8192)#define OTX_EP_MAX_OQ_DESCRIPTORS (8192)#define OTX_EP_OQ_BUF_SIZE (2048) +#define OTX_EP_MIN_RX_BUF_SIZE (64)#define OTX_EP_OQ_INFOPTR_MODE (0)#define OTX_EP_OQ_REFIL_THRESHOLD (16)
@@ -112,6 +115,10 @@ struct otx_ep_device {struct otx_ep_fn_list fn_list; +uint32_t max_tx_queues; + +uint32_t max_rx_queues; +/* SR-IOV info */ struct otx_ep_sriov_info sriov_info;
@@ -119,5 +126,13 @@ struct otx_ep_device {const struct otx_ep_config *conf;int port_configured; + +uint64_t rx_offloads; + uint64_t tx_offloads; }; + +#define OTX_EP_MAX_PKT_SZ 64000U + +#define OTX_EP_MAX_MAC_ADDRS 1 +#endif /* _OTX_EP_COMMON_H_ */
drivers/net/octeontx_ep/otx_ep_ethdev.c +80 -0
100 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_rxtx.h new file +10 -0
@@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2019 Marvell International Ltd. +*/ + +#ifndef _OTX_EP_RXTX_H_ +#define _OTX_EP_RXTX_H_ + +#define OTX_EP_RXD_ALIGN 1 +#define OTX_EP_TXD_ALIGN 1 +#endif
Signature · 1 line
2.17.1
PATCH 6/15 net/octeontx_ep: Added rxq setup and release
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Receive queue setup involves allocating memory for the queue, initializing data structure representing the queue and filling queue with receive buffers of rx descriptor count.
Receive queues are referred as droq. Hardware fills the receive buffers in queue with the packet. It can use same receive buffer (BUFPTR_ONLY_MODE) or separate buffer (INFOPTR_MODE) to fill with packet metadata. BUFPTR_ONLY_MODE is supported now.
In receive queue release, receive buffers are freed along with the receive queue.
--- drivers/net/octeontx_ep/meson.build | 1 + drivers/net/octeontx_ep/otx_ep_common.h | 160 ++++++++++++++++- drivers/net/octeontx_ep/otx_ep_ethdev.c | 133 ++++++++++++++ drivers/net/octeontx_ep/otx_ep_rxtx.c | 222 ++++++++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_vf.h | 6 + 5 files changed, 517 insertions(+), 5 deletions(-) create mode 100644 drivers/net/octeontx_ep/otx_ep_rxtx.c
drivers/net/octeontx_ep/meson.build +1 -0
@@ -6,6 +6,7 @@ sources = files( 'otx_ep_ethdev.c', 'otx_ep_vf.c', 'otx2_ep_vf.c', + 'otx_ep_rxtx.c', ) extra_flags = []
drivers/net/octeontx_ep/otx_ep_common.h +155 -5
208 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_ethdev.c +133 -0
191 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_rxtx.c new file +222 -0
222 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_vf.h +6 -0
@@ -37,6 +37,12 @@#define PCI_DEVID_OCTEONTX_EP_VF 0xa303 +/* this is a static value set by SLI PF driver in octeon +* No handshake is available +* Change this if changing the value in SLI PF driver +*/ +#define SDP_GBL_WMARK 0x100 +int otx_ep_vf_setup_device (struct otx_ep_device *otx_ep);#endif /*_OTX_EP_VF_H_ */
Signature · 1 line
2.17.1
PATCH 7/15 net/octeontx_ep: Added tx queue setup and release
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Transmit queue setup involves allocating memory for the command queue considering tx descriptor count and initializing data structure representing the queue. Transmit queue release function frees the command queue.
--- drivers/net/octeontx_ep/otx_ep_common.h | 89 +++++++++++++++- drivers/net/octeontx_ep/otx_ep_ethdev.c | 81 ++++++++++++++ drivers/net/octeontx_ep/otx_ep_rxtx.c | 135 ++++++++++++++++++++++++ 3 files changed, 303 insertions(+), 2 deletions(-)
drivers/net/octeontx_ep/otx_ep_common.h +87 -2
@@ -42,7 +42,21 @@rte_write64 (val, ((base_addr) + off)); \ } -struct otx_ep_device ; +/* OTX_EP IQ request list */ +struct otx_ep_instr_list { +void *buf; +uint32_t reqtype; +}; +#define OTX_EP_IQREQ_LIST_SIZE (sizeof(struct otx_ep_instr_list)) + +/* Input Queue statistics. Each input queue has four stats fields. */ +struct otx_ep_iq_stats { +uint64_t instr_posted;/* Instructions posted to this queue. */ +uint64_t instr_processed;/* Instructions processed in this queue. */ +uint64_t instr_dropped;/* Instructions that could not be processed */ +uint64_t tx_pkts; +uint64_t tx_bytes; +};/* Structure to define the configuration attributes for each Input queue. */ struct otx_ep_iq_config {
@@ -56,6 +70,66 @@ struct otx_ep_iq_config {uint32_t pending_list_size; }; +/** The instruction (input) queue. +* The input queue is used to post raw (instruction) mode data or packet data +* to OCTEON TX2 device from the host. Each IQ of a OTX_EP EP VF device has one +* such structure to represent it. +*/ +struct otx_ep_instr_queue { +struct otx_ep_device *otx_ep_dev; + +uint32_t q_no; +uint32_t pkt_in_done; + +/* Flag for 64 byte commands. */ +uint32_t iqcmd_64B:1 ; +uint32_t rsvd:17 ; +uint32_t status:8 ; + +/* Number of descriptors in this ring. */ +uint32_t nb_desc; + +/* Input ring index, where the driver should write the next packet */ +uint32_t host_write_index; + +/* Input ring index, where the OCTEON TX2 should read the next packet */ +uint32_t otx_read_index; + +uint32_t reset_instr_cnt; + +/** This index aids in finding the window in the queue where OCTEON TX2 +* has read the commands. +*/ +uint32_t flush_index; + +/* This keeps track of the instructions pending in this queue. */ +uint64_t instr_pending; + +/* Pointer to the Virtual Base addr of the input ring. */ +uint8_t *base_addr; + +/* This IQ request list */ +struct otx_ep_instr_list *req_list; + +/* OTX_EP doorbell register for the ring. */ +void *doorbell_reg; + +/* OTX_EP instruction count register for this ring. */ +void *inst_cnt_reg; + +/* Number of instructions pending to be posted to OCTEON TX2. */ +uint32_t fill_cnt; + +/* Statistics for this input queue. */ +struct otx_ep_iq_stats stats; + +/* DMA mapped base address of the input descriptor ring. */ +uint64_t base_addr_dma; + +/* Memory zone */ +const struct rte_memzone *iq_mz; +}; +/** Descriptor format. * The descriptor ring is made of descriptors which have 2 64-bit values: * -# Physical (bus) address of the data buffer.
@@ -218,6 +292,7 @@ struct otx_ep_config {/* Required functions for each VF device */ struct otx_ep_fn_list { +void (*setup_iq_regs)(struct otx_ep_device *otx_ep,uint32_t q_no);void (*setup_oq_regs)(struct otx_ep_device *otx_ep,uint32_t q_no);int (*setup_device_regs)(struct otx_ep_device *otx_ep);
@@ -256,6 +331,12 @@ struct otx_ep_device {uint32_t max_rx_queues; +/* Num IQs */ +uint32_t nb_tx_queues; + +/* The input instruction queues */ +struct otx_ep_instr_queue *instr_queue[OTX_EP_MAX_IOQS_PER_VF ]; +/* Num OQs */ uint32_t nb_rx_queues;
@@ -277,12 +358,16 @@ struct otx_ep_device { uint64_t tx_offloads; }; +int otx_ep_setup_iqs (struct otx_ep_device *otx_ep,uint32_t iq_no, +int num_descs,unsigned int socket_id); +int otx_ep_delete_iqs (struct otx_ep_device *otx_ep,uint32_t iq_no); +int otx_ep_setup_oqs (struct otx_ep_device *otx_ep,int oq_no,int num_descs,int desc_size,struct rte_mempool *mpool,unsigned int socket_id);int otx_ep_delete_oqs (struct otx_ep_device *otx_ep,uint32_t oq_no); -#define OTX_EP_MAX_PKT_SZ 64000U +#define OTX_EP_MAX_PKT_SZ 64000U#define OTX_EP_MAX_MAC_ADDRS 1#endif /* _OTX_EP_COMMON_H_ */
drivers/net/octeontx_ep/otx_ep_ethdev.c +81 -0
98 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_rxtx.c +135 -0
141 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 8/15 net/octeontx_ep: Setting up iq and oq registers
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Configuring hardware registers with command queue(iq) and droq(oq) parameters.
--- drivers/net/octeontx_ep/otx2_ep_vf.c | 124 ++++++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_common.h | 65 ++++++++++++ drivers/net/octeontx_ep/otx_ep_vf.c | 132 ++++++++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_vf.h | 53 ++++++++++ 4 files changed, 374 insertions(+)
drivers/net/octeontx_ep/otx2_ep_vf.c +124 -0
@@ -78,6 +78,127 @@ otx2_vf_setup_device_regs(struct otx_ep_device *otx_ep)return 0 ; } +static void +otx2_vf_setup_iq_regs (struct otx_ep_device *otx_ep,uint32_t iq_no) +{ +struct otx_ep_instr_queue *iq = otx_ep->instr_queue[iq_no]; +volatile uint64_t reg_val =0ull ; + + reg_val =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_IN_CONTROL (iq_no)); + +/* Wait till IDLE to set to 1, not supposed to configure BADDR +* as long as IDLE is 0 +*/ +if (!(reg_val &SDP_VF_R_IN_CTL_IDLE )) { +do { + reg_val =otx2_read64 (otx_ep->hw_addr + +SDP_VF_R_IN_CONTROL (iq_no)); + }while (!(reg_val &SDP_VF_R_IN_CTL_IDLE )); + } + +/* Write the start of the input queue's ring and its size */ +otx2_write64 (iq->base_addr_dma, otx_ep->hw_addr + +SDP_VF_R_IN_INSTR_BADDR (iq_no)); +otx2_write64 (iq->nb_desc, otx_ep->hw_addr + +SDP_VF_R_IN_INSTR_RSIZE (iq_no)); + +/* Remember the doorbell & instruction count register addr +* for this queue +*/ + iq->doorbell_reg = (uint8_t *)otx_ep->hw_addr + +SDP_VF_R_IN_INSTR_DBELL (iq_no); + iq->inst_cnt_reg = (uint8_t *)otx_ep->hw_addr + +SDP_VF_R_IN_CNTS (iq_no); + +otx_ep_dbg ("InstQ[%d]:dbell reg @ 0x%p instcnt_reg @ 0x%p" , + iq_no, iq->doorbell_reg, iq->inst_cnt_reg); + +do { + reg_val =rte_read32 (iq->inst_cnt_reg); +rte_write32 (reg_val, iq->inst_cnt_reg); + }while (reg_val !=0 ); + +/* IN INTR_THRESHOLD is set to max(FFFFFFFF) which disable the IN INTR +* to raise +*/ +otx2_write64 (0x3FFFFFFFFFFFFFUL , + otx_ep->hw_addr +SDP_VF_R_IN_INT_LEVELS (iq_no)); +} + +static void +otx2_vf_setup_oq_regs (struct otx_ep_device *otx_ep,uint32_t oq_no) +{ +volatile uint64_t reg_val =0ull ; +uint64_t oq_ctl =0ull ; +struct otx_ep_droq *droq = otx_ep->droq[oq_no]; + +/* Wait on IDLE to set to 1, supposed to configure BADDR +* as log as IDLE is 0 +*/ + reg_val =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_OUT_CONTROL (oq_no)); + +while (!(reg_val &SDP_VF_R_OUT_CTL_IDLE )) { + reg_val =otx2_read64 (otx_ep->hw_addr + +SDP_VF_R_OUT_CONTROL (oq_no)); + } + +otx2_write64 (droq->desc_ring_dma, otx_ep->hw_addr + +SDP_VF_R_OUT_SLIST_BADDR (oq_no)); +otx2_write64 (droq->nb_desc, otx_ep->hw_addr + +SDP_VF_R_OUT_SLIST_RSIZE (oq_no)); + + oq_ctl =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_OUT_CONTROL (oq_no)); + +/* Clear the ISIZE and BSIZE (22-0) */ + oq_ctl &= ~(0x7fffffull ); + +/* Populate the BSIZE (15-0) */ + oq_ctl |= (droq->buffer_size &0xffff ); + +#ifndef BUFPTR_ONLY_MODE +/* Populate ISIZE(22-16) */ + oq_ctl |= ((OTX_EP_RH_SIZE <<16 ) &0x7fffff ); +#endif +otx2_write64 (oq_ctl, otx_ep->hw_addr +SDP_VF_R_OUT_CONTROL (oq_no)); + +/* Mapped address of the pkt_sent and pkts_credit regs */ + droq->pkts_sent_reg = (uint8_t *)otx_ep->hw_addr + +SDP_VF_R_OUT_CNTS (oq_no); + droq->pkts_credit_reg = (uint8_t *)otx_ep->hw_addr + +SDP_VF_R_OUT_SLIST_DBELL (oq_no); + +rte_write64 (0x3FFFFFFFFFFFFFUL , + otx_ep->hw_addr +SDP_VF_R_OUT_INT_LEVELS (oq_no)); + +/* Clear PKT_CNT register */ +rte_write64 (0xFFFFFFFFF , (uint8_t *)otx_ep->hw_addr + +SDP_VF_R_OUT_PKT_CNT (oq_no)); + +/* Clear the OQ doorbell */ +rte_write32 (0xFFFFFFFF , droq->pkts_credit_reg); +while ((rte_read32 (droq->pkts_credit_reg) !=0ull )) { +rte_write32 (0xFFFFFFFF , droq->pkts_credit_reg); +rte_delay_ms (1 ); + } +otx_ep_dbg ("SDP_R[%d]_credit:%x" , oq_no, +rte_read32 (droq->pkts_credit_reg)); + +/* Clear the OQ_OUT_CNTS doorbell */ + reg_val =rte_read32 (droq->pkts_sent_reg); +rte_write32 ((uint32_t )reg_val, droq->pkts_sent_reg); + +otx_ep_dbg ("SDP_R[%d]_sent: %x" , oq_no, +rte_read32 (droq->pkts_sent_reg)); + +while (((rte_read32 (droq->pkts_sent_reg)) !=0ull )) { + reg_val =rte_read32 (droq->pkts_sent_reg); +rte_write32 ((uint32_t )reg_val, droq->pkts_sent_reg); +rte_delay_ms (1 ); + } +otx_ep_dbg ("SDP_R[%d]_sent: %x" , oq_no, +rte_read32 (droq->pkts_sent_reg)); +} +static const struct otx_ep_config default_otx2_ep_conf = {/* IQ attributes */ .iq = {
@@ -132,6 +253,9 @@ otx2_ep_vf_setup_device(struct otx_ep_device *otx_ep)otx2_info ("SDP RPVF: %d" , otx_ep->sriov_info.rings_per_vf); + otx_ep->fn_list.setup_iq_regs = otx2_vf_setup_iq_regs; + otx_ep->fn_list.setup_oq_regs = otx2_vf_setup_oq_regs; + otx_ep->fn_list.setup_device_regs = otx2_vf_setup_device_regs;return 0 ;
drivers/net/octeontx_ep/otx_ep_common.h +65 -0
89 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_vf.c +132 -0
144 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_vf.h +53 -0
76 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 9/15 net/octeontx_ep: Added dev start and stop
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Dev start and stop operations are added. To accomplish this internal functions to enable or disable io queues are incorporated.
--- drivers/net/octeontx_ep/otx2_ep_vf.c | 92 +++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_common.h | 13 +++ drivers/net/octeontx_ep/otx_ep_ethdev.c | 45 ++++++++++ drivers/net/octeontx_ep/otx_ep_vf.c | 114 ++++++++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_vf.h | 4 + 5 files changed, 268 insertions(+)
drivers/net/octeontx_ep/otx2_ep_vf.c +92 -0
@@ -199,6 +199,89 @@ otx2_vf_setup_oq_regs(struct otx_ep_device *otx_ep, uint32_t oq_no) rte_read32(droq->pkts_sent_reg)); } +static void +otx2_vf_enable_iq (struct otx_ep_device *otx_ep,uint32_t q_no) +{ +volatile uint64_t reg_val =0ull ; +uint64_t loop =SDP_VF_BUSY_LOOP_COUNT ; + +/* Resetting doorbells during IQ enabling also to handle abrupt +* guest reboot. IQ reset does not clear the doorbells. +*/ +otx2_write64 (0xFFFFFFFF , otx_ep->hw_addr + +SDP_VF_R_IN_INSTR_DBELL (q_no)); + +while (((otx2_read64 (otx_ep->hw_addr + +SDP_VF_R_IN_INSTR_DBELL (q_no))) !=0ull ) && loop--) { +rte_delay_ms (1 ); + } + + reg_val =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_IN_ENABLE (q_no)); + reg_val |=0x1ull ; + +otx2_write64 (reg_val, otx_ep->hw_addr +SDP_VF_R_IN_ENABLE (q_no)); + +otx2_info ("IQ[%d] enable done" , q_no); +} + +static void +otx2_vf_enable_oq (struct otx_ep_device *otx_ep,uint32_t q_no) +{ +volatile uint64_t reg_val =0ull ; + + reg_val =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_OUT_ENABLE (q_no)); + reg_val |=0x1ull ; +otx2_write64 (reg_val, otx_ep->hw_addr +SDP_VF_R_OUT_ENABLE (q_no)); + +otx2_info ("OQ[%d] enable done" , q_no); +} + +static void +otx2_vf_enable_io_queues (struct otx_ep_device *otx_ep) +{ +uint32_t q_no =0 ; + +for (q_no =0 ; q_no < otx_ep->nb_tx_queues; q_no++) +otx2_vf_enable_iq (otx_ep, q_no); + +for (q_no =0 ; q_no < otx_ep->nb_rx_queues; q_no++) +otx2_vf_enable_oq (otx_ep, q_no); +} + +static void +otx2_vf_disable_iq (struct otx_ep_device *otx_ep,uint32_t q_no) +{ +volatile uint64_t reg_val =0ull ; + +/* Reset the doorbell register for this Input Queue. */ + reg_val =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_IN_ENABLE (q_no)); + reg_val &= ~0x1ull ; + +otx2_write64 (reg_val, otx_ep->hw_addr +SDP_VF_R_IN_ENABLE (q_no)); +} + +static void +otx2_vf_disable_oq (struct otx_ep_device *otx_ep,uint32_t q_no) +{ +volatile uint64_t reg_val =0ull ; + + reg_val =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_OUT_ENABLE (q_no)); + reg_val &= ~0x1ull ; + +otx2_write64 (reg_val, otx_ep->hw_addr +SDP_VF_R_OUT_ENABLE (q_no)); +} + +static void +otx2_vf_disable_io_queues (struct otx_ep_device *otx_ep) +{ +uint32_t q_no =0 ; + +for (q_no =0 ; q_no < otx_ep->sriov_info.rings_per_vf; q_no++) { +otx2_vf_disable_iq (otx_ep, q_no); +otx2_vf_disable_oq (otx_ep, q_no); + } +} +static const struct otx_ep_config default_otx2_ep_conf = {/* IQ attributes */ .iq = {
@@ -258,5 +341,14 @@ otx2_ep_vf_setup_device(struct otx_ep_device *otx_ep) otx_ep->fn_list.setup_device_regs = otx2_vf_setup_device_regs; + otx_ep->fn_list.enable_io_queues = otx2_vf_enable_io_queues; + otx_ep->fn_list.disable_io_queues = otx2_vf_disable_io_queues; + + otx_ep->fn_list.enable_iq = otx2_vf_enable_iq; + otx_ep->fn_list.disable_iq = otx2_vf_disable_iq; + + otx_ep->fn_list.enable_oq = otx2_vf_enable_oq; + otx_ep->fn_list.disable_oq = otx2_vf_disable_oq; +return 0 ; }
drivers/net/octeontx_ep/otx_ep_common.h +13 -0
@@ -19,6 +19,8 @@#define OTX_EP_PCI_RING_ALIGN 65536#define SDP_PKIND 40#define SDP_OTX2_PKIND 57 +#define OTX_EP_BUSY_LOOP_COUNT (10000) +#define OTX_EP_MAX_IOQS_PER_VF 8 #define otx_ep_printf(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, \
@@ -362,7 +364,14 @@ struct otx_ep_fn_list {int (*setup_device_regs)(struct otx_ep_device *otx_ep); +void (*enable_io_queues)(struct otx_ep_device *otx_ep);void (*disable_io_queues)(struct otx_ep_device *otx_ep); + +void (*enable_iq)(struct otx_ep_device *otx_ep,uint32_t q_no); +void (*disable_iq)(struct otx_ep_device *otx_ep,uint32_t q_no); + +void (*enable_oq)(struct otx_ep_device *otx_ep,uint32_t q_no); +void (*disable_oq)(struct otx_ep_device *otx_ep,uint32_t q_no); };/* SRIOV information */
@@ -417,6 +426,10 @@ struct otx_ep_device {/* Device configuration */ const struct otx_ep_config *conf; +int started; + +int linkup; +int port_configured;uint64_t rx_offloads;
drivers/net/octeontx_ep/otx_ep_ethdev.c +45 -0
63 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_vf.c +114 -0
125 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_vf.h +4 -0
@@ -12,6 +12,7 @@/* OTX_EP VF IQ Registers */ #define OTX_EP_R_IN_CONTROL_START (0x10000) +#define OTX_EP_R_IN_ENABLE_START (0x10010)#define OTX_EP_R_IN_INSTR_BADDR_START (0x10020)#define OTX_EP_R_IN_INSTR_RSIZE_START (0x10030)#define OTX_EP_R_IN_INSTR_DBELL_START (0x10040)
@@ -21,6 +22,9 @@#define OTX_EP_R_IN_CONTROL (ring) \ (OTX_EP_R_IN_CONTROL_START + ((ring) * OTX_EP_RING_OFFSET)) +#define OTX_EP_R_IN_ENABLE (ring) \ + (OTX_EP_R_IN_ENABLE_START + ((ring) * OTX_EP_RING_OFFSET)) +#define OTX_EP_R_IN_INSTR_BADDR (ring) \ (OTX_EP_R_IN_INSTR_BADDR_START + ((ring) * OTX_EP_RING_OFFSET))
Signature · 1 line
2.17.1
PATCH 10/15 net/octeontx_ep: Receive data path function added
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Function to deliver packets from DROQ to application is added. It also fills DROQ with receive buffers timely such that device can fill them with incoming packets.
--- drivers/net/octeontx_ep/otx_ep_common.h | 5 + drivers/net/octeontx_ep/otx_ep_ethdev.c | 3 + drivers/net/octeontx_ep/otx_ep_rxtx.c | 292 ++++++++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_rxtx.h | 17 +- 4 files changed, 316 insertions(+), 1 deletion(-)
drivers/net/octeontx_ep/otx_ep_common.h +5 -0
@@ -22,6 +22,11 @@#define OTX_EP_BUSY_LOOP_COUNT (10000)#define OTX_EP_MAX_IOQS_PER_VF 8 + +#define OTX_CUST_META_DATA 64 +#define OTX_CUST_PRIV_TAG 2 +#define OTX_CUST_DATA_LEN (OTX_CUST_META_DATA + OTX_CUST_PRIV_TAG) + #define otx_ep_printf(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, RTE_LOGTYPE_PMD, \ fmt, ##args)
drivers/net/octeontx_ep/otx_ep_ethdev.c +3 -0
@@ -147,6 +147,7 @@ otx_epdev_init(struct otx_ep_device *otx_epvf) goto setup_fail; } + otx_epvf->eth_dev->rx_pkt_burst = &otx_ep_recv_pkts; ethdev_queues = (uint32_t )(otx_epvf->sriov_info.rings_per_vf); otx_epvf->max_rx_queues = ethdev_queues; otx_epvf->max_tx_queues = ethdev_queues;
@@ -404,6 +405,8 @@ otx_ep_eth_dev_uninit(struct rte_eth_dev *eth_dev)rte_free (eth_dev->data->mac_addrs); eth_dev->dev_ops =NULL ; + eth_dev->rx_pkt_burst =NULL ; + eth_dev->tx_pkt_burst =NULL ;return 0 ; }
drivers/net/octeontx_ep/otx_ep_rxtx.c +292 -0
307 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_rxtx.h +16 -1
@@ -7,4 +7,19 @@#define OTX_EP_RXD_ALIGN 1#define OTX_EP_TXD_ALIGN 1 -#endif +#define OTX_EP_MAX_DELAYED_PKT_RETRIES 10000 +static inline uint32_t +otx_ep_incr_index (uint32_t index,uint32_t count,uint32_t max) +{ +if ((index + count) >= max) + index = index + count - max; +else + index += count; + +return index; +} +uint16_t +otx_ep_recv_pkts (void *rx_queue, +struct rte_mbuf **rx_pkts, +uint16_t budget); +#endif /* _OTX_EP_RXTX_H_ */
Signature · 1 line
2.17.1
PATCH 11/15 net/octeontx_ep: Transmit data path function added
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
1. Packet transmit function for both otx and otx2 are added.
2. Flushing trasmit(command) queue when pending commands are more than maximum allowed value (currently 16).
3. Scatter gather support if the packet spans multiple buffers.
--- drivers/net/octeontx_ep/otx2_ep_vf.h | 19 + drivers/net/octeontx_ep/otx_ep_common.h | 51 +++ drivers/net/octeontx_ep/otx_ep_ethdev.c | 5 + drivers/net/octeontx_ep/otx_ep_rxtx.c | 448 +++++++++++++++++++++++- drivers/net/octeontx_ep/otx_ep_rxtx.h | 26 ++ drivers/net/octeontx_ep/otx_ep_vf.h | 68 ++++ 6 files changed, 615 insertions(+), 2 deletions(-)
drivers/net/octeontx_ep/otx2_ep_vf.h +19 -0
@@ -7,5 +7,24 @@int otx2_ep_vf_setup_device (struct otx_ep_device *sdpvf); +struct otx2_ep_instr_64B { +/* Pointer where the input data is available. */ +uint64_t dptr; + +/* OTX_EP Instruction Header. */ +union otx_ep_instr_ih ih; + +/** Pointer where the response for a RAW mode packet +* will be written by OCTEON TX. +*/ +uint64_t rptr; + +/* Input Request Header. */ +union otx_ep_instr_irh irh; + +/* Additional headers available in a 64-byte instruction. */ +uint64_t exhdr[4 ]; +}; +#endif /*_OTX2_EP_VF_H_ */
drivers/net/octeontx_ep/otx_ep_common.h +51 -0
73 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_ethdev.c +5 -0
@@ -148,6 +148,11 @@ otx_epdev_init(struct otx_ep_device *otx_epvf) } otx_epvf->eth_dev->rx_pkt_burst = &otx_ep_recv_pkts; +if (otx_epvf->chip_id ==PCI_DEVID_OCTEONTX_EP_VF ) + otx_epvf->eth_dev->tx_pkt_burst = &otx_ep_xmit_pkts; +else if (otx_epvf->chip_id ==PCI_DEVID_OCTEONTX2_EP_NET_VF || + otx_epvf->chip_id ==PCI_DEVID_98XX_EP_NET_VF ) + otx_epvf->eth_dev->tx_pkt_burst = &otx2_ep_xmit_pkts; ethdev_queues = (uint32_t )(otx_epvf->sriov_info.rings_per_vf); otx_epvf->max_rx_queues = ethdev_queues; otx_epvf->max_tx_queues = ethdev_queues;
drivers/net/octeontx_ep/otx_ep_rxtx.c +446 -2
460 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_rxtx.h +26 -0
@@ -5,9 +5,31 @@#ifndef _OTX_EP_RXTX_H_#define _OTX_EP_RXTX_H_ +#include <rte_byteorder.h> +#define OTX_EP_RXD_ALIGN 1#define OTX_EP_TXD_ALIGN 1 + +#define OTX_EP_IQ_SEND_FAILED (-1) +#define OTX_EP_IQ_SEND_SUCCESS (0) +#define OTX_EP_MAX_DELAYED_PKT_RETRIES 10000 + +#define OTX_EP_FSZ 28 +#define OTX2_EP_FSZ 24 +#define OTX_EP_MAX_INSTR 16 + +static inline void +otx_ep_swap_8B_data (uint64_t *data,uint32_t blocks) +{ +/* Swap 8B blocks */ +while (blocks) { + *data =rte_bswap64 (*data); + blocks--; + data++; + } +} +static inline uint32_t otx_ep_incr_index (uint32_t index,uint32_t count,uint32_t max) {
@@ -19,6 +41,10 @@ otx_ep_incr_index(uint32_t index, uint32_t count, uint32_t max)return index; }uint16_t +otx_ep_xmit_pkts (void *tx_queue,struct rte_mbuf **pkts,uint16_t nb_pkts); +uint16_t +otx2_ep_xmit_pkts (void *tx_queue,struct rte_mbuf **pkts,uint16_t nb_pkts); +uint16_t otx_ep_recv_pkts (void *rx_queue,struct rte_mbuf **rx_pkts,uint16_t budget);
drivers/net/octeontx_ep/otx_ep_vf.h +68 -0
74 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 12/15 net/octeontx_ep: INFO PTR mode support added.
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Hardware can be programmed to write the meta data of incoming packet in the same buffer it uses to fill the packet(BUF PTR mode) or a different buffer (INFO PTR mode).
--- drivers/net/octeontx_ep/meson.build | 2 +- drivers/net/octeontx_ep/otx_ep_common.h | 8 ++++ drivers/net/octeontx_ep/otx_ep_rxtx.c | 55 ++++++++++++++++++++++++- 3 files changed, 63 insertions(+), 2 deletions(-)
drivers/net/octeontx_ep/meson.build +1 -1
@@ -9,7 +9,7 @@ sources = files( 'otx_ep_rxtx.c', ) -extra_flags = [] +extra_flags = ['-DBUFPTR_ONLY_MODE'] # This integrated controller runs only on a arm64 machine, remove 32bit warnings if not dpdk_conf.get('RTE_ARCH_64') extra_flags += ['-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast']
drivers/net/octeontx_ep/otx_ep_common.h +8 -0
@@ -239,11 +239,19 @@ union otx_ep_rh {* about the packet. */ struct otx_ep_droq_info { +#ifndef BUFPTR_ONLY_MODE +/* The Output Receive Header. */ +union otx_ep_rh rh; + +/* The Length of the packet. */ +uint64_t length; +#else /* The Length of the packet. */ uint64_t length;/* The Output Receive Header. */ union otx_ep_rh rh; +#endif };#define OTX_EP_DROQ_INFO_SIZE (sizeof(struct otx_ep_droq_info))
drivers/net/octeontx_ep/otx_ep_rxtx.c +54 -1
97 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH 13/15 net/octeontx_ep: stats get/reset and link update
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Added stats get, stats reset and link update operations. Following stats are reported currently
1. ibytes, ipackets and ierrors.
2. obytes, opackets and oerrors.
--- drivers/net/octeontx_ep/otx_ep_ethdev.c | 84 +++++++++++++++++++++++++ 1 file changed, 84 insertions(+)
drivers/net/octeontx_ep/otx_ep_ethdev.c +84 -0
@@ -60,6 +60,27 @@ otx_ep_dev_info_get(struct rte_eth_dev *eth_dev,return 0 ; } +static int +otx_ep_dev_link_update (struct rte_eth_dev *eth_dev, + int wait_to_complete __rte_unused) +{ +struct otx_ep_device *otx_epvf; +struct rte_eth_link link; + + otx_epvf = (struct otx_ep_device *)OTX_EP_DEV (eth_dev); +memset (&link,0 ,sizeof (link)); + link.link_status =ETH_LINK_DOWN ; + link.link_speed =ETH_SPEED_NUM_NONE ; + link.link_duplex =ETH_LINK_HALF_DUPLEX ; + link.link_autoneg =ETH_LINK_AUTONEG ; +if (otx_epvf->linkup) { + link.link_status =ETH_LINK_UP ; + link.link_speed =ETH_SPEED_NUM_10G ; + link.link_duplex =ETH_LINK_FULL_DUPLEX ; + } +return rte_eth_linkstatus_set (eth_dev, &link); +} +static int otx_ep_dev_start (struct rte_eth_dev *eth_dev) {
@@ -348,6 +369,66 @@ otx_ep_tx_queue_release(void *txq)otx_ep_delete_iqs (tq->otx_ep_dev, tq->q_no); } +static int +otx_ep_dev_stats_get (struct rte_eth_dev *eth_dev, +struct rte_eth_stats *stats) +{ +struct otx_ep_device *otx_epvf =OTX_EP_DEV (eth_dev); +struct otx_ep_instr_queue *iq; +struct otx_ep_droq *droq; +int i; +uint64_t bytes =0 ; +uint64_t pkts =0 ; +uint64_t drop =0 ; + +for (i =0 ; i < eth_dev->data->nb_tx_queues; i++) { + iq = otx_epvf->instr_queue[i]; + pkts += iq->stats.tx_pkts; + bytes += iq->stats.tx_bytes; + drop += iq->stats.instr_dropped; + } + stats->opackets = pkts; + stats->obytes = bytes; + stats->oerrors = drop; + + pkts =0 ; + drop =0 ; + bytes =0 ; + +for (i =0 ; i < eth_dev->data->nb_rx_queues; i++) { + droq = otx_epvf->droq[i]; + pkts += droq->stats.pkts_received; + bytes += droq->stats.bytes_received; + drop += droq->stats.rx_alloc_failure + droq->stats.rx_err; + } + stats->ibytes = bytes; + stats->ipackets = pkts; + stats->ierrors = drop; + +return 0 ; +} + +static int +otx_ep_dev_stats_reset (struct rte_eth_dev *eth_dev) +{ +struct otx_ep_device *otx_epvf =OTX_EP_DEV (eth_dev); +struct otx_ep_instr_queue *iq; +struct otx_ep_droq *droq; +int i; + +for (i =0 ; i < eth_dev->data->nb_tx_queues; i++) { + iq = otx_epvf->instr_queue[i]; + iq->stats.tx_pkts =0 ; + iq->stats.tx_bytes =0 ; + } +for (i =0 ; i < eth_dev->data->nb_rx_queues; i++) { + droq = otx_epvf->droq[i]; + droq->stats.pkts_received =0 ; + droq->stats.bytes_received =0 ; + } +return 0 ; +} +/* Define our ethernet definitions */ static const struct eth_dev_ops otx_ep_eth_dev_ops = { .dev_configure = otx_ep_dev_configure,
@@ -357,6 +438,9 @@ static const struct eth_dev_ops otx_ep_eth_dev_ops = { .rx_queue_release = otx_ep_rx_queue_release, .tx_queue_setup = otx_ep_tx_queue_setup, .tx_queue_release = otx_ep_tx_queue_release, + .link_update = otx_ep_dev_link_update, + .stats_get = otx_ep_dev_stats_get, + .stats_reset = otx_ep_dev_stats_reset, .dev_infos_get = otx_ep_dev_info_get, };
Signature · 1 line
2.17.1
PATCH 14/15 net/octeontx_ep: rx queue interrupt
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Added rx queue interrupt enable and disable operations. These functions are supported on both otx and otx2 platforms. Application can make use of these functions and wait on event at packet reception.
--- drivers/net/octeontx_ep/otx2_ep_vf.c | 63 ++++++ drivers/net/octeontx_ep/otx2_ep_vf.h | 26 +++ drivers/net/octeontx_ep/otx_ep_common.h | 53 +++++ drivers/net/octeontx_ep/otx_ep_ethdev.c | 255 ++++++++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_vf.c | 66 ++++++ drivers/net/octeontx_ep/otx_ep_vf.h | 25 +++ 6 files changed, 488 insertions(+)
drivers/net/octeontx_ep/otx2_ep_vf.c +63 -0
@@ -2,6 +2,7 @@* Copyright(C) 2019 Marvell International Ltd. */ +#include <rte_ethdev_driver.h> #include "otx2_common.h" #include "otx_ep_common.h" #include "otx2_ep_vf.h"
@@ -282,6 +283,33 @@ otx2_vf_disable_io_queues(struct otx_ep_device *otx_ep) } } +static uint32_t +otx2_vf_update_read_index (struct otx_ep_instr_queue *iq) +{ +uint32_t new_idx =rte_read32 (iq->inst_cnt_reg); + +if (new_idx ==0xFFFFFFFF ) { +otx_ep_dbg ("%s Going to reset IQ index\n" , __func__); +rte_write32 (new_idx, iq->inst_cnt_reg); + } + +/* The new instr cnt reg is a 32-bit counter that can roll over. +* We have noted the counter's initial value at init time into +* reset_instr_cnt +*/ +if (iq->reset_instr_cnt < new_idx) + new_idx -= iq->reset_instr_cnt; +else + new_idx += (0xffffffff - iq->reset_instr_cnt) +1 ; + +/* Modulo of the new index with the IQ size will give us +* the new index. +*/ + new_idx %= iq->nb_desc; + +return new_idx; +} +static const struct otx_ep_config default_otx2_ep_conf = {/* IQ attributes */ .iq = {
@@ -313,6 +341,38 @@ otx2_ep_get_defconf(struct otx_ep_device *otx_ep_dev __rte_unused)return default_conf; } +static int otx2_vf_enable_rxq_intr (struct otx_ep_device *otx_epvf, +uint16_t q_no) +{ +union out_int_lvl_t out_int_lvl; +union out_cnts_t out_cnts; + + out_int_lvl.s.time_cnt_en =1 ; + out_int_lvl.s.cnt =0 ; +otx2_write64 (out_int_lvl.d64, otx_epvf->hw_addr + +SDP_VF_R_OUT_INT_LEVELS (q_no)); + out_cnts.d64 =0 ; + out_cnts.s.resend =1 ; +otx2_write64 (out_cnts.d64, otx_epvf->hw_addr +SDP_VF_R_OUT_CNTS (q_no)); +return 0 ; +} + +static int otx2_vf_disable_rxq_intr (struct otx_ep_device *otx_epvf, +uint16_t q_no) +{ +union out_int_lvl_t out_int_lvl; + +/* Disable the interrupt for this queue */ + out_int_lvl.d64 =otx2_read64 (otx_epvf->hw_addr + +SDP_VF_R_OUT_INT_LEVELS (q_no)); + out_int_lvl.s.time_cnt_en =0 ; + out_int_lvl.s.cnt =0 ; +otx2_write64 (out_int_lvl.d64, otx_epvf->hw_addr + +SDP_VF_R_OUT_INT_LEVELS (q_no)); + +return 0 ; +} +int otx2_ep_vf_setup_device (struct otx_ep_device *otx_ep) {
@@ -340,6 +400,7 @@ otx2_ep_vf_setup_device(struct otx_ep_device *otx_ep) otx_ep->fn_list.setup_oq_regs = otx2_vf_setup_oq_regs; otx_ep->fn_list.setup_device_regs = otx2_vf_setup_device_regs; + otx_ep->fn_list.update_iq_read_idx = otx2_vf_update_read_index; otx_ep->fn_list.enable_io_queues = otx2_vf_enable_io_queues; otx_ep->fn_list.disable_io_queues = otx2_vf_disable_io_queues;
@@ -349,6 +410,8 @@ otx2_ep_vf_setup_device(struct otx_ep_device *otx_ep) otx_ep->fn_list.enable_oq = otx2_vf_enable_oq; otx_ep->fn_list.disable_oq = otx2_vf_disable_oq; + otx_ep->fn_list.enable_rxq_intr = otx2_vf_enable_rxq_intr; + otx_ep->fn_list.disable_rxq_intr = otx2_vf_disable_rxq_intr;return 0 ; }
drivers/net/octeontx_ep/otx2_ep_vf.h +26 -0
@@ -26,5 +26,31 @@ struct otx2_ep_instr_64B { uint64_t exhdr[4]; }; +union out_int_lvl_t { +uint64_t d64; +struct { +uint64_t cnt:32 ; +uint64_t timet:22 ; +uint64_t max_len:7 ; +uint64_t max_len_en:1 ; +uint64_t time_cnt_en:1 ; +uint64_t bmode:1 ; + } s; +}; + +union out_cnts_t { +uint64_t d64; +struct { +uint64_t cnt:32 ; +uint64_t timer:22 ; +uint64_t rsvd:5 ; +uint64_t resend:1 ; +uint64_t mbox_int:1 ; +uint64_t in_int:1 ; +uint64_t out_int:1 ; +uint64_t send_ism:1 ; + } s; +}; +#endif /*_OTX2_EP_VF_H_ */
drivers/net/octeontx_ep/otx_ep_common.h +53 -0
85 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_ethdev.c +255 -0
311 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_vf.c +66 -0
91 lines not on this page · raw message
drivers/net/octeontx_ep/otx_ep_vf.h +25 -0
@@ -170,4 +170,29 @@ struct otx_ep_instr_64B {int otx_ep_vf_setup_device (struct otx_ep_device *otx_ep); + +union otx_out_int_lvl_t { +uint64_t d64; +struct { +uint64_t cnt:32 ; +uint64_t timet:22 ; +uint64_t raz:9 ; +uint64_t bmode:1 ; + } s; +}; + +union otx_out_cnts_t { +uint64_t d64; +struct { +uint64_t cnt:32 ; +uint64_t timer:22 ; +uint64_t rsvd0:5 ; +uint64_t resend:1 ; +uint64_t mbox_int:1 ; +uint64_t in_int:1 ; +uint64_t out_int:1 ; +uint64_t rsvd1:1 ; + } s; +}; +#endif /*_OTX_EP_VF_H_ */
Signature · 1 line
2.17.1
PATCH 15/15 net/octeontx_ep: Input output reset.
In reply to Nalla, PradeepFrom: "Nalla Pradeep" <[email protected]>
Function to allow resetting input and output queues are added. Supports both otx and otx2 endpoints.
--- drivers/net/octeontx_ep/otx2_ep_vf.c | 120 ++++++++++++++++++++++ drivers/net/octeontx_ep/otx_ep_vf.c | 143 +++++++++++++++++++++++++++ 2 files changed, 263 insertions(+)
drivers/net/octeontx_ep/otx2_ep_vf.c +120 -0
@@ -7,6 +7,96 @@#include "otx_ep_common.h" #include "otx2_ep_vf.h" +static int +otx2_vf_reset_iq (struct otx_ep_device *otx_ep,int q_no) +{ +uint64_t loop =SDP_VF_BUSY_LOOP_COUNT ; +volatile uint64_t d64 =0ull ; + +/* There is no RST for a ring. +* Clear all registers one by one after disabling the ring +*/ + +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_IN_ENABLE (q_no)); +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_IN_INSTR_BADDR (q_no)); +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_IN_INSTR_RSIZE (q_no)); + + d64 =0xFFFFFFFF ;/* ~0ull */ +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_IN_INSTR_DBELL (q_no)); + d64 =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_IN_INSTR_DBELL (q_no)); + +while ((d64 !=0 ) && loop--) { +otx2_write64 (d64, otx_ep->hw_addr + +SDP_VF_R_IN_INSTR_DBELL (q_no)); + +rte_delay_ms (1 ); + + d64 =otx2_read64 (otx_ep->hw_addr + +SDP_VF_R_IN_INSTR_DBELL (q_no)); + } + + loop =SDP_VF_BUSY_LOOP_COUNT ; + d64 =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_IN_CNTS (q_no)); +while ((d64 !=0 ) && loop--) { +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_IN_CNTS (q_no)); + +rte_delay_ms (1 ); + + d64 =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_IN_CNTS (q_no)); + } + + d64 =0ull ; +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_IN_INT_LEVELS (q_no)); +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_IN_PKT_CNT (q_no)); +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_IN_BYTE_CNT (q_no)); + +return 0 ; +} + +static int +otx2_vf_reset_oq (struct otx_ep_device *otx_ep,int q_no) +{ +uint64_t loop =SDP_VF_BUSY_LOOP_COUNT ; +volatile uint64_t d64 =0ull ; + +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_OUT_ENABLE (q_no)); + +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_OUT_SLIST_BADDR (q_no)); + +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_OUT_SLIST_RSIZE (q_no)); + + d64 =0xFFFFFFFF ; +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_OUT_SLIST_DBELL (q_no)); + d64 =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_OUT_SLIST_DBELL (q_no)); + +while ((d64 !=0 ) && loop--) { +otx2_write64 (d64, otx_ep->hw_addr + +SDP_VF_R_OUT_SLIST_DBELL (q_no)); + +rte_delay_ms (1 ); + + d64 =otx2_read64 (otx_ep->hw_addr + +SDP_VF_R_OUT_SLIST_DBELL (q_no)); + } + + loop =SDP_VF_BUSY_LOOP_COUNT ; + d64 =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_OUT_CNTS (q_no)); +while ((d64 !=0 ) && (loop--)) { +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_OUT_CNTS (q_no)); + +rte_delay_ms (1 ); + + d64 =otx2_read64 (otx_ep->hw_addr +SDP_VF_R_OUT_CNTS (q_no)); + } + + d64 =0ull ; +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_OUT_INT_LEVELS (q_no)); +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_OUT_PKT_CNT (q_no)); +otx2_write64 (d64, otx_ep->hw_addr +SDP_VF_R_OUT_BYTE_CNT (q_no)); + +return 0 ; +} +static void otx2_vf_setup_global_iq_reg (struct otx_ep_device *otx_ep,int q_no) {
@@ -52,11 +142,39 @@ otx2_vf_setup_global_oq_reg(struct otx_ep_device *otx_ep, int q_no)otx2_write64 (reg_val, otx_ep->hw_addr +SDP_VF_R_OUT_CONTROL (q_no)); } +static int +otx2_vf_reset_input_queues (struct otx_ep_device *otx_ep) +{ +uint32_t q_no =0 ; + +otx_ep_dbg ("%s :" , __func__); + +for (q_no =0 ; q_no < otx_ep->sriov_info.rings_per_vf; q_no++) +otx2_vf_reset_iq (otx_ep, q_no); + +return 0 ; +} + +static int +otx2_vf_reset_output_queues (struct otx_ep_device *otx_ep) +{ +uint64_t q_no =0ull ; + +otx_ep_dbg (" %s :" , __func__); + +for (q_no =0 ; q_no < otx_ep->sriov_info.rings_per_vf; q_no++) +otx2_vf_reset_oq (otx_ep, q_no); + +return 0 ; +} +static void otx2_vf_setup_global_input_regs (struct otx_ep_device *otx_ep) {uint64_t q_no =0ull ; +otx2_vf_reset_input_queues (otx_ep); +for (q_no =0 ; q_no < (otx_ep->sriov_info.rings_per_vf); q_no++)otx2_vf_setup_global_iq_reg (otx_ep, q_no); }
@@ -66,6 +184,8 @@ otx2_vf_setup_global_output_regs(struct otx_ep_device *otx_ep) {uint32_t q_no; +otx2_vf_reset_output_queues (otx_ep); +for (q_no =0 ; q_no < (otx_ep->sriov_info.rings_per_vf); q_no++)otx2_vf_setup_global_oq_reg (otx_ep, q_no); }
drivers/net/octeontx_ep/otx_ep_vf.c +143 -0
168 lines not on this page · raw message
Signature · 1 line
2.17.1
Quoted 5 lines · Pradeep
From: "Nalla Pradeep" <[email protected]>
This patch set contains PMD with minimal set of operations that can drive both Octeon Tx and Tx2 in endpoint.
Hi Pradeep,
There is already octeontx and octeontx2 net drivers, what is the difference of the 'endpoint' driver, why it is needed, can you please give more information?
Quoted 17 lines
Nalla, Pradeep (15):
net/octeontx_ep: add build and doc infrastructurenet/octeontx_ep: add ethdev probe and removenet/octeontx_ep: add device init and uninitnet/octeontx_ep: Added basic device setup.net/octeontx_ep: Add dev info get and configurenet/octeontx_ep: Added rxq setup and releasenet/octeontx_ep: Added tx queue setup and releasenet/octeontx_ep: Setting up iq and oq registersnet/octeontx_ep: Added dev start and stopnet/octeontx_ep: Receive data path function addednet/octeontx_ep: Transmit data path function addednet/octeontx_ep: INFO PTR mode support added.net/octeontx_ep: stats get/reset and link updatenet/octeontx_ep: rx queue interruptnet/octeontx_ep: Input output reset.
<...>
Hi Ferruh
This PMD, while running on a host, drives octeontx/octeontx2 over pci bus, where as "OcteonTx and OcteonTx2 net drivers" run on respective Tx/Tx2 SOCs to make use of h/w blocks present on the SOC.
Thanks
Pradeep.
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Monday, January 4, 2021 5:22 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmd
External Email
----------------------------------------------------------------------
Quoted 5 lines · Pradeep
From: "Nalla Pradeep" <[email protected]>
This patch set contains PMD with minimal set of operations that can drive both Octeon Tx and Tx2 in endpoint.
Hi Pradeep,
There is already octeontx and octeontx2 net drivers, what is the difference of the 'endpoint' driver, why it is needed, can you please give more information?
Quoted 17 lines
Nalla, Pradeep (15):
net/octeontx_ep: add build and doc infrastructurenet/octeontx_ep: add ethdev probe and removenet/octeontx_ep: add device init and uninitnet/octeontx_ep: Added basic device setup.net/octeontx_ep: Add dev info get and configurenet/octeontx_ep: Added rxq setup and releasenet/octeontx_ep: Added tx queue setup and releasenet/octeontx_ep: Setting up iq and oq registersnet/octeontx_ep: Added dev start and stopnet/octeontx_ep: Receive data path function addednet/octeontx_ep: Transmit data path function addednet/octeontx_ep: INFO PTR mode support added.net/octeontx_ep: stats get/reset and link updatenet/octeontx_ep: rx queue interruptnet/octeontx_ep: Input output reset.
<...>
On 1/5/2021 2:43 PM, Pradeep Kumar Nalla wrote:
Please do not top post, reply moved below.
Quoted 19 lines
Thanks
Pradeep.
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Monday, January 4, 2021 5:22 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdExternal Email
----------------------------------------------------------------------
Quoted 5 lines · Pradeep
From: "Nalla Pradeep" <[email protected]>
This patch set contains PMD with minimal set of operations that can drive both Octeon Tx and Tx2 in endpoint.
Quoted 8 lines
Hi Pradeep,
There is already octeontx and octeontx2 net drivers, what is the difference of the 'endpoint' driver, why it is needed, can you please give more information?
Hi Ferruh
This PMD, while running on a host, drives octeontx/octeontx2 over pci bus, where as "OcteonTx and OcteonTx2 net drivers" run on respective Tx/Tx2 SOCs to make use of h/w blocks present on the SOC.
But aren't they same HW block, either in the SoC or external ethernet controller via PCI bus?
As far as I can see octeontx2 access the device via PCI bus, why updating the existing driver and adding new device IDs is not working?
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, January 5, 2021 8:59 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmd
On 1/5/2021 2:43 PM, Pradeep Kumar Nalla wrote:
Please do not top post, reply moved below.
Quoted 22 lines
Thanks
Pradeep.
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Monday, January 4, 2021 5:22 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdExternal Email
----------------------------------------------------------------------
Quoted 5 lines · Pradeep
From: "Nalla Pradeep" <[email protected]>
This patch set contains PMD with minimal set of operations that can drive both Octeon Tx and Tx2 in endpoint.
Hi Pradeep,
Quoted 7 lines
There is already octeontx and octeontx2 net drivers, what is the difference of the 'endpoint' driver, why it is needed, can you please give more information?
Hi Ferruh
This PMD, while running on a host, drives octeontx/octeontx2 over pci bus, where as "OcteonTx and OcteonTx2 net drivers" run on respective Tx/Tx2 SOCs to make use of h/w blocks present on the SOC.
But aren't they same HW block, either in the SoC or external ethernet controller via PCI bus?
No, this pmd doesn't access any h/w block on the soc. When in ep mode octeontx and octeontx2 present themselves as network devices and this pmd will program that interface and does packet rx/tx.
Quoted 1 line
As far as I can see octeontx2 access the device via PCI bus, why updating the existing driver and adding new device IDs is not working?
OxteonTx2 access H/W blocks on soc which also appear as PCI devices.
Quoted 38 lines · Pradeep Kumar Nalla
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, January 5, 2021 8:59 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdOn 1/5/2021 2:43 PM, Pradeep Kumar Nalla wrote:
Please do not top post, reply moved below.
Quoted 24 lines
Thanks
Pradeep.
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Monday, January 4, 2021 5:22 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdExternal Email
----------------------------------------------------------------------
Quoted 5 lines · Pradeep
From: "Nalla Pradeep" <[email protected]>
This patch set contains PMD with minimal set of operations that can drive both Octeon Tx and Tx2 in endpoint.
Hi Pradeep,
There is already octeontx and octeontx2 net drivers, what is the difference of the 'endpoint' driver, why it is needed, can you please give more information?
Quoted 8 lines
Quoted 5 lines
Hi Ferruh
This PMD, while running on a host, drives octeontx/octeontx2 over pci bus, where as "OcteonTx and OcteonTx2 net drivers" run on respective Tx/Tx2 SOCs to make use of h/w blocks present on the SOC.
But aren't they same HW block, either in the SoC or external ethernet controller via PCI bus?
No, this pmd doesn't access any h/w block on the soc. When in ep mode octeontx and octeontx2 present themselves as network devices and this pmd will program that interface and does packet rx/tx.
Quoted 1 line
As far as I can see octeontx2 access the device via PCI bus, why updating the existing driver and adding new device IDs is not working?
OxteonTx2 access H/W blocks on soc which also appear as PCI devices.
In other words,
- The net/octeontx2 driver has a separate set of HW devices that are not accessible from x86 host.
- Even though net/octeontx2 is based on PCI bus, scope of that PCI bus is internal to SoC. It is an internal bus emulated as PCI to help standard device probing works.
Quoted 43 lines · Jerin Jacob
Quoted 42 lines · Pradeep Kumar Nalla
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, January 5, 2021 8:59 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdOn 1/5/2021 2:43 PM, Pradeep Kumar Nalla wrote:
Please do not top post, reply moved below.
Quoted 28 lines
Thanks
Pradeep.
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Monday, January 4, 2021 5:22 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdExternal Email
----------------------------------------------------------------------
Quoted 5 lines · Pradeep
From: "Nalla Pradeep" <[email protected]>
This patch set contains PMD with minimal set of operations that can drive both Octeon Tx and Tx2 in endpoint.
Hi Pradeep,
There is already octeontx and octeontx2 net drivers, what is the difference of the 'endpoint' driver, why it is needed, can you please give more information?
Hi Ferruh
This PMD, while running on a host, drives octeontx/octeontx2 over pci bus, where as "OcteonTx and OcteonTx2 net drivers" run on respective Tx/Tx2 SOCs to make use of h/w blocks present on the SOC.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
But aren't they same HW block, either in the SoC or external ethernet controller via PCI bus?
No, this pmd doesn't access any h/w block on the soc. When in ep mode octeontx and octeontx2 present themselves as network devices and this pmd will program that interface and does packet rx/tx.
Quoted 1 line
As far as I can see octeontx2 access the device via PCI bus, why updating the existing driver and adding new device IDs is not working?
OxteonTx2 access H/W blocks on soc which also appear as PCI devices.
In other words,
- The net/octeontx2 driver has a separate set of HW devices that are not accessible from x86 host.
So is the net/octeontx2 superset of the endpoint driver?
Quoted 4 lines
- Even though net/octeontx2 is based on PCI bus, scope of that PCI bus is internal to SoC. It is an internal bus emulated as PCI to help standard device probing works.
This shouldn't differ from driver perspective, right, for driver it is configuring device on PCI bus.
Just to be able to eliminate any code that can be eliminated, what prevents using 'net/octeontx2'?
Like I assume one of the HW block not accessible for EP device is eventdev block, is this making required driver change too big, or is it completely something else?
Btw, I can see some end point device PCI IDs are already used, PCI_DEVID_OCTEONTX2_EP_VF, but it is used by a rawdev driver (raw/octeontx2_ep), not sure what it is.
Quoted 61 lines · Ferruh Yigit
Quoted 43 lines · Jerin Jacob
Quoted 42 lines · Pradeep Kumar Nalla
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, January 5, 2021 8:59 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdOn 1/5/2021 2:43 PM, Pradeep Kumar Nalla wrote:
Please do not top post, reply moved below.
Quoted 28 lines
Thanks
Pradeep.
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Monday, January 4, 2021 5:22 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdExternal Email
----------------------------------------------------------------------
Quoted 5 lines · Pradeep
From: "Nalla Pradeep" <[email protected]>
This patch set contains PMD with minimal set of operations that can drive both Octeon Tx and Tx2 in endpoint.
Hi Pradeep,
There is already octeontx and octeontx2 net drivers, what is the difference of the 'endpoint' driver, why it is needed, can you please give more information?
Hi Ferruh
This PMD, while running on a host, drives octeontx/octeontx2 over pci bus, where as "OcteonTx and OcteonTx2 net drivers" run on respective Tx/Tx2 SOCs to make use of h/w blocks present on the SOC.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
But aren't they same HW block, either in the SoC or external ethernet controller via PCI bus?
No, this pmd doesn't access any h/w block on the soc. When in ep mode octeontx and octeontx2 present themselves as network devices and this pmd will program that interface and does packet rx/tx.
Quoted 1 line
As far as I can see octeontx2 access the device via PCI bus, why updating the existing driver and adding new device IDs is not working?
OxteonTx2 access H/W blocks on soc which also appear as PCI devices.
In other words,
- The net/octeontx2 driver has a separate set of HW devices that are not accessible from x86 host.So is the net/octeontx2 superset of the endpoint driver?
Quoted 4 lines
- Even though net/octeontx2 is based on PCI bus, scope of that PCI bus is internal to SoC. It is an internal bus emulated as PCI to help standard device probing works.
Quoted 8 lines
This shouldn't differ from driver perspective, right, for driver it is configuring device on PCI bus.
Just to be able to eliminate any code that can be eliminated, what prevents using 'net/octeontx2'?
Like I assume one of the HW block not accessible for EP device is eventdev block, is this making required driver change too big, or is it completely something else?
No one of the HW devices that is managed by net/octeontx2 is available to PCI RC HOST.
The architecture is like below: It is for smart NIC kind of use case where
1) octeontx2 is in PCIe form factor(connected to x86)
2) net/octeontx2 driver runs on arm64
3) There will be a DPDK application that's using net/octeontx2 on ARM64 and it includes a message server(we call it FW)
4) New PMD(net/octeontx_ep) run on x86, send messages over PCI interface.
5) FW Receives the msg and DPDK app(FW) on ARM64 process it using net/octeonxt2. These messages are very high level abstracted.
6) FW Transmites back message to x86
7) Step 5 and 6 is the ethdev dev ops for net/octeontx_ep
Quoted 3 lines
Btw, I can see some end point device PCI IDs are already used,
PCI_DEVID_OCTEONTX2_EP_VF, but it is used by a rawdev driver (raw/octeontx2_ep), not sure what it is.
Good point. underlaying HW for raw dev and net/octeontx_ep is the same. Just that new PMD has a handle for
custom message(with help FW in arm64) to act as ethdev device. We will see what is the best
method to resolve PCI ID conflit.
-----Original Message-----
From: Jerin Jacob <[email protected]>
Sent: Wednesday, January 6, 2021 8:14 PM
To: Ferruh Yigit <[email protected]>
Cc: Pradeep Kumar Nalla <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmd
Quoted 88 lines · Ferruh Yigit
Quoted 46 lines · Jerin Jacob
Quoted 45 lines · Pradeep Kumar Nalla
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, January 5, 2021 8:59 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdOn 1/5/2021 2:43 PM, Pradeep Kumar Nalla wrote:
Please do not top post, reply moved below.
Quoted 29 lines
Thanks
Pradeep.
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Monday, January 4, 2021 5:22 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdExternal Email
------------------------------------------------------------------
Quoted 5 lines · Pradeep
From: "Nalla Pradeep" <[email protected]>
This patch set contains PMD with minimal set of operations that can drive both Octeon Tx and Tx2 in endpoint.
Hi Pradeep,
There is already octeontx and octeontx2 net drivers, what is the difference of the 'endpoint' driver, why it is needed, can you please give more information?
Hi Ferruh
This PMD, while running on a host, drives octeontx/octeontx2 over pci bus, where as "OcteonTx and OcteonTx2 net drivers" run on respective Tx/Tx2 SOCs to make use of h/w blocks present on the SOC.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
But aren't they same HW block, either in the SoC or external ethernet controller via PCI bus?
No, this pmd doesn't access any h/w block on the soc. When in ep mode octeontx and octeontx2 present themselves as network devices and this pmd will program that interface and does packet rx/tx.
Quoted 1 line
As far as I can see octeontx2 access the device via PCI bus, why updating the existing driver and adding new device IDs is not working?
OxteonTx2 access H/W blocks on soc which also appear as PCI devices.
In other words,
- The net/octeontx2 driver has a separate set of HW devices that are not accessible from x86 host.So is the net/octeontx2 superset of the endpoint driver?
Quoted 4 lines
- Even though net/octeontx2 is based on PCI bus, scope of that PCI bus is internal to SoC. It is an internal bus emulated as PCI to help standard device probing works.
This shouldn't differ from driver perspective, right, for driver it is configuring device on PCI bus.
Quoted 5 lines
Just to be able to eliminate any code that can be eliminated, what prevents using 'net/octeontx2'?
Like I assume one of the HW block not accessible for EP device is eventdev block, is this making required driver change too big, or is it completely something else?No one of the HW devices that is managed by net/octeontx2 is available to PCI RC HOST.
The architecture is like below: It is for smart NIC kind of use case where
1) octeontx2 is in PCIe form factor(connected to x86)
2) net/octeontx2 driver runs on arm64
3) There will be a DPDK application that's using net/octeontx2 on ARM64 and it includes a message server(we call it FW)
4) NewPMD(net/octeontx_ep)run on x86, send messages over PCI interface.
5) FW Receives the msg and DPDK app(FW) on ARM64 process it using net/octeonxt2. These messages are very high level abstracted.
6) FW Transmites back message to x86
7) Step 5 and 6 is the ethdev dev ops fornet/octeontx_ep
Quoted 5 lines
Quoted 3 lines
Btw, I can see some end point device PCI IDs are already used,
PCI_DEVID_OCTEONTX2_EP_VF, but it is used by a rawdev driver (raw/octeontx2_ep), not sure what it is.Good point. underlaying HW for raw dev and
net/octeontx_epis the same. Just that new PMD has a handle for >custom message(with help FW in arm64) to act as ethdev device. We will see what is the best method to resolve >PCI ID conflit.
Device id of (raw/octeontx2_ep) i.e., PCI_DEVID_OCTEONTX2_EP_VF will be changed to 0xB204 whereas net/octeon_tx2 will continue to have 0xB203
Quoted 75 lines · Jerin Jacob
Quoted 61 lines · Ferruh Yigit
Quoted 43 lines · Jerin Jacob
Quoted 42 lines · Pradeep Kumar Nalla
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, January 5, 2021 8:59 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdOn 1/5/2021 2:43 PM, Pradeep Kumar Nalla wrote:
Please do not top post, reply moved below.
Quoted 28 lines
Thanks
Pradeep.
-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Monday, January 4, 2021 5:22 PM
To: Pradeep Kumar Nalla <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Satananda Burla <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH 00/15] Octeon Tx/Tx2 Endpoint pmdExternal Email
----------------------------------------------------------------------
Quoted 5 lines · Pradeep
From: "Nalla Pradeep" <[email protected]>
This patch set contains PMD with minimal set of operations that can drive both Octeon Tx and Tx2 in endpoint.
Hi Pradeep,
There is already octeontx and octeontx2 net drivers, what is the difference of the 'endpoint' driver, why it is needed, can you please give more information?
Hi Ferruh
This PMD, while running on a host, drives octeontx/octeontx2 over pci bus, where as "OcteonTx and OcteonTx2 net drivers" run on respective Tx/Tx2 SOCs to make use of h/w blocks present on the SOC.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
But aren't they same HW block, either in the SoC or external ethernet controller via PCI bus?
No, this pmd doesn't access any h/w block on the soc. When in ep mode octeontx and octeontx2 present themselves as network devices and this pmd will program that interface and does packet rx/tx.
Quoted 1 line
As far as I can see octeontx2 access the device via PCI bus, why updating the existing driver and adding new device IDs is not working?
OxteonTx2 access H/W blocks on soc which also appear as PCI devices.
In other words,
- The net/octeontx2 driver has a separate set of HW devices that are not accessible from x86 host.So is the net/octeontx2 superset of the endpoint driver?
Quoted 4 lines
- Even though net/octeontx2 is based on PCI bus, scope of that PCI bus is internal to SoC. It is an internal bus emulated as PCI to help standard device probing works.
Quoted 8 lines
This shouldn't differ from driver perspective, right, for driver it is configuring device on PCI bus.
Just to be able to eliminate any code that can be eliminated, what prevents using 'net/octeontx2'?
Like I assume one of the HW block not accessible for EP device is eventdev block, is this making required driver change too big, or is it completely something else?No one of the HW devices that is managed by net/octeontx2 is available to PCI RC HOST.
Quoted 11 lines
The architecture is like below: It is for smart NIC kind of use case where
1) octeontx2 is in PCIe form factor(connected to x86)
2) net/octeontx2 driver runs on arm64
3) There will be a DPDK application that's using net/octeontx2 on ARM64 and it includes a message server(we call it FW)
4) NewPMD(net/octeontx_ep)run on x86, send messages over PCI interface.
5) FW Receives the msg and DPDK app(FW) on ARM64 process it using net/octeonxt2. These messages are very high level abstracted.
6) FW Transmites back message to x86
7) Step 5 and 6 is the ethdev dev ops fornet/octeontx_ep
Thanks Jerin for the clarification.
Quoted 11 lines
Quoted 4 lines
Btw, I can see some end point device PCI IDs are already used,
PCI_DEVID_OCTEONTX2_EP_VF, but it is used by a rawdev driver (raw/octeontx2_ep), not sure what it is.Good point. underlaying HW for raw dev and
net/octeontx_epis the same. Just that new PMD has a handle for
custom message(with help FW in arm64) to act as ethdev device. We will see what is the best
method to resolve PCI ID conflit.