Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/external/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ifneq ($(shell uname), FreeBSD)
include packages/rdma-core.mk
include packages/xdp-tools.mk
include packages/octeon-roc.mk
include packages/octeon-dao.mk
endif # ! FreeBSD
include packages/dpdk.mk

Expand All @@ -33,7 +34,7 @@ clean:
ifeq ($(shell uname), FreeBSD)
install: $(if $(ARCH_X86_64), ipsec-mb-install) dpdk-install quicly-install
else
install: $(if $(ARCH_X86_64), ipsec-mb-install) dpdk-install rdma-core-install quicly-install xdp-tools-install $(if $(AARCH64), octeon-roc-install)
install: $(if $(ARCH_X86_64), ipsec-mb-install) dpdk-install rdma-core-install quicly-install xdp-tools-install $(if $(AARCH64), octeon-roc-install octeon-dao-install)
endif # FreeBSD

.PHONY: config
Expand Down
30 changes: 2 additions & 28 deletions build/external/packages/dpdk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ DPDK_MLX_IBV_LINK ?= static
# On most of the systems, default value for max lcores is 128
DPDK_MAX_LCORES ?=

dpdk_version ?= 24.11.1
dpdk_version ?= 25.11
dpdk_base_url ?= http://fast.dpdk.org/rel
dpdk_tarball := dpdk-$(dpdk_version).tar.xz

dpdk_tarball_sha256sum_24.11.1 := bcae7d42c449fc456dfb279feabcbe0599a29bebb2fe2905761e187339d96b8e
dpdk_tarball_sha256sum_25.11 := 52e90d2a531ef3ded0283bd91abc94980698f1f6471fa09658a0217cf6609526

dpdk_tarball_sha256sum := $(dpdk_tarball_sha256sum_$(dpdk_version))
dpdk_url := $(dpdk_base_url)/$(dpdk_tarball)
Expand Down Expand Up @@ -57,29 +57,20 @@ endif
DPDK_DRIVERS_DISABLED := baseband/\*, \
bus/dpaa, \
bus/ifpga, \
common/cnxk, \
compress/isal, \
compress/octeontx, \
compress/zlib, \
crypto/ccp, \
crypto/cnxk, \
crypto/dpaa_sec, \
crypto/openssl, \
crypto/aesni_mb, \
crypto/aesni_gcm, \
crypto/kasumi, \
crypto/snow3g, \
crypto/zuc, \
event/\*, \
mempool/dpaa, \
mempool/cnxk, \
net/af_packet, \
net/bnx2x, \
net/bonding, \
net/cnxk, \
net/ipn3ke, \
net/liquidio, \
net/pcap, \
net/pfe, \
net/sfc, \
net/softnic, \
Expand All @@ -90,27 +81,10 @@ DPDK_DRIVERS_DISABLED := baseband/\*, \
DPDK_LIBS_DISABLED := acl, \
bbdev, \
bitratestats, \
bpf, \
cfgfile, \
cnxk, \
distributor, \
efd, \
fib, \
flow_classify, \
graph, \
gro, \
gso, \
jobstats, \
kni, \
latencystats, \
lpm, \
member, \
node, \
pipeline, \
port, \
power, \
rawdev, \
rib, \
table

DPDK_MLX_CONFIG_FLAG :=
Expand Down
62 changes: 62 additions & 0 deletions build/external/packages/octeon-dao.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Marvell.

DAO_DEBUG ?= n
octeon-dao_version := dao-cn10k-26.02.0-ubuntu-24.04-26.02.0
octeon-dao_tarball := $(octeon-dao_version).tar.gz
octeon-dao_tarball_sha256sum := 0bd606591bd9d42d6b04d656da2ca4bbf4b5c66762e4acaf93664ad1a505f387

octeon-dao_tarball_strip_dirs := 1
octeon-dao_url := https://github.com/MarvellEmbeddedProcessors/dao/archive/refs/tags/$(octeon-dao_tarball)

octeon_dao_cmake_args ?=

DAO_BUILD_TYPE:=release
ifeq ($(DAO_DEBUG), y)
DAO_BUILD_TYPE:=debug
endif

DAO_MESON_ARGS = \
--default-library static \
-Dprefer_static_build=true --prefer-static \
-Denable_apps=virtio-l2fwd \
-Denable_libs=virtio,virtio_net,vfio,pem,pal,common \
--buildtype=$(DAO_BUILD_TYPE) \
-Denable_kmods=false

PREFIX = $(OCTEON_SDK_SYSROOT)

ifeq (,$(findstring $(OCTEON_VERSION),cn10k cn9k))
DAO_MESON_ARGS += -Dplatform=native
DAO_MESON_ARGS += --prefix $(octeon-dao_install_dir)
PREFIX = $(octeon-dao_install_dir)
else ifeq ($(OCTEON_VERSION), cn10k)
DAO_MESON_ARGS += --cross-file=$(octeon-dao_src_dir)/config/arm64_cn10k_linux_gcc
DAO_MESON_ARGS += --prefix $(OCTEON_SDK_SYSROOT)
else ifeq ($(OCTEON_VERSION), cn9k)
DAO_MESON_ARGS += --cross-file=$(octeon-dao_src_dir)/config/arm64_cn9k_linux_gcc
DAO_MESON_ARGS += --prefix $(OCTEON_SDK_SYSROOT)
endif

PIP_DOWNLOAD_DIR = $(CURDIR)/downloads/

define octeon-dao_config_cmds
PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig meson setup $(octeon-dao_src_dir) \
$(octeon-dao_build_dir) \
$(DAO_MESON_ARGS) -Dc_args="-Wno-error" -Dc_link_args="-Wno-error"\
| tee $(dao_config_log) && \
echo "DAO post meson configuration"
endef

define octeon-dao_build_cmds
cd ${octeon-dao_build_dir} && rm -f $(octeon-dao_build_log) && \
ninja install -C ${octeon-dao_build_dir} | tee $(octeon-dao_build_log)
endef

define octeon-dao_install_cmds
cd ${octeon-dao_build_dir} && \
meson install &&\
echo "meson installed directory ${octeon-dao_install_dir}"
endef

$(eval $(call package,octeon-dao))
8 changes: 8 additions & 0 deletions src/plugins/dev_octeon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ if (NOT OCTEON_ROC_LIB)
return ()
endif()

if (NOT OCTEON_ROC_DIR OR NOT OCTEON_ROC_LIB)
include (dev_octeon_virtio.mk)
return ()
endif()

include_directories (${OCTEON_ROC_DIR}/)
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/dpu/)

add_vpp_plugin(dev_octeon
SOURCES
Expand All @@ -39,6 +45,7 @@ add_vpp_plugin(dev_octeon
tm.c
pfc.c
dma.c
dpu/dpu.c

MULTIARCH_SOURCES
rx_node.c
Expand All @@ -48,3 +55,4 @@ add_vpp_plugin(dev_octeon
${OCTEON_ROC_LIB}
)

include (dev_octeon_virtio.mk)
56 changes: 56 additions & 0 deletions src/plugins/dev_octeon/dev_octeon_virtio.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright(c) 2024 Marvell.

# Find OCTEON roc files
vpp_plugin_find_library(dev-octeon-virtio DAO_PAL_LIB "libdao_pal.a")
vpp_plugin_find_library(dev-octeon-virtio DAO_VIRT_LIB "libdao_virtio.a")
vpp_plugin_find_library(dev-octeon-virtio DAO_VIRT_NET_LIB "libdao_virtio_net.a")
vpp_plugin_find_library(dev-octeon-virtio DAO_VFIO_LIB "libdao_vfio.a")
vpp_plugin_find_library(dev-octeon-virtio DAO_PEM_LIB "libdao_pem.a")
vpp_plugin_find_library(dev-octeon-virtio DAO_COMM_LIB "libdao_common.a")
vpp_plugin_find_library(dev-octeon-virtio DAO_DPDK_LIB "libdpdk.a")

vpp_find_path(DAO_NETDEV_INCLUDE_DIR NAMES dao_virtio_netdev.h)

if (NOT DAO_NETDEV_INCLUDE_DIR)
message("OCTEON VIRTIO DAO files not found - Marvell OCTEON virtio device plugin disabled")
return()
endif()

set(DAO_CONFG_INCLUDE_DIR "${DAO_NETDEV_INCLUDE_DIR}/..")

if (NOT DAO_PAL_LIB OR NOT DAO_VIRT_LIB OR NOT DAO_VIRT_NET_LIB OR NOT DAO_VFIO_LIB OR NOT DAO_PEM_LIB OR NOT DAO_COMM_LIB)
message("OCTEON VIRTIO DAO LIBS are not found - Marvell OCTEON virtio device plugin disabled")
return()
endif()

unset(DAO_LINK_FLAGS)

get_filename_component(DAO_DPDK_LIB_DIR ${DAO_DPDK_LIB} DIRECTORY)

link_directories(${DAO_DPDK_LIB_DIR})
string_append(DAO_LINK_FLAGS "-L${DAO_DPDK_LIB_DIR}")
string_append(DAO_LINK_FLAGS "-lnuma -lz -lelf -lpcap -ljansson -lfdt")
if(OPENSSL_FOUND)
string_append(DAO_LINK_FLAGS "-lssl")
string_append(DAO_LINK_FLAGS "-lcrypto")
endif()

string_append(DAO_LINK_FLAGS "-Wl,--whole-archive,${DAO_PAL_LIB},${DAO_VIRT_LIB},${DAO_VIRT_NET_LIB},${DAO_VFIO_LIB},${DAO_PEM_LIB},${DAO_COMM_LIB},${DAO_DPDK_LIB},--no-whole-archive")

include_directories (${DAO_NETDEV_INCLUDE_DIR}/)
include_directories (${DAO_CONFG_INCLUDE_DIR}/)

add_vpp_plugin(dev_octeon_virtio
SOURCES
virtio.c
virtio_bus.c
virtio_port.c
virtio_ctrl.c
virtio_tx_node.c
virtio_rx_node.c
virtio_format.c

LINK_FLAGS
"${DAO_LINK_FLAGS}"
)
Loading
Loading