DPDK patches and discussions
 help / color / mirror / Atom feed
* Can I use rte_pktmbuf_chain to chain multiple mbuffs for calling only single tx_eth_burst API
@ 2022-02-09 18:03 Ansar Kannankattil
  2022-02-09 20:56 ` Stephen Hemminger
  2022-02-09 22:18 ` Ferruh Yigit
  0 siblings, 2 replies; 8+ messages in thread
From: Ansar Kannankattil @ 2022-02-09 18:03 UTC (permalink / raw)
  To: dev

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

Hi
My intention is to decrease the number of rte_tx_eth_burst calls, I know
that mentioning nb_pkts will result in sending multiple packets in a single
call.
But providing nb_pkts=1 and posting a head mbuff having number of
mbuffs linked with it will results sending multiple packets
If not, what is the use case of linking multiple mbuffs together

[-- Attachment #2: Type: text/html, Size: 406 bytes --]

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

* Re: Can I use rte_pktmbuf_chain to chain multiple mbuffs for calling only single tx_eth_burst API
  2022-02-09 18:03 Can I use rte_pktmbuf_chain to chain multiple mbuffs for calling only single tx_eth_burst API Ansar Kannankattil
@ 2022-02-09 20:56 ` Stephen Hemminger
  2022-02-09 22:18 ` Ferruh Yigit
  1 sibling, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2022-02-09 20:56 UTC (permalink / raw)
  To: Ansar Kannankattil; +Cc: dev

On Wed, 9 Feb 2022 23:33:13 +0530
Ansar Kannankattil <ansarkannankat@gmail.com> wrote:

> Hi
> My intention is to decrease the number of rte_tx_eth_burst calls, I know
> that mentioning nb_pkts will result in sending multiple packets in a single
> call.
> But providing nb_pkts=1 and posting a head mbuff having number of
> mbuffs linked with it will results sending multiple packets
> If not, what is the use case of linking multiple mbuffs together

It doesn't work that way.
tx_burst takes an array, not a chain.

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

* Re: Can I use rte_pktmbuf_chain to chain multiple mbuffs for calling only single tx_eth_burst API
  2022-02-09 18:03 Can I use rte_pktmbuf_chain to chain multiple mbuffs for calling only single tx_eth_burst API Ansar Kannankattil
  2022-02-09 20:56 ` Stephen Hemminger
@ 2022-02-09 22:18 ` Ferruh Yigit
  2022-02-09 22:46   ` Stephen Hemminger
  1 sibling, 1 reply; 8+ messages in thread
From: Ferruh Yigit @ 2022-02-09 22:18 UTC (permalink / raw)
  To: Ansar Kannankattil, dev

On 2/9/2022 6:03 PM, Ansar Kannankattil wrote:
> Hi
> My intention is to decrease the number of rte_tx_eth_burst calls, I know that mentioning nb_pkts will result in sending multiple packets in a single call.
> But providing nb_pkts=1 and posting a head mbuff having number of mbuffs linked with it will results sending multiple packets

If driver supports, you can do it.
Driver should expose this capability via RTE_ETH_TX_OFFLOAD_MULTI_SEGS flag,
in 'dev_info->tx_offload_capa'.

> If not, what is the use case of linking multiple mbuffs together

It is also used in Rx path (again if driver supports).

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

* Re: Can I use rte_pktmbuf_chain to chain multiple mbuffs for calling only single tx_eth_burst API
  2022-02-09 22:18 ` Ferruh Yigit
@ 2022-02-09 22:46   ` Stephen Hemminger
  2022-02-10  8:56     ` Ferruh Yigit
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2022-02-09 22:46 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Ansar Kannankattil, dev

On Wed, 9 Feb 2022 22:18:24 +0000
Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 2/9/2022 6:03 PM, Ansar Kannankattil wrote:
> > Hi
> > My intention is to decrease the number of rte_tx_eth_burst calls, I know that mentioning nb_pkts will result in sending multiple packets in a single call.
> > But providing nb_pkts=1 and posting a head mbuff having number of mbuffs linked with it will results sending multiple packets  
> 
> If driver supports, you can do it.
> Driver should expose this capability via RTE_ETH_TX_OFFLOAD_MULTI_SEGS flag,
> in 'dev_info->tx_offload_capa'.
> 
> > If not, what is the use case of linking multiple mbuffs together  
> 
> It is also used in Rx path (again if driver supports).

I think Ansar was asking about chaining multiple packets in one call to tx burst.
The chaining in DPDK is to make a single packet out of multiple pieces (like writev).

DPDK mbufs were based on original BSD concept.
In BSD mbufs, mbuf has two linked lists.
  BSD m->m_next pointer == DPDK m->next  for multiple parts of packet.
  BSD m->m_nextpkt                       for next packet in queue

There is no nextpkt in DPDK.

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

* Re: Can I use rte_pktmbuf_chain to chain multiple mbuffs for calling only single tx_eth_burst API
  2022-02-09 22:46   ` Stephen Hemminger
@ 2022-02-10  8:56     ` Ferruh Yigit
  2022-02-10 10:37       ` Ansar Kannankattil
  0 siblings, 1 reply; 8+ messages in thread
From: Ferruh Yigit @ 2022-02-10  8:56 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Ansar Kannankattil, dev

On 2/9/2022 10:46 PM, Stephen Hemminger wrote:
> On Wed, 9 Feb 2022 22:18:24 +0000
> Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
>> On 2/9/2022 6:03 PM, Ansar Kannankattil wrote:
>>> Hi
>>> My intention is to decrease the number of rte_tx_eth_burst calls, I know that mentioning nb_pkts will result in sending multiple packets in a single call.
>>> But providing nb_pkts=1 and posting a head mbuff having number of mbuffs linked with it will results sending multiple packets
>>
>> If driver supports, you can do it.
>> Driver should expose this capability via RTE_ETH_TX_OFFLOAD_MULTI_SEGS flag,
>> in 'dev_info->tx_offload_capa'.
>>
>>> If not, what is the use case of linking multiple mbuffs together
>>
>> It is also used in Rx path (again if driver supports).
> 
> I think Ansar was asking about chaining multiple packets in one call to tx burst.
> The chaining in DPDK is to make a single packet out of multiple pieces (like writev).
> 
> DPDK mbufs were based on original BSD concept.
> In BSD mbufs, mbuf has two linked lists.
>    BSD m->m_next pointer == DPDK m->next  for multiple parts of packet.
>    BSD m->m_nextpkt                       for next packet in queue
> 
> There is no nextpkt in DPDK.

Right, chaining mbufs is for segmented packets.

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

* Re: Can I use rte_pktmbuf_chain to chain multiple mbuffs for calling only single tx_eth_burst API
  2022-02-10  8:56     ` Ferruh Yigit
@ 2022-02-10 10:37       ` Ansar Kannankattil
  2022-02-10 10:43         ` Ferruh Yigit
  2022-02-10 11:36         ` Bruce Richardson
  0 siblings, 2 replies; 8+ messages in thread
From: Ansar Kannankattil @ 2022-02-10 10:37 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Stephen Hemminger, dev

[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]

Thanks for the responses,
Then what is the advantage of chaining mbuffs over using the mbuff array?

On Thu, Feb 10, 2022 at 2:26 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 2/9/2022 10:46 PM, Stephen Hemminger wrote:
> > On Wed, 9 Feb 2022 22:18:24 +0000
> > Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> >
> >> On 2/9/2022 6:03 PM, Ansar Kannankattil wrote:
> >>> Hi
> >>> My intention is to decrease the number of rte_tx_eth_burst calls, I
> know that mentioning nb_pkts will result in sending multiple packets in a
> single call.
> >>> But providing nb_pkts=1 and posting a head mbuff having number of
> mbuffs linked with it will results sending multiple packets
> >>
> >> If driver supports, you can do it.
> >> Driver should expose this capability via RTE_ETH_TX_OFFLOAD_MULTI_SEGS
> flag,
> >> in 'dev_info->tx_offload_capa'.
> >>
> >>> If not, what is the use case of linking multiple mbuffs together
> >>
> >> It is also used in Rx path (again if driver supports).
> >
> > I think Ansar was asking about chaining multiple packets in one call to
> tx burst.
> > The chaining in DPDK is to make a single packet out of multiple pieces
> (like writev).
> >
> > DPDK mbufs were based on original BSD concept.
> > In BSD mbufs, mbuf has two linked lists.
> >    BSD m->m_next pointer == DPDK m->next  for multiple parts of packet.
> >    BSD m->m_nextpkt                       for next packet in queue
> >
> > There is no nextpkt in DPDK.
>
> Right, chaining mbufs is for segmented packets.
>

[-- Attachment #2: Type: text/html, Size: 2104 bytes --]

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

* Re: Can I use rte_pktmbuf_chain to chain multiple mbuffs for calling only single tx_eth_burst API
  2022-02-10 10:37       ` Ansar Kannankattil
@ 2022-02-10 10:43         ` Ferruh Yigit
  2022-02-10 11:36         ` Bruce Richardson
  1 sibling, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2022-02-10 10:43 UTC (permalink / raw)
  To: Ansar Kannankattil; +Cc: Stephen Hemminger, dev

On 2/10/2022 10:37 AM, Ansar Kannankattil wrote:

moved down, please avoid top post

> On Thu, Feb 10, 2022 at 2:26 PM Ferruh Yigit <ferruh.yigit@intel.com <mailto:ferruh.yigit@intel.com>> wrote:
> 
>     On 2/9/2022 10:46 PM, Stephen Hemminger wrote:
>      > On Wed, 9 Feb 2022 22:18:24 +0000
>      > Ferruh Yigit <ferruh.yigit@intel.com <mailto:ferruh.yigit@intel.com>> wrote:
>      >
>      >> On 2/9/2022 6:03 PM, Ansar Kannankattil wrote:
>      >>> Hi
>      >>> My intention is to decrease the number of rte_tx_eth_burst calls, I know that mentioning nb_pkts will result in sending multiple packets in a single call.
>      >>> But providing nb_pkts=1 and posting a head mbuff having number of mbuffs linked with it will results sending multiple packets
>      >>
>      >> If driver supports, you can do it.
>      >> Driver should expose this capability via RTE_ETH_TX_OFFLOAD_MULTI_SEGS flag,
>      >> in 'dev_info->tx_offload_capa'.
>      >>
>      >>> If not, what is the use case of linking multiple mbuffs together
>      >>
>      >> It is also used in Rx path (again if driver supports).
>      >
>      > I think Ansar was asking about chaining multiple packets in one call to tx burst.
>      > The chaining in DPDK is to make a single packet out of multiple pieces (like writev).
>      >
>      > DPDK mbufs were based on original BSD concept.
>      > In BSD mbufs, mbuf has two linked lists.
>      >    BSD m->m_next pointer == DPDK m->next  for multiple parts of packet.
>      >    BSD m->m_nextpkt                       for next packet in queue
>      >
>      > There is no nextpkt in DPDK.
> 
>     Right, chaining mbufs is for segmented packets.
> 
> 
> Thanks for the responses,
> Then what is the advantage of chaining mbuffs over using the mbuff array?
> 

If you have small packet buffer, mbufs can be chained to represent a big packet.
Or scattered buffers can be used to represent a packet by chaining.

Array is used to represent different packets.

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

* Re: Can I use rte_pktmbuf_chain to chain multiple mbuffs for calling only single tx_eth_burst API
  2022-02-10 10:37       ` Ansar Kannankattil
  2022-02-10 10:43         ` Ferruh Yigit
@ 2022-02-10 11:36         ` Bruce Richardson
  1 sibling, 0 replies; 8+ messages in thread
From: Bruce Richardson @ 2022-02-10 11:36 UTC (permalink / raw)
  To: Ansar Kannankattil; +Cc: Ferruh Yigit, Stephen Hemminger, dev

On Thu, Feb 10, 2022 at 04:07:02PM +0530, Ansar Kannankattil wrote:
>    Thanks for the responses,
>    Then what is the advantage of chaining mbuffs over using the mbuff
>    array?
> 
They imply different things.
* An array of mbufs represents multiple packets.
* A chain of mbufs is a single packet.

Therefore, an array of three mbuf pointers always represents 3 packets.
Each one of the mbufs pointed to from that array may have multiple segments
i.e. chained via the next pointers, but that chain is still a single
packet.

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

end of thread, other threads:[~2022-02-10 11:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09 18:03 Can I use rte_pktmbuf_chain to chain multiple mbuffs for calling only single tx_eth_burst API Ansar Kannankattil
2022-02-09 20:56 ` Stephen Hemminger
2022-02-09 22:18 ` Ferruh Yigit
2022-02-09 22:46   ` Stephen Hemminger
2022-02-10  8:56     ` Ferruh Yigit
2022-02-10 10:37       ` Ansar Kannankattil
2022-02-10 10:43         ` Ferruh Yigit
2022-02-10 11:36         ` Bruce Richardson

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