Regards,
Bala

On 5 June 2017 at 18:42, Stanislaw Kardach <k...@semihalf.com> wrote:
>
>
> Best Regards,
> Stanislaw Kardach
>
> On 06/05/2017 02:54 PM, Bill Fischofer wrote:
>> On Mon, Jun 5, 2017 at 7:32 AM, Stanislaw Kardach <k...@semihalf.com> wrote:
>>>
>>>
>>> Best Regards,
>>> Stanislaw Kardach
>>>
>>> On 06/05/2017 02:27 PM, Balasubramanian Manoharan wrote:
>>>> Adds threshold limit of the pool to the pool parameters.
>>>> This threshold limit is a percentage of total size of the pool.
>>>>
>>>> Signed-off-by: Balasubramanian Manoharan <bala.manoha...@linaro.org>
>>>> ---
>>>>  include/odp/api/spec/pool.h | 32 ++++++++++++++++++++++++++++++++
>>>>  1 file changed, 32 insertions(+)
>>>>
>>>> diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h
>>>> index 6fc5b6b..1c1ebe4 100644
>>>> --- a/include/odp/api/spec/pool.h
>>>> +++ b/include/odp/api/spec/pool.h
>>>> @@ -20,6 +20,7 @@ extern "C" {
>>>>  #endif
>>>>
>>>>  #include <odp/api/std_types.h>
>>>> +#include <odp/api/support.h>
>>>>
>>>>  /** @defgroup odp_pool ODP POOL
>>>>   *  Operations on a pool.
>>>> @@ -127,6 +128,9 @@ typedef struct odp_pool_capability_t {
>>>>                * The value of zero means that limited only by the available
>>>>                * memory size for the pool. */
>>>>               uint32_t max_uarea_size;
>>>> +
>>>> +             /** Pool Threshold limit support */
>>>> +             odp_support_t pool_threshold_limit;
>>>>       } pkt;
>>>>
>>>>       /** Timeout pool capabilities  */
>>>> @@ -214,6 +218,17 @@ typedef struct odp_pool_param_t {
>>>>                           defined by pool capability pkt.max_uarea_size.
>>>>                           Specify as 0 if no user area is needed. */
>>>>                       uint32_t uarea_size;
>>>> +
>>>> +                     /** Pool threshold limit in percentage
>>>> +                      *
>>>> +                      * This value denotes the threshold limit of the 
>>>> pool in
>>>> +                      * percentage of the total size of the pool and is 
>>>> used
>>>> +                      * to configure the Random Early Discard (RED).
>>>> +                      * When the number of packets in the pool is greater
>>>> +                      * than this value RED is initiated in the pool and
>>>> +                      * further incoming packets to the pool are dropped 
>>>> in
>>>> +                      * a random sequence. */
>>>> +                     uint8_t threshold_limit;
>>> Is threshold limit "a percentage of total size of the pool" (hence I
>>> guess 0-100) or rather an absolute value that triggers RED?
>>
>> Do we want to tie this specifically to RED or try to make things more
>> general? There are many types of flow/congestion control algorithms
>> that can be used so perhaps that should be better parameterized? Also,
>> when specifying thresholds it's customary to set high and low
>> watermarks to provide hysteresis. Some algorithms also need more than
>> one data point to control the curves, so again this suggests that we
>> need additional parameterization for this.
>>
> I'm not disputing the generalization, I've mentioned RED because it's
> right there in the comment.
> What I meant is whether this is a percentage value or absolute value (as
> in number of buffers), because commit message suggested former and this
> comments suggest latter with "When the number of packets in the pool is
> greater than this value".

So lets say the total size of the packet pool is 1024 segments and the
threshold for starting/ stopping RED is 750 segments then the
threshold limit is set as 75% rather than the absolute value of 750
segments. I will update the commit message to make it more clear.

>
> Additionally, shouldn't it be "when number of packets in this pool is
> _lower_ than this value"? Since otherwise we're saying that congestion
> algorithms are to be applied on a full pull.

I will update the documentation to indicate when RED gets dropped in
the system. The logic is RED is enabled when packets in pool is
greater than threshold and RED is disabled when packets in pool is
less than or equal to threshold limit.

Regards,
Bala
>>>
>>>>               } pkt;
>>>>
>>>>               /** Parameters for timeout pools */
>>>> @@ -329,6 +344,23 @@ uint64_t odp_pool_to_u64(odp_pool_t hdl);
>>>>  void odp_pool_param_init(odp_pool_param_t *param);
>>>>
>>>>  /**
>>>> + * Set threshold limit of the pool
>>>> + *
>>>> + * Set the threshold limit of the pool as a percentage of the total
>>>> + * size of the pool. This value is used to configure Random Early 
>>>> Discard(RED)
>>>> + * parameters of the pool and any incoming packets to the pool after 
>>>> reaching
>>>> + * this threshold is dropped in a random sequence.
>>>> + *
>>>> + * @param pool                       Pool handle
>>>> + * @param threshold_limit    Threshold limit of the pool.
>>>> + *
>>>> + * @retval                   0 on success
>>>> + * @retval                   -1 on failure
>>>> + */
>>>> +
>>>> +int odp_pool_threshold_limit(odp_pool_t pool, uint8_t threshold_limit);
>>>> +
>>>> +/**
>>>>   * @}
>>>>   */
>>>>
>>>>

Reply via email to