I am working with VxWorks and encountering a network buffer full issue when appending RTP headers in my subroutine rtp_push_hdr. This function allocates space at the beginning of the packet buffer, causing packets to be copied to a new packet with headers prepended. However, during this operation, the buffer seems to be full, leading to allocation failures message in the console.
rtp_push_hdr fails dropping packet::. errno:3997698
Method which calls rtd_push_hdr function
void packet_forward(...)
{
....
if (!(rtp = rtp_push_hdr(&new_pkt)))
{
print("rtp_push_hdr fails dropping packet::. errno:%d \n", errno);
return -ENOMEM;
}
....
}
rtp_push_hdr definition
/*******************************************************************************
*
* rtp_push_hdr - Allocates space at the beginning of the packet buffer
* and returns a pointer to that space.
*
* Parameters:
* \is
* \i <ppkt>
* Pointer to Packet pointer.
* \ie
*
* RETURNS: A pointer to the newly allocated data area. NULL if failure.
*
* ERRNO:
*/
static __inline__ rtp_hdr_t* rtp_push_hdr(Ipcom_pkt **ppkt)
{
...
if (IP_UNLIKELY(hdr == IP_NULL))
{
ipcom_pkt_free(*ppkt);
return NULL;
}
....
Based on my research, it appears that NUM_DAT_CLBLKS needs to be increased to expand the available buffer space. I found that NUM_DAT_CLBLKS is set within a .cdf file (comp_net_pool_vx.cdf) as follows:
Parameter NUM_DAT_MBLKS {
NAME NUM_DAT_MBLKS
SYNOPSIS # of MBLKS in Data Pool
DEFAULT NUM_DAT_CLBLKS
TYPE uint
}
I have tried to add NUM_DAT_CLBLKS and NUM_NET_MBLKS parameters to my project.wpj (workbench) setting file and to my surprise the prjParams.h file generated doesnt have these new params.
My question is,does VxWorks process .cdf files during the build process, and if so, how are these parameters included in the final configuration? Is modifying NUM_DAT_CLBLKS sufficient to resolve network buffer exhaustion, or should I also adjust related parameters such as NUM_DAT_MBLKS? Any help regarding would be greatly appreciated! Thanks!!!