diff mbox series

[2/3] dt-bindings: net: snps,dwmac: Add time-based-scheduling property

Message ID 30ce8f45b8752c603acc861ebb2f18d74d2f8a07.1706105494.git.esben@geanix.com
State New
Headers show
Series None | expand

Commit Message

Esben Haabendal Jan. 24, 2024, 2:33 p.m. UTC
Time Based Scheduling can be enabled per TX queue, if supported by the
controller.

Signed-off-by: Esben Haabendal <esben@geanix.com>
---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Conor Dooley Jan. 25, 2024, 5:14 p.m. UTC | #1
On Thu, Jan 25, 2024 at 12:55:12PM +0100, esben@geanix.com wrote:
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> writes:
> 
> > On 25/01/2024 10:10, esben@geanix.com wrote:
> >> Conor Dooley <conor@kernel.org> writes:
> >> 
> >>> On Wed, Jan 24, 2024 at 03:33:06PM +0100, Esben Haabendal wrote:
> >>>> Time Based Scheduling can be enabled per TX queue, if supported by the
> >>>> controller.
> >>>
> >>> If time based scheduling is not supported by the controller, then the
> >>> property should not be present! The presence of a property like this
> >>> should mean that the feature is supported, using it is up to the
> >>> operating system.
> >>>
> >>> That said, why is this a property that should be in DT?
> >> 
> >> It is added to the tx-queues-config object of snps,dwmac bindings. This
> >> entire object is about configuration of the ethernet controller, which
> >> is also what the purpose of the snps,time-based-scheduling.
> >> So yes, it is not specifically about describing what the hardware is
> >> capable of, but how the hardware is configured. It is a continuation of
> >> the current driver design.
> >> 
> >>> If support is per controller is it not sufficient to use the
> >>> compatible to determine if this is supported?
> >> 
> >> Are you suggesting to include the mapping from all supported compatible
> >> controllers to which TX queues supports TBS in the driver code?  What
> >> would the benefit of that compared to describing it explicitly in the
> >> binding?
> >
> > The benefit is complying with DT bindings rules, saying that bindings
> > describe hardware pieces, not drivers.
> 
> Understood.
> 
> >> And for the purpose of the above question, I am talking about it as if
> >> the binding was describing the hardware capability and not the
> >> configuration.
> >
> > "if"? You wrote it is for driver design...
> 
> If you look at the current driver, all the devicetree bindings under
> rx-queues-config and tx-queues-config are violating the DT binding
> rules.
> Cleaning up that requires quite some work and I guess will break
> backwards compatibility to some extend.

Let bygones be bygones. If something undesirable got in previously,
breaking backwards compatibility there is not justified IMO.
Rob Herring (Arm) Jan. 30, 2024, 9:39 p.m. UTC | #2
On Wed, Jan 24, 2024 at 03:33:06PM +0100, Esben Haabendal wrote:
> Time Based Scheduling can be enabled per TX queue, if supported by the
> controller.
> 
> Signed-off-by: Esben Haabendal <esben@geanix.com>
> ---
>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)

This is not v1 which you are aware. Where's the justification or do I 
need to ask the same questions again? Here's the last discussion[1].

I'm still not clear on why this is needed. Seems like the combination of 
TBS and TSO capabilities provides enough information. If TSO is enabled 
for a queue, then don't enable TBS.

This binding is already such a mess of properties, I'm inclined to say 
"what's one more", but it's death by 1000 cuts. Part of the problem is 
this binding is for not 1 IP block, but something that's evolved over 
at least 15 years. 

The question on configuration properties really comes down to who would 
configure things and when. If it's one time for the life of given h/w, 
then DT makes sense. If every user wants/needs to tweak the setting, 
then definitely shouldn't be in DT. Somewhere in the middle? Judgement 
call.

> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index 5c2769dc689a..301e9150ecc3 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -399,6 +399,12 @@ properties:
>              type: boolean
>              description: TX checksum offload is unsupported by the TX queue.
>  
> +          snps,time-based-scheduling:
> +            type: boolean
> +            description:
> +              Time Based Scheduling will be enabled for TX queue.
> +              This is typically not supported for TX queue 0.

Make the property name clear it is an enable, not a capability.

> +

[1] https://lore.kernel.org/all/20230929051758.21492-1-rohan.g.thomas@intel.com/
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 5c2769dc689a..301e9150ecc3 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -399,6 +399,12 @@  properties:
             type: boolean
             description: TX checksum offload is unsupported by the TX queue.
 
+          snps,time-based-scheduling:
+            type: boolean
+            description:
+              Time Based Scheduling will be enabled for TX queue.
+              This is typically not supported for TX queue 0.
+
         allOf:
           - if:
               required: