<div dir="ltr">Thank you. I have a question about how the active Traffic class is selected in a pipe. <div>Let's say I have  confugured only one Subport and  one  Pipe on interface.</div><div><div>If the highest priority traffic class in a pipe has exhausted it's rate limit can lower traffic class in the same pipe  be dequeued.</div><div>Can I have profile for Pipe where bandwidth for Pipe is shared among multiple TC's </div><div>Here is an example how I want to configure pipe so bandwidth allocated to Pipe is shared among 13 classes giving priority to highest queue provided it didn't exceed the rate limit.</div><div><br></div><div><div class="gmail-line" style="font-variant-numeric:initial;font-variant-east-asian:initial;font-stretch:initial;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">pipe_profile 0 {</div><div class="gmail-line" style="font-variant-numeric:initial;font-variant-east-asian:initial;font-stretch:initial;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">  tb_rate 1300000          /* Pipe level token bucket rate (bytes per second) */</div><div class="gmail-line" style="font-variant-numeric:initial;font-variant-east-asian:initial;font-stretch:initial;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">  tb_size 1000000         /* Pipe level token bucket size (bytes) */</div><div class="gmail-line" style="font-variant-numeric:initial;font-variant-east-asian:initial;font-stretch:initial;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">  tc0_rate 100000         /* Pipe level token bucket rate for traffic class 0 (bytes per second) */</div><div class="gmail-line" style="font-variant-numeric:initial;font-variant-east-asian:initial;font-stretch:initial;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">  tc1_rate 100000         /* Pipe level token bucket rate for traffic class 1 (bytes per second) */</div><div class="gmail-line" style="font-variant-numeric:initial;font-variant-east-asian:initial;font-stretch:initial;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">  tc2_rate 100000         /* Pipe level token bucket rate for traffic class 2 (bytes per second) */</div><div class="gmail-line" style="font-variant-numeric:initial;font-variant-east-asian:initial;font-stretch:initial;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">  tc3_rate 100000</div><div class="gmail-line" style="font-variant-numeric:initial;font-variant-east-asian:initial;font-stretch:initial;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">   </div><div class="gmail-line" style="font-variant-numeric:initial;font-variant-east-asian:initial;font-stretch:initial;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">   .....       /* Pipe level token bucket rate for traffic class 3 (bytes per second) */</div><div class="gmail-line" style="font-variant-numeric:initial;font-variant-east-asian:initial;font-stretch:initial;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">  tc13_rate 100000</div><div class="gmail-line" style="font-variant-numeric:initial;font-variant-east-asian:initial;font-stretch:initial;line-height:1;font-family:monospace,fixed;min-height:13px;white-space:pre-wrap;padding-left:53px;padding-bottom:0px;margin:0px;color:rgb(0,0,0)">  tc_period 40            /* Time int</div></div><div>            }</div><div> <span style="background-color:rgb(252,252,252);color:rgb(64,64,64);font-family:Lato,proxima-nova,"Helvetica Neue",Arial,sans-serif;font-size:16px">The scheduling decision to send next packet from (subport S, pipe P, traffic class TC, queue Q) is favorable (packet is sent) when all the conditions below are met:</span><ul class="gmail-simple" style="box-sizing:border-box;margin:0px 0px 24px;padding:0px;list-style-position:initial;line-height:24px;color:rgb(64,64,64);font-family:Lato,proxima-nova,"Helvetica Neue",Arial,sans-serif;font-size:16px;background-color:rgb(252,252,252)"><li style="box-sizing:border-box;list-style:disc;margin-left:24px">Pipe P of subport S is currently selected by one of the port grinders;</li><li style="box-sizing:border-box;list-style:disc;margin-left:24px">Traffic class TC is the highest priority active traffic class of pipe P;</li><li style="box-sizing:border-box;list-style:disc;margin-left:24px">Queue Q is the next queue selected by WRR within traffic class TC of pipe P;</li><li style="box-sizing:border-box;list-style:disc;margin-left:24px">Subport S has enough credits to send the packet;</li><li style="box-sizing:border-box;list-style:disc;margin-left:24px">Subport S has enough credits for traffic class TC to send the packet;</li><li style="box-sizing:border-box;list-style:disc;margin-left:24px">Pipe P has enough credits to send the packet;</li><li style="box-sizing:border-box;list-style:disc;margin-left:24px">Pipe P has enough credits for traffic class TC to send the packet.</li></ul><p style="box-sizing:border-box;line-height:24px;margin:0px 0px 24px;font-size:16px;color:rgb(64,64,64);font-family:Lato,proxima-nova,"Helvetica Neue",Arial,sans-serif;background-color:rgb(252,252,252)">If all the above conditions are met, then the packet is selected for transmission and the necessary credits are subtracted from subport S, subport S traffic class TC, pipe P, pipe P traffic class TC.</p><div><br><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 6, 2022 at 12:34 PM Singh, Jasvinder <<a href="mailto:jasvinder.singh@intel.com">jasvinder.singh@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-IE" style="overflow-wrap: break-word;">
<div class="gmail-m_-7260357973067368546WordSection1">
<p class="MsoNormal"><span>Yes, it is fixed. The tc_credits_per_period is updated after tc_period duration. Note that tc credits don’t get accumulated if tc queue is visited after multiple tc_period</span> due to rate limiting
 mechanism<span> at the traffic class level.   <u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> satish amara <<a href="mailto:satishkamara@gmail.com" target="_blank">satishkamara@gmail.com</a>>
<br>
<b>Sent:</b> Wednesday, April 6, 2022 4:32 PM<br>
<b>To:</b> Singh, Jasvinder <<a href="mailto:jasvinder.singh@intel.com" target="_blank">jasvinder.singh@intel.com</a>><br>
<b>Cc:</b> Thomas Monjalon <<a href="mailto:thomas@monjalon.net" target="_blank">thomas@monjalon.net</a>>; <a href="mailto:users@dpdk.org" target="_blank">users@dpdk.org</a>; Dumitrescu, Cristian <<a href="mailto:cristian.dumitrescu@intel.com" target="_blank">cristian.dumitrescu@intel.com</a>><br>
<b>Subject:</b> Re: Fwd: QOS sample example.<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Jasvinder,<u></u><u></u></p>
<div>
<p class="MsoNormal">   I have a few more questions.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Can you provide  some clarity on <u></u><u></u></p>
</div>
<table border="1" cellspacing="0" cellpadding="0" style="background:rgb(252,252,252);border-collapse:collapse;border:none;border-spacing:0px;empty-cells:show" id="gmail-m_-7260357973067368546gmail-id23">
<tbody>
<tr style="box-sizing:border-box">
<td nowrap style="border-style:inset inset solid solid;border-top-color:initial;border-left-color:rgb(225,228,229);border-bottom-color:rgb(225,228,229);border-right-color:initial;border-width:1pt;background:rgb(243,246,246);padding:6pt 12pt;box-sizing:border-box;overflow:visible">
<p class="MsoNormal" style="margin-bottom:18pt"><span style="font-family:Lato,sans-serif;color:rgb(64,64,64)">tc_credits_per_period<u></u><u></u></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">tc_period is for how often the credits for traffic need to be updated. Is tc_credits_per_period is fixed based on tc_rate.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Satish Amara<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Fri, Apr 1, 2022 at 9:34 AM satish amara <<a href="mailto:satishkamara@gmail.com" target="_blank">satishkamara@gmail.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<p class="MsoNormal">Thanks for the info Jasvinder. I see there is an internal timer to see when to refill the token buckets and credits.  I have read the QOS  document.  My understanding is that the DPDK code is using the same HQOS thread CPU context to implement timer
 functionality during the pipe selection and not leveraging on Linux timers or other timers.  <u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Satish Amara<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Fri, Apr 1, 2022 at 4:36 AM Singh, Jasvinder <<a href="mailto:jasvinder.singh@intel.com" target="_blank">jasvinder.singh@intel.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<div>
<p class="MsoNormal">Hi Satish,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">DPDK HQoS scheduler has internal timer to compute the credits. The time difference between the two consecutive visit to the same pipe is used to compute the number of tb_periods
 elapsed and based on that, the available credits in the token bucket is computed. Each pipe has its own context which stores the timestamp of the last visit  and it is used when pipe is visited to schedule the packets from its queues.
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Jasvinder<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> satish amara <</span><a href="mailto:satishkamara@gmail.com" target="_blank"><span lang="EN-US">satishkamara@gmail.com</span></a><span lang="EN-US">>
<br>
<b>Sent:</b> Thursday, March 31, 2022 9:27 PM<br>
<b>To:</b> Thomas Monjalon <</span><a href="mailto:thomas@monjalon.net" target="_blank"><span lang="EN-US">thomas@monjalon.net</span></a><span lang="EN-US">><br>
<b>Cc:</b> </span><a href="mailto:users@dpdk.org" target="_blank"><span lang="EN-US">users@dpdk.org</span></a><span lang="EN-US">; Singh, Jasvinder <</span><a href="mailto:jasvinder.singh@intel.com" target="_blank"><span lang="EN-US">jasvinder.singh@intel.com</span></a><span lang="EN-US">>;
 Dumitrescu, Cristian <</span><a href="mailto:cristian.dumitrescu@intel.com" target="_blank"><span lang="EN-US">cristian.dumitrescu@intel.com</span></a><span lang="EN-US">><br>
<b>Subject:</b> Re: Fwd: QOS sample example.</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">Thanks, Thomas for forwarding this to the group. <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">I have one more question. Does DPDK QOS  uses any internal threads/timers for the token bucket implementation?. The token<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> buckets can be implemented in different ways.  When are the tokens are filled, I see there is tb_period?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">It looks like the tokens are filled when the HQOS thread is trying to find the next active pipe?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Satish Amara<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">On Thu, Mar 31, 2022 at 3:39 PM Thomas Monjalon <<a href="mailto:thomas@monjalon.net" target="_blank">thomas@monjalon.net</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<p class="MsoNormal" style="margin-bottom:12pt">+Cc QoS scheduler maintainers (see file MAINTAINERS)<br>
<br>
31/03/2022 18:59, satish amara:<br>
> Hi,<br>
>     I am trying to understand the QOS sample scheduler application code.<br>
> Trying to understand what is tc_period in the config.<br>
> 30. QoS Scheduler Sample Application — Data Plane Development Kit 21.05.0<br>
> documentation (<a href="http://dpdk.org" target="_blank">dpdk.org</a>)<br>
> <<a href="https://doc.dpdk.org/guides-21.05/sample_app_ug/qos_scheduler.html" target="_blank">https://doc.dpdk.org/guides-21.05/sample_app_ug/qos_scheduler.html</a>> Is<br>
> tc_period same as  tb_period<br>
> tb_period Bytes Time period that should elapse since the last credit update<br>
> in order for the bucket to be awarded tb_credits_per_period worth or<br>
> credits.<br>
> Regards,<br>
> Satish Amara<br>
> <br>
<br>
<br>
<br>
<u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</div>

</blockquote></div>