Skip to content

Commit

Permalink
autotest: set FreeBSD kern.ipc.maxsockbuf to 4k
Browse files Browse the repository at this point in the history
unittest_sock unit tests fail on FreeBSD due to
ENOBUFS. Increase to buffer size to 4k for tests
to pass.

Fixes spdk#2943

Signed-off-by: Karol Latecki <[email protected]>
Change-Id: I55d1164d49edb2d90ebfe5f720a615f052ee52d9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17370
Tested-by: SPDK CI Jenkins <[email protected]>
Reviewed-by: Jim Harris <[email protected]>
Reviewed-by: Konrad Sztyber <[email protected]>
  • Loading branch information
karlatec authored and ksztyber committed Mar 30, 2023
1 parent 45dc5f1 commit a7d3e10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions autotest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ out=$output_dir
cd $src

freebsd_update_contigmem_mod
freebsd_set_maxsock_buf

# lcov takes considerable time to process clang coverage.
# Disabling lcov allow us to do this.
Expand Down
9 changes: 9 additions & 0 deletions test/common/autotest_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,15 @@ function freebsd_update_contigmem_mod() {
fi
}

function freebsd_set_maxsock_buf() {
# FreeBSD needs 4MB maxsockbuf size to pass socket unit tests.
# Otherwise tests fail due to ENOBUFS when trying to do setsockopt(SO_RCVBUF|SO_SNDBUF).
# See https://github.com/spdk/spdk/issues/2943
if [[ $(uname) = FreeBSD ]] && (($(sysctl -n kern.ipc.maxsockbuf) < 4194304)); then
sysctl kern.ipc.maxsockbuf=4194304
fi
}

function get_nvme_name_from_bdf() {
blkname=()

Expand Down

0 comments on commit a7d3e10

Please sign in to comment.