@@ -35,18 +35,19 @@ extern "C" {
/**
* Buffer pool parameters
* Used to communicate buffer pool creation options.
+ *
+ * @see ODP_CONFIG_PACKET_BUF_LEN_MIN, ODP_CONFIG_BUFFER_ALIGN_MIN,
+ * ODP_CONFIG_BUFFER_ALIGN_MAX
*/
typedef struct odp_buffer_pool_param_t {
- uint32_t buf_size; /**< Buffer size in bytes. The maximum
- number of bytes application will
- store in each buffer. For packets, this
- is the maximum packet data length, and
- configured headroom and tailroom will be
- added to this number */
- uint32_t buf_align; /**< Minimum buffer alignment in bytes.
- Valid values are powers of two. Use 0
- for default alignment. Default will
- always be a multiple of 8. */
+ uint32_t buf_size; /**< Minimum buffer length in bytes. For packets,
+ this is the minimum segment buffer length. The
+ length includes head-/tailroom bytes. Use 0 for
+ default length. */
This is confusing. Presumably for buffers of type ODP_BUFFER_TYPE_PACKET this is a synonym for ODP_CONFIG_PACKET_BUF_LEN_MIN. However, how is a 0 value to be interpreted for other buffer types? Need to specify that here. In the current code it is legitimate to specify a buf_size of zero as that means that buffers will consist only of metadata. Buffers of type ODP_BUFFER_TYPE_TIMEOUT fall into that category, for example. Since this is a buffer structure, not a packet structure, the documentation should reflect that.
User should use zero when
- the buffer type has only meta-data
- user is going to use the default segment size for packets (== PACKET_BUF_LEN_MIN)