All of lore.kernel.org
 help / color / mirror / Atom feed
* meter: excess token bucket update in srtcm
@ 2016-08-31 10:02 Nikhil Jagtap
  2016-09-06  4:13 ` Nikhil Jagtap
  0 siblings, 1 reply; 7+ messages in thread
From: Nikhil Jagtap @ 2016-08-31 10:02 UTC (permalink / raw)
  To: cristian.dumitrescu; +Cc: dev

Hi,

As per srTCM RFC 2697, we should be updating the E bucket only after the C
bucket overflows.
"Thereafter, the token counts Tc and Te are updated CIR times per second as
follows:
     o If Tc is less than CBS, Tc is incremented by one, else
     o if Te is less then EBS, Te is incremented by one, else
     o neither Tc nor Te is incremented."

However in the current DPDK implementation of srTCM, we are updating both
the buckets simultaneously at the same rate (CIR). This will result in a
token accumulation rate of (2*CIR). This seems like a bug to me. Can you
confirm this?

Nikhil

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

* Re: meter: excess token bucket update in srtcm
  2016-08-31 10:02 meter: excess token bucket update in srtcm Nikhil Jagtap
@ 2016-09-06  4:13 ` Nikhil Jagtap
  2016-09-06  5:10   ` Ramia, Kannan Babu
  0 siblings, 1 reply; 7+ messages in thread
From: Nikhil Jagtap @ 2016-09-06  4:13 UTC (permalink / raw)
  To: cristian.dumitrescu; +Cc: dev

Hi,
Can someone please comment on this?

Nikhil

On 31 August 2016 at 15:32, Nikhil Jagtap <nikhil.jagtap@gmail.com> wrote:

> Hi,
>
> As per srTCM RFC 2697, we should be updating the E bucket only after the C
> bucket overflows.
> "Thereafter, the token counts Tc and Te are updated CIR times per second
> as follows:
>      o If Tc is less than CBS, Tc is incremented by one, else
>      o if Te is less then EBS, Te is incremented by one, else
>      o neither Tc nor Te is incremented."
>
> However in the current DPDK implementation of srTCM, we are updating both
> the buckets simultaneously at the same rate (CIR). This will result in a
> token accumulation rate of (2*CIR). This seems like a bug to me. Can you
> confirm this?
>
> Nikhil
>
>

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

* Re: meter: excess token bucket update in srtcm
  2016-09-06  4:13 ` Nikhil Jagtap
@ 2016-09-06  5:10   ` Ramia, Kannan Babu
  2016-09-06  6:29     ` Nikhil Jagtap
  0 siblings, 1 reply; 7+ messages in thread
From: Ramia, Kannan Babu @ 2016-09-06  5:10 UTC (permalink / raw)
  To: Nikhil Jagtap, dev

Hi Nikhil

You could submit a patch, something like that below logic

If( ((n_periods * m->cir_bytes_per_period) > (m->cbs-m->tc))
	te = m->te + ((n_periods * m->cir_bytes_per_period) - (m->cbs-m->tc));

and this should be done before m->tc update.


Regards
Kannan Babu

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nikhil Jagtap
Sent: Tuesday, September 6, 2016 9:43 AM
To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] meter: excess token bucket update in srtcm

Hi,
Can someone please comment on this?

Nikhil

On 31 August 2016 at 15:32, Nikhil Jagtap <nikhil.jagtap@gmail.com> wrote:

> Hi,
>
> As per srTCM RFC 2697, we should be updating the E bucket only after 
> the C bucket overflows.
> "Thereafter, the token counts Tc and Te are updated CIR times per 
> second as follows:
>      o If Tc is less than CBS, Tc is incremented by one, else
>      o if Te is less then EBS, Te is incremented by one, else
>      o neither Tc nor Te is incremented."
>
> However in the current DPDK implementation of srTCM, we are updating 
> both the buckets simultaneously at the same rate (CIR). This will 
> result in a token accumulation rate of (2*CIR). This seems like a bug 
> to me. Can you confirm this?
>
> Nikhil
>
>

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

* Re: meter: excess token bucket update in srtcm
  2016-09-06  5:10   ` Ramia, Kannan Babu
@ 2016-09-06  6:29     ` Nikhil Jagtap
  2016-09-06  9:56       ` Dumitrescu, Cristian
  0 siblings, 1 reply; 7+ messages in thread
From: Nikhil Jagtap @ 2016-09-06  6:29 UTC (permalink / raw)
  To: Ramia, Kannan Babu; +Cc: dev

Hi Kannan,

Thank you for your reply. I will submit the patch on similar lines I had
used for my test.

Regards,
Nikhil

On 6 September 2016 at 10:40, Ramia, Kannan Babu <
kannan.babu.ramia@intel.com> wrote:

> Hi Nikhil
>
> You could submit a patch, something like that below logic
>
> If( ((n_periods * m->cir_bytes_per_period) > (m->cbs-m->tc))
>         te = m->te + ((n_periods * m->cir_bytes_per_period) -
> (m->cbs-m->tc));
>
> and this should be done before m->tc update.
>
>
> Regards
> Kannan Babu
>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nikhil Jagtap
> Sent: Tuesday, September 6, 2016 9:43 AM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] meter: excess token bucket update in srtcm
>
> Hi,
> Can someone please comment on this?
>
> Nikhil
>
> On 31 August 2016 at 15:32, Nikhil Jagtap <nikhil.jagtap@gmail.com> wrote:
>
> > Hi,
> >
> > As per srTCM RFC 2697, we should be updating the E bucket only after
> > the C bucket overflows.
> > "Thereafter, the token counts Tc and Te are updated CIR times per
> > second as follows:
> >      o If Tc is less than CBS, Tc is incremented by one, else
> >      o if Te is less then EBS, Te is incremented by one, else
> >      o neither Tc nor Te is incremented."
> >
> > However in the current DPDK implementation of srTCM, we are updating
> > both the buckets simultaneously at the same rate (CIR). This will
> > result in a token accumulation rate of (2*CIR). This seems like a bug
> > to me. Can you confirm this?
> >
> > Nikhil
> >
> >
>

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

* Re: meter: excess token bucket update in srtcm
  2016-09-06  6:29     ` Nikhil Jagtap
@ 2016-09-06  9:56       ` Dumitrescu, Cristian
  2016-09-07  6:22         ` Nikhil Jagtap
  0 siblings, 1 reply; 7+ messages in thread
From: Dumitrescu, Cristian @ 2016-09-06  9:56 UTC (permalink / raw)
  To: Nikhil Jagtap, Ramia, Kannan Babu; +Cc: dev

Hi Nikhil,

It also looks to me that you are right. Sorry, my mistake when translating the RFC into code.

Challenge in fixing this is how to code it using minimal number of branches ...

Thanks,
Cristian

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nikhil Jagtap
> Sent: Tuesday, September 6, 2016 7:30 AM
> To: Ramia, Kannan Babu <kannan.babu.ramia@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] meter: excess token bucket update in srtcm
> 
> Hi Kannan,
> 
> Thank you for your reply. I will submit the patch on similar lines I had
> used for my test.
> 
> Regards,
> Nikhil
> 
> On 6 September 2016 at 10:40, Ramia, Kannan Babu <
> kannan.babu.ramia@intel.com> wrote:
> 
> > Hi Nikhil
> >
> > You could submit a patch, something like that below logic
> >
> > If( ((n_periods * m->cir_bytes_per_period) > (m->cbs-m->tc))
> >         te = m->te + ((n_periods * m->cir_bytes_per_period) -
> > (m->cbs-m->tc));
> >
> > and this should be done before m->tc update.
> >
> >
> > Regards
> > Kannan Babu
> >
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nikhil Jagtap
> > Sent: Tuesday, September 6, 2016 9:43 AM
> > To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] meter: excess token bucket update in srtcm
> >
> > Hi,
> > Can someone please comment on this?
> >
> > Nikhil
> >
> > On 31 August 2016 at 15:32, Nikhil Jagtap <nikhil.jagtap@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > As per srTCM RFC 2697, we should be updating the E bucket only after
> > > the C bucket overflows.
> > > "Thereafter, the token counts Tc and Te are updated CIR times per
> > > second as follows:
> > >      o If Tc is less than CBS, Tc is incremented by one, else
> > >      o if Te is less then EBS, Te is incremented by one, else
> > >      o neither Tc nor Te is incremented."
> > >
> > > However in the current DPDK implementation of srTCM, we are updating
> > > both the buckets simultaneously at the same rate (CIR). This will
> > > result in a token accumulation rate of (2*CIR). This seems like a bug
> > > to me. Can you confirm this?
> > >
> > > Nikhil
> > >
> > >
> >

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

* Re: meter: excess token bucket update in srtcm
  2016-09-06  9:56       ` Dumitrescu, Cristian
@ 2016-09-07  6:22         ` Nikhil Jagtap
  2016-09-09 21:00           ` Dumitrescu, Cristian
  0 siblings, 1 reply; 7+ messages in thread
From: Nikhil Jagtap @ 2016-09-07  6:22 UTC (permalink / raw)
  To: Dumitrescu, Cristian; +Cc: Ramia, Kannan Babu, dev

Hi Cristian,

Thanks for the confirmation. I have submitted a patch for the same.
http://dpdk.org/ml/archives/dev/2016-September/046226.html

Regards,
Nikhil

On 6 September 2016 at 15:26, Dumitrescu, Cristian <
cristian.dumitrescu@intel.com> wrote:

> Hi Nikhil,
>
> It also looks to me that you are right. Sorry, my mistake when translating
> the RFC into code.
>
> Challenge in fixing this is how to code it using minimal number of
> branches ...
>
> Thanks,
> Cristian
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nikhil Jagtap
> > Sent: Tuesday, September 6, 2016 7:30 AM
> > To: Ramia, Kannan Babu <kannan.babu.ramia@intel.com>
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] meter: excess token bucket update in srtcm
> >
> > Hi Kannan,
> >
> > Thank you for your reply. I will submit the patch on similar lines I had
> > used for my test.
> >
> > Regards,
> > Nikhil
> >
> > On 6 September 2016 at 10:40, Ramia, Kannan Babu <
> > kannan.babu.ramia@intel.com> wrote:
> >
> > > Hi Nikhil
> > >
> > > You could submit a patch, something like that below logic
> > >
> > > If( ((n_periods * m->cir_bytes_per_period) > (m->cbs-m->tc))
> > >         te = m->te + ((n_periods * m->cir_bytes_per_period) -
> > > (m->cbs-m->tc));
> > >
> > > and this should be done before m->tc update.
> > >
> > >
> > > Regards
> > > Kannan Babu
> > >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nikhil Jagtap
> > > Sent: Tuesday, September 6, 2016 9:43 AM
> > > To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] meter: excess token bucket update in srtcm
> > >
> > > Hi,
> > > Can someone please comment on this?
> > >
> > > Nikhil
> > >
> > > On 31 August 2016 at 15:32, Nikhil Jagtap <nikhil.jagtap@gmail.com>
> wrote:
> > >
> > > > Hi,
> > > >
> > > > As per srTCM RFC 2697, we should be updating the E bucket only after
> > > > the C bucket overflows.
> > > > "Thereafter, the token counts Tc and Te are updated CIR times per
> > > > second as follows:
> > > >      o If Tc is less than CBS, Tc is incremented by one, else
> > > >      o if Te is less then EBS, Te is incremented by one, else
> > > >      o neither Tc nor Te is incremented."
> > > >
> > > > However in the current DPDK implementation of srTCM, we are updating
> > > > both the buckets simultaneously at the same rate (CIR). This will
> > > > result in a token accumulation rate of (2*CIR). This seems like a bug
> > > > to me. Can you confirm this?
> > > >
> > > > Nikhil
> > > >
> > > >
> > >
>

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

* Re: meter: excess token bucket update in srtcm
  2016-09-07  6:22         ` Nikhil Jagtap
@ 2016-09-09 21:00           ` Dumitrescu, Cristian
  0 siblings, 0 replies; 7+ messages in thread
From: Dumitrescu, Cristian @ 2016-09-09 21:00 UTC (permalink / raw)
  To: Nikhil Jagtap; +Cc: Ramia, Kannan Babu, dev

Thanks, Nikhil, will review and get back to you in the next couple of weeks. Regards, Cristian

From: Nikhil Jagtap [mailto:nikhil.jagtap@gmail.com]
Sent: Wednesday, September 7, 2016 7:22 AM
To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
Cc: Ramia, Kannan Babu <kannan.babu.ramia@intel.com>; dev@dpdk.org
Subject: Re: [dpdk-dev] meter: excess token bucket update in srtcm

Hi Cristian,

Thanks for the confirmation. I have submitted a patch for the same.
http://dpdk.org/ml/archives/dev/2016-September/046226.html

Regards,
Nikhil

On 6 September 2016 at 15:26, Dumitrescu, Cristian <cristian.dumitrescu@intel.com<mailto:cristian.dumitrescu@intel.com>> wrote:
Hi Nikhil,

It also looks to me that you are right. Sorry, my mistake when translating the RFC into code.

Challenge in fixing this is how to code it using minimal number of branches ...

Thanks,
Cristian

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org<mailto:dev-bounces@dpdk.org>] On Behalf Of Nikhil Jagtap
> Sent: Tuesday, September 6, 2016 7:30 AM
> To: Ramia, Kannan Babu <kannan.babu.ramia@intel.com<mailto:kannan.babu.ramia@intel.com>>
> Cc: dev@dpdk.org<mailto:dev@dpdk.org>
> Subject: Re: [dpdk-dev] meter: excess token bucket update in srtcm
>
> Hi Kannan,
>
> Thank you for your reply. I will submit the patch on similar lines I had
> used for my test.
>
> Regards,
> Nikhil
>
> On 6 September 2016 at 10:40, Ramia, Kannan Babu <
> kannan.babu.ramia@intel.com<mailto:kannan.babu.ramia@intel.com>> wrote:
>
> > Hi Nikhil
> >
> > You could submit a patch, something like that below logic
> >
> > If( ((n_periods * m->cir_bytes_per_period) > (m->cbs-m->tc))
> >         te = m->te + ((n_periods * m->cir_bytes_per_period) -
> > (m->cbs-m->tc));
> >
> > and this should be done before m->tc update.
> >
> >
> > Regards
> > Kannan Babu
> >
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org<mailto:dev-bounces@dpdk.org>] On Behalf Of Nikhil Jagtap
> > Sent: Tuesday, September 6, 2016 9:43 AM
> > To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com<mailto:cristian.dumitrescu@intel.com>>
> > Cc: dev@dpdk.org<mailto:dev@dpdk.org>
> > Subject: Re: [dpdk-dev] meter: excess token bucket update in srtcm
> >
> > Hi,
> > Can someone please comment on this?
> >
> > Nikhil
> >
> > On 31 August 2016 at 15:32, Nikhil Jagtap <nikhil.jagtap@gmail.com<mailto:nikhil.jagtap@gmail.com>> wrote:
> >
> > > Hi,
> > >
> > > As per srTCM RFC 2697, we should be updating the E bucket only after
> > > the C bucket overflows.
> > > "Thereafter, the token counts Tc and Te are updated CIR times per
> > > second as follows:
> > >      o If Tc is less than CBS, Tc is incremented by one, else
> > >      o if Te is less then EBS, Te is incremented by one, else
> > >      o neither Tc nor Te is incremented."
> > >
> > > However in the current DPDK implementation of srTCM, we are updating
> > > both the buckets simultaneously at the same rate (CIR). This will
> > > result in a token accumulation rate of (2*CIR). This seems like a bug
> > > to me. Can you confirm this?
> > >
> > > Nikhil
> > >
> > >
> >


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

end of thread, other threads:[~2016-09-09 21:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-31 10:02 meter: excess token bucket update in srtcm Nikhil Jagtap
2016-09-06  4:13 ` Nikhil Jagtap
2016-09-06  5:10   ` Ramia, Kannan Babu
2016-09-06  6:29     ` Nikhil Jagtap
2016-09-06  9:56       ` Dumitrescu, Cristian
2016-09-07  6:22         ` Nikhil Jagtap
2016-09-09 21:00           ` Dumitrescu, Cristian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.