Thread (6 messages) flat view 6 messages, 4 authors, 2020-05-29

Re: [PATCH bpf-next] bpf: add SO_KEEPALIVE and related options to bpf_setsockopt

From: Dmitry Yakunin <hidden>
Date: 2020-05-27 20:44:54
Also in: bpf


27.05.2020, 20:03, "Martin KaFai Lau" [off-list ref]:
On Wed, May 27, 2020 at 06:05:43PM +0300, Dmitry Yakunin wrote:
quoted
 This patch adds support of SO_KEEPALIVE flag and TCP related options
 to bpf_setsockopt() routine. This is helpful if we want to enable or tune
 TCP keepalive for applications which don't do it in the userspace code.
 In order to avoid copy-paste, common code from classic setsockopt was moved
 to auxiliary functions in the headers.
Thanks for refatoring some of the pieces. I suspect some more can be done.
In the long run, I don't think this copy-and-paste is scalable.
For most of the options (integer value and do not need ns_capable()),
do_tcp_setsockopt() and sock_setsockopt() can be directly called with
some refactoring.

The change looks good. For this patch,

Acked-by: Martin KaFai Lau <redacted>
Thanks for your comment, Martin.
I agree with you, bpf_setsockopt and older setsockopts should be refactored to use common code.
I'll keep this in mind if i want to add new options.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help