diff mbox series

[net-next,12/16] dt-bindings: net: dwmac: Add MTL Tx Queue properties constraints

Message ID 20230313225103.30512-13-Sergey.Semin@baikalelectronics.ru (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series dt-bindings: net: dwmac: Extend clocks, props desc and constraints | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/apply fail Patch does not apply to net-next

Commit Message

Serge Semin March 13, 2023, 10:50 p.m. UTC
Currently none of the MTL Tx Queues QoS-related DT-properties have been
equipped with the proper constraints meanwhile they can be specified at
least based on the corresponding CSR field sizes or the DW (x|xG)MAC
IP-core synthesize parameter constraints. Let's do that:
+ snps,tx-queues-to-use - number of Tx queues to utilise is limited with a
number of available queues. DW MAC/GMAC: no queues, DW Eth QoS: <= 8, DW
xGMAC: <= 16.
+ snps,weight - Tx Queue/Traffic Class quantum/weight utilised depending
on enabled algorithm for the Data Center Bridging feature: DWRR (up to
0x1312D0 bytes to add to credit) or WFQ (up to 0x3FFF - least bandwidth)
or WFQ (up to 0x64). DW MAC/GMAC: no queues, DW Eth QoS: <= 0x1312D0, DW
xGMAC: <= 0x1312D0.
+ snps,send_slope - Tx Queue/Traffic Class Send-Slope credit value
subtracted from the accumulated credit for the Audio/Video bridging
feature (CBS algorithm, bits per cycle scaled up by 1,024). DW MAC/GMAC:
no queues, DW Eth QoS: <= 0x2000, DW xGMAC: <= 0x3FFF.
+ snps,idle_slope - same meaning as snps,send_slope except it's determines
the Idle-Slope credit of CBS algorithm. DW MAC/GMAC: no queues, DW Eth
QoS: <= 0x2000, DW xGMAC: <= 0x8000.
+ snps,high_credit/snps,low_credit - maximum and minimum values
accumulated in the credit for the Audio/Video bridging feature (CBS
algorithm, bits scaled up by 1,024). DW MAC/GMAC: no queues, DW Eth
QoS: <= 0x1FFFFFFF, DW xGMAC: <= 0x1FFFFFFF.
+ snps,priority - Tx Queue/Traffic Class priority (enabled by the
PFC-packets) limits determined by the VLAN tag PRI field width (it's 7).
DW MAC/GMAC: no queues, DW Eth QoS: 0xff, DW xGMAC: 0xff.

Since the constraints vary for different IP-cores and the DT-schema is
common for all of them the least restrictive values are chosen. The info
above can be used for the IP-core specific DT-schemas if anybody ever is
bothered with one to create.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 .../bindings/net/snps,dwmac-generic.yaml      |  2 +-
 .../devicetree/bindings/net/snps,dwmac.yaml   | 24 ++++++++++++++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)

Comments

Krzysztof Kozlowski March 16, 2023, 8:08 a.m. UTC | #1
On 13/03/2023 23:50, Serge Semin wrote:
> Currently none of the MTL Tx Queues QoS-related DT-properties have been
> equipped with the proper constraints meanwhile they can be specified at
> least based on the corresponding CSR field sizes or the DW (x|xG)MAC
> IP-core synthesize parameter constraints. Let's do that:
> + snps,tx-queues-to-use - number of Tx queues to utilise is limited with a
> number of available queues. DW MAC/GMAC: no queues, DW Eth QoS: <= 8, DW
> xGMAC: <= 16.
> + snps,weight - Tx Queue/Traffic Class quantum/weight utilised depending
> on enabled algorithm for the Data Center Bridging feature: DWRR (up to
> 0x1312D0 bytes to add to credit) or WFQ (up to 0x3FFF - least bandwidth)
> or WFQ (up to 0x64). DW MAC/GMAC: no queues, DW Eth QoS: <= 0x1312D0, DW
> xGMAC: <= 0x1312D0.
> + snps,send_slope - Tx Queue/Traffic Class Send-Slope credit value
> subtracted from the accumulated credit for the Audio/Video bridging
> feature (CBS algorithm, bits per cycle scaled up by 1,024). DW MAC/GMAC:
> no queues, DW Eth QoS: <= 0x2000, DW xGMAC: <= 0x3FFF.
> + snps,idle_slope - same meaning as snps,send_slope except it's determines
> the Idle-Slope credit of CBS algorithm. DW MAC/GMAC: no queues, DW Eth
> QoS: <= 0x2000, DW xGMAC: <= 0x8000.
> + snps,high_credit/snps,low_credit - maximum and minimum values
> accumulated in the credit for the Audio/Video bridging feature (CBS
> algorithm, bits scaled up by 1,024). DW MAC/GMAC: no queues, DW Eth
> QoS: <= 0x1FFFFFFF, DW xGMAC: <= 0x1FFFFFFF.
> + snps,priority - Tx Queue/Traffic Class priority (enabled by the
> PFC-packets) limits determined by the VLAN tag PRI field width (it's 7).
> DW MAC/GMAC: no queues, DW Eth QoS: 0xff, DW xGMAC: 0xff.
> 
> Since the constraints vary for different IP-cores and the DT-schema is
> common for all of them the least restrictive values are chosen. The info
> above can be used for the IP-core specific DT-schemas if anybody ever is
> bothered with one to create.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> ---
>  .../bindings/net/snps,dwmac-generic.yaml      |  2 +-
>  .../devicetree/bindings/net/snps,dwmac.yaml   | 24 ++++++++++++++++++-
>  2 files changed, 24 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml b/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml
> index ae740a1ab213..2974af79511d 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml
> @@ -137,7 +137,7 @@ examples:
>                  snps,send_slope = <0x1000>;
>                  snps,idle_slope = <0x1000>;
>                  snps,high_credit = <0x3E800>;
> -                snps,low_credit = <0xFFC18000>;
> +                snps,low_credit = <0x1FC18000>;
>                  snps,priority = <0x1>;
>              };
>          };
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index e5662b1498b7..2ebf7995426b 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -250,6 +250,10 @@ properties:
>        snps,tx-queues-to-use:
>          $ref: /schemas/types.yaml#/definitions/uint32
>          description: number of TX queues to be used in the driver
> +        default: 1
> +        minimum: 1
> +        maximum: 16
> +
>        snps,tx-sched-wrr:
>          type: boolean
>          description: Weighted Round Robin
> @@ -296,13 +300,16 @@ properties:
>              snps,tx-sched-wfq: false
>              snps,tx-sched-dwrr: false
>      patternProperties:
> -      "^queue[0-9]$":
> +      "^queue([0-9]|1[0-5])$":
>          description: Each subnode represents a queue.
>          type: object
>          properties:
>            snps,weight:
>              $ref: /schemas/types.yaml#/definitions/uint32
>              description: TX queue weight (if using a DCB weight algorithm)
> +            minimum: 0
> +            maximum: 0x1312D0
> +
>            snps,dcb-algorithm:
>              type: boolean
>              description: TX queue will be working in DCB
> @@ -315,15 +322,27 @@ properties:
>            snps,send_slope:
>              $ref: /schemas/types.yaml#/definitions/uint32
>              description: enable Low Power Interface
> +            minimum: 0
> +            maximum: 0x3FFF

lowercase hex everywhere.

Best regards,
Krzysztof
Serge Semin March 23, 2023, 11:55 a.m. UTC | #2
On Thu, Mar 16, 2023 at 09:08:02AM +0100, Krzysztof Kozlowski wrote:
> On 13/03/2023 23:50, Serge Semin wrote:
> > Currently none of the MTL Tx Queues QoS-related DT-properties have been
> > equipped with the proper constraints meanwhile they can be specified at
> > least based on the corresponding CSR field sizes or the DW (x|xG)MAC
> > IP-core synthesize parameter constraints. Let's do that:
> > + snps,tx-queues-to-use - number of Tx queues to utilise is limited with a
> > number of available queues. DW MAC/GMAC: no queues, DW Eth QoS: <= 8, DW
> > xGMAC: <= 16.
> > + snps,weight - Tx Queue/Traffic Class quantum/weight utilised depending
> > on enabled algorithm for the Data Center Bridging feature: DWRR (up to
> > 0x1312D0 bytes to add to credit) or WFQ (up to 0x3FFF - least bandwidth)
> > or WFQ (up to 0x64). DW MAC/GMAC: no queues, DW Eth QoS: <= 0x1312D0, DW
> > xGMAC: <= 0x1312D0.
> > + snps,send_slope - Tx Queue/Traffic Class Send-Slope credit value
> > subtracted from the accumulated credit for the Audio/Video bridging
> > feature (CBS algorithm, bits per cycle scaled up by 1,024). DW MAC/GMAC:
> > no queues, DW Eth QoS: <= 0x2000, DW xGMAC: <= 0x3FFF.
> > + snps,idle_slope - same meaning as snps,send_slope except it's determines
> > the Idle-Slope credit of CBS algorithm. DW MAC/GMAC: no queues, DW Eth
> > QoS: <= 0x2000, DW xGMAC: <= 0x8000.
> > + snps,high_credit/snps,low_credit - maximum and minimum values
> > accumulated in the credit for the Audio/Video bridging feature (CBS
> > algorithm, bits scaled up by 1,024). DW MAC/GMAC: no queues, DW Eth
> > QoS: <= 0x1FFFFFFF, DW xGMAC: <= 0x1FFFFFFF.
> > + snps,priority - Tx Queue/Traffic Class priority (enabled by the
> > PFC-packets) limits determined by the VLAN tag PRI field width (it's 7).
> > DW MAC/GMAC: no queues, DW Eth QoS: 0xff, DW xGMAC: 0xff.
> > 
> > Since the constraints vary for different IP-cores and the DT-schema is
> > common for all of them the least restrictive values are chosen. The info
> > above can be used for the IP-core specific DT-schemas if anybody ever is
> > bothered with one to create.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > ---
> >  .../bindings/net/snps,dwmac-generic.yaml      |  2 +-
> >  .../devicetree/bindings/net/snps,dwmac.yaml   | 24 ++++++++++++++++++-
> >  2 files changed, 24 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml b/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml
> > index ae740a1ab213..2974af79511d 100644
> > --- a/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml
> > +++ b/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml
> > @@ -137,7 +137,7 @@ examples:
> >                  snps,send_slope = <0x1000>;
> >                  snps,idle_slope = <0x1000>;
> >                  snps,high_credit = <0x3E800>;
> > -                snps,low_credit = <0xFFC18000>;
> > +                snps,low_credit = <0x1FC18000>;
> >                  snps,priority = <0x1>;
> >              };
> >          };
> > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > index e5662b1498b7..2ebf7995426b 100644
> > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > @@ -250,6 +250,10 @@ properties:
> >        snps,tx-queues-to-use:
> >          $ref: /schemas/types.yaml#/definitions/uint32
> >          description: number of TX queues to be used in the driver
> > +        default: 1
> > +        minimum: 1
> > +        maximum: 16
> > +
> >        snps,tx-sched-wrr:
> >          type: boolean
> >          description: Weighted Round Robin
> > @@ -296,13 +300,16 @@ properties:
> >              snps,tx-sched-wfq: false
> >              snps,tx-sched-dwrr: false
> >      patternProperties:
> > -      "^queue[0-9]$":
> > +      "^queue([0-9]|1[0-5])$":
> >          description: Each subnode represents a queue.
> >          type: object
> >          properties:
> >            snps,weight:
> >              $ref: /schemas/types.yaml#/definitions/uint32
> >              description: TX queue weight (if using a DCB weight algorithm)
> > +            minimum: 0
> > +            maximum: 0x1312D0
> > +
> >            snps,dcb-algorithm:
> >              type: boolean
> >              description: TX queue will be working in DCB
> > @@ -315,15 +322,27 @@ properties:
> >            snps,send_slope:
> >              $ref: /schemas/types.yaml#/definitions/uint32
> >              description: enable Low Power Interface
> > +            minimum: 0
> > +            maximum: 0x3FFF
> 
> lowercase hex everywhere.

Got it. Thanks.

-Serge(y)

> 
> Best regards,
> Krzysztof
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml b/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml
index ae740a1ab213..2974af79511d 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml
@@ -137,7 +137,7 @@  examples:
                 snps,send_slope = <0x1000>;
                 snps,idle_slope = <0x1000>;
                 snps,high_credit = <0x3E800>;
-                snps,low_credit = <0xFFC18000>;
+                snps,low_credit = <0x1FC18000>;
                 snps,priority = <0x1>;
             };
         };
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index e5662b1498b7..2ebf7995426b 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -250,6 +250,10 @@  properties:
       snps,tx-queues-to-use:
         $ref: /schemas/types.yaml#/definitions/uint32
         description: number of TX queues to be used in the driver
+        default: 1
+        minimum: 1
+        maximum: 16
+
       snps,tx-sched-wrr:
         type: boolean
         description: Weighted Round Robin
@@ -296,13 +300,16 @@  properties:
             snps,tx-sched-wfq: false
             snps,tx-sched-dwrr: false
     patternProperties:
-      "^queue[0-9]$":
+      "^queue([0-9]|1[0-5])$":
         description: Each subnode represents a queue.
         type: object
         properties:
           snps,weight:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: TX queue weight (if using a DCB weight algorithm)
+            minimum: 0
+            maximum: 0x1312D0
+
           snps,dcb-algorithm:
             type: boolean
             description: TX queue will be working in DCB
@@ -315,15 +322,27 @@  properties:
           snps,send_slope:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: enable Low Power Interface
+            minimum: 0
+            maximum: 0x3FFF
+
           snps,idle_slope:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: unlock on WoL
+            minimum: 0
+            maximum: 0x8000
+
           snps,high_credit:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: max write outstanding req. limit
+            minimum: 0
+            maximum: 0x1FFFFFFF
+
           snps,low_credit:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: max read outstanding req. limit
+            minimum: 0
+            maximum: 0x1FFFFFFF
+
           snps,priority:
             $ref: /schemas/types.yaml#/definitions/uint32
             description:
@@ -331,6 +350,9 @@  properties:
               When a PFC frame is received with priorities matching the bitmask,
               the queue is blocked from transmitting for the pause time specified
               in the PFC frame.
+            minimum: 0
+            maximum: 0xFF
+
         allOf:
           - if:
               required: