Skip to content

Commit

Permalink
dao: initial version 24.05.0
Browse files Browse the repository at this point in the history
Change-Id: Ia177353a80d577f3e5f10c8d5bfe9dc6229941fe
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
  • Loading branch information
jerinjacobk authored and PavanNikhilesh committed May 24, 2024
0 parents commit 76b07f5
Show file tree
Hide file tree
Showing 275 changed files with 79,066 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .checkpatch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--no-tree
--strict
--ignore=SPLIT_STRING
--ignore SSCANF_TO_KSTRTO
--ignore=NEW_TYPEDEFS
--ignore=DEPRECATED_VARIABLE
--ignore=COMPARISON_TO_NULL
--ignore=BIT_MACRO
--ignore=PREFER_PRINTF
--ignore=PREFER_SCANF
--ignore=VOLATILE
--ignore=AVOID_EXTERNS
--ignore=CONST_STRUCT
--ignore=PREFER_KERNEL_TYPES
--ignore=CONSTANT_COMPARISON
--ignore=BLOCK_COMMENT_STYLE
--ignore=UNNECESSARY_PARENTHESES
--ignore=SPDX_LICENSE_TAG
--ignore=PREFER_FALLTHROUGH
--ignore=LONG_LINE_STRING
--ignore=EMAIL_SUBJECT
--ignore=MACRO_ARG_REUSE
--ignore=MACRO_WITH_FLOW_CONTROL
--ignore=PREFER_ALIGNED
--ignore=GERRIT_CHANGE_ID
--ignore=OPEN_ENDED_LINE
--ignore=INDENTED_LABEL
--ignore=CAMELCASE
--ignore=COMPLEX_MACRO
--codespell
--codespellfile=./ci/checkpatch/dictionary.txt
59 changes: 59 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
BasedOnStyle: LLVM
IndentWidth: 8
TabWidth: 8
UseTab: ForContinuationAndIndentation
BreakStringLiterals : false
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
ColumnLimit: 100
AllowShortFunctionsOnASingleLine: false
AlwaysBreakAfterReturnType: AllDefinitions
ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
BreakBeforeBraces: Linux
AllowShortBlocksOnASingleLine: false
AlignConsecutiveAssignments: false
AlignEscapedNewlines: Right
AlignConsecutiveMacros : true
MaxEmptyLinesToKeep : 1
Cpp11BracedListStyle : true
AlignTrailingComments : true
BreakBeforeTernaryOperators : false
SpacesInContainerLiterals : false
ReflowComments: true
ForEachMacros:
- 'CIRBUF_FOREACH'
- 'LIST_FOREACH'
- 'LIST_FOREACH_SAFE'
- 'RTE_BBDEV_FOREACH'
- 'RTE_DEV_FOREACH'
- 'RTE_EAL_DEVARGS_FOREACH'
- 'RTE_ETH_FOREACH_DEV'
- 'RTE_ETH_FOREACH_DEV_OF'
- 'RTE_ETH_FOREACH_DEV_OWNED_BY'
- 'RTE_ETH_FOREACH_DEV_SIBLING'
- 'RTE_ETH_FOREACH_MATCHING_DEV'
- 'RTE_ETH_FOREACH_VALID_DEV'
- 'rte_graph_foreach_node'
- 'RTE_LCORE_FOREACH'
- 'RTE_LCORE_FOREACH_SLAVE'
- 'STAILQ_FOREACH'
- 'TAILQ_FOREACH'
- 'TAILQ_FOREACH_FROM'
- 'TAILQ_FOREACH_FROM_SAFE'
- 'TAILQ_FOREACH_REVERSE'
- 'TAILQ_FOREACH_REVERSE_FROM'
- 'TAILQ_FOREACH_REVERSE_FROM_SAFE'
- 'TAILQ_FOREACH_REVERSE_SAFE'
- 'TAILQ_FOREACH_SAFE'
- 'FOREACH_DEVICE_ON_PCIBUS'
- 'FOREACH_DEVARGS_ON_PCIBUS'
- 'FOREACH_DRIVER_ON_PCIBUS'
- 'FOREACH_DEVICE_REVERSE_ON_PCIBUS_SAFE'
- 'cxk_book_foreach_page'
- 'cxk_chapter_foreach_page'
- 'cxk_section_foreach_page'
---
156 changes: 156 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: build-cn10k

on:
push:
schedule:
- cron: "0 0 * * *"
pull_request:

permissions:
contents: write
pages: write
id-token: write
packages: write

jobs:
ubuntu-cn10k-build:
name: ubuntu-cn10k-arm64
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
include:
- arch: aarch64
distro: ubuntu22.04
compiler: gcc
library: static

steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Generate cache keys
id: get_ref_keys
run: |
echo 'ccache=ccache-${{ matrix.distro }}-${{ matrix.compiler }}-${{ matrix.arch }}-'$(date -u +%Y-w%W) >> $GITHUB_OUTPUT
- name: Retrieve ccache cache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }}
restore-keys: |
${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main
- name: Extract version details
id: version
run: |
mkdir -p "${PWD}/artifacts"
git tag --points-at HEAD > /tmp/tags
[ -s /tmp/tags ] && PKG_POSTFIX= || PKG_POSTFIX=-latest
[ -s /tmp/tags ] && NIGHTLY=false || NIGHTLY=true
echo "PKG_VERSION_NAME=`cat VERSION`" >> "${PWD}/artifacts/env"
echo "DPDK_PKG_VERSION=`cat DPDK_VERSION | grep RELEASE_VERSION | awk -F'=' '{print $2}'`" >> "${PWD}/artifacts/env"
echo "DPDK_BASE_PKG_VERSION=`cat DPDK_VERSION | grep BASE_VERSION | awk -F'=' '{print $2}' | awk -F'.' '{print $1"."$2}'`" >> "${PWD}/artifacts/env"
source "${PWD}/artifacts/env"
echo "PKG_POSTFIX=${PKG_POSTFIX}" >> "${PWD}/artifacts/env"
echo "NIGHTLY=${NIGHTLY}" >> $GITHUB_OUTPUT
echo "DPDK_PKG_VERSION=${DPDK_PKG_VERSION}" >> $GITHUB_OUTPUT
- uses: robinraju/release-downloader@v1.10
with:
repository: "MarvellEmbeddedProcessors/marvell-dpdk"
tag: "${{ steps.version.outputs.DPDK_PKG_VERSION }}"
fileName: "*.deb"
- uses: uraimo/run-on-arch-action@v2.7.2
name: Build DAO and generate package
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
githubToken: ${{ github.token }}
setup: |
mkdir -p ~/.ccache
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
--volume "${HOME}/.ccache:/root/.ccache"
shell: /bin/bash
install: |
apt-get update -q -y
apt-get install -y build-essential gcc meson ccache git doxygen apt-utils
apt-get install -y build-essential ccache git software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update -q -y
apt-get install -y libnl-3-dev libnl-route-3-dev libnl-xfrm-3-dev
apt-get install -y sphinx-common python3-sphinx-rtd-theme pkg-config
apt-get install -y libarchive-dev libbsd-dev libbpf-dev
apt-get install -y libfdt-dev libjansson-dev
apt-get install -y libssl-dev ninja-build python3-pip
apt-get install -y python3-pyelftools python3-setuptools python3-wheel zlib1g-dev
apt-get install -y gcc-13 bzip2-doc icu-devtools libacl1-dev libattr1-dev
apt-get install -y libbz2-dev libgmp-dev libgmpxx4ldbl libicu-dev liblz4-dev
apt-get install -y liblzma-dev libxml2-dev libzstd-dev nettle-dev
pip3 install meson --upgrade
run: |
source /artifacts/env
apt-get install -y ./"dpdk-${DPDK_BASE_PKG_VERSION}-cn10k_${DPDK_PKG_VERSION}_arm64.deb"
export CC='ccache gcc-13'
echo "cache_dir = /root/.ccache" > /root/.ccache/ccache.conf
ccache -p
pkg-config --list-all
meson build -Dplatform=cn10k --prefix="${PWD}/install" -Denable_kmods=false --prefer-static
ninja install -C build
mkdir -p "${PWD}/install/DEBIAN"
cd "${PWD}/install"
echo 'Package: dao-cn10k'$PKG_POSTFIX >> DEBIAN/control
echo 'Version: '$PKG_VERSION_NAME >> DEBIAN/control
echo 'Depends: dpdk-'$DPDK_BASE_PKG_VERSION'-cn10k (= '$DPDK_PKG_VERSION')' >> DEBIAN/control
echo "Maintainer: Jerin Jacob (jerinj@marvell.com)" >> DEBIAN/control
echo "Architecture: arm64" >> DEBIAN/control
echo "Homepage: https://www.dpdk.org/" >> DEBIAN/control
echo "Description: DPU Accelerator offload for Marvell Octeon 10" >> DEBIAN/control
cd -
mv "${PWD}/install" "${PWD}/dao-cn10k${PKG_POSTFIX}_${PKG_VERSION_NAME}_arm64"
dpkg --build "dao-cn10k${PKG_POSTFIX}_${PKG_VERSION_NAME}_arm64"
cp "dao-cn10k${PKG_POSTFIX}_${PKG_VERSION_NAME}_arm64.deb" /artifacts/.
mkdir -p gen_docs
mv build/doc/guides/html gen_docs/guides
mv build/doc/api/html gen_docs/api
- name: Export version name
id: artifacts
run: |
source "${PWD}/artifacts/env"
echo $PKG_VERSION_NAME
echo "PKG_VERSION_NAME=${PKG_VERSION_NAME}" >> "$GITHUB_OUTPUT"
echo $PKG_POSTFIX
echo "PKG_POSTFIX=${PKG_POSTFIX}" >> "$GITHUB_OUTPUT"
[[ "$PKG_POSTFIX" == "-latest" ]] && TAG=latest || TAG=${PKG_VERSION_NAME}
echo "TAG=${TAG}" >> "$GITHUB_OUTPUT"
- name: Upload debian package as artifact
uses: actions/upload-artifact@v4.3.1
if: ${{ github.event_name == 'push' }}
with:
name: dao-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.PKG_VERSION_NAME }}_arm64.deb
path: ${{ github.workspace }}/artifacts/dao-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.PKG_VERSION_NAME }}_arm64.deb
- name: Release DPDK cn10k package
uses: softprops/action-gh-release@v2.0.4
if: ${{ github.event_name == 'push' }}
with:
tag_name: ${{ steps.artifacts.outputs.TAG }}
files: |
${{ github.workspace }}/artifacts/dao-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.PKG_VERSION_NAME }}_arm64.deb
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
if: ${{ github.event_name == 'push' }}
with:
path: ${{ github.workspace }}/gen_docs
- name: Deploy Github Pages
if: ${{ github.event_name == 'push' }}
uses: actions/deploy-pages@v4.0.5
- name: Dispatch package update event
if: ${{ github.event_name == 'push' }}
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PPA_REPO_SECRET }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/marvellembeddedprocessors/packages/dispatches \
-d '{"event_type":"dispatch-event", "client_payload": {"package" : "dao", "tag": "${{ steps.artifacts.outputs.TAG }}", "dpdk_tag" : "${{ steps.version.outputs.DPDK_PKG_VERSION }}", "has_dpdk" : "true"}}'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subprojects/dpdk.wrap
5 changes: 5 additions & 0 deletions .gitreview
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[gerrit]
host=sj1git1.cavium.com
port=29418
project=IP/SW/dataplane/dpu-offload
defaultbranch=dpu-offload-devel
2 changes: 2 additions & 0 deletions DPDK_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BASE_VERSION=23.11.0
RELEASE_VERSION=24.04.0
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
DPU Accelerator Offload(DAO)
============================

| Build Status | |
| ------------ | - |
| ***marvell-dao*** | [![build](https://github.com/MarvellEmbeddedProcessors/dpu-accelerator-offload/actions/workflows/build.yml/badge.svg)](https://github.com/MarvellEmbeddedProcessors/dpu-accelerator-offload/actions/workflows/build.yml) |
| ***marvell-dpdk*** | [![dependency](https://github.com/MarvellEmbeddedProcessors/marvell-dpdk-test/actions/workflows/build-cn10k.yml/badge.svg)](https://github.com/MarvellEmbeddedProcessors/marvell-dpdk-test/actions/workflows/build-cn10k.yml) |
| ***marvell-packages*** | [![Commit and deploy package](https://github.com/MarvellEmbeddedProcessors/packages/actions/workflows/push-package.yml/badge.svg)](https://github.com/MarvellEmbeddedProcessors/packages/actions/workflows/push-package.yml) |

DPU Accelerator Offload(DAO) provides library interfaces which enable developers
to implement their own application on top of Marvell's OCTEON based data
processing units.
It also comes with applications aimed at supporting accelerated switching and
packet processing.

Programmers Guide
-----------------

https://marvellembeddedprocessors.github.io/dpu-accelerator-offload/guides/

API Reference Guide
-------------------

https://marvellembeddedprocessors.github.io/dpu-accelerator-offload/api/
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24.05.0
74 changes: 74 additions & 0 deletions app/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# SPDX-License-Identifier: Marvell-MIT
# Copyright (c) 2023 Marvell.

apps = [
'ovs-offload',
'smart-nic',
'virtio-l2fwd',
'secgw-graph'
]

enabled = []
disabled = []
skip_app = false
default_cflags = machine_args
default_cflags += ['-DALLOW_EXPERIMENTAL_API']
default_cflags += ['-g']
default_cflags += ['-DALLOW_INTERNAL_API']
default_cflags += ['-D_GNU_SOURCE']

foreach app: apps
name = app
build = true

sources = []
includes = []
deps = []
cflags = default_cflags
ldflags = []

skip_app = false
subdir(app)

# Skip app compilation if marked
if skip_app
disabled += [name]
continue
endif

dep_objs = DAO_DPDK_LIB_DEPS
# Defining the static library dependencies
foreach d:deps
var_name = 'static' + '_dao_' + d
if not is_variable(var_name)
build = false
message('Missing dependency "@0@" for example "@1@"'.format(d, name))
break
endif
dep_objs += [get_variable(var_name)]
endforeach

if not build
message('Skipping app "' + name + '"')
disabled += [name]
continue
endif

enabled += [name]
executable('dpdk-' + name, sources,
include_directories: DAO_INCLUDES + includes,
link_whole: DAO_STATIC_LIBS,
link_args: ldflags,
c_args: cflags,
dependencies: dep_objs,
install: true)
endforeach

# Update global configuration
if enabled.length() > 0
DAO_MODULES_ENABLED += [['Applications', enabled]]
endif

if disabled.length() > 0
DAO_MODULES_DISABLED += [['Applications', disabled]]
endif
9 changes: 9 additions & 0 deletions app/ovs-offload/control/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-License-Identifier: Marvell-MIT
# Copyright (c) 2023 Marvell.

sources += files(
'ood_eth_ctrl.c',
'ood_flow_ctrl.c',
'ood_msg_recv.c',
'ood_msg_send.c',
)
Loading

0 comments on commit 76b07f5

Please sign in to comment.