Skip to main content
added 136 characters in body
Source Link
sourcejedi
  • 53.6k
  • 23
  • 179
  • 339

man mount

SO_RCVBUF

Sets or gets the maximum socket receive buffer in bytes. The kernel doubles this value (to allow space for bookkeeping overhead) when it is set using setsockopt(2), and this doubled value is returned by getsockopt(2). The default value is set by the /proc/sys/net/core/rmem_default file, and the maximum allowed value is set by the /proc/sys/net/core/rmem_max file. The minimum (doubled) value for this option is 256.

but I think such a buffer can hold no packets

What values may Linux use for the default unix socket buffer size?

...

The per-packet overhead is a combination of struct sk_buff and struct skb_shared_info, so it depends on the exact size of these structures (rounded up slightly for alignment). E.g. in the 64-bit kernel above, the overhead is 576 bytes per packet.

Is the above correct? Is there any good reason that the kernel enforces a minimum socket buffer size of 256?

SO_RCVBUF

Sets or gets the maximum socket receive buffer in bytes. The kernel doubles this value (to allow space for bookkeeping overhead) when it is set using setsockopt(2), and this doubled value is returned by getsockopt(2). The default value is set by the /proc/sys/net/core/rmem_default file, and the maximum allowed value is set by the /proc/sys/net/core/rmem_max file. The minimum (doubled) value for this option is 256.

but I think such a buffer can hold no packets

The per-packet overhead is a combination of struct sk_buff and struct skb_shared_info, so it depends on the exact size of these structures (rounded up slightly for alignment). E.g. in the 64-bit kernel above, the overhead is 576 bytes per packet.

Is the above correct? Is there any good reason that the kernel enforces a minimum socket buffer size of 256?

man mount

SO_RCVBUF

Sets or gets the maximum socket receive buffer in bytes. The kernel doubles this value (to allow space for bookkeeping overhead) when it is set using setsockopt(2), and this doubled value is returned by getsockopt(2). The default value is set by the /proc/sys/net/core/rmem_default file, and the maximum allowed value is set by the /proc/sys/net/core/rmem_max file. The minimum (doubled) value for this option is 256.

but I think such a buffer can hold no packets

What values may Linux use for the default unix socket buffer size?

...

The per-packet overhead is a combination of struct sk_buff and struct skb_shared_info, so it depends on the exact size of these structures (rounded up slightly for alignment). E.g. in the 64-bit kernel above, the overhead is 576 bytes per packet.

Is the above correct? Is there any good reason that the kernel enforces a minimum socket buffer size of 256?

Source Link
sourcejedi
  • 53.6k
  • 23
  • 179
  • 339

Does the minimum 256-byte SO_RCVBUF not allow a packet to be held?

SO_RCVBUF

Sets or gets the maximum socket receive buffer in bytes. The kernel doubles this value (to allow space for bookkeeping overhead) when it is set using setsockopt(2), and this doubled value is returned by getsockopt(2). The default value is set by the /proc/sys/net/core/rmem_default file, and the maximum allowed value is set by the /proc/sys/net/core/rmem_max file. The minimum (doubled) value for this option is 256.

but I think such a buffer can hold no packets

The per-packet overhead is a combination of struct sk_buff and struct skb_shared_info, so it depends on the exact size of these structures (rounded up slightly for alignment). E.g. in the 64-bit kernel above, the overhead is 576 bytes per packet.

Is the above correct? Is there any good reason that the kernel enforces a minimum socket buffer size of 256?