Compare commits

..

26 Commits

Author SHA1 Message Date
bf73623ecc ipsec: fix AES CBC IV generation (CVE-2022-46397)
For AES-CBC, the IV must be unpredictable (see NIST SP800-38a Appendix
C). Chaining IVs like is done by ipsecmb and native backends for the
VNET_CRYPTO_OP_FLAG_INIT_IV is fully predictable.
Encrypt a counter as part of the message, making the (predictable)
counter-generated IV unpredictable.

Fixes: VPP-2037
Type: fix

Change-Id: If4f192d62bf97dda553e7573331c75efa11822ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-02-03 21:04:39 -05:00
73fdb095b3 dpdk: improve rx burst count per loop
Type: improvement

This patch improves the per dpdk-input loop number of packets
received from the port. The change mimics how packets rx happened
before VPP 22.02/DPDK 21.11: instead of trying to rx huge number
of packets (256) in one go, rx more times with up to 32 packets
max each time.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Change-Id: I804dce6d9121ab21b02e53dd0328dc52ac49d80f
(cherry picked from commit a9fe20f4b8)
2022-06-15 07:30:38 +00:00
3159d1c210 ipsec: fix vector after remove entry in spd
Originally after remove the policy entry in spd, macro "vec_del1"
can change localization of the last entry in vector and finally the
entry list has not been sorted.
This patch fixes this issue by change executed macro "vec_delete"
instead of "vec_del1".

Type: fix

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I396591cbbe17646e1d243aedb4cdc272ed4d5e25
(cherry picked from commit aacd3ed6d5)
2022-06-09 17:05:38 +00:00
c015843c54 docs: update spelling word list and fix typos
- update wordlist and fix typos so that 'make docs-spell' passes
- sort spelling_wordlist.txt
- update docs maintainers list

Type: docs

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I38ac7850c604c323427d2bb6877ea98bd10bcc38
2022-05-24 21:57:51 -04:00
3d8bab088e tls: do not overwrite config parameters if set
User can define first_seg_size and add-segment-size in the tls
configuration section, but current code does not take this configuration
into account and sets a default value to first_seg_size and add_seg_size
respectively.

This commit checks if configuration was set and only if not uses the
default values.

Type: fix

Signed-off-by: Ofer Heifetz <oferh@marvell.com>
Change-Id: I0077f7d54fe7773dd92522476f882c924fda22df
2022-04-25 18:21:38 +00:00
d715d0bce8 udp: fix inner packet checksum calculation in udp-encap
When computing the inner packet checksum, the code wrongly
assumes that the IP version of the inner packet is the
same of the outer one. On the contrary, it is perfectly
possible to encapsulate v6 packets into v4 and viceversa,
so we need to check the IP format of the inner header before
calling vnet_calc_checksums_inline.

Ticket: VPP-2020
Type: fix

Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: Ia4515563c164f6dd5096832c831a48cb0a29b3ad
Signed-off-by: Mauro Sardara <msardara@cisco.com>
(cherry picked from commit 9539647b89)
2022-03-30 18:37:38 +00:00
f4011d19ed tcp: update error counters in listen node
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib2e1d847607c9c7d928b174b87e5c21d53153ebe
(cherry picked from commit e8d67719fd)
2022-03-20 22:07:02 +00:00
62cf2330e1 memif: fix memif_process_desc indexing
The index i was incremented in the wrong place, and the check on the
presence of a next buffer in the chain was actually done for the
next desc_status rather than the current one.

Type: fix

Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I74a64a34fea497900b7969cd96e1aeeb570a1bba
(cherry picked from commit b0f0f8c8dd)
2022-03-15 14:00:29 +00:00
ad2ff1fa55 dpdk: fix program vlans on ixgbevf
Recent "dpdk: refactor device setup" have broken vlans programming for IXGBE_VF.

Type: fix

Signed-off-by: Dzmitry Sautsa <dzmitry.sautsa@nokia.com>
Change-Id: Idacda33a473f6b10dbe002d9926661a19d0f3f97
2022-03-15 13:51:43 +00:00
8639e5c52c memif: Fix underflow
Type: fix

Change-Id: Id183c47328510b5db7ffcc7a4dfb41f5a3151399
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 1b969c2f6a)
2022-03-11 09:53:11 +00:00
9f0c28e7f2 vapi: Missing include file in vlib.api.vapi.h
- A call to vapi_msg_control_ping_hton() is generated in
  a static inline function in vlib.api.vapi.h, which is
  defined/generated in memclnt.api.vapi.h without
  including memclnt.api.vapi.h in vlib.api.vapi.h.
  This breaks the compilation of plugins which include
  only vlib.api.vapi.h (e.g. hicn_plugin from the HICN
  project).

Type: fix
Fixes: a1400cecb

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I5574f4ed496183ea93265f493bf3624254a865a2
(cherry picked from commit 14baada214)
2022-02-25 18:14:22 +00:00
f4df11acf9 build: export missing header files required by hicn_plugin
- HICN project's hicn_plugin requires vnet header files
  fib/fib_entry_track.h and udp/udp_encap.h to be
  included in build-root/install-vpp*-*/vpp/include/vnet

Type: fix

Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Iabd3f8fe0aee8d727758fc6ef202e859d68d63a3
(cherry picked from commit 40cfc1560e)
2022-02-24 16:06:01 +00:00
7911f29c51 misc: VPP 22.02 Release Notes
type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I32291160f0d22a804929d0a040472ff952f02544
Signed-off-by: Maciek Konstantynowicz <mkonstan@cisco.com>
2022-02-23 13:02:41 +00:00
d3ba176774 fib: fix mpls db label overflow
mpls fib DB size was 2^20 instead of intended 2^21.
Therefore large mpls labels caused DB to overflow and write
to other tables or some random objects. Or crash with ASAN.
Sometimes.

Type: fix

Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru>
Change-Id: I6db65680037a266fe47e8213464a0c16de63c06c
(cherry picked from commit cf2595dfc0)
2022-02-23 10:16:51 +00:00
8cd5a1a1e0 vxlan: add l2 mode test
Type: improvement

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: I214f6fb5b63d97ca4afe3b10fd2d3e3410b5a6e4
2022-02-22 18:05:04 +00:00
83945776cb vnet: add set_max_frame_size callbacks for several interfaces
This is required after distinguishing between max_frame_size and MTU

Type: fix
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Change-Id: Ie642bee4e30ca76903bb8be5eeb6914c2c09bf35
(cherry picked from commit 66593a6a63)
2022-02-22 16:50:14 +00:00
201830e1b9 lisp: fix ip and udp checksum computation
Type: fix
Fixes: 6fdcc3d

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I820c505482801ff2ab8dac41a0016bb3a741a4ee
(cherry picked from commit d85fe1a216)
2022-02-22 16:21:52 +00:00
47617a98c8 vxlan: crash on assigning IP address to interface
Revert "vxlan: crash on configuring vxlan tunnel on l3 mode"

This reverts commit b8de7d43e4.

Reason for revert: VPP-2014

Type: fix
Fixes: b8de7d43e4

Change-Id: Ic4d10f28985ee10e0550a1bbfd465ada915e4aa6
Signed-off-by: Ed Warnicke <hagbard@gmail.com>
2022-02-18 19:52:06 +00:00
53ecd05962 dpdk: enable scatter on Rx for net/ena
Type: fix

Since commit e2a6d08bef
DPDK started advertising scattered Rx feature for elastic network adapters. Thus, dpdk
plugin doesn't have to disable it for ENA by default anymore

Signed-off-by: akolechk <akolechk@cisco.com>
Change-Id: I2d4f429be992e3c4edcc0c3adf8c55f3d5381631
2022-02-17 12:34:17 +00:00
7b35695c23 ipfix-export: pass ipv4 addr to format fn for show
When the ipfix address was changed to be an ip_address instead of
an ip4_address the output when creating an exporter via the cli
should have been modified to take the address of the v4 part of
the addr.

Type: fix
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: I141456cd9092c861a4c4aefba4035dbde23efcd6
(cherry picked from commit bf9918a7e0)
2022-02-16 11:30:34 +00:00
9d2db2eb2e wireguard: fix passing argument
Fixed coverity-issue CID 248456.
Originally passing argument of type "uint64_t *" to function:
"memcopy_s_inline".
This patch fixes the problem by changing type of passing argument and
make a portable assumption.

Type: fix

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I17e4583a05ea1263e4d8a4acc9949454e5fd92c0
(cherry picked from commit ffd9057493)
2022-01-25 11:36:28 +00:00
e3d36d18c1 dpdk-cryptodev: add support chacha20-poly1305
Originally cryptodev doesn't support chacha20-poly1305 with aad length
0.

This patch add support in cryptodev for chacha20-poly1305 with aad
length 0. This length is using in Wireguard.

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I0608920bb557d7d071e7f9f37c80cf50bad81dcc
2022-01-25 11:32:52 +01:00
0fb3a93a03 wireguard: add async mode for decryption packets
Originally wireguard doesn't support async mode for decryption packets.

This patch add async mode for decryption in wireguard.
In addition, it contains some performance improvement such as
prefetching packet header and reducing the number of current time
function calls.

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: Ieba6ae0078f3ff140c05b517891afb57232b3b7d
(cherry picked from commit 77e69ae2d1)
2022-01-25 11:25:16 +01:00
65c070f9da wireguard: add async mode for encryption packets
Originally wireguard doesn't support async mode for encryption packets.

This patch add async mode for encryption in wireguard and also adds
support chacha20-poly1305 algorithm in cryptodev for async handler.
In addition it contains new command line to activate async mode for wireguard:
  set wireguard async mode on|off

and also add new command to check active mode for wireguard:
  show wireguard mode

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I141d48b42ee8dbff0112b8542ab5205268089da6
(cherry picked from commit 492d7790ff)
2022-01-25 11:04:23 +01:00
ab2478ceed wireguard: add burst mode
Originally wireguard does packet by packet encryption and decryption.

This patch adds burst mode for encryption and decryption packets. In
addition, it contains some performance improvement such as prefetching
packet header and reducing the number of current time function calls.

Type: improvement

Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: I04c7daa9b6dc56cd15c789661a64ec642b35aa3f
(cherry picked from commit 8ca08496a4)
2022-01-24 10:01:42 +00:00
93e5bea2d3 misc: Initial changes for stable/2202 branch
Change-Id: I23e72a788d6f382601945986c8cb8cfc3bb9da8e
Type: docs
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2022-01-19 13:48:39 +01:00
1275 changed files with 55988 additions and 112123 deletions

View File

@ -1,4 +1,4 @@
# Minimal clang-format version is 11
# Minimal clang-format version is 8
BasedOnStyle: GNU
UseTab: Always
@ -28,7 +28,3 @@ StatementMacros:
- 'VNET_DEVICE_CLASS_TX_FN'
- '__clib_section'
- '__clib_aligned'
WhitespaceSensitiveMacros:
- 'WARN_ON'
- 'WARN_OFF'

View File

@ -1,21 +0,0 @@
---
name: Close Pull Request
on:
pull_request_target:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
# Optional. Post a issue comment just before closing a pull request.
comment: "Thank you so much for your interest! VPP takes patches at https://gerrit.fd.io/
```
git clone https://gerrit.fd.io/r/vpp
```
Using [git review](https://www.mediawiki.org/wiki/Gerrit/git-review) to contribute patches is recommended"

7
.gitignore vendored
View File

@ -10,7 +10,6 @@
/build-root/path_setup
/build-root/deb/debian/vpp-plugins/
/build-root/deb/.pybuild/
/build-root/*.buildinfo
/build-root/*.deb
/build-root/*.rpm
/build-root/*.tar.xz
@ -18,17 +17,17 @@
/build-root/rpmbuild/
/build-root/test-doc/
/build-root/test-cov/
/build-root/test/
/test/run/
/test/build/
/test/coverage/
/test/venv/
/test/vapi_test/
/test/doc/build/
/build-config.mk
/build/external/*.tar.gz
/build/external/*.tar.xz
/build/external/vpp-*
/build/external/dpdk_mlx_default.sh
/build/external/vpp-*.deb
/build/external/vpp-*.changes
/build/external/downloads/
/path_setup
/tools/

View File

@ -2,4 +2,4 @@
host=gerrit.fd.io
port=29418
project=vpp
defaultbranch=stable/2210
defaultbranch=stable/2202

View File

@ -41,6 +41,7 @@ F: src/vnet/bonding/
Sphinx Documents
I: docs
M: John DeNisco <jdenisco@cisco.com>
M: Ray Kinsella <raykinsella78@gmail.com>
M: Dave Wallace <dwallacelf@gmail.com>
F: docs/
@ -85,7 +86,7 @@ F: src/vlibmemory/
VNET Bidirectional Forwarding Detection (BFD)
I: bfd
M: Klement Sekera <klement.sekera@gmail.com>
M: Klement Sekera <ksekera@cisco.com>
F: src/vnet/bfd/
VNET Classifier
@ -180,7 +181,6 @@ F: src/vnet/pg/
VNET Segment Routing (IPv6 and MPLS)
I: sr
M: Pablo Camarillo <pcamaril@cisco.com>
M: Ahmed Abdelsalam <ahabdels@cisco.com>
F: src/vnet/srv6/
F: src/vnet/srmpls/
F: src/examples/srv6-sample-localsid/
@ -386,7 +386,7 @@ Plugin - NAT
I: nat
M: Ole Troan <ot@cisco.com>
M: Filip Varga <fivarga@cisco.com>
M: Klement Sekera <klement.sekera@gmail.com>
M: Klement Sekera <ksekera@cisco.com>
F: src/plugins/nat/
Plugin - PNAT Static match and rewrite engine
@ -426,7 +426,6 @@ F: src/plugins/flowprobe/
Plugin - http_static
I: http_static
M: Dave Barach <vpp@barachs.net>
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/http_static/
Plugin - builtinurl
@ -466,7 +465,7 @@ F: src/plugins/lisp/
Plugin - Link Layer Discovery Protocol (LLDP)
I: lldp
M: Klement Sekera <klement.sekera@gmail.com>
M: Klement Sekera <ksekera@cisco.com>
F: src/plugins/lldp/
Plugin - memif device driver
@ -482,7 +481,6 @@ F: src/plugins/marvell/
Plugin - performance counter
I: perfmon
M: Damjan Marion <damarion@cisco.com>
M: Ray Kinsella <mdr@ashroe.eu>
F: src/plugins/perfmon/
Plugin - PPPoE
@ -566,14 +564,9 @@ M: Dave Barach <vpp@barachs.net>
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/unittest/
Plugin - Intel DMA engines
I: dma_intel
M: Marvin Liu <yong.liu@intel.com>
F: src/plugins/dma_intel
Test Infrastructure
I: tests
M: Klement Sekera <klement.sekera@gmail.com>
M: Klement Sekera <ksekera@cisco.com>
M: Paul Vinciguerra <pvinci@vinciconsulting.com>
F: test/
@ -739,11 +732,6 @@ M: Artem Glazychev <artem.glazychev@xored.com>
M: Fan Zhang <roy.fan.zhang@intel.com>
F: src/plugins/wireguard
Packetforge
I: packetforge
M: Ting Xu <ting.xu@intel.com>
F: extras/packetforge
VPP Config Tooling
I: vpp_config
M: John DeNisco <jdenisco@cisco.com>
@ -786,16 +774,6 @@ I: hsi
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/hsi/
Plugin - HTTP
I: http
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/http
Plugin - Prom
I: prom
M: Florin Coras <fcoras@cisco.com>
F: src/plugins/prom
cJSON
I: cjson
M: Ole Troan <ot@cisco.com>
@ -817,12 +795,6 @@ I: rpm-packaging
M: Laszlo Kiraly <laszlo.kiraly@est.tech>
F: src/extras/rpm/opensuse
VPP StrongSwan Daemon
I: vpp-swan
M: Fan Zhang <roy.fan.zhang@intel.com>
M: Gabriel Oginski <gabrielx.oginski@intel.com>
F: extras/strongswan/vpp_sswan
THE REST
I: misc
M: vpp-dev Mailing List <vpp-dev@fd.io>

158
Makefile

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ MAKE ?= make
MAKE_ARGS ?= -j
BUILD_DIR ?= $(CURDIR)/_build
INSTALL_DIR ?= $(CURDIR)/_install
PKG_VERSION ?= $(shell git describe --abbrev=0 --match 'v[0-9]*' | cut -d- -f1 | cut -dv -f2 | cut -d. -f1,2)
PKG_VERSION ?= $(shell git describe --abbrev=0 | cut -d- -f1 | cut -dv -f2 | cut -d. -f1,2)
PKG_SUFFIX ?= $(shell git log --oneline v$(PKG_VERSION)-rc0.. . | wc -l)
JOBS := $(if $(shell [ -f /proc/cpuinfo ] && head /proc/cpuinfo),\
$(shell grep -c ^processor /proc/cpuinfo), 2)
@ -36,10 +36,11 @@ endif
ARCH_X86_64=$(filter x86_64,$(shell uname -m))
include packages.mk
include packages/nasm.mk
include packages/ipsec-mb.mk
include packages/quicly.mk
include packages/rdma-core.mk
include packages/dpdk.mk
include packages/rdma-core.mk
include packages/libbpf.mk
.PHONY: clean
@ -47,10 +48,10 @@ clean:
@rm -rf $(B) $(I)
.PHONY: install
install: $(if $(ARCH_X86_64), ipsec-mb-install) dpdk-install rdma-core-install quicly-install libbpf-install
install: $(if $(ARCH_X86_64), nasm-install ipsec-mb-install) dpdk-install rdma-core-install quicly-install libbpf-install
.PHONY: config
config: $(if $(ARCH_X86_64), ipsec-mb-config) dpdk-config rdma-core-config quicly-build
config: $(if $(ARCH_X86_64), nasm-config ipsec-mb-config) dpdk-config rdma-core-config quicly-build
##############################################################################
# .deb packaging

View File

@ -1,9 +1,6 @@
#!/usr/bin/make -f
DH_VERBOSE = 1
DEB_BUILD_OPTIONS = noddebs
DEB_CFLAGS_MAINT_STRIP = -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -O2
DEB_LDFLAGS_MAINT_STRIP = -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects
DEB_CFLAGS_MAINT_APPEND = -O3
PKG=vpp-ext-deps
VERSION = $(shell dpkg-parsechangelog | sed -nr '/^Version:/s/Version: //p')
@ -28,5 +25,3 @@ override_dh_install:
make $(MAKE_ARGS) install
dh_install -p$(PKG) --autodest /opt
override_dh_shlibdeps:
dh_shlibdeps -l$(INSTALL_DIR)lib/

View File

@ -1 +0,0 @@
rdma=41.0 dpdk=22.07

View File

@ -146,9 +146,5 @@ $(B)/.$1.install.ok: $(B)/.$1.build.ok
.PHONY: $1-install
$1-install: $(B)/.$1.install.ok
.PHONY: $1-show-%
$1-show-%:
@echo $$($$*)
ALL_TARGETS += $1-install
endef

View File

@ -14,16 +14,17 @@
DPDK_PKTMBUF_HEADROOM ?= 128
DPDK_USE_LIBBSD ?= n
DPDK_DEBUG ?= n
DPDK_MLX4_PMD ?= n
DPDK_MLX5_PMD ?= n
DPDK_MLX5_COMMON_PMD ?= n
DPDK_TAP_PMD ?= n
DPDK_FAILSAFE_PMD ?= n
DPDK_MACHINE ?= default
DPDK_MLX_IBV_LINK ?= static
dpdk_version ?= 22.07
dpdk_version ?= 21.11
dpdk_base_url ?= http://fast.dpdk.org/rel
dpdk_tarball := dpdk-$(dpdk_version).tar.xz
dpdk_tarball_md5sum_22.07 := fb73b58b80b1349cd05fe9cf6984afd4
dpdk_tarball_md5sum_22.03 := a07ca8839f98062f46e1cc359735cce8
dpdk_tarball_md5sum_21.11 := 58660bbbe9e95abce86e47692b196555
dpdk_tarball_md5sum_21.08 := de33433a1806280996a0ecbe66e3642f
dpdk_tarball_md5sum_21.05 := a78bba290b11d9717d1272cc6bfaf7c3
@ -31,11 +32,6 @@ dpdk_tarball_md5sum := $(dpdk_tarball_md5sum_$(dpdk_version))
dpdk_url := $(dpdk_base_url)/$(dpdk_tarball)
dpdk_tarball_strip_dirs := 1
dpdk_depends := rdma-core $(if $(ARCH_X86_64), ipsec-mb)
DPDK_MLX_DEFAULT := $(shell if grep -q "rdma=$(rdma-core_version) dpdk=$(dpdk_version)" mlx_rdma_dpdk_matrix.txt; then echo 'y'; else echo 'n'; fi)
DPDK_MLX4_PMD ?= $(DPDK_MLX_DEFAULT)
DPDK_MLX5_PMD ?= $(DPDK_MLX_DEFAULT)
DPDK_MLX5_COMMON_PMD ?= $(DPDK_MLX_DEFAULT)
# Debug or release
DPDK_BUILD_TYPE:=release
@ -46,12 +42,10 @@ 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, \
@ -61,11 +55,9 @@ DPDK_DRIVERS_DISABLED := baseband/\*, \
crypto/zuc, \
event/\*, \
mempool/dpaa, \
mempool/cnxk, \
net/af_packet, \
net/bnx2x, \
net/bonding, \
net/cnxk, \
net/ipn3ke, \
net/liquidio, \
net/pcap, \
@ -81,7 +73,6 @@ DPDK_LIBS_DISABLED := acl, \
bitratestats, \
bpf, \
cfgfile, \
cnxk, \
distributor, \
efd, \
fib, \
@ -175,7 +166,6 @@ PIP_DOWNLOAD_DIR = $(CURDIR)/downloads/
define dpdk_config_cmds
cd $(dpdk_build_dir) && \
echo "DPDK_MLX_DEFAULT=$(DPDK_MLX_DEFAULT)" > ../../../dpdk_mlx_default.sh && \
rm -rf ../dpdk-meson-venv && \
mkdir -p ../dpdk-meson-venv && \
python3 -m venv ../dpdk-meson-venv && \

View File

@ -11,17 +11,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ipsec-mb_version := 1.2
ipsec-mb_version := 1.1
ipsec-mb_tarball := v$(ipsec-mb_version).tar.gz
ipsec-mb_tarball_md5sum_0.54 := 258941f7ba90c275fcf9d19c622d2d21
ipsec-mb_tarball_md5sum_0.55 := deca674bca7ae2282890e1fa7f953609
ipsec-mb_tarball_md5sum_1.0 := 906e701937751e761671dc83a41cff65
ipsec-mb_tarball_md5sum_1.1 := 3916471d3713d27e42473cb6af9c65e5
ipsec-mb_tarball_md5sum_1.2 := f551d9c208893a436c1f5c146a615bd6
ipsec-mb_tarball_md5sum := $(ipsec-mb_tarball_md5sum_$(ipsec-mb_version))
ipsec-mb_tarball_strip_dirs := 1
ipsec-mb_url := http://github.com/01org/intel-ipsec-mb/archive/$(ipsec-mb_tarball)
ipsec-mb_depends := nasm
define ipsec-mb_config_cmds
@true
@ -34,6 +34,7 @@ define ipsec-mb_build_cmds
SAFE_LOOKUP=n \
SAFE_DATA=n \
PREFIX=$(ipsec-mb_install_dir) \
NASM=$(ipsec-mb_install_dir)/bin/nasm \
EXTRA_CFLAGS="-g -msse4.2" > $(ipsec-mb_build_log)
endef

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022 Cisco and/or its affiliates.
# Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@ -11,11 +11,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
add_vpp_plugin(prom
SOURCES
prom.c
prom_cli.c
nasm_version := 2.14.02
nasm_tarball := nasm-$(nasm_version).tar.xz
nasm_tarball_md5sum := 6390bd67b07ff1df9fe628b6929c0353
nasm_tarball_strip_dirs := 1
nasm_url := https://ftp.osuosl.org/pub/blfs/conglomeration/nasm/$(nasm_tarball)
nasm_cflags := -Wno-implicit-fallthrough -std=c11
LINK_LIBRARIES
vppapiclient
)
$(eval $(call package,nasm))

View File

@ -13,10 +13,10 @@
RDMA_CORE_DEBUG?=n
rdma-core_version := 41.0
rdma-core_version := 38.0
rdma-core_tarball := rdma-core-$(rdma-core_version).tar.gz
rdma-core_tarball_md5sum_39.1 := 63ba4632fd01173a2331e5b990373330
rdma-core_tarball_md5sum_41.0 := 2250389cb61a7130133e6411fdeef2f9
rdma-core_tarball_md5sum_35.0 := 85afb89ec536ef229c0fef6cb87e8665
rdma-core_tarball_md5sum_38.0 := 44e14dd392ac139a0d452148eb0a0514
rdma-core_tarball_md5sum := $(rdma-core_tarball_md5sum_$(rdma-core_version))
rdma-core_tarball_strip_dirs := 1
rdma-core_url := http://github.com/linux-rdma/rdma-core/releases/download/v$(rdma-core_version)/$(rdma-core_tarball)
@ -32,16 +32,27 @@ define rdma-core_config_cmds
-DENABLE_STATIC=1 -DENABLE_RESOLVE_NEIGH=0 -DNO_PYVERBS=1 -DENABLE_VALGRIND=0\
-DCMAKE_BUILD_TYPE=$(RDMA_BUILD_TYPE) -DCMAKE_INSTALL_PREFIX=$(rdma-core_install_dir) \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_RUNDIR:PATH=/run \
-DCMAKE_C_FLAGS='-fPIC' -DNO_MAN_PAGES=ON | tee $(rdma-core_config_log)
-DCMAKE_C_FLAGS='-fPIC -fvisibility=hidden' > $(rdma-core_config_log)
endef
define rdma-core_build_cmds
$(CMAKE) --build $(rdma-core_build_dir) | tee $(rdma-core_build_log)
$(CMAKE) --build $(rdma-core_build_dir) -- libccan.a libibverbs.a librdma_util.a libmlx5.a libmlx4.a > $(rdma-core_build_log)
sed 's/^Libs.private:.*/Libs.private: -lmlx4 -lmlx5 -libverbs -lrdma_util -lccan -lpthread/' -i $(rdma-core_build_dir)/lib/pkgconfig/libibverbs.pc >> $(rdma-core_build_log)
endef
define rdma-core_install_cmds
$(CMAKE) --install $(rdma-core_build_dir) | tee $(rdma-core_install_log)
mkdir -p $(rdma-core_install_dir)/lib/pkgconfig
cp -avL $(rdma-core_build_dir)/include $(rdma-core_install_dir) > $(rdma-core_install_log)
cp -avL $(rdma-core_build_dir)/lib/pkgconfig/libibverbs.pc \
$(rdma-core_build_dir)/lib/pkgconfig/libmlx5.pc \
$(rdma-core_build_dir)/lib/pkgconfig/libmlx4.pc \
$(rdma-core_install_dir)/lib/pkgconfig >> $(rdma-core_install_log)
cp -avL $(rdma-core_build_dir)/lib/statics/libibverbs.a \
$(rdma-core_build_dir)/lib/statics/libmlx5.a \
$(rdma-core_build_dir)/lib/statics/libmlx4.a \
$(rdma-core_build_dir)/util/librdma_util.a \
$(rdma-core_build_dir)/ccan/libccan.a \
$(rdma-core_install_dir)/lib >> $(rdma-core_install_log)
endef
$(eval $(call package,rdma-core))

View File

@ -1,137 +0,0 @@
From f4192afd7712a8d6be1e80af7478a12caaaa8917 Mon Sep 17 00:00:00 2001
From: Matthew Smith <mgsmith@netgate.com>
Date: Fri, 25 Feb 2022 16:15:40 -0600
Subject: [PATCH] net/igc: Add device ID for i226v
Add the device ID 0x125C in order to enable the i226v.
Add phy ID for the i226 and allow that ID anywhere the phy ID for the
i225 was allowed.
---
drivers/net/igc/base/igc_api.c | 1 +
drivers/net/igc/base/igc_defines.h | 1 +
drivers/net/igc/base/igc_hw.h | 1 +
drivers/net/igc/base/igc_i225.c | 1 +
drivers/net/igc/base/igc_phy.c | 11 ++++++-----
drivers/net/igc/igc_ethdev.c | 1 +
6 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/igc/base/igc_api.c b/drivers/net/igc/base/igc_api.c
index 2f8c0753cb..da51ef2d59 100644
--- a/drivers/net/igc/base/igc_api.c
+++ b/drivers/net/igc/base/igc_api.c
@@ -888,6 +888,7 @@ s32 igc_set_mac_type(struct igc_hw *hw)
case IGC_DEV_ID_I225_I:
case IGC_DEV_ID_I220_V:
case IGC_DEV_ID_I225_BLANK_NVM:
+ case IGC_DEV_ID_I226_V:
mac->type = igc_i225;
break;
case IGC_DEV_ID_I350_VF:
diff --git a/drivers/net/igc/base/igc_defines.h b/drivers/net/igc/base/igc_defines.h
index 30a41300f5..767587a171 100644
--- a/drivers/net/igc/base/igc_defines.h
+++ b/drivers/net/igc/base/igc_defines.h
@@ -1351,6 +1351,7 @@
#define IGP04IGC_E_PHY_ID 0x02A80391
#define M88_VENDOR 0x0141
#define I225_I_PHY_ID 0x67C9DC00
+#define I226_I_PHY_ID 0x67C9DC10
/* M88E1000 Specific Registers */
#define M88IGC_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Reg */
diff --git a/drivers/net/igc/base/igc_hw.h b/drivers/net/igc/base/igc_hw.h
index be38fafa5f..686fb721af 100644
--- a/drivers/net/igc/base/igc_hw.h
+++ b/drivers/net/igc/base/igc_hw.h
@@ -164,6 +164,7 @@ struct igc_hw;
#define IGC_DEV_ID_I225_V 0x15F3
#define IGC_DEV_ID_I225_K 0x3100
#define IGC_DEV_ID_I225_I 0x15F8
+#define IGC_DEV_ID_I226_V 0x125C
#define IGC_DEV_ID_I220_V 0x15F7
#define IGC_DEV_ID_I225_BLANK_NVM 0x15FD
#define IGC_DEV_ID_I354_BACKPLANE_1GBPS 0x1F40
diff --git a/drivers/net/igc/base/igc_i225.c b/drivers/net/igc/base/igc_i225.c
index 060b2f8f93..8c078029f7 100644
--- a/drivers/net/igc/base/igc_i225.c
+++ b/drivers/net/igc/base/igc_i225.c
@@ -176,6 +176,7 @@ static s32 igc_init_phy_params_i225(struct igc_hw *hw)
/* Verify phy id and set remaining function pointers */
switch (phy->id) {
case I225_I_PHY_ID:
+ case I226_I_PHY_ID:
phy->type = igc_phy_i225;
phy->ops.set_d0_lplu_state = igc_set_d0_lplu_state_i225;
phy->ops.set_d3_lplu_state = igc_set_d3_lplu_state_i225;
diff --git a/drivers/net/igc/base/igc_phy.c b/drivers/net/igc/base/igc_phy.c
index 43bbe69bca..d46a6b3555 100644
--- a/drivers/net/igc/base/igc_phy.c
+++ b/drivers/net/igc/base/igc_phy.c
@@ -1474,8 +1474,7 @@ s32 igc_phy_setup_autoneg(struct igc_hw *hw)
return ret_val;
}
- if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
- hw->phy.id == I225_I_PHY_ID) {
+ if (phy->autoneg_mask & ADVERTISE_2500_FULL) {
/* Read the MULTI GBT AN Control Register - reg 7.32 */
ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK <<
MMD_DEVADDR_SHIFT) |
@@ -1615,8 +1614,7 @@ s32 igc_phy_setup_autoneg(struct igc_hw *hw)
ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL,
mii_1000t_ctrl_reg);
- if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
- hw->phy.id == I225_I_PHY_ID)
+ if (phy->autoneg_mask & ADVERTISE_2500_FULL)
ret_val = phy->ops.write_reg(hw,
(STANDARD_AN_REG_MASK <<
MMD_DEVADDR_SHIFT) |
@@ -1882,6 +1880,7 @@ s32 igc_phy_force_speed_duplex_m88(struct igc_hw *hw)
/* fall-through */
case I225_I_PHY_ID:
/* fall-through */
+ case I226_I_PHY_ID:
reset_dsp = false;
break;
default:
@@ -1923,7 +1922,7 @@ s32 igc_phy_force_speed_duplex_m88(struct igc_hw *hw)
return IGC_SUCCESS;
if (hw->phy.id == I210_I_PHY_ID)
return IGC_SUCCESS;
- if (hw->phy.id == I225_I_PHY_ID)
+ if (hw->phy.type == igc_phy_i225)
return IGC_SUCCESS;
if (hw->phy.id == M88E1543_E_PHY_ID || hw->phy.id == M88E1512_E_PHY_ID)
return IGC_SUCCESS;
@@ -2480,6 +2479,7 @@ s32 igc_get_cable_length_m88_gen2(struct igc_hw *hw)
phy->cable_length = phy_data / (is_cm ? 100 : 1);
break;
case I225_I_PHY_ID:
+ case I226_I_PHY_ID:
if (ret_val)
return ret_val;
/* TODO - complete with Foxville data */
@@ -3064,6 +3064,7 @@ enum igc_phy_type igc_get_phy_type_from_id(u32 phy_id)
phy_type = igc_phy_i210;
break;
case I225_I_PHY_ID:
+ case I226_I_PHY_ID:
phy_type = igc_phy_i225;
break;
default:
diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c
index a1f1a9772b..0dd3a212d7 100644
--- a/drivers/net/igc/igc_ethdev.c
+++ b/drivers/net/igc/igc_ethdev.c
@@ -97,6 +97,7 @@ static const struct rte_pci_id pci_id_igc_map[] = {
{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_V) },
{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_I) },
{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_K) },
+ { RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I226_V) },
{ .vendor_id = 0, /* sentinel */ },
};
--
2.30.1 (Apple Git-130)

View File

@ -1,76 +0,0 @@
From 16449a64d38c7f4b880601ddf3d34087da5e8577 Mon Sep 17 00:00:00 2001
From: Xiaoming Jiang <jiangxiaoming@outlook.com>
Date: Thu, 9 Jun 2022 06:15:51 +0000
Subject: [PATCH 1/1] bus/vmbus: add support allow/block scan mode
---
drivers/bus/vmbus/vmbus_common.c | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
index 3677273..47edacb 100644
--- a/drivers/bus/vmbus/vmbus_common.c
+++ b/drivers/bus/vmbus/vmbus_common.c
@@ -102,7 +102,12 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
VMBUS_LOG(INFO, "VMBUS device %s on NUMA socket %i",
guid, dev->device.numa_node);
- /* TODO add block/allow logic */
+ /* no initialization when marked as blocked, return without error */
+ if (dev->device.devargs != NULL &&
+ dev->device.devargs->policy == RTE_DEV_BLOCKED) {
+ RTE_LOG(INFO, EAL, " Device is blocked, not initializing\n");
+ return 1;
+ }
/* map resources for device */
ret = rte_vmbus_map_device(dev);
@@ -134,7 +139,7 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
/*
* If device class GUID matches, call the probe function of
- * register drivers for the vmbus device.
+ * registere drivers for the vmbus device.
* Return -1 if initialization failed,
* and 1 if no driver found for this device.
*/
@@ -163,6 +168,25 @@ vmbus_probe_all_drivers(struct rte_vmbus_device *dev)
return 1;
}
+static bool
+rte_vmbus_ignore_device(struct rte_vmbus_device *dev)
+{
+ struct rte_devargs *devargs = vmbus_devargs_lookup(dev);
+
+ switch (rte_vmbus_bus.bus.conf.scan_mode) {
+ case RTE_BUS_SCAN_ALLOWLIST:
+ if (devargs && devargs->policy == RTE_DEV_ALLOWED)
+ return false;
+ break;
+ case RTE_BUS_SCAN_UNDEFINED:
+ case RTE_BUS_SCAN_BLOCKLIST:
+ if (devargs == NULL || devargs->policy != RTE_DEV_BLOCKED)
+ return false;
+ break;
+ }
+ return true;
+}
+
/*
* Scan the vmbus, and call the devinit() function for
* all registered drivers that have a matching entry in its id_table
@@ -180,7 +204,9 @@ rte_vmbus_probe(void)
rte_uuid_unparse(dev->device_id, ubuf, sizeof(ubuf));
- /* TODO: add allowlist/blocklist */
+ if (rte_vmbus_ignore_device(dev)) {
+ continue;
+ }
if (vmbus_probe_all_drivers(dev) < 0) {
VMBUS_LOG(NOTICE,
--
2.32.0

View File

@ -1,57 +0,0 @@
From 013a095d6b348afddceaa5ea710ef6309566dc85 Mon Sep 17 00:00:00 2001
From: Kai Ji <kai.ji@intel.com>
Date: Fri, 25 Mar 2022 19:22:07 +0800
Subject: [PATCH] crypto/qat: fix of cipher offset and length assignment
This patch fix the cipher offset and length values when convert
mbuf to vector chain for QAT build op.
Fixes: a815a04cea05 ("crypto/qat: support symmetric build op request")
Signed-off-by: Kai Ji <kai.ji@intel.com>
---
drivers/crypto/qat/dev/qat_crypto_pmd_gens.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
index 50a9c5ad5b..dc473e0624 100644
--- a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
+++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
@@ -395,12 +395,12 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op,
ret = qat_cipher_is_len_in_bits(ctx, op);
switch (ret) {
case 1:
- cipher_len = op->sym->aead.data.length >> 3;
- cipher_ofs = op->sym->aead.data.offset >> 3;
+ cipher_len = op->sym->cipher.data.length >> 3;
+ cipher_ofs = op->sym->cipher.data.offset >> 3;
break;
case 0:
- cipher_len = op->sym->aead.data.length;
- cipher_ofs = op->sym->aead.data.offset;
+ cipher_len = op->sym->cipher.data.length;
+ cipher_ofs = op->sym->cipher.data.offset;
break;
default:
QAT_DP_LOG(ERR,
@@ -426,7 +426,6 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op,
return -EINVAL;
}
- min_ofs = cipher_ofs < auth_ofs ? cipher_ofs : auth_ofs;
max_len = RTE_MAX(cipher_ofs + cipher_len, auth_ofs + auth_len);
/* digest in buffer check. Needed only for wireless algos */
@@ -463,7 +462,8 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op,
ctx->digest_length);
}
- n_src = rte_crypto_mbuf_to_vec(op->sym->m_src, min_ofs, max_len,
+ /* Passing 0 as cipher & auth offsets are assigned into ofs later */
+ n_src = rte_crypto_mbuf_to_vec(op->sym->m_src, 0, max_len,
in_sgl->vec, QAT_SYM_SGL_MAX_NUMBER);
if (unlikely(n_src < 0 || n_src > op->sym->m_src->nb_segs)) {
op->status = RTE_CRYPTO_OP_STATUS_ERROR;
--
2.25.1

File diff suppressed because it is too large Load Diff

View File

@ -1,96 +0,0 @@
From 794d99b8abeeb401a374489a9e3c629d023c271f Mon Sep 17 00:00:00 2001
From: Ting Xu <ting.xu@intel.com>
Date: Fri, 4 Mar 2022 07:26:28 +0000
Subject: [PATCH v2] net/ice: fix raw flow input pattern value change in FDIR
When parsing raw flow pattern in FDIR, the input parameter spec and
mask are used directly and the original value will be changed. It
will cause error if these values are used in other functions. In this
patch, temporary variables are created to store the spec and mask.
Fixes: 25be39cc1760 ("net/ice: enable protocol agnostic flow offloading in FDIR")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
---
drivers/net/ice/ice_fdir_filter.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 7954c6d8ea..5ff1afac90 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1868,10 +1868,11 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
break;
/* convert raw spec & mask from byte string to int */
- unsigned char *tmp_spec =
+ unsigned char *spec_pattern =
(uint8_t *)(uintptr_t)raw_spec->pattern;
- unsigned char *tmp_mask =
+ unsigned char *mask_pattern =
(uint8_t *)(uintptr_t)raw_mask->pattern;
+ uint8_t *tmp_spec, *tmp_mask;
uint16_t udp_port = 0;
uint16_t tmp_val = 0;
uint8_t pkt_len = 0;
@@ -1883,8 +1884,18 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
pkt_len)
return -rte_errno;
+ tmp_spec = rte_zmalloc(NULL, pkt_len / 2, 0);
+ if (!tmp_spec)
+ return -rte_errno;
+
+ tmp_mask = rte_zmalloc(NULL, pkt_len / 2, 0);
+ if (!tmp_mask) {
+ rte_free(tmp_spec);
+ return -rte_errno;
+ }
+
for (i = 0, j = 0; i < pkt_len; i += 2, j++) {
- tmp = tmp_spec[i];
+ tmp = spec_pattern[i];
if (tmp >= 'a' && tmp <= 'f')
tmp_val = tmp - 'a' + 10;
if (tmp >= 'A' && tmp <= 'F')
@@ -1893,7 +1904,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
tmp_val = tmp - '0';
tmp_val *= 16;
- tmp = tmp_spec[i + 1];
+ tmp = spec_pattern[i + 1];
if (tmp >= 'a' && tmp <= 'f')
tmp_spec[j] = tmp_val + tmp - 'a' + 10;
if (tmp >= 'A' && tmp <= 'F')
@@ -1901,7 +1912,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
if (tmp >= '0' && tmp <= '9')
tmp_spec[j] = tmp_val + tmp - '0';
- tmp = tmp_mask[i];
+ tmp = mask_pattern[i];
if (tmp >= 'a' && tmp <= 'f')
tmp_val = tmp - 'a' + 10;
if (tmp >= 'A' && tmp <= 'F')
@@ -1910,7 +1921,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
tmp_val = tmp - '0';
tmp_val *= 16;
- tmp = tmp_mask[i + 1];
+ tmp = mask_pattern[i + 1];
if (tmp >= 'a' && tmp <= 'f')
tmp_mask[j] = tmp_val + tmp - 'a' + 10;
if (tmp >= 'A' && tmp <= 'F')
@@ -1953,6 +1964,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
filter->parser_ena = true;
+ rte_free(tmp_spec);
+ rte_free(tmp_mask);
break;
}
--
2.17.1

View File

@ -0,0 +1,13 @@
diff --git a/Makefile b/Makefile
index 329da9f..c7fa8ad 100644
--- a/Makefile
+++ b/Makefile
@@ -51,7 +51,7 @@ YASM ?= yasm
NASM ?= nasm
# Detect NASM version (minimum version required: 2.14)
-NASM_VERSION = $(shell nasm -v | cut -d " " -f 3)
+NASM_VERSION = $(shell $(NASM) -v | cut -d " " -f 3)
NASM_MAJOR_REQ = 2
NASM_MINOR_REQ = 14

View File

@ -0,0 +1,13 @@
diff --git a/lib/Makefile b/lib/Makefile
index 3831172..9ce6f4c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -51,7 +51,7 @@ YASM ?= yasm
NASM ?= nasm
# Detect NASM version (minimum version required: 2.14)
-NASM_VERSION = $(shell nasm -v | cut -d " " -f 3)
+NASM_VERSION = $(shell $(NASM) -v | cut -d " " -f 3)
NASM_MAJOR_REQ = 2
NASM_MINOR_REQ = 14

View File

@ -1,13 +0,0 @@
diff --git a/lib/Makefile b/lib/Makefile
index 22890878..6ce90697 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -694,7 +694,7 @@ else
cp -f $(LIB).def $(LIB)_lnk.def
endif
-$(LIB_DIR)/$(LIBNAME): $(target_obj_files) $(LIB)_lnk.def
+$(LIB_DIR)/$(LIBNAME): $(target_obj_files)
ifeq ($(SHARED),y)
ifneq ($(MINGW),0)
$(CC) -shared $(LDFLAGS) -o $(LIBNAME) $^

57
configure vendored
View File

@ -8,12 +8,8 @@ set -o pipefail -o errtrace -o nounset -o errexit
build_dir=.
install_dir=/usr/local
build_type=release
prefix_path=/opt/vpp/external/$(uname -m)/
src_dir="$(dirname "$(readlink -f "$0")")"
host_arch=$(uname -m)
arch=${host_arch}
native_only=no
wipe=no
args=()
help()
{
@ -24,11 +20,9 @@ USAGE: ${0} [options]
OPTIONS:
--help, -h This help
--arch, -a Cross-compile for specified target architecture (aarch64, riscv64, i386, ...)
--build-dir, -b Build directory
--install-dir, -i Install directory
--build-type, -t Build type (release, debug, ...)
--native-only, -n Only compile for Native CPU (no multiarch)
--wipe, -w Wipe whole repo (except startup.* files)
__EOF__
}
@ -48,15 +42,6 @@ while (( "$#" )); do
exit 1
fi
;;
-a|--arch)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
arch=$2
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
-i|--install-dir)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
install_dir=$2
@ -75,13 +60,9 @@ while (( "$#" )); do
exit 1
fi
;;
-n|--native-only)
native_only=yes
shift 1
;;
-w|--wipe)
wipe=yes
shift 1
git clean -fdx --exclude=startup.\*
exit 1
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
@ -94,30 +75,16 @@ while (( "$#" )); do
esac
done
if [ "${arch}" != "${host_arch}" ] ; then
args+=("-DCMAKE_SYSTEM_NAME=Linux")
args+=("-DCMAKE_SYSTEM_PROCESSOR=${arch}")
args+=("-DCMAKE_C_COMPILER=clang")
args+=("-DCMAKE_C_COMPILER_TARGET=${arch}-linux-gnu")
args+=("-DCMAKE_ASM_COMPILER_TARGET=${arch}-linux-gnu")
args+=("-DCMAKE_FIND_ROOT_PATH=/usr/${arch}-linux-gnu")
args+=("-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER")
args+=("-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH")
args+=("-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH")
args+=("-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY")
fi
cmake \
-G Ninja \
-S ${src_dir}/src \
-B ${build_dir} \
-DCMAKE_PREFIX_PATH=${prefix_path} \
-DCMAKE_INSTALL_PREFIX=${install_dir} \
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \
-DCMAKE_BUILD_TYPE:STRING=${build_type}
args+=("-DCMAKE_PREFIX_PATH=/opt/vpp/external/${arch}")
args+=("-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON")
args+=("-DCMAKE_INSTALL_PREFIX=${install_dir}")
args+=("-DCMAKE_BUILD_TYPE:STRING=${build_type}")
[ "${native_only}" == "yes" ] && args+=("-DVPP_BUILD_NATIVE_ONLY:BOOL=ON")
[ "${wipe}" == "yes" ] && git clean -fdx --exclude=startup.\*
cmake ${args[@]} -G Ninja -S ${src_dir}/src -B ${build_dir}
cat << __EOF__
cat << __EOF__
Useful build commands:

View File

@ -21,6 +21,7 @@ WS_ROOT ?= $(CURDIR)/..
BR ?= $(WS_ROOT)/build-root
DOCS_DIR ?= $(WS_ROOT)/docs
VENV_DIR ?= $(DOCS_DIR)/venv
SPHINX_SCRIPTS_DIR ?= $(WS_ROOT)/docs/scripts
# Work out the OS if we haven't already
@ -39,11 +40,11 @@ endif
SPHINXOPTS = --keep-going -n -W
SPHINXBUILD = sphinx-build
SPHINXPROJ = fdio-vpp
SOURCEDIR = .
BUILDDIR = ${BR}/docs
BUILDDIR_SRC = ${BUILDDIR}/src
BUILDDIR_OUT = ${BUILDDIR}/html
SCRIPTS_DIR = _scripts
VENV_DIR ?= $(BUILDDIR)/venv
# Put it first so that "make" without argument is like "make help".
@ -54,6 +55,30 @@ help:
$(SPHINXBUILD) --help ;\
)
.PHONY: checkdeps
checkdeps:
@echo "Checking whether dependencies for Docs are installed..."
ifeq ($(OS_ID),ubuntu)
@set -e; inst=; \
for i in $(DOC_DEB_DEPENDS); do \
dpkg-query --show $$i >/dev/null 2>&1 || inst="$$inst $$i"; \
done; \
if [ "$$inst" ]; then \
sudo apt-get update; \
sudo apt-get $(CONFIRM) $(FORCE) install $$inst; \
fi
else ifneq ("$(wildcard /etc/redhat-release)","")
@sudo yum install $(CONFIRM) $(DOC_RPM_DEPENDS)
endif
.PHONY: spell
spell: clean checkdeps venv ${BUILDDIR_SRC}
@( \
. ${VENV_DIR}/bin/activate; \
make -C ${SCRIPTS_DIR} generate && \
$(SPHINXBUILD) -b spelling $(SPHINXOPTS) $(BUILDDIR_SRC) $(BUILDDIR_OUT); \
)
.PHONY: venv
venv:
@( \
@ -66,30 +91,22 @@ venv:
fi; \
)
.PHONY: spell
spell: venv
@( \
. ${VENV_DIR}/bin/activate; \
make -C ${SCRIPTS_DIR} generate && \
$(SPHINXBUILD) -b spelling $(SPHINXOPTS) $(BUILDDIR_SRC) $(BUILDDIR_OUT); \
)
.PHONY: rebuild-spell
rebuild-spell: clean spell
${BUILDDIR_SRC}:
@mkdir -p ${BUILDDIR_SRC}
@cp -r $(SOURCEDIR) ${BUILDDIR_SRC}
@cd ${BUILDDIR_SRC} && find . -type l -exec cp --remove-destination -L ${DOCS_DIR}/{} {} \;
.PHONY: docs
docs: venv
docs: clean venv ${BUILDDIR_SRC}
@( \
. ${VENV_DIR}/bin/activate; \
make -C ${SCRIPTS_DIR} generate && \
$(SPHINXBUILD) $(SPHINXOPTS) -b html $(BUILDDIR_SRC) $(BUILDDIR_OUT); \
)
.PHONY: rebuild
rebuild: clean docs
.PHONY: clean
clean:
@rm -rf $(BUILDDIR) ${VENV_DIR}
@make -C ${SCRIPTS_DIR} clean
.PHONY: build

View File

@ -23,9 +23,6 @@ all: siphon
# These should be passed in by the root Makefile
WS_ROOT ?= $(CURDIR)/../..
BR ?= $(WS_ROOT)/build-root
BUILDDIR ?= ${BR}/docs
BUILDDIR_SRC ?= ${BUILDDIR}/src
DOCS_DIR ?= ${WS_ROOT}/docs
# Tag used in github repository path.
# Change this when genearting for a release
@ -37,11 +34,12 @@ REPOSITORY_URL ?= https://github.com/FDio/vpp/blob/$(VPP_TAG)/
SCRIPTS_DIR ?= $(WS_ROOT)/docs/_scripts
# docs root directory
DOCS_DIR ?= ${BR}/docs/src
FEATURE_LIST_FILE = ${BUILDDIR_SRC}/aboutvpp/featurelist.md
FEATURE_LIST_FILE = ${DOCS_DIR}/aboutvpp/featurelist.md
# Siphoned fragements are processed into here
DOCS_GENERATED_DIR ?= $(BUILDDIR_SRC)/_generated
DOCS_GENERATED_DIR ?= $(DOCS_DIR)/_generated
# Siphoned fragments end up in here
SIPHON_INPUT_DIR ?= $(DOCS_GENERATED_DIR)/fragments
@ -120,7 +118,8 @@ SIPHON_DOCS = $(addprefix $(DOCS_GENERATED_DIR)/,$(addsuffix .rst,$(SIPHONS)))
BUILT_ON = $(shell date '+%d %B %Y')
VPP_VERSION = $(shell ${WS_ROOT}/src/scripts/version)
$(DOCS_GENERATED_DIR)/.featurelist.done:
.PHONY: featurelist
featurelist:
@( \
cd $(WS_ROOT) && \
find . -name FEATURE.yaml | \
@ -129,19 +128,19 @@ $(DOCS_GENERATED_DIR)/.featurelist.done:
--repolink $(REPOSITORY_URL) > \
$(FEATURE_LIST_FILE) ; \
)
@touch $(DOCS_GENERATED_DIR)/.featurelist.done
$(DOCS_GENERATED_DIR)/.includes-render.done:
.PHONY: includes-render
includes-render:
@mkdir -p "$(DYNAMIC_RENDER_DIR)"
@python3 $(SCRIPTS_DIR)/includes_renderer.py ${WS_ROOT} ${DYNAMIC_RENDER_DIR}
@touch $(DOCS_GENERATED_DIR)/.includes-render.done
$(DOCS_GENERATED_DIR)/.template-index.done:
@sed -ie "s/__VPP_VERSION__/${VPP_VERSION}/g" ${BUILDDIR_SRC}/index.rst
@sed -ie "s/__BUILT_ON__/${BUILT_ON}/g" ${BUILDDIR_SRC}/index.rst
.PHONY: template-index
template-index:
@sed -ie "s/__VPP_VERSION__/${VPP_VERSION}/g" ${DOCS_DIR}/index.rst
@sed -ie "s/__BUILT_ON__/${BUILT_ON}/g" ${DOCS_DIR}/index.rst
@( \
for f in $$(grep -l -R __REPOSITORY_URL__ ${BUILDDIR_SRC} | grep -e '\.rst$$' -e '\.md$$' ) ;\
for f in $$(grep -l -R __REPOSITORY_URL__ ${DOCS_DIR} | grep -e '\.rst$$' -e '\.md$$' ) ;\
do \
if [ ! -z $${f} ]; then \
echo "TEMPLATING $${f}" ;\
@ -149,7 +148,6 @@ $(DOCS_GENERATED_DIR)/.template-index.done:
fi ;\
done ; \
)
@touch $(DOCS_GENERATED_DIR)/.template-index.done
.NOTPARALLEL: $(SIPHON_FILES)
$(SIPHON_FILES): $(SCRIPTS_DIR)/siphon-generate \
@ -209,45 +207,15 @@ $(eval $(call siphon-process,rst,markdown))
# This target can be used just to generate the siphoned things
.PHONY: siphon
$(DOCS_GENERATED_DIR)/.siphon.done: $(SIPHON_DOCS)
@cp $(DOCS_GENERATED_DIR)/clicmd.rst $(BUILDDIR_SRC)/cli-reference/index.rst
@mkdir -p $(BUILDDIR_SRC)/cli-reference/clis
@cp -r $(DOCS_GENERATED_DIR)/clicmd.rst.dir/* $(BUILDDIR_SRC)/cli-reference/clis
@touch $(DOCS_GENERATED_DIR)/.siphon.done
.PHONY: clean-siphons
clean-siphons:
@( \
echo "find $(SIPHON_INPUT) -newer $(DOCS_GENERATED_DIR)/.siphon.done" ; \
cd $(WS_ROOT); \
if [ -f $(DOCS_GENERATED_DIR)/.siphon.done ] && \
[ $$(find $(SIPHON_INPUT) -type f -newer $(DOCS_GENERATED_DIR)/.siphon.done \
-not -name '*.md' \
-not -name '*.rst' | wc -l) -gt 0 ]; then \
rm -r $(DOCS_GENERATED_DIR); \
echo "removing... $(DOCS_GENERATED_DIR)"; \
fi; \
)
${BUILDDIR}/.docsrc.sync.ok:
@echo "Copying docs files..."
@cp -r $(DOCS_DIR) ${BUILDDIR_SRC}
@cd ${BUILDDIR_SRC} && find . -type l -exec cp --remove-destination -L ${DOCS_DIR}/{} {} \;
@touch $(BUILDDIR)/.docsrc.sync.ok
.PHONY: copy-src
copy-src: ${BUILDDIR}/.docsrc.sync.ok
@echo "Syncing changed files..."
@cd $(DOCS_DIR) && find . -type f -not -path '*/_scripts/*' -newer $(BUILDDIR)/.docsrc.sync.ok -exec cp {} ${BUILDDIR_SRC}/{} \;
@cd ${DOCS_DIR} && find . -type l -not -path '*/_scripts/*' -newer $(BUILDDIR)/.docsrc.sync.ok -exec cp --remove-destination -L ${DOCS_DIR}/{} ${BUILDDIR_SRC}/{} \;
@cd ${DOCS_DIR} && find -L . -type f -not -path '*/_scripts/*' -newer $(BUILDDIR)/.docsrc.sync.ok -exec cp --remove-destination -L ${DOCS_DIR}/{} ${BUILDDIR_SRC}/{} \;
@touch $(BUILDDIR)/.docsrc.sync.ok
siphon: $(SIPHON_DOCS)
@cp $(DOCS_GENERATED_DIR)/clicmd.rst $(DOCS_DIR)/cli-reference/index.rst
@cp -r $(DOCS_GENERATED_DIR)/clicmd.rst.dir $(DOCS_DIR)/cli-reference/clis
.PHONY: generate
generate: copy-src clean-siphons $(DOCS_GENERATED_DIR)/.siphon.done $(DOCS_GENERATED_DIR)/.includes-render.done $(DOCS_GENERATED_DIR)/.template-index.done $(DOCS_GENERATED_DIR)/.featurelist.done
generate: siphon includes-render template-index featurelist
.PHONY: clean
clean:
@rm -rf $(BUILDDIR)
@rm -rf $(BR)/.siphon.dep
@rm -rf $(SCRIPTS_DIR)/siphon/__pycache__

View File

@ -24,10 +24,9 @@ if len(sys.argv) < 2:
patterns = [
# Search for "define" blocks and treat them as structs
(
re.compile(r"^.*(manual_.[^\s]+\s+)?define\s+(?P<name>[^\s]+)"),
r"typedef struct vl_api_\g<name>_t",
),
(re.compile(r"^.*(manual_.[^\s]+\s+)?define\s+(?P<name>[^\s]+)"),
r"typedef struct vl_api_\g<name>_t"),
# For every "brief" statement at the start of a comment block, add an
# xref with whatever is on the same line. This gives us an index page
# with all the API methods in one place.
@ -37,8 +36,9 @@ patterns = [
# r'/** @xrefitem api "" "VPP API" \g<c> \g<b> \g<c>'), # capture inline comment close
# (re.compile(r"/\*\*\s*(?P<b>[\\@]brief)\s+(?P<c>.+)$"),
# r'/** @xrefitem api "" "VPP API" \g<c> \g<b> \g<c>'),
# Since structs don't have params, replace @param with @tparam
(re.compile("[\\@]param\\b"), "@tparam"),
( re.compile("[\\@]param\\b"), "@tparam"),
]
with open(sys.argv[1]) as fd:
@ -46,4 +46,4 @@ with open(sys.argv[1]) as fd:
str = line[:-1] # strip \n
for p in patterns:
str = p[0].sub(p[1], str)
sys.stdout.write(str + "\n")
sys.stdout.write(str+"\n")

View File

@ -23,82 +23,51 @@ if len(sys.argv) < 2:
replace_patterns = [
# Search for VLIB_CLI_COMMAND, extract its parameters and add a docblock for it
(
re.compile("(?P<m>VLIB_CLI_COMMAND)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ vlib_cli_command_t \g<name>",
),
(
re.compile(
"(?P<m>VLIB_CLI_COMMAND)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<qual>[^)]*)[)]"
),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ \g<qual> vlib_cli_command_t \g<name>",
),
( re.compile("(?P<m>VLIB_CLI_COMMAND)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ vlib_cli_command_t \g<name>"),
( re.compile("(?P<m>VLIB_CLI_COMMAND)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<qual>[^)]*)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ \g<qual> vlib_cli_command_t \g<name>"),
# Search for VLIB_REGISTER_NODE, extract its parameters and add a docblock for it
(
re.compile("(?P<m>VLIB_REGISTER_NODE)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ vlib_node_registration_t \g<name>",
),
(
re.compile(
"(?P<m>VLIB_REGISTER_NODE)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<qual>[^)]*)[)]"
),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ \g<qual> vlib_node_registration_t \g<name>",
),
( re.compile("(?P<m>VLIB_REGISTER_NODE)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ vlib_node_registration_t \g<name>"),
( re.compile("(?P<m>VLIB_REGISTER_NODE)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<qual>[^)]*)[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>) */ \g<qual> vlib_node_registration_t \g<name>"),
# Search for VLIB_INIT_FUNCTION, extract its parameter and add a docblock for it
(
re.compile("(?P<m>VLIB_INIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ vlib_init_function_t * _vlib_init_function_\g<name>",
),
(
re.compile("(?P<m>VLIB_DECLARE_INIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ vlib_init_function_t * _vlib_init_function_\g<name>",
),
( re.compile("(?P<m>VLIB_INIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ vlib_init_function_t * _vlib_init_function_\g<name>"),
( re.compile("(?P<m>VLIB_DECLARE_INIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ vlib_init_function_t * _vlib_init_function_\g<name>"),
# Search for VLIB_LOOP_ENTER_FUNCTION, extract the parameters and add a docblock for it
(
re.compile(
"(?P<m>VLIB_MAIN_LOOP_ENTER_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)(,[^)]*)?[)]"
),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ _vlib_main_loop_enter_\g<name>",
),
(
re.compile(
"(?P<m>VLIB_MAIN_LOOP_EXIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)(,[^)]*)?[)]"
),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ _vlib_main_loop_exit_\g<name>",
),
( re.compile("(?P<m>VLIB_MAIN_LOOP_ENTER_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)(,[^)]*)?[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ _vlib_main_loop_enter_\g<name>"),
( re.compile("(?P<m>VLIB_MAIN_LOOP_EXIT_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+)(,[^)]*)?[)]"),
r"/** @brief (@em constructor) \g<m> (@ref \g<name>) */ _vlib_main_loop_exit_\g<name>"),
# Search for VLIB_CONFIG_FUNCTION, extract the parameters and add a docblock for it
(
re.compile(
'(?P<m>VLIB_CONFIG_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<n>"[^"]+")(,[^)]*)?[)]'
),
r"/** @brief (@em constructor) \g<m> (\g<name>, \g<n>) */ vlib_config_function_runtime_t _vlib_config_function_\g<name>",
),
(
re.compile(
'(?P<m>VLIB_EARLY_CONFIG_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<n>"[^"]+")(,[^)]*)?[)]'
),
r"/** @brief (@em constructor) \g<m> (\g<name>, \g<n>) */ vlib_config_function_runtime_t _vlib_config_function_\g<name>",
),
( re.compile("(?P<m>VLIB_CONFIG_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<n>\"[^\"]+\")(,[^)]*)?[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>, \g<n>) */ vlib_config_function_runtime_t _vlib_config_function_\g<name>"),
( re.compile("(?P<m>VLIB_EARLY_CONFIG_FUNCTION)\s*[(](?P<name>[a-zA-Z0-9_]+),\s*(?P<n>\"[^\"]+\")(,[^)]*)?[)]"),
r"/** @brief (@em constructor) \g<m> (\g<name>, \g<n>) */ vlib_config_function_runtime_t _vlib_config_function_\g<name>"),
# Search for "format_thing" and "unformat_thing" when used as a function pointer and add parens
(
re.compile(
"(?P<pre>(^|,)\s*)(?P<name>(un)?format_[a-zA-Z0-9_]+)(?P<post>\s*(,|$))"
),
r"\g<pre>\g<name>()\g<post>",
),
( re.compile("(?P<pre>(^|,)\s*)(?P<name>(un)?format_[a-zA-Z0-9_]+)(?P<post>\s*(,|$))"),
r"\g<pre>\g<name>()\g<post>" ),
# Search for CLIB_PAD_FROM_TO(...); and replace with padding
# #define CLIB_PAD_FROM_TO(from,to) u8 pad_##from[(to) - (from)]
(
re.compile("(?P<m>CLIB_PAD_FROM_TO)\s*[(](?P<from>[^,]+),\s*(?P<to>[^)]+)[)]"),
r"/** Padding. */ u8 pad_\g<from>[(\g<to>) - (\g<from>)]",
),
( re.compile("(?P<m>CLIB_PAD_FROM_TO)\s*[(](?P<from>[^,]+),\s*(?P<to>[^)]+)[)]"),
r"/** Padding. */ u8 pad_\g<from>[(\g<to>) - (\g<from>)]" ),
]
filename = sys.argv[1]
cwd = os.getcwd()
if filename[0 : len(cwd)] == cwd:
filename = filename[len(cwd) :]
if filename[0:len(cwd)] == cwd:
filename = filename[len(cwd):]
if filename[0] == "/":
filename = filename[1:]
@ -113,6 +82,6 @@ with open(filename) as fd:
for p in replace_patterns:
str = p[0].sub(p[1], str)
sys.stdout.write(str + "\n")
sys.stdout.write(str+"\n")
# All done

View File

@ -26,19 +26,17 @@ if len(sys.argv) < 2:
replace_patterns = [
# Search for CLIB_PAD_FROM_TO(...); and replace with padding
# #define CLIB_PAD_FROM_TO(from,to) u8 pad_##from[(to) - (from)]
(
re.compile(
r"(?P<m>CLIB_PAD_FROM_TO)\s*[(](?P<from>[^,]+)," r"\s*(?P<to>[^)]+)[)]"
),
r"/** Padding. */ u8 pad_\g<from>[(\g<to>) - (\g<from>)]",
),
(re.compile(r"(?P<m>CLIB_PAD_FROM_TO)\s*[(](?P<from>[^,]+),"
r"\s*(?P<to>[^)]+)[)]"),
r"/** Padding. */ u8 pad_\g<from>[(\g<to>) - (\g<from>)]"),
]
filename = sys.argv[1]
cwd = os.getcwd()
if filename[0 : len(cwd)] == cwd:
filename = filename[len(cwd) :]
if filename[0:len(cwd)] == cwd:
filename = filename[len(cwd):]
if filename[0] == "/":
filename = filename[1:]
@ -53,6 +51,6 @@ with open(filename) as fd:
for p in replace_patterns:
str = p[0].sub(p[1], str)
sys.stdout.write(str + "\n")
sys.stdout.write(str+"\n")
# All done

View File

@ -33,14 +33,15 @@ class ContentRenderer:
class PluginRenderer(ContentRenderer):
def _render_entry(self, output_file, entry):
description = "<no-description-found>"
# we use glob because a plugin can (ioam for now)
# define the plugin definition in
# a further subdirectory.
path = os.path.join(self.plugin_dir(), entry.name, "**")
path = os.path.join(self.plugin_dir(), entry.name, '**')
for f in glob.iglob(path, recursive=True):
if not f.endswith(".c"):
if not f.endswith('.c'):
continue
with open(f, "r", encoding="utf-8") as src:
for match in self.regex.finditer(src.read()):
@ -55,7 +56,7 @@ class PluginRenderer(ContentRenderer):
with open(fname, "w") as output_file:
with os.scandir(self.plugin_dir()) as pdir:
for entry in sorted(pdir, key=lambda entry: entry.name):
if not entry.name.startswith(".") and entry.is_dir():
if not entry.name.startswith('.') and entry.is_dir():
self._render_entry(output_file, entry)

View File

@ -24,7 +24,7 @@ import os
import siphon
DEFAULT_LOGFILE = None
DEFAULT_LOGLEVEL = "warning"
DEFAULT_LOGLEVEL = "info"
DEFAULT_OUTPUT = "build-root/docs/siphons"
DEFAULT_PREFIX = os.getcwd()

Some files were not shown because too many files have changed in this diff Show More