Skip to contentSkip to conversation

net/atlantic: Aquantia aQtion 10G NIC Family DPDK PMD driver

PATCH In review Igor Russkikh 2 participants 25 messages Oct 12, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v6 cover net/atlantic: Aquantia aQtion 10G NIC Family DPDK PMD driver

Hello DPDK community!

Aquantia would like to contribute PMD for aQtion AQC10X NIC family:
https://www.aquantia.com/products/aqtion/chips/
These are 10G ethernet NICs with various features.

We do base this work on parts of the existing native linux kernel driver source (atlantic). Shared code is hw_atl hardware and registers access module.

We'd like to target this driver for 18.11 DPDK release timeline, it'd be good to hear comments from the community on how feasible is this.

This patchset implements basic driver infrastructure, vlan offloads, checksumm offloads, rss control, multiring, jumbo frames and other features.

Later on, we plan to share HW MACSEC offloads, rxflows and other features.

version 6 changes:
- PKT_TX_VLAN_PKT replaced with PKT_TX_VLAN
- rx_descriptor_done removed
- adding PKT_RX_VLAN/STRIPPED into mbuf->ol_flags when vlan offloads are on
- commit headlines better naming

version 5 changes:
- MTU configuration is now in separate patch
- Custom LED api removed. Will resubmit separately later on
- Add product link to docs, rearranged adapter features file
- MAINTAINERS file update
- logging name prefix fixed
- rte_eth_copy_pci_info is not needed in init
- dev->security_ctx is not used (removed free)
- fixed adapter_stopped and dev stop/close states interactions
- return error if get_fw_version fails
- added port# to important error logs
- rte_eth_linkstatus_get instead of atomic64 ops
- swstats are now cleared in stats_reset
- xstats_reset callback declared as atl_dev_stats_reset
- stats_mapping_set removed
- check-git-logs fixes

version 4 changes:
- fixed build errors with -Werror on gcc7
- validated build on arm64, freebsd x86_64
- PPC marked as unsupported arch
- stdbool.h is used instead of bool redefines

version 3 changes:
- patchset fixed to be incrementally buildable
- extra includes removed and cleaned up
- license changed to dual GPL-BSD for pieces shared with linux
- removed extra logging #defines
- misc comments from previous review session

version 2 changes:
- fixed build on freebsd (no ETIME const)
- fixed a bunch of checkpatch failures and warnings
- removed extra CFLAGS disabled warning
- making static arrays const

Igor Russkikh (8):
net/atlantic: add logging structure net/atlantic: add hardware registers access routines net/atlantic: add hardware access layer net/atlantic: implement firmware operations net/atlantic: add b0 hardware layer net/atlantic: implement Rx path net/atlantic: implement RSS and RETA manipulation API net/atlantic: add release notes

Pavel Belous (14):
net/atlantic: add atlantic PMD driver skeleton net/atlantic: configure rte device start/stop net/atlantic: implement core logic for Tx/Rx net/atlantic: implement Tx path
net/atlantic: add link status and interrupt management net/atlantic: implement device statistics net/atlantic: add Rx/Tx descriptors information net/atlantic: implement promisc and allmulti modes net/atlantic: add flow control configuration net/atlantic: implement MAC address manipulations net/atlantic: implement MTU configuration net/atlantic: implement VLAN filters and offloads net/atlantic: implement EEPROM get/set net/atlantic: read MAC registers for debug purposes

 MAINTAINERS                                       |    7 +
 config/common_base                                |    5 +
 config/defconfig_ppc_64-power8-linuxapp-gcc       |    1 +
 doc/guides/nics/atlantic.rst                      |   47 +
 doc/guides/nics/features/atlantic.ini             |   37 +
 doc/guides/nics/index.rst                         |    1 +
 doc/guides/rel_notes/release_18_11.rst            |    5 +
 drivers/net/Makefile                              |    1 +
 drivers/net/atlantic/Makefile                     |   35 +
 drivers/net/atlantic/atl_common.h                 |   96 +
 drivers/net/atlantic/atl_ethdev.c                 | 1539 +++++++++++++
 drivers/net/atlantic/atl_ethdev.h                 |  107 +
 drivers/net/atlantic/atl_hw_regs.c                |   52 +
 drivers/net/atlantic/atl_hw_regs.h                |   53 +
 drivers/net/atlantic/atl_logs.h                   |   31 +
 drivers/net/atlantic/atl_rxtx.c                   | 1357 ++++++++++++
 drivers/net/atlantic/atl_types.h                  |  186 ++
 drivers/net/atlantic/hw_atl/hw_atl_b0.c           |  510 +++++
 drivers/net/atlantic/hw_atl/hw_atl_b0.h           |   40 +
 drivers/net/atlantic/hw_atl/hw_atl_b0_internal.h  |  145 ++
 drivers/net/atlantic/hw_atl/hw_atl_llh.c          | 1490 +++++++++++++
 drivers/net/atlantic/hw_atl/hw_atl_llh.h          |  714 ++++++
 drivers/net/atlantic/hw_atl/hw_atl_llh_internal.h | 2407 +++++++++++++++++++++
 drivers/net/atlantic/hw_atl/hw_atl_utils.c        |  942 ++++++++
 drivers/net/atlantic/hw_atl/hw_atl_utils.h        |  510 +++++
 drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c   |  618 ++++++
 drivers/net/atlantic/meson.build                  |   12 +
 drivers/net/atlantic/rte_pmd_atlantic_version.map |    4 +
 drivers/net/meson.build                           |    1 +
 mk/rte.app.mk                                     |    1 +
 30 files changed, 10954 insertions(+)
 create mode 100644 doc/guides/nics/atlantic.rst
 create mode 100644 doc/guides/nics/features/atlantic.ini
 create mode 100644 drivers/net/atlantic/Makefile
 create mode 100644 drivers/net/atlantic/atl_common.h
 create mode 100644 drivers/net/atlantic/atl_ethdev.c
 create mode 100644 drivers/net/atlantic/atl_ethdev.h
 create mode 100644 drivers/net/atlantic/atl_hw_regs.c
 create mode 100644 drivers/net/atlantic/atl_hw_regs.h
 create mode 100644 drivers/net/atlantic/atl_logs.h
 create mode 100644 drivers/net/atlantic/atl_rxtx.c
 create mode 100644 drivers/net/atlantic/atl_types.h
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_b0.c
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_b0.h
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_b0_internal.h
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_llh.c
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_llh.h
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_llh_internal.h
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_utils.c
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_utils.h
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c
 create mode 100644 drivers/net/atlantic/meson.build
 create mode 100644 drivers/net/atlantic/rte_pmd_atlantic_version.map
Signature · 1 line
2.7.4
#1 lore raw

PATCH v6 1/22 net/atlantic: add atlantic PMD driver skeleton

From: Pavel Belous <[email protected]>

Makefile/meson build infrastructure, atl_ethdev minimal skeleton, header with aquantia aQtion NIC device and vendor IDs.

---
 MAINTAINERS                                       |   7 +
 config/common_base                                |   5 +
 config/defconfig_ppc_64-power8-linuxapp-gcc       |   1 +
 doc/guides/nics/atlantic.rst                      |  37 +++++
 doc/guides/nics/features/atlantic.ini             |  10 ++
 doc/guides/nics/index.rst                         |   1 +
 drivers/net/Makefile                              |   1 +
 drivers/net/atlantic/Makefile                     |  27 ++++
 drivers/net/atlantic/atl_common.h                 |  96 ++++++++++++
 drivers/net/atlantic/atl_ethdev.c                 | 170 ++++++++++++++++++++++
 drivers/net/atlantic/atl_ethdev.h                 |  15 ++
 drivers/net/atlantic/meson.build                  |   6 +
 drivers/net/atlantic/rte_pmd_atlantic_version.map |   4 +
 drivers/net/meson.build                           |   1 +
 mk/rte.app.mk                                     |   1 +
 15 files changed, 382 insertions(+)
 create mode 100644 doc/guides/nics/atlantic.rst
 create mode 100644 doc/guides/nics/features/atlantic.ini
 create mode 100644 drivers/net/atlantic/Makefile
 create mode 100644 drivers/net/atlantic/atl_common.h
 create mode 100644 drivers/net/atlantic/atl_ethdev.c
 create mode 100644 drivers/net/atlantic/atl_ethdev.h
 create mode 100644 drivers/net/atlantic/meson.build
 create mode 100644 drivers/net/atlantic/rte_pmd_atlantic_version.map
MAINTAINERS +7 -0
index 84b9ff786628..80c964a5144f 100644
@@ -485,6 +485,13 @@ F: drivers/net/axgbe/
 F: doc/guides/nics/axgbe.rst
 F: doc/guides/nics/features/axgbe.ini
 
+Aquantia atlantic
+M: Igor Russkikh <[email protected]>
+M: Pavel Belous <[email protected]>
+F: drivers/net/atlantic/
+F: doc/guides/nics/atlantic.rst
+F: doc/guides/nics/features/atlantic.ini
+
 Atomic Rules ARK
 M: Shepard Siegel <[email protected]>
 M: Ed Czeck <[email protected]>
config/common_base +5 -0
index acc5211bcc17..090ed26d13a1 100644
@@ -641,6 +641,11 @@ CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV=n
 CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV=n
 
 #
+# Compile Aquantia Atlantic PMD driver
+#
+CONFIG_RTE_LIBRTE_ATLANTIC_PMD=y
+
+#
 # Compile raw device support
 # EXPERIMENTAL: API may change without prior notice
 #
config/defconfig_ppc_64-power8-linuxapp-gcc +1 -0
index a52e22efcc9d..8cbf7ed50c15 100644
@@ -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_ATLANTIC_PMD=n
 CONFIG_RTE_LIBRTE_IXGBE_PMD=n
 CONFIG_RTE_LIBRTE_VIRTIO_PMD=y
 CONFIG_RTE_LIBRTE_VMXNET3_PMD=n
doc/guides/nics/atlantic.rst new file +37 -0
new file mode 100644
index 000000000000..21e52bb26625
@@ -0,0 +1,37 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2018 Aquantia Corporation.
+
+Aquantia Atlantic DPDK Driver
+=============================
+
+Atlantic DPDK driver provides DPDK support for Aquantia's AQtion family of chipsets: AQC107/AQC108/AQC109
+
+More information can be found at `Aquantia Official Website
+<https://www.aquantia.com/products/client-connectivity/>`_.
+
+Supported features
+^^^^^^^^^^^^^^^^^^
+
+Configuration Information
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- ``CONFIG_RTE_LIBRTE_ATLANTIC_PMD`` (default ``y``)
+
+Application Programming Interface
+---------------------------------
+
+Limitations or Known issues
+---------------------------
+
+Statistics
+~~~~~~~~~~
+
+MTU setting
+~~~~~~~~~~~
+
+Supported Chipsets and NICs
+---------------------------
+
+- Aquantia AQtion AQC107 10 Gigabit Ethernet Controller
+- Aquantia AQtion AQC108 5 Gigabit Ethernet Controller
+- Aquantia AQtion AQC109 2.5 Gigabit Ethernet Controller
doc/guides/nics/features/atlantic.ini new file +10 -0
new file mode 100644
index 000000000000..e6c5676acf7a
@@ -0,0 +1,10 @@
+;
+; Supported features of the 'atlantic' network poll mode driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Linux UIO            = Y
+ARMv8                = Y
+x86-32               = Y
+x86-64               = Y
doc/guides/nics/index.rst +1 -0
index 59f6063dce92..7925c2bd86ff 100644
@@ -12,6 +12,7 @@ Network Interface Controller Drivers
     features
     build_and_test
     ark
+    atlantic
     avp
     axgbe
     bnx2x
drivers/net/Makefile +1 -0
index 664398de983a..8ac6b9db5916 100644
@@ -10,6 +10,7 @@ endif
 
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += af_packet
 DIRS-$(CONFIG_RTE_LIBRTE_ARK_PMD) += ark
+DIRS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atlantic
 DIRS-$(CONFIG_RTE_LIBRTE_AVF_PMD) += avf
 DIRS-$(CONFIG_RTE_LIBRTE_AVP_PMD) += avp
 DIRS-$(CONFIG_RTE_LIBRTE_AXGBE_PMD) += axgbe
drivers/net/atlantic/Makefile new file +27 -0
new file mode 100644
index 000000000000..e42ce5b178ab
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Aquantia Corporation
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+#
+# library name
+#
+LIB = librte_pmd_atlantic.a
+
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+
+EXPORT_MAP := rte_pmd_atlantic_version.map
+
+LIBABIVER := 1
+
+LDLIBS += -lrte_eal
+LDLIBS += -lrte_ethdev -lrte_net
+LDLIBS += -lrte_bus_pci
+
+#
+# all source are stored in SRCS-y
+#
+SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_ethdev.c
+
+include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/atlantic/atl_common.h new file +96 -0

96 lines not on this page · raw message

drivers/net/atlantic/atl_ethdev.c new file +170 -0

170 lines not on this page · raw message

drivers/net/atlantic/atl_ethdev.h new file +15 -0
new file mode 100644
index 000000000000..622806837379
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Aquantia Corporation
+ */
+
+#ifndef _ATLANTIC_ETHDEV_H_
+#define _ATLANTIC_ETHDEV_H_
+#include <rte_errno.h>
+#include "rte_ethdev.h"
+/*
+ * Structure to store private data for each driver instance (for each port).
+ */
+struct atl_adapter {
+};
+
+#endif /* _ATLANTIC_ETHDEV_H_ */
drivers/net/atlantic/meson.build new file +6 -0
new file mode 100644
index 000000000000..c5a2546ef657
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Aquantia Corporation
+
+sources = files(
+	'atl_ethdev.c',
+)
drivers/net/atlantic/rte_pmd_atlantic_version.map new file +4 -0
new file mode 100644
index 000000000000..521e51f411fb
@@ -0,0 +1,4 @@
+DPDK_18.11 {
+
+	local: *;
+};
drivers/net/meson.build +1 -0
index 5906283c2f5c..32374141a9ea 100644
@@ -3,6 +3,7 @@
 
 drivers = ['af_packet',
 	'ark',
+	'atlantic',
 	'avf',
 	'avp',
 	'axgbe', 'bonding',
mk/rte.app.mk +1 -0
index 32579e4b7587..009280701034 100644
@@ -123,6 +123,7 @@ endif
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET)  += -lrte_pmd_af_packet
 _LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD)        += -lrte_pmd_ark
+_LDLIBS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD)   += -lrte_pmd_atlantic
 _LDLIBS-$(CONFIG_RTE_LIBRTE_AVF_PMD)        += -lrte_pmd_avf
 _LDLIBS-$(CONFIG_RTE_LIBRTE_AVP_PMD)        += -lrte_pmd_avp
 _LDLIBS-$(CONFIG_RTE_LIBRTE_AXGBE_PMD)      += -lrte_pmd_axgbe
Signature · 1 line
2.7.4
#2 lore raw

PATCH v6 2/22 net/atlantic: add logging structure

In reply to Igor Russkikh

Implement logging macroses for debug purposes.

---
 drivers/net/atlantic/atl_ethdev.c | 14 ++++++++++++++
 drivers/net/atlantic/atl_logs.h   | 31 +++++++++++++++++++++++++++++++
 drivers/net/atlantic/atl_types.h  | 25 +++++++++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 drivers/net/atlantic/atl_logs.h
 create mode 100644 drivers/net/atlantic/atl_types.h
drivers/net/atlantic/atl_ethdev.c +14 -0
index a9d7a5a49398..5b05ca180bc7 100644
@@ -23,6 +23,9 @@ static int eth_atl_pci_remove(struct rte_pci_device *pci_dev);
 static void atl_dev_info_get(struct rte_eth_dev *dev,
 				struct rte_eth_dev_info *dev_info);
 
+int atl_logtype_init;
+int atl_logtype_driver;
+
 /*
  * The set of PCI devices this driver supports
  */
@@ -168,3 +171,14 @@ atl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 RTE_PMD_REGISTER_PCI(net_atlantic, rte_atl_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_atlantic, pci_id_atl_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_atlantic, "* igb_uio | uio_pci_generic");
+
+RTE_INIT(atl_init_log)
+{
+	atl_logtype_init = rte_log_register("pmd.net.atlantic.init");
+	if (atl_logtype_init >= 0)
+		rte_log_set_level(atl_logtype_init, RTE_LOG_NOTICE);
+	atl_logtype_driver = rte_log_register("pmd.net.atlantic.driver");
+	if (atl_logtype_driver >= 0)
+		rte_log_set_level(atl_logtype_driver, RTE_LOG_NOTICE);
+}
+
drivers/net/atlantic/atl_logs.h new file +31 -0
new file mode 100644
index 000000000000..e3dba334fe92
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Aquantia Corporation
+ */
+#ifndef ATL_LOGS_H
+#define ATL_LOGS_H
+
+#include <rte_log.h>
+
+extern int atl_logtype_init;
+
+#define PMD_INIT_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, atl_logtype_init, \
+		"%s(): " fmt "\n", __func__, ##args)
+
+#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
+
+#define PMD_RX_LOG(level, fmt, args...) \
+	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+
+#define PMD_TX_LOG(level, fmt, args...) \
+	RTE_LOG_DP(level, PMD, "%s(): " fmt "\n", __func__, ## args)
+
+extern int atl_logtype_driver;
+#define PMD_DRV_LOG_RAW(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, atl_logtype_driver, "%s(): " fmt, \
+		__func__, ## args)
+
+#define PMD_DRV_LOG(level, fmt, args...) \
+	PMD_DRV_LOG_RAW(level, fmt "\n", ## args)
+
+#endif
drivers/net/atlantic/atl_types.h new file +25 -0
new file mode 100644
index 000000000000..d8c2560807d3
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Aquantia Corporation
+ */
+#ifndef ATL_TYPES_H
+#define ATL_TYPES_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include <inttypes.h>
+#include <string.h>
+#include <stdbool.h>
+
+
+typedef uint8_t		u8;
+typedef int8_t		s8;
+typedef uint16_t	u16;
+typedef int16_t		s16;
+typedef uint32_t	u32;
+typedef int32_t		s32;
+typedef uint64_t	u64;
+
+#define min(a, b)	RTE_MIN(a, b)
+#define max(a, b)	RTE_MAX(a, b)
+
+#endif
Signature · 1 line
2.7.4
#3 lore raw

PATCH v6 3/22 net/atlantic: add hardware registers access routines

In reply to Igor Russkikh

Add implementation for hardware registers access routines.

---
 drivers/net/atlantic/Makefile      |  1 +
 drivers/net/atlantic/atl_hw_regs.c | 52 +++++++++++++++++++++++++++++++++++++
 drivers/net/atlantic/atl_hw_regs.h | 53 ++++++++++++++++++++++++++++++++++++++
 drivers/net/atlantic/atl_types.h   |  4 +++
 drivers/net/atlantic/meson.build   |  1 +
 5 files changed, 111 insertions(+)
 create mode 100644 drivers/net/atlantic/atl_hw_regs.c
 create mode 100644 drivers/net/atlantic/atl_hw_regs.h
drivers/net/atlantic/Makefile +1 -0
index e42ce5b178ab..8613ced71732 100644
@@ -23,5 +23,6 @@ LDLIBS += -lrte_bus_pci
 # all source are stored in SRCS-y
 #
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_hw_regs.c
 
 include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/atlantic/atl_hw_regs.c new file +52 -0

52 lines not on this page · raw message

drivers/net/atlantic/atl_hw_regs.h new file +53 -0

53 lines not on this page · raw message

drivers/net/atlantic/atl_types.h +4 -0
index d8c2560807d3..725b0c4dc670 100644
@@ -22,4 +22,8 @@ typedef uint64_t	u64;
 #define min(a, b)	RTE_MIN(a, b)
 #define max(a, b)	RTE_MAX(a, b)
 
+struct aq_hw_s {
+	void *mmio;
+};
+
 #endif
drivers/net/atlantic/meson.build +1 -0
index c5a2546ef657..cd6a0f637a7d 100644
@@ -3,4 +3,5 @@
 
 sources = files(
 	'atl_ethdev.c',
+	'atl_hw_regs.c',
 )
Signature · 1 line
2.7.4
#4 lore raw

PATCH v6 4/22 net/atlantic: add hardware access layer

In reply to Igor Russkikh

This patch introduces hw_atl layer which is maintained in sync with linux kernel driver.
It will generally be in sync with linux upstream.

---
 drivers/net/atlantic/Makefile                     |    3 +
 drivers/net/atlantic/hw_atl/hw_atl_llh.c          | 1490 +++++++++++++
 drivers/net/atlantic/hw_atl/hw_atl_llh.h          |  714 ++++++
 drivers/net/atlantic/hw_atl/hw_atl_llh_internal.h | 2407 +++++++++++++++++++++
 drivers/net/atlantic/meson.build                  |    1 +
 5 files changed, 4615 insertions(+)
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_llh.c
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_llh.h
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_llh_internal.h
drivers/net/atlantic/Makefile +3 -0
index 8613ced71732..cae317badc0c 100644
@@ -19,10 +19,13 @@ LDLIBS += -lrte_eal
 LDLIBS += -lrte_ethdev -lrte_net
 LDLIBS += -lrte_bus_pci
 
+VPATH += $(SRCDIR)/hw_atl
+
 #
 # all source are stored in SRCS-y
 #
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_hw_regs.c
+SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += hw_atl_llh.c
 
 include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/atlantic/hw_atl/hw_atl_llh.c new file +1490 -0

1,490 lines not on this page · raw message

drivers/net/atlantic/hw_atl/hw_atl_llh.h new file +714 -0

714 lines not on this page · raw message

drivers/net/atlantic/hw_atl/hw_atl_llh_internal.h new file +2407 -0

783 lines not on this page · raw message

drivers/net/atlantic/meson.build +1 -0
index cd6a0f637a7d..055342ec9db7 100644

Lines of this file are not shown. View the raw message.

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

Signature · 1 line
2.7.4

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

#5 lore raw

PATCH v6 5/22 net/atlantic: implement firmware operations

In reply to Igor Russkikh

AQC NICs comes in fields with two major
FW generations: 1x and 3x.

This is part of linux atlantic driver shared code, responsible for internal NIC firmware interactions, including link management ops, FW initialization, various lifecycle features.

---
 drivers/net/atlantic/Makefile                   |   2 +
 drivers/net/atlantic/atl_types.h                |  95 +++
 drivers/net/atlantic/hw_atl/hw_atl_utils.c      | 942 ++++++++++++++++++++++++
 drivers/net/atlantic/hw_atl/hw_atl_utils.h      | 510 +++++++++++++
 drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c | 618 ++++++++++++++++
 drivers/net/atlantic/meson.build                |   2 +
 6 files changed, 2169 insertions(+)
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_utils.c
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_utils.h
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c
drivers/net/atlantic/Makefile +2 -0
index cae317badc0c..a291053b5ab7 100644
@@ -26,6 +26,8 @@ VPATH += $(SRCDIR)/hw_atl
 #
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_hw_regs.c
+SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += hw_atl_utils.c
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += hw_atl_llh.c
+SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += hw_atl_utils_fw2x.c
 
 include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/atlantic/atl_types.h +95 -0

103 lines not on this page · raw message

drivers/net/atlantic/hw_atl/hw_atl_utils.c new file +942 -0

942 lines not on this page · raw message

drivers/net/atlantic/hw_atl/hw_atl_utils.h new file +510 -0

510 lines not on this page · raw message

drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c new file +618 -0

618 lines not on this page · raw message

drivers/net/atlantic/meson.build +2 -0
index 055342ec9db7..b05c97773541 100644
@@ -5,4 +5,6 @@ sources = files(
 	'atl_ethdev.c',
 	'atl_hw_regs.c',
 	'hw_atl/hw_atl_llh.c',
+	'hw_atl/hw_atl_utils_fw2x.c',
+	'hw_atl/hw_atl_utils.c',
 )
Signature · 1 line
2.7.4
#6 lore raw

PATCH v6 6/22 net/atlantic: add b0 hardware layer

In reply to Igor Russkikh

This is hw_atl logic layer derived from linux atlantic driver. It contains RX/TX hardware initialization sequences, various hw configuration.

---
 drivers/net/atlantic/Makefile                    |   1 +
 drivers/net/atlantic/atl_types.h                 |  15 +-
 drivers/net/atlantic/hw_atl/hw_atl_b0.c          | 510 +++++++++++++++++++++++
 drivers/net/atlantic/hw_atl/hw_atl_b0.h          |  40 ++
 drivers/net/atlantic/hw_atl/hw_atl_b0_internal.h | 145 +++++++
 drivers/net/atlantic/meson.build                 |   1 +
 6 files changed, 711 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_b0.c
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_b0.h
 create mode 100644 drivers/net/atlantic/hw_atl/hw_atl_b0_internal.h
drivers/net/atlantic/Makefile +1 -0
index a291053b5ab7..91306d71ba97 100644
@@ -29,5 +29,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_hw_regs.c
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += hw_atl_utils.c
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += hw_atl_llh.c
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += hw_atl_utils_fw2x.c
+SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += hw_atl_b0.c
 
 include $(RTE_SDK)/mk/rte.lib.mk
drivers/net/atlantic/atl_types.h +14 -1
index af24da3a5a54..c9ebbf4e91d8 100644
@@ -9,7 +9,7 @@
 #include <inttypes.h>
 #include <string.h>
 #include <stdbool.h>
-
+#include <netinet/in.h>
 
 typedef uint8_t		u8;
 typedef int8_t		s8;
@@ -22,6 +22,7 @@ typedef uint64_t	u64;
 #define min(a, b)	RTE_MIN(a, b)
 #define max(a, b)	RTE_MAX(a, b)
 
+#include "hw_atl/hw_atl_b0_internal.h"
 #include "hw_atl/hw_atl_utils.h"
 
 struct aq_hw_link_status_s {
@@ -50,8 +51,18 @@ struct aq_stats_s {
 	u64 dma_oct_tc;
 };
 
+struct aq_rss_parameters {
+	u16 base_cpu_number;
+	u16 indirection_table_size;
+	u16 hash_secret_key_size;
+	u32 hash_secret_key[HW_ATL_B0_RSS_HASHKEY_BITS / 8];
+	u8 indirection_table[HW_ATL_B0_RSS_REDIRECTION_MAX];
+};
+
 struct aq_hw_cfg_s {
 	bool is_lro;
+	bool is_rss;
+	unsigned int num_rss_queues;
 	int wol;
 
 	int link_speed_msk;
@@ -60,6 +71,8 @@ struct aq_hw_cfg_s {
 	unsigned int vecs;
 
 	uint32_t flow_control;
+
+	struct aq_rss_parameters aq_rss;
 };
 
 struct aq_hw_s {
drivers/net/atlantic/hw_atl/hw_atl_b0.c new file +510 -0

510 lines not on this page · raw message

drivers/net/atlantic/hw_atl/hw_atl_b0.h new file +40 -0
new file mode 100644
index 000000000000..06feb56c1620
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0) */
+/* Copyright (C) 2014-2017 aQuantia Corporation. */
+
+/* File hw_atl_b0.h: Declaration of abstract interface for Atlantic hardware
+ * specific functions.
+ */
+
+#ifndef HW_ATL_B0_H
+#define HW_ATL_B0_H
+
+int hw_atl_b0_hw_reset(struct aq_hw_s *self);
+int hw_atl_b0_hw_init(struct aq_hw_s *self, u8 *mac_addr);
+
+int hw_atl_b0_hw_ring_tx_init(struct aq_hw_s *self, uint64_t base_addr,
+		int index, int size, int cpu, int vec);
+int hw_atl_b0_hw_ring_rx_init(struct aq_hw_s *self, uint64_t base_addr,
+		int index, int size, int buff_size, int cpu, int vec);
+
+int hw_atl_b0_hw_start(struct aq_hw_s *self);
+
+int hw_atl_b0_hw_ring_rx_start(struct aq_hw_s *self, int index);
+int hw_atl_b0_hw_ring_tx_start(struct aq_hw_s *self, int index);
+
+
+int hw_atl_b0_hw_ring_tx_stop(struct aq_hw_s *self, int index);
+int hw_atl_b0_hw_ring_rx_stop(struct aq_hw_s *self, int index);
+
+
+int hw_atl_b0_hw_tx_ring_tail_update(struct aq_hw_s *self, int tail, int index);
+
+int hw_atl_b0_hw_rss_hash_set(struct aq_hw_s *self,
+				     struct aq_rss_parameters *rss_params);
+int hw_atl_b0_hw_rss_set(struct aq_hw_s *self,
+				struct aq_rss_parameters *rss_params);
+
+int hw_atl_b0_hw_irq_enable(struct aq_hw_s *self, u64 mask);
+int hw_atl_b0_hw_irq_disable(struct aq_hw_s *self, u64 mask);
+int hw_atl_b0_hw_irq_read(struct aq_hw_s *self, u64 *mask);
+
+#endif /* HW_ATL_B0_H */
drivers/net/atlantic/hw_atl/hw_atl_b0_internal.h new file +145 -0

145 lines not on this page · raw message

drivers/net/atlantic/meson.build +1 -0
index b05c97773541..a0ad8f088571 100644
@@ -4,6 +4,7 @@
 sources = files(
 	'atl_ethdev.c',
 	'atl_hw_regs.c',
+	'hw_atl/hw_atl_b0.c',
 	'hw_atl/hw_atl_llh.c',
 	'hw_atl/hw_atl_utils_fw2x.c',
 	'hw_atl/hw_atl_utils.c',
Signature · 1 line
2.7.4
#7 lore raw

PATCH v6 7/22 net/atlantic: configure rte device start/stop

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

Start, stop and reset are all done via hw_atl layer.

---
 doc/guides/nics/features/atlantic.ini |   1 +
 drivers/net/atlantic/atl_ethdev.c     | 140 ++++++++++++++++++++++++++++++++--
 drivers/net/atlantic/atl_ethdev.h     |   9 +++
 drivers/net/atlantic/atl_types.h      |   4 +
 4 files changed, 147 insertions(+), 7 deletions(-)
doc/guides/nics/features/atlantic.ini +1 -0
index e6c5676acf7a..1b9cbf95077f 100644
@@ -4,6 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+FW version           = Y
 Linux UIO            = Y
 ARMv8                = Y
 x86-32               = Y
drivers/net/atlantic/atl_ethdev.c +133 -7

202 lines not on this page · raw message

drivers/net/atlantic/atl_ethdev.h +9 -0
index 622806837379..c0cc5475a091 100644
@@ -6,10 +6,19 @@
 #define _ATLANTIC_ETHDEV_H_
 #include <rte_errno.h>
 #include "rte_ethdev.h"
+
+#include "atl_types.h"
+#include "hw_atl/hw_atl_utils.h"
+
+#define ATL_DEV_PRIVATE_TO_HW(adapter) \
+	(&((struct atl_adapter *)adapter)->hw)
+
 /*
  * Structure to store private data for each driver instance (for each port).
  */
 struct atl_adapter {
+	struct aq_hw_s             hw;
+	struct aq_hw_cfg_s         hw_cfg;
 };
 
 #endif /* _ATLANTIC_ETHDEV_H_ */
drivers/net/atlantic/atl_types.h +4 -0
index c9ebbf4e91d8..37ad43a110f0 100644
@@ -76,6 +76,10 @@ struct aq_hw_cfg_s {
 };
 
 struct aq_hw_s {
+	u16 device_id;
+	u16 vendor_id;
+	bool adapter_stopped;
+
 	u8 rbl_enabled:1;
 	struct aq_hw_cfg_s *aq_nic_cfg;
 	const struct aq_fw_ops *aq_fw_ops;
Signature · 1 line
2.7.4
#8 lore raw

PATCH v6 8/22 net/atlantic: implement core logic for Tx/Rx

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

Add RX/TX function prototypes for further datapath development.

---
 doc/guides/nics/features/atlantic.ini |  1 +
 drivers/net/atlantic/Makefile         |  1 +
 drivers/net/atlantic/atl_ethdev.c     | 14 ++++++++++++
 drivers/net/atlantic/atl_ethdev.h     | 15 +++++++++++++
 drivers/net/atlantic/atl_rxtx.c       | 42 +++++++++++++++++++++++++++++++++++
 drivers/net/atlantic/meson.build      |  1 +
 6 files changed, 74 insertions(+)
 create mode 100644 drivers/net/atlantic/atl_rxtx.c
doc/guides/nics/features/atlantic.ini +1 -0
index 1b9cbf95077f..c603b7bfcd42 100644
@@ -4,6 +4,7 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Queue start/stop     = Y
 FW version           = Y
 Linux UIO            = Y
 ARMv8                = Y
drivers/net/atlantic/Makefile +1 -0
index 91306d71ba97..b88da362146d 100644
@@ -24,6 +24,7 @@ VPATH += $(SRCDIR)/hw_atl
 #
 # all source are stored in SRCS-y
 #
+SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_rxtx.c
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += atl_hw_regs.c
 SRCS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD) += hw_atl_utils.c
drivers/net/atlantic/atl_ethdev.c +14 -0
index d756ad4c8b99..870eafba3e13 100644
@@ -104,6 +104,9 @@ eth_atl_dev_init(struct rte_eth_dev *eth_dev)
 	PMD_INIT_FUNC_TRACE();
 
 	eth_dev->dev_ops = &atl_eth_dev_ops;
+	eth_dev->rx_pkt_burst = &atl_recv_pkts;
+	eth_dev->tx_pkt_burst = &atl_xmit_pkts;
+	eth_dev->tx_pkt_prepare = &atl_prep_pkts;
 
 	/* For secondary processes, the primary process has done all the work */
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
@@ -155,6 +158,8 @@ eth_atl_dev_uninit(struct rte_eth_dev *eth_dev)
 		atl_dev_close(eth_dev);
 
 	eth_dev->dev_ops = NULL;
+	eth_dev->rx_pkt_burst = NULL;
+	eth_dev->tx_pkt_burst = NULL;
 
 	rte_free(eth_dev->data->mac_addrs);
 	eth_dev->data->mac_addrs = NULL;
@@ -208,6 +213,15 @@ atl_dev_start(struct rte_eth_dev *dev)
 	err = hw_atl_b0_hw_init(hw, dev->data->mac_addrs->addr_bytes);
 
 	hw_atl_b0_hw_start(hw);
+	/* initialize transmission unit */
+	atl_tx_init(dev);
+
+	/* This can fail when allocating mbufs for descriptor rings */
+	err = atl_rx_init(dev);
+	if (err) {
+		PMD_INIT_LOG(ERR, "Unable to initialize RX hardware");
+		return -EIO;
+	}
 
 	PMD_INIT_LOG(DEBUG, "FW version: %u.%u.%u",
 		hw->fw_ver_actual >> 24,
drivers/net/atlantic/atl_ethdev.h +15 -0
index c0cc5475a091..990e8e4e9978 100644
@@ -21,4 +21,19 @@ struct atl_adapter {
 	struct aq_hw_cfg_s         hw_cfg;
 };
 
+/*
+ * RX/TX function prototypes
+ */
+int atl_rx_init(struct rte_eth_dev *dev);
+int atl_tx_init(struct rte_eth_dev *dev);
+
+uint16_t atl_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
+		uint16_t nb_pkts);
+
+uint16_t atl_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts);
+
+uint16_t atl_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+		uint16_t nb_pkts);
+
 #endif /* _ATLANTIC_ETHDEV_H_ */
drivers/net/atlantic/atl_rxtx.c new file +42 -0

42 lines not on this page · raw message

drivers/net/atlantic/meson.build +1 -0
index a0ad8f088571..28fb97cace6e 100644
@@ -2,6 +2,7 @@
 # Copyright(c) 2018 Aquantia Corporation
 
 sources = files(
+	'atl_rxtx.c',
 	'atl_ethdev.c',
 	'atl_hw_regs.c',
 	'hw_atl/hw_atl_b0.c',
Signature · 1 line
2.7.4
#9 lore raw

PATCH v6 9/22 net/atlantic: implement Rx path

In reply to Igor Russkikh

Add implementation for RX datapath.

---
 doc/guides/nics/atlantic.rst          |   6 +
 doc/guides/nics/features/atlantic.ini |   5 +
 drivers/net/atlantic/Makefile         |   2 +-
 drivers/net/atlantic/atl_ethdev.c     |  79 ++++-
 drivers/net/atlantic/atl_ethdev.h     |  19 +
 drivers/net/atlantic/atl_rxtx.c       | 632 +++++++++++++++++++++++++++++++++-
 6 files changed, 733 insertions(+), 10 deletions(-)
doc/guides/nics/atlantic.rst +6 -0
index 21e52bb26625..a003ef5110c9 100644
@@ -12,6 +12,10 @@ More information can be found at `Aquantia Official Website
 Supported features
 ^^^^^^^^^^^^^^^^^^
 
+- Base L2 features
+- Checksum offload
+- Jumbo Frame upto 16K
+
 Configuration Information
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -29,6 +33,8 @@ Statistics
 MTU setting
 ~~~~~~~~~~~
 
+Atlantic NIC supports up to 16K jumbo frame size
+
 Supported Chipsets and NICs
 ---------------------------
 
doc/guides/nics/features/atlantic.ini +5 -0
index c603b7bfcd42..374cf9fb1061 100644
@@ -5,6 +5,11 @@
 ;
 [Features]
 Queue start/stop     = Y
+Jumbo frame          = Y
+CRC offload          = Y
+L3 checksum offload  = Y
+L4 checksum offload  = Y
+Packet type parsing  = Y
 FW version           = Y
 Linux UIO            = Y
 ARMv8                = Y
drivers/net/atlantic/Makefile +1 -1
index b88da362146d..62dcdbffa69c 100644
@@ -15,7 +15,7 @@ EXPORT_MAP := rte_pmd_atlantic_version.map
 
 LIBABIVER := 1
 
-LDLIBS += -lrte_eal
+LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net
 LDLIBS += -lrte_bus_pci
 
drivers/net/atlantic/atl_ethdev.c +75 -4

133 lines not on this page · raw message

drivers/net/atlantic/atl_ethdev.h +19 -0
index 990e8e4e9978..a9a9fc8fe7ff 100644
@@ -13,6 +13,10 @@
 #define ATL_DEV_PRIVATE_TO_HW(adapter) \
 	(&((struct atl_adapter *)adapter)->hw)
 
+#define ATL_DEV_TO_ADAPTER(dev) \
+	((struct atl_adapter *)(dev)->data->dev_private)
+
+
 /*
  * Structure to store private data for each driver instance (for each port).
  */
@@ -24,9 +28,24 @@ struct atl_adapter {
 /*
  * RX/TX function prototypes
  */
+void atl_rx_queue_release(void *rxq);
+
+int atl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
+		uint16_t nb_rx_desc, unsigned int socket_id,
+		const struct rte_eth_rxconf *rx_conf,
+		struct rte_mempool *mb_pool);
+
 int atl_rx_init(struct rte_eth_dev *dev);
 int atl_tx_init(struct rte_eth_dev *dev);
 
+int atl_start_queues(struct rte_eth_dev *dev);
+int atl_stop_queues(struct rte_eth_dev *dev);
+void atl_free_queues(struct rte_eth_dev *dev);
+
+int atl_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
+int atl_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
+
+
 uint16_t atl_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts);
 
drivers/net/atlantic/atl_rxtx.c +627 -5

659 lines not on this page · raw message

Signature · 1 line
2.7.4
#10 lore raw

PATCH v6 10/22 net/atlantic: implement Tx path

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

Add implementation for TX datapath.

---
 drivers/net/atlantic/atl_ethdev.c |  28 ++
 drivers/net/atlantic/atl_ethdev.h |   7 +
 drivers/net/atlantic/atl_rxtx.c   | 546 +++++++++++++++++++++++++++++++++++++-
 3 files changed, 572 insertions(+), 9 deletions(-)
drivers/net/atlantic/atl_ethdev.c +28 -0
index 521376d1398c..156f1be99cdf 100644
@@ -82,12 +82,27 @@ static struct rte_pci_driver rte_atl_pmd = {
 			| DEV_RX_OFFLOAD_TCP_CKSUM \
 			| DEV_RX_OFFLOAD_JUMBO_FRAME)
 
+#define ATL_TX_OFFLOADS (DEV_TX_OFFLOAD_VLAN_INSERT \
+			| DEV_TX_OFFLOAD_IPV4_CKSUM \
+			| DEV_TX_OFFLOAD_UDP_CKSUM \
+			| DEV_TX_OFFLOAD_TCP_CKSUM \
+			| DEV_TX_OFFLOAD_TCP_TSO \
+			| DEV_TX_OFFLOAD_MULTI_SEGS)
+
 static const struct rte_eth_desc_lim rx_desc_lim = {
 	.nb_max = ATL_MAX_RING_DESC,
 	.nb_min = ATL_MIN_RING_DESC,
 	.nb_align = ATL_RXD_ALIGN,
 };
 
+static const struct rte_eth_desc_lim tx_desc_lim = {
+	.nb_max = ATL_MAX_RING_DESC,
+	.nb_min = ATL_MIN_RING_DESC,
+	.nb_align = ATL_TXD_ALIGN,
+	.nb_seg_max = ATL_TX_MAX_SEG,
+	.nb_mtu_seg_max = ATL_TX_MAX_SEG,
+};
+
 static const struct eth_dev_ops atl_eth_dev_ops = {
 	.dev_configure	      = atl_dev_configure,
 	.dev_start	      = atl_dev_start,
@@ -104,6 +119,11 @@ static const struct eth_dev_ops atl_eth_dev_ops = {
 	.rx_queue_stop	      = atl_rx_queue_stop,
 	.rx_queue_setup       = atl_rx_queue_setup,
 	.rx_queue_release     = atl_rx_queue_release,
+
+	.tx_queue_start	      = atl_tx_queue_start,
+	.tx_queue_stop	      = atl_tx_queue_stop,
+	.tx_queue_setup       = atl_tx_queue_setup,
+	.tx_queue_release     = atl_tx_queue_release,
 };
 
 static inline int32_t
@@ -350,11 +370,19 @@ atl_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 
 	dev_info->rx_offload_capa = ATL_RX_OFFLOADS;
 
+	dev_info->tx_offload_capa = ATL_TX_OFFLOADS;
+
+
 	dev_info->default_rxconf = (struct rte_eth_rxconf) {
 		.rx_free_thresh = ATL_DEFAULT_RX_FREE_THRESH,
 	};
 
+	dev_info->default_txconf = (struct rte_eth_txconf) {
+		.tx_free_thresh = ATL_DEFAULT_TX_FREE_THRESH,
+	};
+
 	dev_info->rx_desc_lim = rx_desc_lim;
+	dev_info->tx_desc_lim = tx_desc_lim;
 }
 
 static const uint32_t *
drivers/net/atlantic/atl_ethdev.h +7 -0
index a9a9fc8fe7ff..92bb302ffe55 100644
@@ -29,12 +29,17 @@ struct atl_adapter {
  * RX/TX function prototypes
  */
 void atl_rx_queue_release(void *rxq);
+void atl_tx_queue_release(void *txq);
 
 int atl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 		uint16_t nb_rx_desc, unsigned int socket_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mb_pool);
 
+int atl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
+		uint16_t nb_tx_desc, unsigned int socket_id,
+		const struct rte_eth_txconf *tx_conf);
+
 int atl_rx_init(struct rte_eth_dev *dev);
 int atl_tx_init(struct rte_eth_dev *dev);
 
@@ -45,6 +50,8 @@ void atl_free_queues(struct rte_eth_dev *dev);
 int atl_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int atl_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 
+int atl_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
+int atl_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 
 uint16_t atl_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts);
drivers/net/atlantic/atl_rxtx.c +537 -9

625 lines not on this page · raw message

Signature · 1 line
2.7.4
#11 lore raw

PATCH v6 11/22 net/atlantic: add link status and interrupt management

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

Implement link interrupt, link info, link polling.

---
 doc/guides/nics/features/atlantic.ini |   3 +
 drivers/net/atlantic/atl_ethdev.c     | 411 +++++++++++++++++++++++++++++++++-
 drivers/net/atlantic/atl_ethdev.h     |  16 ++
 drivers/net/atlantic/atl_rxtx.c       |  36 +++
 drivers/net/atlantic/atl_types.h      |   2 +
 5 files changed, 466 insertions(+), 2 deletions(-)
doc/guides/nics/features/atlantic.ini +3 -0
index 374cf9fb1061..f5650ae8f5f7 100644
@@ -4,6 +4,9 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
+Link status          = Y
+Link status event    = Y
 Queue start/stop     = Y
 Jumbo frame          = Y
 CRC offload          = Y
drivers/net/atlantic/atl_ethdev.c +409 -2

542 lines not on this page · raw message

drivers/net/atlantic/atl_ethdev.h +16 -0
index 92bb302ffe55..55a7e0d6188c 100644
@@ -16,6 +16,16 @@
 #define ATL_DEV_TO_ADAPTER(dev) \
 	((struct atl_adapter *)(dev)->data->dev_private)
 
+#define ATL_DEV_PRIVATE_TO_INTR(adapter) \
+	(&((struct atl_adapter *)adapter)->intr)
+
+#define ATL_FLAG_NEED_LINK_UPDATE (uint32_t)(1 << 0)
+#define ATL_FLAG_NEED_LINK_CONFIG (uint32_t)(4 << 0)
+
+struct atl_interrupt {
+	uint32_t flags;
+	uint32_t mask;
+};
 
 /*
  * Structure to store private data for each driver instance (for each port).
@@ -23,6 +33,7 @@
 struct atl_adapter {
 	struct aq_hw_s             hw;
 	struct aq_hw_cfg_s         hw_cfg;
+	struct atl_interrupt       intr;
 };
 
 /*
@@ -40,6 +51,11 @@ int atl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 		uint16_t nb_tx_desc, unsigned int socket_id,
 		const struct rte_eth_txconf *tx_conf);
 
+int atl_dev_rx_queue_intr_enable(struct rte_eth_dev *eth_dev,
+				 uint16_t queue_id);
+int atl_dev_rx_queue_intr_disable(struct rte_eth_dev *eth_dev,
+				  uint16_t queue_id);
+
 int atl_rx_init(struct rte_eth_dev *dev);
 int atl_tx_init(struct rte_eth_dev *dev);
 
drivers/net/atlantic/atl_rxtx.c +36 -0
index 1d4c8099325d..36141564f5c1 100644
@@ -651,6 +651,42 @@ atl_stop_queues(struct rte_eth_dev *dev)
 	return 0;
 }
 
+static int
+atl_rx_enable_intr(struct rte_eth_dev *dev, uint16_t queue_id, bool enable)
+{
+	struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct atl_rx_queue *rxq;
+
+	PMD_INIT_FUNC_TRACE();
+
+	if (queue_id >= dev->data->nb_rx_queues) {
+		PMD_DRV_LOG(ERR, "Invalid RX queue id=%d", queue_id);
+		return -EINVAL;
+	}
+
+	rxq = dev->data->rx_queues[queue_id];
+
+	if (rxq == NULL)
+		return 0;
+
+	/* Mapping interrupt vector */
+	hw_atl_itr_irq_map_en_rx_set(hw, enable, queue_id);
+
+	return 0;
+}
+
+int
+atl_dev_rx_queue_intr_enable(struct rte_eth_dev *eth_dev, uint16_t queue_id)
+{
+	return atl_rx_enable_intr(eth_dev, queue_id, true);
+}
+
+int
+atl_dev_rx_queue_intr_disable(struct rte_eth_dev *eth_dev, uint16_t queue_id)
+{
+	return atl_rx_enable_intr(eth_dev, queue_id, false);
+}
+
 uint16_t
 atl_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 	      uint16_t nb_pkts)
drivers/net/atlantic/atl_types.h +2 -0
index 37ad43a110f0..e636464955e3 100644
@@ -86,11 +86,13 @@ struct aq_hw_s {
 	void *mmio;
 
 	struct aq_hw_link_status_s aq_link_status;
+	bool is_autoneg;
 
 	struct hw_aq_atl_utils_mbox mbox;
 	struct hw_atl_stats_s last_stats;
 	struct aq_stats_s curr_stats;
 
+	u64 speed;
 	unsigned int chip_features;
 	u32 fw_ver_actual;
 	u32 mbox_addr;
Signature · 1 line
2.7.4
#12 lore raw

PATCH v6 12/22 net/atlantic: implement device statistics

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

Add support for device stats, xstats and queue stats

---
 doc/guides/nics/atlantic.rst          |   1 +
 doc/guides/nics/features/atlantic.ini |   3 +
 drivers/net/atlantic/atl_ethdev.c     | 133 ++++++++++++++++++++++++++++++++++
 drivers/net/atlantic/atl_ethdev.h     |   1 +
 drivers/net/atlantic/atl_rxtx.c       |  11 ++-
 drivers/net/atlantic/atl_types.h      |  41 +++++++++++
 6 files changed, 189 insertions(+), 1 deletion(-)
doc/guides/nics/atlantic.rst +1 -0
index a003ef5110c9..1108d458f836 100644
@@ -13,6 +13,7 @@ Supported features
 ^^^^^^^^^^^^^^^^^^
 
 - Base L2 features
+- Port statistics
 - Checksum offload
 - Jumbo Frame upto 16K
 
doc/guides/nics/features/atlantic.ini +3 -0
index f5650ae8f5f7..4056d4daacc8 100644
@@ -13,6 +13,9 @@ CRC offload          = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
 Packet type parsing  = Y
+Basic stats          = Y
+Extended stats       = Y
+Stats per queue      = Y
 FW version           = Y
 Linux UIO            = Y
 ARMv8                = Y
drivers/net/atlantic/atl_ethdev.c +133 -0

163 lines not on this page · raw message

drivers/net/atlantic/atl_ethdev.h +1 -0
index 55a7e0d6188c..dc48c134b7b8 100644
@@ -33,6 +33,7 @@ struct atl_interrupt {
 struct atl_adapter {
 	struct aq_hw_s             hw;
 	struct aq_hw_cfg_s         hw_cfg;
+	struct atl_sw_stats        sw_stats;
 	struct atl_interrupt       intr;
 };
 
drivers/net/atlantic/atl_rxtx.c +10 -1
index 36141564f5c1..c51d24d74ed2 100644
@@ -874,7 +874,8 @@ atl_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 				   "queue_id=%u", (unsigned int)rxq->port_id,
 				   (unsigned int)rxq->queue_id);
 				dev->data->rx_mbuf_alloc_failed++;
-						goto err_stop;
+				adapter->sw_stats.rx_nombuf++;
+				goto err_stop;
 			}
 
 			nb_hold++;
@@ -957,6 +958,9 @@ atl_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		 * of returned packets.
 		 */
 		rx_pkts[nb_rx++] = rx_mbuf_first;
+		adapter->sw_stats.q_ipackets[rxq->queue_id]++;
+		adapter->sw_stats.q_ibytes[rxq->queue_id] +=
+			rx_mbuf_first->pkt_len;
 
 		PMD_RX_LOG(ERR, "add mbuf segs=%d pkt_len=%d",
 			rx_mbuf_first->nb_segs,
@@ -1102,6 +1106,8 @@ static inline void
 atl_xmit_pkt(struct aq_hw_s *hw, struct atl_tx_queue *txq,
 	     struct rte_mbuf *tx_pkt)
 {
+	struct atl_adapter *adapter =
+		ATL_DEV_TO_ADAPTER(&rte_eth_devices[txq->port_id]);
 	uint32_t pay_len = 0;
 	int tail = 0;
 	struct atl_tx_entry *tx_entry;
@@ -1182,6 +1188,9 @@ atl_xmit_pkt(struct aq_hw_s *hw, struct atl_tx_queue *txq,
 	txq->tx_tail = tail;
 
 	txq->tx_free -= desc_count;
+
+	adapter->sw_stats.q_opackets[txq->queue_id]++;
+	adapter->sw_stats.q_obytes[txq->queue_id] += pay_len;
 }
 
 uint16_t
drivers/net/atlantic/atl_types.h +41 -0

45 lines not on this page · raw message

Signature · 1 line
2.7.4
#13 lore raw

PATCH v6 13/22 net/atlantic: add Rx/Tx descriptors information

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

Add support for Rx/Tx descriptors status information.

---
 doc/guides/nics/features/atlantic.ini |   2 +
 drivers/net/atlantic/atl_ethdev.c     |   7 +++
 drivers/net/atlantic/atl_ethdev.h     |  11 ++++
 drivers/net/atlantic/atl_rxtx.c       | 103 ++++++++++++++++++++++++++++++++++
 4 files changed, 123 insertions(+)
doc/guides/nics/features/atlantic.ini +2 -0
index 4056d4daacc8..cea9787ba1a9 100644
@@ -13,6 +13,8 @@ CRC offload          = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
 Packet type parsing  = Y
+Rx descriptor status = Y
+Tx descriptor status = Y
 Basic stats          = Y
 Extended stats       = Y
 Stats per queue      = Y
drivers/net/atlantic/atl_ethdev.c +7 -0
index b1e7e3030d57..d76d071dc3e7 100644
@@ -191,6 +191,13 @@ static const struct eth_dev_ops atl_eth_dev_ops = {
 
 	.rx_queue_intr_enable = atl_dev_rx_queue_intr_enable,
 	.rx_queue_intr_disable = atl_dev_rx_queue_intr_disable,
+
+	.rx_queue_count       = atl_rx_queue_count,
+	.rx_descriptor_status = atl_dev_rx_descriptor_status,
+	.tx_descriptor_status = atl_dev_tx_descriptor_status,
+
+	.rxq_info_get	      = atl_rxq_info_get,
+	.txq_info_get	      = atl_txq_info_get,
 };
 
 static inline int32_t
drivers/net/atlantic/atl_ethdev.h +11 -0
index dc48c134b7b8..c315e0436dca 100644
@@ -52,6 +52,11 @@ int atl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 		uint16_t nb_tx_desc, unsigned int socket_id,
 		const struct rte_eth_txconf *tx_conf);
 
+uint32_t atl_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id);
+
+int atl_dev_rx_descriptor_status(void *rx_queue, uint16_t offset);
+int atl_dev_tx_descriptor_status(void *tx_queue, uint16_t offset);
+
 int atl_dev_rx_queue_intr_enable(struct rte_eth_dev *eth_dev,
 				 uint16_t queue_id);
 int atl_dev_rx_queue_intr_disable(struct rte_eth_dev *eth_dev,
@@ -70,6 +75,12 @@ int atl_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int atl_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 int atl_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 
+void atl_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_rxq_info *qinfo);
+
+void atl_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+	struct rte_eth_txq_info *qinfo);
+
 uint16_t atl_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts);
 
drivers/net/atlantic/atl_rxtx.c +103 -0

109 lines not on this page · raw message

Signature · 1 line
2.7.4
#14 lore raw

PATCH v6 14/22 net/atlantic: implement promisc and allmulti modes

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

Add support for promiscuous/allmulticast modes configuration.

---
 doc/guides/nics/atlantic.rst          |  2 ++
 doc/guides/nics/features/atlantic.ini |  2 ++
 drivers/net/atlantic/atl_ethdev.c     | 44 +++++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)
doc/guides/nics/atlantic.rst +2 -0
index 1108d458f836..b09c79babdf4 100644
@@ -13,6 +13,8 @@ Supported features
 ^^^^^^^^^^^^^^^^^^
 
 - Base L2 features
+- Promiscuous mode
+- Multicast mode
 - Port statistics
 - Checksum offload
 - Jumbo Frame upto 16K
doc/guides/nics/features/atlantic.ini +2 -0
index cea9787ba1a9..347ac80a1ceb 100644
@@ -9,6 +9,8 @@ Link status          = Y
 Link status event    = Y
 Queue start/stop     = Y
 Jumbo frame          = Y
+Promiscuous mode     = Y
+Allmulticast mode    = Y
 CRC offload          = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
drivers/net/atlantic/atl_ethdev.c +44 -0

62 lines not on this page · raw message

Signature · 1 line
2.7.4
#15 lore raw

PATCH v6 15/22 net/atlantic: implement RSS and RETA manipulation API

In reply to Igor Russkikh

Add support for Receive Side Scaling feature.
RSS hash and reta table configuration.

---
 doc/guides/nics/atlantic.rst          |   1 +
 doc/guides/nics/features/atlantic.ini |   3 +
 drivers/net/atlantic/atl_ethdev.c     | 107 ++++++++++++++++++++++++++++++++++
 drivers/net/atlantic/atl_ethdev.h     |  14 +++++
 drivers/net/atlantic/atl_rxtx.c       |   5 ++
 5 files changed, 130 insertions(+)
doc/guides/nics/atlantic.rst +1 -0
index b09c79babdf4..80591b13c185 100644
@@ -16,6 +16,7 @@ Supported features
 - Promiscuous mode
 - Multicast mode
 - Port statistics
+- RSS (Receive Side Scaling)
 - Checksum offload
 - Jumbo Frame upto 16K
 
doc/guides/nics/features/atlantic.ini +3 -0
index 347ac80a1ceb..592af817931e 100644
@@ -11,6 +11,9 @@ Queue start/stop     = Y
 Jumbo frame          = Y
 Promiscuous mode     = Y
 Allmulticast mode    = Y
+RSS hash             = Y
+RSS key update       = Y
+RSS reta update      = Y
 CRC offload          = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
drivers/net/atlantic/atl_ethdev.c +107 -0

143 lines not on this page · raw message

drivers/net/atlantic/atl_ethdev.h +14 -0
index c315e0436dca..1e29999b539c 100644
@@ -10,6 +10,17 @@
 #include "atl_types.h"
 #include "hw_atl/hw_atl_utils.h"
 
+#define ATL_RSS_OFFLOAD_ALL ( \
+	ETH_RSS_IPV4 | \
+	ETH_RSS_NONFRAG_IPV4_TCP | \
+	ETH_RSS_NONFRAG_IPV4_UDP | \
+	ETH_RSS_IPV6 | \
+	ETH_RSS_NONFRAG_IPV6_TCP | \
+	ETH_RSS_NONFRAG_IPV6_UDP | \
+	ETH_RSS_IPV6_EX | \
+	ETH_RSS_IPV6_TCP_EX | \
+	ETH_RSS_IPV6_UDP_EX)
+
 #define ATL_DEV_PRIVATE_TO_HW(adapter) \
 	(&((struct atl_adapter *)adapter)->hw)
 
@@ -19,6 +30,9 @@
 #define ATL_DEV_PRIVATE_TO_INTR(adapter) \
 	(&((struct atl_adapter *)adapter)->intr)
 
+#define ATL_DEV_PRIVATE_TO_CFG(adapter) \
+	(&((struct atl_adapter *)adapter)->hw_cfg)
+
 #define ATL_FLAG_NEED_LINK_UPDATE (uint32_t)(1 << 0)
 #define ATL_FLAG_NEED_LINK_CONFIG (uint32_t)(4 << 0)
 
drivers/net/atlantic/atl_rxtx.c +5 -0
index fbd50a766098..01267214088b 100644
@@ -336,6 +336,7 @@ int
 atl_rx_init(struct rte_eth_dev *eth_dev)
 {
 	struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
+	struct aq_rss_parameters *rss_params = &hw->aq_nic_cfg->aq_rss;
 	struct atl_rx_queue *rxq;
 	uint64_t base_addr = 0;
 	int i = 0;
@@ -379,6 +380,10 @@ atl_rx_init(struct rte_eth_dev *eth_dev)
 		}
 	}
 
+	for (i = rss_params->indirection_table_size; i--;)
+		rss_params->indirection_table[i] = i &
+			(eth_dev->data->nb_rx_queues - 1);
+	hw_atl_b0_hw_rss_set(hw, rss_params);
 	return err;
 }
 
Signature · 1 line
2.7.4
#16 lore raw

PATCH v6 16/22 net/atlantic: add flow control configuration

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

Add support for flow control feature.

---
 doc/guides/nics/features/atlantic.ini |  1 +
 drivers/net/atlantic/atl_ethdev.c     | 54 +++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)
doc/guides/nics/features/atlantic.ini +1 -0
index 592af817931e..e86707ea5c0a 100644
@@ -14,6 +14,7 @@ Allmulticast mode    = Y
 RSS hash             = Y
 RSS key update       = Y
 RSS reta update      = Y
+Flow control         = Y
 CRC offload          = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
drivers/net/atlantic/atl_ethdev.c +54 -0

78 lines not on this page · raw message

Signature · 1 line
2.7.4
#17 lore raw

PATCH v6 17/22 net/atlantic: implement MAC address manipulations

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

Add support for adding/removing MAC addresses.

---
 doc/guides/nics/features/atlantic.ini |   1 +
 drivers/net/atlantic/atl_ethdev.c     | 105 ++++++++++++++++++++++++++++++++++
 2 files changed, 106 insertions(+)
doc/guides/nics/features/atlantic.ini +1 -0
index e86707ea5c0a..1dd3ff87e512 100644
@@ -11,6 +11,7 @@ Queue start/stop     = Y
 Jumbo frame          = Y
 Promiscuous mode     = Y
 Allmulticast mode    = Y
+Unicast MAC filter   = Y
 RSS hash             = Y
 RSS key update       = Y
 RSS reta update      = Y
drivers/net/atlantic/atl_ethdev.c +105 -0

123 lines not on this page · raw message

Signature · 1 line
2.7.4
#18 lore raw

PATCH v6 18/22 net/atlantic: implement MTU configuration

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

Add support for updating MTU value.

---
 doc/guides/nics/features/atlantic.ini |  1 +
 drivers/net/atlantic/atl_ethdev.c     | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)
doc/guides/nics/features/atlantic.ini +1 -0
index 1dd3ff87e512..dd44ed75aef4 100644
@@ -8,6 +8,7 @@ Speed capabilities   = Y
 Link status          = Y
 Link status event    = Y
 Queue start/stop     = Y
+MTU update           = Y
 Jumbo frame          = Y
 Promiscuous mode     = Y
 Allmulticast mode    = Y
drivers/net/atlantic/atl_ethdev.c +21 -0
index 6cee14b2dcba..db2d798f28aa 100644
@@ -48,6 +48,8 @@ static void atl_dev_info_get(struct rte_eth_dev *dev,
 
 static const uint32_t *atl_dev_supported_ptypes_get(struct rte_eth_dev *dev);
 
+static int atl_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
+
 /* Flow control */
 static int atl_flow_ctrl_get(struct rte_eth_dev *dev,
 			       struct rte_eth_fc_conf *fc_conf);
@@ -219,6 +221,8 @@ static const struct eth_dev_ops atl_eth_dev_ops = {
 	.dev_infos_get	      = atl_dev_info_get,
 	.dev_supported_ptypes_get = atl_dev_supported_ptypes_get,
 
+	.mtu_set              = atl_dev_mtu_set,
+
 	/* Queue Control */
 	.rx_queue_start	      = atl_rx_queue_start,
 	.rx_queue_stop	      = atl_rx_queue_stop,
@@ -1151,6 +1155,23 @@ atl_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr)
 }
 
 static int
+atl_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
+{
+	struct rte_eth_dev_info dev_info;
+	uint32_t frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+
+	atl_dev_info_get(dev, &dev_info);
+
+	if ((mtu < ETHER_MIN_MTU) || (frame_size > dev_info.max_rx_pktlen))
+		return -EINVAL;
+
+	/* update max frame size */
+	dev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size;
+
+	return 0;
+}
+
+static int
 atl_dev_set_mc_addr_list(struct rte_eth_dev *dev,
 			  struct ether_addr *mc_addr_set,
 			  uint32_t nb_mc_addr)
Signature · 1 line
2.7.4
#19 lore raw

PATCH v6 19/22 net/atlantic: implement VLAN filters and offloads

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

VLAN filters and VLAN offloads implementation.

---
 doc/guides/nics/features/atlantic.ini |   2 +
 drivers/net/atlantic/atl_ethdev.c     | 159 ++++++++++++++++++++++++++++++++++
 drivers/net/atlantic/atl_rxtx.c       |  12 +++
 drivers/net/atlantic/atl_types.h      |   2 +
 4 files changed, 175 insertions(+)
doc/guides/nics/features/atlantic.ini +2 -0
index dd44ed75aef4..66949b816284 100644
@@ -16,8 +16,10 @@ Unicast MAC filter   = Y
 RSS hash             = Y
 RSS key update       = Y
 RSS reta update      = Y
+VLAN filter          = Y
 Flow control         = Y
 CRC offload          = Y
+VLAN offload         = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
 Packet type parsing  = Y
drivers/net/atlantic/atl_ethdev.c +159 -0

177 lines not on this page · raw message

drivers/net/atlantic/atl_rxtx.c +12 -0
index 01267214088b..fd909476c45f 100644
@@ -919,6 +919,8 @@ atl_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 	struct atl_adapter *adapter =
 		ATL_DEV_TO_ADAPTER(&rte_eth_devices[rxq->port_id]);
 	struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(adapter);
+	struct aq_hw_cfg_s *cfg =
+		ATL_DEV_PRIVATE_TO_CFG(dev->data->dev_private);
 	struct atl_rx_entry *sw_ring = rxq->sw_ring;
 
 	struct rte_mbuf *new_mbuf;
@@ -1036,8 +1038,18 @@ atl_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
 			rx_mbuf->ol_flags =
 				atl_desc_to_offload_flags(rxq, &rxd_wb);
+
 			rx_mbuf->packet_type = atl_desc_to_pkt_type(&rxd_wb);
 
+			if (rx_mbuf->packet_type & RTE_PTYPE_L2_ETHER_VLAN) {
+				rx_mbuf->ol_flags |= PKT_RX_VLAN;
+				rx_mbuf->vlan_tci = rxd_wb.vlan;
+
+				if (cfg->vlan_strip)
+					rx_mbuf->ol_flags |=
+						PKT_RX_VLAN_STRIPPED;
+			}
+
 			if (!rx_mbuf_first)
 				rx_mbuf_first = rx_mbuf;
 			rx_mbuf_first->nb_segs++;
drivers/net/atlantic/atl_types.h +2 -0
index 56887b14d6f8..3d90f6caefc2 100644
@@ -70,6 +70,8 @@ struct aq_hw_cfg_s {
 	int irq_mask;
 	unsigned int vecs;
 
+	bool vlan_strip;
+	uint32_t vlan_filter[HW_ATL_B0_MAX_VLAN_IDS];
 	uint32_t flow_control;
 
 	struct aq_rss_parameters aq_rss;
Signature · 1 line
2.7.4
#20 lore raw

PATCH v6 20/22 net/atlantic: implement EEPROM get/set

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

Add support for EEPROM reading/writing.

---
 doc/guides/nics/features/atlantic.ini |  1 +
 drivers/net/atlantic/atl_ethdev.c     | 47 +++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)
doc/guides/nics/features/atlantic.ini +1 -0
index 66949b816284..f09a75691a28 100644
@@ -29,6 +29,7 @@ Basic stats          = Y
 Extended stats       = Y
 Stats per queue      = Y
 FW version           = Y
+EEPROM dump          = Y
 Linux UIO            = Y
 ARMv8                = Y
 x86-32               = Y
drivers/net/atlantic/atl_ethdev.c +47 -0

65 lines not on this page · raw message

Signature · 1 line
2.7.4
#21 lore raw

PATCH v6 21/22 net/atlantic: read MAC registers for debug purposes

In reply to Igor Russkikh

From: Pavel Belous <[email protected]>

This patch add support for dumping MAC registers.

---
 doc/guides/nics/features/atlantic.ini |  1 +
 drivers/net/atlantic/atl_ethdev.c     | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
doc/guides/nics/features/atlantic.ini +1 -0
index f09a75691a28..5ed095b14323 100644
@@ -30,6 +30,7 @@ Extended stats       = Y
 Stats per queue      = Y
 FW version           = Y
 EEPROM dump          = Y
+Registers dump       = Y
 Linux UIO            = Y
 ARMv8                = Y
 x86-32               = Y
drivers/net/atlantic/atl_ethdev.c +32 -0
index 824e624dd772..5bc04f55cc21 100644
@@ -69,6 +69,10 @@ static int atl_dev_get_eeprom(struct rte_eth_dev *dev,
 static int atl_dev_set_eeprom(struct rte_eth_dev *dev,
 			      struct rte_dev_eeprom_info *eeprom);
 
+/* Regs */
+static int atl_dev_get_regs(struct rte_eth_dev *dev,
+			    struct rte_dev_reg_info *regs);
+
 /* Flow control */
 static int atl_flow_ctrl_get(struct rte_eth_dev *dev,
 			       struct rte_eth_fc_conf *fc_conf);
@@ -229,6 +233,8 @@ static const struct eth_dev_ops atl_eth_dev_ops = {
 	/* Link */
 	.link_update	      = atl_dev_link_update,
 
+	.get_reg              = atl_dev_get_regs,
+
 	/* Stats */
 	.stats_get	      = atl_dev_stats_get,
 	.xstats_get	      = atl_dev_xstats_get,
@@ -1125,6 +1131,32 @@ atl_dev_set_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *eeprom)
 }
 
 static int
+atl_dev_get_regs(struct rte_eth_dev *dev, struct rte_dev_reg_info *regs)
+{
+	struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	u32 mif_id;
+	int err;
+
+	if (regs->data == NULL) {
+		regs->length = hw_atl_utils_hw_get_reg_length();
+		regs->width = sizeof(u32);
+		return 0;
+	}
+
+	/* Only full register dump is supported */
+	if (regs->length && regs->length != hw_atl_utils_hw_get_reg_length())
+		return -ENOTSUP;
+
+	err = hw_atl_utils_hw_get_regs(hw, regs->data);
+
+	/* Device version */
+	mif_id = hw_atl_reg_glb_mif_id_get(hw);
+	regs->version = mif_id & 0xFFU;
+
+	return err;
+}
+
+static int
 atl_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 {
 	struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private);
Signature · 1 line
2.7.4
#22 lore raw

PATCH v6 22/22 net/atlantic: add release notes

In reply to Igor Russkikh

Release notes for Aquantia atlantic driver.

---
 doc/guides/rel_notes/release_18_11.rst | 5 +++++
 1 file changed, 5 insertions(+)
doc/guides/rel_notes/release_18_11.rst +5 -0
index 2133a5b9bb2e..643ec4d9103d 100644
@@ -104,6 +104,11 @@ New Features
   the specified port. The port must be stopped before the command call in order
   to reconfigure queues.
 
+* **Added Ethernet poll mode driver for Aquantia aQtion family of 10G devices.**
+
+  Added the new ``atlantic`` ethernet poll mode driver for Aquantia XGBE devices.
+  See the :doc:`../nics/atlantic` nic driver guide for more details on this
+  driver.
 
 API Changes
 -----------
Signature · 1 line
2.7.4
#23 lore raw
In reply to Igor Russkikh
Quoted 71 lines · Igor Russkikh

Hello DPDK community!

Aquantia would like to contribute PMD for aQtion AQC10X NIC family:
https://www.aquantia.com/products/aqtion/chips/
These are 10G ethernet NICs with various features.

We do base this work on parts of the existing native linux kernel driver source (atlantic). Shared code is hw_atl hardware and registers access module.

We'd like to target this driver for 18.11 DPDK release timeline, it'd be good to hear comments from the community on how feasible is this.

This patchset implements basic driver infrastructure, vlan offloads, checksumm offloads, rss control, multiring, jumbo frames and other features.

Later on, we plan to share HW MACSEC offloads, rxflows and other features.

version 6 changes:
- PKT_TX_VLAN_PKT replaced with PKT_TX_VLAN
- rx_descriptor_done removed
- adding PKT_RX_VLAN/STRIPPED into mbuf->ol_flags when vlan offloads are on
- commit headlines better naming

version 5 changes:
- MTU configuration is now in separate patch
- Custom LED api removed. Will resubmit separately later on
- Add product link to docs, rearranged adapter features file
- MAINTAINERS file update
- logging name prefix fixed
- rte_eth_copy_pci_info is not needed in init
- dev->security_ctx is not used (removed free)
- fixed adapter_stopped and dev stop/close states interactions
- return error if get_fw_version fails
- added port# to important error logs
- rte_eth_linkstatus_get instead of atomic64 ops
- swstats are now cleared in stats_reset
- xstats_reset callback declared as atl_dev_stats_reset
- stats_mapping_set removed
- check-git-logs fixes

version 4 changes:
- fixed build errors with -Werror on gcc7
- validated build on arm64, freebsd x86_64
- PPC marked as unsupported arch
- stdbool.h is used instead of bool redefines

version 3 changes:
- patchset fixed to be incrementally buildable
- extra includes removed and cleaned up
- license changed to dual GPL-BSD for pieces shared with linux
- removed extra logging #defines
- misc comments from previous review session

version 2 changes:
- fixed build on freebsd (no ETIME const)
- fixed a bunch of checkpatch failures and warnings
- removed extra CFLAGS disabled warning
- making static arrays const

Igor Russkikh (8):
net/atlantic: add logging structure net/atlantic: add hardware registers access routines net/atlantic: add hardware access layer net/atlantic: implement firmware operations net/atlantic: add b0 hardware layer net/atlantic: implement Rx path net/atlantic: implement RSS and RETA manipulation API net/atlantic: add release notes

Quoted 15 lines

Pavel Belous (14):
net/atlantic: add atlantic PMD driver skeleton net/atlantic: configure rte device start/stop net/atlantic: implement core logic for Tx/Rx net/atlantic: implement Tx path
net/atlantic: add link status and interrupt management net/atlantic: implement device statistics net/atlantic: add Rx/Tx descriptors information net/atlantic: implement promisc and allmulti modes net/atlantic: add flow control configuration net/atlantic: implement MAC address manipulations net/atlantic: implement MTU configuration net/atlantic: implement VLAN filters and offloads net/atlantic: implement EEPROM get/set net/atlantic: read MAC registers for debug purposes

Series applied to dpdk-next-net/master, thanks.

Please don't forget to send a web page patch [1] to add new device support to web site [2].

Thanks,
ferruh

[1]: http://dpdk.org/git/tools/dpdk-web
[2]: https://core.dpdk.org/supported/

#24 lore raw

Hi Ferruh,

Quoted 17 lines · Ferruh Yigit
Quoted 16 lines · Igor Russkikh

Hello DPDK community!

Aquantia would like to contribute PMD for aQtion AQC10X NIC family:
https://www.aquantia.com/products/aqtion/chips/
These are 10G ethernet NICs with various features.

We do base this work on parts of the existing native linux kernel driver source (atlantic). Shared code is hw_atl hardware and registers access module.

We'd like to target this driver for 18.11 DPDK release timeline, it'd be good to hear comments from the community on how feasible is this.

This patchset implements basic driver infrastructure, vlan offloads, checksumm offloads, rss control, multiring, jumbo frames and other features.

Quoted 9 lines
Quoted 3 lines

Later on, we plan to share HW MACSEC offloads, rxflows and other features.

version 6 changes

Series applied to dpdk-next-net/master, thanks.

Please don't forget to send a web page patch [1] to add new device support to web site [2].

Thank you for supporting us in this review and for all your comments!

Regards,
Igor