DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] Freeing up Mbuf
@ 2016-12-22 16:47 Kumaraparameshwaran Rathnavel
  2016-12-22 17:00 ` Take Ceara
  2016-12-23  3:54 ` Anupam Kapoor
  0 siblings, 2 replies; 5+ messages in thread
From: Kumaraparameshwaran Rathnavel @ 2016-12-22 16:47 UTC (permalink / raw)
  To: users

Hi All,

The mbuf implementation is similar to the Network Driver of the FreeBSD Network Driver. In DPDK userspace driver it is the responsibility of the rte_eth_dev implementation to free the memory buffer associated with a Queue when descriptors reach below a threshold. In FreeBSD the user can actually specify the free routine for the mbuf when the transmit routine is called. Is this implemented in DPDK. I basically will give the data buffer of the application layer that will be chained with the Transport Layer Headers and I do not want to free up the routines always. Is this possible?

Thanking You,
Param.

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

* Re: [dpdk-users] Freeing up Mbuf
  2016-12-22 16:47 [dpdk-users] Freeing up Mbuf Kumaraparameshwaran Rathnavel
@ 2016-12-22 17:00 ` Take Ceara
  2016-12-24  4:53   ` Kumaraparameshwaran Rathnavel
  2016-12-23  3:54 ` Anupam Kapoor
  1 sibling, 1 reply; 5+ messages in thread
From: Take Ceara @ 2016-12-22 17:00 UTC (permalink / raw)
  To: Kumaraparameshwaran Rathnavel; +Cc: users

Hi Param,

On Thu, Dec 22, 2016 at 5:47 PM, Kumaraparameshwaran Rathnavel
<krath@cloudsimple.com> wrote:
> Hi All,
>
> The mbuf implementation is similar to the Network Driver of the FreeBSD Network Driver. In DPDK userspace driver it is the responsibility of the rte_eth_dev implementation to free the memory buffer associated with a Queue when descriptors reach below a threshold. In FreeBSD the user can actually specify the free routine for the mbuf when the transmit routine is called. Is this implemented in DPDK. I basically will give the data buffer of the application layer that will be chained with the Transport Layer Headers and I do not want to free up the routines always. Is this possible?

You can send a clone of the mbuf (see rte_pktmbuf_clone). Cloning the
mbuf will increase the refcount of the direct mbuf (that stores the
actual data). When the driver is done transmitting the clone it will
decrement the refcount and only free the direct mbuf if the refcount
is 0 (see rte_pktmbuf_free_seg and __rte_pktmbuf_prefree_seg).

However, you need to be careful if you plan to change the data stored
in the direct mbuf and make sure there are no more clones of the data
pending transmission.

>
> Thanking You,
> Param.

Regards,
Dumitru

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

* Re: [dpdk-users] Freeing up Mbuf
  2016-12-22 16:47 [dpdk-users] Freeing up Mbuf Kumaraparameshwaran Rathnavel
  2016-12-22 17:00 ` Take Ceara
@ 2016-12-23  3:54 ` Anupam Kapoor
  2016-12-23 16:28   ` Wiles, Keith
  1 sibling, 1 reply; 5+ messages in thread
From: Anupam Kapoor @ 2016-12-23  3:54 UTC (permalink / raw)
  To: Kumaraparameshwaran Rathnavel; +Cc: users

On Thu, Dec 22, 2016 at 10:17 PM, Kumaraparameshwaran Rathnavel <
krath@cloudsimple.com> wrote:

> In FreeBSD the user can actually specify the free routine for the mbuf
> when the transmit routine is called. Is this implemented in DPDK.


​currently, afaik, dpdk ​does not provide this functionality. basically,
there is no way to poll the tx-ring for consumed buffers. or to put it
another way, rte_eth_tx_burst doesn't synchronously transmit the packets.

​--
kind regards
anupam​


In the beginning was the lambda, and the lambda was with Emacs, and Emacs
was the lambda.

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

* Re: [dpdk-users] Freeing up Mbuf
  2016-12-23  3:54 ` Anupam Kapoor
@ 2016-12-23 16:28   ` Wiles, Keith
  0 siblings, 0 replies; 5+ messages in thread
From: Wiles, Keith @ 2016-12-23 16:28 UTC (permalink / raw)
  To: Anupam Kapoor; +Cc: Kumaraparameshwaran Rathnavel, users


> On Dec 22, 2016, at 9:54 PM, Anupam Kapoor <anupam.kapoor@gmail.com> wrote:
> 
> On Thu, Dec 22, 2016 at 10:17 PM, Kumaraparameshwaran Rathnavel <
> krath@cloudsimple.com> wrote:
> 
>> In FreeBSD the user can actually specify the free routine for the mbuf
>> when the transmit routine is called. Is this implemented in DPDK.
> 
> 
> ​currently, afaik, dpdk ​does not provide this functionality. basically,
> there is no way to poll the tx-ring for consumed buffers. or to put it
> another way, rte_eth_tx_burst doesn't synchronously transmit the packets.

A new patch set is being add to support flushing of the tx done ring. Only a couple to PMDs have support today, but more should be coming or you can add a patch to support your NIC.

http://dpdk.org/ml/archives/dev/2016-November/050444.html

> 
> ​--
> kind regards
> anupam​
> 
> 
> In the beginning was the lambda, and the lambda was with Emacs, and Emacs
> was the lambda.

Regards,
Keith


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

* Re: [dpdk-users] Freeing up Mbuf
  2016-12-22 17:00 ` Take Ceara
@ 2016-12-24  4:53   ` Kumaraparameshwaran Rathnavel
  0 siblings, 0 replies; 5+ messages in thread
From: Kumaraparameshwaran Rathnavel @ 2016-12-24  4:53 UTC (permalink / raw)
  To: Take Ceara; +Cc: users

Hi Dumitru,

Thankyou for the response. The rte_pktmbuf_clone routine allocates a new mbuf right?  I see that it allocated a newmbuf from the specified pool.

Thanking You,
Param.
> On 22-Dec-2016, at 10:30 PM, Take Ceara <dumitru.ceara@gmail.com> wrote:
> 
> Hi Param,
> 
> On Thu, Dec 22, 2016 at 5:47 PM, Kumaraparameshwaran Rathnavel
> <krath@cloudsimple.com> wrote:
>> Hi All,
>> 
>> The mbuf implementation is similar to the Network Driver of the FreeBSD Network Driver. In DPDK userspace driver it is the responsibility of the rte_eth_dev implementation to free the memory buffer associated with a Queue when descriptors reach below a threshold. In FreeBSD the user can actually specify the free routine for the mbuf when the transmit routine is called. Is this implemented in DPDK. I basically will give the data buffer of the application layer that will be chained with the Transport Layer Headers and I do not want to free up the routines always. Is this possible?
> 
> You can send a clone of the mbuf (see rte_pktmbuf_clone). Cloning the
> mbuf will increase the refcount of the direct mbuf (that stores the
> actual data). When the driver is done transmitting the clone it will
> decrement the refcount and only free the direct mbuf if the refcount
> is 0 (see rte_pktmbuf_free_seg and __rte_pktmbuf_prefree_seg).
> 
> However, you need to be careful if you plan to change the data stored
> in the direct mbuf and make sure there are no more clones of the data
> pending transmission.
> 
>> 
>> Thanking You,
>> Param.
> 
> Regards,
> Dumitru

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

end of thread, other threads:[~2016-12-24  4:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-22 16:47 [dpdk-users] Freeing up Mbuf Kumaraparameshwaran Rathnavel
2016-12-22 17:00 ` Take Ceara
2016-12-24  4:53   ` Kumaraparameshwaran Rathnavel
2016-12-23  3:54 ` Anupam Kapoor
2016-12-23 16:28   ` Wiles, Keith

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).