DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Problem in configuring buffer size of a memory pool
@ 2017-02-09  6:38 Karthikraj palanichamy
  2017-02-09  9:19 ` Bruce Richardson
  0 siblings, 1 reply; 3+ messages in thread
From: Karthikraj palanichamy @ 2017-02-09  6:38 UTC (permalink / raw)
  To: dev

Hi developers,

For /`rte_pktmbuf_pool_create()`, /I normally provide 
RTE_MBUF_DEFAULT_BUF_SIZE as the data room size.

I needed to change this dynamically based on the frame size to be 
transmitted.
To transmit 80 bytes frames, I configured (80 +/RTE_PKTMBUF_HEADROOM/). 
There was no problem and transmission was successful.

Then I will do `rte_mempool_free()` and create mem pool again whenever 
needed.

So, my code flow is /create mempool -> transmit pkts -> free mempool/

When I do this for 3 to 5 times, I get segmentation fault in the 
transmission API of the PMD. - 'eth_igb_xmit_pkts' for igb PMD and  
'ixgbe_xmit_pkts_vec()' for ixgbe PMD.

Thanks in advance for your help.

Regards
Karthik

DISCLAIMER: Privileged and/or Confidential information may be
contained in this message. If you are not the addressee of this message,
you may not copy, use or deliver this message to anyone. In such
event,you should destroy the message and kindly notify the sender by
reply e-mail.
It is understood that opinions or conclusions that do not relate to the
official business of the company are neither given nor endorsed by the
company.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] Problem in configuring buffer size of a memory pool
  2017-02-09  6:38 [dpdk-dev] Problem in configuring buffer size of a memory pool Karthikraj palanichamy
@ 2017-02-09  9:19 ` Bruce Richardson
  2017-02-09 10:11   ` Karthikraj palanichamy
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2017-02-09  9:19 UTC (permalink / raw)
  To: Karthikraj palanichamy; +Cc: dev

On Thu, Feb 09, 2017 at 12:08:54PM +0530, Karthikraj palanichamy wrote:
> Hi developers,
> 
> For /`rte_pktmbuf_pool_create()`, /I normally provide
> RTE_MBUF_DEFAULT_BUF_SIZE as the data room size.
> 
> I needed to change this dynamically based on the frame size to be
> transmitted.
> To transmit 80 bytes frames, I configured (80 +/RTE_PKTMBUF_HEADROOM/).
> There was no problem and transmission was successful.
> 
> Then I will do `rte_mempool_free()` and create mem pool again whenever
> needed.
> 
> So, my code flow is /create mempool -> transmit pkts -> free mempool/
> 
> When I do this for 3 to 5 times, I get segmentation fault in the
> transmission API of the PMD. - 'eth_igb_xmit_pkts' for igb PMD and
> 'ixgbe_xmit_pkts_vec()' for ixgbe PMD.
> 
> Thanks in advance for your help.
> 
I think you'll need to stop the transmit ports and possibly destroy and 
recreate the TX queues too. What may be happening is that packet buffers
are remaining on the TX ring after transmit, and then when being freed
to make room for new packet buffers to be transmitted, the mempool to
which they are to be freed no longer exists.

> Regards
> Karthik
> 
> DISCLAIMER: Privileged and/or Confidential information may be
> contained in this message. If you are not the addressee of this message,
> you may not copy, use or deliver this message to anyone. In such
> event,you should destroy the message and kindly notify the sender by
> reply e-mail.
> It is understood that opinions or conclusions that do not relate to the
> official business of the company are neither given nor endorsed by the
> company.
> 

Since this is a public mailing list, please remove this disclaimer as
the email cannot be private.

/Bruce

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] Problem in configuring buffer size of a memory pool
  2017-02-09  9:19 ` Bruce Richardson
@ 2017-02-09 10:11   ` Karthikraj palanichamy
  0 siblings, 0 replies; 3+ messages in thread
From: Karthikraj palanichamy @ 2017-02-09 10:11 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

Thanks for the help.

I couldn't stop or close the device/port since Rx is a continuous 
process with a separate mempool.
I'm creating dynamic mempools only for Tx.

Tried stopping the Tx queue 'rte_eth_dev_tx_queue_stop()' after freeing 
the mempool. Created mempool again and then started the tx queue.

Still observing the same problem.

Regards
Karthik

On 02/09/2017 02:49 PM, Bruce Richardson wrote:
> On Thu, Feb 09, 2017 at 12:08:54PM +0530, Karthikraj palanichamy wrote:
>> Hi developers,
>>
>> For /`rte_pktmbuf_pool_create()`, /I normally provide
>> RTE_MBUF_DEFAULT_BUF_SIZE as the data room size.
>>
>> I needed to change this dynamically based on the frame size to be
>> transmitted.
>> To transmit 80 bytes frames, I configured (80 +/RTE_PKTMBUF_HEADROOM/).
>> There was no problem and transmission was successful.
>>
>> Then I will do `rte_mempool_free()` and create mem pool again whenever
>> needed.
>>
>> So, my code flow is /create mempool -> transmit pkts -> free mempool/
>>
>> When I do this for 3 to 5 times, I get segmentation fault in the
>> transmission API of the PMD. - 'eth_igb_xmit_pkts' for igb PMD and
>> 'ixgbe_xmit_pkts_vec()' for ixgbe PMD.
>>
>> Thanks in advance for your help.
>>
> I think you'll need to stop the transmit ports and possibly destroy and
> recreate the TX queues too. What may be happening is that packet buffers
> are remaining on the TX ring after transmit, and then when being freed
> to make room for new packet buffers to be transmitted, the mempool to
> which they are to be freed no longer exists.
>
>> Regards
>> Karthik
>>
>> DISCLAIMER: Privileged and/or Confidential information may be
>> contained in this message. If you are not the addressee of this message,
>> you may not copy, use or deliver this message to anyone. In such
>> event,you should destroy the message and kindly notify the sender by
>> reply e-mail.
>> It is understood that opinions or conclusions that do not relate to the
>> official business of the company are neither given nor endorsed by the
>> company.
>>
> Since this is a public mailing list, please remove this disclaimer as
> the email cannot be private.
>
> /Bruce
>


DISCLAIMER: Privileged and/or Confidential information may be
contained in this message. If you are not the addressee of this message,
you may not copy, use or deliver this message to anyone. In such
event,you should destroy the message and kindly notify the sender by
reply e-mail.
It is understood that opinions or conclusions that do not relate to the
official business of the company are neither given nor endorsed by the
company.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-09 10:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09  6:38 [dpdk-dev] Problem in configuring buffer size of a memory pool Karthikraj palanichamy
2017-02-09  9:19 ` Bruce Richardson
2017-02-09 10:11   ` Karthikraj palanichamy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).