DPDK usage discussions
 help / color / mirror / Atom feed
* reuse the packets after tx burst
@ 2024-08-12 10:25 Lokesh Chakka
  2024-08-12 14:52 ` Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: Lokesh Chakka @ 2024-08-12 10:25 UTC (permalink / raw)
  To: users

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

hello,

Here is a small piece of code :

while( condition )
{

	if( rte_eth_tx_burst( port_id, 0, mbuf, num_of_pkts_per_queue ) !=
num_of_pkts_per_queue )
	{
		fprintf( stderr, "%d %s\n", rte_errno, rte_strerror(rte_errno) );
		rte_exit( EXIT_FAILURE, "%s %d rte_eth_tx_burst port id: %u\n",
__func__, __LINE__, port_id );//second iteration failing.
	}
	fprintf( stderr, "%s %d port: %u packet: %c sent %u packets\n",
__func__, __LINE__, port_id, argv[3][0], num_of_pkts_per_queue
);//printing once
	for( pkt_count=0; pkt_count<num_of_pkts_per_queue; pkt_count++ )
	{//want to send same data again...!!!
		mbuf[pkt_count]->pkt_len = mbuf[pkt_count]->data_len = dev_info.max_mtu;

	}

}

Can someone help me understand how to reuse the packets again to send the
same data ?

Thanks & Regards
--
Lokesh Chakka.

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

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

* Re: reuse the packets after tx burst
  2024-08-12 10:25 reuse the packets after tx burst Lokesh Chakka
@ 2024-08-12 14:52 ` Stephen Hemminger
  2024-08-14 12:27   ` Lokesh Chakka
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2024-08-12 14:52 UTC (permalink / raw)
  To: Lokesh Chakka; +Cc: users

On Mon, 12 Aug 2024 15:55:50 +0530
Lokesh Chakka <lvenkatakumarchakka@gmail.com> wrote:

> hello,
> 
> Here is a small piece of code :
> 
> while( condition )
> {
> 
> 	if( rte_eth_tx_burst( port_id, 0, mbuf, num_of_pkts_per_queue ) !=
> num_of_pkts_per_queue )
> 	{
> 		fprintf( stderr, "%d %s\n", rte_errno, rte_strerror(rte_errno) );
> 		rte_exit( EXIT_FAILURE, "%s %d rte_eth_tx_burst port id: %u\n",
> __func__, __LINE__, port_id );//second iteration failing.
> 	}
> 	fprintf( stderr, "%s %d port: %u packet: %c sent %u packets\n",
> __func__, __LINE__, port_id, argv[3][0], num_of_pkts_per_queue
> );//printing once
> 	for( pkt_count=0; pkt_count<num_of_pkts_per_queue; pkt_count++ )
> 	{//want to send same data again...!!!
> 		mbuf[pkt_count]->pkt_len = mbuf[pkt_count]->data_len = dev_info.max_mtu;
> 
> 	}
> 
> }
> 
> Can someone help me understand how to reuse the packets again to send the
> same data ?
> 

When packet is passed to tx_burst, the ownership of that mbuf is passed
to the driver. The driver will free it after it is sent.

One option would be to increase the reference count on the packet before sending.
Using rte_mbuf_refcnt_update() function to add one to refcount.
Then the driver will decrement refcount and the refcount will still be one (not freed).

Assume this is some kind of packet generator.

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

* Re: reuse the packets after tx burst
  2024-08-12 14:52 ` Stephen Hemminger
@ 2024-08-14 12:27   ` Lokesh Chakka
  2024-08-14 14:59     ` Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: Lokesh Chakka @ 2024-08-14 12:27 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

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

hi stephen,

Thanks for your response. However it seems the solution is not working. The
following is the modified snippet....

while( condition )
{
     for( pkt_count=0; pkt_count<num_of_pkts_per_queue; pkt_count++ )
     {
          rte_mbuf_refcnt_set( mbuf[pkt_count], 2 );// setting to two -
first and second iteration
     }
     for( pkt_count=0; pkt_count<5; pkt_count++ )
     {
          fprintf( stderr, "%s %d %u\n", __func__, __LINE__,
rte_mbuf_refcnt_read( mbuf[pkt_count] ) );//able to print two- first and
second iteration
     }
     if( rte_eth_tx_burst( port_id, 0, mbuf, num_of_pkts_per_queue ) !=
num_of_pkts_per_queue )
     {
          fprintf( stderr, "%s %d %d %s\n", __func__, __LINE__, rte_errno,
rte_strerror(rte_errno) );//failing second time
          rte_exit( EXIT_FAILURE, "%s %d rte_eth_tx_burst port id: %u\n",
__func__, __LINE__, port_id );
     }
     fprintf( stderr, "%s %d port: %u sent %u packets\n", __func__,
__LINE__, port_id, num_of_pkts_per_queue );//able to send once - first
iteration only
     for( pkt_count=0; pkt_count<5; pkt_count++ )
     {
          fprintf( stderr, "%s %d %u\n", __func__, __LINE__,
rte_mbuf_refcnt_read( mbuf[pkt_count] ) );//refcnt is printing one
     }
}

There seems to be some more gap in my understanding. Could you please help
understand the issue?

Thanks & Regards
--
Lokesh Chakka.


On Mon, Aug 12, 2024 at 8:22 PM Stephen Hemminger <
stephen@networkplumber.org> wrote:

> On Mon, 12 Aug 2024 15:55:50 +0530
> Lokesh Chakka <lvenkatakumarchakka@gmail.com> wrote:
>
> > hello,
> >
> > Here is a small piece of code :
> >
> > while( condition )
> > {
> >
> >       if( rte_eth_tx_burst( port_id, 0, mbuf, num_of_pkts_per_queue ) !=
> > num_of_pkts_per_queue )
> >       {
> >               fprintf( stderr, "%d %s\n", rte_errno,
> rte_strerror(rte_errno) );
> >               rte_exit( EXIT_FAILURE, "%s %d rte_eth_tx_burst port id:
> %u\n",
> > __func__, __LINE__, port_id );//second iteration failing.
> >       }
> >       fprintf( stderr, "%s %d port: %u packet: %c sent %u packets\n",
> > __func__, __LINE__, port_id, argv[3][0], num_of_pkts_per_queue
> > );//printing once
> >       for( pkt_count=0; pkt_count<num_of_pkts_per_queue; pkt_count++ )
> >       {//want to send same data again...!!!
> >               mbuf[pkt_count]->pkt_len = mbuf[pkt_count]->data_len =
> dev_info.max_mtu;
> >
> >       }
> >
> > }
> >
> > Can someone help me understand how to reuse the packets again to send the
> > same data ?
> >
>
> When packet is passed to tx_burst, the ownership of that mbuf is passed
> to the driver. The driver will free it after it is sent.
>
> One option would be to increase the reference count on the packet before
> sending.
> Using rte_mbuf_refcnt_update() function to add one to refcount.
> Then the driver will decrement refcount and the refcount will still be one
> (not freed).
>
> Assume this is some kind of packet generator.
>

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

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

* Re: reuse the packets after tx burst
  2024-08-14 12:27   ` Lokesh Chakka
@ 2024-08-14 14:59     ` Stephen Hemminger
  2024-08-15 16:18       ` Lokesh Chakka
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2024-08-14 14:59 UTC (permalink / raw)
  To: Lokesh Chakka; +Cc: users

On Wed, 14 Aug 2024 17:57:40 +0530
Lokesh Chakka <lvenkatakumarchakka@gmail.com> wrote:

> hi stephen,
> 
> Thanks for your response. However it seems the solution is not working. The
> following is the modified snippet....
> 
> while( condition )
> {
>      for( pkt_count=0; pkt_count<num_of_pkts_per_queue; pkt_count++ )
>      {
>           rte_mbuf_refcnt_set( mbuf[pkt_count], 2 );// setting to two -
> first and second iteration
>      }
>      for( pkt_count=0; pkt_count<5; pkt_count++ )
>      {
>           fprintf( stderr, "%s %d %u\n", __func__, __LINE__,
> rte_mbuf_refcnt_read( mbuf[pkt_count] ) );//able to print two- first and
> second iteration
>      }
>      if( rte_eth_tx_burst( port_id, 0, mbuf, num_of_pkts_per_queue ) !=
> num_of_pkts_per_queue )
>      {
>           fprintf( stderr, "%s %d %d %s\n", __func__, __LINE__, rte_errno,
> rte_strerror(rte_errno) );//failing second time
>           rte_exit( EXIT_FAILURE, "%s %d rte_eth_tx_burst port id: %u\n",
> __func__, __LINE__, port_id );
>      }
>      fprintf( stderr, "%s %d port: %u sent %u packets\n", __func__,
> __LINE__, port_id, num_of_pkts_per_queue );//able to send once - first
> iteration only
>      for( pkt_count=0; pkt_count<5; pkt_count++ )
>      {
>           fprintf( stderr, "%s %d %u\n", __func__, __LINE__,
> rte_mbuf_refcnt_read( mbuf[pkt_count] ) );//refcnt is printing one
>      }
> }
> 
> There seems to be some more gap in my understanding. Could you please help
> understand the issue?
> 
> Thanks & Regards
> --
> Lokesh Chakka.
> 
> 
> On Mon, Aug 12, 2024 at 8:22 PM Stephen Hemminger <
> stephen@networkplumber.org> wrote:  
> 
> > On Mon, 12 Aug 2024 15:55:50 +0530
> > Lokesh Chakka <lvenkatakumarchakka@gmail.com> wrote:
> >  
> > > hello,
> > >
> > > Here is a small piece of code :
> > >
> > > while( condition )
> > > {
> > >
> > >       if( rte_eth_tx_burst( port_id, 0, mbuf, num_of_pkts_per_queue ) !=
> > > num_of_pkts_per_queue )
> > >       {
> > >               fprintf( stderr, "%d %s\n", rte_errno,  
> > rte_strerror(rte_errno) );  
> > >               rte_exit( EXIT_FAILURE, "%s %d rte_eth_tx_burst port id:  
> > %u\n",  
> > > __func__, __LINE__, port_id );//second iteration failing.
> > >       }
> > >       fprintf( stderr, "%s %d port: %u packet: %c sent %u packets\n",
> > > __func__, __LINE__, port_id, argv[3][0], num_of_pkts_per_queue
> > > );//printing once
> > >       for( pkt_count=0; pkt_count<num_of_pkts_per_queue; pkt_count++ )
> > >       {//want to send same data again...!!!
> > >               mbuf[pkt_count]->pkt_len = mbuf[pkt_count]->data_len =  
> > dev_info.max_mtu;  
> > >
> > >       }
> > >
> > > }
> > >
> > > Can someone help me understand how to reuse the packets again to send the
> > > same data ?
> > >  
> >
> > When packet is passed to tx_burst, the ownership of that mbuf is passed
> > to the driver. The driver will free it after it is sent.
> >
> > One option would be to increase the reference count on the packet before
> > sending.
> > Using rte_mbuf_refcnt_update() function to add one to refcount.
> > Then the driver will decrement refcount and the refcount will still be one
> > (not freed).
> >
> > Assume this is some kind of packet generator.
> >  


Don't use refcnt_set(), you want to add an additional refcount not force it to two.
The device driver may hold onto the mbuf for a while after it was passed to tx_burst
so can't assume a value of two.

If the number actually queued is less that the number requested, that means the device
transmit queue is now full. Need to handle that case.

Something like this might get you started:


volatile running = true;

void flood(uint16_t port_id, struct rte_mbufs *mbufs[], uint16_t num_pkts)
{

	while (running) {
		/* Add additional reference to retain the packets */
		for (uint16_t i = 0; i < num_pkts; i++)
			rte_mbuf_refcnt_update(mbufs[i], 1);

		uint16_t sent = rte_eth_tx_burst(port_id, queue_id, mbufs, num_pkts);

		if (sent < num_pkts) {
			/* device transmit queue was full, drop our reference */
			for (uint16_t i = sent; i < num_pkts; i++)
				rte_pktmbuf_free(mbufs[i]);
		}
	}

	/* Don't leak original version */
	rte_pktmbuf_free_bulk(mbufs, num_pkts);

}
			


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

* Re: reuse the packets after tx burst
  2024-08-14 14:59     ` Stephen Hemminger
@ 2024-08-15 16:18       ` Lokesh Chakka
  2024-08-16  7:12         ` Lokesh Chakka
  0 siblings, 1 reply; 6+ messages in thread
From: Lokesh Chakka @ 2024-08-15 16:18 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

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

Hi Stephen,

Thank you for the information.
It solved your problem.

Regards.
Lokesh.


On Wed, 14 Aug, 2024, 20:29 Stephen Hemminger, <stephen@networkplumber.org>
wrote:

> On Wed, 14 Aug 2024 17:57:40 +0530
> Lokesh Chakka <lvenkatakumarchakka@gmail.com> wrote:
>
> > hi stephen,
> >
> > Thanks for your response. However it seems the solution is not working.
> The
> > following is the modified snippet....
> >
> > while( condition )
> > {
> >      for( pkt_count=0; pkt_count<num_of_pkts_per_queue; pkt_count++ )
> >      {
> >           rte_mbuf_refcnt_set( mbuf[pkt_count], 2 );// setting to two -
> > first and second iteration
> >      }
> >      for( pkt_count=0; pkt_count<5; pkt_count++ )
> >      {
> >           fprintf( stderr, "%s %d %u\n", __func__, __LINE__,
> > rte_mbuf_refcnt_read( mbuf[pkt_count] ) );//able to print two- first and
> > second iteration
> >      }
> >      if( rte_eth_tx_burst( port_id, 0, mbuf, num_of_pkts_per_queue ) !=
> > num_of_pkts_per_queue )
> >      {
> >           fprintf( stderr, "%s %d %d %s\n", __func__, __LINE__,
> rte_errno,
> > rte_strerror(rte_errno) );//failing second time
> >           rte_exit( EXIT_FAILURE, "%s %d rte_eth_tx_burst port id: %u\n",
> > __func__, __LINE__, port_id );
> >      }
> >      fprintf( stderr, "%s %d port: %u sent %u packets\n", __func__,
> > __LINE__, port_id, num_of_pkts_per_queue );//able to send once - first
> > iteration only
> >      for( pkt_count=0; pkt_count<5; pkt_count++ )
> >      {
> >           fprintf( stderr, "%s %d %u\n", __func__, __LINE__,
> > rte_mbuf_refcnt_read( mbuf[pkt_count] ) );//refcnt is printing one
> >      }
> > }
> >
> > There seems to be some more gap in my understanding. Could you please
> help
> > understand the issue?
> >
> > Thanks & Regards
> > --
> > Lokesh Chakka.
> >
> >
> > On Mon, Aug 12, 2024 at 8:22 PM Stephen Hemminger <
> > stephen@networkplumber.org> wrote:
> >
> > > On Mon, 12 Aug 2024 15:55:50 +0530
> > > Lokesh Chakka <lvenkatakumarchakka@gmail.com> wrote:
> > >
> > > > hello,
> > > >
> > > > Here is a small piece of code :
> > > >
> > > > while( condition )
> > > > {
> > > >
> > > >       if( rte_eth_tx_burst( port_id, 0, mbuf, num_of_pkts_per_queue
> ) !=
> > > > num_of_pkts_per_queue )
> > > >       {
> > > >               fprintf( stderr, "%d %s\n", rte_errno,
> > > rte_strerror(rte_errno) );
> > > >               rte_exit( EXIT_FAILURE, "%s %d rte_eth_tx_burst port
> id:
> > > %u\n",
> > > > __func__, __LINE__, port_id );//second iteration failing.
> > > >       }
> > > >       fprintf( stderr, "%s %d port: %u packet: %c sent %u packets\n",
> > > > __func__, __LINE__, port_id, argv[3][0], num_of_pkts_per_queue
> > > > );//printing once
> > > >       for( pkt_count=0; pkt_count<num_of_pkts_per_queue; pkt_count++
> )
> > > >       {//want to send same data again...!!!
> > > >               mbuf[pkt_count]->pkt_len = mbuf[pkt_count]->data_len
> =
> > > dev_info.max_mtu;
> > > >
> > > >       }
> > > >
> > > > }
> > > >
> > > > Can someone help me understand how to reuse the packets again to
> send the
> > > > same data ?
> > > >
> > >
> > > When packet is passed to tx_burst, the ownership of that mbuf is passed
> > > to the driver. The driver will free it after it is sent.
> > >
> > > One option would be to increase the reference count on the packet
> before
> > > sending.
> > > Using rte_mbuf_refcnt_update() function to add one to refcount.
> > > Then the driver will decrement refcount and the refcount will still be
> one
> > > (not freed).
> > >
> > > Assume this is some kind of packet generator.
> > >
>
>
> Don't use refcnt_set(), you want to add an additional refcount not force
> it to two.
> The device driver may hold onto the mbuf for a while after it was passed
> to tx_burst
> so can't assume a value of two.
>
> If the number actually queued is less that the number requested, that
> means the device
> transmit queue is now full. Need to handle that case.
>
> Something like this might get you started:
>
>
> volatile running = true;
>
> void flood(uint16_t port_id, struct rte_mbufs *mbufs[], uint16_t num_pkts)
> {
>
>         while (running) {
>                 /* Add additional reference to retain the packets */
>                 for (uint16_t i = 0; i < num_pkts; i++)
>                         rte_mbuf_refcnt_update(mbufs[i], 1);
>
>                 uint16_t sent = rte_eth_tx_burst(port_id, queue_id, mbufs,
> num_pkts);
>
>                 if (sent < num_pkts) {
>                         /* device transmit queue was full, drop our
> reference */
>                         for (uint16_t i = sent; i < num_pkts; i++)
>                                 rte_pktmbuf_free(mbufs[i]);
>                 }
>         }
>
>         /* Don't leak original version */
>         rte_pktmbuf_free_bulk(mbufs, num_pkts);
>
> }
>
>
>

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

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

* Re: reuse the packets after tx burst
  2024-08-15 16:18       ` Lokesh Chakka
@ 2024-08-16  7:12         ` Lokesh Chakka
  0 siblings, 0 replies; 6+ messages in thread
From: Lokesh Chakka @ 2024-08-16  7:12 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

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

Please ignore the type.
It Solved *OUR* problem.


Thanks & Regards
--
Lokesh Chakka.


On Thu, Aug 15, 2024 at 9:48 PM Lokesh Chakka <lvenkatakumarchakka@gmail.com>
wrote:

> Hi Stephen,
>
> Thank you for the information.
> It solved your problem.
>
> Regards.
> Lokesh.
>
>
> On Wed, 14 Aug, 2024, 20:29 Stephen Hemminger, <stephen@networkplumber.org>
> wrote:
>
>> On Wed, 14 Aug 2024 17:57:40 +0530
>> Lokesh Chakka <lvenkatakumarchakka@gmail.com> wrote:
>>
>> > hi stephen,
>> >
>> > Thanks for your response. However it seems the solution is not working.
>> The
>> > following is the modified snippet....
>> >
>> > while( condition )
>> > {
>> >      for( pkt_count=0; pkt_count<num_of_pkts_per_queue; pkt_count++ )
>> >      {
>> >           rte_mbuf_refcnt_set( mbuf[pkt_count], 2 );// setting to two -
>> > first and second iteration
>> >      }
>> >      for( pkt_count=0; pkt_count<5; pkt_count++ )
>> >      {
>> >           fprintf( stderr, "%s %d %u\n", __func__, __LINE__,
>> > rte_mbuf_refcnt_read( mbuf[pkt_count] ) );//able to print two- first and
>> > second iteration
>> >      }
>> >      if( rte_eth_tx_burst( port_id, 0, mbuf, num_of_pkts_per_queue ) !=
>> > num_of_pkts_per_queue )
>> >      {
>> >           fprintf( stderr, "%s %d %d %s\n", __func__, __LINE__,
>> rte_errno,
>> > rte_strerror(rte_errno) );//failing second time
>> >           rte_exit( EXIT_FAILURE, "%s %d rte_eth_tx_burst port id:
>> %u\n",
>> > __func__, __LINE__, port_id );
>> >      }
>> >      fprintf( stderr, "%s %d port: %u sent %u packets\n", __func__,
>> > __LINE__, port_id, num_of_pkts_per_queue );//able to send once - first
>> > iteration only
>> >      for( pkt_count=0; pkt_count<5; pkt_count++ )
>> >      {
>> >           fprintf( stderr, "%s %d %u\n", __func__, __LINE__,
>> > rte_mbuf_refcnt_read( mbuf[pkt_count] ) );//refcnt is printing one
>> >      }
>> > }
>> >
>> > There seems to be some more gap in my understanding. Could you please
>> help
>> > understand the issue?
>> >
>> > Thanks & Regards
>> > --
>> > Lokesh Chakka.
>> >
>> >
>> > On Mon, Aug 12, 2024 at 8:22 PM Stephen Hemminger <
>> > stephen@networkplumber.org> wrote:
>> >
>> > > On Mon, 12 Aug 2024 15:55:50 +0530
>> > > Lokesh Chakka <lvenkatakumarchakka@gmail.com> wrote:
>> > >
>> > > > hello,
>> > > >
>> > > > Here is a small piece of code :
>> > > >
>> > > > while( condition )
>> > > > {
>> > > >
>> > > >       if( rte_eth_tx_burst( port_id, 0, mbuf, num_of_pkts_per_queue
>> ) !=
>> > > > num_of_pkts_per_queue )
>> > > >       {
>> > > >               fprintf( stderr, "%d %s\n", rte_errno,
>> > > rte_strerror(rte_errno) );
>> > > >               rte_exit( EXIT_FAILURE, "%s %d rte_eth_tx_burst port
>> id:
>> > > %u\n",
>> > > > __func__, __LINE__, port_id );//second iteration failing.
>> > > >       }
>> > > >       fprintf( stderr, "%s %d port: %u packet: %c sent %u
>> packets\n",
>> > > > __func__, __LINE__, port_id, argv[3][0], num_of_pkts_per_queue
>> > > > );//printing once
>> > > >       for( pkt_count=0; pkt_count<num_of_pkts_per_queue;
>> pkt_count++ )
>> > > >       {//want to send same data again...!!!
>> > > >               mbuf[pkt_count]->pkt_len = mbuf[pkt_count]->data_len
>> =
>> > > dev_info.max_mtu;
>> > > >
>> > > >       }
>> > > >
>> > > > }
>> > > >
>> > > > Can someone help me understand how to reuse the packets again to
>> send the
>> > > > same data ?
>> > > >
>> > >
>> > > When packet is passed to tx_burst, the ownership of that mbuf is
>> passed
>> > > to the driver. The driver will free it after it is sent.
>> > >
>> > > One option would be to increase the reference count on the packet
>> before
>> > > sending.
>> > > Using rte_mbuf_refcnt_update() function to add one to refcount.
>> > > Then the driver will decrement refcount and the refcount will still
>> be one
>> > > (not freed).
>> > >
>> > > Assume this is some kind of packet generator.
>> > >
>>
>>
>> Don't use refcnt_set(), you want to add an additional refcount not force
>> it to two.
>> The device driver may hold onto the mbuf for a while after it was passed
>> to tx_burst
>> so can't assume a value of two.
>>
>> If the number actually queued is less that the number requested, that
>> means the device
>> transmit queue is now full. Need to handle that case.
>>
>> Something like this might get you started:
>>
>>
>> volatile running = true;
>>
>> void flood(uint16_t port_id, struct rte_mbufs *mbufs[], uint16_t num_pkts)
>> {
>>
>>         while (running) {
>>                 /* Add additional reference to retain the packets */
>>                 for (uint16_t i = 0; i < num_pkts; i++)
>>                         rte_mbuf_refcnt_update(mbufs[i], 1);
>>
>>                 uint16_t sent = rte_eth_tx_burst(port_id, queue_id,
>> mbufs, num_pkts);
>>
>>                 if (sent < num_pkts) {
>>                         /* device transmit queue was full, drop our
>> reference */
>>                         for (uint16_t i = sent; i < num_pkts; i++)
>>                                 rte_pktmbuf_free(mbufs[i]);
>>                 }
>>         }
>>
>>         /* Don't leak original version */
>>         rte_pktmbuf_free_bulk(mbufs, num_pkts);
>>
>> }
>>
>>
>>

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

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

end of thread, other threads:[~2024-08-16  7:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-12 10:25 reuse the packets after tx burst Lokesh Chakka
2024-08-12 14:52 ` Stephen Hemminger
2024-08-14 12:27   ` Lokesh Chakka
2024-08-14 14:59     ` Stephen Hemminger
2024-08-15 16:18       ` Lokesh Chakka
2024-08-16  7:12         ` Lokesh Chakka

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