[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e802d4c0-7247-346f-e6da-4965068d131c@gmail.com>
Date: Fri, 8 Jan 2021 20:03:52 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Vladimir Oltean <olteanv@...il.com>, netdev@...r.kernel.org
Cc: alexandre.belloni@...tlin.com, andrew@...n.ch,
vivien.didelot@...il.com, alexandru.marginean@....com,
claudiu.manoil@....com, xiaoliang.yang_1@....com,
hongbo.wang@....com, kuba@...nel.org, jiri@...nulli.us,
idosch@...sch.org, UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH v3 net-next 10/10] net: mscc: ocelot: configure watermarks
using devlink-sb
On 1/8/2021 9:59 AM, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@....com>
>
> Using devlink-sb, we can configure 12/16 (the important 75%) of the
> switch's controlling watermarks for congestion drops, and we can monitor
> 50% of the watermark occupancies (we can monitor the reservation
> watermarks, but not the sharing watermarks, which are exposed as pool
> sizes).
>
> The following definitions can be made:
>
> SB_BUF=0 # The devlink-sb for frame buffers
> SB_REF=1 # The devlink-sb for frame references
> POOL_ING=0 # The pool for ingress traffic. Both devlink-sb instances
> # have one of these.
> POOL_EGR=1 # The pool for egress traffic. Both devlink-sb instances
> # have one of these.
>
> Editing the hardware watermarks is done in the following way:
> BUF_xxxx_I is accessed when sb=$SB_BUF and pool=$POOL_ING
> REF_xxxx_I is accessed when sb=$SB_REF and pool=$POOL_ING
> BUF_xxxx_E is accessed when sb=$SB_BUF and pool=$POOL_EGR
> REF_xxxx_E is accessed when sb=$SB_REF and pool=$POOL_EGR
>
> Configuring the sharing watermarks for COL_SHR(dp=0) is done implicitly
> by modifying the corresponding pool size. By default, the pool size has
> maximum size, so this can be skipped.
>
> devlink sb pool set pci/0000:00:00.5 sb $SB_BUF pool $POOL_ING \
> size 103872 thtype static
>
> Since by default there is no buffer reservation, the above command has
> maxed out BUF_COL_SHR_I(dp=0).
>
> Configuring the per-port reservation watermark (P_RSRV) is done in the
> following way:
>
> devlink sb port pool set pci/0000:00:00.5/0 sb $SB_BUF \
> pool $POOL_ING th 1000
>
> The above command sets BUF_P_RSRV_I(port 0) to 1000 bytes. After this
> command, the sharing watermarks are internally reconfigured with 1000
> bytes less, i.e. from 103872 bytes to 102872 bytes.
>
> Configuring the per-port-tc reservation watermarks (Q_RSRV) is done in
> the following way:
>
> for tc in {0..7}; do
> devlink sb tc bind set pci/0000:00:00.5/0 sb 0 tc $tc \
> type ingress pool $POOL_ING \
> th 3000
> done
>
> The above command sets BUF_Q_RSRV_I(port 0, tc 0..7) to 3000 bytes.
> The sharing watermarks are again reconfigured with 24000 bytes less.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
--
Florian
Powered by blists - more mailing lists