Skip to content

Commit 7891fc3

Browse files
committed
Merge branch 'v9_0'
2 parents 7a834aa + a0017fa commit 7891fc3

File tree

11 files changed

+225
-72
lines changed

11 files changed

+225
-72
lines changed

Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,25 @@ else
1313
$(error ZF_DEVEL unsupported when building from installed onload)
1414
endif
1515
$(info Using installed onload libraries and headers)
16+
17+
ifneq ("$(wildcard /usr/lib64/libcitools1.a)","")
1618
CITOOLS_LIB := /usr/lib64/libcitools1.a
17-
CIUL_LIB := /usr/lib64/libciul1.a
19+
else ifneq ("$(wildcard /usr/lib/x86_64-linux-gnu/libcitools1.a)","")
20+
CITOOLS_LIB := /usr/lib/x86_64-linux-gnu/libcitools1.a
21+
else
22+
$(warning Could not find libcitools1.a. Have you installed onload development headers?)
23+
endif
24+
$(info libcitools1.a found at $(CITOOLS_LIB))
25+
26+
ifneq ("$(wildcard /usr/lib64/libciul1.a)","")
27+
CIUL_LIB := /usr/lib64/libciul1.a
28+
else ifneq ("$(wildcard /usr/lib/x86_64-linux-gnu/libciul1.a)","")
29+
CIUL_LIB := /usr/lib/x86_64-linux-gnu/libciul1.a
30+
else
31+
$(warning Could not find libciul1.a. Have you installed onload development headers?)
32+
endif
33+
$(info libciul1.a found at $(CIUL_LIB))
34+
1835
endif
1936
include Makefile-top.inc
2037

README.MD

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ make
2222
```
2323

2424
### Packaging
25+
26+
#### SRPM instructions
2527
Use the [`zf_make_official_srpm`](./scripts/zf_make_official_srpm) script to create an SRPM package:
2628

2729
```bash
@@ -51,6 +53,26 @@ invocation of `rpmbuild` above:
5153

5254
Where the `${onload}` variable points to an Onload tarball.
5355

56+
57+
#### Deb instructions
58+
59+
To install TCPDirect from a DEB:
60+
61+
The DEB package depends on `*onload-user` and `*onload-dev` packages in addition
62+
to any other dependencies.
63+
64+
```bash
65+
# 1. Extract debian-source tarball:
66+
tar -xf tcpdirect_<version>-debiansource.tgz
67+
# 2. Unpack debian source archive
68+
dpkg-source -x tcpdirect_<version>-1.dsc
69+
# 3. Enter newly created tcpdirect directory
70+
cd tcpdirect-<version>
71+
# 4. Build debian package
72+
debuild -i -uc -us
73+
# 5. Install debian package
74+
dpkg -i ../tcpdirect_<version>-1_amd64.deb
75+
```
5476
## How to run unit tests
5577

5678
### Dependencies

ci/test.groovy

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,15 @@ nm.slack_notify() {
184184
archiveArtifacts(artifacts: '*.tgz')
185185
archiveArtifacts(artifacts: '*.md5')
186186
archiveArtifacts(artifacts: '*.txt')
187+
sh 'rm *ReleaseNotes.txt'
187188
stash name: 'text_files', includes: '*.txt'
188189
zip_and_archive_files(
189190
"tcpdirect-${tcpdirect_version_long}-tarball-doxbox.zip",
190191
'*.tgz',
191192
'*.md5',
192193
'*.txt'
193194
)
194-
stash(
195-
name: "tcpdirect-release-tarball",
196-
includes: "tcpdirect-${tcpdirect_version_long}.tgz",
197-
)
198195
}
199-
stash(name: "tcpdirect-build-artifacts", includes: "tcpdirect/build/artifacts/**")
200196
}
201197
}
202198

@@ -220,25 +216,26 @@ nm.slack_notify() {
220216
sh "rm -rf ${outdir}"
221217
}
222218
},
223-
"publish release deb": {
219+
"publish deb": {
224220
node("deb") {
225-
stage('stage installation') {
221+
stage('Create source tarball') {
226222
deleteDir()
227-
unstash('tcpdirect-release-tarball')
228-
sh "tar xvzf tcpdirect-${tcpdirect_version_long}.tgz"
229-
sh "tcpdirect-${tcpdirect_version_long}/scripts/zf_install --packaging --dest-dir staging/usr"
230-
stash(name: "tcpdirect-staged-installation", includes: "staging/**")
223+
unstash('tcpdirect-src')
224+
sh "tcpdirect/scripts/zf_mksrc --version ${tcpdirect_version_long}"
225+
stash name: 'tcpdirect-tar', includes: "tcpdirect-${tcpdirect_version_long}.tar.gz"
226+
sh "mv tcpdirect-${tcpdirect_version_long}.tar.gz tcpdirect-source-${tcpdirect_version_long}.tar.gz"
227+
archiveArtifacts allowEmptyArchive: true, artifacts: "tcpdirect-source-${tcpdirect_version_long}.tar.gz", followSymlinks: false
231228
}
232-
stage('build deb') {
229+
stage('create deb') {
233230
deleteDir()
234-
unstash('tcpdirect-staged-installation')
231+
unstash('tcpdirect-tar')
235232
unstash('tcpdirect-src')
236-
sh "tcpdirect/scripts/zf_make_official_deb --version ${tcpdirect_version_long} staging"
237-
archiveArtifacts allowEmptyArchive: true, artifacts: '*.deb', followSymlinks: false
233+
sh "tcpdirect/scripts/zf_make_official_deb --version ${tcpdirect_version_long} tcpdirect-${tcpdirect_version_long}.tar.gz"
234+
archiveArtifacts allowEmptyArchive: true, artifacts: '*debiansource.tgz', followSymlinks: false
238235
unstash('text_files')
239236
zip_and_archive_files(
240237
"tcpdirect-${tcpdirect_version_long}-deb-doxbox.zip",
241-
'*.deb',
238+
'*debiansource.tgz',
242239
'*.txt'
243240
)
244241
}

doc/ReleaseNotes

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
TCPDirect-9.0.0
22
===============
33

4-
This is a feature release of TCPDirect that includes fixes and other changes
5-
since the TCPDirect-8.1.3.8.
6-
7-
See the ChangeLog for a list of fixes.
4+
This is a feature release of TCPDirect that includes improvements since
5+
TCPDirect-8.1.3.8. See the ChangeLog for a list of changes.
86

97
TCPDirect must be used with a matching version of Onload, in this case
108
Onload version 9.0.0. The network adapter and operating system support
119
derives from those supported by Onload.
1210

1311

14-
Public Onload/ef_vi control plane API
15-
-------------------------------------
16-
17-
The Onload control plane in this Onload-9.0.0 is presented via a new
18-
public API that can be used by ef_vi applications. As an ef_vi application,
19-
TCPDirect now uses this API to query the control plane server.
20-
21-
2212
TCPDirect distributed as source code
2313
------------------------------------
2414

@@ -29,35 +19,40 @@ TCPDirect distributed as source code
2919
suitable new build and installation workflows for the TCPDirect source
3020
package.
3121

22+
In particular, this means an additional Onload development package
23+
is required, which contains the necessary headers for building TCPDirect.
3224

33-
Installation (TBD: update this section)
34-
------------
35-
36-
To install TCPDirect from a tarball:
3725

38-
1. As root, unpack the tar file using the tar command:
26+
New onload development package
27+
------------------------------
3928

40-
tar -zxvf tcpdirect-<version>.tgz
29+
Onload now includes a package containing headers required by ef_vi
30+
applications like TCPDirect. Installing this package is required to
31+
build TCPDirect and TCPDirect applications.
4132

42-
This will unpack the tar file and, within the current directory,
43-
create a sub-directory called tcpdirect-<version> which contains
44-
other sub-directories including the scripts directory from
45-
which subsequent install commands can be run.
33+
Please ensure the openonload-devel RPM or onload-dev DEB is installed
34+
after building Onload before attempting to build TCPDirect.
4635

47-
2. Go to the scripts directory:
4836

49-
cd tcpdirect-<version>/scripts
37+
Public Onload/ef_vi control plane API
38+
-------------------------------------
5039

51-
3. Install TCPDirect in the system directories:
40+
The Onload control plane in this Onload-9.0.0 is presented via a new
41+
public API that can be used by ef_vi applications. As an ef_vi application,
42+
TCPDirect now uses this API to query the control plane server.
5243

53-
./zf_install
5444

55-
Successful installation is indicated with the following output:
45+
Installation
46+
------------
5647

57-
TCPDirect install complete
48+
To install TCPDirect from a Source RPM:
5849

50+
0. The source RPM package depends on the Onload userspace and development
51+
packages in addition to any other dependencies on standard system
52+
packages:
5953

60-
To install TCPDirect from a Source RPM:
54+
- onload
55+
- onload-devel
6156

6257
1. Build the binary RPM from the source RPM file:
6358

@@ -77,5 +72,38 @@ Installation (TBD: update this section)
7772
rpm -Uvh <path>/tcpdirect-<module_version>.rpm
7873

7974

75+
To install TCPDirect from a DEB:
76+
77+
0. The DEB source package depends on the Onload userspace and development
78+
packages in addition to any other dependencies on standard system
79+
packages:
80+
81+
- onload-user
82+
- onload-dev
83+
84+
1. Extract debian-source tarball:
85+
86+
tar -xf tcpdirect_<version>-debiansource.tgz
87+
88+
2. Unpack debian source archive
89+
90+
dpkg-source -x tcpdirect_<version>-1.dsc
91+
92+
3. Enter newly created tcpdirect directory
93+
94+
cd tcpdirect-<version>
95+
96+
4. Build debian package
97+
98+
debuild -i -uc -us
99+
100+
5. Install debian package
101+
102+
dpkg -i tcpdirect_<version>-1_amd64.deb
103+
104+
There is no longer a 'tarball' distribution type as the RPM and DEB source
105+
packages are suitable for all supported OSs.
106+
107+
80108
SPDX-License-Identifier: MIT
81109
SPDX-FileCopyrightText: (c) 2023-2024 Advanced Micro Devices, Inc.

scripts/debian-templ/control

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
Package: tcpdirect
2-
Version: #VERSION#
1+
Source: tcpdirect
32
Section: libs
43
Priority: optional
4+
Maintainer: AMD NIC Support <[email protected]>
5+
Build-Depends: debhelper (>= 8.0.0), onload-user, onload-dev, build-essential
6+
Standards-Version: 3.9.3
7+
Homepage: http://www.openonload.org
8+
9+
Package: tcpdirect
510
Architecture: amd64
6-
Depends: onload-user | enterpriseonload-user | openonload-user | cloudonload-user
7-
Maintainer: Support <[email protected]>
11+
Depends: onload-user
812
Description: TCPDirect library

scripts/debian-templ/rules

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/make -f
2+
3+
# See debhelper(7) (uncomment to enable).
4+
# Output every command that modifies files on the build system.
5+
#export DH_VERBOSE = 1
6+
7+
# dpkg-buildflags sets link time optimisation by default. Because we want to
8+
# finish before the heat death of the universe, we disable the optimisation for
9+
# this package.
10+
export DEB_BUILD_MAINT_OPTIONS=optimize=-lto
11+
12+
%:
13+
dh $@
14+
15+
override_dh_auto_build:
16+
./scripts/zf_mkdist --name tcpdirect --version #VERSION#
17+
tar -xzvf build/tcpdirect-#VERSION#.tgz
18+
19+
override_dh_auto_install:
20+
mkdir -p $(CURDIR)/debian/tcpdirect/usr
21+
cp ./scripts/zf_install tcpdirect-#VERSION#/scripts
22+
./tcpdirect-#VERSION#/scripts/zf_install --dest-dir $(CURDIR)/debian/tcpdirect/usr --packaging
23+
24+
# By default, dh_compresses any files in usr/share/doc that is over 4k. This
25+
# includes the example source and header files, which prevents easy compilation.
26+
# Exclude the examples from the compress so that they are still compilable.
27+
override_dh_compress:
28+
dh_compress -Xexamples

scripts/debian-templ/source/format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (quilt)

scripts/zf_make_official_deb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,12 @@ lib64_path() {
2222
usage() {
2323
err
2424
err "usage:"
25-
err " $me [options] <staged_tree>"
25+
err " $me [options] <zf_tarball>"
2626
err
2727
err "options:"
2828
err " --out <path> - directory to write source package to"
2929
err " --version <version> - version number for debian package"
3030
err
31-
err "notes:"
32-
err " prepare an appropriate staging directory. Example usage:"
33-
err " zf_install --packaging --dest-dir staging/usr"
34-
err " $me staging"
3531
exit 1
3632
}
3733

@@ -55,7 +51,7 @@ done
5551

5652
[ $# -eq 1 ] || usage
5753

58-
staged=$1
54+
tarball=$1
5955

6056
if [ ! -d "$outdir" ]; then
6157
echo "$outdir does not appear to be a directory";
@@ -67,11 +63,9 @@ if [ -z "$version" ]; then
6763
fi
6864

6965
# soversion=$(awk '/^ONLOAD_EXT_VERSION_MAJOR/{print $3}' $TOP/../mk/site/libs.mk)
70-
deb_ver="1"
71-
arch="amd64"
7266
package_name="tcpdirect"
7367
package="${package_name}_${version}"
74-
tcpdirect_dir="${package}-${deb_ver}_${arch}"
68+
tcpdirect_dir="${package_name}-${version}"
7569
tempfile=$(mktemp -d)
7670

7771
if [ ! -d "$tempfile" ]; then
@@ -81,28 +75,34 @@ fi
8175

8276
echo "Creating package $package in $tempfile"
8377

84-
try mkdir -p "$tempfile/$tcpdirect_dir/DEBIAN"
78+
try cp "${tarball}" "${tempfile}/${package}.orig.tar.gz"
79+
try mkdir -p "$tempfile/$tcpdirect_dir/debian"
8580

8681
# Make any necessary replacements in the control files
87-
for i in "$TOP"/scripts/debian-templ/*; do
88-
try sed -e "s/#VERSION#/$version/g" -e "s|#LIBDIR#|"$(lib64_path)"|g" < "$i" > "${tempfile}/${tcpdirect_dir}/DEBIAN/$(basename "$i")";
82+
find "$TOP"/scripts/debian-templ/* -type f | while read -r i; do
83+
debfile="${tempfile}/${tcpdirect_dir}/debian/$(basename "$i")"
84+
try sed -e "s/#VERSION#/$version/g" -e "s|#LIBDIR#|$(lib64_path)|g" < "$i" > "$debfile";
8985
done
9086

9187
# Accoding to the Debian Policy Manual, executable maintainer scripts should be
9288
# owned by root:root and have mode 755
9389
for i in postinst postrm; do
94-
try chmod 0755 "${tempfile}/${tcpdirect_dir}/DEBIAN/$i"
90+
try chmod 0755 "${tempfile}/${tcpdirect_dir}/debian/$i"
9591
done
9692

97-
dest_dir="${tempfile}/${tcpdirect_dir}"
93+
try cd "$tempfile"
94+
try tar xf "$package.orig.tar.gz" -C "$tcpdirect_dir" --strip-components=1
95+
try cd "$tcpdirect_dir/debian"
96+
try debuild -S -i -uc -us -d
97+
try cd "$tempfile"
9898

99-
try cp -a ${staged}/* "${dest_dir}"
99+
echo "Using package components:"
100+
ls -- *.[gx]z *.dsc
100101

101-
try cd "$tempfile"
102-
try fakeroot dpkg-deb -b "$tcpdirect_dir"
103-
try mv "$tcpdirect_dir.deb" "$outdir/"
102+
try tar zcf "$package-debiansource.tgz" --owner=root --group=root -- *.[gx]z *.dsc
103+
try mv "$package-debiansource.tgz" "$outdir/"
104104
try rm -rf "$tempfile"
105105

106106
echo ""
107-
echo "Wrote $outdir/$tcpdirect_dir.deb"
107+
echo "Wrote $outdir/$package-debiansource.tgz"
108108
echo ""

scripts/zf_make_tarball

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ make_release_package() {
2828
cp "${script_dir}"/zf_install "${stage_dir}/scripts"
2929
cp "${script_dir}"/zf_uninstall "${stage_dir}/scripts"
3030
cp "${script_dir}"/zf_debug "${stage_dir}/scripts"
31-
cp "${script_dir}"/tcpdirect_misc/tcpdirect.spec "${stage_dir}/scripts"
3231

32+
if [ -f "${script_dir}"/tcpdirect_misc/tcpdirect.spec ]; then
33+
cp "${script_dir}"/tcpdirect_misc/tcpdirect.spec "${stage_dir}/scripts"
34+
fi
3335

3436
# Add documents to tarball
3537
# Currently only ReleaseNotes exists (in a separate branch), so checks are added for each file

0 commit comments

Comments
 (0)