Whamcloud - gitweb
LU-13783 libcfs: support removal of kernel_setsockopt()
authorMr NeilBrown <neilb@suse.de>
Tue, 11 May 2021 06:27:46 +0000 (23:27 -0700)
committerLi Xi <lixi@ddn.com>
Tue, 18 May 2021 01:47:02 +0000 (01:47 +0000)
commit7e410763d85c1cc14f59ea3d9af072d8d4ec3843
tree67b076322aaa83f8fd04ad2c86673ec954121429
parent542fcc1b5e8883ab68949a3420dd06d2d1462b1c
LU-13783 libcfs: support removal of kernel_setsockopt()

Linux 5.8 removes kernel_setsockopt() and kernel_getsockopt(), and
provides some helper functions for some accesses that are
not trivial.

This patch adds those helpers to libcfs when they are not available,
and changes (nearly) all calls to kernel_[gs]etsockopt() to
either use direct access to a helper call.

->keepalive() is not available before v4.11-rc1~94^2~43^2~14
and there is no helper function, so for SO_KEEPALIVE we
need to have #ifdef code in the C file.

TCP_BACKOFF* setting are not converted as they are not available in
any upstream kernel, so no conversion is possible.

Also include some minor style fixes and change lnet_sock_setbuf() and
lnet_sock_getbuf() to be 'void' functions.

Lustre-change: https://review.whamcloud.com/39259
Lustre-commit: 99d9638d6c074b48f1c21c5c94d6dfe347eed3ee

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I539cf8d20555ddb3565fa75130fdd3acf709c545
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/43644
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/linux/Makefile.am
libcfs/include/libcfs/linux/linux-net.h [new file with mode: 0644]
lnet/include/lnet/lib-lnet.h
lnet/klnds/socklnd/socklnd.h
lnet/klnds/socklnd/socklnd_lib.c
lnet/lnet/lib-socket.c