* [dpdk-dev] Requirement of minimum Rx burst size for PMDs
@ 2017-10-20 1:18 Yongseok Koh
2017-10-20 8:13 ` Bruce Richardson
2017-10-20 10:07 ` Andrew Rybchenko
0 siblings, 2 replies; 6+ messages in thread
From: Yongseok Koh @ 2017-10-20 1:18 UTC (permalink / raw)
To: dev
Hi,
In some rx_burst functions, especially for vectorized ones (e.g. i40e_rxtx_vec*
or mlx5_rxtx_vec*), there's actually a requirement of min burst size.
As it manipulates 4 packets simultaneously in a loop, if nb_pkts of
rte_eth_rx_burst() is less than 4, it just returns without sending a packet.
One way to handle it could be falling back to regular rx_burst in such cases but
the burst size isn't a fixed/static parameter but applications can dynamically
change it when it polls a device. So, it might not be a good option.
Therefore, how about adding min_rx/tx_burst_sz in struct rte_eth_dev_info and
have PMDs fill it in on dev_ops->dev_infos_get() so as to make apps comply with
it.
Because the max size of a burst can be handled well by PMD, it may not be
necessary.
Thoughts?
Thanks,
Yongseok
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] Requirement of minimum Rx burst size for PMDs
2017-10-20 1:18 [dpdk-dev] Requirement of minimum Rx burst size for PMDs Yongseok Koh
@ 2017-10-20 8:13 ` Bruce Richardson
2017-10-20 10:07 ` Andrew Rybchenko
1 sibling, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2017-10-20 8:13 UTC (permalink / raw)
To: Yongseok Koh; +Cc: dev
On Fri, Oct 20, 2017 at 01:18:18AM +0000, Yongseok Koh wrote:
> Hi,
>
> In some rx_burst functions, especially for vectorized ones (e.g. i40e_rxtx_vec*
> or mlx5_rxtx_vec*), there's actually a requirement of min burst size.
>
> As it manipulates 4 packets simultaneously in a loop, if nb_pkts of
> rte_eth_rx_burst() is less than 4, it just returns without sending a packet.
>
> One way to handle it could be falling back to regular rx_burst in such cases but
> the burst size isn't a fixed/static parameter but applications can dynamically
> change it when it polls a device. So, it might not be a good option.
>
> Therefore, how about adding min_rx/tx_burst_sz in struct rte_eth_dev_info and
> have PMDs fill it in on dev_ops->dev_infos_get() so as to make apps comply with
> it.
>
> Because the max size of a burst can be handled well by PMD, it may not be
> necessary.
>
> Thoughts?
>
For a short term fix, having the min burst size in the device info is a
good enough fix, I think. Medium to long term, we need to remove this
limitation in the vector drivers.
/Bruce
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] Requirement of minimum Rx burst size for PMDs
2017-10-20 1:18 [dpdk-dev] Requirement of minimum Rx burst size for PMDs Yongseok Koh
2017-10-20 8:13 ` Bruce Richardson
@ 2017-10-20 10:07 ` Andrew Rybchenko
2017-10-20 11:58 ` Bruce Richardson
1 sibling, 1 reply; 6+ messages in thread
From: Andrew Rybchenko @ 2017-10-20 10:07 UTC (permalink / raw)
To: Yongseok Koh, dev
On 10/20/2017 04:18 AM, Yongseok Koh wrote:
> Therefore, how about adding min_rx/tx_burst_sz in struct rte_eth_dev_info and
> have PMDs fill it in on dev_ops->dev_infos_get() so as to make apps comply with
> it.
Just for my understand, what should happen if application wants to send only
one packet? 5 packets? 33? 35?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] Requirement of minimum Rx burst size for PMDs
2017-10-20 10:07 ` Andrew Rybchenko
@ 2017-10-20 11:58 ` Bruce Richardson
2017-10-20 12:23 ` Andrew Rybchenko
0 siblings, 1 reply; 6+ messages in thread
From: Bruce Richardson @ 2017-10-20 11:58 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: Yongseok Koh, dev
On Fri, Oct 20, 2017 at 01:07:17PM +0300, Andrew Rybchenko wrote:
> On 10/20/2017 04:18 AM, Yongseok Koh wrote:
> > Therefore, how about adding min_rx/tx_burst_sz in struct rte_eth_dev_info and
> > have PMDs fill it in on dev_ops->dev_infos_get() so as to make apps comply with
> > it.
>
> Just for my understand, what should happen if application wants to send only
> one packet? 5 packets? 33? 35?
I actually think there is a mistake in the original mails. At least for
Intel PMDs there is no restriction on min TX burst sizes in any code
path. The vector RX on the other hand does require a minimum number of empty
buffers to be passed to it, so you need to request no fewer than 4
packets in a burst. If only one packet is available that will still be
returned to you, but you must request at least 4
Reagrds,
/Bruce
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] Requirement of minimum Rx burst size for PMDs
2017-10-20 11:58 ` Bruce Richardson
@ 2017-10-20 12:23 ` Andrew Rybchenko
2017-10-20 16:59 ` Yongseok Koh
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Rybchenko @ 2017-10-20 12:23 UTC (permalink / raw)
To: Bruce Richardson; +Cc: Yongseok Koh, dev
On 10/20/2017 02:58 PM, Bruce Richardson wrote:
> On Fri, Oct 20, 2017 at 01:07:17PM +0300, Andrew Rybchenko wrote:
>> On 10/20/2017 04:18 AM, Yongseok Koh wrote:
>>> Therefore, how about adding min_rx/tx_burst_sz in struct rte_eth_dev_info and
>>> have PMDs fill it in on dev_ops->dev_infos_get() so as to make apps comply with
>>> it.
>> Just for my understand, what should happen if application wants to send only
>> one packet? 5 packets? 33? 35?
> I actually think there is a mistake in the original mails. At least for
> Intel PMDs there is no restriction on min TX burst sizes in any code
> path. The vector RX on the other hand does require a minimum number of empty
> buffers to be passed to it, so you need to request no fewer than 4
> packets in a burst. If only one packet is available that will still be
> returned to you, but you must request at least 4
I see. The thread subject says Rx, but Tx (min_tx_burst_sz) is mentioned
above.
If Tx is mentioned by mistake, it is clear now.
Andrew.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] Requirement of minimum Rx burst size for PMDs
2017-10-20 12:23 ` Andrew Rybchenko
@ 2017-10-20 16:59 ` Yongseok Koh
0 siblings, 0 replies; 6+ messages in thread
From: Yongseok Koh @ 2017-10-20 16:59 UTC (permalink / raw)
To: Andrew Rybchenko; +Cc: Bruce Richardson, dev
On Fri, Oct 20, 2017 at 03:23:10PM +0300, Andrew Rybchenko wrote:
> On 10/20/2017 02:58 PM, Bruce Richardson wrote:
> > On Fri, Oct 20, 2017 at 01:07:17PM +0300, Andrew Rybchenko wrote:
> > > On 10/20/2017 04:18 AM, Yongseok Koh wrote:
> > > > Therefore, how about adding min_rx/tx_burst_sz in struct rte_eth_dev_info and
> > > > have PMDs fill it in on dev_ops->dev_infos_get() so as to make apps comply with
> > > > it.
> > > Just for my understand, what should happen if application wants to send only
> > > one packet? 5 packets? 33? 35?
> > I actually think there is a mistake in the original mails. At least for
> > Intel PMDs there is no restriction on min TX burst sizes in any code
> > path. The vector RX on the other hand does require a minimum number of empty
> > buffers to be passed to it, so you need to request no fewer than 4
> > packets in a burst. If only one packet is available that will still be
> > returned to you, but you must request at least 4
>
> I see. The thread subject says Rx, but Tx (min_tx_burst_sz) is mentioned
> above.
> If Tx is mentioned by mistake, it is clear now.
Oops, Tx was mistakenly mentioned. Neither Intel nor Mellanox PMD has such
restriction on Tx burst size.
Will come up with a patch for it soon.
Thanks,
Yongseok
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-10-20 17:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-20 1:18 [dpdk-dev] Requirement of minimum Rx burst size for PMDs Yongseok Koh
2017-10-20 8:13 ` Bruce Richardson
2017-10-20 10:07 ` Andrew Rybchenko
2017-10-20 11:58 ` Bruce Richardson
2017-10-20 12:23 ` Andrew Rybchenko
2017-10-20 16:59 ` Yongseok Koh
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).