Skip to contentSkip to conversation

add net/crypto mrvl pmd drivers

PATCH Superseded Tomasz Duszynski 11 participants 110 messages Sep 26, 2017 – Oct 12, 2017

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

cover add net/crypto mrvl pmd drivers

Hello,

This patch series introduces net/crypto drivers for Marvell Armada 7k/8k SoCs along with documentation and crypto driver pmd tests.

Below you can find the list of features which net/crypto pmds support.

Net pmd features:
* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Cryto pmd features:
* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Tomasz Duszynski (8):
app: link the whole rte_cfgfile library net/mrvl: add mrvl net pmd driver
doc: add mrvl net pmd documentation
maintainers: add maintainers for the mrvl net pmd crypto/mrvl: add mrvl crypto pmd driver
doc: add mrvl crypto pmd documentation
maintainers: add maintainers for the mrvl crypto pmd
test: add mrvl crypto pmd unit tests

 MAINTAINERS                                  |   20 +
 config/common_base                           |   13 +
 doc/guides/cryptodevs/features/mrvl.ini      |   42 +
 doc/guides/cryptodevs/index.rst              |    1 +
 doc/guides/cryptodevs/mrvl.rst               |  198 +++
 doc/guides/nics/features/mrvl.ini            |   24 +
 doc/guides/nics/index.rst                    |    1 +
 doc/guides/nics/mrvl.rst                     |  151 ++
 drivers/crypto/Makefile                      |    2 +
 drivers/crypto/mrvl/Makefile                 |   63 +
 drivers/crypto/mrvl/rte_mrvl_compat.h        |   48 +
 drivers/crypto/mrvl/rte_mrvl_pmd.c           |  866 ++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c       |  787 +++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_private.h   |  121 ++
 drivers/crypto/mrvl/rte_mrvl_pmd_version.map |    3 +
 drivers/net/Makefile                         |    2 +
 drivers/net/mrvl/Makefile                    |   69 +
 drivers/net/mrvl/mrvl_ethdev.c               | 2277 ++++++++++++++++++++++++++
 drivers/net/mrvl/mrvl_ethdev.h               |  115 ++
 drivers/net/mrvl/mrvl_qos.c                  |  627 +++++++
 drivers/net/mrvl/mrvl_qos.h                  |  112 ++
 drivers/net/mrvl/rte_pmd_mrvl_version.map    |    3 +
 mk/rte.app.mk                                |    4 +-
 test/test/test_cryptodev.c                   |  168 ++
 test/test/test_cryptodev.h                   |    1 +
 test/test/test_cryptodev_aes_test_vectors.h  |   72 +-
 test/test/test_cryptodev_blockcipher.c       |    9 +-
 test/test/test_cryptodev_blockcipher.h       |    1 +
 test/test/test_cryptodev_des_test_vectors.h  |   24 +-
 29 files changed, 5790 insertions(+), 34 deletions(-)
 create mode 100644 doc/guides/cryptodevs/features/mrvl.ini
 create mode 100644 doc/guides/cryptodevs/mrvl.rst
 create mode 100644 doc/guides/nics/features/mrvl.ini
 create mode 100644 doc/guides/nics/mrvl.rst
 create mode 100644 drivers/crypto/mrvl/Makefile
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_compat.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_private.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_version.map
 create mode 100644 drivers/net/mrvl/Makefile
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.c
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.h
 create mode 100644 drivers/net/mrvl/mrvl_qos.c
 create mode 100644 drivers/net/mrvl/mrvl_qos.h
 create mode 100644 drivers/net/mrvl/rte_pmd_mrvl_version.map

--
2.7.4

#1 lore raw

PATCH 1/8 app: link the whole rte_cfgfile library

Since MRVL NET PMD needs librte_cfgfile to parse QoS configuration file link it as the whole library.

---
 mk/rte.app.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mk/rte.app.mk +1 -1
index c25fdd9..94568a8 100644
@@ -81,10 +81,10 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER)          += -lrte_power
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER)          += -lrte_timer
 _LDLIBS-$(CONFIG_RTE_LIBRTE_EFD)            += -lrte_efd
-_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
 
 _LDLIBS-y += --whole-archive
 
+_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
 _LDLIBS-$(CONFIG_RTE_LIBRTE_HASH)           += -lrte_hash
 _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lrte_vhost
 _LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS)         += -lrte_kvargs
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 1/8] app: link the whole rte_cfgfile library

Quoted 6 lines · Tomasz Duszynski

Since MRVL NET PMD needs librte_cfgfile to parse QoS configuration file link it as the whole library.

---

Can you clarify a bit more why this is needed? For a static build, the cfgfile should be linked in to the after the PMDs, so the dependencies in the driver should be satisfied in the link. For a dynamic build, the PMD should depend upon the cfgfile directly, and use it at runtime appropriately.
Am I missing something?

/Bruce

#3 lore raw

Re: [PATCH 1/8] app: link the whole rte_cfgfile library

Quoted 8 lines · Bruce Richardson
Quoted 6 lines · Tomasz Duszynski

Since MRVL NET PMD needs librte_cfgfile to parse QoS configuration file link it as the whole library.

---

Quoted 8 lines

Can you clarify a bit more why this is needed? For a static build, the cfgfile should be linked in to the after the PMDs, so the dependencies in the driver should be satisfied in the link. For a dynamic build, the PMD should depend upon the cfgfile directly, and use it at runtime appropriately.
Am I missing something?

/Bruce

Hi Bruce,

You are correct, all dependencies in the driver will be satisfied. The reason this change was introduced is that, librte_pmd_mrvl.a contains undefined symbols from librte_cfgfile.a thus linking applications under app/ directory will fail as librte_cfgfile.a comes before librte_pmd_mrvl.a during the linking stage.

Linking librte_cfgfile.a with --whole-archive solves the issue.

--
- Tomasz Duszyński

#4 lore raw

Re: [PATCH 1/8] app: link the whole rte_cfgfile library

Quoted 25 lines · Tomasz Duszynski
Quoted 8 lines · Bruce Richardson
Quoted 6 lines · Tomasz Duszynski

Since MRVL NET PMD needs librte_cfgfile to parse QoS configuration file link it as the whole library.

---

Quoted 8 lines

Can you clarify a bit more why this is needed? For a static build, the cfgfile should be linked in to the after the PMDs, so the dependencies in the driver should be satisfied in the link. For a dynamic build, the PMD should depend upon the cfgfile directly, and use it at runtime appropriately.
Am I missing something?

/Bruce

Hi Bruce,

You are correct, all dependencies in the driver will be satisfied. The reason this change was introduced is that, librte_pmd_mrvl.a contains undefined symbols from librte_cfgfile.a thus linking applications under app/ directory will fail as librte_cfgfile.a comes before librte_pmd_mrvl.a during the linking stage.

Quoted 3 lines

Linking librte_cfgfile.a with --whole-archive solves the issue.

--

Thanks for the explanation.

I believe the proper fix in this case is to ensure that when linking apps that cfgfile comes after librte_pmd_mrvl. The drivers should always come first when linking, then the DPDK libs.

/Bruce

#5 lore raw

PATCH 2/8 net/mrvl: add mrvl net pmd driver

In reply to Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

---
 config/common_base                        |    7 +
 drivers/net/Makefile                      |    2 +
 drivers/net/mrvl/Makefile                 |   69 +
 drivers/net/mrvl/mrvl_ethdev.c            | 2277 +++++++++++++++++++++++++++++
 drivers/net/mrvl/mrvl_ethdev.h            |  115 ++
 drivers/net/mrvl/mrvl_qos.c               |  627 ++++++++
 drivers/net/mrvl/mrvl_qos.h               |  112 ++
 drivers/net/mrvl/rte_pmd_mrvl_version.map |    3 +
 mk/rte.app.mk                             |    1 +
 9 files changed, 3213 insertions(+)
 create mode 100644 drivers/net/mrvl/Makefile
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.c
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.h
 create mode 100644 drivers/net/mrvl/mrvl_qos.c
 create mode 100644 drivers/net/mrvl/mrvl_qos.h
 create mode 100644 drivers/net/mrvl/rte_pmd_mrvl_version.map
config/common_base +7 -0
index 5e97a08..d05a60c 100644
@@ -262,6 +262,13 @@ CONFIG_RTE_LIBRTE_NFP_PMD=n
 CONFIG_RTE_LIBRTE_NFP_DEBUG=n
 
 #
+# Compile Marvell PMD driver
+#
+CONFIG_RTE_LIBRTE_MRVL_PMD=n
+CONFIG_RTE_LIBRTE_MRVL_DEBUG=n
+CONFIG_RTE_MRVL_MUSDK_DMA_MEMSIZE=41943040
+
+#
 # Compile burst-oriented Broadcom BNXT PMD driver
 #
 CONFIG_RTE_LIBRTE_BNXT_PMD=y
drivers/net/Makefile +2 -0
index d33c959..4a3a205 100644
@@ -73,6 +73,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4
 DEPDIRS-mlx4 = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5
 DEPDIRS-mlx5 = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += mrvl
+DEPDIRS-mrvl = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += nfp
 DEPDIRS-nfp = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt
drivers/net/mrvl/Makefile new file +69 -0

69 lines not on this page · raw message

drivers/net/mrvl/mrvl_ethdev.c new file +2277 -0

2,277 lines not on this page · raw message

drivers/net/mrvl/mrvl_ethdev.h new file +115 -0

115 lines not on this page · raw message

drivers/net/mrvl/mrvl_qos.c new file +627 -0

518 lines not on this page · raw message

drivers/net/mrvl/mrvl_qos.h new file +112 -0

112 lines not on this page · raw message

drivers/net/mrvl/rte_pmd_mrvl_version.map new file +3 -0
new file mode 100644
index 0000000..a753031

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

mk/rte.app.mk +1 -0
index 94568a8..8df74bb 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.

#6 lore raw

PATCH 3/8 doc: add mrvl net pmd documentation

In reply to Tomasz Duszynski

Add documentation for the MRVL NET PMD driver.

---
 doc/guides/nics/features/mrvl.ini |  24 ++++++
 doc/guides/nics/index.rst         |   1 +
 doc/guides/nics/mrvl.rst          | 151 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 176 insertions(+)
 create mode 100644 doc/guides/nics/features/mrvl.ini
 create mode 100644 doc/guides/nics/mrvl.rst
doc/guides/nics/features/mrvl.ini new file +24 -0
new file mode 100644
index 0000000..781d6dc
@@ -0,0 +1,24 @@
+;
+; Supported features of the 'mrvl' network poll mode driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Speed capabilities   = Y
+Link status          = Y
+MTU update           = Y
+Jumbo frame          = Y
+Promiscuous mode     = Y
+Allmulticast mode    = Y
+Unicast MAC filter   = Y
+Multicast MAC filter = Y
+RSS hash             = Y
+VLAN filter          = Y
+CRC offload          = Y
+L3 checksum offload  = Y
+L4 checksum offload  = Y
+Packet type parsing  = Y
+Basic stats          = Y
+Stats per queue      = Y
+ARMv8                = Y
+Usage doc            = Y
doc/guides/nics/index.rst +1 -0
index 36f4f3f..7192f63 100644
@@ -55,6 +55,7 @@ Network Interface Controller Drivers
     liquidio
     mlx4
     mlx5
+    mrvl
     nfp
     qede
     sfc_efx
doc/guides/nics/mrvl.rst new file +151 -0

151 lines not on this page · raw message

Signature · 1 line
2.7.4
#7 lore raw

PATCH 4/8 maintainers: add maintainers for the mrvl net pmd

In reply to Tomasz Duszynski
---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index a0cd75e..d4810cf 100644
@@ -393,6 +393,16 @@ F: drivers/net/mlx5/
 F: doc/guides/nics/mlx5.rst
 F: doc/guides/nics/features/mlx5.ini
 
+Marvell mrvl
+M: Jacek Siuda <[email protected]>
+M: Tomasz Duszynski <[email protected]>
+M: Dmitri Epshtein <[email protected]>
+M: Natalie Samsonov <[email protected]>
+M: Jianbo Liu <[email protected]>
+F: drivers/net/mrvl/
+F: doc/guides/nics/mrvl.rst
+F: doc/guides/nics/features/mrvl.ini
+
 Netcope szedata2
 M: Matej Vido <[email protected]>
 F: drivers/net/szedata2/
Signature · 1 line
2.7.4
#8 lore raw

PATCH 5/8 crypto/mrvl: add mrvl crypto pmd driver

In reply to Tomasz Duszynski

Add support for the Marvell Security Crypto Accelerator EIP197. Driver is based on external, publicly available, Marvell MUSDK library that provides access to the hardware with minimum overhead and high performance.

Driver comes with support for the following features:

* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

---
 config/common_base                           |   6 +
 drivers/crypto/Makefile                      |   2 +
 drivers/crypto/mrvl/Makefile                 |  63 ++
 drivers/crypto/mrvl/rte_mrvl_compat.h        |  48 ++
 drivers/crypto/mrvl/rte_mrvl_pmd.c           | 866 +++++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c       | 787 ++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_private.h   | 121 ++++
 drivers/crypto/mrvl/rte_mrvl_pmd_version.map |   3 +
 mk/rte.app.mk                                |   1 +
 9 files changed, 1897 insertions(+)
 create mode 100644 drivers/crypto/mrvl/Makefile
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_compat.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_private.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_version.map
config/common_base +6 -0
index d05a60c..e9b181e 100644
@@ -521,6 +521,12 @@ CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER_DEBUG=n
 CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=y
 
 #
+# Compile PMD for Marvell Crypto device
+#
+CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO=n
+CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO_DEBUG=n
+
+#
 # Compile generic event device library
 #
 CONFIG_RTE_LIBRTE_EVENTDEV=y
drivers/crypto/Makefile +2 -0
index 7a719b9..1d7db5b 100644
@@ -51,6 +51,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += kasumi
 DEPDIRS-kasumi = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += zuc
 DEPDIRS-zuc = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += mrvl
+DEPDIRS-mrvl = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += null
 DEPDIRS-null = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += dpaa2_sec
drivers/crypto/mrvl/Makefile new file +63 -0

63 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_compat.h new file +48 -0

48 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd.c new file +866 -0

866 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +787 -0

787 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd_private.h new file +121 -0

121 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd_version.map new file +3 -0
new file mode 100644
index 0000000..a753031
@@ -0,0 +1,3 @@
+DPDK_17.11 {
+	local: *;
+};
mk/rte.app.mk +1 -0
index 8df74bb..0f121ee 100644
@@ -163,6 +163,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -lrte_pmd_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -L$(LIBSSO_ZUC_PATH)/build -lsso_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -lrte_pmd_armv8
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += -L$(LIBMUSDK_PATH)/lib -lrte_pmd_mrvl_crypto -lmusdk
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += -lrte_pmd_crypto_scheduler
 ifeq ($(CONFIG_RTE_LIBRTE_FSLMC_BUS),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC)   += -lrte_pmd_dpaa2_sec
Signature · 1 line
2.7.4
#9 lore raw

PATCH 6/8 doc: add mrvl crypto pmd documentation

In reply to Tomasz Duszynski

Add documentation for the MRVL CRYPTO PMD driver.

---
 doc/guides/cryptodevs/features/mrvl.ini |  42 +++++++
 doc/guides/cryptodevs/index.rst         |   1 +
 doc/guides/cryptodevs/mrvl.rst          | 198 ++++++++++++++++++++++++++++++++
 3 files changed, 241 insertions(+)
 create mode 100644 doc/guides/cryptodevs/features/mrvl.ini
 create mode 100644 doc/guides/cryptodevs/mrvl.rst
doc/guides/cryptodevs/features/mrvl.ini new file +42 -0
new file mode 100644
index 0000000..6d2fe6a
@@ -0,0 +1,42 @@
+; Supported features of the 'mrvl' crypto driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Symmetric crypto       = Y
+Sym operation chaining = Y
+
+;
+; Supported crypto algorithms of a default crypto driver.
+;
+[Cipher]
+AES CBC (128)  = Y
+AES CBC (192)  = Y
+AES CBC (256)  = Y
+AES CTR (128)  = Y
+AES CTR (192)  = Y
+AES CTR (256)  = Y
+3DES CBC       = Y
+3DES CTR       = Y
+
+;
+; Supported authentication algorithms of a default crypto driver.
+;
+[Auth]
+MD5          = Y
+MD5 HMAC     = Y
+SHA1         = Y
+SHA1 HMAC    = Y
+SHA256       = Y
+SHA256 HMAC  = Y
+SHA384       = Y
+SHA384 HMAC  = Y
+SHA512       = Y
+SHA512 HMAC  = Y
+AES GMAC     = Y
+
+;
+; Supported AEAD algorithms of a default crypto driver.
+;
+[AEAD]
+AES GCM (128) = Y
doc/guides/cryptodevs/index.rst +1 -0
index 361b82d..a8ee0eb 100644
@@ -42,6 +42,7 @@ Crypto Device Drivers
     dpaa2_sec
     kasumi
     openssl
+    mrvl
     null
     scheduler
     snow3g
doc/guides/cryptodevs/mrvl.rst new file +198 -0

198 lines not on this page · raw message

Signature · 1 line
2.7.4
#10 lore raw

PATCH 7/8 maintainers: add maintainers for the mrvl crypto pmd

In reply to Tomasz Duszynski
---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index d4810cf..93800d2 100644
@@ -561,6 +561,16 @@ F: drivers/crypto/dpaa2_sec/
 F: doc/guides/cryptodevs/dpaa2_sec.rst
 F: doc/guides/cryptodevs/features/dpaa2_sec.ini
 
+MARVELL MRVL PMD
+M: Jacek Siuda <[email protected]>
+M: Tomasz Duszynski <[email protected]>
+M: Dmitri Epshtein <[email protected]>
+M: Natalie Samsonov <[email protected]>
+M: Jianbo Liu <[email protected]>
+F: drivers/crypto/mrvl/
+F: doc/guides/cryptodevs/mrvl.rst
+F: doc/guides/cryptodevs/mrvl.ini
+
 SNOW 3G PMD
 M: Pablo de Lara <[email protected]>
 F: drivers/crypto/snow3g/
Signature · 1 line
2.7.4
#11 lore raw

PATCH 8/8 test: add mrvl crypto pmd unit tests

In reply to Tomasz Duszynski

Add unit tests for MRVL CRYPTO PMD driver.

---
 test/test/test_cryptodev.c                  | 168 ++++++++++++++++++++++++++++
 test/test/test_cryptodev.h                  |   1 +
 test/test/test_cryptodev_aes_test_vectors.h |  72 ++++++++----
 test/test/test_cryptodev_blockcipher.c      |   9 +-
 test/test/test_cryptodev_blockcipher.h      |   1 +
 test/test/test_cryptodev_des_test_vectors.h |  24 ++--
 6 files changed, 242 insertions(+), 33 deletions(-)
test/test/test_cryptodev.c +168 -0
index a4116c6..9fb6a2c 100644
@@ -341,6 +341,28 @@ testsuite_setup(void)
 		}
 	}
 
+	/* Create a MRVL device if required */
+	if (gbl_driver_id == rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_MRVL_PMD))) {
+#ifndef RTE_LIBRTE_PMD_MRVL_CRYPTO
+		RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO must be"
+			" enabled in config file to run this testsuite.\n");
+		return TEST_FAILED;
+#endif
+		nb_devs = rte_cryptodev_device_count_by_driver(
+				rte_cryptodev_driver_id_get(
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD)));
+		if (nb_devs < 1) {
+			ret = rte_vdev_init(
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD),
+				NULL);
+
+			TEST_ASSERT(ret == 0, "Failed to create "
+				"instance of pmd : %s",
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
+		}
+	}
+
 #ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
 	if (gbl_driver_id == rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD))) {
@@ -1862,6 +1884,101 @@ test_AES_chain_armv8_all(void)
 	return TEST_SUCCESS;
 }
 
+static int
+test_AES_chain_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AES_CHAIN_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_AES_cipheronly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AES_CIPHERONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_authonly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AUTHONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_3DES_chain_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_3DES_CHAIN_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_3DES_cipheronly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_3DES_CIPHERONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
 /* ***** SNOW 3G Tests ***** */
 static int
 create_wireless_algo_hash_session(uint8_t dev_id,
@@ -8939,6 +9056,40 @@ static struct unit_test_suite cryptodev_armv8_testsuite  = {
 	}
 };
 
+static struct unit_test_suite cryptodev_mrvl_testsuite  = {
+	.suite_name = "Crypto Device Marvell Component Test Suite",
+	.setup = testsuite_setup,
+	.teardown = testsuite_teardown,
+	.unit_test_cases = {
+		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_multi_session_random_usage),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_AES_chain_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_AES_cipheronly_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_authonly_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_3DES_chain_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_3DES_cipheronly_mrvl_all),
+
+		/** Negative tests */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			authentication_verify_HMAC_SHA1_fail_data_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
+
+		TEST_CASES_END() /**< NULL terminate unit test array */
+	}
+};
+
+
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
@@ -9083,6 +9234,22 @@ test_cryptodev_armv8(void)
 	return unit_test_suite_runner(&cryptodev_armv8_testsuite);
 }
 
+static int
+test_cryptodev_mrvl(void)
+{
+	gbl_driver_id = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
+
+	if (gbl_driver_id == -1) {
+		RTE_LOG(ERR, USER1, "MRVL PMD must be loaded. Check if "
+				"CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO is enabled "
+				"in config file to run this testsuite.\n");
+		return TEST_FAILED;
+	}
+
+	return unit_test_suite_runner(&cryptodev_mrvl_testsuite);
+}
+
 #ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
 
 static int
@@ -9136,4 +9303,5 @@ REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_autotest, test_cryptodev_sw_snow3g);
 REGISTER_TEST_COMMAND(cryptodev_sw_kasumi_autotest, test_cryptodev_sw_kasumi);
 REGISTER_TEST_COMMAND(cryptodev_sw_zuc_autotest, test_cryptodev_sw_zuc);
 REGISTER_TEST_COMMAND(cryptodev_sw_armv8_autotest, test_cryptodev_armv8);
+REGISTER_TEST_COMMAND(cryptodev_sw_mrvl_autotest, test_cryptodev_mrvl);
 REGISTER_TEST_COMMAND(cryptodev_dpaa2_sec_autotest, test_cryptodev_dpaa2_sec);
test/test/test_cryptodev.h +1 -0
index 4509a09..2e9eb0b 100644
@@ -88,6 +88,7 @@
 #define CRYPTODEV_NAME_ARMV8_PMD	crypto_armv8
 #define CRYPTODEV_NAME_DPAA2_SEC_PMD	crypto_dpaa2_sec
 #define CRYPTODEV_NAME_SCHEDULER_PMD	crypto_scheduler
+#define CRYPTODEV_NAME_MRVL_PMD		crypto_mrvl
 
 /**
  * Write (spread) data from buffer to mbuf data
test/test/test_cryptodev_aes_test_vectors.h +48 -24

216 lines not on this page · raw message

test/test/test_cryptodev_blockcipher.c +8 -1
index 6089af4..01fe136 100644
@@ -92,6 +92,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
 	int dpaa2_sec_pmd = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
+	int mrvl_pmd = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
 
 	int nb_segs = 1;
 
@@ -116,7 +118,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 	if (driver_id == dpaa2_sec_pmd ||
 			driver_id == qat_pmd ||
 			driver_id == openssl_pmd ||
-			driver_id == armv8_pmd) { /* Fall through */
+			driver_id == armv8_pmd ||
+			driver_id == mrvl_pmd) { /* Fall through */
 		digest_len = tdata->digest.len;
 	} else if (driver_id == aesni_mb_pmd ||
 			driver_id == scheduler_pmd) {
@@ -612,6 +615,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
 			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
 	int qat_pmd = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
+	int mrvl_pmd = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
 
 	switch (test_type) {
 	case BLKCIPHER_AES_CHAIN_TYPE:
@@ -670,6 +675,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
 		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER;
 	else if (driver_id == dpaa2_pmd)
 		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC;
+	else if (driver_id == mrvl_pmd)
+		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MRVL;
 	else
 		TEST_ASSERT(0, "Unrecognized cryptodev type");
 
test/test/test_cryptodev_blockcipher.h +1 -0
index 22b8d20..6919336 100644
@@ -53,6 +53,7 @@
 #define BLOCKCIPHER_TEST_TARGET_PMD_ARMV8	0x0008 /* ARMv8 flag */
 #define BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER	0x0010 /* Scheduler */
 #define BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC	0x0020 /* DPAA2_SEC flag */
+#define BLOCKCIPHER_TEST_TARGET_PMD_MRVL	0x0040 /* Marvell flag */
 
 #define BLOCKCIPHER_TEST_OP_CIPHER	(BLOCKCIPHER_TEST_OP_ENCRYPT | \
 					BLOCKCIPHER_TEST_OP_DECRYPT)
test/test/test_cryptodev_des_test_vectors.h +16 -8
index 0b6e0b8..ffcf657 100644
@@ -851,13 +851,15 @@ static const struct blockcipher_test_case des_cipheronly_test_cases[] = {
 		.test_descr = "DES-CBC Encryption",
 		.test_data = &des_cbc_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "DES-CBC Decryption",
 		.test_data = &des_cbc_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 
 };
@@ -1087,7 +1089,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC HMAC-SHA1 Decryption Digest Verify",
@@ -1095,19 +1098,22 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC SHA1 Encryption Digest",
 		.test_data = &triple_des192cbc_sha1_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC SHA1 Decryption Digest Verify",
 		.test_data = &triple_des192cbc_sha1_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-128-CTR HMAC-SHA1 Encryption Digest",
@@ -1220,7 +1226,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC Decryption",
@@ -1228,7 +1235,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-128-CTR Encryption",
Signature · 1 line
2.7.4
#12 lore raw
In reply to Tomasz Duszynski
Quoted 10 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Duszynski
Sent: Tuesday, September 26, 2017 10:40 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Tomasz Duszynski <[email protected]>
Subject: [dpdk-dev] [PATCH 0/8] add net/crypto mrvl pmd drivers

Quoted 7 lines

Hello,

This patch series introduces net/crypto drivers for Marvell Armada 7k/8k SoCs along with documentation and crypto driver pmd tests.

Below you can find the list of features which net/crypto pmds support.

Could you split this patchset into two? I think the network and crypto PMDs should be separated, as they are targetting different subtrees.

Thanks,
Pablo

#13 lore raw
Quoted 15 lines · Pablo
Quoted 15 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Duszynski
Sent: Tuesday, September 26, 2017 10:40 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Tomasz Duszynski <[email protected]>
Subject: [dpdk-dev] [PATCH 0/8] add net/crypto mrvl pmd drivers

Hello,

This patch series introduces net/crypto drivers for Marvell Armada 7k/8k SoCs along with documentation and crypto driver pmd tests.

Quoted 8 lines
Quoted 2 lines

Below you can find the list of features which net/crypto pmds support.

Could you split this patchset into two? I think the network and crypto PMDs should be separated, as they are targetting different subtrees.

Thanks,
Pablo

If that's a hard requirement I am fine with splitting the patch series. Drivers were put into the same patchset because they have common CONFIG dependency.

E.g. applying just crypto pmd patches and changing CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO to 'y' would break compilation as it depends on CONFIG introduced by net pmd patches.

--
- Tomasz Duszyński

#14 lore raw

v2 cover add net mrvl pmd driver

In reply to Tomasz Duszynski

Hello,

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Below you can find the list of features which net pmd supports:
* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Tomasz Duszynski (4):
app: link the whole rte_cfgfile library net/mrvl: add mrvl net pmd driver
doc: add mrvl net pmd documentation
maintainers: add maintainers for the mrvl net pmd

 MAINTAINERS                               |   10 +
 config/common_base                        |    7 +
 doc/guides/nics/features/mrvl.ini         |   24 +
 doc/guides/nics/index.rst                 |    1 +
 doc/guides/nics/mrvl.rst                  |  151 ++
 drivers/net/Makefile                      |    2 +
 drivers/net/mrvl/Makefile                 |   69 +
 drivers/net/mrvl/mrvl_ethdev.c            | 2277 +++++++++++++++++++++++++++++
 drivers/net/mrvl/mrvl_ethdev.h            |  115 ++
 drivers/net/mrvl/mrvl_qos.c               |  627 ++++++++
 drivers/net/mrvl/mrvl_qos.h               |  112 ++
 drivers/net/mrvl/rte_pmd_mrvl_version.map |    3 +
 mk/rte.app.mk                             |    3 +-
 13 files changed, 3400 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/nics/features/mrvl.ini
 create mode 100644 doc/guides/nics/mrvl.rst
 create mode 100644 drivers/net/mrvl/Makefile
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.c
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.h
 create mode 100644 drivers/net/mrvl/mrvl_qos.c
 create mode 100644 drivers/net/mrvl/mrvl_qos.h
 create mode 100644 drivers/net/mrvl/rte_pmd_mrvl_version.map

--
2.7.4

#15 lore raw

PATCH v2 1/4 app: link the whole rte_cfgfile library

MRVL net pmd needs rte_cfgfile to parse QoS configuration file thus librte_pmd_mrvl.a contains undefined symbols from librte_cfgfile.a.

As a result linking applications under app/ directory will fail because librte_cfgfile.a comes before librte_pmd_mrvl.a during the linking stage.

Linking the whole librte_cfgfile.a solves the issue.

---
v2:
* Changed commit message to explain problem better.

 mk/rte.app.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mk/rte.app.mk +1 -1
index c25fdd9..94568a8 100644
@@ -81,10 +81,10 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER)          += -lrte_power
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER)          += -lrte_timer
 _LDLIBS-$(CONFIG_RTE_LIBRTE_EFD)            += -lrte_efd
-_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
 
 _LDLIBS-y += --whole-archive
 
+_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
 _LDLIBS-$(CONFIG_RTE_LIBRTE_HASH)           += -lrte_hash
 _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lrte_vhost
 _LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS)         += -lrte_kvargs

--
2.7.4

#16 lore raw

v3 cover add net mrvl pmd driver

Hello,

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Below you can find the list of features which net pmd supports:
* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Changes since v2:
* Removed LINE_SPACING, MULTILINE_DEREFERENCE and SPLIT_STRING checkpatch warnings.
* Removed unnecessary forward declarations.
* Fixed whitespace warnings.

Changes since v1:
* Changed commit message to explain problem better.
* Removed bunch of checkpatch warnings about unnecessary parentheses.

Tomasz Duszynski (4):
app: link the whole rte_cfgfile library net/mrvl: add mrvl net pmd driver
doc: add mrvl net pmd documentation
maintainers: add maintainers for the mrvl net pmd

 MAINTAINERS                               |   10 +
 config/common_base                        |    7 +
 doc/guides/nics/features/mrvl.ini         |   24 +
 doc/guides/nics/index.rst                 |    1 +
 doc/guides/nics/mrvl.rst                  |  151 ++
 drivers/net/Makefile                      |    2 +
 drivers/net/mrvl/Makefile                 |   69 +
 drivers/net/mrvl/mrvl_ethdev.c            | 2277 +++++++++++++++++++++++++++++
 drivers/net/mrvl/mrvl_ethdev.h            |  114 ++
 drivers/net/mrvl/mrvl_qos.c               |  628 ++++++++
 drivers/net/mrvl/mrvl_qos.h               |  112 ++
 drivers/net/mrvl/rte_pmd_mrvl_version.map |    3 +
 mk/rte.app.mk                             |    3 +-
 13 files changed, 3400 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/nics/features/mrvl.ini
 create mode 100644 doc/guides/nics/mrvl.rst
 create mode 100644 drivers/net/mrvl/Makefile
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.c
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.h
 create mode 100644 drivers/net/mrvl/mrvl_qos.c
 create mode 100644 drivers/net/mrvl/mrvl_qos.h
 create mode 100644 drivers/net/mrvl/rte_pmd_mrvl_version.map

--
2.7.4

#17 lore raw

PATCH v3 1/4 app: link the whole rte_cfgfile library

MRVL net pmd needs rte_cfgfile to parse QoS configuration file thus librte_pmd_mrvl.a contains undefined symbols from librte_cfgfile.a.

As a result linking applications under app/ directory will fail because librte_cfgfile.a comes before librte_pmd_mrvl.a during the linking stage.

Linking the whole librte_cfgfile.a solves the issue.

---
v2:
* Changed commit message to explain problem better.

 mk/rte.app.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mk/rte.app.mk +1 -1
index c25fdd9..94568a8 100644
@@ -81,10 +81,10 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER)          += -lrte_power
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER)          += -lrte_timer
 _LDLIBS-$(CONFIG_RTE_LIBRTE_EFD)            += -lrte_efd
-_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
 
 _LDLIBS-y += --whole-archive
 
+_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
 _LDLIBS-$(CONFIG_RTE_LIBRTE_HASH)           += -lrte_hash
 _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lrte_vhost
 _LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS)         += -lrte_kvargs

--
2.7.4

#18 lore raw

PATCH v3 2/4 net/mrvl: add mrvl net pmd driver

In reply to Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

---
v3:
* Removed LINE_SPACING, MULTILINE_DEREFERENCE and SPLIT_STRING checkpatch warnings.
* Removed unnecessary forward declarations.
* Fixed whitespace warnings.

v2:
* Removed bunch of checkpatch warnings about unnecessary parentheses.

 config/common_base                        |    7 +
 drivers/net/Makefile                      |    2 +
 drivers/net/mrvl/Makefile                 |   69 +
 drivers/net/mrvl/mrvl_ethdev.c            | 2274 +++++++++++++++++++++++++++++
 drivers/net/mrvl/mrvl_ethdev.h            |  114 ++
 drivers/net/mrvl/mrvl_qos.c               |  628 ++++++++
 drivers/net/mrvl/mrvl_qos.h               |  112 ++
 drivers/net/mrvl/rte_pmd_mrvl_version.map |    3 +
 mk/rte.app.mk                             |    1 +
 9 files changed, 3210 insertions(+)
 create mode 100644 drivers/net/mrvl/Makefile
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.c
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.h
 create mode 100644 drivers/net/mrvl/mrvl_qos.c
 create mode 100644 drivers/net/mrvl/mrvl_qos.h
 create mode 100644 drivers/net/mrvl/rte_pmd_mrvl_version.map
config/common_base +7 -0
index 5e97a08..d05a60c 100644
@@ -262,6 +262,13 @@ CONFIG_RTE_LIBRTE_NFP_PMD=n
 CONFIG_RTE_LIBRTE_NFP_DEBUG=n
 
 #
+# Compile Marvell PMD driver
+#
+CONFIG_RTE_LIBRTE_MRVL_PMD=n
+CONFIG_RTE_LIBRTE_MRVL_DEBUG=n
+CONFIG_RTE_MRVL_MUSDK_DMA_MEMSIZE=41943040
+
+#
 # Compile burst-oriented Broadcom BNXT PMD driver
 #
 CONFIG_RTE_LIBRTE_BNXT_PMD=y
drivers/net/Makefile +2 -0
index d33c959..4a3a205 100644
@@ -73,6 +73,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4
 DEPDIRS-mlx4 = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5
 DEPDIRS-mlx5 = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += mrvl
+DEPDIRS-mrvl = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += nfp
 DEPDIRS-nfp = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt
drivers/net/mrvl/Makefile new file +69 -0

69 lines not on this page · raw message

drivers/net/mrvl/mrvl_ethdev.c new file +2274 -0

2,274 lines not on this page · raw message

drivers/net/mrvl/mrvl_ethdev.h new file +114 -0

114 lines not on this page · raw message

drivers/net/mrvl/mrvl_qos.c new file +628 -0

522 lines not on this page · raw message

drivers/net/mrvl/mrvl_qos.h new file +112 -0

112 lines not on this page · raw message

drivers/net/mrvl/rte_pmd_mrvl_version.map new file +3 -0
new file mode 100644
index 0000000..a753031

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

mk/rte.app.mk +1 -0
index 94568a8..8df74bb 100644

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

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

--
2.7.4

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

#19 lore raw

Re: [PATCH v3 2/4] net/mrvl: add mrvl net pmd driver

Quoted 15 lines · Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter

Quoted 8 lines

* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

I have more detailed comments but in high level, what do you think splitting this patch into three patches:
- Skeleton
- Add Rx/Tx support
- Add features, like MTU update or Promiscuous etc.. support

Quoted 13 lines

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

<...>

drivers/net/mrvl/mrvl_ethdev.c line 2273

Quoted 6 lines
drivers/net/mrvl/mrvl_ethdev.c new file +6 -0
+static struct rte_vdev_driver pmd_mrvl_drv = {
+	.probe = rte_pmd_mrvl_probe,
+	.remove = rte_pmd_mrvl_remove,
+};
+
+RTE_PMD_REGISTER_VDEV(net_mrvl, pmd_mrvl_drv);

Please help me understand.

This driver implemented as virtual driver, because:
With the help of custom kernel modules, musdk library already provides userspace datapath support. This PMD is an interface to musdk library. Is this correct?

If so, just thinking loud:
- Why not implement this PMD directly on top of kernel interface, removing musdk layer completely?
- How big problem that this PMD depends on custom kernel code?
- How library and custom kernel code delivered? For which platforms?

<....>

#20 lore raw

Re: [PATCH v3 2/4] net/mrvl: add mrvl net pmd driver

Quoted 25 lines · Ferruh Yigit
Quoted 15 lines · Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter

Quoted 8 lines

* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Quoted 5 lines

I have more detailed comments but in high level, what do you think splitting this patch into three patches:
- Skeleton
- Add Rx/Tx support
- Add features, like MTU update or Promiscuous etc.. support

If it's how submission process works then I think you left me with no other option than splitting driver into nice patchset :). On the other hand driver is really a wrapper to MUSDK library and thus quite easy to follow. What are the benefits of such 3-way split?

Quoted 26 lines
Quoted 14 lines

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

<...>

drivers/net/mrvl/mrvl_ethdev.c line 2273

Quoted 6 lines
drivers/net/mrvl/mrvl_ethdev.c new file +6 -0
+static struct rte_vdev_driver pmd_mrvl_drv = {
+	.probe = rte_pmd_mrvl_probe,
+	.remove = rte_pmd_mrvl_remove,
+};
+
+RTE_PMD_REGISTER_VDEV(net_mrvl, pmd_mrvl_drv);

Please help me understand.

Quoted 4 lines

This driver implemented as virtual driver, because:
With the help of custom kernel modules, musdk library already provides userspace datapath support. This PMD is an interface to musdk library. Is this correct?

That is right. Another reason this NIC is not PCI device.

Quoted 5 lines

If so, just thinking loud:
- Why not implement this PMD directly on top of kernel interface, removing musdk layer completely?
- How big problem that this PMD depends on custom kernel code?

I think the main reason is that MUSDK is already used in different projects. Keeping multiple codebases offering similar functionality would be quite demanding in terms of extra work needed.

Quoted 1 line

- How library and custom kernel code delivered? For which platforms?

Kernel and library sources are hosted on publicly available repository. Driver was tested on Armada 7k/8k SoCs.

Quoted 3 lines

<....>

--
- Tomasz Duszyński

#21 lore raw

Re: [PATCH v3 2/4] net/mrvl: add mrvl net pmd driver

Quoted 26 lines · Tomasz Duszynski
Quoted 25 lines · Ferruh Yigit
Quoted 23 lines · Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Quoted 7 lines
Quoted 5 lines

I have more detailed comments but in high level, what do you think splitting this patch into three patches:
- Skeleton
- Add Rx/Tx support
- Add features, like MTU update or Promiscuous etc.. support

If it's how submission process works then I think you left me with no other option than splitting driver into nice patchset :).

No, there is no defined submission process.

Quoted 3 lines

On the other
hand driver is really a wrapper to MUSDK library and thus quite easy to follow. What are the benefits of such 3-way split?

To help others review/understand your code. Big code chunks are scary and I believe most of details gets lost in big code chunks.

When someone from community wants to understand and update/improve/fix your code, to help them by logically split the code that their focus can go into more narrow part.

But this also means some effort in your side, so some kind of balance is required.

I think splitting patch into smaller logical part is helpful for others, what do you think, is it too much effort?

Quoted 26 lines
Quoted 26 lines
Quoted 14 lines

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

<...>

drivers/net/mrvl/mrvl_ethdev.c line 2273

Quoted 6 lines
drivers/net/mrvl/mrvl_ethdev.c new file +6 -0
+static struct rte_vdev_driver pmd_mrvl_drv = {
+	.probe = rte_pmd_mrvl_probe,
+	.remove = rte_pmd_mrvl_remove,
+};
+
+RTE_PMD_REGISTER_VDEV(net_mrvl, pmd_mrvl_drv);

Please help me understand.

Quoted 5 lines
Quoted 4 lines

This driver implemented as virtual driver, because:
With the help of custom kernel modules, musdk library already provides userspace datapath support. This PMD is an interface to musdk library. Is this correct?

That is right. Another reason this NIC is not PCI device.

We support more bus now :). Out of curiosity, which bus is device on?

Quoted 10 lines
Quoted 5 lines

If so, just thinking loud:
- Why not implement this PMD directly on top of kernel interface, removing musdk layer completely?
- How big problem that this PMD depends on custom kernel code?

I think the main reason is that MUSDK is already used in different projects. Keeping multiple codebases offering similar functionality would be quite demanding in terms of extra work needed.

Quoted 1 line

- How library and custom kernel code delivered? For which platforms?

Kernel and library sources are hosted on publicly available repository.

I guess it would be nice to highlight custom kernel with external patches is required. This is not mentioned in "Prerequisites" section of the document.

Quoted 1 line

Driver was tested on Armada 7k/8k SoCs.

Can you please provide link to the HW mentioned in documentation?

Quoted 7 lines
Quoted 3 lines

<....>

--
- Tomasz Duszyński

#22 lore raw

Re: [PATCH v3 2/4] net/mrvl: add mrvl net pmd driver

Quoted 48 lines · Ferruh Yigit
Quoted 26 lines · Tomasz Duszynski
Quoted 25 lines · Ferruh Yigit
Quoted 23 lines · Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Quoted 7 lines
Quoted 5 lines

I have more detailed comments but in high level, what do you think splitting this patch into three patches:
- Skeleton
- Add Rx/Tx support
- Add features, like MTU update or Promiscuous etc.. support

If it's how submission process works then I think you left me with no other option than splitting driver into nice patchset :).

No, there is no defined submission process.

Quoted 3 lines

On the other
hand driver is really a wrapper to MUSDK library and thus quite easy to follow. What are the benefits of such 3-way split?

To help others review/understand your code. Big code chunks are scary and I believe most of details gets lost in big code chunks.

When someone from community wants to understand and update/improve/fix your code, to help them by logically split the code that their focus can go into more narrow part.

Quoted 6 lines

But this also means some effort in your side, so some kind of balance is required.

I think splitting patch into smaller logical part is helpful for others, what do you think, is it too much effort?

Fair enough. I'll split the driver as suggested. A few specific questions about functionality each patch should contain though.

As for skeleton, I see others just put driver probing here.

As for Rx/Tx support it seems that there's no common pattern. Functionality like starting/stopping device, queues configuration and all the other things related to Rx/Tx should be here as well?

What's left are features which go into features-patch.

Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 14 lines

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

<...>

drivers/net/mrvl/mrvl_ethdev.c line 2273

Quoted 6 lines
drivers/net/mrvl/mrvl_ethdev.c new file +6 -0
+static struct rte_vdev_driver pmd_mrvl_drv = {
+	.probe = rte_pmd_mrvl_probe,
+	.remove = rte_pmd_mrvl_remove,
+};
+
+RTE_PMD_REGISTER_VDEV(net_mrvl, pmd_mrvl_drv);

Please help me understand.

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines

This driver implemented as virtual driver, because:
With the help of custom kernel modules, musdk library already provides userspace datapath support. This PMD is an interface to musdk library. Is this correct?

That is right. Another reason this NIC is not PCI device.

We support more bus now :). Out of curiosity, which bus is device on?

Bus is called Aurora2. That's proprietary SoC interconnect fabric.

Quoted 9 lines
Quoted 9 lines
Quoted 6 lines

If so, just thinking loud:
- Why not implement this PMD directly on top of kernel interface, removing musdk layer completely?
- How big problem that this PMD depends on custom kernel code?

I think the main reason is that MUSDK is already used in different projects. Keeping multiple codebases offering similar functionality would be quite demanding in terms of extra work needed.

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

- How library and custom kernel code delivered? For which platforms?

Kernel and library sources are hosted on publicly available repository.

I guess it would be nice to highlight custom kernel with external patches is required. This is not mentioned in "Prerequisites" section of the document.

ACK

Quoted 4 lines
Quoted 1 line

Driver was tested on Armada 7k/8k SoCs.

Can you please provide link to the HW mentioned in documentation?

You can find some info here:

https://www.marvell.com/embedded-processors/armada-70xx/
https://www.marvell.com/embedded-processors/armada-80xx/

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

<....>

--
- Tomasz Duszyński

--
- Tomasz Duszyński

#23 lore raw

Re: [PATCH v3 2/4] net/mrvl: add mrvl net pmd driver

Quoted 56 lines · Tomasz Duszynski
Quoted 48 lines · Ferruh Yigit
Quoted 26 lines · Tomasz Duszynski
Quoted 25 lines · Ferruh Yigit
Quoted 23 lines · Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Quoted 7 lines
Quoted 5 lines

I have more detailed comments but in high level, what do you think splitting this patch into three patches:
- Skeleton
- Add Rx/Tx support
- Add features, like MTU update or Promiscuous etc.. support

If it's how submission process works then I think you left me with no other option than splitting driver into nice patchset :).

No, there is no defined submission process.

Quoted 3 lines

On the other
hand driver is really a wrapper to MUSDK library and thus quite easy to follow. What are the benefits of such 3-way split?

To help others review/understand your code. Big code chunks are scary and I believe most of details gets lost in big code chunks.

When someone from community wants to understand and update/improve/fix your code, to help them by logically split the code that their focus can go into more narrow part.

Quoted 6 lines

But this also means some effort in your side, so some kind of balance is required.

I think splitting patch into smaller logical part is helpful for others, what do you think, is it too much effort?

Quoted 8 lines

Fair enough. I'll split the driver as suggested. A few specific questions about functionality each patch should contain though.

As for skeleton, I see others just put driver probing here.

As for Rx/Tx support it seems that there's no common pattern. Functionality like starting/stopping device, queues configuration and all the other things related to Rx/Tx should be here as well?

As you said there is no common pattern, but I think starting/stopping device, queues configuration can go into skeleton and mainly Rx/Tx burst functions can go into Rx/Tx patch.
But please what you think more reasonable matters here.

Quoted 2 lines

What's left are features which go into features-patch.

Yes.
And the .ini file, currently part of doc patch, can be part of this features patch, it is helps more to see the code add feature and doc documents it in same patch.

Quoted 58 lines
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 15 lines

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

<...>

drivers/net/mrvl/mrvl_ethdev.c line 2273

Quoted 6 lines
drivers/net/mrvl/mrvl_ethdev.c new file +6 -0
+static struct rte_vdev_driver pmd_mrvl_drv = {
+	.probe = rte_pmd_mrvl_probe,
+	.remove = rte_pmd_mrvl_remove,
+};
+
+RTE_PMD_REGISTER_VDEV(net_mrvl, pmd_mrvl_drv);

Please help me understand.

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines

This driver implemented as virtual driver, because:
With the help of custom kernel modules, musdk library already provides userspace datapath support. This PMD is an interface to musdk library. Is this correct?

That is right. Another reason this NIC is not PCI device.

We support more bus now :). Out of curiosity, which bus is device on?

Bus is called Aurora2. That's proprietary SoC interconnect fabric.

Quoted 9 lines
Quoted 9 lines
Quoted 6 lines

If so, just thinking loud:
- Why not implement this PMD directly on top of kernel interface, removing musdk layer completely?
- How big problem that this PMD depends on custom kernel code?

I think the main reason is that MUSDK is already used in different projects. Keeping multiple codebases offering similar functionality would be quite demanding in terms of extra work needed.

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

- How library and custom kernel code delivered? For which platforms?

Kernel and library sources are hosted on publicly available repository.

I guess it would be nice to highlight custom kernel with external patches is required. This is not mentioned in "Prerequisites" section of the document.

ACK

Quoted 2 lines
Quoted 1 line

Driver was tested on Armada 7k/8k SoCs.

Quoted 7 lines
Quoted 2 lines

Can you please provide link to the HW mentioned in documentation?

You can find some info here:

https://www.marvell.com/embedded-processors/armada-70xx/
https://www.marvell.com/embedded-processors/armada-80xx/

Thanks, would you mind putting these links into driver documentation as well?

Quoted 13 lines
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines

<....>

--
- Tomasz Duszyński

--
- Tomasz Duszyński

#24 lore raw

Re: [PATCH v3 2/4] net/mrvl: add mrvl net pmd driver

Quoted 62 lines · Ferruh Yigit
Quoted 61 lines · Tomasz Duszynski
Quoted 48 lines · Ferruh Yigit
Quoted 26 lines · Tomasz Duszynski
Quoted 25 lines · Ferruh Yigit
Quoted 23 lines · Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Quoted 7 lines
Quoted 5 lines

I have more detailed comments but in high level, what do you think splitting this patch into three patches:
- Skeleton
- Add Rx/Tx support
- Add features, like MTU update or Promiscuous etc.. support

If it's how submission process works then I think you left me with no other option than splitting driver into nice patchset :).

No, there is no defined submission process.

Quoted 3 lines

On the other
hand driver is really a wrapper to MUSDK library and thus quite easy to follow. What are the benefits of such 3-way split?

To help others review/understand your code. Big code chunks are scary and I believe most of details gets lost in big code chunks.

When someone from community wants to understand and update/improve/fix your code, to help them by logically split the code that their focus can go into more narrow part.

Quoted 6 lines

But this also means some effort in your side, so some kind of balance is required.

I think splitting patch into smaller logical part is helpful for others, what do you think, is it too much effort?

Fair enough. I'll split the driver as suggested. A few specific questions about functionality each patch should contain though.

As for skeleton, I see others just put driver probing here.

Quoted 9 lines
Quoted 3 lines

As for Rx/Tx support it seems that there's no common pattern. Functionality like starting/stopping device, queues configuration and all the other things related to Rx/Tx should be here as well?

As you said there is no common pattern, but I think starting/stopping device, queues configuration can go into skeleton and mainly Rx/Tx burst functions can go into Rx/Tx patch.
But please what you think more reasonable matters here.

ACK

Quoted 8 lines
Quoted 2 lines

What's left are features which go into features-patch.

Yes.
And the .ini file, currently part of doc patch, can be part of this features patch, it is helps more to see the code add feature and doc documents it in same patch.

ACK

Quoted 61 lines
Quoted 61 lines
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 15 lines

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

<...>

drivers/net/mrvl/mrvl_ethdev.c line 2273

Quoted 6 lines
drivers/net/mrvl/mrvl_ethdev.c new file +6 -0
+static struct rte_vdev_driver pmd_mrvl_drv = {
+	.probe = rte_pmd_mrvl_probe,
+	.remove = rte_pmd_mrvl_remove,
+};
+
+RTE_PMD_REGISTER_VDEV(net_mrvl, pmd_mrvl_drv);

Please help me understand.

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines

This driver implemented as virtual driver, because:
With the help of custom kernel modules, musdk library already provides userspace datapath support. This PMD is an interface to musdk library. Is this correct?

That is right. Another reason this NIC is not PCI device.

We support more bus now :). Out of curiosity, which bus is device on?

Bus is called Aurora2. That's proprietary SoC interconnect fabric.

Quoted 9 lines
Quoted 9 lines
Quoted 6 lines

If so, just thinking loud:
- Why not implement this PMD directly on top of kernel interface, removing musdk layer completely?
- How big problem that this PMD depends on custom kernel code?

I think the main reason is that MUSDK is already used in different projects. Keeping multiple codebases offering similar functionality would be quite demanding in terms of extra work needed.

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

- How library and custom kernel code delivered? For which platforms?

Kernel and library sources are hosted on publicly available repository.

I guess it would be nice to highlight custom kernel with external patches is required. This is not mentioned in "Prerequisites" section of the document.

ACK

Quoted 4 lines
Quoted 1 line

Driver was tested on Armada 7k/8k SoCs.

Can you please provide link to the HW mentioned in documentation?

Quoted 7 lines
Quoted 4 lines

You can find some info here:

https://www.marvell.com/embedded-processors/armada-70xx/
https://www.marvell.com/embedded-processors/armada-80xx/

Thanks, would you mind putting these links into driver documentation as well?

ACK

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

<....>

Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

--
- Tomasz Duszyński

--
- Tomasz Duszyński

--
- Tomasz Duszyński

#25 lore raw

Re: [PATCH v3 2/4] net/mrvl: add mrvl net pmd driver

In reply to Tomasz Duszynski

05/10/2017 10:43, Tomasz Duszynski:

Quoted 7 lines · Ferruh Yigit
Quoted 6 lines · Tomasz Duszynski
Quoted 5 lines · Ferruh Yigit
Quoted 4 lines · Tomasz Duszynski
Quoted 3 lines

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

[...]

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

drivers/net/mrvl/mrvl_ethdev.c line 2273

Quoted 6 lines
drivers/net/mrvl/mrvl_ethdev.c new file +6 -0
+static struct rte_vdev_driver pmd_mrvl_drv = {
+	.probe = rte_pmd_mrvl_probe,
+	.remove = rte_pmd_mrvl_remove,
+};
+
+RTE_PMD_REGISTER_VDEV(net_mrvl, pmd_mrvl_drv);

Please help me understand.

This driver implemented as virtual driver, because:
With the help of custom kernel modules, musdk library already provides userspace datapath support. This PMD is an interface to musdk library. Is this correct?

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

That is right. Another reason this NIC is not PCI device.

We support more bus now :). Out of curiosity, which bus is device on?

Bus is called Aurora2. That's proprietary SoC interconnect fabric.

So you should provide drivers/bus/aurora2/.
It would do a software scan of devices (probably looking in sysfs). Then the probe function is nearly the same as with vdev init. It could provide a better user experience by removing the need of explicit declaration of devices. It will allow to be integrated in a more generic whitelist/blacklist mechanism.
And having such well defined bus code and objects will probably help in your future developments.

#26 lore raw

Re: [PATCH v3 2/4] net/mrvl: add mrvl net pmd driver

In reply to Tomasz Duszynski
Quoted 36 lines · Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

<...>

config/common_base CONFIG_RTE_LIBRTE_NFP_PMD=n · line 269

Quoted 10 lines

+++ b/config/common_base

config/common_base +5 -0
@@ -262,6 +262,13 @@ CONFIG_RTE_LIBRTE_NFP_PMD=n
 CONFIG_RTE_LIBRTE_NFP_DEBUG=n
 
 #
+# Compile Marvell PMD driver
+#
+CONFIG_RTE_LIBRTE_MRVL_PMD=n
+CONFIG_RTE_LIBRTE_MRVL_DEBUG=n
+CONFIG_RTE_MRVL_MUSDK_DMA_MEMSIZE=41943040

Is dma memsize needs to be a configuration option?

<...>

drivers/net/mrvl/Makefile line 36

Quoted 6 lines
drivers/net/mrvl/Makefile new file +6 -0
+include $(RTE_SDK)/mk/rte.vars.mk
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),config)
+ifeq ($(LIBMUSDK_PATH),)
+$(error "Please define LIBMUSDK_PATH environment variable")

Not sure how to resolve this dependency.
What do you think adding this as configuration option?

Or DPDK just adds the -lmusdk external dependency and while compiling for marvel EXTRA_LDFLAGS parameter should be pass with "-L$(LIBMUSDK_PATH)" and this can be documented in marvel doc. What do you think?

drivers/net/mrvl/Makefile line 39

Quoted 3 lines
drivers/net/mrvl/Makefile new file +3 -0
+endif
+ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),n)
+$(error "RTE_LIBRTE_CFGFILE must be enabled in configuration!")

This can be also handled in drivers/net/Makefile, it can be possible to add check there for LIBRTE_CFGFILE dependency.

Quoted 10 lines
drivers/net/mrvl/Makefile new file +10 -0
+endif
+endif
+endif
+
+# library name
+LIB = librte_pmd_mrvl.a
+
+# library version
+LIBABIVER := 1
+

drivers/net/mrvl/Makefile line 59

Quoted 10 lines
drivers/net/mrvl/Makefile new file +10 -0
+# versioning export map
+EXPORT_MAP := rte_pmd_mrvl_version.map
+
+# external library dependencies
+CFLAGS += -I$(LIBMUSDK_PATH)/include
+CFLAGS += -DMVCONF_ARCH_DMA_ADDR_T_64BIT
+CFLAGS += -DCONF_PP2_BPOOL_COOKIE_SIZE=32
+CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -O3
+LDLIBS += -L$(LIBMUSDK_PATH)/lib

This can be LDFLAGS instead of LDLIBS

drivers/net/mrvl/Makefile line 67

Quoted 8 lines
drivers/net/mrvl/Makefile new file +8 -0
+LDLIBS += -lmusdk
+
+# library source files
+SRCS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += mrvl_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += mrvl_qos.c
+
+# library dependencies
+DEPDIRS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += lib/librte_cfgfile

These variables no more used, you can drop this. drivers/net/Makefile used for this, you are already updating that file, librte_cfgfile needs to be added there.

Quoted 2 lines
(quoted diff) +2 -0
+
+include $(RTE_SDK)/mk/rte.lib.mk

<...>

Quoted 10 lines

+/*
+ * To use buffer harvesting based on loopback port shadow queue structure
+ * was introduced for buffers information bookkeeping.
+ *
+ * Before sending the packet, related buffer information (pp2_buff_inf) is
+ * stored in shadow queue. After packet is transmitted no longer used
+ * packet buffer is released back to it's original hardware pool,
+ * on condition it originated from interface.
+ * In case it was generated by application itself i.e: mbuf->port field is
+ * 0xff then its released to software mempool.

You already explained here but can you please give more details why shadow queue needed?

Quoted 26 lines

+ */

drivers/net/mrvl/mrvl_ethdev.c new file +25 -0
+struct mrvl_shadow_txq {
+	int head;           /* write index - used when sending buffers */
+	int tail;           /* read index - used when releasing buffers */
+	u16 size;           /* queue occupied size */
+	u16 num_to_release; /* number of buffers sent, that can be released */
+	struct buff_release_entry ent[MRVL_PP2_TX_SHADOWQ_SIZE]; /* q entries */
+};
+
+struct mrvl_rxq {
+	struct mrvl_priv *priv;
+	struct rte_mempool *mp;
+	int queue_id;
+	int port_id;
+	int cksum_enabled;
+	uint64_t bytes_recv;
+	uint64_t drop_mac;
+};
+
+struct mrvl_txq {
+	struct mrvl_priv *priv;
+	int queue_id;
+	int port_id;
+	uint64_t bytes_sent;
+};
+

<...>

drivers/net/mrvl/mrvl_ethdev.c line 412

Quoted 10 lines
drivers/net/mrvl/mrvl_ethdev.c new file +10 -0
+static int
+mrvl_dev_start(struct rte_eth_dev *dev)
+{
+	struct mrvl_priv *priv = dev->data->dev_private;
+	char match[MRVL_MATCH_LEN];
+	int ret;
+
+	snprintf(match, sizeof(match), "ppio-%d:%d",
+		 priv->pp_id, priv->ppio_id);
+	priv->ppio_params.match = match;

Why this match is used, just a reminder that match is only valid for the scope of this function, after this function it will be invalid.

<...>

drivers/net/mrvl/mrvl_ethdev.c line 1615

Quoted 2 lines
drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+
+	if (rte_spinlock_trylock(&q->priv->lock) == 1) {

Why getting lock in Rx data path?

Quoted 34 lines
drivers/net/mrvl/mrvl_ethdev.c new file +34 -0
+		num = mrvl_get_bpool_size(bpool->pp2_id, bpool->id);
+
+		if (unlikely(num <= q->priv->bpool_min_size ||
+			     (!rx_done && num < q->priv->bpool_init_size))) {
+			ret = mrvl_fill_bpool(q, MRVL_BURST_SIZE);
+			if (ret)
+				RTE_LOG(ERR, PMD, "Failed to fill bpool\n");
+		} else if (unlikely(num > q->priv->bpool_max_size)) {
+			int i;
+			int pkt_to_remove = num - q->priv->bpool_init_size;
+			struct rte_mbuf *mbuf;
+			struct pp2_buff_inf buff;
+
+			RTE_LOG(DEBUG, PMD,
+				"\nport-%d:%d: bpool %d oversize - remove %d buffers (pool size: %d -> %d)\n",
+				bpool->pp2_id, q->priv->ppio->port_id,
+				bpool->id, pkt_to_remove, num,
+				q->priv->bpool_init_size);
+
+			for (i = 0; i < pkt_to_remove; i++) {
+				pp2_bpool_get_buff(hifs[core_id], bpool, &buff);
+				mbuf = (struct rte_mbuf *)
+					(cookie_addr_high | buff.cookie);
+				rte_pktmbuf_free(mbuf);
+			}
+			mrvl_port_bpool_size
+				[bpool->pp2_id][bpool->id][core_id] -=
+								pkt_to_remove;
+		}
+		rte_spinlock_unlock(&q->priv->lock);
+	}
+
+	return rx_done;
+}

<...>

drivers/net/mrvl/mrvl_ethdev.c line 2179

Quoted 7 lines
drivers/net/mrvl/mrvl_ethdev.c new file +7 -0
+	cfgnum = rte_kvargs_count(kvlist, MRVL_CFG_ARG);
+	if (cfgnum > 1) {
+		RTE_LOG(ERR, PMD, "Cannot handle more than one config file!\n");
+		goto out_free_kvlist;
+	} else if (cfgnum == 1) {
+		rte_kvargs_process(kvlist, MRVL_CFG_ARG,
+				   mrvl_get_qoscfg, &mrvl_qos_cfg);

Is the expected format/contect of the config file documented? How one can know how to create a config file?

Quoted 13 lines
drivers/net/mrvl/mrvl_ethdev.c new file +13 -0
+	}
+
+	/*
+	 * ret == -EEXIST is correct, it means DMA
+	 * has been already initialized (by another PMD).
+	 */
+	ret = mv_sys_dma_mem_init(RTE_MRVL_MUSDK_DMA_MEMSIZE);
+	if (ret < 0 && ret != -EEXIST)
+		goto out_free_kvlist;
+
+	ret = mrvl_init_pp2();
+	if (ret) {
+		RTE_LOG(ERR, PMD, "Failed to init PP!\n");

drivers/net/mrvl/mrvl_ethdev.c line 2202

Quoted 10 lines
drivers/net/mrvl/mrvl_ethdev.c new file +10 -0
+		goto out_deinit_dma;
+	}
+
+	ret = mrvl_init_hifs();
+	if (ret)
+		goto out_deinit_hifs;
+
+	for (i = 0; i < ifnum; i++) {
+		RTE_LOG(INFO, PMD, "Creating %s\n", ifnames[i]);
+		ret = mrvl_eth_dev_create(vdev, ifnames[i]);

So you are supporting multiple ethdev devices created by single vdev device, by providing multiple "iface" argument in device args.

This will cause eal create single virtual device but driver create multiple ethdev devices. I don't see direct problem with this but lets think about it.
This can be problem if you want to provide ethdev specific device arguments. Perhaps that is why you need to provide a config file ?

It can be an option to define each ethdev with:
"--vdev net_mrvl0,iface=xx0,config=yy0 --vdev
net_mrlv1,iface=xx1,config=yy1 ..."

This may remove your dependecy to librte_cfgfile.

drivers/net/mrvl/mrvl_ethdev.c line 2215

Quoted 13 lines
drivers/net/mrvl/mrvl_ethdev.c new file +13 -0
+		if (ret)
+			goto out_cleanup;
+	}
+
+	rte_kvargs_free(kvlist);
+
+	memset(mrvl_port_bpool_size, 0, sizeof(mrvl_port_bpool_size));
+
+	mrvl_lcore_first = RTE_MAX_LCORE;
+	mrvl_lcore_last = 0;
+
+	RTE_LCORE_FOREACH(core_id) {
+		mrvl_set_first_last_cores(core_id);

This sets limits of core_id. Why you need to know this in PMD level?

<...>

#27 lore raw

Re: [PATCH v3 2/4] net/mrvl: add mrvl net pmd driver

Quoted 44 lines · Ferruh Yigit
Quoted 36 lines · Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

<...>

Quoted 4 lines

+++ b/config/common_base

config/common_base +0 -0
@@ -262,6 +262,13 @@ CONFIG_RTE_LIBRTE_NFP_PMD=n
 CONFIG_RTE_LIBRTE_NFP_DEBUG=n
 
Quoted 8 lines

config/common_base CONFIG_RTE_LIBRTE_NFP_PMD=n · line 269

Quoted 6 lines
config/common_base +5 -0
 #
+# Compile Marvell PMD driver
+#
+CONFIG_RTE_LIBRTE_MRVL_PMD=n
+CONFIG_RTE_LIBRTE_MRVL_DEBUG=n
+CONFIG_RTE_MRVL_MUSDK_DMA_MEMSIZE=41943040

Is dma memsize needs to be a configuration option?

That config option is used both by NET and CRYPTO drivers. In case NET and CRYPTO are used together i.e ipsec-secgw then DMA_MEMSIZE must be the set to the same size. Putting this configuration option in .config makes sure DMA_MEMSIZE stays synchronized.

Quoted 12 lines

<...>

drivers/net/mrvl/Makefile line 36

Quoted 6 lines
drivers/net/mrvl/Makefile new file +6 -0
+include $(RTE_SDK)/mk/rte.vars.mk
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),config)
+ifeq ($(LIBMUSDK_PATH),)
+$(error "Please define LIBMUSDK_PATH environment variable")

Not sure how to resolve this dependency.
What do you think adding this as configuration option?

All other drivers with external dependencies follow the same approach.

Quoted 5 lines

Or DPDK just adds the -lmusdk external dependency and while compiling for marvel EXTRA_LDFLAGS parameter should be pass with "-L$(LIBMUSDK_PATH)" and this can be documented in marvel doc. What do you think?

Both solutions are reasonable. The former was chosen because that's what the other drivers do.

Quoted 8 lines

drivers/net/mrvl/Makefile line 39

Quoted 4 lines
drivers/net/mrvl/Makefile new file +3 -0
+endif
+ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),n)
+$(error "RTE_LIBRTE_CFGFILE must be enabled in configuration!")

This can be also handled in drivers/net/Makefile, it can be possible to add check there for LIBRTE_CFGFILE dependency.

ACK

Quoted 14 lines
Quoted 14 lines
drivers/net/mrvl/Makefile new file +14 -0
+endif
+endif
+endif
+
+# library name
+LIB = librte_pmd_mrvl.a
+
+# library version
+LIBABIVER := 1
+
+# versioning export map
+EXPORT_MAP := rte_pmd_mrvl_version.map
+
+# external library dependencies
Quoted 8 lines

drivers/net/mrvl/Makefile line 59

Quoted 6 lines
drivers/net/mrvl/Makefile new file +6 -0
+CFLAGS += -I$(LIBMUSDK_PATH)/include
+CFLAGS += -DMVCONF_ARCH_DMA_ADDR_T_64BIT
+CFLAGS += -DCONF_PP2_BPOOL_COOKIE_SIZE=32
+CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -O3
+LDLIBS += -L$(LIBMUSDK_PATH)/lib

This can be LDFLAGS instead of LDLIBS

Moving that to LDFLAGS will break compilation in case CONFIG_RTE_BUILD_SHARED_LIB is set as -L... does not show up on command line thus linker does not know where to look extra library up. I may be wrong but it looks as if specifying LDFLAGS in driver's Makefile is no-op.

On the other hand, if we are building static libraries both -lmusdk and -L$(LIBMUSDK_PATH)/lib are added to specific _LDLIBS which in turn ends up in LDLIBS.

Quoted 14 lines

drivers/net/mrvl/Makefile line 67

Quoted 9 lines
drivers/net/mrvl/Makefile new file +8 -0
+LDLIBS += -lmusdk
+
+# library source files
+SRCS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += mrvl_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += mrvl_qos.c
+
+# library dependencies
+DEPDIRS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += lib/librte_cfgfile

These variables no more used, you can drop this. drivers/net/Makefile used for this, you are already updating that file, librte_cfgfile needs to be added there.

ACK

Quoted 16 lines
Quoted 2 lines
(quoted diff) +2 -0
+
+include $(RTE_SDK)/mk/rte.lib.mk

<...>

Quoted 10 lines

+/*
+ * To use buffer harvesting based on loopback port shadow queue structure
+ * was introduced for buffers information bookkeeping.
+ *
+ * Before sending the packet, related buffer information (pp2_buff_inf) is
+ * stored in shadow queue. After packet is transmitted no longer used
+ * packet buffer is released back to it's original hardware pool,
+ * on condition it originated from interface.
+ * In case it was generated by application itself i.e: mbuf->port field is
+ * 0xff then its released to software mempool.

Quoted 2 lines

You already explained here but can you please give more details why shadow queue needed?

It's used for mbuf harvesting in tx-path. Instead of releasing pushed out mbuf to mempool and allocating it once again later on, mbuf is stored in the shadow queue and returned back to hardware buffer manager after being sent.

Quoted 30 lines
Quoted 27 lines

+ */

drivers/net/mrvl/mrvl_ethdev.c new file +25 -0
+struct mrvl_shadow_txq {
+	int head;           /* write index - used when sending buffers */
+	int tail;           /* read index - used when releasing buffers */
+	u16 size;           /* queue occupied size */
+	u16 num_to_release; /* number of buffers sent, that can be released */
+	struct buff_release_entry ent[MRVL_PP2_TX_SHADOWQ_SIZE]; /* q entries */
+};
+
+struct mrvl_rxq {
+	struct mrvl_priv *priv;
+	struct rte_mempool *mp;
+	int queue_id;
+	int port_id;
+	int cksum_enabled;
+	uint64_t bytes_recv;
+	uint64_t drop_mac;
+};
+
+struct mrvl_txq {
+	struct mrvl_priv *priv;
+	int queue_id;
+	int port_id;
+	uint64_t bytes_sent;
+};
+

<...>

Quoted 14 lines

drivers/net/mrvl/mrvl_ethdev.c line 412

Quoted 10 lines
drivers/net/mrvl/mrvl_ethdev.c new file +10 -0
+static int
+mrvl_dev_start(struct rte_eth_dev *dev)
+{
+	struct mrvl_priv *priv = dev->data->dev_private;
+	char match[MRVL_MATCH_LEN];
+	int ret;
+
+	snprintf(match, sizeof(match), "ppio-%d:%d",
+		 priv->pp_id, priv->ppio_id);
+	priv->ppio_params.match = match;

Why this match is used, just a reminder that match is only valid for the scope of this function, after this function it will be invalid.

Keeping match locally is fine. That's used to tell MUSDK which physical port to configure, i.e ppio-0:1 means to configure port 1 on packet processor 0. Armada 8k has to such packet processor, while armada 7k only one.

Quoted 7 lines

<...>

drivers/net/mrvl/mrvl_ethdev.c line 1615

Quoted 2 lines
drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+
+	if (rte_spinlock_trylock(&q->priv->lock) == 1) {

Why getting lock in Rx data path?

In multi-core and multi-queue case some kind of protection is necessary so that several cores cannot modify bpool at the same time.

Quoted 37 lines
Quoted 34 lines
drivers/net/mrvl/mrvl_ethdev.c new file +34 -0
+		num = mrvl_get_bpool_size(bpool->pp2_id, bpool->id);
+
+		if (unlikely(num <= q->priv->bpool_min_size ||
+			     (!rx_done && num < q->priv->bpool_init_size))) {
+			ret = mrvl_fill_bpool(q, MRVL_BURST_SIZE);
+			if (ret)
+				RTE_LOG(ERR, PMD, "Failed to fill bpool\n");
+		} else if (unlikely(num > q->priv->bpool_max_size)) {
+			int i;
+			int pkt_to_remove = num - q->priv->bpool_init_size;
+			struct rte_mbuf *mbuf;
+			struct pp2_buff_inf buff;
+
+			RTE_LOG(DEBUG, PMD,
+				"\nport-%d:%d: bpool %d oversize - remove %d buffers (pool size: %d -> %d)\n",
+				bpool->pp2_id, q->priv->ppio->port_id,
+				bpool->id, pkt_to_remove, num,
+				q->priv->bpool_init_size);
+
+			for (i = 0; i < pkt_to_remove; i++) {
+				pp2_bpool_get_buff(hifs[core_id], bpool, &buff);
+				mbuf = (struct rte_mbuf *)
+					(cookie_addr_high | buff.cookie);
+				rte_pktmbuf_free(mbuf);
+			}
+			mrvl_port_bpool_size
+				[bpool->pp2_id][bpool->id][core_id] -=
+								pkt_to_remove;
+		}
+		rte_spinlock_unlock(&q->priv->lock);
+	}
+
+	return rx_done;
+}

<...>

Quoted 11 lines

drivers/net/mrvl/mrvl_ethdev.c line 2179

Quoted 7 lines
drivers/net/mrvl/mrvl_ethdev.c new file +7 -0
+	cfgnum = rte_kvargs_count(kvlist, MRVL_CFG_ARG);
+	if (cfgnum > 1) {
+		RTE_LOG(ERR, PMD, "Cannot handle more than one config file!\n");
+		goto out_free_kvlist;
+	} else if (cfgnum == 1) {
+		rte_kvargs_process(kvlist, MRVL_CFG_ARG,
+				   mrvl_get_qoscfg, &mrvl_qos_cfg);

Is the expected format/contect of the config file documented? How one can know how to create a config file?

Right, documentation is missing for that. Will add in v4.

Quoted 33 lines
Quoted 13 lines
drivers/net/mrvl/mrvl_ethdev.c new file +13 -0
+	}
+
+	/*
+	 * ret == -EEXIST is correct, it means DMA
+	 * has been already initialized (by another PMD).
+	 */
+	ret = mv_sys_dma_mem_init(RTE_MRVL_MUSDK_DMA_MEMSIZE);
+	if (ret < 0 && ret != -EEXIST)
+		goto out_free_kvlist;
+
+	ret = mrvl_init_pp2();
+	if (ret) {
+		RTE_LOG(ERR, PMD, "Failed to init PP!\n");

drivers/net/mrvl/mrvl_ethdev.c line 2202

Quoted 10 lines
drivers/net/mrvl/mrvl_ethdev.c new file +10 -0
+		goto out_deinit_dma;
+	}
+
+	ret = mrvl_init_hifs();
+	if (ret)
+		goto out_deinit_hifs;
+
+	for (i = 0; i < ifnum; i++) {
+		RTE_LOG(INFO, PMD, "Creating %s\n", ifnames[i]);
+		ret = mrvl_eth_dev_create(vdev, ifnames[i]);

So you are supporting multiple ethdev devices created by single vdev device, by providing multiple "iface" argument in device args.

This will cause eal create single virtual device but driver create multiple ethdev devices. I don't see direct problem with this but lets think about it.
This can be problem if you want to provide ethdev specific device arguments. Perhaps that is why you need to provide a config file ?

Quoted 6 lines

It can be an option to define each ethdev with:
"--vdev net_mrvl0,iface=xx0,config=yy0 --vdev
net_mrlv1,iface=xx1,config=yy1 ..."

This may remove your dependecy to librte_cfgfile.

Currently there's not need to passing separate options to each created device. As for configuration file it handles all devices at once.

Quoted 7 lines
Quoted 7 lines
drivers/net/mrvl/mrvl_ethdev.c new file +7 -0
+		if (ret)
+			goto out_cleanup;
+	}
+
+	rte_kvargs_free(kvlist);
+
+	memset(mrvl_port_bpool_size, 0, sizeof(mrvl_port_bpool_size));
Quoted 8 lines

drivers/net/mrvl/mrvl_ethdev.c line 2215

Quoted 6 lines
drivers/net/mrvl/mrvl_ethdev.c new file +6 -0
+
+	mrvl_lcore_first = RTE_MAX_LCORE;
+	mrvl_lcore_last = 0;
+
+	RTE_LCORE_FOREACH(core_id) {
+		mrvl_set_first_last_cores(core_id);

This sets limits of core_id. Why you need to know this in PMD level?

It's just to limit number of entries in mrvl_port_bpool_size we iterate over every time we want to count the total number of buffers in the hardware buffer pool.

Quoted 3 lines

<...>

--
- Tomasz Duszyński

#28 lore raw

Re: [PATCH v3 2/4] net/mrvl: add mrvl net pmd driver

Quoted 54 lines · Tomasz Duszynski
Quoted 44 lines · Ferruh Yigit
Quoted 36 lines · Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

<...>

Quoted 4 lines

+++ b/config/common_base

config/common_base +0 -0
@@ -262,6 +262,13 @@ CONFIG_RTE_LIBRTE_NFP_PMD=n
 CONFIG_RTE_LIBRTE_NFP_DEBUG=n
 
Quoted 8 lines

config/common_base CONFIG_RTE_LIBRTE_NFP_PMD=n · line 269

Quoted 6 lines
config/common_base +5 -0
 #
+# Compile Marvell PMD driver
+#
+CONFIG_RTE_LIBRTE_MRVL_PMD=n
+CONFIG_RTE_LIBRTE_MRVL_DEBUG=n
+CONFIG_RTE_MRVL_MUSDK_DMA_MEMSIZE=41943040

Is dma memsize needs to be a configuration option?

Quoted 4 lines

That config option is used both by NET and CRYPTO drivers. In case NET and CRYPTO are used together i.e ipsec-secgw then DMA_MEMSIZE must be the set to the same size. Putting this configuration option in .config makes sure DMA_MEMSIZE stays synchronized.

OK.

Quoted 17 lines
Quoted 4 lines

<...>

Quoted 9 lines

drivers/net/mrvl/Makefile line 36

Quoted 6 lines
drivers/net/mrvl/Makefile new file +6 -0
+include $(RTE_SDK)/mk/rte.vars.mk
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),config)
+ifeq ($(LIBMUSDK_PATH),)
+$(error "Please define LIBMUSDK_PATH environment variable")

Not sure how to resolve this dependency.
What do you think adding this as configuration option?

All other drivers with external dependencies follow the same approach.

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

Or DPDK just adds the -lmusdk external dependency and while compiling for marvel EXTRA_LDFLAGS parameter should be pass with "-L$(LIBMUSDK_PATH)" and this can be documented in marvel doc. What do you think?

Both solutions are reasonable. The former was chosen because that's what the other drivers do.

OK.

Quoted 35 lines
Quoted 9 lines

drivers/net/mrvl/Makefile line 39

Quoted 5 lines
drivers/net/mrvl/Makefile new file +3 -0
+endif
+ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),n)
+$(error "RTE_LIBRTE_CFGFILE must be enabled in configuration!")

This can be also handled in drivers/net/Makefile, it can be possible to add check there for LIBRTE_CFGFILE dependency.

ACK

Quoted 14 lines
Quoted 14 lines
drivers/net/mrvl/Makefile new file +14 -0
+endif
+endif
+endif
+
+# library name
+LIB = librte_pmd_mrvl.a
+
+# library version
+LIBABIVER := 1
+
+# versioning export map
+EXPORT_MAP := rte_pmd_mrvl_version.map
+
+# external library dependencies
Quoted 8 lines

drivers/net/mrvl/Makefile line 59

Quoted 6 lines
drivers/net/mrvl/Makefile new file +6 -0
+CFLAGS += -I$(LIBMUSDK_PATH)/include
+CFLAGS += -DMVCONF_ARCH_DMA_ADDR_T_64BIT
+CFLAGS += -DCONF_PP2_BPOOL_COOKIE_SIZE=32
+CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -O3
+LDLIBS += -L$(LIBMUSDK_PATH)/lib

This can be LDFLAGS instead of LDLIBS

Quoted 5 lines

Moving that to LDFLAGS will break compilation in case CONFIG_RTE_BUILD_SHARED_LIB is set as -L... does not show up on command line thus linker does not know where to look extra library up. I may be wrong but it looks as if specifying LDFLAGS in driver's Makefile is no-op.

I would expect LDFLAGS will work, but if it is breaking the build, please keep as it is, we can check and fix this later.

Quoted 91 lines

On the other hand, if we are building static libraries both -lmusdk and -L$(LIBMUSDK_PATH)/lib are added to specific _LDLIBS which in turn ends up in LDLIBS.

Quoted 14 lines

drivers/net/mrvl/Makefile line 67

Quoted 9 lines
drivers/net/mrvl/Makefile new file +8 -0
+LDLIBS += -lmusdk
+
+# library source files
+SRCS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += mrvl_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += mrvl_qos.c
+
+# library dependencies
+DEPDIRS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += lib/librte_cfgfile

These variables no more used, you can drop this. drivers/net/Makefile used for this, you are already updating that file, librte_cfgfile needs to be added there.

ACK

Quoted 16 lines
Quoted 2 lines
(quoted diff) +2 -0
+
+include $(RTE_SDK)/mk/rte.lib.mk

<...>

Quoted 10 lines

+/*
+ * To use buffer harvesting based on loopback port shadow queue structure
+ * was introduced for buffers information bookkeeping.
+ *
+ * Before sending the packet, related buffer information (pp2_buff_inf) is
+ * stored in shadow queue. After packet is transmitted no longer used
+ * packet buffer is released back to it's original hardware pool,
+ * on condition it originated from interface.
+ * In case it was generated by application itself i.e: mbuf->port field is
+ * 0xff then its released to software mempool.

Quoted 2 lines

You already explained here but can you please give more details why shadow queue needed?

It's used for mbuf harvesting in tx-path. Instead of releasing pushed out mbuf to mempool and allocating it once again later on, mbuf is stored in the shadow queue and returned back to hardware buffer manager after being sent.

Quoted 30 lines
Quoted 27 lines

+ */

drivers/net/mrvl/mrvl_ethdev.c new file +25 -0
+struct mrvl_shadow_txq {
+	int head;           /* write index - used when sending buffers */
+	int tail;           /* read index - used when releasing buffers */
+	u16 size;           /* queue occupied size */
+	u16 num_to_release; /* number of buffers sent, that can be released */
+	struct buff_release_entry ent[MRVL_PP2_TX_SHADOWQ_SIZE]; /* q entries */
+};
+
+struct mrvl_rxq {
+	struct mrvl_priv *priv;
+	struct rte_mempool *mp;
+	int queue_id;
+	int port_id;
+	int cksum_enabled;
+	uint64_t bytes_recv;
+	uint64_t drop_mac;
+};
+
+struct mrvl_txq {
+	struct mrvl_priv *priv;
+	int queue_id;
+	int port_id;
+	uint64_t bytes_sent;
+};
+

<...>

Quoted 14 lines

drivers/net/mrvl/mrvl_ethdev.c line 412

Quoted 10 lines
drivers/net/mrvl/mrvl_ethdev.c new file +10 -0
+static int
+mrvl_dev_start(struct rte_eth_dev *dev)
+{
+	struct mrvl_priv *priv = dev->data->dev_private;
+	char match[MRVL_MATCH_LEN];
+	int ret;
+
+	snprintf(match, sizeof(match), "ppio-%d:%d",
+		 priv->pp_id, priv->ppio_id);
+	priv->ppio_params.match = match;

Why this match is used, just a reminder that match is only valid for the scope of this function, after this function it will be invalid.

Quoted 4 lines

Keeping match locally is fine. That's used to tell MUSDK which physical port to configure, i.e ppio-0:1 means to configure port 1 on packet processor 0. Armada 8k has to such packet processor, while armada 7k only one.

Ok, thanks for clarification.

Quoted 101 lines
Quoted 8 lines

<...>

drivers/net/mrvl/mrvl_ethdev.c line 1615

Quoted 2 lines
drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+
+	if (rte_spinlock_trylock(&q->priv->lock) == 1) {

Why getting lock in Rx data path?

In multi-core and multi-queue case some kind of protection is necessary so that several cores cannot modify bpool at the same time.

Quoted 37 lines
Quoted 34 lines
drivers/net/mrvl/mrvl_ethdev.c new file +34 -0
+		num = mrvl_get_bpool_size(bpool->pp2_id, bpool->id);
+
+		if (unlikely(num <= q->priv->bpool_min_size ||
+			     (!rx_done && num < q->priv->bpool_init_size))) {
+			ret = mrvl_fill_bpool(q, MRVL_BURST_SIZE);
+			if (ret)
+				RTE_LOG(ERR, PMD, "Failed to fill bpool\n");
+		} else if (unlikely(num > q->priv->bpool_max_size)) {
+			int i;
+			int pkt_to_remove = num - q->priv->bpool_init_size;
+			struct rte_mbuf *mbuf;
+			struct pp2_buff_inf buff;
+
+			RTE_LOG(DEBUG, PMD,
+				"\nport-%d:%d: bpool %d oversize - remove %d buffers (pool size: %d -> %d)\n",
+				bpool->pp2_id, q->priv->ppio->port_id,
+				bpool->id, pkt_to_remove, num,
+				q->priv->bpool_init_size);
+
+			for (i = 0; i < pkt_to_remove; i++) {
+				pp2_bpool_get_buff(hifs[core_id], bpool, &buff);
+				mbuf = (struct rte_mbuf *)
+					(cookie_addr_high | buff.cookie);
+				rte_pktmbuf_free(mbuf);
+			}
+			mrvl_port_bpool_size
+				[bpool->pp2_id][bpool->id][core_id] -=
+								pkt_to_remove;
+		}
+		rte_spinlock_unlock(&q->priv->lock);
+	}
+
+	return rx_done;
+}

<...>

Quoted 11 lines

drivers/net/mrvl/mrvl_ethdev.c line 2179

Quoted 7 lines
drivers/net/mrvl/mrvl_ethdev.c new file +7 -0
+	cfgnum = rte_kvargs_count(kvlist, MRVL_CFG_ARG);
+	if (cfgnum > 1) {
+		RTE_LOG(ERR, PMD, "Cannot handle more than one config file!\n");
+		goto out_free_kvlist;
+	} else if (cfgnum == 1) {
+		rte_kvargs_process(kvlist, MRVL_CFG_ARG,
+				   mrvl_get_qoscfg, &mrvl_qos_cfg);

Is the expected format/contect of the config file documented? How one can know how to create a config file?

Right, documentation is missing for that. Will add in v4.

Quoted 37 lines
Quoted 13 lines
drivers/net/mrvl/mrvl_ethdev.c new file +13 -0
+	}
+
+	/*
+	 * ret == -EEXIST is correct, it means DMA
+	 * has been already initialized (by another PMD).
+	 */
+	ret = mv_sys_dma_mem_init(RTE_MRVL_MUSDK_DMA_MEMSIZE);
+	if (ret < 0 && ret != -EEXIST)
+		goto out_free_kvlist;
+
+	ret = mrvl_init_pp2();
+	if (ret) {
+		RTE_LOG(ERR, PMD, "Failed to init PP!\n");

drivers/net/mrvl/mrvl_ethdev.c line 2202

Quoted 10 lines
drivers/net/mrvl/mrvl_ethdev.c new file +10 -0
+		goto out_deinit_dma;
+	}
+
+	ret = mrvl_init_hifs();
+	if (ret)
+		goto out_deinit_hifs;
+
+	for (i = 0; i < ifnum; i++) {
+		RTE_LOG(INFO, PMD, "Creating %s\n", ifnames[i]);
+		ret = mrvl_eth_dev_create(vdev, ifnames[i]);

So you are supporting multiple ethdev devices created by single vdev device, by providing multiple "iface" argument in device args.

This will cause eal create single virtual device but driver create multiple ethdev devices. I don't see direct problem with this but lets think about it.
This can be problem if you want to provide ethdev specific device arguments. Perhaps that is why you need to provide a config file ?

It can be an option to define each ethdev with:
"--vdev net_mrvl0,iface=xx0,config=yy0 --vdev
net_mrlv1,iface=xx1,config=yy1 ..."

Quoted 5 lines
Quoted 2 lines

This may remove your dependecy to librte_cfgfile.

Currently there's not need to passing separate options to each created device. As for configuration file it handles all devices at once.

Ok, that was an option...

Quoted 28 lines
Quoted 16 lines
Quoted 4 lines
drivers/net/mrvl/mrvl_ethdev.c new file +3 -0
+		if (ret)
+			goto out_cleanup;
+	}

drivers/net/mrvl/mrvl_ethdev.c line 2215

Quoted 10 lines
drivers/net/mrvl/mrvl_ethdev.c new file +10 -0
+
+	rte_kvargs_free(kvlist);
+
+	memset(mrvl_port_bpool_size, 0, sizeof(mrvl_port_bpool_size));
+
+	mrvl_lcore_first = RTE_MAX_LCORE;
+	mrvl_lcore_last = 0;
+
+	RTE_LCORE_FOREACH(core_id) {
+		mrvl_set_first_last_cores(core_id);

This sets limits of core_id. Why you need to know this in PMD level?

It's just to limit number of entries in mrvl_port_bpool_size we iterate over every time we want to count the total number of buffers in the hardware buffer pool.

Quoted 3 lines

<...>

--
- Tomasz Duszyński

#29 lore raw

PATCH v3 3/4 doc: add mrvl net pmd documentation

In reply to Tomasz Duszynski

Add documentation for the MRVL NET PMD driver.

---
 doc/guides/nics/features/mrvl.ini |  24 ++++++
 doc/guides/nics/index.rst         |   1 +
 doc/guides/nics/mrvl.rst          | 151 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 176 insertions(+)
 create mode 100644 doc/guides/nics/features/mrvl.ini
 create mode 100644 doc/guides/nics/mrvl.rst
doc/guides/nics/features/mrvl.ini new file +24 -0
new file mode 100644
index 0000000..781d6dc
@@ -0,0 +1,24 @@
+;
+; Supported features of the 'mrvl' network poll mode driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Speed capabilities   = Y
+Link status          = Y
+MTU update           = Y
+Jumbo frame          = Y
+Promiscuous mode     = Y
+Allmulticast mode    = Y
+Unicast MAC filter   = Y
+Multicast MAC filter = Y
+RSS hash             = Y
+VLAN filter          = Y
+CRC offload          = Y
+L3 checksum offload  = Y
+L4 checksum offload  = Y
+Packet type parsing  = Y
+Basic stats          = Y
+Stats per queue      = Y
+ARMv8                = Y
+Usage doc            = Y
doc/guides/nics/index.rst +1 -0
index 36f4f3f..7192f63 100644
@@ -55,6 +55,7 @@ Network Interface Controller Drivers
     liquidio
     mlx4
     mlx5
+    mrvl
     nfp
     qede
     sfc_efx
doc/guides/nics/mrvl.rst new file +151 -0

151 lines not on this page · raw message

Signature · 1 line
2.7.4
#30 lore raw

Re: [PATCH v3 3/4] doc: add mrvl net pmd documentation

Quoted 4 lines · Tomasz Duszynski

Add documentation for the MRVL NET PMD driver.

<...>

doc/guides/nics/features/mrvl.ini line 7

Quoted 3 lines
doc/guides/nics/features/mrvl.ini new file +3 -0
+;
+[Features]
+Speed capabilities   = Y

This doesn't seems correct please check doc/guides/nics/features.rst

Quoted 6 lines
doc/guides/nics/features/mrvl.ini new file +6 -0
+Link status          = Y
+MTU update           = Y
+Jumbo frame          = Y
+Promiscuous mode     = Y
+Allmulticast mode    = Y
+Unicast MAC filter   = Y

doc/guides/nics/features/mrvl.ini line 23

Quoted 10 lines
doc/guides/nics/features/mrvl.ini new file +10 -0
+Multicast MAC filter = Y
+RSS hash             = Y
+VLAN filter          = Y
+CRC offload          = Y
+L3 checksum offload  = Y
+L4 checksum offload  = Y
+Packet type parsing  = Y
+Basic stats          = Y
+Stats per queue      = Y
+ARMv8                = Y

Is other architecture not supported or not tested?

Quoted 1 line

+Usage doc = Y

<...>

doc/guides/nics/mrvl.rst line 85

Quoted 5 lines
doc/guides/nics/mrvl.rst new file +5 -0
+Prerequisites
+-------------
+
+- MUSDK (Marvell User-Space SDK) sources available
+  `here <https://github.com/MarvellEmbeddedProcessors/musdk-marvell/tree/musdk-armada-17.08>`_.

Is this 17.08 by change related to DPDK version, I mean is there any relation between DPDK version and musdk library version?

doc/guides/nics/mrvl.rst line 91

Quoted 6 lines
doc/guides/nics/mrvl.rst new file +6 -0
+
+    MUSDK is a light-weight library that provides direct access to Marvell's
+    PPv2 (Packet Processor v2). Alternatively prebuilt MUSDK library can be
+    requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
+    approval has been granted, library can be found by typing ``musdk`` in
+    search box.

What is the condition of having an approval?

Quoted 7 lines
doc/guides/nics/mrvl.rst new file +7 -0
+
+- DPDK environment
+
+    Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup
+    DPDK environment.
+
+

<...>

Quoted 9 lines
doc/guides/nics/mrvl.rst new file +9 -0
+Building DPDK
+-------------
+
+Driver needs precompiled MUSDK library during compilation. Detailed build
+process is described in library's documentation under ``doc`` directory.
+
+Before the DPDK build process the environmental variable ``LIBMUSDK_PATH`` with
+the path to the MUSDK installation directory needs to be exported.
+

doc/guides/nics/mrvl.rst line 136

Quoted 10 lines
doc/guides/nics/mrvl.rst new file +10 -0
+Usage Example
+-------------
+
+MRVL PMD requires extra kernel modules to function properly:
+
+.. code-block:: console
+
+   insmod musdk_uio.ko
+   insmod mv_pp_uio.ko
+   insmod mvpp2x_sysfs.ko

Why these kernel modules are required and how one can obtain them? These are out of tree kernel modules right?

<...>

#31 lore raw

Re: [PATCH v3 3/4] doc: add mrvl net pmd documentation

On Wed, Oct 04, 2017 at 01:29:01AM +0100, Ferruh Yigit wrote:

+cc Shlomi.

Quoted 6 lines · Tomasz Duszynski
Quoted 4 lines

Add documentation for the MRVL NET PMD driver.

Quoted 7 lines

<...>

doc/guides/nics/features/mrvl.ini line 7

Quoted 3 lines
doc/guides/nics/features/mrvl.ini new file +3 -0
+;
+[Features]
+Speed capabilities   = Y

This doesn't seems correct please check doc/guides/nics/features.rst

Right, speed capabilities are not returned via rte_eth_dev_info. Thanks for pointing this out. Will fix that in v4.

Quoted 11 lines
Quoted 11 lines
doc/guides/nics/features/mrvl.ini new file +10 -0
+Link status          = Y
+MTU update           = Y
+Jumbo frame          = Y
+Promiscuous mode     = Y
+Allmulticast mode    = Y
+Unicast MAC filter   = Y
+Multicast MAC filter = Y
+RSS hash             = Y
+VLAN filter          = Y
+CRC offload          = Y
Quoted 8 lines

doc/guides/nics/features/mrvl.ini line 23

Quoted 6 lines
doc/guides/nics/features/mrvl.ini new file +6 -0
+L3 checksum offload  = Y
+L4 checksum offload  = Y
+Packet type parsing  = Y
+Basic stats          = Y
+Stats per queue      = Y
+ARMv8                = Y

Is other architecture not supported or not tested?

Currently that NIC comes integrated into Armada 7k/8k SoCs and they are based on ARMv8.

Quoted 5 lines
Quoted 2 lines

+Usage doc = Y

<...>

Quoted 8 lines

doc/guides/nics/mrvl.rst line 85

Quoted 5 lines
doc/guides/nics/mrvl.rst new file +5 -0
+Prerequisites
+-------------
+
+- MUSDK (Marvell User-Space SDK) sources available
+  `here <https://github.com/MarvellEmbeddedProcessors/musdk-marvell/tree/musdk-armada-17.08>`_.

Is this 17.08 by change related to DPDK version, I mean is there any relation between DPDK version and musdk library version?

No relation except similar versioning convention that is used. Musdk library version needed by DPDK driver is mentioned explicitly in documentation.

Quoted 9 lines

doc/guides/nics/mrvl.rst line 91

Quoted 7 lines
doc/guides/nics/mrvl.rst new file +6 -0
+
+    MUSDK is a light-weight library that provides direct access to Marvell's
+    PPv2 (Packet Processor v2). Alternatively prebuilt MUSDK library can be
+    requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
+    approval has been granted, library can be found by typing ``musdk`` in
+    search box.

What is the condition of having an approval?

I think Marvell team would be more helpful here.

Quoted 24 lines
Quoted 8 lines
doc/guides/nics/mrvl.rst new file +7 -0
+
+- DPDK environment
+
+    Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to setup
+    DPDK environment.
+
+

<...>

Quoted 13 lines
doc/guides/nics/mrvl.rst new file +13 -0
+Building DPDK
+-------------
+
+Driver needs precompiled MUSDK library during compilation. Detailed build
+process is described in library's documentation under ``doc`` directory.
+
+Before the DPDK build process the environmental variable ``LIBMUSDK_PATH`` with
+the path to the MUSDK installation directory needs to be exported.
+
+Usage Example
+-------------
+
+MRVL PMD requires extra kernel modules to function properly:
Quoted 8 lines

doc/guides/nics/mrvl.rst line 136

Quoted 6 lines
doc/guides/nics/mrvl.rst new file +6 -0
+
+.. code-block:: console
+
+   insmod musdk_uio.ko
+   insmod mv_pp_uio.ko
+   insmod mvpp2x_sysfs.ko

Why these kernel modules are required and how one can obtain them?

Kernel modules are used to map device memory regions to userspace. musdk_uio and mv_pp_uio both come with MUSDK library. As for mvpp2x_sysfs I think Marvell team could be more helpful here.

Quoted 1 line

These are out of tree kernel modules right?

Right. You have to either build them yourself or get precompiled from Marvell-extranet.

Quoted 3 lines

<...>

--
- Tomasz Duszyński

#32 lore raw

PATCH v3 4/4 maintainers: add maintainers for the mrvl net pmd

In reply to Tomasz Duszynski
---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index a0cd75e..d4810cf 100644
@@ -393,6 +393,16 @@ F: drivers/net/mlx5/
 F: doc/guides/nics/mlx5.rst
 F: doc/guides/nics/features/mlx5.ini
 
+Marvell mrvl
+M: Jacek Siuda <[email protected]>
+M: Tomasz Duszynski <[email protected]>
+M: Dmitri Epshtein <[email protected]>
+M: Natalie Samsonov <[email protected]>
+M: Jianbo Liu <[email protected]>
+F: drivers/net/mrvl/
+F: doc/guides/nics/mrvl.rst
+F: doc/guides/nics/features/mrvl.ini
+
 Netcope szedata2
 M: Matej Vido <[email protected]>
 F: drivers/net/szedata2/
Signature · 1 line
2.7.4
#33 lore raw

v4 cover add net mrvl pmd driver

In reply to Tomasz Duszynski

Hello,

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Below you can find the list of features which net pmd supports:
* Speed capabilities
* Link status
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* QoS

Changes since v3:
* Split driver into skeleton, rx/tx, features, documentation parts
* Added speed capabilities flags.
* Added missing rx offload flags: VLAN/JUMBOFRAME
* Updated release notes.
* Updated documentation.

Changes since v2:
* Removed LINE_SPACING, MULTILINE_DEREFERENCE and SPLIT_STRING checkpatch warnings.
* Removed unnecessary forward declarations.
* Fixed whitespace warnings.

Changes since v1:
* Changed commit message to explain problem better.
* Removed bunch of checkpatch warnings about unnecessary parentheses.

Tomasz Duszynski (4):
app: link the whole rte_cfgfile library
net/mrvl: add mrvl net pmd driver skeleton net/mrvl: add rx/tx support
net/mrvl: add link update
net/mrvl: add link speed capabilities
net/mrvl: add support for updating mtu
net/mrvl: add jumbo frame support
net/mrvl: add support for promiscuous and allmulticast modes net/mrvl: add support for mac filtering
net/mrvl: add rss hashing support
net/mrvl: add support for vlan filtering
net/mrvl: add crc, l3 and l4 offloads support net/mrvl: add packet type parsing support. net/mrvl: add basic stats support
maintainers: add maintainers for the mrvl net pmd
doc: add mrvl net pmd documentation

 MAINTAINERS                               |   10 +
 config/common_base                        |    7 +
 doc/guides/nics/features/mrvl.ini         |   23 +
 doc/guides/nics/index.rst                 |    1 +
 doc/guides/nics/mrvl.rst                  |  256 ++++
 doc/guides/rel_notes/release_17_11.rst    |    6 +
 drivers/net/Makefile                      |    8 +
 drivers/net/mrvl/Makefile                 |   63 +
 drivers/net/mrvl/mrvl_ethdev.c            | 2279 +++++++++++++++++++++++++++++
 drivers/net/mrvl/mrvl_ethdev.h            |  114 ++
 drivers/net/mrvl/mrvl_qos.c               |  633 ++++++++
 drivers/net/mrvl/mrvl_qos.h               |  112 ++
 drivers/net/mrvl/rte_pmd_mrvl_version.map |    3 +
 mk/rte.app.mk                             |    3 +-
 14 files changed, 3517 insertions(+), 1 deletion(-)
 create mode 100644 doc/guides/nics/features/mrvl.ini
 create mode 100644 doc/guides/nics/mrvl.rst
 create mode 100644 drivers/net/mrvl/Makefile
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.c
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.h
 create mode 100644 drivers/net/mrvl/mrvl_qos.c
 create mode 100644 drivers/net/mrvl/mrvl_qos.h
 create mode 100644 drivers/net/mrvl/rte_pmd_mrvl_version.map

--
2.7.4

#34 lore raw

PATCH v4 1/16 app: link the whole rte_cfgfile library

MRVL net pmd needs rte_cfgfile to parse QoS configuration file thus librte_pmd_mrvl.a contains undefined symbols from librte_cfgfile.a.

As a result linking applications under app/ directory will fail because librte_cfgfile.a comes before librte_pmd_mrvl.a during the linking stage.

Linking the whole librte_cfgfile.a solves the issue.

---
 mk/rte.app.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mk/rte.app.mk +1 -1
index a788be2..4891bc2 100644
@@ -81,10 +81,10 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER)          += -lrte_power
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER)          += -lrte_timer
 _LDLIBS-$(CONFIG_RTE_LIBRTE_EFD)            += -lrte_efd
-_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
 
 _LDLIBS-y += --whole-archive
 
+_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
 _LDLIBS-$(CONFIG_RTE_LIBRTE_HASH)           += -lrte_hash
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MEMBER)         += -lrte_member
 _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lrte_vhost
Signature · 1 line
2.7.4
#35 lore raw

PATCH v4 2/16 net/mrvl: add mrvl net pmd driver skeleton

In reply to Tomasz Duszynski

Add mrvl net pmd driver skeleton providing base for the further development. Besides the basic functionality QoS configuration is introduced as well.

---
 config/common_base                        |    7 +
 doc/guides/rel_notes/release_17_11.rst    |    6 +
 drivers/net/Makefile                      |    8 +
 drivers/net/mrvl/Makefile                 |   63 ++
 drivers/net/mrvl/mrvl_ethdev.c            | 1112 +++++++++++++++++++++++++++++
 drivers/net/mrvl/mrvl_ethdev.h            |  100 +++
 drivers/net/mrvl/mrvl_qos.c               |  633 ++++++++++++++++
 drivers/net/mrvl/mrvl_qos.h               |  112 +++
 drivers/net/mrvl/rte_pmd_mrvl_version.map |    3 +
 mk/rte.app.mk                             |    1 +
 10 files changed, 2045 insertions(+)
 create mode 100644 drivers/net/mrvl/Makefile
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.c
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.h
 create mode 100644 drivers/net/mrvl/mrvl_qos.c
 create mode 100644 drivers/net/mrvl/mrvl_qos.h
 create mode 100644 drivers/net/mrvl/rte_pmd_mrvl_version.map
config/common_base +7 -0
index 22068c5..36c7f4c 100644
@@ -260,6 +260,13 @@ CONFIG_RTE_LIBRTE_NFP_PMD=n
 CONFIG_RTE_LIBRTE_NFP_DEBUG=n
 
 #
+# Compile Marvell PMD driver
+#
+CONFIG_RTE_LIBRTE_MRVL_PMD=n
+CONFIG_RTE_LIBRTE_MRVL_DEBUG=n
+CONFIG_RTE_MRVL_MUSDK_DMA_MEMSIZE=41943040
+
+#
 # Compile burst-oriented Broadcom BNXT PMD driver
 #
 CONFIG_RTE_LIBRTE_BNXT_PMD=y
doc/guides/rel_notes/release_17_11.rst +6 -0
index 6a75ae0..d9f6b4e 100644
@@ -81,6 +81,12 @@ New Features
   See the :ref:`Membership Library <Member_Library>` documentation in
   the Programmers Guide document, for more information.
 
+* **Added a new driver for Marvell Armada 7k/8k devices.**
+
+  Added the new mrvl net driver for Marvell Armada 7k/8k devices. See the
+  "Network Interface Controller Drivers" document for more details on this new
+  driver.
+
 
 Resolved Issues
 ---------------
drivers/net/Makefile +8 -0
index b28310b..3d3e0b3 100644
@@ -75,6 +75,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4
 DEPDIRS-mlx4 = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5
 DEPDIRS-mlx5 = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += mrvl
+DEPDIRS-mrvl = $(core-libs) librte_cfgfile
 DIRS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += nfp
 DEPDIRS-nfp = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt
@@ -110,4 +112,10 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += vhost
 endif # $(CONFIG_RTE_LIBRTE_VHOST)
 DEPDIRS-vhost = $(core-libs) librte_vhost
 
+ifeq ($(CONFIG_RTE_LIBRTE_MRVL_PMD),y)
+ifeq ($(CONFIG_RTE_LIBRTE_CFGFILE),n)
+$(error "RTE_LIBRTE_CFGFILE must be enabled in configuration!")
+endif
+endif
+
 include $(RTE_SDK)/mk/rte.subdir.mk
drivers/net/mrvl/Makefile new file +63 -0

63 lines not on this page · raw message

drivers/net/mrvl/mrvl_ethdev.c new file +1112 -0

1,112 lines not on this page · raw message

drivers/net/mrvl/mrvl_ethdev.h new file +100 -0

100 lines not on this page · raw message

drivers/net/mrvl/mrvl_qos.c new file +633 -0

633 lines not on this page · raw message

drivers/net/mrvl/mrvl_qos.h new file +112 -0

112 lines not on this page · raw message

drivers/net/mrvl/rte_pmd_mrvl_version.map new file +3 -0
new file mode 100644
index 0000000..a753031
@@ -0,0 +1,3 @@
+DPDK_17.11 {
+	local: *;
+};
mk/rte.app.mk +1 -0
index 4891bc2..b9197e8 100644
@@ -136,6 +136,7 @@ endif
 _LDLIBS-$(CONFIG_RTE_LIBRTE_LIO_PMD)        += -lrte_pmd_lio
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD)       += -lrte_pmd_mlx4 -libverbs
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD)       += -lrte_pmd_mlx5 -libverbs -lmlx5
+_LDLIBS-$(CONFIG_RTE_LIBRTE_MRVL_PMD)       += -lrte_pmd_mrvl -L$(LIBMUSDK_PATH)/lib -lmusdk
 _LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD)        += -lrte_pmd_nfp
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL)       += -lrte_pmd_null
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP)       += -lrte_pmd_pcap -lpcap
Signature · 1 line
2.7.4
#36 lore raw

Re: [PATCH v4 02/16] net/mrvl: add mrvl net pmd driver skeleton

Hi,

09/10/2017 17:00, Tomasz Duszynski:

config/common_base CONFIG_RTE_LIBRTE_NFP_PMD=n · line 267

Quoted 6 lines

#

config/common_base +5 -0
+# Compile Marvell PMD driver
+#
+CONFIG_RTE_LIBRTE_MRVL_PMD=n
+CONFIG_RTE_LIBRTE_MRVL_DEBUG=n
+CONFIG_RTE_MRVL_MUSDK_DMA_MEMSIZE=41943040

We are trying to remove build-time configurations and behave like a true library.

The DEBUG config options are now prohibited.
Where is it used in your code?
If it is used for logs, you should switch to the dynamic log config.

What is MUSDK_DMA_MEMSIZE?
If the value cannot change, it must be a constant in the code. If it can change, it should be a run-time driver option.

Thank you and welcome!

#37 lore raw

Re: [PATCH v4 02/16] net/mrvl: add mrvl net pmd driver skeleton

Quoted 13 lines · Thomas Monjalon

Hi,

09/10/2017 17:00, Tomasz Duszynski:

config/common_base CONFIG_RTE_LIBRTE_NFP_PMD=n · line 267

Quoted 6 lines

#

config/common_base +5 -0
+# Compile Marvell PMD driver
+#
+CONFIG_RTE_LIBRTE_MRVL_PMD=n
+CONFIG_RTE_LIBRTE_MRVL_DEBUG=n
+CONFIG_RTE_MRVL_MUSDK_DMA_MEMSIZE=41943040

We are trying to remove build-time configurations and behave like a true library.

Quoted 7 lines

The DEBUG config options are now prohibited.
Where is it used in your code?
If it is used for logs, you should switch to the dynamic log config.

What is MUSDK_DMA_MEMSIZE?
If the value cannot change, it must be a constant in the code. If it can change, it should be a run-time driver option.

It's up to the user what MUSDK_DMA_MEMSIZE is going to be. Currently it's set to value that should work it all cases.

Except that, MUSDK_DMA_MEMSIZE is used as synchronization point for net and crypto (on condition they are used together i.e ipsec-secgw).

Suppose we have two different MUSDK_DMA_MEMSIZE defined for net/crypto then dma memsize allocated will depend on driver probing sequence which might confuse user.

If you have any better idea please share it with us. Thanks.

Quoted 2 lines

Thank you and welcome

--
- Tomasz Duszyński

#38 lore raw

Re: [PATCH v4 02/16] net/mrvl: add mrvl net pmd driver skeleton

+1 with Thomas, see below,

Le 12/10/2017 à 08:51, Tomasz Duszynski a écrit :

Quoted 6 lines
Quoted 3 lines

What is MUSDK_DMA_MEMSIZE?
If the value cannot change, it must be a constant in the code. If it can change, it should be a run-time driver option.

It's up to the user what MUSDK_DMA_MEMSIZE is going to be. Currently it's set to value that should work it all cases.

Quoted 6 lines

Except that, MUSDK_DMA_MEMSIZE is used as synchronization point for net and crypto (on condition they are used together i.e ipsec-secgw).

Suppose we have two different MUSDK_DMA_MEMSIZE defined for net/crypto then dma memsize allocated will depend on driver probing sequence which might confuse user.

It does not make sense,
+ /*
+ * ret == -EEXIST is correct, it means DMA
+ * has been already initialized (by another PMD).
+ */
+ ret = mv_sys_dma_mem_init(RTE_MRVL_MUSDK_DMA_MEMSIZE

int mv_sys_dma_mem_init(u64 size)

{
        struct sys_dma  *i_sys_dma;
        int err;

        if (sys_dma) {
                pr_err("Dma object already exits.\n");
                return -EEXIST;
        }

So, I do not understand why you cannot add some checks into the drivers to assert that users must have set the same value for both when calling:
ret = mv_sys_dma_mem_init(my_best_size);
maybe, you need to fix and improve musdk first to avoid DPDK from getting such compilation issues.

best regards,
Vincent

#39 lore raw

Re: [PATCH v4 02/16] net/mrvl: add mrvl net pmd driver skeleton

Hi,

The problem is, that both drivers are totally separate entities, linked into separate libs, but we need to use only one setting in both of them. So, in order to provide any runtime (or even compile-time) verification, we would need to create a third entity just to handle a simple assertion - a bit overkill. At the time the code was written, common configuration option seemed the most logical. If your long-term goal is to get rid of build-time configurations, then it puts everything in a different perspective.

What we can do, is to add a run-time driver option and oblige user (in documentation) to set the option only for the first mrvl vdev. If the driver doesn't see the option set, it won't initialize DMA. This, plus meaningful error handling/logs should take care of any potential mishandling by user that we were afraid of. I hope that would be more acceptable.

Best Regards,
Jacek Siuda.

2017-10-12 9:59 GMT+02:00 Vincent JARDIN <[email protected]>:

Quoted 45 lines

+1 with Thomas, see below,

Quoted 7 lines · Tomasz Duszynski

What is MUSDK_DMA_MEMSIZE?

Quoted 3 lines

If the value cannot change, it must be a constant in the code. If it can change, it should be a run-time driver option.

It's up to the user what MUSDK_DMA_MEMSIZE is going to be. Currently it's set to value that should work it all cases.

Quoted 8 lines

Except that, MUSDK_DMA_MEMSIZE is used as synchronization point for net and crypto (on condition they are used together i.e ipsec-secgw).

Suppose we have two different MUSDK_DMA_MEMSIZE defined for net/crypto then
dma memsize allocated will depend on driver probing sequence which might confuse user.

It does not make sense,

drivers/net/mrvl/mrvl_ethdev.c new file +5 -0
+       /*
+        * ret == -EEXIST is correct, it means DMA
+        * has been already initialized (by another PMD).
+        */
+       ret = mv_sys_dma_mem_init(RTE_MRVL_MUSDK_DMA_MEMSIZE

int mv_sys_dma_mem_init(u64 size)

{
        struct sys_dma  *i_sys_dma;
        int err;

        if (sys_dma) {
                pr_err("Dma object already exits.\n");
                return -EEXIST;
        }

So, I do not understand why you cannot add some checks into the drivers to assert that users must have set the same value for both when calling:
ret = mv_sys_dma_mem_init(my_best_size);
maybe, you need to fix and improve musdk first to avoid DPDK from getting such compilation issues.

best regards,
Vincent

#40 lore raw

Re: [PATCH v4 02/16] net/mrvl: add mrvl net pmd driver skeleton

Le 12/10/2017 à 14:14, Jacek Siuda a écrit :

Quoted 2 lines

What we can do, is to add a run-time driver option and oblige user (in documentation) to set the option only for the first mrvl vdev. If the driver doesn't see the option set, it  won't initialize DMA. This, plus meaningful error handling/logs should take care of any potential mishandling by user that we were afraid of. I hope that would be more acceptable.

Yes, it does. And it already matches the current design in fact since the return error can be EEXIST and it is ignored.

thank you,
Vincent

#41 lore raw

PATCH v4 3/16 net/mrvl: add rx/tx support

In reply to Tomasz Duszynski

Add rx/tx support.

---
 drivers/net/mrvl/mrvl_ethdev.c | 370 ++++++++++++++++++++++++++++++++++++++++-
 drivers/net/mrvl/mrvl_ethdev.h |  11 ++
 2 files changed, 380 insertions(+), 1 deletion(-)
drivers/net/mrvl/mrvl_ethdev.c +369 -1
index 1e730c6..c87d48e 100644
@@ -70,6 +70,9 @@
 #define MRVL_MUSDK_HIFS_MAX 9
 
 #define MRVL_MAC_ADDRS_MAX 1
+/* prefetch shift */
+#define MRVL_MUSDK_PREFETCH_SHIFT 2
+
 #define MRVL_MATCH_LEN 16
 #define MRVL_PKT_EFFEC_OFFS (MRVL_PKT_OFFS + MV_MH_SIZE)
 /* Maximum allowable packet size */
@@ -100,8 +103,29 @@ static int used_bpools[PP2_NUM_PKT_PROC] = {
 	MRVL_MUSDK_BPOOLS_RESERVED
 };
 
+struct pp2_bpool *mrvl_port_to_bpool_lookup[RTE_MAX_ETHPORTS];
+int mrvl_port_bpool_size[PP2_NUM_PKT_PROC][PP2_BPOOL_NUM_POOLS][RTE_MAX_LCORE];
 uint64_t cookie_addr_high = MRVL_COOKIE_ADDR_INVALID;
 
+/*
+ * To use buffer harvesting based on loopback port shadow queue structure
+ * was introduced for buffers information bookkeeping.
+ *
+ * Before sending the packet, related buffer information (pp2_buff_inf) is
+ * stored in shadow queue. After packet is transmitted no longer used
+ * packet buffer is released back to it's original hardware pool,
+ * on condition it originated from interface.
+ * In case it  was generated by application itself i.e: mbuf->port field is
+ * 0xff then its released to software mempool.
+ */
+struct mrvl_shadow_txq {
+	int head;           /* write index - used when sending buffers */
+	int tail;           /* read index - used when releasing buffers */
+	u16 size;           /* queue occupied size */
+	u16 num_to_release; /* number of buffers sent, that can be released */
+	struct buff_release_entry ent[MRVL_PP2_TX_SHADOWQ_SIZE]; /* q entries */
+};
+
 struct mrvl_rxq {
 	struct mrvl_priv *priv;
 	struct rte_mempool *mp;
@@ -115,8 +139,31 @@ struct mrvl_txq {
 	int port_id;
 };
 
+/*
+ * Every tx queue should have dedicated shadow tx queue.
+ *
+ * Ports assigned by DPDK might not start at zero or be continuous so
+ * as a workaround define shadow queues for each possible port so that
+ * we eventually fit somewhere.
+ */
+struct mrvl_shadow_txq shadow_txqs[RTE_MAX_ETHPORTS][RTE_MAX_LCORE];
+
 /** Number of ports configured. */
 int mrvl_ports_nb;
+static int mrvl_lcore_first;
+static int mrvl_lcore_last;
+
+static inline int
+mrvl_get_bpool_size(int pp2_id, int pool_id)
+{
+	int i;
+	int size = 0;
+
+	for (i = mrvl_lcore_first; i <= mrvl_lcore_last; i++)
+		size += mrvl_port_bpool_size[pp2_id][pool_id][i];
+
+	return size;
+}
 
 static inline int
 mrvl_reserve_bit(int *bitmap, int max)
@@ -326,6 +373,33 @@ mrvl_flush_rx_queues(struct rte_eth_dev *dev)
 }
 
 /**
+ * Flush transmit shadow queues.
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure.
+ */
+static void
+mrvl_flush_tx_shadow_queues(struct rte_eth_dev *dev)
+{
+	int i;
+
+	RTE_LOG(INFO, PMD, "Flushing tx shadow queues\n");
+	for (i = 0; i < RTE_MAX_LCORE; i++) {
+		struct mrvl_shadow_txq *sq =
+			&shadow_txqs[dev->data->port_id][i];
+
+		while (sq->tail != sq->head) {
+			uint64_t addr = cookie_addr_high |
+					sq->ent[sq->tail].buff.cookie;
+			rte_pktmbuf_free((struct rte_mbuf *)addr);
+			sq->tail = (sq->tail + 1) & MRVL_PP2_TX_SHADOWQ_MASK;
+		}
+
+		memset(sq, 0, sizeof(*sq));
+	}
+}
+
+/**
  * Flush hardware bpool (buffer-pool).
  *
  * @param dev
@@ -371,6 +445,7 @@ mrvl_dev_stop(struct rte_eth_dev *dev)
 
 	mrvl_dev_set_link_down(dev);
 	mrvl_flush_rx_queues(dev);
+	mrvl_flush_tx_shadow_queues(dev);
 	if (priv->qos_tbl)
 		pp2_cls_qos_tbl_deinit(priv->qos_tbl);
 	pp2_ppio_deinit(priv->ppio);
@@ -543,6 +618,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
 	}
 
 	pp2_bpool_put_buffs(hif, entries, (uint16_t *)&i);
+	mrvl_port_bpool_size[bpool->pp2_id][bpool->id][core_id] += i;
 
 	if (i != num)
 		goto out;
@@ -619,6 +695,7 @@ mrvl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 	rxq->mp = mp;
 	rxq->queue_id = idx;
 	rxq->port_id = dev->data->port_id;
+	mrvl_port_to_bpool_lookup[rxq->port_id] = priv->bpool;
 
 	tc = priv->rxq_map[rxq->queue_id].tc,
 	inq = priv->rxq_map[rxq->queue_id].inq;
@@ -750,6 +827,276 @@ static const struct eth_dev_ops mrvl_ops = {
 };
 
 /**
+ * DPDK callback for receive.
+ *
+ * @param rxq
+ *   Generic pointer to the receive queue.
+ * @param rx_pkts
+ *   Array to store received packets.
+ * @param nb_pkts
+ *   Maximum number of packets in array.
+ *
+ * @return
+ *   Number of packets successfully received.
+ */
+static uint16_t
+mrvl_rx_pkt_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
+{
+	struct mrvl_rxq *q = rxq;
+	struct pp2_ppio_desc descs[nb_pkts];
+	struct pp2_bpool *bpool;
+	int i, ret, rx_done = 0;
+	int num;
+	unsigned int core_id = rte_lcore_id();
+
+	if (unlikely(!q->priv->ppio))
+		return 0;
+
+	bpool = q->priv->bpool;
+
+	ret = pp2_ppio_recv(q->priv->ppio, q->priv->rxq_map[q->queue_id].tc,
+			    q->priv->rxq_map[q->queue_id].inq, descs, &nb_pkts);
+	if (unlikely(ret < 0)) {
+		RTE_LOG(ERR, PMD, "Failed to receive packets\n");
+		return 0;
+	}
+	mrvl_port_bpool_size[bpool->pp2_id][bpool->id][core_id] -= nb_pkts;
+
+	for (i = 0; i < nb_pkts; i++) {
+		struct rte_mbuf *mbuf;
+		enum pp2_inq_desc_status status;
+		uint64_t addr;
+
+		if (likely(nb_pkts - i > MRVL_MUSDK_PREFETCH_SHIFT)) {
+			struct pp2_ppio_desc *pref_desc;
+			u64 pref_addr;
+
+			pref_desc = &descs[i + MRVL_MUSDK_PREFETCH_SHIFT];
+			pref_addr = cookie_addr_high |
+				    pp2_ppio_inq_desc_get_cookie(pref_desc);
+			rte_mbuf_prefetch_part1((struct rte_mbuf *)(pref_addr));
+			rte_mbuf_prefetch_part2((struct rte_mbuf *)(pref_addr));
+		}
+
+		addr = cookie_addr_high |
+		       pp2_ppio_inq_desc_get_cookie(&descs[i]);
+		mbuf = (struct rte_mbuf *)addr;
+		rte_pktmbuf_reset(mbuf);
+
+		/* drop packet in case of mac, overrun or resource error */
+		status = pp2_ppio_inq_desc_get_l2_pkt_error(&descs[i]);
+		if (unlikely(status != PP2_DESC_ERR_OK)) {
+			struct pp2_buff_inf binf = {
+				.addr = rte_mbuf_data_dma_addr_default(mbuf),
+				.cookie = (pp2_cookie_t)(uint64_t)mbuf,
+			};
+
+			pp2_bpool_put_buff(hifs[core_id], bpool, &binf);
+			mrvl_port_bpool_size
+				[bpool->pp2_id][bpool->id][core_id]++;
+			continue;
+		}
+
+		mbuf->data_off += MRVL_PKT_EFFEC_OFFS;
+		mbuf->pkt_len = pp2_ppio_inq_desc_get_pkt_len(&descs[i]);
+		mbuf->data_len = mbuf->pkt_len;
+		mbuf->port = q->port_id;
+
+		rx_pkts[rx_done++] = mbuf;
+	}
+
+	if (rte_spinlock_trylock(&q->priv->lock) == 1) {
+		num = mrvl_get_bpool_size(bpool->pp2_id, bpool->id);
+
+		if (unlikely(num <= q->priv->bpool_min_size ||
+			     (!rx_done && num < q->priv->bpool_init_size))) {
+			ret = mrvl_fill_bpool(q, MRVL_BURST_SIZE);
+			if (ret)
+				RTE_LOG(ERR, PMD, "Failed to fill bpool\n");
+		} else if (unlikely(num > q->priv->bpool_max_size)) {
+			int i;
+			int pkt_to_remove = num - q->priv->bpool_init_size;
+			struct rte_mbuf *mbuf;
+			struct pp2_buff_inf buff;
+
+			RTE_LOG(DEBUG, PMD,
+				"\nport-%d:%d: bpool %d oversize - remove %d buffers (pool size: %d -> %d)\n",
+				bpool->pp2_id, q->priv->ppio->port_id,
+				bpool->id, pkt_to_remove, num,
+				q->priv->bpool_init_size);
+
+			for (i = 0; i < pkt_to_remove; i++) {
+				pp2_bpool_get_buff(hifs[core_id], bpool, &buff);
+				mbuf = (struct rte_mbuf *)
+					(cookie_addr_high | buff.cookie);
+				rte_pktmbuf_free(mbuf);
+			}
+			mrvl_port_bpool_size
+				[bpool->pp2_id][bpool->id][core_id] -=
+								pkt_to_remove;
+		}
+		rte_spinlock_unlock(&q->priv->lock);
+	}
+
+	return rx_done;
+}
+
+/**
+ * Release already sent buffers to bpool (buffer-pool).
+ *
+ * @param ppio
+ *   Pointer to the port structure.
+ * @param hif
+ *   Pointer to the MUSDK hardware interface.
+ * @param sq
+ *   Pointer to the shadow queue.
+ * @param qid
+ *   Queue id number.
+ * @param force
+ *   Force releasing packets.
+ */
+static inline void
+mrvl_free_sent_buffers(struct pp2_ppio *ppio, struct pp2_hif *hif,
+		       struct mrvl_shadow_txq *sq, int qid, int force)
+{
+	struct buff_release_entry *entry;
+	uint16_t nb_done = 0, num = 0, skip_bufs = 0;
+	int i, core_id = rte_lcore_id();
+
+	pp2_ppio_get_num_outq_done(ppio, hif, qid, &nb_done);
+
+	sq->num_to_release += nb_done;
+
+	if (likely(!force &&
+		   sq->num_to_release < MRVL_PP2_BUF_RELEASE_BURST_SIZE))
+		return;
+
+	nb_done = sq->num_to_release;
+	sq->num_to_release = 0;
+
+	for (i = 0; i < nb_done; i++) {
+		entry = &sq->ent[sq->tail + num];
+		if (unlikely(!entry->buff.addr)) {
+			RTE_LOG(ERR, PMD,
+				"Shadow memory @%d: cookie(%lx), pa(%lx)!\n",
+				sq->tail, (u64)entry->buff.cookie,
+				(u64)entry->buff.addr);
+			skip_bufs = 1;
+			goto skip;
+		}
+
+		if (unlikely(!entry->bpool)) {
+			struct rte_mbuf *mbuf;
+
+			mbuf = (struct rte_mbuf *)
+			       (cookie_addr_high | entry->buff.cookie);
+			rte_pktmbuf_free(mbuf);
+			skip_bufs = 1;
+			goto skip;
+		}
+
+		mrvl_port_bpool_size
+			[entry->bpool->pp2_id][entry->bpool->id][core_id]++;
+		num++;
+		if (unlikely(sq->tail + num == MRVL_PP2_TX_SHADOWQ_SIZE))
+			goto skip;
+		continue;
+skip:
+		if (likely(num))
+			pp2_bpool_put_buffs(hif, &sq->ent[sq->tail], &num);
+		num += skip_bufs;
+		sq->tail = (sq->tail + num) & MRVL_PP2_TX_SHADOWQ_MASK;
+		sq->size -= num;
+		num = 0;
+	}
+
+	if (likely(num)) {
+		pp2_bpool_put_buffs(hif, &sq->ent[sq->tail], &num);
+		sq->tail = (sq->tail + num) & MRVL_PP2_TX_SHADOWQ_MASK;
+		sq->size -= num;
+	}
+}
+
+/**
+ * DPDK callback for transmit.
+ *
+ * @param txq
+ *   Generic pointer transmit queue.
+ * @param tx_pkts
+ *   Packets to transmit.
+ * @param nb_pkts
+ *   Number of packets in array.
+ *
+ * @return
+ *   Number of packets successfully transmitted.
+ */
+static uint16_t
+mrvl_tx_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+	struct mrvl_txq *q = txq;
+	struct mrvl_shadow_txq *sq = &shadow_txqs[q->port_id][rte_lcore_id()];
+	struct pp2_hif *hif = hifs[rte_lcore_id()];
+	struct pp2_ppio_desc descs[nb_pkts];
+	int i;
+	uint16_t num, sq_free_size;
+
+	if (unlikely(!q->priv->ppio))
+		return 0;
+
+	if (sq->size)
+		mrvl_free_sent_buffers(q->priv->ppio, hif, sq, q->queue_id, 0);
+
+	sq_free_size = MRVL_PP2_TX_SHADOWQ_SIZE - sq->size - 1;
+	if (unlikely(nb_pkts > sq_free_size)) {
+		RTE_LOG(DEBUG, PMD,
+			"No room in shadow queue for %d packets! %d packets will be sent.\n",
+			nb_pkts, sq_free_size);
+		nb_pkts = sq_free_size;
+	}
+
+	for (i = 0; i < nb_pkts; i++) {
+		struct rte_mbuf *mbuf = tx_pkts[i];
+
+		if (likely(nb_pkts - i > MRVL_MUSDK_PREFETCH_SHIFT)) {
+			struct rte_mbuf *pref_pkt_hdr;
+
+			pref_pkt_hdr = tx_pkts[i + MRVL_MUSDK_PREFETCH_SHIFT];
+			rte_mbuf_prefetch_part1(pref_pkt_hdr);
+			rte_mbuf_prefetch_part2(pref_pkt_hdr);
+		}
+
+		sq->ent[sq->head].buff.cookie = (pp2_cookie_t)(uint64_t)mbuf;
+		sq->ent[sq->head].buff.addr =
+			rte_mbuf_data_dma_addr_default(mbuf);
+		sq->ent[sq->head].bpool =
+			(unlikely(mbuf->port == 0xff || mbuf->refcnt > 1)) ?
+			 NULL : mrvl_port_to_bpool_lookup[mbuf->port];
+		sq->head = (sq->head + 1) & MRVL_PP2_TX_SHADOWQ_MASK;
+		sq->size++;
+
+		pp2_ppio_outq_desc_reset(&descs[i]);
+		pp2_ppio_outq_desc_set_phys_addr(&descs[i],
+						 rte_pktmbuf_mtophys(mbuf));
+		pp2_ppio_outq_desc_set_pkt_offset(&descs[i], 0);
+		pp2_ppio_outq_desc_set_pkt_len(&descs[i],
+					       rte_pktmbuf_pkt_len(mbuf));
+	}
+
+	num = nb_pkts;
+	pp2_ppio_send(q->priv->ppio, hif, q->queue_id, descs, &nb_pkts);
+	/* number of packets that were not sent */
+	if (unlikely(num > nb_pkts)) {
+		for (i = nb_pkts; i < num; i++) {
+			sq->head = (MRVL_PP2_TX_SHADOWQ_SIZE + sq->head - 1) &
+				MRVL_PP2_TX_SHADOWQ_MASK;
+		}
+		sq->size -= num - nb_pkts;
+	}
+
+	return nb_pkts;
+}
+
+/**
  * Initialize packet processor.
  *
  * @return
@@ -821,6 +1168,7 @@ mrvl_priv_create(const char *dev_name)
 		goto out_clear_bpool_bit;
 
 	priv->ppio_params.type = PP2_PPIO_T_NIC;
+	rte_spinlock_init(&priv->lock);
 
 	return priv;
 out_clear_bpool_bit:
@@ -875,6 +1223,8 @@ mrvl_eth_dev_create(struct rte_vdev_device *vdev, const char *name)
 	memcpy(eth_dev->data->mac_addrs[0].addr_bytes,
 	       req.ifr_addr.sa_data, ETHER_ADDR_LEN);
 
+	eth_dev->rx_pkt_burst = mrvl_rx_pkt_burst;
+	eth_dev->tx_pkt_burst = mrvl_tx_pkt_burst;
 	eth_dev->data->dev_private = priv;
 	eth_dev->device = &vdev->device;
 	eth_dev->dev_ops = &mrvl_ops;
@@ -984,6 +1334,15 @@ mrvl_deinit_hifs(void)
 	}
 }
 
+static void mrvl_set_first_last_cores(int core_id)
+{
+	if (core_id < mrvl_lcore_first)
+		mrvl_lcore_first = core_id;
+
+	if (core_id > mrvl_lcore_last)
+		mrvl_lcore_last = core_id;
+}
+
 /**
  * DPDK callback to register the virtual device.
  *
@@ -999,7 +1358,7 @@ rte_pmd_mrvl_probe(struct rte_vdev_device *vdev)
 	struct rte_kvargs *kvlist;
 	const char *ifnames[PP2_NUM_ETH_PPIO * PP2_NUM_PKT_PROC];
 	int ret = -EINVAL;
-	uint32_t i, ifnum, cfgnum;
+	uint32_t i, ifnum, cfgnum, core_id;
 	const char *params;
 
 	params = rte_vdev_device_args(vdev);
@@ -1053,6 +1412,15 @@ rte_pmd_mrvl_probe(struct rte_vdev_device *vdev)
 
 	rte_kvargs_free(kvlist);
 
+	memset(mrvl_port_bpool_size, 0, sizeof(mrvl_port_bpool_size));
+
+	mrvl_lcore_first = RTE_MAX_LCORE;
+	mrvl_lcore_last = 0;
+
+	RTE_LCORE_FOREACH(core_id) {
+		mrvl_set_first_last_cores(core_id);
+	}
+
 	return 0;
 out_cleanup:
 	for (; i > 0; i--)
drivers/net/mrvl/mrvl_ethdev.h +11 -0
index 626cfaa..da33d05 100644
@@ -33,6 +33,7 @@
 #ifndef _MRVL_ETHDEV_H_
 #define _MRVL_ETHDEV_H_
 
+#include <rte_spinlock.h>
 #include <drivers/mv_pp2_cls.h>
 #include <drivers/mv_pp2_ppio.h>
 
@@ -69,10 +70,20 @@
 /** Packet offset inside RX buffer. */
 #define MRVL_PKT_OFFS 64
 
+/** Maximum number of descriptors in shadow queue. Must be power of 2 */
+#define MRVL_PP2_TX_SHADOWQ_SIZE MRVL_PP2_TXD_MAX
+
+/** Shadow queue size mask (since shadow queue size is power of 2) */
+#define MRVL_PP2_TX_SHADOWQ_MASK (MRVL_PP2_TX_SHADOWQ_SIZE - 1)
+
+/** Minimum number of sent buffers to release from shadow queue to BM */
+#define MRVL_PP2_BUF_RELEASE_BURST_SIZE	64
+
 struct mrvl_priv {
 	/* Hot fields, used in fast path. */
 	struct pp2_bpool *bpool;  /**< BPool pointer */
 	struct pp2_ppio	*ppio;    /**< Port handler pointer */
+	rte_spinlock_t lock;	  /**< Spinlock for checking bpool status */
 	uint16_t bpool_max_size;  /**< BPool maximum size */
 	uint16_t bpool_min_size;  /**< BPool minimum size  */
 	uint16_t bpool_init_size; /**< Configured BPool size  */
Signature · 1 line
2.7.4
#42 lore raw

PATCH v4 4/16 net/mrvl: add link update

In reply to Tomasz Duszynski

Add support for retrieving physical link information i.e:
speed, duplex and link status.

---
 doc/guides/nics/features/mrvl.ini |  7 +++++
 drivers/net/mrvl/mrvl_ethdev.c    | 65 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 doc/guides/nics/features/mrvl.ini
doc/guides/nics/features/mrvl.ini new file +7 -0
new file mode 100644
index 0000000..72df92e
@@ -0,0 +1,7 @@
+;
+; Supported features of the 'mrvl' network poll mode driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Link status          = Y
drivers/net/mrvl/mrvl_ethdev.c +65 -0

77 lines not on this page · raw message

Signature · 1 line
2.7.4
#43 lore raw

PATCH v4 5/16 net/mrvl: add link speed capabilities

In reply to Tomasz Duszynski

Return supported link speed capabilities via rte_dev_info_get().

---
 doc/guides/nics/features/mrvl.ini | 1 +
 drivers/net/mrvl/mrvl_ethdev.c    | 5 +++++
 2 files changed, 6 insertions(+)
doc/guides/nics/features/mrvl.ini +1 -0
index 72df92e..c3b9edf 100644
@@ -4,4 +4,5 @@
 ; Refer to default.ini for the full list of available PMD features.
 ;
 [Features]
+Speed capabilities   = Y
 Link status          = Y
drivers/net/mrvl/mrvl_ethdev.c +5 -0
index 4788784..7bd0dad 100644
@@ -576,6 +576,11 @@ static void
 mrvl_dev_infos_get(struct rte_eth_dev *dev __rte_unused,
 		   struct rte_eth_dev_info *info)
 {
+	info->speed_capa = ETH_LINK_SPEED_10M |
+			   ETH_LINK_SPEED_100M |
+			   ETH_LINK_SPEED_1G |
+			   ETH_LINK_SPEED_10G;
+
 	info->max_rx_queues = MRVL_PP2_RXQ_MAX;
 	info->max_tx_queues = MRVL_PP2_TXQ_MAX;
 	info->max_mac_addrs = MRVL_MAC_ADDRS_MAX;
Signature · 1 line
2.7.4
#44 lore raw

PATCH v4 6/16 net/mrvl: add support for updating mtu

In reply to Tomasz Duszynski

Add support for updating mtu.

---
 doc/guides/nics/features/mrvl.ini |  1 +
 drivers/net/mrvl/mrvl_ethdev.c    | 44 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
doc/guides/nics/features/mrvl.ini +1 -0
index c3b9edf..13cfaab 100644
@@ -6,3 +6,4 @@
 [Features]
 Speed capabilities   = Y
 Link status          = Y
+MTU update           = Y
drivers/net/mrvl/mrvl_ethdev.c +44 -0

62 lines not on this page · raw message

Signature · 1 line
2.7.4
#45 lore raw

PATCH v4 7/16 net/mrvl: add jumbo frame support

In reply to Tomasz Duszynski

Add jumbo frame support.

---
 doc/guides/nics/features/mrvl.ini | 1 +
 drivers/net/mrvl/mrvl_ethdev.c    | 5 +++++
 2 files changed, 6 insertions(+)
doc/guides/nics/features/mrvl.ini +1 -0
index 13cfaab..2ddabfb 100644
@@ -7,3 +7,4 @@
 Speed capabilities   = Y
 Link status          = Y
 MTU update           = Y
+Jumbo frame          = Y
drivers/net/mrvl/mrvl_ethdev.c +5 -0
index 628d4de..3a5f6a0 100644
@@ -227,6 +227,10 @@ mrvl_dev_configure(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+	if (dev->data->dev_conf.rxmode.jumbo_frame)
+		dev->data->mtu = dev->data->dev_conf.rxmode.max_rx_pkt_len -
+				 ETHER_HDR_LEN - ETHER_CRC_LEN;
+
 	ret = mrvl_configure_rxqs(priv, dev->data->port_id,
 				  dev->data->nb_rx_queues);
 	if (ret < 0)
@@ -636,6 +640,7 @@ mrvl_dev_infos_get(struct rte_eth_dev *dev __rte_unused,
 	info->tx_desc_lim.nb_min = MRVL_PP2_TXD_MIN;
 	info->tx_desc_lim.nb_align = MRVL_PP2_TXD_ALIGN;
 
+	info->rx_offload_capa = DEV_RX_OFFLOAD_JUMBO_FRAME;
 	/* By default packets are dropped if no descriptors are available */
 	info->default_rxconf.rx_drop_en = 1;
 
Signature · 1 line
2.7.4
#46 lore raw

PATCH v4 8/16 net/mrvl: add support for promiscuous and allmulticast modes

In reply to Tomasz Duszynski

Add support for promiscuous and allmulticast modes.

---
 doc/guides/nics/features/mrvl.ini |  2 ++
 drivers/net/mrvl/mrvl_ethdev.c    | 72 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+)
doc/guides/nics/features/mrvl.ini +2 -0
index 2ddabfb..c2df525 100644
@@ -8,3 +8,5 @@ Speed capabilities   = Y
 Link status          = Y
 MTU update           = Y
 Jumbo frame          = Y
+Promiscuous mode     = Y
+Allmulticast mode    = Y
drivers/net/mrvl/mrvl_ethdev.c +72 -0

84 lines not on this page · raw message

Signature · 1 line
2.7.4
#47 lore raw

PATCH v4 9/16 net/mrvl: add support for mac filtering

In reply to Tomasz Duszynski

Add support for unicast and multicast mac filters.

---
 doc/guides/nics/features/mrvl.ini |  2 +
 drivers/net/mrvl/mrvl_ethdev.c    | 95 ++++++++++++++++++++++++++++++++++++++-
 drivers/net/mrvl/mrvl_ethdev.h    |  1 +
 3 files changed, 97 insertions(+), 1 deletion(-)
doc/guides/nics/features/mrvl.ini +2 -0
index c2df525..2243749 100644
@@ -10,3 +10,5 @@ MTU update           = Y
 Jumbo frame          = Y
 Promiscuous mode     = Y
 Allmulticast mode    = Y
+Unicast MAC filter   = Y
+Multicast MAC filter = Y
drivers/net/mrvl/mrvl_ethdev.c +94 -1

122 lines not on this page · raw message

drivers/net/mrvl/mrvl_ethdev.h +1 -0
index da33d05..f43f426 100644
@@ -98,6 +98,7 @@ struct mrvl_priv {
 	uint8_t pp_id;
 	uint8_t ppio_id;
 	uint8_t bpool_bit;
+	uint8_t uc_mc_flushed;
 
 	struct pp2_ppio_params ppio_params;
 	struct pp2_cls_qos_tbl_params qos_tbl_params;
Signature · 1 line
2.7.4
#48 lore raw

PATCH v4 10/16 net/mrvl: add rss hashing support

In reply to Tomasz Duszynski

Add support for rss hashing on rx.

---
 doc/guides/nics/features/mrvl.ini |   1 +
 drivers/net/mrvl/mrvl_ethdev.c    | 116 +++++++++++++++++++++++++++++++++++++-
 drivers/net/mrvl/mrvl_ethdev.h    |   1 +
 3 files changed, 115 insertions(+), 3 deletions(-)
doc/guides/nics/features/mrvl.ini +1 -0
index 2243749..e65dea7 100644
@@ -12,3 +12,4 @@ Promiscuous mode     = Y
 Allmulticast mode    = Y
 Unicast MAC filter   = Y
 Multicast MAC filter = Y
+RSS hash             = Y
drivers/net/mrvl/mrvl_ethdev.c +113 -3

166 lines not on this page · raw message

drivers/net/mrvl/mrvl_ethdev.h +1 -0
index f43f426..136c555 100644
@@ -98,6 +98,7 @@ struct mrvl_priv {
 	uint8_t pp_id;
 	uint8_t ppio_id;
 	uint8_t bpool_bit;
+	uint8_t rss_hf_tcp;
 	uint8_t uc_mc_flushed;
 
 	struct pp2_ppio_params ppio_params;
Signature · 1 line
2.7.4
#49 lore raw

PATCH v4 11/16 net/mrvl: add support for vlan filtering

In reply to Tomasz Duszynski

Add support for vlan filtering.

---
 doc/guides/nics/features/mrvl.ini |  1 +
 drivers/net/mrvl/mrvl_ethdev.c    | 39 ++++++++++++++++++++++++++++++++++++++-
 drivers/net/mrvl/mrvl_ethdev.h    |  1 +
 3 files changed, 40 insertions(+), 1 deletion(-)
doc/guides/nics/features/mrvl.ini +1 -0
index e65dea7..5d9132e 100644
@@ -13,3 +13,4 @@ Allmulticast mode    = Y
 Unicast MAC filter   = Y
 Multicast MAC filter = Y
 RSS hash             = Y
+VLAN filter          = Y
drivers/net/mrvl/mrvl_ethdev.c +38 -1
index fe2603a..7023f5b 100644
@@ -439,6 +439,19 @@ mrvl_dev_start(struct rte_eth_dev *dev)
 		priv->uc_mc_flushed = 1;
 	}
 
+	if (!priv->vlan_flushed) {
+		ret = pp2_ppio_flush_vlan(priv->ppio);
+		if (ret) {
+			RTE_LOG(ERR, PMD, "Failed to flush vlan list\n");
+			/*
+			 * TODO
+			 * once pp2_ppio_flush_vlan() is supported jump to out
+			 * goto out;
+			 */
+		}
+		priv->vlan_flushed = 1;
+	}
+
 	/* For default QoS config, don't start classifier. */
 	if (mrvl_qos_cfg) {
 		ret = mrvl_start_qos_mapping(priv);
@@ -849,7 +862,8 @@ mrvl_dev_infos_get(struct rte_eth_dev *dev __rte_unused,
 	info->tx_desc_lim.nb_min = MRVL_PP2_TXD_MIN;
 	info->tx_desc_lim.nb_align = MRVL_PP2_TXD_ALIGN;
 
-	info->rx_offload_capa = DEV_RX_OFFLOAD_JUMBO_FRAME;
+	info->rx_offload_capa = DEV_RX_OFFLOAD_JUMBO_FRAME |
+				DEV_RX_OFFLOAD_VLAN_FILTER;
 	info->flow_type_rss_offloads = ETH_RSS_IPV4 |
 				       ETH_RSS_NONFRAG_IPV4_TCP |
 				       ETH_RSS_NONFRAG_IPV4_UDP;
@@ -904,6 +918,28 @@ static void mrvl_txq_info_get(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 }
 
 /**
+ * DPDK callback to Configure a VLAN filter.
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure.
+ * @param vlan_id
+ *   VLAN ID to filter.
+ * @param on
+ *   Toggle filter.
+ *
+ * @return
+ *   0 on success, negative error value otherwise.
+ */
+static int
+mrvl_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
+{
+	struct mrvl_priv *priv = dev->data->dev_private;
+
+	return on ? pp2_ppio_add_vlan(priv->ppio, vlan_id) :
+		    pp2_ppio_remove_vlan(priv->ppio, vlan_id);
+}
+
+/**
  * Release buffers to hardware bpool (buffer-pool)
  *
  * @param rxq
@@ -1211,6 +1247,7 @@ static const struct eth_dev_ops mrvl_ops = {
 	.dev_infos_get = mrvl_dev_infos_get,
 	.rxq_info_get = mrvl_rxq_info_get,
 	.txq_info_get = mrvl_txq_info_get,
+	.vlan_filter_set = mrvl_vlan_filter_set,
 	.rx_queue_setup = mrvl_rx_queue_setup,
 	.rx_queue_release = mrvl_rx_queue_release,
 	.tx_queue_setup = mrvl_tx_queue_setup,
drivers/net/mrvl/mrvl_ethdev.h +1 -0
index 136c555..72af4c7 100644
@@ -100,6 +100,7 @@ struct mrvl_priv {
 	uint8_t bpool_bit;
 	uint8_t rss_hf_tcp;
 	uint8_t uc_mc_flushed;
+	uint8_t vlan_flushed;
 
 	struct pp2_ppio_params ppio_params;
 	struct pp2_cls_qos_tbl_params qos_tbl_params;
Signature · 1 line
2.7.4
#50 lore raw

PATCH v4 12/16 net/mrvl: add crc, l3 and l4 offloads support

In reply to Tomasz Duszynski

Add support for crc offload and l3/l4 checksum offloads.

---
 doc/guides/nics/features/mrvl.ini |   3 +
 drivers/net/mrvl/mrvl_ethdev.c    | 204 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 205 insertions(+), 2 deletions(-)
doc/guides/nics/features/mrvl.ini +3 -0
index 5d9132e..8407b60 100644
@@ -14,3 +14,6 @@ Unicast MAC filter   = Y
 Multicast MAC filter = Y
 RSS hash             = Y
 VLAN filter          = Y
+CRC offload          = Y
+L3 checksum offload  = Y
+L4 checksum offload  = Y
drivers/net/mrvl/mrvl_ethdev.c +202 -2

264 lines not on this page · raw message

Signature · 1 line
2.7.4
#51 lore raw

PATCH v4 13/16 net/mrvl: add packet type parsing support.

In reply to Tomasz Duszynski

Add packet type parsing support.

---
 doc/guides/nics/features/mrvl.ini |  1 +
 drivers/net/mrvl/mrvl_ethdev.c    | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)
doc/guides/nics/features/mrvl.ini +1 -0
index 8407b60..31b8a9c 100644
@@ -17,3 +17,4 @@ VLAN filter          = Y
 CRC offload          = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
+Packet type parsing  = Y
drivers/net/mrvl/mrvl_ethdev.c +28 -0
index f7dbdba..d7a8527 100644
@@ -884,6 +884,33 @@ mrvl_dev_infos_get(struct rte_eth_dev *dev __rte_unused,
 }
 
 /**
+ * Return supported packet types.
+ *
+ * @param dev
+ *   Pointer to Ethernet device structure (unused).
+ *
+ * @return
+ *   Const pointer to the table with supported packet types.
+ */
+static const uint32_t *
+mrvl_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)
+{
+	static const uint32_t ptypes[] = {
+		RTE_PTYPE_L2_ETHER,
+		RTE_PTYPE_L3_IPV4,
+		RTE_PTYPE_L3_IPV4_EXT,
+		RTE_PTYPE_L3_IPV4_EXT_UNKNOWN,
+		RTE_PTYPE_L3_IPV6,
+		RTE_PTYPE_L3_IPV6_EXT,
+		RTE_PTYPE_L2_ETHER_ARP,
+		RTE_PTYPE_L4_TCP,
+		RTE_PTYPE_L4_UDP
+	};
+
+	return ptypes;
+}
+
+/**
  * DPDK callback to get information about specific receive queue.
  *
  * @param dev
@@ -1255,6 +1282,7 @@ static const struct eth_dev_ops mrvl_ops = {
 	.mac_addr_set = mrvl_mac_addr_set,
 	.mtu_set = mrvl_mtu_set,
 	.dev_infos_get = mrvl_dev_infos_get,
+	.dev_supported_ptypes_get = mrvl_dev_supported_ptypes_get,
 	.rxq_info_get = mrvl_rxq_info_get,
 	.txq_info_get = mrvl_txq_info_get,
 	.vlan_filter_set = mrvl_vlan_filter_set,
Signature · 1 line
2.7.4
#52 lore raw

PATCH v4 14/16 net/mrvl: add basic stats support

In reply to Tomasz Duszynski

Add support for both per queue and overall basic statistics.

---
 doc/guides/nics/features/mrvl.ini |   1 +
 drivers/net/mrvl/mrvl_ethdev.c    | 142 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 142 insertions(+), 1 deletion(-)
doc/guides/nics/features/mrvl.ini +1 -0
index 31b8a9c..3643b8b 100644
@@ -18,3 +18,4 @@ CRC offload          = Y
 L3 checksum offload  = Y
 L4 checksum offload  = Y
 Packet type parsing  = Y
+Basic stats          = Y
drivers/net/mrvl/mrvl_ethdev.c +141 -1

207 lines not on this page · raw message

Signature · 1 line
2.7.4
#53 lore raw

PATCH v4 15/16 maintainers: add maintainers for the mrvl net pmd

In reply to Tomasz Duszynski
---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index 1b74f98..5c78477 100644
@@ -392,6 +392,16 @@ F: drivers/net/mlx5/
 F: doc/guides/nics/mlx5.rst
 F: doc/guides/nics/features/mlx5.ini
 
+Marvell mrvl
+M: Jacek Siuda <[email protected]>
+M: Tomasz Duszynski <[email protected]>
+M: Dmitri Epshtein <[email protected]>
+M: Natalie Samsonov <[email protected]>
+M: Jianbo Liu <[email protected]>
+F: drivers/net/mrvl/
+F: doc/guides/nics/mrvl.rst
+F: doc/guides/nics/features/mrvl.ini
+
 Netcope szedata2
 M: Matej Vido <[email protected]>
 F: drivers/net/szedata2/
Signature · 1 line
2.7.4
#54 lore raw

Re: [PATCH v4 15/16] maintainers: add maintainers for the mrvl net pmd

Quoted 2 lines · Tomasz Duszynski

Congratulations!,

this is the 30000. patch in patchwork:
http://dpdk.org/dev/patchwork/patch/30000/

20000 was here:
http://dpdk.org/ml/archives/dev/2017-January/056354.html

10K patches in less than 10 months (close to 9 months), this is lots of patches :)

#55 lore raw

Re: [PATCH v4 15/16] maintainers: add maintainers for the mrvl net pmd

2017-10-09 21:02 GMT+02:00 Ferruh Yigit <[email protected]>:

Quoted 8 lines · Tomasz Duszynski
Quoted 2 lines

Congratulations!,

this is the 30000. patch in patchwork:
http://dpdk.org/dev/patchwork/patch/30000/

There's no other option now, but to merge the jubilee patchset ;)

Best regards,
Marcin

Quoted 6 lines

20000 was here:
http://dpdk.org/ml/archives/dev/2017-January/056354.html

10K patches in less than 10 months (close to 9 months), this is lots of patches :)

#56 lore raw

Re: [PATCH v4 15/16] maintainers: add maintainers for the mrvl net pmd

Quoted 11 lines · Marcin Wojtas

2017-10-09 21:02 GMT+02:00 Ferruh Yigit <[email protected]>:

Quoted 8 lines · Tomasz Duszynski
Quoted 2 lines

Congratulations!,

this is the 30000. patch in patchwork:
http://dpdk.org/dev/patchwork/patch/30000/

There's no other option now, but to merge the jubilee patchset ;)

nice try ;)

Quoted 10 lines

Best regards,
Marcin

Quoted 6 lines

20000 was here:
http://dpdk.org/ml/archives/dev/2017-January/056354.html

10K patches in less than 10 months (close to 9 months), this is lots of patches :)

#57 lore raw

Re: [PATCH v4 15/16] maintainers: add maintainers for the mrvl net pmd

In reply to Ferruh Yigit
Quoted 7 lines · Ferruh Yigit
Quoted 2 lines · Tomasz Duszynski

Congratulations!,

this is the 30000. patch in patchwork:

30k patch and series applied, double win.

Quoted 7 lines

http://dpdk.org/dev/patchwork/patch/30000/

20000 was here:
http://dpdk.org/ml/archives/dev/2017-January/056354.html

10K patches in less than 10 months (close to 9 months), this is lots of patches :)

Lots of reviewing as well :).

--
- Tomasz Duszyński

#58 lore raw

Re: [PATCH v4 15/16] maintainers: add maintainers for the mrvl net pmd

In reply to Tomasz Duszynski
Quoted 11 lines · Tomasz Duszynski
---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +0 -0
index 1b74f98..5c78477 100644

MAINTAINERS F: drivers/net/mlx5/ · line 400

Quoted 9 lines
MAINTAINERS +6 -0
@@ -392,6 +392,16 @@ F: drivers/net/mlx5/
 F: doc/guides/nics/mlx5.rst
 F: doc/guides/nics/features/mlx5.ini
 
+Marvell mrvl
+M: Jacek Siuda <[email protected]>
+M: Tomasz Duszynski <[email protected]>
+M: Dmitri Epshtein <[email protected]>
+M: Natalie Samsonov <[email protected]>
+M: Jianbo Liu <[email protected]>

Please change my email to [email protected], thanks.

Quoted 10 lines
MAINTAINERS +4 -1
+F: drivers/net/mrvl/
+F: doc/guides/nics/mrvl.rst
+F: doc/guides/nics/features/mrvl.ini
+
 Netcope szedata2
 M: Matej Vido <[email protected]>
 F: drivers/net/szedata2/
--

2.7.4

#59 lore raw

Re: [PATCH v4 15/16] maintainers: add maintainers for the mrvl net pmd

Quoted 15 lines · Jianbo Liu
Quoted 14 lines · Tomasz Duszynski
---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +0 -0
index 1b74f98..5c78477 100644
@@ -392,6 +392,16 @@ F: drivers/net/mlx5/
 F: doc/guides/nics/mlx5.rst
 F: doc/guides/nics/features/mlx5.ini
 
Quoted 8 lines

MAINTAINERS F: drivers/net/mlx5/ · line 400

Quoted 6 lines
MAINTAINERS +6 -0
+Marvell mrvl
+M: Jacek Siuda <[email protected]>
+M: Tomasz Duszynski <[email protected]>
+M: Dmitri Epshtein <[email protected]>
+M: Natalie Samsonov <[email protected]>
+M: Jianbo Liu <[email protected]>

Please change my email to [email protected], thanks.

Done.

#60 lore raw

PATCH v4 16/16 doc: add mrvl net pmd documentation

In reply to Tomasz Duszynski

Add documentation for the MRVL NET PMD driver.

---
 doc/guides/nics/features/mrvl.ini |   2 +
 doc/guides/nics/index.rst         |   1 +
 doc/guides/nics/mrvl.rst          | 256 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 259 insertions(+)
 create mode 100644 doc/guides/nics/mrvl.rst
doc/guides/nics/features/mrvl.ini +2 -0
index 3643b8b..00d9621 100644
@@ -19,3 +19,5 @@ L3 checksum offload  = Y
 L4 checksum offload  = Y
 Packet type parsing  = Y
 Basic stats          = Y
+ARMv8                = Y
+Usage doc            = Y
doc/guides/nics/index.rst +1 -0
index 4115141..df19ec7 100644
@@ -56,6 +56,7 @@ Network Interface Controller Drivers
     liquidio
     mlx4
     mlx5
+    mrvl
     nfp
     qede
     sfc_efx
doc/guides/nics/mrvl.rst new file +256 -0

256 lines not on this page · raw message

Signature · 1 line
2.7.4
#63 lore raw

Re: [PATCH v4 16/16] doc: add mrvl net pmd documentation

In reply to Tomasz Duszynski

09/10/2017 17:00, Tomasz Duszynski:

Quoted 4 lines

+- MUSDK (Marvell User-Space SDK) sources available

doc/guides/nics/mrvl.rst new file +3 -0
+  `here <https://github.com/MarvellEmbeddedProcessors/musdk-marvell/tree/musdk-armada-17.08>`__.
+
+    MUSDK is a light-weight library that provides direct access to Marvell's

doc/guides/nics/mrvl.rst line 108

Quoted 10 lines
doc/guides/nics/mrvl.rst new file +10 -0
+    PPv2 (Packet Processor v2). Alternatively prebuilt MUSDK library can be
+    requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
+    approval has been granted, library can be found by typing ``musdk`` in
+    the search box.
+
+    MUSDK must be configured with the following features:
+
+    .. code-block:: console
+
+       --enable-bpool-dma=64

It is really too short.
This is what I did:

export CROSS_COMPILE=<toolchain>/bin/aarch64-linux-gnu- export CROSS_COMPILE=<toolchain>/bin/arm-linux-gnueabi- export ARCH=arm64
./bootstrap
./configure --host=aarch64-linux-gnu --enable-bpool-dma=64 make install

But if fails at link step:

CCLD libmusdk.la
gcc-linaro-7.1.1-2017.08-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.1.1/../../../../aarch64-linux-gnu/bin/ld: lib/.libs/libmusdk_la-list.o: Relocations in generic ELF (EM: 62) lib/.libs/libmusdk_la-list.o: error adding symbols: File in wrong format

Please help

#64 lore raw

Re: [PATCH v4 16/16] doc: add mrvl net pmd documentation

11/10/2017 16:27, Thomas Monjalon:

Quoted 26 lines

09/10/2017 17:00, Tomasz Duszynski:

Quoted 4 lines

+- MUSDK (Marvell User-Space SDK) sources available

doc/guides/nics/mrvl.rst new file +3 -0
+  `here <https://github.com/MarvellEmbeddedProcessors/musdk-marvell/tree/musdk-armada-17.08>`__.
+
+    MUSDK is a light-weight library that provides direct access to Marvell's

doc/guides/nics/mrvl.rst line 108

Quoted 10 lines
doc/guides/nics/mrvl.rst new file +10 -0
+    PPv2 (Packet Processor v2). Alternatively prebuilt MUSDK library can be
+    requested from `Marvell Extranet <https://extranet.marvell.com>`_. Once
+    approval has been granted, library can be found by typing ``musdk`` in
+    the search box.
+
+    MUSDK must be configured with the following features:
+
+    .. code-block:: console
+
+       --enable-bpool-dma=64

It is really too short.
This is what I did:

export CROSS_COMPILE=<toolchain>/bin/aarch64-linux-gnu- export CROSS_COMPILE=<toolchain>/bin/arm-linux-gnueabi- export ARCH=arm64
./bootstrap
./configure --host=aarch64-linux-gnu --enable-bpool-dma=64 make install

Quoted 7 lines

But if fails at link step:

CCLD libmusdk.la
gcc-linaro-7.1.1-2017.08-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.1.1/../../../../aarch64-linux-gnu/bin/ld: lib/.libs/libmusdk_la-list.o: Relocations in generic ELF (EM: 62) lib/.libs/libmusdk_la-list.o: error adding symbols: File in wrong format

Please help

This failure was probably due to a previous wrong configuration. After "make clean", it works.

When looking at your wiki, there are more options used:
https://github.com/MarvellEmbeddedProcessors/dpdk-marvell/wiki/Building-and-Running
--enable-bpool-cookie=64 \
--enable-bpool-dma=64 \
--enable-dma-addr=64 \
--enable-sam

Are they needed?

#65 lore raw

Re: [PATCH v4 00/16] add net mrvl pmd driver

In reply to Tomasz Duszynski
Quoted 49 lines · Tomasz Duszynski

Hello,

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Below you can find the list of features which net pmd supports:
* Speed capabilities
* Link status
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* QoS

Changes since v3:
* Split driver into skeleton, rx/tx, features, documentation parts
* Added speed capabilities flags.
* Added missing rx offload flags: VLAN/JUMBOFRAME
* Updated release notes.
* Updated documentation.

Changes since v2:
* Removed LINE_SPACING, MULTILINE_DEREFERENCE and SPLIT_STRING checkpatch warnings.
* Removed unnecessary forward declarations.
* Fixed whitespace warnings.

Changes since v1:
* Changed commit message to explain problem better.
* Removed bunch of checkpatch warnings about unnecessary parentheses.

Tomasz Duszynski (4):
app: link the whole rte_cfgfile library
net/mrvl: add mrvl net pmd driver skeleton net/mrvl: add rx/tx support
net/mrvl: add link update
net/mrvl: add link speed capabilities
net/mrvl: add support for updating mtu
net/mrvl: add jumbo frame support
net/mrvl: add support for promiscuous and allmulticast modes

Quoted 8 lines

net/mrvl: add support for mac filtering net/mrvl: add rss hashing support net/mrvl: add support for vlan filtering net/mrvl: add crc, l3 and l4 offloads support net/mrvl: add packet type parsing support. net/mrvl: add basic stats support
maintainers: add maintainers for the mrvl net pmd
doc: add mrvl net pmd documentation

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

(I can't compile because of missing musdk library, but since PMD is disabled by default this is not so bad, lets get this for rc1 and for crypto dependency, later I can have my environment set and test)

#66 lore raw

Re: [PATCH v4 00/16] add net mrvl pmd driver

Quoted 59 lines · Ferruh Yigit
Quoted 49 lines · Tomasz Duszynski

Hello,

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Below you can find the list of features which net pmd supports:
* Speed capabilities
* Link status
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* QoS

Changes since v3:
* Split driver into skeleton, rx/tx, features, documentation parts
* Added speed capabilities flags.
* Added missing rx offload flags: VLAN/JUMBOFRAME
* Updated release notes.
* Updated documentation.

Changes since v2:
* Removed LINE_SPACING, MULTILINE_DEREFERENCE and SPLIT_STRING checkpatch warnings.
* Removed unnecessary forward declarations.
* Fixed whitespace warnings.

Changes since v1:
* Changed commit message to explain problem better.
* Removed bunch of checkpatch warnings about unnecessary parentheses.

Tomasz Duszynski (4):
app: link the whole rte_cfgfile library
net/mrvl: add mrvl net pmd driver skeleton net/mrvl: add rx/tx support
net/mrvl: add link update
net/mrvl: add link speed capabilities
net/mrvl: add support for updating mtu
net/mrvl: add jumbo frame support
net/mrvl: add support for promiscuous and allmulticast modes

Quoted 8 lines

net/mrvl: add support for mac filtering net/mrvl: add rss hashing support net/mrvl: add support for vlan filtering net/mrvl: add crc, l3 and l4 offloads support net/mrvl: add packet type parsing support. net/mrvl: add basic stats support
maintainers: add maintainers for the mrvl net pmd
doc: add mrvl net pmd documentation

Quoted 1 line

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

Can you also add a web patch [1] to list NICs as supported NICs [2] ?

[1]
http://dpdk.org/browse/tools/dpdk-web/

[2]
http://dpdk.org/doc/nics

Quoted 5 lines

(I can't compile because of missing musdk library, but since PMD is disabled by default this is not so bad, lets get this for rc1 and for crypto dependency, later I can have my environment set and test)

#67 lore raw

Re: [PATCH v4 00/16] add net mrvl pmd driver

Quoted 62 lines · Ferruh Yigit
Quoted 59 lines · Ferruh Yigit
Quoted 49 lines · Tomasz Duszynski

Hello,

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Below you can find the list of features which net pmd supports:
* Speed capabilities
* Link status
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* QoS

Changes since v3:
* Split driver into skeleton, rx/tx, features, documentation parts
* Added speed capabilities flags.
* Added missing rx offload flags: VLAN/JUMBOFRAME
* Updated release notes.
* Updated documentation.

Changes since v2:
* Removed LINE_SPACING, MULTILINE_DEREFERENCE and SPLIT_STRING checkpatch warnings.
* Removed unnecessary forward declarations.
* Fixed whitespace warnings.

Changes since v1:
* Changed commit message to explain problem better.
* Removed bunch of checkpatch warnings about unnecessary parentheses.

Tomasz Duszynski (4):
app: link the whole rte_cfgfile library
net/mrvl: add mrvl net pmd driver skeleton net/mrvl: add rx/tx support
net/mrvl: add link update
net/mrvl: add link speed capabilities
net/mrvl: add support for updating mtu
net/mrvl: add jumbo frame support
net/mrvl: add support for promiscuous and allmulticast modes

Quoted 8 lines

net/mrvl: add support for mac filtering net/mrvl: add rss hashing support net/mrvl: add support for vlan filtering net/mrvl: add crc, l3 and l4 offloads support net/mrvl: add packet type parsing support. net/mrvl: add basic stats support
maintainers: add maintainers for the mrvl net pmd
doc: add mrvl net pmd documentation

Quoted 1 line

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

Quoted 15 lines

Can you also add a web patch [1] to list NICs as supported NICs [2] ?

[1]
http://dpdk.org/browse/tools/dpdk-web/

[2]
http://dpdk.org/doc/nics

Quoted 5 lines

(I can't compile because of missing musdk library, but since PMD is disabled by default this is not so bad, lets get this for rc1 and for crypto dependency, later I can have my environment set and test)

ACK

--
- Tomasz Duszyński

#68 lore raw

Re: [PATCH v4 00/16] add net mrvl pmd driver

In reply to Ferruh Yigit
Quoted 59 lines · Ferruh Yigit
Quoted 49 lines · Tomasz Duszynski

Hello,

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Below you can find the list of features which net pmd supports:
* Speed capabilities
* Link status
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* QoS

Changes since v3:
* Split driver into skeleton, rx/tx, features, documentation parts
* Added speed capabilities flags.
* Added missing rx offload flags: VLAN/JUMBOFRAME
* Updated release notes.
* Updated documentation.

Changes since v2:
* Removed LINE_SPACING, MULTILINE_DEREFERENCE and SPLIT_STRING checkpatch warnings.
* Removed unnecessary forward declarations.
* Fixed whitespace warnings.

Changes since v1:
* Changed commit message to explain problem better.
* Removed bunch of checkpatch warnings about unnecessary parentheses.

Tomasz Duszynski (4):
app: link the whole rte_cfgfile library
net/mrvl: add mrvl net pmd driver skeleton net/mrvl: add rx/tx support
net/mrvl: add link update
net/mrvl: add link speed capabilities
net/mrvl: add support for updating mtu
net/mrvl: add jumbo frame support
net/mrvl: add support for promiscuous and allmulticast modes

Quoted 8 lines

net/mrvl: add support for mac filtering net/mrvl: add rss hashing support net/mrvl: add support for vlan filtering net/mrvl: add crc, l3 and l4 offloads support net/mrvl: add packet type parsing support. net/mrvl: add basic stats support
maintainers: add maintainers for the mrvl net pmd
doc: add mrvl net pmd documentation

Quoted 5 lines

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

(I can't compile because of missing musdk library, but since PMD is disabled by default this is not so bad, lets get this for rc1 and for crypto dependency, later I can have my environment set and test)

Thanks!

--
- Tomasz Duszyński

#69 lore raw

Re: [PATCH v4 00/16] add net mrvl pmd driver

In reply to Ferruh Yigit
Quoted 59 lines · Ferruh Yigit
Quoted 49 lines · Tomasz Duszynski

Hello,

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Below you can find the list of features which net pmd supports:
* Speed capabilities
* Link status
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* QoS

Changes since v3:
* Split driver into skeleton, rx/tx, features, documentation parts
* Added speed capabilities flags.
* Added missing rx offload flags: VLAN/JUMBOFRAME
* Updated release notes.
* Updated documentation.

Changes since v2:
* Removed LINE_SPACING, MULTILINE_DEREFERENCE and SPLIT_STRING checkpatch warnings.
* Removed unnecessary forward declarations.
* Fixed whitespace warnings.

Changes since v1:
* Changed commit message to explain problem better.
* Removed bunch of checkpatch warnings about unnecessary parentheses.

Tomasz Duszynski (4):
app: link the whole rte_cfgfile library
net/mrvl: add mrvl net pmd driver skeleton net/mrvl: add rx/tx support
net/mrvl: add link update
net/mrvl: add link speed capabilities
net/mrvl: add support for updating mtu
net/mrvl: add jumbo frame support
net/mrvl: add support for promiscuous and allmulticast modes

Quoted 8 lines

net/mrvl: add support for mac filtering net/mrvl: add rss hashing support net/mrvl: add support for vlan filtering net/mrvl: add crc, l3 and l4 offloads support net/mrvl: add packet type parsing support. net/mrvl: add basic stats support
maintainers: add maintainers for the mrvl net pmd
doc: add mrvl net pmd documentation

Quoted 5 lines

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

(I can't compile because of missing musdk library, but since PMD is disabled by default this is not so bad, lets get this for rc1 and for crypto dependency, later I can have my environment set and test)

Did able to compile but I have questions :)

1- Used the "arm64-armv8a-linuxapp-gcc" config, can you please confirm. Does it make sense to document this?

2- I used different toolchain than documented in musdk, which uses a marvel one. Can you please confirm any aarch64-linux-gnu-gcc is OK?

3- Used following command:
CROSS=<toolchain>/aarch64-linux-gnu- make
EXTRA_CFLAGS="-I.../musdk-marvell/src/include
-L.../musdk-marvell/src/.libs/"

Do you also need to use EXTRA_CFLAGS? Otherwise I can't compile. If you also use it please document it, if not please share with us how to do?

4- musk generated a static library, can you please confirm there is a way to generate a shared musdk library as well?

5- Still not tested building kernel modules, and building musdk with ./configure options, I will do later.

Thanks,
ferruh

#70 lore raw

PATCH 1/1 doc: add build steps to mrvl NIC guide

Show how to compile MUSDK and enable compilation of the mrvl PMD.

The build test tool is also updated to support this new PMD.

---
 devtools/test-build.sh   |  4 ++++
 doc/guides/nics/mrvl.rst | 15 +++++++++++++++
 2 files changed, 19 insertions(+)
devtools/test-build.sh +4 -0
index c6dfaf0a8..4d7eaa499 100755
@@ -47,6 +47,7 @@ default_path=$PATH
 # - DPDK_DEP_ZLIB (y/[n])
 # - DPDK_MAKE_JOBS (int)
 # - DPDK_NOTIFY (notify-send)
+# - LIBMUSDK_PATH
 # - LIBSSO_SNOW3G_PATH
 # - LIBSSO_KASUMI_PATH
 # - LIBSSO_ZUC_PATH
@@ -129,6 +130,7 @@ reset_env ()
 	unset DPDK_DEP_ZLIB
 	unset AESNI_MULTI_BUFFER_LIB_PATH
 	unset ARMV8_CRYPTO_LIB_PATH
+	unset LIBMUSDK_PATH
 	unset LIBSSO_SNOW3G_PATH
 	unset LIBSSO_KASUMI_PATH
 	unset LIBSSO_ZUC_PATH
@@ -169,6 +171,8 @@ config () # <directory> <target> <options>
 		sed -ri       's,(RESOURCE_TAR=)n,\1y,' $1/.config
 		test "$DPDK_DEP_MOFED" != y || \
 		sed -ri           's,(MLX._PMD=)n,\1y,' $1/.config
+		test -z "$LIBMUSDK_PATH" || \
+		sed -ri           's,(MRVL_PMD=)n,\1y,' $1/.config
 		test "$DPDK_DEP_SZE" != y || \
 		sed -ri       's,(PMD_SZEDATA2=)n,\1y,' $1/.config
 		test "$DPDK_DEP_ZLIB" != y || \
doc/guides/nics/mrvl.rst +15 -0
index 462bc0e9d..df0032bda 100644
@@ -221,9 +221,24 @@ Building DPDK
 Driver needs precompiled MUSDK library during compilation. Please consult
 ``doc/musdk_get_started.txt`` for the detailed build instructions.
 
+.. code-block:: console
+
+   export CROSS_COMPILE=<toolchain>/bin/aarch64-linux-gnu-
+   ./bootstrap
+   ./configure --enable-bpool-dma=64
+   make install
+
 Before the DPDK build process the environmental variable ``LIBMUSDK_PATH`` with
 the path to the MUSDK installation directory needs to be exported.
 
+.. code-block:: console
+
+   export LIBMUSDK_PATH=<musdk>/usr/local
+   export CROSS=aarch64-linux-gnu-
+   make config T=arm64-armv8a-linuxapp-gcc
+   sed -ri 's,(MRVL_PMD=)n,\1y,' build/.config
+   make
+
 
 Usage Example
 -------------
Signature · 1 line
2.14.1
author Acked-by on v1 1/1
#71 lore raw

Re: [PATCH] doc: add build steps to mrvl NIC guide

Quoted 31 lines · Thomas Monjalon

Show how to compile MUSDK and enable compilation of the mrvl PMD.

The build test tool is also updated to support this new PMD.

---
 devtools/test-build.sh   |  4 ++++
 doc/guides/nics/mrvl.rst | 15 +++++++++++++++
 2 files changed, 19 insertions(+)
devtools/test-build.sh +2 -0
index c6dfaf0a8..4d7eaa499 100755
@@ -47,6 +47,7 @@ default_path=$PATH
 # - DPDK_DEP_ZLIB (y/[n])
 # - DPDK_MAKE_JOBS (int)
 # - DPDK_NOTIFY (notify-send)
+# - LIBMUSDK_PATH
 # - LIBSSO_SNOW3G_PATH
 # - LIBSSO_KASUMI_PATH
 # - LIBSSO_ZUC_PATH
@@ -129,6 +130,7 @@ reset_env ()
 	unset DPDK_DEP_ZLIB
 	unset AESNI_MULTI_BUFFER_LIB_PATH
 	unset ARMV8_CRYPTO_LIB_PATH
+	unset LIBMUSDK_PATH
 	unset LIBSSO_SNOW3G_PATH
 	unset LIBSSO_KASUMI_PATH
 	unset LIBSSO_ZUC_PATH

devtools/test-build.sh config () # <directory> <target> <options> · line 175

Quoted 5 lines
devtools/test-build.sh +2 -0
@@ -169,6 +171,8 @@ config () # <directory> <target> <options>
 		sed -ri       's,(RESOURCE_TAR=)n,\1y,' $1/.config
 		test "$DPDK_DEP_MOFED" != y || \
 		sed -ri           's,(MLX._PMD=)n,\1y,' $1/.config
+		test -z "$LIBMUSDK_PATH" || \
+		sed -ri           's,(MRVL_PMD=)n,\1y,' $1/.config

test-build.sh modifications come with crypto-mrvl patches. The only difference is that PMD_MRVL_CRYPTO is enabled instead of MRVL_PMD. Thus I don't think it will apply after applying crypto patches.

Quoted 8 lines
devtools/test-build.sh +0 -0
 		test "$DPDK_DEP_SZE" != y || \
 		sed -ri       's,(PMD_SZEDATA2=)n,\1y,' $1/.config
 		test "$DPDK_DEP_ZLIB" != y || \
doc/guides/nics/mrvl.rst +0 -0
index 462bc0e9d..df0032bda 100644

doc/guides/nics/mrvl.rst Building DPDK · line 229

Quoted 9 lines
doc/guides/nics/mrvl.rst +6 -0
@@ -221,9 +221,24 @@ Building DPDK
 Driver needs precompiled MUSDK library during compilation. Please consult
 ``doc/musdk_get_started.txt`` for the detailed build instructions.
 
+.. code-block:: console
+
+   export CROSS_COMPILE=<toolchain>/bin/aarch64-linux-gnu-
+   ./bootstrap
+   ./configure --enable-bpool-dma=64
+   make install

I personally build MUSDK as follows:

export CROSS_COMPILE=/home/tdu/workspace/gcc-linaro-5.4.1-2017.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

make clean

./configure \
	--prefix=$(pwd)/musdk-install-dir \
	--enable-bpool-dma=64 \
	--enable-sam \
	--disable-shared

make install

'--enable-sam' is of course optional if you're not going to use crypto engine.

MUSDK ends up in musdk-install-dir then. Otherwise you'll need extra permissions to install to /usr/local. Of course its up to you where would you like to have it installed.

The reason I tend to add '--disable-shared' is that during build DPDK will suck in static libraries and then later on I don't have to install MUSDK library on the development board.

Quoted 16 lines
doc/guides/nics/mrvl.rst +9 -1
+
 Before the DPDK build process the environmental variable ``LIBMUSDK_PATH`` with
 the path to the MUSDK installation directory needs to be exported.
 
+.. code-block:: console
+
+   export LIBMUSDK_PATH=<musdk>/usr/local
+   export CROSS=aarch64-linux-gnu-
+   make config T=arm64-armv8a-linuxapp-gcc
+   sed -ri 's,(MRVL_PMD=)n,\1y,' build/.config
+   make
+
 
 Usage Example
 -------------
--
Quoted 2 lines

2.14.1

Anyway patch looks good. Thanks.

--
- Tomasz Duszyński

#72 lore raw

Re: [PATCH] doc: add build steps to mrvl NIC guide

12/10/2017 08:28, Tomasz Duszynski:

Quoted 33 lines · Thomas Monjalon
Quoted 32 lines

Show how to compile MUSDK and enable compilation of the mrvl PMD.

The build test tool is also updated to support this new PMD.

---
 devtools/test-build.sh   |  4 ++++
 doc/guides/nics/mrvl.rst | 15 +++++++++++++++
 2 files changed, 19 insertions(+)
devtools/test-build.sh +2 -0
index c6dfaf0a8..4d7eaa499 100755
@@ -47,6 +47,7 @@ default_path=$PATH
 # - DPDK_DEP_ZLIB (y/[n])
 # - DPDK_MAKE_JOBS (int)
 # - DPDK_NOTIFY (notify-send)
+# - LIBMUSDK_PATH
 # - LIBSSO_SNOW3G_PATH
 # - LIBSSO_KASUMI_PATH
 # - LIBSSO_ZUC_PATH
@@ -129,6 +130,7 @@ reset_env ()
 	unset DPDK_DEP_ZLIB
 	unset AESNI_MULTI_BUFFER_LIB_PATH
 	unset ARMV8_CRYPTO_LIB_PATH
+	unset LIBMUSDK_PATH
 	unset LIBSSO_SNOW3G_PATH
 	unset LIBSSO_KASUMI_PATH
 	unset LIBSSO_ZUC_PATH
@@ -169,6 +171,8 @@ config () # <directory> <target> <options>
 		sed -ri       's,(RESOURCE_TAR=)n,\1y,' $1/.config
Quoted 8 lines

devtools/test-build.sh config () # <directory> <target> <options> · line 175

Quoted 4 lines
devtools/test-build.sh +2 -0
 		test "$DPDK_DEP_MOFED" != y || \
 		sed -ri           's,(MLX._PMD=)n,\1y,' $1/.config
+		test -z "$LIBMUSDK_PATH" || \
+		sed -ri           's,(MRVL_PMD=)n,\1y,' $1/.config

test-build.sh modifications come with crypto-mrvl patches. The only difference is that PMD_MRVL_CRYPTO is enabled instead of MRVL_PMD. Thus I don't think it will apply after applying crypto patches.

OK I will adapt with crypto patches.

Quoted 24 lines

doc/guides/nics/mrvl.rst Building DPDK · line 229

Quoted 12 lines
doc/guides/nics/mrvl.rst +6 -0
@@ -221,9 +221,24 @@ Building DPDK
 Driver needs precompiled MUSDK library during compilation. Please consult
 ``doc/musdk_get_started.txt`` for the detailed build instructions.
 
+.. code-block:: console
+
+   export CROSS_COMPILE=<toolchain>/bin/aarch64-linux-gnu-
+   ./bootstrap
+   ./configure --enable-bpool-dma=64
+   make install

I personally build MUSDK as follows:

export CROSS_COMPILE=/home/tdu/workspace/gcc-linaro-5.4.1-2017.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

make clean

./configure \
	--prefix=$(pwd)/musdk-install-dir \
	--enable-bpool-dma=64 \
	--enable-sam \
	--disable-shared
Quoted 8 lines

make install

'--enable-sam' is of course optional if you're not going to use crypto engine.

MUSDK ends up in musdk-install-dir then. Otherwise you'll need extra permissions to install to /usr/local. Of course its up to you where would you like to have it installed.

No, the default is to install in usr/local inside musdk directory.

Quoted 16 lines

The reason I tend to add '--disable-shared' is that during build DPDK will suck in static libraries and then later on I don't have to install MUSDK library on the development board.

Quoted 12 lines
doc/guides/nics/mrvl.rst +9 -0
+
 Before the DPDK build process the environmental variable ``LIBMUSDK_PATH`` with
 the path to the MUSDK installation directory needs to be exported.
 
+.. code-block:: console
+
+   export LIBMUSDK_PATH=<musdk>/usr/local
+   export CROSS=aarch64-linux-gnu-
+   make config T=arm64-armv8a-linuxapp-gcc
+   sed -ri 's,(MRVL_PMD=)n,\1y,' build/.config
+   make
+

[...]

Quoted 6 lines

Anyway patch looks good. Thanks.

--
- Tomasz Duszyński

Thanks

#73 lore raw

Re: [PATCH v4 00/16] add net mrvl pmd driver

In reply to Ferruh Yigit
Quoted 62 lines · Ferruh Yigit
Quoted 61 lines · Ferruh Yigit
Quoted 49 lines · Tomasz Duszynski

Hello,

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Below you can find the list of features which net pmd supports:
* Speed capabilities
* Link status
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* QoS

Changes since v3:
* Split driver into skeleton, rx/tx, features, documentation parts
* Added speed capabilities flags.
* Added missing rx offload flags: VLAN/JUMBOFRAME
* Updated release notes.
* Updated documentation.

Changes since v2:
* Removed LINE_SPACING, MULTILINE_DEREFERENCE and SPLIT_STRING checkpatch warnings.
* Removed unnecessary forward declarations.
* Fixed whitespace warnings.

Changes since v1:
* Changed commit message to explain problem better.
* Removed bunch of checkpatch warnings about unnecessary parentheses.

Tomasz Duszynski (4):
app: link the whole rte_cfgfile library
net/mrvl: add mrvl net pmd driver skeleton net/mrvl: add rx/tx support
net/mrvl: add link update
net/mrvl: add link speed capabilities
net/mrvl: add support for updating mtu
net/mrvl: add jumbo frame support
net/mrvl: add support for promiscuous and allmulticast modes

Quoted 8 lines

net/mrvl: add support for mac filtering net/mrvl: add rss hashing support net/mrvl: add support for vlan filtering net/mrvl: add crc, l3 and l4 offloads support net/mrvl: add packet type parsing support. net/mrvl: add basic stats support
maintainers: add maintainers for the mrvl net pmd
doc: add mrvl net pmd documentation

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

Quoted 8 lines
Quoted 3 lines

(I can't compile because of missing musdk library, but since PMD is disabled by default this is not so bad, lets get this for rc1 and for crypto dependency, later I can have my environment set and test)

Did able to compile but I have questions :)

1- Used the "arm64-armv8a-linuxapp-gcc" config, can you please confirm. Does it make sense to document this?

Right, that makes sense.

Quoted 4 lines

2- I used different toolchain than documented in musdk, which uses a marvel one. Can you please confirm any aarch64-linux-gnu-gcc is OK?

I am not sure that every toolchain out there will work but those available here
https://releases.linaro.org/components/toolchain/binaries/*/aarch64-linux-gnu/
should work fine.

Quoted 7 lines

3- Used following command:
CROSS=<toolchain>/aarch64-linux-gnu- make
EXTRA_CFLAGS="-I.../musdk-marvell/src/include
-L.../musdk-marvell/src/.libs/"

Do you also need to use EXTRA_CFLAGS? Otherwise I can't compile. If you also use it please document it, if not please share with us how to do?

As for MUSDK I build it as follows:

export CROSS_COMPILE=/home/tdu/workspace/gcc-linaro-5.4.1-2017.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

# in case of the first build
./bootstrap
# later on that will do
make clean
./configure \
	--host=aarch64-linux-gnu \
	--prefix=$(pwd)/musdk-install-dir \
	--enable-sam \
	--enable-bpool-dma=64 \
	--disable-shared

make -j8
make install

As for building DPDK that works for me:

export RTE_KERNELDIR=/home/tdu/workspace/tmp2/linux-marvell
export LIBMUSDK_PATH=/home/tdu/workspace/tmp2/musdk-marvell/musdk-install-dir
export CROSS=/home/tdu/workspace/tmp2/gcc-linaro-5.4.1-2017.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

make -j8

Quoted 4 lines

4- musk generated a static library, can you please confirm there is a way to generate a shared musdk library as well?

To generate shared just remove --disable-shared from ./configure command line. Then you will have both *.so and *.a generated.

Quoted 2 lines

5- Still not tested building kernel modules, and building musdk with ./configure options, I will do later.

Let me know in case you have any sort of difficulties or something is unclear.

Quoted 3 lines

Thanks,
ferruh

--
- Tomasz Duszyński

#74 lore raw

PATCH v2 2/4 net/mrvl: add mrvl net pmd driver

In reply to Tomasz Duszynski

Add support for the Marvell PPv2 (Packet Processor v2) 1/10 Gbps adapter. Driver is based on external, publicly available, light-weight Marvell MUSDK library that provides access to network packet processor.

Driver comes with support for the following features:

* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

---
v2:
* Removed bunch of checkpatch warnings about unnecessary parentheses.

 config/common_base                        |    7 +
 drivers/net/Makefile                      |    2 +
 drivers/net/mrvl/Makefile                 |   69 +
 drivers/net/mrvl/mrvl_ethdev.c            | 2277 +++++++++++++++++++++++++++++
 drivers/net/mrvl/mrvl_ethdev.h            |  115 ++
 drivers/net/mrvl/mrvl_qos.c               |  627 ++++++++
 drivers/net/mrvl/mrvl_qos.h               |  112 ++
 drivers/net/mrvl/rte_pmd_mrvl_version.map |    3 +
 mk/rte.app.mk                             |    1 +
 9 files changed, 3213 insertions(+)
 create mode 100644 drivers/net/mrvl/Makefile
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.c
 create mode 100644 drivers/net/mrvl/mrvl_ethdev.h
 create mode 100644 drivers/net/mrvl/mrvl_qos.c
 create mode 100644 drivers/net/mrvl/mrvl_qos.h
 create mode 100644 drivers/net/mrvl/rte_pmd_mrvl_version.map
config/common_base +7 -0
index 5e97a08..d05a60c 100644
@@ -262,6 +262,13 @@ CONFIG_RTE_LIBRTE_NFP_PMD=n
 CONFIG_RTE_LIBRTE_NFP_DEBUG=n
 
 #
+# Compile Marvell PMD driver
+#
+CONFIG_RTE_LIBRTE_MRVL_PMD=n
+CONFIG_RTE_LIBRTE_MRVL_DEBUG=n
+CONFIG_RTE_MRVL_MUSDK_DMA_MEMSIZE=41943040
+
+#
 # Compile burst-oriented Broadcom BNXT PMD driver
 #
 CONFIG_RTE_LIBRTE_BNXT_PMD=y
drivers/net/Makefile +2 -0
index d33c959..4a3a205 100644
@@ -73,6 +73,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += mlx4
 DEPDIRS-mlx4 = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5
 DEPDIRS-mlx5 = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_MRVL_PMD) += mrvl
+DEPDIRS-mrvl = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += nfp
 DEPDIRS-nfp = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt
drivers/net/mrvl/Makefile new file +69 -0

69 lines not on this page · raw message

drivers/net/mrvl/mrvl_ethdev.c new file +2277 -0

2,277 lines not on this page · raw message

drivers/net/mrvl/mrvl_ethdev.h new file +115 -0

115 lines not on this page · raw message

drivers/net/mrvl/mrvl_qos.c new file +627 -0

518 lines not on this page · raw message

drivers/net/mrvl/mrvl_qos.h new file +112 -0

112 lines not on this page · raw message

drivers/net/mrvl/rte_pmd_mrvl_version.map new file +3 -0
new file mode 100644
index 0000000..a753031

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

mk/rte.app.mk +1 -0
index 94568a8..8df74bb 100644

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

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

--
2.7.4

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

#75 lore raw

Re: [PATCH v2 2/4] net/mrvl: add mrvl net pmd driver

drivers/net/mrvl/mrvl_ethdev.c line 135

Quoted 3 lines · On Thu, 28 Sep 2017 12:22:36 +0200 Tomasz Duszynski <[email protected]> wrote:
drivers/net/mrvl/mrvl_ethdev.c new file +3 -0
+
+struct mrvl_rxq;
+struct mrvl_txq;

These forward decl should not be nececessary

drivers/net/mrvl/mrvl_ethdev.c line 169

Quoted 2 lines
drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+static inline int
+mrvl_get_bpool_size(int	pp2_id, int pool_id)

No tab here please

Why does this need to be inlined? Is it in critical path?

drivers/net/mrvl/mrvl_ethdev.c line 179

Quoted 10 lines
drivers/net/mrvl/mrvl_ethdev.c new file +10 -0
+{
+	int i;
+	int size = 0;
+
+	for (i = mrvl_lcore_first; i <= mrvl_lcore_last; i++)
+		size += mrvl_port_bpool_size[pp2_id][pool_id][i];
+
+	return size;
+}
+

Also, I prefer that the following restrictions from the kernel be also applied to DPDK code.

### [dpdk-dev] [PATCH v2 2/4] net/mrvl: add mrvl net pmd driver

CHECK:LINE_SPACING: Please don't use multiple blank lines #452: FILE: drivers/net/mrvl/mrvl_ethdev.c:180:
+
+

WARNING:LINE_SPACING: Missing a blank line after declarations #457: FILE: drivers/net/mrvl/mrvl_ethdev.c:185:
+ int n = sizeof(*bitmap) * 8 - __builtin_clz(*bitmap);
+ if (n >= max)

CHECK:LINE_SPACING: Please don't use multiple blank lines #562: FILE: drivers/net/mrvl/mrvl_ethdev.c:290:
+
+

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[i].inqs_params' #880: FILE: drivers/net/mrvl/mrvl_ethdev.c:608:
+ rte_free(priv->ppio_params.inqs_params.
+ tcs_params[i].inqs_params);

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[i].inqs_params' #882: FILE: drivers/net/mrvl/mrvl_ethdev.c:610:
+ priv->ppio_params.inqs_params.
+ tcs_params[i].inqs_params = NULL;

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[tc].inqs_params[inq].size' #1330: FILE: drivers/net/mrvl/mrvl_ethdev.c:1058:
+ qinfo->nb_desc = priv->ppio_params.inqs_params.
+ tcs_params[tc].inqs_params[inq].size;

WARNING:SPLIT_STRING: quoted string split across lines #1476: FILE: drivers/net/mrvl/mrvl_ethdev.c:1204:
+ RTE_LOG(ERR, PMD, "Mbuf size must be increased to %u bytes"
+ " to hold up to %u bytes of data.\n",

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[priv->rxq_map[rxq->queue_id].tc' #1500: FILE: drivers/net/mrvl/mrvl_ethdev.c:1228:
+ priv->ppio_params.inqs_params.
+ tcs_params[priv->rxq_map[rxq->queue_id].tc].

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'q->priv->ppio_params.inqs_params.tcs_params[q->priv->rxq_map[q->queue_id].tc' #1532: FILE: drivers/net/mrvl/mrvl_ethdev.c:1260:
+ num = q->priv->ppio_params.inqs_params.
+ tcs_params[q->priv->rxq_map[q->queue_id].tc].

WARNING:SPLIT_STRING: quoted string split across lines #1902: FILE: drivers/net/mrvl/mrvl_ethdev.c:1630:
+ RTE_LOG(DEBUG, PMD, "\nport-%d:%d: bpool %d oversize -"
+ " remove %d buffers (pool size: %d -> %d)\n",

WARNING:SPLIT_STRING: quoted string split across lines #2094: FILE: drivers/net/mrvl/mrvl_ethdev.c:1822:
+ "No room in shadow queue for %d packets!!!"
+ "%d packets will be sent.\n",

CHECK:LINE_SPACING: Please don't use multiple blank lines #2294: FILE: drivers/net/mrvl/mrvl_ethdev.c:2022:
+
+

CHECK:LINE_SPACING: Please don't use multiple blank lines #2595: FILE: drivers/net/mrvl/mrvl_ethdev.h:40:
+
+

WARNING:LINE_SPACING: Missing a blank line after declarations #3253: FILE: drivers/net/mrvl/mrvl_qos.c:577:
+ uint8_t idx = port_cfg->tc[tc].inq[i];
+ priv->rxq_map[idx].tc = tc;

#76 lore raw

Re: [PATCH v2 2/4] net/mrvl: add mrvl net pmd driver

Quoted 15 lines · Stephen Hemminger

drivers/net/mrvl/mrvl_ethdev.c line 135

Quoted 3 lines · On Thu, 28 Sep 2017 12:22:36 +0200 Tomasz Duszynski <[email protected]> wrote:
drivers/net/mrvl/mrvl_ethdev.c new file +3 -0
+
+struct mrvl_rxq;
+struct mrvl_txq;

These forward decl should not be nececessary

drivers/net/mrvl/mrvl_ethdev.c line 169

Quoted 2 lines
drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+static inline int
+mrvl_get_bpool_size(int	pp2_id, int pool_id)

No tab here please

Why does this need to be inlined? Is it in critical path?

Quoted 14 lines

drivers/net/mrvl/mrvl_ethdev.c line 179

Quoted 10 lines
drivers/net/mrvl/mrvl_ethdev.c new file +10 -0
+{
+	int i;
+	int size = 0;
+
+	for (i = mrvl_lcore_first; i <= mrvl_lcore_last; i++)
+		size += mrvl_port_bpool_size[pp2_id][pool_id][i];
+
+	return size;
+}
+

Also, I prefer that the following restrictions from the kernel be also applied to DPDK code.

+1 for LINE_SPACING (multiple blank lines), MULTILINE_DEREFERENCE and SPLIT_STRING. [Is split string not already enforced?]

I'm a bit ambivilant about forcing a blank line after definitions, I think it's a good idea in most cases, but I'm not sure it needs to be enforced in all cases.

/Bruce

Quoted 72 lines

### [dpdk-dev] [PATCH v2 2/4] net/mrvl: add mrvl net pmd driver

CHECK:LINE_SPACING: Please don't use multiple blank lines #452: FILE: drivers/net/mrvl/mrvl_ethdev.c:180:

(quoted diff) +2 -0
+
+

WARNING:LINE_SPACING: Missing a blank line after declarations #457: FILE: drivers/net/mrvl/mrvl_ethdev.c:185:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	int n = sizeof(*bitmap) * 8 - __builtin_clz(*bitmap);
+	if (n >= max)

CHECK:LINE_SPACING: Please don't use multiple blank lines #562: FILE: drivers/net/mrvl/mrvl_ethdev.c:290:

(quoted diff) +2 -0
+
+

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[i].inqs_params' #880: FILE: drivers/net/mrvl/mrvl_ethdev.c:608:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			rte_free(priv->ppio_params.inqs_params.
+				tcs_params[i].inqs_params);

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[i].inqs_params' #882: FILE: drivers/net/mrvl/mrvl_ethdev.c:610:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			priv->ppio_params.inqs_params.
+				tcs_params[i].inqs_params = NULL;

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[tc].inqs_params[inq].size' #1330: FILE: drivers/net/mrvl/mrvl_ethdev.c:1058:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	qinfo->nb_desc = priv->ppio_params.inqs_params.
+			 tcs_params[tc].inqs_params[inq].size;

WARNING:SPLIT_STRING: quoted string split across lines #1476: FILE: drivers/net/mrvl/mrvl_ethdev.c:1204:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+		RTE_LOG(ERR, PMD, "Mbuf size must be increased to %u bytes"
+				  " to hold up to %u bytes of data.\n",

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[priv->rxq_map[rxq->queue_id].tc' #1500: FILE: drivers/net/mrvl/mrvl_ethdev.c:1228:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	priv->ppio_params.inqs_params.
+		tcs_params[priv->rxq_map[rxq->queue_id].tc].

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'q->priv->ppio_params.inqs_params.tcs_params[q->priv->rxq_map[q->queue_id].tc' #1532: FILE: drivers/net/mrvl/mrvl_ethdev.c:1260:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	num = q->priv->ppio_params.inqs_params.
+			tcs_params[q->priv->rxq_map[q->queue_id].tc].

WARNING:SPLIT_STRING: quoted string split across lines #1902: FILE: drivers/net/mrvl/mrvl_ethdev.c:1630:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			RTE_LOG(DEBUG, PMD, "\nport-%d:%d: bpool %d oversize -"
+				" remove %d buffers (pool size: %d -> %d)\n",

WARNING:SPLIT_STRING: quoted string split across lines #2094: FILE: drivers/net/mrvl/mrvl_ethdev.c:1822:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			"No room in shadow queue for %d packets!!!"
+			"%d packets will be sent.\n",

CHECK:LINE_SPACING: Please don't use multiple blank lines #2294: FILE: drivers/net/mrvl/mrvl_ethdev.c:2022:

(quoted diff) +2 -0
+
+

CHECK:LINE_SPACING: Please don't use multiple blank lines #2595: FILE: drivers/net/mrvl/mrvl_ethdev.h:40:

(quoted diff) +2 -0
+
+

WARNING:LINE_SPACING: Missing a blank line after declarations #3253: FILE: drivers/net/mrvl/mrvl_qos.c:577:

drivers/net/mrvl/mrvl_qos.c new file +2 -0
+			uint8_t idx = port_cfg->tc[tc].inq[i];
+			priv->rxq_map[idx].tc = tc;
#77 lore raw

Re: [PATCH v2 2/4] net/mrvl: add mrvl net pmd driver

Quoted 31 lines · Bruce Richardson
Quoted 15 lines · Stephen Hemminger

drivers/net/mrvl/mrvl_ethdev.c line 135

Quoted 3 lines · On Thu, 28 Sep 2017 12:22:36 +0200 Tomasz Duszynski <[email protected]> wrote:
drivers/net/mrvl/mrvl_ethdev.c new file +3 -0
+
+struct mrvl_rxq;
+struct mrvl_txq;

These forward decl should not be nececessary

drivers/net/mrvl/mrvl_ethdev.c line 169

Quoted 2 lines
drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+static inline int
+mrvl_get_bpool_size(int	pp2_id, int pool_id)

No tab here please

Why does this need to be inlined? Is it in critical path?

Quoted 14 lines

drivers/net/mrvl/mrvl_ethdev.c line 179

Quoted 10 lines
drivers/net/mrvl/mrvl_ethdev.c new file +10 -0
+{
+	int i;
+	int size = 0;
+
+	for (i = mrvl_lcore_first; i <= mrvl_lcore_last; i++)
+		size += mrvl_port_bpool_size[pp2_id][pool_id][i];
+
+	return size;
+}
+

Also, I prefer that the following restrictions from the kernel be also applied to DPDK code.

Quoted 2 lines

+1 for LINE_SPACING (multiple blank lines), MULTILINE_DEREFERENCE and SPLIT_STRING. [Is split string not already enforced?]

ACK

Quoted 4 lines

I'm a bit ambivilant about forcing a blank line after definitions, I think it's a good idea in most cases, but I'm not sure it needs to be enforced in all cases.

Agree. In this case however adding a few extra blank lines after definitions will not hurt, plus it will improve coding style consistency across driver sources.

Quoted 70 lines

/Bruce

Quoted 67 lines

### [dpdk-dev] [PATCH v2 2/4] net/mrvl: add mrvl net pmd driver

CHECK:LINE_SPACING: Please don't use multiple blank lines #452: FILE: drivers/net/mrvl/mrvl_ethdev.c:180:

(quoted diff) +2 -0
+
+

WARNING:LINE_SPACING: Missing a blank line after declarations #457: FILE: drivers/net/mrvl/mrvl_ethdev.c:185:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	int n = sizeof(*bitmap) * 8 - __builtin_clz(*bitmap);
+	if (n >= max)

CHECK:LINE_SPACING: Please don't use multiple blank lines #562: FILE: drivers/net/mrvl/mrvl_ethdev.c:290:

(quoted diff) +2 -0
+
+

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[i].inqs_params' #880: FILE: drivers/net/mrvl/mrvl_ethdev.c:608:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			rte_free(priv->ppio_params.inqs_params.
+				tcs_params[i].inqs_params);

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[i].inqs_params' #882: FILE: drivers/net/mrvl/mrvl_ethdev.c:610:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			priv->ppio_params.inqs_params.
+				tcs_params[i].inqs_params = NULL;

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[tc].inqs_params[inq].size' #1330: FILE: drivers/net/mrvl/mrvl_ethdev.c:1058:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	qinfo->nb_desc = priv->ppio_params.inqs_params.
+			 tcs_params[tc].inqs_params[inq].size;

WARNING:SPLIT_STRING: quoted string split across lines #1476: FILE: drivers/net/mrvl/mrvl_ethdev.c:1204:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+		RTE_LOG(ERR, PMD, "Mbuf size must be increased to %u bytes"
+				  " to hold up to %u bytes of data.\n",

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[priv->rxq_map[rxq->queue_id].tc' #1500: FILE: drivers/net/mrvl/mrvl_ethdev.c:1228:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	priv->ppio_params.inqs_params.
+		tcs_params[priv->rxq_map[rxq->queue_id].tc].

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'q->priv->ppio_params.inqs_params.tcs_params[q->priv->rxq_map[q->queue_id].tc' #1532: FILE: drivers/net/mrvl/mrvl_ethdev.c:1260:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	num = q->priv->ppio_params.inqs_params.
+			tcs_params[q->priv->rxq_map[q->queue_id].tc].

WARNING:SPLIT_STRING: quoted string split across lines #1902: FILE: drivers/net/mrvl/mrvl_ethdev.c:1630:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			RTE_LOG(DEBUG, PMD, "\nport-%d:%d: bpool %d oversize -"
+				" remove %d buffers (pool size: %d -> %d)\n",

WARNING:SPLIT_STRING: quoted string split across lines #2094: FILE: drivers/net/mrvl/mrvl_ethdev.c:1822:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			"No room in shadow queue for %d packets!!!"
+			"%d packets will be sent.\n",

CHECK:LINE_SPACING: Please don't use multiple blank lines #2294: FILE: drivers/net/mrvl/mrvl_ethdev.c:2022:

(quoted diff) +2 -0
+
+

CHECK:LINE_SPACING: Please don't use multiple blank lines #2595: FILE: drivers/net/mrvl/mrvl_ethdev.h:40:

(quoted diff) +2 -0
+
+
Quoted 5 lines

drivers/net/mrvl/mrvl_qos.c line 577

Quoted 5 lines

WARNING:LINE_SPACING: Missing a blank line after declarations #3253: FILE: drivers/net/mrvl/mrvl_qos.c:577:

drivers/net/mrvl/mrvl_qos.c new file +2 -0
+			uint8_t idx = port_cfg->tc[tc].inq[i];
+			priv->rxq_map[idx].tc = tc;

--
- Tomasz Duszyński

#78 lore raw

Re: [PATCH v2 2/4] net/mrvl: add mrvl net pmd driver

In reply to Stephen Hemminger
Quoted 8 lines · Stephen Hemminger

drivers/net/mrvl/mrvl_ethdev.c line 135

Quoted 3 lines · On Thu, 28 Sep 2017 12:22:36 +0200 Tomasz Duszynski <[email protected]> wrote:
drivers/net/mrvl/mrvl_ethdev.c new file +3 -0
+
+struct mrvl_rxq;
+struct mrvl_txq;

These forward decl should not be nececessary

ACK

Quoted 3 lines

drivers/net/mrvl/mrvl_ethdev.c line 169

Quoted 2 lines
drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+static inline int
+mrvl_get_bpool_size(int	pp2_id, int pool_id)

No tab here please

Good catch, thanks.

Quoted 4 lines

Why does this need to be inlined? Is it in critical path?

Right, in rx handler precisely.

Quoted 23 lines

drivers/net/mrvl/mrvl_ethdev.c line 179

Quoted 10 lines
drivers/net/mrvl/mrvl_ethdev.c new file +10 -0
+{
+	int i;
+	int size = 0;
+
+	for (i = mrvl_lcore_first; i <= mrvl_lcore_last; i++)
+		size += mrvl_port_bpool_size[pp2_id][pool_id][i];
+
+	return size;
+}
+

Also, I prefer that the following restrictions from the kernel be also applied to DPDK code.

### [dpdk-dev] [PATCH v2 2/4] net/mrvl: add mrvl net pmd driver

CHECK:LINE_SPACING: Please don't use multiple blank lines #452: FILE: drivers/net/mrvl/mrvl_ethdev.c:180:

(quoted diff) +2 -0
+
+

WARNING:LINE_SPACING: Missing a blank line after declarations #457: FILE: drivers/net/mrvl/mrvl_ethdev.c:185:

drivers/net/mrvl/mrvl_ethdev.c line 185

Quoted 2 lines
drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	int n = sizeof(*bitmap) * 8 - __builtin_clz(*bitmap);
+	if (n >= max)

These were not triggered by the DPDK checkpatch wrapper. On the other hand using kernel checkpatch will show them. That makes we wonder which tool should actually be used? Anyway, will fix that in v3.

Quoted 23 lines

CHECK:LINE_SPACING: Please don't use multiple blank lines #562: FILE: drivers/net/mrvl/mrvl_ethdev.c:290:

(quoted diff) +2 -0
+
+

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[i].inqs_params' #880: FILE: drivers/net/mrvl/mrvl_ethdev.c:608:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			rte_free(priv->ppio_params.inqs_params.
+				tcs_params[i].inqs_params);

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[i].inqs_params' #882: FILE: drivers/net/mrvl/mrvl_ethdev.c:610:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			priv->ppio_params.inqs_params.
+				tcs_params[i].inqs_params = NULL;

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[tc].inqs_params[inq].size' #1330: FILE: drivers/net/mrvl/mrvl_ethdev.c:1058:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	qinfo->nb_desc = priv->ppio_params.inqs_params.
+			 tcs_params[tc].inqs_params[inq].size;

WARNING:SPLIT_STRING: quoted string split across lines #1476: FILE: drivers/net/mrvl/mrvl_ethdev.c:1204:

drivers/net/mrvl/mrvl_ethdev.c line 1204

Quoted 2 lines
drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+		RTE_LOG(ERR, PMD, "Mbuf size must be increased to %u bytes"
+				  " to hold up to %u bytes of data.\n",

Personally I would go with kernel checkpatch, but DPDK checker complained about overly long lines thus such comments were split across lines.

Quoted 34 lines

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[priv->rxq_map[rxq->queue_id].tc' #1500: FILE: drivers/net/mrvl/mrvl_ethdev.c:1228:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	priv->ppio_params.inqs_params.
+		tcs_params[priv->rxq_map[rxq->queue_id].tc].

WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'q->priv->ppio_params.inqs_params.tcs_params[q->priv->rxq_map[q->queue_id].tc' #1532: FILE: drivers/net/mrvl/mrvl_ethdev.c:1260:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+	num = q->priv->ppio_params.inqs_params.
+			tcs_params[q->priv->rxq_map[q->queue_id].tc].

WARNING:SPLIT_STRING: quoted string split across lines #1902: FILE: drivers/net/mrvl/mrvl_ethdev.c:1630:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			RTE_LOG(DEBUG, PMD, "\nport-%d:%d: bpool %d oversize -"
+				" remove %d buffers (pool size: %d -> %d)\n",

WARNING:SPLIT_STRING: quoted string split across lines #2094: FILE: drivers/net/mrvl/mrvl_ethdev.c:1822:

drivers/net/mrvl/mrvl_ethdev.c new file +2 -0
+			"No room in shadow queue for %d packets!!!"
+			"%d packets will be sent.\n",

CHECK:LINE_SPACING: Please don't use multiple blank lines #2294: FILE: drivers/net/mrvl/mrvl_ethdev.c:2022:

(quoted diff) +2 -0
+
+

CHECK:LINE_SPACING: Please don't use multiple blank lines #2595: FILE: drivers/net/mrvl/mrvl_ethdev.h:40:

(quoted diff) +2 -0
+
+

WARNING:LINE_SPACING: Missing a blank line after declarations #3253: FILE: drivers/net/mrvl/mrvl_qos.c:577:

drivers/net/mrvl/mrvl_qos.c line 577

Quoted 2 lines
drivers/net/mrvl/mrvl_qos.c new file +2 -0
+			uint8_t idx = port_cfg->tc[tc].inq[i];
+			priv->rxq_map[idx].tc = tc;

--
- Tomasz Duszyński

#79 lore raw

PATCH v2 3/4 doc: add mrvl net pmd documentation

In reply to Tomasz Duszynski

Add documentation for the MRVL NET PMD driver.

---
 doc/guides/nics/features/mrvl.ini |  24 ++++++
 doc/guides/nics/index.rst         |   1 +
 doc/guides/nics/mrvl.rst          | 151 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 176 insertions(+)
 create mode 100644 doc/guides/nics/features/mrvl.ini
 create mode 100644 doc/guides/nics/mrvl.rst
doc/guides/nics/features/mrvl.ini new file +24 -0
new file mode 100644
index 0000000..781d6dc
@@ -0,0 +1,24 @@
+;
+; Supported features of the 'mrvl' network poll mode driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Speed capabilities   = Y
+Link status          = Y
+MTU update           = Y
+Jumbo frame          = Y
+Promiscuous mode     = Y
+Allmulticast mode    = Y
+Unicast MAC filter   = Y
+Multicast MAC filter = Y
+RSS hash             = Y
+VLAN filter          = Y
+CRC offload          = Y
+L3 checksum offload  = Y
+L4 checksum offload  = Y
+Packet type parsing  = Y
+Basic stats          = Y
+Stats per queue      = Y
+ARMv8                = Y
+Usage doc            = Y
doc/guides/nics/index.rst +1 -0
index 36f4f3f..7192f63 100644
@@ -55,6 +55,7 @@ Network Interface Controller Drivers
     liquidio
     mlx4
     mlx5
+    mrvl
     nfp
     qede
     sfc_efx
doc/guides/nics/mrvl.rst new file +151 -0

151 lines not on this page · raw message

Signature · 1 line
2.7.4
#80 lore raw

PATCH v2 4/4 maintainers: add maintainers for the mrvl net pmd

In reply to Tomasz Duszynski
---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index a0cd75e..d4810cf 100644
@@ -393,6 +393,16 @@ F: drivers/net/mlx5/
 F: doc/guides/nics/mlx5.rst
 F: doc/guides/nics/features/mlx5.ini
 
+Marvell mrvl
+M: Jacek Siuda <[email protected]>
+M: Tomasz Duszynski <[email protected]>
+M: Dmitri Epshtein <[email protected]>
+M: Natalie Samsonov <[email protected]>
+M: Jianbo Liu <[email protected]>
+F: drivers/net/mrvl/
+F: doc/guides/nics/mrvl.rst
+F: doc/guides/nics/features/mrvl.ini
+
 Netcope szedata2
 M: Matej Vido <[email protected]>
 F: drivers/net/szedata2/
Signature · 1 line
2.7.4
#81 lore raw

Re: [PATCH v2 0/4] add net mrvl pmd driver

In reply to Tomasz Duszynski
Quoted 24 lines · Tomasz Duszynski

Hello,

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Below you can find the list of features which net pmd supports:
* Speed capabilities
* Link status
* Queue start/stop
* MTU update
* Jumbo frame
* Promiscuous mode
* Allmulticast mode
* Unicast MAC filter
* Multicast MAC filter
* RSS hash
* VLAN filter
* CRC offload
* L3 checksum offload
* L4 checksum offload
* Packet type parsing
* Basic stats
* Stats per queue

Quoted 5 lines

Tomasz Duszynski (4):
app: link the whole rte_cfgfile library net/mrvl: add mrvl net pmd driver
doc: add mrvl net pmd documentation
maintainers: add maintainers for the mrvl net pmd

Hi Tomasz,

Good to see more vendors are contributing, welcome!

This patchset arrived a little late for this release cycle, I still would like to get it but priority will be the existing waiting drivers, so no promises :)

Thanks,
ferruh

<...>

#82 lore raw

Re: [PATCH v2 0/4] add net mrvl pmd driver

Quoted 2 lines
Quoted 2 lines

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Wondering, if it could be tested on Marvell Armada 3700 based ESPRESSObin board ?

Thanks
Amit

#83 lore raw

Re: [PATCH v2 0/4] add net mrvl pmd driver

Hi Amit,

2017-09-28 13:40 GMT+02:00 Amit Tomer <[email protected]>:

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

This patch series introduces the net driver for Marvell Armada 7k/8k SoCs along with documentation.

Wondering, if it could be tested on Marvell Armada 3700 based ESPRESSObin board ?

Different SoC. This one is intended to work with Armada 8040 MacchiatoBin board.

Best regards,
Marcin

#84 lore raw

v2 cover add crypto mrvl pmd driver

In reply to Tomasz Duszynski

Hello,

This patch series introduces crypto driver for Marvell Armada 7k/8k SoCs along with documentation and crypto pmd driver tests.

Below you can find the list of features which crypto pmd supports:
* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Tomasz Duszynski (4):
crypto/mrvl: add mrvl crypto pmd driver
doc: add mrvl crypto pmd documentation
maintainers: add maintainers for the mrvl crypto pmd
test: add mrvl crypto pmd unit tests

 MAINTAINERS                                  |  10 +
 config/common_base                           |   6 +
 doc/guides/cryptodevs/features/mrvl.ini      |  42 ++
 doc/guides/cryptodevs/index.rst              |   1 +
 doc/guides/cryptodevs/mrvl.rst               | 198 ++++++
 drivers/crypto/Makefile                      |   2 +
 drivers/crypto/mrvl/Makefile                 |  63 ++
 drivers/crypto/mrvl/rte_mrvl_compat.h        |  48 ++
 drivers/crypto/mrvl/rte_mrvl_pmd.c           | 870 +++++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c       | 787 ++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_private.h   | 121 ++++
 drivers/crypto/mrvl/rte_mrvl_pmd_version.map |   3 +
 mk/rte.app.mk                                |   1 +
 test/test/test_cryptodev.c                   | 168 ++++++
 test/test/test_cryptodev.h                   |   1 +
 test/test/test_cryptodev_aes_test_vectors.h  |  72 ++-
 test/test/test_cryptodev_blockcipher.c       |   9 +-
 test/test/test_cryptodev_blockcipher.h       |   1 +
 test/test/test_cryptodev_des_test_vectors.h  |  24 +-
 19 files changed, 2394 insertions(+), 33 deletions(-)
 create mode 100644 doc/guides/cryptodevs/features/mrvl.ini
 create mode 100644 doc/guides/cryptodevs/mrvl.rst
 create mode 100644 drivers/crypto/mrvl/Makefile
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_compat.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_private.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_version.map

--
2.7.4

#85 lore raw

PATCH v2 1/4 crypto/mrvl: add mrvl crypto pmd driver

Add support for the Marvell Security Crypto Accelerator EIP197. Driver is based on external, publicly available, Marvell MUSDK library that provides access to the hardware with minimum overhead and high performance.

Driver comes with support for the following features:

* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

---
 config/common_base                           |   6 +
 drivers/crypto/Makefile                      |   2 +
 drivers/crypto/mrvl/Makefile                 |  63 ++
 drivers/crypto/mrvl/rte_mrvl_compat.h        |  48 ++
 drivers/crypto/mrvl/rte_mrvl_pmd.c           | 870 +++++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c       | 787 ++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_private.h   | 121 ++++
 drivers/crypto/mrvl/rte_mrvl_pmd_version.map |   3 +
 mk/rte.app.mk                                |   1 +
 9 files changed, 1901 insertions(+)
 create mode 100644 drivers/crypto/mrvl/Makefile
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_compat.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_private.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_version.map
config/common_base +6 -0
index d05a60c..e9b181e 100644
@@ -521,6 +521,12 @@ CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER_DEBUG=n
 CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=y
 
 #
+# Compile PMD for Marvell Crypto device
+#
+CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO=n
+CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO_DEBUG=n
+
+#
 # Compile generic event device library
 #
 CONFIG_RTE_LIBRTE_EVENTDEV=y
drivers/crypto/Makefile +2 -0
index 7a719b9..1d7db5b 100644
@@ -51,6 +51,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += kasumi
 DEPDIRS-kasumi = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += zuc
 DEPDIRS-zuc = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += mrvl
+DEPDIRS-mrvl = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += null
 DEPDIRS-null = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += dpaa2_sec
drivers/crypto/mrvl/Makefile new file +63 -0

63 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_compat.h new file +48 -0

48 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd.c new file +870 -0

870 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +787 -0

787 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd_private.h new file +121 -0

121 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd_version.map new file +3 -0
new file mode 100644
index 0000000..a753031
@@ -0,0 +1,3 @@
+DPDK_17.11 {
+	local: *;
+};
mk/rte.app.mk +1 -0
index 8df74bb..0f121ee 100644
@@ -163,6 +163,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -lrte_pmd_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -L$(LIBSSO_ZUC_PATH)/build -lsso_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -lrte_pmd_armv8
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += -L$(LIBMUSDK_PATH)/lib -lrte_pmd_mrvl_crypto -lmusdk
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += -lrte_pmd_crypto_scheduler
 ifeq ($(CONFIG_RTE_LIBRTE_FSLMC_BUS),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC)   += -lrte_pmd_dpaa2_sec
Signature · 1 line
2.7.4
#86 lore raw

Re: [PATCH v2 1/4] crypto/mrvl: add mrvl crypto pmd driver

Hi Tomasz,

Quoted 45 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Duszynski
Sent: Thursday, September 28, 2017 11:23 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Tomasz Duszynski <[email protected]>; Jacek Siuda <[email protected]>
Subject: [dpdk-dev] [PATCH v2 1/4] crypto/mrvl: add mrvl crypto pmd driver

Add support for the Marvell Security Crypto Accelerator EIP197. Driver is based on external, publicly available, Marvell MUSDK library that provides access to the hardware with minimum overhead and high performance.

Driver comes with support for the following features:

* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Quoted 6 lines

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

If the guys in Marvell has contributed with the code, they should sign off too. Up to you.

There is a script to test compilation (devtools/test-build.sh). You should also modify it to include the dependency with LIBMUSDK.

...

Quoted 6 lines
drivers/crypto/mrvl/rte_mrvl_pmd.c new file +0 -0
new file mode 100644
index 0000000..63f8daa

...

Quoted 6 lines
drivers/crypto/mrvl/rte_mrvl_pmd.c new file +3 -0
+
+/* Register the driver in constructor. */
+RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_MRVL_PMD,

cryptodev_mrvl_pmd_drv);
+RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_MRVL_PMD,
cryptodev_mrvl_pmd);

You can remove this alias, as this is a new PMD, we should be using the primary convention "crypto_mrvl".

Quoted 12 lines
drivers/crypto/mrvl/rte_mrvl_pmd.c new file +5 -0
+RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_MRVL_PMD,
+	"max_nb_queue_pairs=<int> "
+	"max_nb_sessions=<int> "
+	"socket_id=<int>");
+RTE_PMD_REGISTER_CRYPTO_DRIVER(cryptodev_mrvl_pmd_drv,

cryptodev_driver_id);

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +0 -0
new file mode 100644
index 0000000..f7374f8

...

Quoted 11 lines

+ */

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +10 -0
+static const struct rte_cryptodev_capabilities
+	mrvl_crypto_pmd_capabilities[] = {
+	{	/* MD5 HMAC */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			{.auth = {
+				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
+				.block_size = 64,
+				.key_size = {

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c line 63

Quoted 10 lines
drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +10 -0
+					.min = 64,
+					.max = 64,
+					.increment = 0
+				},
+				.digest_size = {
+					.min = 16,
+					.max = 16,
+					.increment = 0
+				},
+				.aad_size = { 0 }

You can remove this aad_size, as it is only applicable to AEAD algorithms (GCM in your case).

Quoted 3 lines
drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +3 -0
+			}, }
+		}, }
+	},

...

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c line 98

Quoted 13 lines
drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +4 -0
+	{	/* SHA1 HMAC */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+			{.sym = {
+				.xform_type =

RTE_CRYPTO_SYM_XFORM_AUTH,

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +2 -0
+				{.auth = {
+					.algo =

RTE_CRYPTO_AUTH_SHA1_HMAC,

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +5 -0
+					.block_size = 64,
+					.key_size = {
+						.min = 16,
+						.max = 128,
+						.increment = 0

If min and max values are different, increment cannot be 0.

#87 lore raw

Re: [PATCH v2 1/4] crypto/mrvl: add mrvl crypto pmd driver

Quoted 51 lines · Pablo

Hi Tomasz,

Quoted 49 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Duszynski
Sent: Thursday, September 28, 2017 11:23 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Tomasz Duszynski <[email protected]>; Jacek Siuda <[email protected]>
Subject: [dpdk-dev] [PATCH v2 1/4] crypto/mrvl: add mrvl crypto pmd driver

Add support for the Marvell Security Crypto Accelerator EIP197. Driver is based on external, publicly available, Marvell MUSDK library that provides access to the hardware with minimum overhead and high performance.

Driver comes with support for the following features:

* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

Quoted 9 lines
Quoted 2 lines

If the guys in Marvell has contributed with the code, they should sign off too. Up to you.

There is a script to test compilation (devtools/test-build.sh). You should also modify it to include the dependency with LIBMUSDK.

ACK

Quoted 11 lines

...

Quoted 6 lines
drivers/crypto/mrvl/rte_mrvl_pmd.c new file +0 -0
new file mode 100644
index 0000000..63f8daa

...

Quoted 10 lines
Quoted 6 lines
drivers/crypto/mrvl/rte_mrvl_pmd.c new file +3 -0
+
+/* Register the driver in constructor. */
+RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_MRVL_PMD,

cryptodev_mrvl_pmd_drv);
+RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_MRVL_PMD,
cryptodev_mrvl_pmd);

You can remove this alias, as this is a new PMD, we should be using the primary convention "crypto_mrvl".

ACK

Quoted 31 lines
Quoted 13 lines
drivers/crypto/mrvl/rte_mrvl_pmd.c new file +5 -0
+RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_MRVL_PMD,
+	"max_nb_queue_pairs=<int> "
+	"max_nb_sessions=<int> "
+	"socket_id=<int>");
+RTE_PMD_REGISTER_CRYPTO_DRIVER(cryptodev_mrvl_pmd_drv,

cryptodev_driver_id);

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +0 -0
new file mode 100644
index 0000000..f7374f8

...

Quoted 15 lines

+ */

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +14 -0
+static const struct rte_cryptodev_capabilities
+	mrvl_crypto_pmd_capabilities[] = {
+	{	/* MD5 HMAC */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			{.auth = {
+				.algo = RTE_CRYPTO_AUTH_MD5_HMAC,
+				.block_size = 64,
+				.key_size = {
+					.min = 64,
+					.max = 64,
+					.increment = 0
+				},
Quoted 9 lines

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c line 63

Quoted 6 lines
drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +6 -0
+				.digest_size = {
+					.min = 16,
+					.max = 16,
+					.increment = 0
+				},
+				.aad_size = { 0 }

You can remove this aad_size, as it is only applicable to AEAD algorithms (GCM in your case).

ACK

Quoted 6 lines
Quoted 3 lines
drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +3 -0
+			}, }
+		}, }
+	},

...

Quoted 15 lines

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c line 98

Quoted 13 lines
drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +4 -0
+	{	/* SHA1 HMAC */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+			{.sym = {
+				.xform_type =

RTE_CRYPTO_SYM_XFORM_AUTH,

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +2 -0
+				{.auth = {
+					.algo =

RTE_CRYPTO_AUTH_SHA1_HMAC,

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +5 -0
+					.block_size = 64,
+					.key_size = {
+						.min = 16,
+						.max = 128,
+						.increment = 0

If min and max values are different, increment cannot be 0.

ACK

Thanks for comments.

--
- Tomasz Duszyński

#88 lore raw

Re: [PATCH v2 1/4] crypto/mrvl: add mrvl crypto pmd driver

In reply to Tomasz Duszynski
Quoted 41 lines · Tomasz Duszynski

Add support for the Marvell Security Crypto Accelerator EIP197. Driver is based on external, publicly available, Marvell MUSDK library that provides access to the hardware with minimum overhead and high performance.

Driver comes with support for the following features:

* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

Quoted 9 lines
---
 config/common_base                           |   6 +
 drivers/crypto/Makefile                      |   2 +
 drivers/crypto/mrvl/Makefile                 |  63 ++
 drivers/crypto/mrvl/rte_mrvl_compat.h        |  48 ++
 drivers/crypto/mrvl/rte_mrvl_pmd.c           | 870 +++++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c       | 787 ++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_private.h   | 121 ++++
 drivers/crypto/mrvl/rte_mrvl_pmd_version.map |   3 +

The standard convention for naming version files for these drivers is "rte_pmd_<name>_version.map". Without this, the new meson build system will have trouble finding the map file. The same convention applies to net drivers too.

Regards,
/Bruce

#89 lore raw

Re: [PATCH v2 1/4] crypto/mrvl: add mrvl crypto pmd driver

Quoted 52 lines · Bruce Richardson
Quoted 41 lines · Tomasz Duszynski

Add support for the Marvell Security Crypto Accelerator EIP197. Driver is based on external, publicly available, Marvell MUSDK library that provides access to the hardware with minimum overhead and high performance.

Driver comes with support for the following features:

* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

Quoted 9 lines
---
 config/common_base                           |   6 +
 drivers/crypto/Makefile                      |   2 +
 drivers/crypto/mrvl/Makefile                 |  63 ++
 drivers/crypto/mrvl/rte_mrvl_compat.h        |  48 ++
 drivers/crypto/mrvl/rte_mrvl_pmd.c           | 870 +++++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c       | 787 ++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_private.h   | 121 ++++
 drivers/crypto/mrvl/rte_mrvl_pmd_version.map |   3 +
Quoted 5 lines

The standard convention for naming version files for these drivers is "rte_pmd_<name>_version.map". Without this, the new meson build system will have trouble finding the map file. The same convention applies to net drivers too.

OK. Thanks for pointing this out.

Quoted 2 lines

Regards,
/Bruce

--
- Tomasz Duszyński

#90 lore raw

PATCH v2 2/4 doc: add mrvl crypto pmd documentation

In reply to Tomasz Duszynski

Add documentation for the MRVL CRYPTO PMD driver.

---
 doc/guides/cryptodevs/features/mrvl.ini |  42 +++++++
 doc/guides/cryptodevs/index.rst         |   1 +
 doc/guides/cryptodevs/mrvl.rst          | 198 ++++++++++++++++++++++++++++++++
 3 files changed, 241 insertions(+)
 create mode 100644 doc/guides/cryptodevs/features/mrvl.ini
 create mode 100644 doc/guides/cryptodevs/mrvl.rst
doc/guides/cryptodevs/features/mrvl.ini new file +42 -0
new file mode 100644
index 0000000..6d2fe6a
@@ -0,0 +1,42 @@
+; Supported features of the 'mrvl' crypto driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Symmetric crypto       = Y
+Sym operation chaining = Y
+
+;
+; Supported crypto algorithms of a default crypto driver.
+;
+[Cipher]
+AES CBC (128)  = Y
+AES CBC (192)  = Y
+AES CBC (256)  = Y
+AES CTR (128)  = Y
+AES CTR (192)  = Y
+AES CTR (256)  = Y
+3DES CBC       = Y
+3DES CTR       = Y
+
+;
+; Supported authentication algorithms of a default crypto driver.
+;
+[Auth]
+MD5          = Y
+MD5 HMAC     = Y
+SHA1         = Y
+SHA1 HMAC    = Y
+SHA256       = Y
+SHA256 HMAC  = Y
+SHA384       = Y
+SHA384 HMAC  = Y
+SHA512       = Y
+SHA512 HMAC  = Y
+AES GMAC     = Y
+
+;
+; Supported AEAD algorithms of a default crypto driver.
+;
+[AEAD]
+AES GCM (128) = Y
doc/guides/cryptodevs/index.rst +1 -0
index 361b82d..a8ee0eb 100644
@@ -42,6 +42,7 @@ Crypto Device Drivers
     dpaa2_sec
     kasumi
     openssl
+    mrvl
     null
     scheduler
     snow3g
doc/guides/cryptodevs/mrvl.rst new file +198 -0

198 lines not on this page · raw message

Signature · 1 line
2.7.4
#91 lore raw

Re: [PATCH v2 2/4] doc: add mrvl crypto pmd documentation

Quoted 12 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Duszynski
Sent: Thursday, September 28, 2017 11:24 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Tomasz Duszynski <[email protected]>; Jacek Siuda <[email protected]>
Subject: [dpdk-dev] [PATCH v2 2/4] doc: add mrvl crypto pmd documentation

Quoted 1 line

Add documentation for the MRVL CRYPTO PMD driver.

You should add the pmd in the list of device types (devtype), In doc/guides/tools/cryptoperf.rst.

Also, you should mention this new PMD in release notes.

Quoted 7 lines
---
 doc/guides/cryptodevs/features/mrvl.ini |  42 +++++++
 doc/guides/cryptodevs/index.rst         |   1 +
 doc/guides/cryptodevs/mrvl.rst          | 198

...

Quoted 2 lines

+++ b/doc/guides/cryptodevs/mrvl.rst

(quoted diff) +0 -0
@@ -0,0 +1,198 @@

...

Review

Quoted 3 lines
(quoted diff) +3 -0
+
+   ./l2fwd-crypto -c 0x3 --vdev=eth_mrvl,iface=eth0
+ --vdev=cryptodev_mrvl_pmd

I will make the comment also in the first patch, but you should use "crypto_mrvl". The cryptodev_*_pmd convention is old and we are only maintaining it for backward compatibility. So, I would use "crypto_mrvl".

#92 lore raw

Re: [PATCH v2 2/4] doc: add mrvl crypto pmd documentation

Quoted 12 lines · Pablo
Quoted 12 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Duszynski
Sent: Thursday, September 28, 2017 11:24 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Tomasz Duszynski <[email protected]>; Jacek Siuda <[email protected]>
Subject: [dpdk-dev] [PATCH v2 2/4] doc: add mrvl crypto pmd documentation

Quoted 4 lines
Quoted 1 line

Add documentation for the MRVL CRYPTO PMD driver.

You should add the pmd in the list of device types (devtype), In doc/guides/tools/cryptoperf.rst.

ACK

Quoted 3 lines

Also, you should mention this new PMD in release notes.

ACK

Quoted 15 lines
Quoted 7 lines
---
 doc/guides/cryptodevs/features/mrvl.ini |  42 +++++++
 doc/guides/cryptodevs/index.rst         |   1 +
 doc/guides/cryptodevs/mrvl.rst          | 198

...

Quoted 2 lines

+++ b/doc/guides/cryptodevs/mrvl.rst

(quoted diff) +0 -0
@@ -0,0 +1,198 @@

...

Quoted 7 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+
+   ./l2fwd-crypto -c 0x3 --vdev=eth_mrvl,iface=eth0
+ --vdev=cryptodev_mrvl_pmd

I will make the comment also in the first patch, but you should use "crypto_mrvl". The cryptodev_*_pmd convention is old and we are only maintaining it for backward compatibility. So, I would use "crypto_mrvl".

ACK

Thanks for comments.

--
- Tomasz Duszyński

#93 lore raw

PATCH v2 3/4 maintainers: add maintainers for the mrvl crypto pmd

In reply to Tomasz Duszynski
---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index d4810cf..93800d2 100644
@@ -561,6 +561,16 @@ F: drivers/crypto/dpaa2_sec/
 F: doc/guides/cryptodevs/dpaa2_sec.rst
 F: doc/guides/cryptodevs/features/dpaa2_sec.ini
 
+MARVELL MRVL PMD
+M: Jacek Siuda <[email protected]>
+M: Tomasz Duszynski <[email protected]>
+M: Dmitri Epshtein <[email protected]>
+M: Natalie Samsonov <[email protected]>
+M: Jianbo Liu <[email protected]>
+F: drivers/crypto/mrvl/
+F: doc/guides/cryptodevs/mrvl.rst
+F: doc/guides/cryptodevs/mrvl.ini
+
 SNOW 3G PMD
 M: Pablo de Lara <[email protected]>
 F: drivers/crypto/snow3g/
Signature · 1 line
2.7.4
#94 lore raw

PATCH v2 4/4 test: add mrvl crypto pmd unit tests

In reply to Tomasz Duszynski

Add unit tests for MRVL CRYPTO PMD driver.

---
 test/test/test_cryptodev.c                  | 168 ++++++++++++++++++++++++++++
 test/test/test_cryptodev.h                  |   1 +
 test/test/test_cryptodev_aes_test_vectors.h |  72 ++++++++----
 test/test/test_cryptodev_blockcipher.c      |   9 +-
 test/test/test_cryptodev_blockcipher.h      |   1 +
 test/test/test_cryptodev_des_test_vectors.h |  24 ++--
 6 files changed, 242 insertions(+), 33 deletions(-)
test/test/test_cryptodev.c +168 -0
index a4116c6..9fb6a2c 100644
@@ -341,6 +341,28 @@ testsuite_setup(void)
 		}
 	}
 
+	/* Create a MRVL device if required */
+	if (gbl_driver_id == rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_MRVL_PMD))) {
+#ifndef RTE_LIBRTE_PMD_MRVL_CRYPTO
+		RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO must be"
+			" enabled in config file to run this testsuite.\n");
+		return TEST_FAILED;
+#endif
+		nb_devs = rte_cryptodev_device_count_by_driver(
+				rte_cryptodev_driver_id_get(
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD)));
+		if (nb_devs < 1) {
+			ret = rte_vdev_init(
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD),
+				NULL);
+
+			TEST_ASSERT(ret == 0, "Failed to create "
+				"instance of pmd : %s",
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
+		}
+	}
+
 #ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
 	if (gbl_driver_id == rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD))) {
@@ -1862,6 +1884,101 @@ test_AES_chain_armv8_all(void)
 	return TEST_SUCCESS;
 }
 
+static int
+test_AES_chain_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AES_CHAIN_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_AES_cipheronly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AES_CIPHERONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_authonly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AUTHONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_3DES_chain_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_3DES_CHAIN_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_3DES_cipheronly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_3DES_CIPHERONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
 /* ***** SNOW 3G Tests ***** */
 static int
 create_wireless_algo_hash_session(uint8_t dev_id,
@@ -8939,6 +9056,40 @@ static struct unit_test_suite cryptodev_armv8_testsuite  = {
 	}
 };
 
+static struct unit_test_suite cryptodev_mrvl_testsuite  = {
+	.suite_name = "Crypto Device Marvell Component Test Suite",
+	.setup = testsuite_setup,
+	.teardown = testsuite_teardown,
+	.unit_test_cases = {
+		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_multi_session_random_usage),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_AES_chain_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_AES_cipheronly_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_authonly_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_3DES_chain_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_3DES_cipheronly_mrvl_all),
+
+		/** Negative tests */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			authentication_verify_HMAC_SHA1_fail_data_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
+
+		TEST_CASES_END() /**< NULL terminate unit test array */
+	}
+};
+
+
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
@@ -9083,6 +9234,22 @@ test_cryptodev_armv8(void)
 	return unit_test_suite_runner(&cryptodev_armv8_testsuite);
 }
 
+static int
+test_cryptodev_mrvl(void)
+{
+	gbl_driver_id = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
+
+	if (gbl_driver_id == -1) {
+		RTE_LOG(ERR, USER1, "MRVL PMD must be loaded. Check if "
+				"CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO is enabled "
+				"in config file to run this testsuite.\n");
+		return TEST_FAILED;
+	}
+
+	return unit_test_suite_runner(&cryptodev_mrvl_testsuite);
+}
+
 #ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
 
 static int
@@ -9136,4 +9303,5 @@ REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_autotest, test_cryptodev_sw_snow3g);
 REGISTER_TEST_COMMAND(cryptodev_sw_kasumi_autotest, test_cryptodev_sw_kasumi);
 REGISTER_TEST_COMMAND(cryptodev_sw_zuc_autotest, test_cryptodev_sw_zuc);
 REGISTER_TEST_COMMAND(cryptodev_sw_armv8_autotest, test_cryptodev_armv8);
+REGISTER_TEST_COMMAND(cryptodev_sw_mrvl_autotest, test_cryptodev_mrvl);
 REGISTER_TEST_COMMAND(cryptodev_dpaa2_sec_autotest, test_cryptodev_dpaa2_sec);
test/test/test_cryptodev.h +1 -0
index 4509a09..2e9eb0b 100644
@@ -88,6 +88,7 @@
 #define CRYPTODEV_NAME_ARMV8_PMD	crypto_armv8
 #define CRYPTODEV_NAME_DPAA2_SEC_PMD	crypto_dpaa2_sec
 #define CRYPTODEV_NAME_SCHEDULER_PMD	crypto_scheduler
+#define CRYPTODEV_NAME_MRVL_PMD		crypto_mrvl
 
 /**
  * Write (spread) data from buffer to mbuf data
test/test/test_cryptodev_aes_test_vectors.h +48 -24

216 lines not on this page · raw message

test/test/test_cryptodev_blockcipher.c +8 -1
index 6089af4..01fe136 100644
@@ -92,6 +92,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
 	int dpaa2_sec_pmd = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
+	int mrvl_pmd = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
 
 	int nb_segs = 1;
 
@@ -116,7 +118,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 	if (driver_id == dpaa2_sec_pmd ||
 			driver_id == qat_pmd ||
 			driver_id == openssl_pmd ||
-			driver_id == armv8_pmd) { /* Fall through */
+			driver_id == armv8_pmd ||
+			driver_id == mrvl_pmd) { /* Fall through */
 		digest_len = tdata->digest.len;
 	} else if (driver_id == aesni_mb_pmd ||
 			driver_id == scheduler_pmd) {
@@ -612,6 +615,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
 			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
 	int qat_pmd = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
+	int mrvl_pmd = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
 
 	switch (test_type) {
 	case BLKCIPHER_AES_CHAIN_TYPE:
@@ -670,6 +675,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
 		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER;
 	else if (driver_id == dpaa2_pmd)
 		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC;
+	else if (driver_id == mrvl_pmd)
+		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MRVL;
 	else
 		TEST_ASSERT(0, "Unrecognized cryptodev type");
 
test/test/test_cryptodev_blockcipher.h +1 -0
index 22b8d20..6919336 100644
@@ -53,6 +53,7 @@
 #define BLOCKCIPHER_TEST_TARGET_PMD_ARMV8	0x0008 /* ARMv8 flag */
 #define BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER	0x0010 /* Scheduler */
 #define BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC	0x0020 /* DPAA2_SEC flag */
+#define BLOCKCIPHER_TEST_TARGET_PMD_MRVL	0x0040 /* Marvell flag */
 
 #define BLOCKCIPHER_TEST_OP_CIPHER	(BLOCKCIPHER_TEST_OP_ENCRYPT | \
 					BLOCKCIPHER_TEST_OP_DECRYPT)
test/test/test_cryptodev_des_test_vectors.h +16 -8
index 0b6e0b8..ffcf657 100644
@@ -851,13 +851,15 @@ static const struct blockcipher_test_case des_cipheronly_test_cases[] = {
 		.test_descr = "DES-CBC Encryption",
 		.test_data = &des_cbc_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "DES-CBC Decryption",
 		.test_data = &des_cbc_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 
 };
@@ -1087,7 +1089,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC HMAC-SHA1 Decryption Digest Verify",
@@ -1095,19 +1098,22 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC SHA1 Encryption Digest",
 		.test_data = &triple_des192cbc_sha1_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC SHA1 Decryption Digest Verify",
 		.test_data = &triple_des192cbc_sha1_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-128-CTR HMAC-SHA1 Encryption Digest",
@@ -1220,7 +1226,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC Decryption",
@@ -1228,7 +1235,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-128-CTR Encryption",
Signature · 1 line
2.7.4
#95 lore raw

v3 cover add crypto mrvl pmd driver

In reply to Tomasz Duszynski

Hello,

This patch series introduces crypto driver for Marvell Armada 7k/8k SoCs along with documentation and crypto pmd driver tests.

Below you can find the list of features which crypto pmd supports:
* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Changes since v2:
* Added MRVL CRYPTO PMD to the test-build.sh.
* Updated release notes.
* Updated cryptoperf documentation.
* Removed cryptodev_mrvl_pmd driver alias.
* Fixed min,max key sizes used by HMACs in capabilities table.
* Renamed map file.
* Updated documentation.

Tomasz Duszynski (4):
crypto/mrvl: add mrvl crypto pmd driver
doc: add mrvl crypto pmd documentation
maintainers: add maintainers for the mrvl crypto pmd
test: add mrvl crypto pmd unit tests

 MAINTAINERS                                  |  10 +
 config/common_base                           |   6 +
 devtools/test-build.sh                       |   4 +
 doc/guides/cryptodevs/features/mrvl.ini      |  42 ++
 doc/guides/cryptodevs/index.rst              |   1 +
 doc/guides/cryptodevs/mrvl.rst               | 198 ++++++
 doc/guides/rel_notes/release_17_11.rst       |   5 +
 doc/guides/tools/cryptoperf.rst              |   1 +
 drivers/crypto/Makefile                      |   2 +
 drivers/crypto/mrvl/Makefile                 |  63 ++
 drivers/crypto/mrvl/rte_mrvl_compat.h        |  48 ++
 drivers/crypto/mrvl/rte_mrvl_pmd.c           | 869 +++++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c       | 776 ++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_private.h   | 121 ++++
 drivers/crypto/mrvl/rte_pmd_mrvl_version.map |   3 +
 mk/rte.app.mk                                |   1 +
 test/test/test_cryptodev.c                   | 168 ++++++
 test/test/test_cryptodev.h                   |   1 +
 test/test/test_cryptodev_aes_test_vectors.h  |  72 ++-
 test/test/test_cryptodev_blockcipher.c       |   9 +-
 test/test/test_cryptodev_blockcipher.h       |   1 +
 test/test/test_cryptodev_des_test_vectors.h  |  24 +-
 22 files changed, 2392 insertions(+), 33 deletions(-)
 create mode 100644 doc/guides/cryptodevs/features/mrvl.ini
 create mode 100644 doc/guides/cryptodevs/mrvl.rst
 create mode 100644 drivers/crypto/mrvl/Makefile
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_compat.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_private.h
 create mode 100644 drivers/crypto/mrvl/rte_pmd_mrvl_version.map

--
2.7.4

#96 lore raw

PATCH v3 1/4 crypto/mrvl: add mrvl crypto pmd driver

Add support for the Marvell Security Crypto Accelerator EIP197. Driver is based on external, publicly available, Marvell MUSDK library that provides access to the hardware with minimum overhead and high performance.

Driver comes with support for the following features:

* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

---
v3:
* Added MRVL CRYPTO PMD to the test-build.sh.
* Updated release notes.
* Updated cryptoperf documentation.
* Removed cryptodev_mrvl_pmd driver alias.
* Fixed min,max key sizes used by HMACs in capabilities table.
* Renamed map file.

 config/common_base                           |   6 +
 devtools/test-build.sh                       |   4 +
 doc/guides/rel_notes/release_17_11.rst       |   5 +
 doc/guides/tools/cryptoperf.rst              |   1 +
 drivers/crypto/Makefile                      |   2 +
 drivers/crypto/mrvl/Makefile                 |  63 ++
 drivers/crypto/mrvl/rte_mrvl_compat.h        |  48 ++
 drivers/crypto/mrvl/rte_mrvl_pmd.c           | 869 +++++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c       | 776 ++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_private.h   | 121 ++++
 drivers/crypto/mrvl/rte_pmd_mrvl_version.map |   3 +
 mk/rte.app.mk                                |   1 +
 12 files changed, 1899 insertions(+)
 create mode 100644 drivers/crypto/mrvl/Makefile
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_compat.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_private.h
 create mode 100644 drivers/crypto/mrvl/rte_pmd_mrvl_version.map
config/common_base +6 -0
index 4e4e7c1..745b239 100644
@@ -524,6 +524,12 @@ CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER_DEBUG=n
 CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=y
 
 #
+# Compile PMD for Marvell Crypto device
+#
+CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO=n
+CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO_DEBUG=n
+
+#
 # Compile generic event device library
 #
 CONFIG_RTE_LIBRTE_EVENTDEV=y
devtools/test-build.sh +4 -0
index c6dfaf0..d82e3f4 100755
@@ -50,6 +50,7 @@ default_path=$PATH
 # - LIBSSO_SNOW3G_PATH
 # - LIBSSO_KASUMI_PATH
 # - LIBSSO_ZUC_PATH
+# - LIBMUSDK_PATH
 . $(dirname $(readlink -e $0))/load-devel-config
 
 print_usage () {
@@ -133,6 +134,7 @@ reset_env ()
 	unset LIBSSO_KASUMI_PATH
 	unset LIBSSO_ZUC_PATH
 	unset PQOS_INSTALL_PATH
+	unset LIBMUSDK_PATH
 }
 
 config () # <directory> <target> <options>
@@ -193,6 +195,8 @@ config () # <directory> <target> <options>
 		test "$DPDK_DEP_SSL" != y || \
 		sed -ri            's,(PMD_QAT=)n,\1y,' $1/.config
 		sed -ri           's,(SCHED_.*=)n,\1y,' $1/.config
+		test -z "$LIBMUSDK_PATH" || \
+		sed -ri    's,(PMD_MRVL_CRYPTO=)n,\1y,' $1/.config
 		build_config_hook $1 $2 $3
 
 		# Explicit enabler/disabler (uppercase)
doc/guides/rel_notes/release_17_11.rst +5 -0
index 4f92912..340e162 100644
@@ -64,6 +64,11 @@ New Features
    * Support for Flow API
    * Support for Tx and Rx descriptor status functions
 
+* **Added MRVL crypto PMD.**
+
+  A new crypto PMD has been added, which provides several ciphering and hashing
+  algorithms. All cryptography operations use the MUSDK library crypto API.
+
 
 Resolved Issues
 ---------------
doc/guides/tools/cryptoperf.rst +1 -0
index 457f817..5105230 100644
@@ -189,6 +189,7 @@ The following are the appication command-line options:
            crypto_dpaa2_sec
            crypto_armv8
            crypto_scheduler
+           crypto_mrvl
 
 * ``--optype <name>``
 
drivers/crypto/Makefile +2 -0
index 7a719b9..1d7db5b 100644
@@ -51,6 +51,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += kasumi
 DEPDIRS-kasumi = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += zuc
 DEPDIRS-zuc = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += mrvl
+DEPDIRS-mrvl = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += null
 DEPDIRS-null = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += dpaa2_sec
drivers/crypto/mrvl/Makefile new file +63 -0

63 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_compat.h new file +48 -0

48 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd.c new file +869 -0

869 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +776 -0

776 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd_private.h new file +121 -0

121 lines not on this page · raw message

drivers/crypto/mrvl/rte_pmd_mrvl_version.map new file +3 -0
new file mode 100644
index 0000000..a753031
@@ -0,0 +1,3 @@
+DPDK_17.11 {
+	local: *;
+};
mk/rte.app.mk +1 -0
index 009bb7c..c9eb588 100644
@@ -168,6 +168,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -lrte_pmd_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -L$(LIBSSO_ZUC_PATH)/build -lsso_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -lrte_pmd_armv8
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += -L$(LIBMUSDK_PATH)/lib -lrte_pmd_mrvl_crypto -lmusdk
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += -lrte_pmd_crypto_scheduler
 ifeq ($(CONFIG_RTE_LIBRTE_FSLMC_BUS),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC)   += -lrte_pmd_dpaa2_sec

--
2.7.4

#97 lore raw

Re: [PATCH v3 1/4] crypto/mrvl: add mrvl crypto pmd driver

Quoted 11 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Duszynski
Sent: Saturday, October 7, 2017 9:28 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Tomasz Duszynski <[email protected]>; Jacek Siuda <[email protected]>
Subject: [dpdk-dev] [PATCH v3 1/4] crypto/mrvl: add mrvl crypto pmd driver

...

Quoted 6 lines
drivers/crypto/mrvl/rte_mrvl_pmd.c new file +0 -0
new file mode 100644
index 0000000..a404bf4

...

Quoted 10 lines
drivers/crypto/mrvl/rte_mrvl_pmd.c new file +3 -0
+
+/* Register the driver in constructor. */
+RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_MRVL_PMD,

cryptodev_mrvl_pmd_drv);

drivers/crypto/mrvl/rte_mrvl_pmd.c new file +5 -0
+RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_MRVL_PMD,
+	"max_nb_queue_pairs=<int> "
+	"max_nb_sessions=<int> "
+	"socket_id=<int>");
+RTE_PMD_REGISTER_CRYPTO_DRIVER(cryptodev_mrvl_pmd_drv,

cryptodev_driver_id);

This macro now needs 3 parameters. You probably rebased the patchset against the main repo, and not dpdk-next-crypto.
Just a reminder that all crypto patches should target this repository.

Apart from this, the rest of the patchset looks good to me. So send a v4 and hopefully it can be merged in RC1.

Pablo

#98 lore raw

Re: [PATCH v3 1/4] crypto/mrvl: add mrvl crypto pmd driver

Quoted 23 lines · Pablo
Quoted 11 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Duszynski
Sent: Saturday, October 7, 2017 9:28 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Tomasz Duszynski <[email protected]>; Jacek Siuda <[email protected]>
Subject: [dpdk-dev] [PATCH v3 1/4] crypto/mrvl: add mrvl crypto pmd driver

...

Quoted 6 lines
drivers/crypto/mrvl/rte_mrvl_pmd.c new file +0 -0
new file mode 100644
index 0000000..a404bf4

...

Quoted 13 lines
Quoted 10 lines
drivers/crypto/mrvl/rte_mrvl_pmd.c new file +3 -0
+
+/* Register the driver in constructor. */
+RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_MRVL_PMD,

cryptodev_mrvl_pmd_drv);

drivers/crypto/mrvl/rte_mrvl_pmd.c new file +5 -0
+RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_MRVL_PMD,
+	"max_nb_queue_pairs=<int> "
+	"max_nb_sessions=<int> "
+	"socket_id=<int>");
+RTE_PMD_REGISTER_CRYPTO_DRIVER(cryptodev_mrvl_pmd_drv,

cryptodev_driver_id);

This macro now needs 3 parameters. You probably rebased the patchset against the main repo, and not dpdk-next-crypto.

ACK

Quoted 7 lines

Just a reminder that all crypto patches should target this repository.

Apart from this, the rest of the patchset looks good to me. So send a v4 and hopefully it can be merged in RC1.

Pablo

--
- Tomasz Duszyński

#99 lore raw

PATCH v3 2/4 doc: add mrvl crypto pmd documentation

In reply to Tomasz Duszynski

Add documentation for the MRVL CRYPTO PMD driver.

---
v3:
* Updated documentation.

 doc/guides/cryptodevs/features/mrvl.ini |  42 +++++++
 doc/guides/cryptodevs/index.rst         |   1 +
 doc/guides/cryptodevs/mrvl.rst          | 198 ++++++++++++++++++++++++++++++++
 3 files changed, 241 insertions(+)
 create mode 100644 doc/guides/cryptodevs/features/mrvl.ini
 create mode 100644 doc/guides/cryptodevs/mrvl.rst
doc/guides/cryptodevs/features/mrvl.ini new file +42 -0
new file mode 100644
index 0000000..6d2fe6a
@@ -0,0 +1,42 @@
+; Supported features of the 'mrvl' crypto driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Symmetric crypto       = Y
+Sym operation chaining = Y
+
+;
+; Supported crypto algorithms of a default crypto driver.
+;
+[Cipher]
+AES CBC (128)  = Y
+AES CBC (192)  = Y
+AES CBC (256)  = Y
+AES CTR (128)  = Y
+AES CTR (192)  = Y
+AES CTR (256)  = Y
+3DES CBC       = Y
+3DES CTR       = Y
+
+;
+; Supported authentication algorithms of a default crypto driver.
+;
+[Auth]
+MD5          = Y
+MD5 HMAC     = Y
+SHA1         = Y
+SHA1 HMAC    = Y
+SHA256       = Y
+SHA256 HMAC  = Y
+SHA384       = Y
+SHA384 HMAC  = Y
+SHA512       = Y
+SHA512 HMAC  = Y
+AES GMAC     = Y
+
+;
+; Supported AEAD algorithms of a default crypto driver.
+;
+[AEAD]
+AES GCM (128) = Y
doc/guides/cryptodevs/index.rst +1 -0
index 361b82d..a8ee0eb 100644
@@ -42,6 +42,7 @@ Crypto Device Drivers
     dpaa2_sec
     kasumi
     openssl
+    mrvl
     null
     scheduler
     snow3g
doc/guides/cryptodevs/mrvl.rst new file +198 -0

198 lines not on this page · raw message

--
2.7.4

#100 lore raw

PATCH v3 3/4 maintainers: add maintainers for the mrvl crypto pmd

In reply to Tomasz Duszynski
---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index 73b0c1d..e65be03 100644
@@ -574,6 +574,16 @@ F: drivers/crypto/dpaa2_sec/
 F: doc/guides/cryptodevs/dpaa2_sec.rst
 F: doc/guides/cryptodevs/features/dpaa2_sec.ini
 
+MARVELL MRVL PMD
+M: Jacek Siuda <[email protected]>
+M: Tomasz Duszynski <[email protected]>
+M: Dmitri Epshtein <[email protected]>
+M: Natalie Samsonov <[email protected]>
+M: Jianbo Liu <[email protected]>
+F: drivers/crypto/mrvl/
+F: doc/guides/cryptodevs/mrvl.rst
+F: doc/guides/cryptodevs/mrvl.ini
+
 SNOW 3G PMD
 M: Pablo de Lara <[email protected]>
 F: drivers/crypto/snow3g/
Signature · 1 line
2.7.4
#101 lore raw

PATCH v3 4/4 test: add mrvl crypto pmd unit tests

In reply to Tomasz Duszynski

Add unit tests for MRVL CRYPTO PMD driver.

---
 test/test/test_cryptodev.c                  | 168 ++++++++++++++++++++++++++++
 test/test/test_cryptodev.h                  |   1 +
 test/test/test_cryptodev_aes_test_vectors.h |  72 ++++++++----
 test/test/test_cryptodev_blockcipher.c      |   9 +-
 test/test/test_cryptodev_blockcipher.h      |   1 +
 test/test/test_cryptodev_des_test_vectors.h |  24 ++--
 6 files changed, 242 insertions(+), 33 deletions(-)
test/test/test_cryptodev.c +168 -0
index a4116c6..9fb6a2c 100644
@@ -341,6 +341,28 @@ testsuite_setup(void)
 		}
 	}
 
+	/* Create a MRVL device if required */
+	if (gbl_driver_id == rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_MRVL_PMD))) {
+#ifndef RTE_LIBRTE_PMD_MRVL_CRYPTO
+		RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO must be"
+			" enabled in config file to run this testsuite.\n");
+		return TEST_FAILED;
+#endif
+		nb_devs = rte_cryptodev_device_count_by_driver(
+				rte_cryptodev_driver_id_get(
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD)));
+		if (nb_devs < 1) {
+			ret = rte_vdev_init(
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD),
+				NULL);
+
+			TEST_ASSERT(ret == 0, "Failed to create "
+				"instance of pmd : %s",
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
+		}
+	}
+
 #ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
 	if (gbl_driver_id == rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD))) {
@@ -1862,6 +1884,101 @@ test_AES_chain_armv8_all(void)
 	return TEST_SUCCESS;
 }
 
+static int
+test_AES_chain_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AES_CHAIN_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_AES_cipheronly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AES_CIPHERONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_authonly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AUTHONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_3DES_chain_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_3DES_CHAIN_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_3DES_cipheronly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_3DES_CIPHERONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
 /* ***** SNOW 3G Tests ***** */
 static int
 create_wireless_algo_hash_session(uint8_t dev_id,
@@ -8939,6 +9056,40 @@ static struct unit_test_suite cryptodev_armv8_testsuite  = {
 	}
 };
 
+static struct unit_test_suite cryptodev_mrvl_testsuite  = {
+	.suite_name = "Crypto Device Marvell Component Test Suite",
+	.setup = testsuite_setup,
+	.teardown = testsuite_teardown,
+	.unit_test_cases = {
+		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_multi_session_random_usage),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_AES_chain_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_AES_cipheronly_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_authonly_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_3DES_chain_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_3DES_cipheronly_mrvl_all),
+
+		/** Negative tests */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			authentication_verify_HMAC_SHA1_fail_data_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
+
+		TEST_CASES_END() /**< NULL terminate unit test array */
+	}
+};
+
+
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
@@ -9083,6 +9234,22 @@ test_cryptodev_armv8(void)
 	return unit_test_suite_runner(&cryptodev_armv8_testsuite);
 }
 
+static int
+test_cryptodev_mrvl(void)
+{
+	gbl_driver_id = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
+
+	if (gbl_driver_id == -1) {
+		RTE_LOG(ERR, USER1, "MRVL PMD must be loaded. Check if "
+				"CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO is enabled "
+				"in config file to run this testsuite.\n");
+		return TEST_FAILED;
+	}
+
+	return unit_test_suite_runner(&cryptodev_mrvl_testsuite);
+}
+
 #ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
 
 static int
@@ -9136,4 +9303,5 @@ REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_autotest, test_cryptodev_sw_snow3g);
 REGISTER_TEST_COMMAND(cryptodev_sw_kasumi_autotest, test_cryptodev_sw_kasumi);
 REGISTER_TEST_COMMAND(cryptodev_sw_zuc_autotest, test_cryptodev_sw_zuc);
 REGISTER_TEST_COMMAND(cryptodev_sw_armv8_autotest, test_cryptodev_armv8);
+REGISTER_TEST_COMMAND(cryptodev_sw_mrvl_autotest, test_cryptodev_mrvl);
 REGISTER_TEST_COMMAND(cryptodev_dpaa2_sec_autotest, test_cryptodev_dpaa2_sec);
test/test/test_cryptodev.h +1 -0
index 4509a09..2e9eb0b 100644
@@ -88,6 +88,7 @@
 #define CRYPTODEV_NAME_ARMV8_PMD	crypto_armv8
 #define CRYPTODEV_NAME_DPAA2_SEC_PMD	crypto_dpaa2_sec
 #define CRYPTODEV_NAME_SCHEDULER_PMD	crypto_scheduler
+#define CRYPTODEV_NAME_MRVL_PMD		crypto_mrvl
 
 /**
  * Write (spread) data from buffer to mbuf data
test/test/test_cryptodev_aes_test_vectors.h +48 -24

216 lines not on this page · raw message

test/test/test_cryptodev_blockcipher.c +8 -1
index 6089af4..01fe136 100644
@@ -92,6 +92,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
 	int dpaa2_sec_pmd = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
+	int mrvl_pmd = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
 
 	int nb_segs = 1;
 
@@ -116,7 +118,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 	if (driver_id == dpaa2_sec_pmd ||
 			driver_id == qat_pmd ||
 			driver_id == openssl_pmd ||
-			driver_id == armv8_pmd) { /* Fall through */
+			driver_id == armv8_pmd ||
+			driver_id == mrvl_pmd) { /* Fall through */
 		digest_len = tdata->digest.len;
 	} else if (driver_id == aesni_mb_pmd ||
 			driver_id == scheduler_pmd) {
@@ -612,6 +615,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
 			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
 	int qat_pmd = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
+	int mrvl_pmd = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
 
 	switch (test_type) {
 	case BLKCIPHER_AES_CHAIN_TYPE:
@@ -670,6 +675,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
 		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER;
 	else if (driver_id == dpaa2_pmd)
 		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC;
+	else if (driver_id == mrvl_pmd)
+		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MRVL;
 	else
 		TEST_ASSERT(0, "Unrecognized cryptodev type");
 
test/test/test_cryptodev_blockcipher.h +1 -0
index 22b8d20..6919336 100644
@@ -53,6 +53,7 @@
 #define BLOCKCIPHER_TEST_TARGET_PMD_ARMV8	0x0008 /* ARMv8 flag */
 #define BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER	0x0010 /* Scheduler */
 #define BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC	0x0020 /* DPAA2_SEC flag */
+#define BLOCKCIPHER_TEST_TARGET_PMD_MRVL	0x0040 /* Marvell flag */
 
 #define BLOCKCIPHER_TEST_OP_CIPHER	(BLOCKCIPHER_TEST_OP_ENCRYPT | \
 					BLOCKCIPHER_TEST_OP_DECRYPT)
test/test/test_cryptodev_des_test_vectors.h +16 -8
index 0b6e0b8..ffcf657 100644
@@ -851,13 +851,15 @@ static const struct blockcipher_test_case des_cipheronly_test_cases[] = {
 		.test_descr = "DES-CBC Encryption",
 		.test_data = &des_cbc_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "DES-CBC Decryption",
 		.test_data = &des_cbc_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 
 };
@@ -1087,7 +1089,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC HMAC-SHA1 Decryption Digest Verify",
@@ -1095,19 +1098,22 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC SHA1 Encryption Digest",
 		.test_data = &triple_des192cbc_sha1_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC SHA1 Decryption Digest Verify",
 		.test_data = &triple_des192cbc_sha1_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-128-CTR HMAC-SHA1 Encryption Digest",
@@ -1220,7 +1226,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC Decryption",
@@ -1228,7 +1235,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-128-CTR Encryption",
Signature · 1 line
2.7.4
#102 lore raw

Re: [PATCH v3 4/4] test: add mrvl crypto pmd unit tests

Quoted 11 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Duszynski
Sent: Saturday, October 7, 2017 9:28 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Tomasz Duszynski <[email protected]>; Jacek Siuda <[email protected]>
Subject: [dpdk-dev] [PATCH v3 4/4] test: add mrvl crypto pmd unit tests

Quoted 4 lines

Add unit tests for MRVL CRYPTO PMD driver.

Hi Tomasz,

Just one final comment, Patch 2 and this patch have your email wrong.

Pablo

#103 lore raw

Re: [PATCH v3 4/4] test: add mrvl crypto pmd unit tests

Quoted 11 lines · Pablo
Quoted 11 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Duszynski
Sent: Saturday, October 7, 2017 9:28 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Tomasz Duszynski <[email protected]>; Jacek Siuda <[email protected]>
Subject: [dpdk-dev] [PATCH v3 4/4] test: add mrvl crypto pmd unit tests

Quoted 8 lines
Quoted 4 lines

Add unit tests for MRVL CRYPTO PMD driver.

Hi Tomasz,

Just one final comment, Patch 2 and this patch have your email wrong.

Fixed already. Thanks.

Quoted 2 lines

Pablo

--
- Tomasz Duszyński

#104 lore raw

v4 cover add crypto mrvl pmd driver

In reply to Tomasz Duszynski

Hello,

This patch series introduces crypto driver for Marvell Armada 7k/8k SoCs along with documentation and crypto pmd driver tests.

Below you can find the list of features which crypto pmd supports:
* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Changes since v3:
* Rebased on dpdk-next-crypto.
* Allocated driver structure statically.
* Fixed email addresses.
* Updated documentation.

Changes since v2:
* Added MRVL CRYPTO PMD to the test-build.sh.
* Updated release notes.
* Updated cryptoperf documentation.
* Removed cryptodev_mrvl_pmd driver alias.
* Fixed min,max key sizes used by HMACs in capabilities table.
* Renamed map file.
* Updated documentation.

Tomasz Duszynski (4):
crypto/mrvl: add mrvl crypto pmd driver
doc: add mrvl crypto pmd documentation
maintainers: add maintainers for the mrvl crypto pmd
test: add mrvl crypto pmd unit tests

 MAINTAINERS                                  |  10 +
 config/common_base                           |   6 +
 devtools/test-build.sh                       |   4 +
 doc/guides/cryptodevs/features/mrvl.ini      |  42 ++
 doc/guides/cryptodevs/index.rst              |   1 +
 doc/guides/cryptodevs/mrvl.rst               | 205 +++++++
 doc/guides/rel_notes/release_17_11.rst       |   5 +
 doc/guides/tools/cryptoperf.rst              |   1 +
 drivers/crypto/Makefile                      |   2 +
 drivers/crypto/mrvl/Makefile                 |  63 ++
 drivers/crypto/mrvl/rte_mrvl_compat.h        |  48 ++
 drivers/crypto/mrvl/rte_mrvl_pmd.c           | 872 +++++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c       | 776 ++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_private.h   | 121 ++++
 drivers/crypto/mrvl/rte_pmd_mrvl_version.map |   3 +
 mk/rte.app.mk                                |   1 +
 test/test/test_cryptodev.c                   | 168 ++++++
 test/test/test_cryptodev.h                   |   1 +
 test/test/test_cryptodev_aes_test_vectors.h  |  72 ++-
 test/test/test_cryptodev_blockcipher.c       |   9 +-
 test/test/test_cryptodev_blockcipher.h       |   1 +
 test/test/test_cryptodev_des_test_vectors.h  |  24 +-
 22 files changed, 2402 insertions(+), 33 deletions(-)
 create mode 100644 doc/guides/cryptodevs/features/mrvl.ini
 create mode 100644 doc/guides/cryptodevs/mrvl.rst
 create mode 100644 drivers/crypto/mrvl/Makefile
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_compat.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_private.h
 create mode 100644 drivers/crypto/mrvl/rte_pmd_mrvl_version.map

--
2.7.4

#105 lore raw

PATCH v4 1/4 crypto/mrvl: add mrvl crypto pmd driver

Add support for the Marvell Security Crypto Accelerator EIP197. Driver is based on external, publicly available, Marvell MUSDK library that provides access to the hardware with minimum overhead and high performance.

Driver comes with support for the following features:

* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <[email protected]>
Tomasz Duszynski <[email protected]>

Marvell:
Dmitri Epshtein <[email protected]>
Natalie Samsonov <[email protected]>

---
v4:
* Allocated driver structure statically.

v3:
* Added MRVL CRYPTO PMD to the test-build.sh.
* Updated release notes.
* Updated cryptoperf documentation.
* Removed cryptodev_mrvl_pmd driver alias.
* Fixed min,max key sizes used by HMACs in capabilities table.
* Renamed map file.

 config/common_base                           |   6 +
 devtools/test-build.sh                       |   4 +
 doc/guides/rel_notes/release_17_11.rst       |   5 +
 doc/guides/tools/cryptoperf.rst              |   1 +
 drivers/crypto/Makefile                      |   2 +
 drivers/crypto/mrvl/Makefile                 |  63 ++
 drivers/crypto/mrvl/rte_mrvl_compat.h        |  48 ++
 drivers/crypto/mrvl/rte_mrvl_pmd.c           | 872 +++++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c       | 776 ++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_private.h   | 121 ++++
 drivers/crypto/mrvl/rte_pmd_mrvl_version.map |   3 +
 mk/rte.app.mk                                |   1 +
 12 files changed, 1902 insertions(+)
 create mode 100644 drivers/crypto/mrvl/Makefile
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_compat.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_private.h
 create mode 100644 drivers/crypto/mrvl/rte_pmd_mrvl_version.map
config/common_base +6 -0
index 8adcb09..db1e20b 100644
@@ -528,6 +528,12 @@ CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER_DEBUG=n
 CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=y
 
 #
+# Compile PMD for Marvell Crypto device
+#
+CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO=n
+CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO_DEBUG=n
+
+#
 # Compile generic event device library
 #
 CONFIG_RTE_LIBRTE_EVENTDEV=y
devtools/test-build.sh +4 -0
index c6dfaf0..d82e3f4 100755
@@ -50,6 +50,7 @@ default_path=$PATH
 # - LIBSSO_SNOW3G_PATH
 # - LIBSSO_KASUMI_PATH
 # - LIBSSO_ZUC_PATH
+# - LIBMUSDK_PATH
 . $(dirname $(readlink -e $0))/load-devel-config
 
 print_usage () {
@@ -133,6 +134,7 @@ reset_env ()
 	unset LIBSSO_KASUMI_PATH
 	unset LIBSSO_ZUC_PATH
 	unset PQOS_INSTALL_PATH
+	unset LIBMUSDK_PATH
 }
 
 config () # <directory> <target> <options>
@@ -193,6 +195,8 @@ config () # <directory> <target> <options>
 		test "$DPDK_DEP_SSL" != y || \
 		sed -ri            's,(PMD_QAT=)n,\1y,' $1/.config
 		sed -ri           's,(SCHED_.*=)n,\1y,' $1/.config
+		test -z "$LIBMUSDK_PATH" || \
+		sed -ri    's,(PMD_MRVL_CRYPTO=)n,\1y,' $1/.config
 		build_config_hook $1 $2 $3
 
 		# Explicit enabler/disabler (uppercase)
doc/guides/rel_notes/release_17_11.rst +5 -0
index f452f0b..6ff86e4 100644
@@ -122,6 +122,11 @@ New Features
   added. See the "Crypto Device Drivers" document for more details on this
   driver.
 
+* **Added MRVL crypto PMD.**
+
+  A new crypto PMD has been added, which provides several ciphering and hashing
+  algorithms. All cryptography operations use the MUSDK library crypto API.
+
 
 Resolved Issues
 ---------------
doc/guides/tools/cryptoperf.rst +1 -0
index 2b3a5b6..7e12677 100644
@@ -194,6 +194,7 @@ The following are the appication command-line options:
            crypto_dpaa2_sec
            crypto_armv8
            crypto_scheduler
+           crypto_mrvl
 
 * ``--optype <name>``
 
drivers/crypto/Makefile +2 -0
index 8ca5f18..d8c8740 100644
@@ -51,6 +51,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += kasumi
 DEPDIRS-kasumi = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += zuc
 DEPDIRS-zuc = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += mrvl
+DEPDIRS-mrvl = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += null
 DEPDIRS-null = $(core-libs)
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC) += dpaa2_sec
drivers/crypto/mrvl/Makefile new file +63 -0

63 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_compat.h new file +48 -0

48 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd.c new file +872 -0

872 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd_ops.c new file +776 -0

776 lines not on this page · raw message

drivers/crypto/mrvl/rte_mrvl_pmd_private.h new file +121 -0

121 lines not on this page · raw message

drivers/crypto/mrvl/rte_pmd_mrvl_version.map new file +3 -0
new file mode 100644
index 0000000..a753031
@@ -0,0 +1,3 @@
+DPDK_17.11 {
+	local: *;
+};
mk/rte.app.mk +1 -0
index 51b97e3..c6d21df 100644
@@ -172,6 +172,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -lrte_pmd_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -L$(LIBSSO_ZUC_PATH)/build -lsso_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -lrte_pmd_armv8
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += -L$(LIBMUSDK_PATH)/lib -lrte_pmd_mrvl_crypto -lmusdk
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += -lrte_pmd_crypto_scheduler
 ifeq ($(CONFIG_RTE_LIBRTE_FSLMC_BUS),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC)   += -lrte_pmd_dpaa2_sec

--
2.7.4

#106 lore raw

PATCH v4 2/4 doc: add mrvl crypto pmd documentation

In reply to Tomasz Duszynski

Add documentation for the MRVL CRYPTO PMD driver.

---
v4:
* Updated documentation.

v3:
* Updated documentation.

 doc/guides/cryptodevs/features/mrvl.ini |  42 +++++++
 doc/guides/cryptodevs/index.rst         |   1 +
 doc/guides/cryptodevs/mrvl.rst          | 205 ++++++++++++++++++++++++++++++++
 3 files changed, 248 insertions(+)
 create mode 100644 doc/guides/cryptodevs/features/mrvl.ini
 create mode 100644 doc/guides/cryptodevs/mrvl.rst
doc/guides/cryptodevs/features/mrvl.ini new file +42 -0
new file mode 100644
index 0000000..6d2fe6a
@@ -0,0 +1,42 @@
+; Supported features of the 'mrvl' crypto driver.
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+[Features]
+Symmetric crypto       = Y
+Sym operation chaining = Y
+
+;
+; Supported crypto algorithms of a default crypto driver.
+;
+[Cipher]
+AES CBC (128)  = Y
+AES CBC (192)  = Y
+AES CBC (256)  = Y
+AES CTR (128)  = Y
+AES CTR (192)  = Y
+AES CTR (256)  = Y
+3DES CBC       = Y
+3DES CTR       = Y
+
+;
+; Supported authentication algorithms of a default crypto driver.
+;
+[Auth]
+MD5          = Y
+MD5 HMAC     = Y
+SHA1         = Y
+SHA1 HMAC    = Y
+SHA256       = Y
+SHA256 HMAC  = Y
+SHA384       = Y
+SHA384 HMAC  = Y
+SHA512       = Y
+SHA512 HMAC  = Y
+AES GMAC     = Y
+
+;
+; Supported AEAD algorithms of a default crypto driver.
+;
+[AEAD]
+AES GCM (128) = Y
doc/guides/cryptodevs/index.rst +1 -0
index 3a39a2d..6d4e15b 100644
@@ -43,6 +43,7 @@ Crypto Device Drivers
     dpaa_sec
     kasumi
     openssl
+    mrvl
     null
     scheduler
     snow3g
doc/guides/cryptodevs/mrvl.rst new file +205 -0

205 lines not on this page · raw message

--
2.7.4

#107 lore raw

PATCH v4 3/4 maintainers: add maintainers for the mrvl crypto pmd

In reply to Tomasz Duszynski

---
v4:
* Changed Jianbo Liu mail address.

 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index fd565ae..eb453a9 100644
@@ -576,6 +576,16 @@ F: drivers/crypto/dpaa2_sec/
 F: doc/guides/cryptodevs/dpaa2_sec.rst
 F: doc/guides/cryptodevs/features/dpaa2_sec.ini
 
+MARVELL MRVL PMD
+M: Jacek Siuda <[email protected]>
+M: Tomasz Duszynski <[email protected]>
+M: Dmitri Epshtein <[email protected]>
+M: Natalie Samsonov <[email protected]>
+M: Jianbo Liu <[email protected]>
+F: drivers/crypto/mrvl/
+F: doc/guides/cryptodevs/mrvl.rst
+F: doc/guides/cryptodevs/mrvl.ini
+
 SNOW 3G PMD
 M: Pablo de Lara <[email protected]>
 F: drivers/crypto/snow3g/

--
2.7.4

#108 lore raw

PATCH v4 4/4 test: add mrvl crypto pmd unit tests

In reply to Tomasz Duszynski

Add unit tests for MRVL CRYPTO PMD driver.

---
 test/test/test_cryptodev.c                  | 168 ++++++++++++++++++++++++++++
 test/test/test_cryptodev.h                  |   1 +
 test/test/test_cryptodev_aes_test_vectors.h |  72 ++++++++----
 test/test/test_cryptodev_blockcipher.c      |   9 +-
 test/test/test_cryptodev_blockcipher.h      |   1 +
 test/test/test_cryptodev_des_test_vectors.h |  24 ++--
 6 files changed, 242 insertions(+), 33 deletions(-)
test/test/test_cryptodev.c +168 -0
index df84430..a926779 100644
@@ -341,6 +341,28 @@ testsuite_setup(void)
 		}
 	}
 
+	/* Create a MRVL device if required */
+	if (gbl_driver_id == rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_MRVL_PMD))) {
+#ifndef RTE_LIBRTE_PMD_MRVL_CRYPTO
+		RTE_LOG(ERR, USER1, "CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO must be"
+			" enabled in config file to run this testsuite.\n");
+		return TEST_FAILED;
+#endif
+		nb_devs = rte_cryptodev_device_count_by_driver(
+				rte_cryptodev_driver_id_get(
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD)));
+		if (nb_devs < 1) {
+			ret = rte_vdev_init(
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD),
+				NULL);
+
+			TEST_ASSERT(ret == 0, "Failed to create "
+				"instance of pmd : %s",
+				RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
+		}
+	}
+
 #ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
 	if (gbl_driver_id == rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD))) {
@@ -1919,6 +1941,101 @@ test_AES_chain_armv8_all(void)
 	return TEST_SUCCESS;
 }
 
+static int
+test_AES_chain_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AES_CHAIN_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_AES_cipheronly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AES_CIPHERONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_authonly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_AUTHONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_3DES_chain_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_3DES_CHAIN_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
+static int
+test_3DES_cipheronly_mrvl_all(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	int status;
+
+	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+		ts_params->op_mpool,
+		ts_params->session_mpool,
+		ts_params->valid_devs[0],
+		rte_cryptodev_driver_id_get(
+		RTE_STR(CRYPTODEV_NAME_MRVL_PMD)),
+		BLKCIPHER_3DES_CIPHERONLY_TYPE);
+
+	TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+	return TEST_SUCCESS;
+}
+
 /* ***** SNOW 3G Tests ***** */
 static int
 create_wireless_algo_hash_session(uint8_t dev_id,
@@ -9417,6 +9534,40 @@ static struct unit_test_suite cryptodev_armv8_testsuite  = {
 	}
 };
 
+static struct unit_test_suite cryptodev_mrvl_testsuite  = {
+	.suite_name = "Crypto Device Marvell Component Test Suite",
+	.setup = testsuite_setup,
+	.teardown = testsuite_teardown,
+	.unit_test_cases = {
+		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_multi_session_random_usage),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_AES_chain_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_AES_cipheronly_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_authonly_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_3DES_chain_mrvl_all),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+				test_3DES_cipheronly_mrvl_all),
+
+		/** Negative tests */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			authentication_verify_HMAC_SHA1_fail_data_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
+
+		TEST_CASES_END() /**< NULL terminate unit test array */
+	}
+};
+
+
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
@@ -9561,6 +9712,22 @@ test_cryptodev_armv8(void)
 	return unit_test_suite_runner(&cryptodev_armv8_testsuite);
 }
 
+static int
+test_cryptodev_mrvl(void)
+{
+	gbl_driver_id = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
+
+	if (gbl_driver_id == -1) {
+		RTE_LOG(ERR, USER1, "MRVL PMD must be loaded. Check if "
+				"CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO is enabled "
+				"in config file to run this testsuite.\n");
+		return TEST_FAILED;
+	}
+
+	return unit_test_suite_runner(&cryptodev_mrvl_testsuite);
+}
+
 #ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
 
 static int
@@ -9630,5 +9797,6 @@ REGISTER_TEST_COMMAND(cryptodev_sw_snow3g_autotest, test_cryptodev_sw_snow3g);
 REGISTER_TEST_COMMAND(cryptodev_sw_kasumi_autotest, test_cryptodev_sw_kasumi);
 REGISTER_TEST_COMMAND(cryptodev_sw_zuc_autotest, test_cryptodev_sw_zuc);
 REGISTER_TEST_COMMAND(cryptodev_sw_armv8_autotest, test_cryptodev_armv8);
+REGISTER_TEST_COMMAND(cryptodev_sw_mrvl_autotest, test_cryptodev_mrvl);
 REGISTER_TEST_COMMAND(cryptodev_dpaa2_sec_autotest, test_cryptodev_dpaa2_sec);
 REGISTER_TEST_COMMAND(cryptodev_dpaa_sec_autotest, test_cryptodev_dpaa_sec);
test/test/test_cryptodev.h +1 -0
index 4509a09..2e9eb0b 100644
@@ -88,6 +88,7 @@
 #define CRYPTODEV_NAME_ARMV8_PMD	crypto_armv8
 #define CRYPTODEV_NAME_DPAA2_SEC_PMD	crypto_dpaa2_sec
 #define CRYPTODEV_NAME_SCHEDULER_PMD	crypto_scheduler
+#define CRYPTODEV_NAME_MRVL_PMD		crypto_mrvl
 
 /**
  * Write (spread) data from buffer to mbuf data
test/test/test_cryptodev_aes_test_vectors.h +48 -24

216 lines not on this page · raw message

test/test/test_cryptodev_blockcipher.c +8 -1
index 167d196..9a9fd8b 100644
@@ -94,6 +94,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 			RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
 	int dpaa_sec_pmd = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD));
+	int mrvl_pmd = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
 
 	int nb_segs = 1;
 
@@ -119,7 +121,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 			driver_id == dpaa_sec_pmd ||
 			driver_id == qat_pmd ||
 			driver_id == openssl_pmd ||
-			driver_id == armv8_pmd) { /* Fall through */
+			driver_id == armv8_pmd ||
+			driver_id == mrvl_pmd) { /* Fall through */
 		digest_len = tdata->digest.len;
 	} else if (driver_id == aesni_mb_pmd ||
 			driver_id == scheduler_pmd) {
@@ -592,6 +595,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
 			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
 	int qat_pmd = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
+	int mrvl_pmd = rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MRVL_PMD));
 
 	switch (test_type) {
 	case BLKCIPHER_AES_CHAIN_TYPE:
@@ -652,6 +657,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
 		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC;
 	else if (driver_id == dpaa_sec_pmd)
 		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC;
+	else if (driver_id == mrvl_pmd)
+		target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MRVL;
 	else
 		TEST_ASSERT(0, "Unrecognized cryptodev type");
 
test/test/test_cryptodev_blockcipher.h +1 -0
index b81e559..67c78d4 100644
@@ -54,6 +54,7 @@
 #define BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER	0x0010 /* Scheduler */
 #define BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC	0x0020 /* DPAA2_SEC flag */
 #define BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC	0x0040 /* DPAA_SEC flag */
+#define BLOCKCIPHER_TEST_TARGET_PMD_MRVL	0x0080 /* Marvell flag */
 
 #define BLOCKCIPHER_TEST_OP_CIPHER	(BLOCKCIPHER_TEST_OP_ENCRYPT | \
 					BLOCKCIPHER_TEST_OP_DECRYPT)
test/test/test_cryptodev_des_test_vectors.h +16 -8
index ebf8869..05265ae 100644
@@ -853,7 +853,8 @@ static const struct blockcipher_test_case des_cipheronly_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
 			BLOCKCIPHER_TEST_TARGET_PMD_MB |
-			BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+			BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "DES-CBC Decryption",
@@ -861,7 +862,8 @@ static const struct blockcipher_test_case des_cipheronly_test_cases[] = {
 		.op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_QAT |
 			BLOCKCIPHER_TEST_TARGET_PMD_MB |
-			BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+			BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 
 };
@@ -1100,7 +1102,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
 			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC HMAC-SHA1 Decryption Digest Verify",
@@ -1109,19 +1112,22 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
 			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC SHA1 Encryption Digest",
 		.test_data = &triple_des192cbc_sha1_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC SHA1 Decryption Digest Verify",
 		.test_data = &triple_des192cbc_sha1_test_vector,
 		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
-		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
+		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-128-CTR HMAC-SHA1 Encryption Digest",
@@ -1237,7 +1243,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
 			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-192-CBC Decryption",
@@ -1246,7 +1253,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
 		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
 			BLOCKCIPHER_TEST_TARGET_PMD_QAT |
 			BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
-			BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
+			BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+			BLOCKCIPHER_TEST_TARGET_PMD_MRVL
 	},
 	{
 		.test_descr = "3DES-128-CTR Encryption",
Signature · 1 line
2.7.4
#109 lore raw

Re: [PATCH v4 0/4] add crypto mrvl pmd driver

In reply to Tomasz Duszynski
Quoted 93 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tomasz Duszynski
Sent: Tuesday, October 10, 2017 1:17 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Tomasz Duszynski <[email protected]>
Subject: [dpdk-dev] [PATCH v4 0/4] add crypto mrvl pmd driver

Hello,

This patch series introduces crypto driver for Marvell Armada 7k/8k SoCs along with documentation and crypto pmd driver tests.

Below you can find the list of features which crypto pmd supports:
* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Changes since v3:
* Rebased on dpdk-next-crypto.
* Allocated driver structure statically.
* Fixed email addresses.
* Updated documentation.

Changes since v2:
* Added MRVL CRYPTO PMD to the test-build.sh.
* Updated release notes.
* Updated cryptoperf documentation.
* Removed cryptodev_mrvl_pmd driver alias.
* Fixed min,max key sizes used by HMACs in capabilities table.
* Renamed map file.
* Updated documentation.

Tomasz Duszynski (4):
crypto/mrvl: add mrvl crypto pmd driver
doc: add mrvl crypto pmd documentation
maintainers: add maintainers for the mrvl crypto pmd
test: add mrvl crypto pmd unit tests

 MAINTAINERS                                  |  10 +
 config/common_base                           |   6 +
 devtools/test-build.sh                       |   4 +
 doc/guides/cryptodevs/features/mrvl.ini      |  42 ++
 doc/guides/cryptodevs/index.rst              |   1 +
 doc/guides/cryptodevs/mrvl.rst               | 205 +++++++
 doc/guides/rel_notes/release_17_11.rst       |   5 +
 doc/guides/tools/cryptoperf.rst              |   1 +
 drivers/crypto/Makefile                      |   2 +
 drivers/crypto/mrvl/Makefile                 |  63 ++
 drivers/crypto/mrvl/rte_mrvl_compat.h        |  48 ++
 drivers/crypto/mrvl/rte_mrvl_pmd.c           | 872
+++++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c       | 776
++++++++++++++++++++++++
 drivers/crypto/mrvl/rte_mrvl_pmd_private.h   | 121 ++++
 drivers/crypto/mrvl/rte_pmd_mrvl_version.map |   3 +
 mk/rte.app.mk                                |   1 +
 test/test/test_cryptodev.c                   | 168 ++++++
 test/test/test_cryptodev.h                   |   1 +
 test/test/test_cryptodev_aes_test_vectors.h  |  72 ++-
 test/test/test_cryptodev_blockcipher.c       |   9 +-
 test/test/test_cryptodev_blockcipher.h       |   1 +
 test/test/test_cryptodev_des_test_vectors.h  |  24 +-
 22 files changed, 2402 insertions(+), 33 deletions(-)  create mode 100644
doc/guides/cryptodevs/features/mrvl.ini
 create mode 100644 doc/guides/cryptodevs/mrvl.rst  create mode 100644
drivers/crypto/mrvl/Makefile  create mode 100644
drivers/crypto/mrvl/rte_mrvl_compat.h
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_ops.c
 create mode 100644 drivers/crypto/mrvl/rte_mrvl_pmd_private.h
 create mode 100644 drivers/crypto/mrvl/rte_pmd_mrvl_version.map
Quoted 2 lines

--
2.7.4

Applied to dpdk-next-crypto, squashing patch 1 and 3. Thanks,

Pablo