From: Cyril Hrubis <chrubis@suse.cz>
To: Alexey Kodanev <alexey.kodanev@oracle.com>
Cc: vasily.isaenko@oracle.com, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] sctp/test_1_to_1_sockopt.c: set SO_SNDBUF above the defined minimum
Date: Wed, 11 Mar 2015 12:48:32 +0100 [thread overview]
Message-ID: <20150311114831.GB3713@rei> (raw)
In-Reply-To: <55002A64.6040108@oracle.com>
Hi!
> This is what is written in kernel source (net/core/sock.c):
>
> sk->sk_sndbuf = max_t(u32, val * 2, SOCK_MIN_SNDBUF);
> ...
> /*
> * We double it on the way in to account for
> * "struct sk_buff" etc. overhead. Applications
> * assume that the SO_RCVBUF setting they make will
> * allow that much actual data to be received on that
> * socket.
> *
> * Applications are unaware that "struct sk_buff" and
> * other overheads allocate from the receive buffer
> * during socket buffer allocation.
> *
> * And after considering the possible alternatives,
> * returning the value we actually used in getsockopt
> * is the most desirable behavior.
> */
>
> sk->sk_rcvbuf = max_t(u32, val * 2, SOCK_MIN_RCVBUF);
>
> I'm not sure why it is not just 'val', because it chooses the maximum
> value in any case and we have defined minimum.
Ok.
The patch is fine then.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2015-03-11 11:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-10 11:18 [LTP] [PATCH] sctp/test_1_to_1_sockopt.c: set SO_SNDBUF above the defined minimum Alexey Kodanev
2015-03-11 10:30 ` Cyril Hrubis
[not found] ` <55002A64.6040108@oracle.com>
2015-03-11 11:48 ` Cyril Hrubis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150311114831.GB3713@rei \
--to=chrubis@suse.cz \
--cc=alexey.kodanev@oracle.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=vasily.isaenko@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.