From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>, netdev@vger.kernel.org
Cc: alexandre.belloni@bootlin.com, andrew@lunn.ch,
vivien.didelot@gmail.com, alexandru.marginean@nxp.com,
claudiu.manoil@nxp.com, xiaoliang.yang_1@nxp.com,
hongbo.wang@nxp.com, kuba@kernel.org, jiri@resnulli.us,
idosch@idosch.org, UNGLinuxDriver@microchip.com
Subject: Re: [PATCH v3 net-next 10/10] net: mscc: ocelot: configure watermarks using devlink-sb
Date: Fri, 8 Jan 2021 20:03:52 -0800 [thread overview]
Message-ID: <e802d4c0-7247-346f-e6da-4965068d131c@gmail.com> (raw)
In-Reply-To: <20210108175950.484854-11-olteanv@gmail.com>
On 1/8/2021 9:59 AM, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.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@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
prev parent reply other threads:[~2021-01-09 4:05 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-08 17:59 [PATCH v3 net-next 00/10] Configuring congestion watermarks on ocelot switch using devlink-sb Vladimir Oltean
2021-01-08 17:59 ` [PATCH v3 net-next 01/10] net: mscc: ocelot: auto-detect packet buffer size and number of frame references Vladimir Oltean
2021-01-08 18:30 ` Florian Fainelli
2021-01-08 17:59 ` [PATCH v3 net-next 02/10] net: mscc: ocelot: add ops for decoding watermark threshold and occupancy Vladimir Oltean
2021-01-08 18:30 ` Florian Fainelli
2021-01-10 1:20 ` Jakub Kicinski
2021-01-11 16:53 ` Vladimir Oltean
2021-01-11 19:10 ` Jakub Kicinski
2021-01-08 17:59 ` [PATCH v3 net-next 03/10] net: dsa: add ops for devlink-sb Vladimir Oltean
2021-01-08 18:20 ` Andrew Lunn
2021-01-08 18:31 ` Florian Fainelli
2021-01-08 17:59 ` [PATCH v3 net-next 04/10] net: dsa: felix: reindent struct dsa_switch_ops Vladimir Oltean
2021-01-08 18:33 ` Florian Fainelli
2021-01-10 1:24 ` Jakub Kicinski
2021-01-11 17:01 ` Vladimir Oltean
2021-01-11 19:12 ` Jakub Kicinski
2021-01-08 17:59 ` [PATCH v3 net-next 05/10] net: dsa: felix: perform teardown in reverse order of setup Vladimir Oltean
2021-01-08 18:34 ` Florian Fainelli
2021-01-08 17:59 ` [PATCH v3 net-next 06/10] net: mscc: ocelot: export NUM_TC constant from felix to common switch lib Vladimir Oltean
2021-01-08 18:34 ` Florian Fainelli
2021-01-08 17:59 ` [PATCH v3 net-next 07/10] net: mscc: ocelot: delete unused ocelot_set_cpu_port prototype Vladimir Oltean
2021-01-08 18:35 ` Florian Fainelli
2021-01-08 17:59 ` [PATCH v3 net-next 08/10] net: mscc: ocelot: register devlink ports Vladimir Oltean
2021-01-08 18:36 ` Florian Fainelli
2021-01-10 1:44 ` Jakub Kicinski
2021-01-11 17:13 ` Vladimir Oltean
2021-01-11 19:19 ` Jakub Kicinski
2021-01-14 10:34 ` Vladimir Oltean
2021-01-14 16:44 ` Jakub Kicinski
2021-01-15 17:11 ` Renaming interfaces that are up (Was "Re: [PATCH v3 net-next 08/10] net: mscc: ocelot: register devlink") ports Vladimir Oltean
2021-01-15 19:54 ` Vladimir Oltean
2021-01-10 2:01 ` [PATCH v3 net-next 08/10] net: mscc: ocelot: register devlink ports Jakub Kicinski
2021-01-08 17:59 ` [PATCH v3 net-next 09/10] net: mscc: ocelot: initialize watermarks to sane defaults Vladimir Oltean
2021-01-09 3:59 ` Florian Fainelli
2021-01-08 17:59 ` [PATCH v3 net-next 10/10] net: mscc: ocelot: configure watermarks using devlink-sb Vladimir Oltean
2021-01-09 4:03 ` Florian Fainelli [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e802d4c0-7247-346f-e6da-4965068d131c@gmail.com \
--to=f.fainelli@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandru.marginean@nxp.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=hongbo.wang@nxp.com \
--cc=idosch@idosch.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@gmail.com \
--cc=xiaoliang.yang_1@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).