-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
octeon: native driver for Marvell Octeon SoC
Type: feature Change-Id: I6898625c4e8854f777407dac3159e4c639a54860 Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com> Signed-off-by: Damjan Marion <damarion@cisco.com>
- Loading branch information
Showing
21 changed files
with
2,659 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (c) 2023 Marvell. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# https://spdx.org/licenses/Apache-2.0.html | ||
|
||
octeon-roc_version := 0.2 | ||
octeon-roc_tarball := octeon-roc-v$(octeon-roc_version).tar.gz | ||
octeon-roc_tarball_md5sum := a72bb3b27fd3bbaf58aadd99514620e1 | ||
|
||
octeon-roc_tarball_strip_dirs := 1 | ||
octeon-roc_url := https://github.com/MarvellEmbeddedProcessors/marvell-vpp/archive/refs/tags/$(octeon-roc_tarball) | ||
|
||
define octeon-roc_config_cmds | ||
@true | ||
endef | ||
|
||
define octeon-roc_build_cmds | ||
@cd ${octeon-roc_src_dir} && rm -f $(octeon-roc_build_log) && $(CMAKE) ${octeon-roc_src_dir} -DCMAKE_INSTALL_PREFIX='$(octeon-roc_install_dir)' >> $(octeon-roc_build_log) | ||
@$(MAKE) -C ${octeon-roc_src_dir} >> $(octeon-roc_build_log) | ||
endef | ||
|
||
define octeon-roc_install_cmds | ||
@$(MAKE) -C ${octeon-roc_src_dir} install >> $(octeon-roc_install_log) | ||
endef | ||
|
||
$(eval $(call package,octeon-roc)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
PKG=vpp-dep-octeon-roc | ||
URL=https://github.com/MarvellEmbeddedProcessors/marvell-vpp.git | ||
ARCH=$(dpkg --print-architecture) | ||
TMP_DIR=$(mktemp -d -p $PWD) | ||
|
||
set -eEuo pipefail | ||
|
||
err_handler() | ||
{ | ||
trap '' INT TERM EXIT ERR | ||
echo "Cleaning up ${TMP_DIR}" | ||
rm -rf ${TMP_DIR} | ||
exit | ||
} | ||
trap "err_handler" INT TERM EXIT ERR | ||
|
||
SRC=${TMP_DIR}/src | ||
BUILD=${TMP_DIR}/build | ||
STAGE=${TMP_DIR}/pkg | ||
INSTALL_PREFIX=/opt/vpp/external/$(uname -m) | ||
|
||
git clone ${URL} ${SRC} | ||
VER=0.0.$(git -C ${SRC} rev-list --count HEAD) | ||
|
||
cmake -S ${SRC} -B ${BUILD} | ||
cmake --build ${BUILD} --parallel | ||
cmake --install ${BUILD} --prefix ${STAGE}${INSTALL_PREFIX} | ||
|
||
mkdir -p ${STAGE}/DEBIAN | ||
|
||
cat > ${STAGE}/DEBIAN/control << __EOF__ | ||
Package: ${PKG} | ||
Version: ${VER} | ||
Architecture: ${ARCH} | ||
Maintainer: vpp-dev <vpp-dev@fd.io> | ||
Installed-Size: $(du -ks ${STAGE}|cut -f 1) | ||
Section: system | ||
Priority: extra | ||
Description: Marvell Octeon ROC library for VPP | ||
See https://github.com/MarvellEmbeddedProcessors/marvell-vpp | ||
__EOF__ | ||
|
||
DEB=${PKG}_${VER}_${ARCH}.deb | ||
dpkg-deb -b ${STAGE} ${DEB} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
set(VPP_PLATFORM_CACHE_LINE_SIZE 64) | ||
set(VPP_PLATFORM_MARCH_FLAGS -march=armv8.3-a+crypto+sve2-bitperm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright(c) 2022 Cisco Systems, Inc. | ||
|
||
if (NOT VPP_PLATFORM_NAME STREQUAL "octeon10") | ||
return() | ||
endif() | ||
|
||
# Find OCTEON roc files | ||
vpp_find_path(OCTEON_ROC_DIR PATH_SUFFIXES octeon-roc NAMES platform.h) | ||
vpp_plugin_find_library(dev-octeon OCTEON_ROC_LIB "libocteon-roc.a") | ||
|
||
if (NOT OCTEON_ROC_DIR) | ||
message("OCTEON ROC files not found - Marvell OCTEON device plugin disabled") | ||
return() | ||
endif() | ||
|
||
if (NOT OCTEON_ROC_LIB) | ||
message("OCTEON ROC library (libocteon-roc.a) not found - Marvell OCTEON device plugin disabled") | ||
return () | ||
endif() | ||
|
||
include_directories (${OCTEON_ROC_DIR}/) | ||
|
||
add_vpp_plugin(dev_octeon | ||
SOURCES | ||
init.c | ||
format.c | ||
port.c | ||
queue.c | ||
roc_helper.c | ||
rx_node.c | ||
tx_node.c | ||
|
||
MULTIARCH_SOURCES | ||
rx_node.c | ||
tx_node.c | ||
|
||
LINK_LIBRARIES | ||
${OCTEON_ROC_LIB} | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 | ||
* Copyright (c) 2023 Cisco Systems, Inc. | ||
*/ | ||
|
||
#ifndef _OCT_COMMON_H_ | ||
#define _OCT_COMMON_H_ | ||
|
||
#include <vppinfra/clib.h> | ||
#include <vppinfra/format.h> | ||
#include <vnet/vnet.h> | ||
#include <vnet/dev/dev.h> | ||
#include <base/roc_api.h> | ||
|
||
static_always_inline u32 | ||
oct_aura_free_all_buffers (vlib_main_t *vm, u64 aura_handle, u16 hdr_off) | ||
{ | ||
u32 n = 0; | ||
u64 iova; | ||
|
||
while ((iova = roc_npa_aura_op_alloc (aura_handle, 0))) | ||
{ | ||
vlib_buffer_t *b = (void *) iova + hdr_off; | ||
vlib_buffer_free_one (vm, vlib_get_buffer_index (vm, b)); | ||
n++; | ||
} | ||
return n; | ||
} | ||
|
||
#endif /* _OCT_COMMON_H_ */ |
Oops, something went wrong.