Socket buffer
Leon Pollak
leonp at plris.com
Sun Oct 11 14:51:05 UTC 2009
Hello, all.
I searched WEB and Wiki - was not able to find an answer...:-(
--
I see the message "not delivered. Socket buffer full" in
rtems_bsdnet_show_udp_stats report.
Ok, I now tried to increase the socket buffer (from 1MB to 2MB) by the command
setsockopt(so,SOL_SOCKET,SO_RCVBUF,&Size,sizeof(Size)).
- failed.
Debugging shows that function sbreserve fails in the first check:
/*
* Allot mbufs to a sockbuf.
* Attempt to scale mbmax so that mbcnt doesn't become limiting
* if buffering efficiency is near the normal case.
*/
int
sbreserve(sb, cc)
struct sockbuf *sb;
u_long cc;
{
if (cc > sb_max * MCLBYTES / (MSIZE + MCLBYTES))
return (0);
......
Now, when I set sb_max to be 1MB, the max socket buffer size may be also not
more then 1MB.
And I cannot set it higher to 2MB, as the calculation of sb_max * MCLBYTES
(which is 2048) exits the 32bit limit.
This makes me think that increasing the socket buffer to such extend is
incorrect. If so, what can I do to avoid this error?
I thought that the cause may be in the lack of CPU time, but
rtems_cpu_usage_report shows that about 35% CPU spends in IDLE task...
Thanks a lot for any hint.
--
Leon
More information about the users
mailing list