Skip to content

Commit 3123348

Browse files
authored
Merge branch 'main' into p4cpconfig
2 parents 43f9ae3 + a9234a3 commit 3123348

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3393
-771
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
---
6+
version: 2
7+
updates:
8+
- package-ecosystem: "pip" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"

.github/workflows/pipeline.yml

Lines changed: 77 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ jobs:
3939
#---------------------------------------------------------------------
4040
build_dpdk_p4cp:
4141
runs-on: ubuntu-latest
42+
timeout-minutes: 20
4243

4344
steps:
4445
- name: Clone networking-recipe
45-
uses: actions/checkout@v3
46+
uses: actions/checkout@v4
4647
with:
4748
submodules: recursive
4849
path: recipe
@@ -57,7 +58,6 @@ jobs:
5758
repository: ${{ env.SDE_REPOSITORY }}
5859
tag: ${{ env.SDE_TAG }}
5960
fileName: ${{ env.SDE_FILENAME }}
60-
6161
- run: |
6262
sudo tar -xzf $SDE_FILENAME -C /
6363
rm $SDE_FILENAME
@@ -68,7 +68,6 @@ jobs:
6868
repository: ${{ env.DEPS_REPOSITORY }}
6969
tag: ${{ env.DEPS_TAG }}
7070
fileName: ${{ env.DEPS_FILENAME }}
71-
7271
- run: |
7372
sudo tar -xzf $DEPS_FILENAME -C /
7473
rm $DEPS_FILENAME
@@ -85,17 +84,15 @@ jobs:
8584
#---------------------------------------------------------------------
8685
krnlmon_unit_tests:
8786
runs-on: ubuntu-latest
87+
timeout-minutes: 5
8888

8989
steps:
9090
- name: Clone networking-recipe
91-
uses: actions/checkout@v3
91+
uses: actions/checkout@v4
9292
with:
93+
submodules: recursive
9394
path: recipe
9495

95-
- name: Initialize krnlmon submodule
96-
working-directory: recipe
97-
run: git submodule update --init --checkout --depth 1 krnlmon
98-
9996
- name: Install prerequisites
10097
run: |
10198
sudo apt install $PREREQS
@@ -106,7 +103,6 @@ jobs:
106103
repository: ${{ env.SDE_REPOSITORY }}
107104
tag: ${{ env.SDE_TAG }}
108105
fileName: ${{ env.SDE_FILENAME }}
109-
110106
- run: |
111107
sudo tar -xzf $SDE_FILENAME -C /
112108
rm $SDE_FILENAME
@@ -117,7 +113,6 @@ jobs:
117113
repository: ${{ env.DEPS_REPOSITORY }}
118114
tag: ${{ env.DEPS_TAG }}
119115
fileName: ${{ env.DEPS_FILENAME }}
120-
121116
- run: |
122117
sudo tar -xzf $DEPS_FILENAME -C /
123118
rm $DEPS_FILENAME
@@ -134,17 +129,86 @@ jobs:
134129
# 3-py_bandit_check
135130
#---------------------------------------------------------------------
136131
py_bandit_check:
137-
timeout-minutes: 10
132+
timeout-minutes: 5
138133
runs-on: ubuntu-latest
139134
steps:
140135
- name: Clone networking-recipe
141-
uses: actions/checkout@v3
136+
uses: actions/checkout@v4
142137
with:
143138
path: recipe
144139

145140
- name: Check p4rt-ctl
146-
uses: tj-actions/bandit@v5.1
141+
uses: tj-actions/bandit@v5.5
147142
with:
148143
targets: | # or a single string "."
149144
./recipe/clients/p4rt-ctl/p4rt-ctl.in
150145
options: "-v"
146+
147+
#---------------------------------------------------------------------
148+
# 4-build_p4runtime_protos
149+
#---------------------------------------------------------------------
150+
build_p4runtime_protos:
151+
runs-on: ubuntu-latest
152+
timeout-minutes: 5
153+
154+
steps:
155+
- name: Clone networking-recipe
156+
uses: actions/checkout@v4
157+
with:
158+
submodules: recursive
159+
path: recipe
160+
161+
- name: Install prerequisites
162+
run: |
163+
sudo apt install $PREREQS
164+
165+
- name: Install python dependencies
166+
working-directory: recipe
167+
run: |
168+
python -m pip install setuptools build wheel
169+
170+
- name: Set up Go environment
171+
uses: actions/[email protected]
172+
with:
173+
go-version: 'stable'
174+
175+
- name: Install gRPC plugins
176+
run: |
177+
go install google.golang.org/protobuf/cmd/[email protected]
178+
go install google.golang.org/grpc/cmd/[email protected]
179+
180+
- name: Install DPDK SDE
181+
uses: robinraju/[email protected]
182+
with:
183+
repository: ${{ env.SDE_REPOSITORY }}
184+
tag: ${{ env.SDE_TAG }}
185+
fileName: ${{ env.SDE_FILENAME }}
186+
- run: |
187+
sudo tar -xzf $SDE_FILENAME -C /
188+
rm $SDE_FILENAME
189+
190+
- name: Install stratum dependencies
191+
uses: robinraju/[email protected]
192+
with:
193+
repository: ${{ env.DEPS_REPOSITORY }}
194+
tag: ${{ env.DEPS_TAG }}
195+
fileName: ${{ env.DEPS_FILENAME }}
196+
- run: |
197+
sudo tar -xzf $DEPS_FILENAME -C /
198+
rm $DEPS_FILENAME
199+
200+
- name: Build protobufs in superproject
201+
working-directory: recipe
202+
run: |
203+
export DEPEND_INSTALL=$DEPS_INSTALL_DIR
204+
export SDE_INSTALL=$SDE_INSTALL_DIR
205+
./make-all.sh --target=dpdk --no-ovs --no-build
206+
cmake --build build --target protobufs
207+
208+
- name: Build protobufs in subdirectory
209+
working-directory: recipe/protobufs
210+
run: |
211+
export DEPEND_INSTALL=$DEPS_INSTALL_DIR
212+
cmake -B build
213+
cmake --build build
214+
cmake --install build --prefix install

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.vscode
22
.vslick
3-
/build
4-
/install
53
.p4cpconfig
4+
build
5+
install

CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
1414
include(CMakePrintHelpers)
1515
include(CompilerSettings)
1616
include(CTest)
17+
include(ExternalProject)
1718
include(FindPkgConfig)
1819
include(GNUInstallDirs)
1920

@@ -146,8 +147,17 @@ cmake_print_variables(CMAKE_PREFIX_PATH)
146147
# External packages #
147148
#####################
148149

150+
# Stratum dependencies for the target system.
149151
include(StratumDependencies)
150152

153+
# Protobuf compiler for the development system.
154+
find_package(HostProtoc)
155+
156+
# TLS libraries.
157+
find_package(OpenSSL REQUIRED)
158+
mark_as_advanced(OpenSSL_DIR)
159+
160+
# P4 SDE for the target system.
151161
if(DPDK_TARGET)
152162
find_package(DpdkDriver)
153163
elseif(ES2K_TARGET)
@@ -156,6 +166,7 @@ elseif(TOFINO_TARGET)
156166
find_package(TofinoDriver)
157167
endif()
158168

169+
# Open vSwitch.
159170
if(WITH_OVSP4RT)
160171
find_package(OVS)
161172
endif()
@@ -243,6 +254,12 @@ function(set_install_rpath TARGET)
243254
endif()
244255
endfunction()
245256

257+
#####################
258+
# Protobufs project #
259+
#####################
260+
261+
include(P4RuntimeProtobufs)
262+
246263
##################
247264
# Subdirectories #
248265
##################

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
<!-- markdownlint-disable MD041 -->
2+
[![P4 Control Plane CI Pipeline](https://github.com/ipdk-io/networking-recipe/actions/workflows/pipeline.yml/badge.svg)](https://github.com/ipdk-io/networking-recipe/actions/workflows/pipeline.yml)
3+
<!-- markdownlint-enable MD041 -->
14
# P4 Control Plane
25

36
This repository is the superproject for P4 Control Plane.
47
It is the successor to P4-OVS.
58

69
- also called the IPDK Networking Recipe
7-
- formally known as P4-OVS Split Architecture
10+
- formerly known as P4-OVS Split Architecture
811

912
P4 Control Plane modularizes P4-OVS and reduces coupling between its
1013
components, making the code easier to maintain and more suitable for

clients/gnmi-ctl/gnmi_ctl_utils.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/*
2-
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
2+
* Copyright (c) 2008-2016 Nicira, Inc.
33
* Copyright (c) 2022-2023 Intel Corporation.
44
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*
57
* Licensed under the Apache License, Version 2.0 (the "License");
68
* you may not use this file except in compliance with the License.
79
* You may obtain a copy of the License at:

clients/gnmi-ctl/gnmi_ctl_utils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
2-
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Nicira, Inc.
2+
* Copyright (c) 2008-2017 Nicira, Inc.
33
* Copyright (c) 2022-2023 Intel Corporation.
4+
*
45
* SPDX-License-Identifier: Apache-2.0
56
*
67
* Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)