regex/mlx5: introduce driver for BlueField 2

This commit introduce the RegEx poll mode drivers class, and
adds Mellanox RegEx PMD.

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Signed-off-by: Ori Kam <orika@mellanox.com>
This commit is contained in:
Yuval Avnery 2020-07-20 06:26:05 +00:00 committed by Thomas Monjalon
parent 3a66b2f90b
commit cf9b3c36e5
24 changed files with 335 additions and 6 deletions

1
.gitignore vendored
View File

@ -9,6 +9,7 @@ doc/guides/cryptodevs/overview_auth_table.txt
doc/guides/cryptodevs/overview_aead_table.txt doc/guides/cryptodevs/overview_aead_table.txt
doc/guides/cryptodevs/overview_asym_table.txt doc/guides/cryptodevs/overview_asym_table.txt
doc/guides/compressdevs/overview_feature_table.txt doc/guides/compressdevs/overview_feature_table.txt
doc/guides/regexdevs/overview_feature_table.txt
doc/guides/vdpadevs/overview_feature_table.txt doc/guides/vdpadevs/overview_feature_table.txt
doc/guides/bbdevs/overview_feature_table.txt doc/guides/bbdevs/overview_feature_table.txt

View File

@ -454,6 +454,7 @@ RegEx API - EXPERIMENTAL
M: Ori Kam <orika@mellanox.com> M: Ori Kam <orika@mellanox.com>
F: lib/librte_regexdev/ F: lib/librte_regexdev/
F: doc/guides/prog_guide/regexdev.rst F: doc/guides/prog_guide/regexdev.rst
F: doc/guides/regexdevs/features/default.ini
Eventdev API Eventdev API
M: Jerin Jacob <jerinj@marvell.com> M: Jerin Jacob <jerinj@marvell.com>
@ -1128,6 +1129,16 @@ F: doc/guides/compressdevs/zlib.rst
F: doc/guides/compressdevs/features/zlib.ini F: doc/guides/compressdevs/features/zlib.ini
RegEx Drivers
-------------
Mellanox mlx5
M: Ori Kam <orika@mellanox.com>
F: drivers/regex/mlx5/
F: doc/guides/regexdevs/mlx5.rst
F: doc/guides/regexdevs/features/mlx5.ini
vDPA Drivers vDPA Drivers
------------ ------------
T: git://dpdk.org/next/dpdk-next-virtio T: git://dpdk.org/next/dpdk-next-virtio

View File

@ -374,6 +374,11 @@ CONFIG_RTE_LIBRTE_MLX4_DEBUG=n
CONFIG_RTE_LIBRTE_MLX5_PMD=n CONFIG_RTE_LIBRTE_MLX5_PMD=n
CONFIG_RTE_LIBRTE_MLX5_DEBUG=n CONFIG_RTE_LIBRTE_MLX5_DEBUG=n
#
# Compile regex-oriented Mellanox PMD
#
CONFIG_RTE_LIBRTE_MLX5_REGEX_PMD=n
# #
# Compile vdpa-oriented Mellanox ConnectX-6 & BlueField (MLX5) PMD # Compile vdpa-oriented Mellanox ConnectX-6 & BlueField (MLX5) PMD
# #

View File

@ -47,7 +47,7 @@
master_doc = 'index' master_doc = 'index'
# Maximum feature description string length # Maximum feature description string length
feature_str_len = 25 feature_str_len = 30
# Figures, tables and code-blocks automatically numbered if they have caption # Figures, tables and code-blocks automatically numbered if they have caption
numfig = True numfig = True
@ -409,6 +409,11 @@ def setup(app):
'Features', 'Features',
'Features availability in compression drivers', 'Features availability in compression drivers',
'Feature') 'Feature')
table_file = dirname(__file__) + '/regexdevs/overview_feature_table.txt'
generate_overview_table(table_file, 1,
'Features',
'Features availability in regex drivers',
'Feature')
table_file = dirname(__file__) + '/vdpadevs/overview_feature_table.txt' table_file = dirname(__file__) + '/vdpadevs/overview_feature_table.txt'
generate_overview_table(table_file, 1, generate_overview_table(table_file, 1,
'Features', 'Features',

View File

@ -20,6 +20,7 @@ DPDK documentation
cryptodevs/index cryptodevs/index
compressdevs/index compressdevs/index
vdpadevs/index vdpadevs/index
regexdevs/index
eventdevs/index eventdevs/index
rawdevs/index rawdevs/index
mempool/index mempool/index

View File

@ -0,0 +1,32 @@
;
; Features of a default RegEx driver.
;
; This file defines the features that are valid for inclusion in
; the other driver files and also the order that they appear in
; the features table in the documentation. The feature description
; string should not exceed feature_str_len defined in conf.py.
;
[Features]
Cross buffer =
PCRE start anchor =
PCRE atomic grouping =
PCRE back reference =
PCRE back tracking ctrl =
PCRE call outs =
PCRE forward reference =
PCRE greedy =
PCRE match all =
PCRE match as end =
PCRE match point rst =
PCRE New line conventions =
PCRE new line SEQ =
PCRE look around =
PCRE possessive qualifiers =
PCRE subroutine references =
PCRE UTF 8 =
PCRE UTF 16 =
PCRE UTF 32 =
PCRE word boundary =
Run time compilation =
Armv8 =
x86 =

View File

@ -0,0 +1,8 @@
;
; Supported features of the 'mlx5' RegEx driver.
;
; Refer to default.ini for the full list of available driver features.
;
[Features]
Armv8 = Y
x86 = Y

View File

@ -0,0 +1,100 @@
.. SPDX-License-Identifier: BSD-3-Clause
Copyright 2020 Mellanox Technologies, Ltd
Overview of RegEx Drivers Features
==================================
This section explains the supported features that are listed in the table below.
Cross buffer
Support cross buffer detection.
PCRE start anchor
Support PCRE start anchor.
PCRE atomic grouping
Support PCRE atomic grouping.
PCRE back reference
Support PCRE back regerence.
PCRE back tracking ctrl
Support PCRE back tracking ctrl.
PCRE call outs
Support PCRE call outes.
PCRE forward reference
Support Forward reference.
PCRE greedy
Support PCRE greedy mode.
PCRE match all
Support PCRE match all.
PCRE match as end
Support match as end.
PCRE match point rst
Support PCRE match point reset directive.
PCRE New line conventions
Support new line conventions.
PCRE new line SEQ
Support new line sequence.
PCRE look around
Support PCRE look around.
PCRE possessive qualifiers
Support PCRE possessive qualifiers.
PCRE subroutine references
Support PCRE subroutine references.
PCRE UTF 8
Support UTF-8.
PCRE UTF 16
Support UTF-16.
PCRE UTF 32
Support UTF-32.
PCRE word boundary
Support word boundaries.
Run time compilation
Support compilation during run time.
Armv8
Support armv8 (64bit) architecture.
x86
Support x86 architecture.
.. note::
Most of the features capabilities should be provided by the drivers via the
RegEx ``info_get`` operation.
References
==========
* `PCRE: PCRE pattern man page <https://www.pcre.org/original/doc/html/pcrepattern.html>`_
Features Table
==============
.. _table_regex_pmd_features:
.. include:: overview_feature_table.txt
.. Note::
Features marked with "P" are partially supported. Refer to the appropriate
driver guide in the following sections for details.

View File

@ -0,0 +1,15 @@
.. SPDX-License-Identifier: BSD-3-Clause
Copyright 2020 Mellanox Technologies, Ltd
REGEX Device Drivers
====================
The following are a list of RegEx (Regular Expression) device drivers,
which can be used from an application through RegEx API.
.. toctree::
:maxdepth: 2
:numbered:
features_overview
mlx5

View File

@ -0,0 +1,53 @@
.. SPDX-License-Identifier: BSD-3-Clause
Copyright 2020 Mellanox Technologies, Ltd
.. include:: <isonum.txt>
MLX5 RegEx driver
=================
The MLX5 RegEx (Regular Expression) driver library
(**librte_pmd_mlx5_regex**) provides support for **Mellanox BlueField 2**
families of 25/50/100/200 Gb/s adapters.
Design
------
This PMD is configuring the RegEx HW engine.
For the PMD to work, the application must supply
a precompiled rule file in rof2 format.
The PMD uses libibverbs and libmlx5 to access the device firmware
or directly the hardware components.
There are different levels of objects and bypassing abilities
to get the best performances:
- Verbs is a complete high-level generic API
- Direct Verbs is a device-specific API
- DevX allows to access firmware objects
Enabling librte_pmd_mlx5_regex causes DPDK applications to be linked against
libibverbs.
Mellanox mlx5 pci device can be probed by number of different pci devices,
for example net / vDPA / RegEx. To select the RegEx PMD ``class=regex`` should
be specified as device parameter. The RegEx device can be probed and used with
other Mellanox devices, by adding more options in the class.
For example: ``class=net:regex`` will probe both the net PMD and the RegEx PMD.
Supported NICs
--------------
* Mellanox\ |reg| BlueField 2 SmartNIC
Prerequisites
-------------
- BlueField 2 running Mellanox supported kernel.
- Enable the RegEx capabilities using system call from the BlueField 2.
- Official support is not yet released.
Run-time configuration
~~~~~~~~~~~~~~~~~~~~~~
- **ethtool** operations on related kernel interfaces also affect the PMD.

View File

@ -81,6 +81,8 @@ New Features
Added the RegEx library which provides an API for offload of regular Added the RegEx library which provides an API for offload of regular
expressions search operations to hardware or software accelerator devices. expressions search operations to hardware or software accelerator devices.
Added Mellanox RegEx PMD, allowing to offload RegEx searches.
* **Added eCPRI protocol support in rte_flow.** * **Added eCPRI protocol support in rte_flow.**
The ``ECPRI`` item has been added to support eCPRI packet offloading for The ``ECPRI`` item has been added to support eCPRI packet offloading for

View File

@ -18,6 +18,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += common/qat
DEPDIRS-common/qat := bus mempool DEPDIRS-common/qat := bus mempool
DIRS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += compress DIRS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += compress
DEPDIRS-compress := bus mempool DEPDIRS-compress := bus mempool
DIRS-$(CONFIG_RTE_LIBRTE_REGEXDEV) += regex
DEPDIRS-regex := common bus
DIRS-$(CONFIG_RTE_LIBRTE_VHOST) += vdpa DIRS-$(CONFIG_RTE_LIBRTE_VHOST) += vdpa
DEPDIRS-vdpa := common bus mempool DEPDIRS-vdpa := common bus mempool
DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event

View File

@ -36,7 +36,7 @@ ifneq (,$(findstring y,$(IAVF-y)))
DIRS-y += iavf DIRS-y += iavf
endif endif
ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_MLX5_PMD)$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD)),y) ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_MLX5_PMD)$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD)$(CONFIG_RTE_LIBRTE_MLX5_REGEX_PMD)),y)
DIRS-y += mlx5 DIRS-y += mlx5
endif endif

View File

@ -10,7 +10,7 @@ LIB_GLUE_BASE = librte_pmd_mlx5_glue.so
LIB_GLUE_VERSION = 20.02.0 LIB_GLUE_VERSION = 20.02.0
# Sources. # Sources.
ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_MLX5_PMD)$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD)),y) ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_MLX5_PMD)$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD)$(CONFIG_RTE_LIBRTE_MLX5_REGEX_PMD)),y)
ifneq ($(CONFIG_RTE_IBVERBS_LINK_DLOPEN),y) ifneq ($(CONFIG_RTE_IBVERBS_LINK_DLOPEN),y)
SRCS-y += linux/mlx5_glue.c SRCS-y += linux/mlx5_glue.c
endif endif
@ -344,7 +344,7 @@ mlx5_autoconf.h: mlx5_autoconf.h.new
cmp '$<' '$@' $(AUTOCONF_OUTPUT) || \ cmp '$<' '$@' $(AUTOCONF_OUTPUT) || \
mv '$<' '$@' mv '$<' '$@'
ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_MLX5_PMD)$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD)),y) ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_MLX5_PMD)$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD)$(CONFIG_RTE_LIBRTE_MLX5_REGEX_PMD)),y)
$(SRCS-y:.c=.o): mlx5_autoconf.h $(SRCS-y:.c=.o): mlx5_autoconf.h
endif endif

View File

@ -210,6 +210,7 @@ int mlx5_get_ifname_sysfs(const char *ibdev_path, char *ifname);
enum mlx5_class { enum mlx5_class {
MLX5_CLASS_NET, MLX5_CLASS_NET,
MLX5_CLASS_VDPA, MLX5_CLASS_VDPA,
MLX5_CLASS_REGEX,
MLX5_CLASS_INVALID, MLX5_CLASS_INVALID,
}; };

View File

@ -9,6 +9,7 @@ dpdk_driver_classes = ['common',
'raw', # depends on common, bus and net. 'raw', # depends on common, bus and net.
'crypto', # depends on common, bus and mempool (net in future). 'crypto', # depends on common, bus and mempool (net in future).
'compress', # depends on common, bus, mempool. 'compress', # depends on common, bus, mempool.
'regex', # depends on common, bus, regexdev.
'vdpa', # depends on common, bus and mempool. 'vdpa', # depends on common, bus and mempool.
'event', # depends on common, bus, mempool and net. 'event', # depends on common, bus, mempool and net.
'baseband'] # depends on common and bus. 'baseband'] # depends on common and bus.

8
drivers/regex/Makefile Normal file
View File

@ -0,0 +1,8 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2020 Mellanox Technologies, Ltd
include $(RTE_SDK)/mk/rte.vars.mk
DIRS-$(CONFIG_RTE_LIBRTE_MLX5_REGEX_PMD) += mlx5
include $(RTE_SDK)/mk/rte.subdir.mk

View File

@ -0,0 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2020 Mellanox Technologies, Ltd
drivers = ['mlx5']
std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
driver_name_fmt = 'rte_pmd_@0@'

View File

@ -0,0 +1,34 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2020 Mellanox Technologies, Ltd
include $(RTE_SDK)/mk/rte.vars.mk
# Library name.
LIB = librte_pmd_mlx5_regex.a
# Sources.
SRCS-$(CONFIG_RTE_LIBRTE_MLX5_REGEX_PMD) += mlx5_regex.c
# Basic CFLAGS.
CFLAGS += -O3
CFLAGS += -std=c11 -Wall -Wextra
CFLAGS += -g
CFLAGS += -I$(RTE_SDK)/drivers/common/mlx5
CFLAGS += -I$(BUILDDIR)/drivers/common/mlx5
CFLAGS += -D_BSD_SOURCE
CFLAGS += -D_DEFAULT_SOURCE
CFLAGS += -D_XOPEN_SOURCE=600
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -Wno-strict-prototypes
LDLIBS += -lrte_common_mlx5
LDLIBS += -lm
LDLIBS += -lrte_eal -lrte_mbuf -lrte_regexdev
LDLIBS += -lrte_kvargs
LDLIBS += -lrte_bus_pci
# A few warnings cannot be avoided in external headers.
CFLAGS += -Wno-error=cast-qual
EXPORT_MAP := rte_pmd_mlx5_regex_version.map
include $(RTE_SDK)/mk/rte.lib.mk

View File

@ -0,0 +1,26 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2020 Mellanox Technologies, Ltd
if not is_linux
build = false
reason = 'only supported on Linux'
subdir_done()
endif
fmt_name = 'mlx5_regex'
deps += ['common_mlx5', 'bus_pci', 'eal', 'regexdev']
sources = files(
'mlx5_regex.c',
)
cflags_options = [
'-std=c11',
'-Wno-strict-prototypes',
'-D_BSD_SOURCE',
'-D_DEFAULT_SOURCE',
'-D_XOPEN_SOURCE=600'
]
foreach option:cflags_options
if cc.has_argument(option)
cflags += option
endif
endforeach

View File

@ -0,0 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2020 Mellanox Technologies, Ltd
*/
#include "mlx5_regex.h"

View File

@ -0,0 +1,8 @@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2020 Mellanox Technologies, Ltd
*/
#ifndef MLX5_REGEX_H
#define MLX5_REGEX_H
#endif /* MLX5_REGEX_H */

View File

@ -0,0 +1,3 @@
DPDK_21 {
local: *;
};

View File

@ -201,11 +201,12 @@ endif
_LDLIBS-$(CONFIG_RTE_LIBRTE_LIO_PMD) += -lrte_pmd_lio _LDLIBS-$(CONFIG_RTE_LIBRTE_LIO_PMD) += -lrte_pmd_lio
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_MEMIF) += -lrte_pmd_memif _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_MEMIF) += -lrte_pmd_memif
_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4
ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_MLX5_PMD)$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD)),y) ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_MLX5_PMD)$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD)$(CONFIG_RTE_LIBRTE_MLX5_REGEX_PMD)),y)
_LDLIBS-y += -lrte_common_mlx5 _LDLIBS-y += -lrte_common_mlx5
endif endif
_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5 _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5
_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD) += -lrte_pmd_mlx5_vdpa _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD) += -lrte_pmd_mlx5_vdpa
_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_REGEX_PMD) += -lrte_pmd_mlx5_regex
ifeq ($(CONFIG_RTE_IBVERBS_LINK_DLOPEN),y) ifeq ($(CONFIG_RTE_IBVERBS_LINK_DLOPEN),y)
_LDLIBS-y += -ldl _LDLIBS-y += -ldl
else ifeq ($(CONFIG_RTE_IBVERBS_LINK_STATIC),y) else ifeq ($(CONFIG_RTE_IBVERBS_LINK_STATIC),y)
@ -214,7 +215,7 @@ _LDLIBS-y += --no-whole-archive
_LDLIBS-y += $(LIBS_IBVERBS_STATIC) _LDLIBS-y += $(LIBS_IBVERBS_STATIC)
_LDLIBS-y += --whole-archive _LDLIBS-y += --whole-archive
else else
ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_MLX5_PMD)$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD)),y) ifeq ($(findstring y,$(CONFIG_RTE_LIBRTE_MLX5_PMD)$(CONFIG_RTE_LIBRTE_MLX5_VDPA_PMD)$(CONFIG_RTE_LIBRTE_MLX5_REGEX_PMD)),y)
_LDLIBS-y += -libverbs -lmlx5 _LDLIBS-y += -libverbs -lmlx5
endif endif
_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs -lmlx4 _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs -lmlx4