Skip to content

Commit

Permalink
Crypto Driver framework
Browse files Browse the repository at this point in the history
Basic framework for the driver. Provides most boilerplate code needed
for crypto PMD.

Most handlers are empty. Do not expect it to work when ran on any
live machine.
  • Loading branch information
semihalf-siuda-jacek authored and dimaep committed Jun 10, 2017
1 parent 49a4070 commit 8d7ce78
Show file tree
Hide file tree
Showing 9 changed files with 1,113 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/common_base
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,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=y
CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO_DEBUG=y

#
# Compile librte_ring
#
Expand Down
4 changes: 4 additions & 0 deletions devtools/test-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ default_path=$PATH
# Load config options:
# - AESNI_MULTI_BUFFER_LIB_PATH
# - ARMV8_CRYPTO_LIB_PATH
# - MRVL_CRYPTO_LIB_PATH
# - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2)
# - DPDK_DEP_ARCHIVE
# - DPDK_DEP_CFLAGS
Expand Down Expand Up @@ -131,6 +132,7 @@ reset_env ()
unset DPDK_DEP_ZLIB
unset AESNI_MULTI_BUFFER_LIB_PATH
unset ARMV8_CRYPTO_LIB_PATH
unset MRVL_CRYPTO_LIB_PATH
unset LIBSSO_SNOW3G_PATH
unset LIBSSO_KASUMI_PATH
unset LIBSSO_ZUC_PATH
Expand Down Expand Up @@ -180,6 +182,8 @@ config () # <directory> <target> <options>
sed -ri 's,(PCAP=)n,\1y,' $1/.config
test -z "$ARMV8_CRYPTO_LIB_PATH" || \
sed -ri 's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
test -z "$MRVL_CRYPTO_LIB_PATH" || \
sed -ri 's,(PMD_MRVL_CRYPTO=)n,\1y,' $1/.config
test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
sed -ri 's,(PMD_AESNI_MB=)n,\1y,' $1/.config
test "$DPDK_DEP_ISAL_CRYPTO" != y || \
Expand Down
1 change: 1 addition & 0 deletions drivers/crypto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += snow3g
DIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += kasumi
DIRS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += zuc
DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += null
DIRS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += mrvl

include $(RTE_SDK)/mk/rte.subdir.mk
68 changes: 68 additions & 0 deletions drivers/crypto/mrvl/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#
# Copyright (c) 2017 Semihalf.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2 Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#

include $(RTE_SDK)/mk/rte.vars.mk

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),config)
ifeq ($(MRVL_CRYPTO_LIB_PATH),)
$(error "Please define MRVL_CRYPTO_LIB_PATH environment variable")
endif
endif
endif

# library name
LIB = librte_pmd_mrvl.a

# build flags
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)

# library version
LIBABIVER := 1

# versioning export map
EXPORT_MAP := rte_mrvl_pmd_version.map

# external library dependencies
CFLAGS += -I$(MRVL_CRYPTO_LIB_PATH)
CFLAGS += -I$(MRVL_CRYPTO_LIB_PATH)/include
CFLAGS += -I$(MRVL_CRYPTO_LIB_PATH)/include/drivers
LDLIBS += -L$(MRVL_CRYPTO_LIB_PATH) -lmusdk

# library source files
SRCS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += rte_mrvl_pmd.c
SRCS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += rte_mrvl_pmd_ops.c

# library dependencies
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += lib/librte_mempool
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += lib/librte_ring
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_MRVL_CRYPTO) += lib/librte_cryptodev

include $(RTE_SDK)/mk/rte.lib.mk
Loading

0 comments on commit 8d7ce78

Please sign in to comment.