diff mbox series

[net-next,09/13] dt-bindings: net: airoha: Add airoha,npu phandle property

Message ID 20250205-airoha-en7581-flowtable-offload-v1-9-d362cfa97b01@kernel.org (mailing list archive)
State New
Headers show
Series Introduce flowtable hw offloading in airoha_eth driver | expand

Commit Message

Lorenzo Bianconi Feb. 5, 2025, 6:21 p.m. UTC
Introduce the airoha,npu property for the npu syscon node available on
EN7581 SoC. The airoha Network Processor Unit (NPU) is used to offload
network traffic forwarded between Packet Switch Engine (PSE) ports.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Conor Dooley Feb. 5, 2025, 7:10 p.m. UTC | #1
On Wed, Feb 05, 2025 at 07:21:28PM +0100, Lorenzo Bianconi wrote:
> Introduce the airoha,npu property for the npu syscon node available on
> EN7581 SoC. The airoha Network Processor Unit (NPU) is used to offload
> network traffic forwarded between Packet Switch Engine (PSE) ports.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> index c578637c5826db4bf470a4d01ac6f3133976ae1a..6388afff64e990a20230b0c4e58534aa61f984da 100644
> --- a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> +++ b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> @@ -63,6 +63,12 @@ properties:
>    "#size-cells":
>      const: 0
>  
> +  airoha,npu:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      Phandle to the syscon node used to configure the NPU module
> +      used for traffic offloading.

Why do you need a phandle for this, instead of a lookup by compatible?
Do you have multiple instances of this ethernet controller on the
device, that each need to look up a different npu?

> +
>  patternProperties:
>    "^ethernet@[1-4]$":
>      type: object
> @@ -132,6 +138,8 @@ examples:
>                       <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
>                       <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
>  
> +        airoha,npu = <&npu>;
> +
>          #address-cells = <1>;
>          #size-cells = <0>;
>  
> 
> -- 
> 2.48.1
>
Lorenzo Bianconi Feb. 5, 2025, 7:33 p.m. UTC | #2
> On Wed, Feb 05, 2025 at 07:21:28PM +0100, Lorenzo Bianconi wrote:
> > Introduce the airoha,npu property for the npu syscon node available on
> > EN7581 SoC. The airoha Network Processor Unit (NPU) is used to offload
> > network traffic forwarded between Packet Switch Engine (PSE) ports.
> > 
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> >  Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > index c578637c5826db4bf470a4d01ac6f3133976ae1a..6388afff64e990a20230b0c4e58534aa61f984da 100644
> > --- a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > +++ b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > @@ -63,6 +63,12 @@ properties:
> >    "#size-cells":
> >      const: 0
> >  
> > +  airoha,npu:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> > +    description:
> > +      Phandle to the syscon node used to configure the NPU module
> > +      used for traffic offloading.
> 
> Why do you need a phandle for this, instead of a lookup by compatible?
> Do you have multiple instances of this ethernet controller on the
> device, that each need to look up a different npu?

actually not, but looking up via the compatible string has been naked by
Krzysztof on a different series [0].

Regards,
Lorenzo

[0] https://patchwork.kernel.org/project/linux-pci/patch/20250115-en7581-pcie-pbus-csr-v1-2-40d8fcb9360f@kernel.org/

> 
> > +
> >  patternProperties:
> >    "^ethernet@[1-4]$":
> >      type: object
> > @@ -132,6 +138,8 @@ examples:
> >                       <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
> >                       <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
> >  
> > +        airoha,npu = <&npu>;
> > +
> >          #address-cells = <1>;
> >          #size-cells = <0>;
> >  
> > 
> > -- 
> > 2.48.1
> >
Conor Dooley Feb. 5, 2025, 8:01 p.m. UTC | #3
On Wed, Feb 05, 2025 at 08:33:13PM +0100, Lorenzo Bianconi wrote:
> > On Wed, Feb 05, 2025 at 07:21:28PM +0100, Lorenzo Bianconi wrote:
> > > Introduce the airoha,npu property for the npu syscon node available on
> > > EN7581 SoC. The airoha Network Processor Unit (NPU) is used to offload
> > > network traffic forwarded between Packet Switch Engine (PSE) ports.
> > > 
> > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > ---
> > >  Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > index c578637c5826db4bf470a4d01ac6f3133976ae1a..6388afff64e990a20230b0c4e58534aa61f984da 100644
> > > --- a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > +++ b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > @@ -63,6 +63,12 @@ properties:
> > >    "#size-cells":
> > >      const: 0
> > >  
> > > +  airoha,npu:
> > > +    $ref: /schemas/types.yaml#/definitions/phandle
> > > +    description:
> > > +      Phandle to the syscon node used to configure the NPU module
> > > +      used for traffic offloading.
> > 
> > Why do you need a phandle for this, instead of a lookup by compatible?
> > Do you have multiple instances of this ethernet controller on the
> > device, that each need to look up a different npu?
> 
> actually not, but looking up via the compatible string has been naked by
> Krzysztof on a different series [0].

Hmm, I disagree with adding phandles that are not needed. I don't agree
that there's no reuse, if you can treat the phandle identically on a new
device, in all likelihood, that node should have a fallback to the
existing one.

That said, the bigger problem in what you link is the ABI break caused by
requiring the presence of a new node. I'd NAK that patch too.

> 
> Regards,
> Lorenzo
> 
> [0] https://patchwork.kernel.org/project/linux-pci/patch/20250115-en7581-pcie-pbus-csr-v1-2-40d8fcb9360f@kernel.org/
> 
> > 
> > > +
> > >  patternProperties:
> > >    "^ethernet@[1-4]$":
> > >      type: object
> > > @@ -132,6 +138,8 @@ examples:
> > >                       <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
> > >                       <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
> > >  
> > > +        airoha,npu = <&npu>;
> > > +
> > >          #address-cells = <1>;
> > >          #size-cells = <0>;
> > >  
> > > 
> > > -- 
> > > 2.48.1
> > > 
> 
>
Conor Dooley Feb. 5, 2025, 8:28 p.m. UTC | #4
On Wed, Feb 05, 2025 at 08:01:26PM +0000, Conor Dooley wrote:
> On Wed, Feb 05, 2025 at 08:33:13PM +0100, Lorenzo Bianconi wrote:
> > > On Wed, Feb 05, 2025 at 07:21:28PM +0100, Lorenzo Bianconi wrote:
> > > > Introduce the airoha,npu property for the npu syscon node available on
> > > > EN7581 SoC. The airoha Network Processor Unit (NPU) is used to offload
> > > > network traffic forwarded between Packet Switch Engine (PSE) ports.
> > > > 
> > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > ---
> > > >  Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml | 8 ++++++++
> > > >  1 file changed, 8 insertions(+)
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > > index c578637c5826db4bf470a4d01ac6f3133976ae1a..6388afff64e990a20230b0c4e58534aa61f984da 100644
> > > > --- a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > > +++ b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > > @@ -63,6 +63,12 @@ properties:
> > > >    "#size-cells":
> > > >      const: 0
> > > >  
> > > > +  airoha,npu:
> > > > +    $ref: /schemas/types.yaml#/definitions/phandle
> > > > +    description:
> > > > +      Phandle to the syscon node used to configure the NPU module
> > > > +      used for traffic offloading.
> > > 
> > > Why do you need a phandle for this, instead of a lookup by compatible?
> > > Do you have multiple instances of this ethernet controller on the
> > > device, that each need to look up a different npu?
> > 
> > actually not, but looking up via the compatible string has been naked by
> > Krzysztof on a different series [0].
> 
> Hmm, I disagree with adding phandles that are not needed. I don't agree
> that there's no reuse, if you can treat the phandle identically on a new
> device, in all likelihood, that node should have a fallback to the
> existing one.

Also, where is the binding for this npu? It looks like a brand-new
module that you're adding a driver for in this series and a phandle to
the node for here but I see no binding for it.

> 
> That said, the bigger problem in what you link is the ABI break caused by
> requiring the presence of a new node. I'd NAK that patch too.
> 
> > 
> > Regards,
> > Lorenzo
> > 
> > [0] https://patchwork.kernel.org/project/linux-pci/patch/20250115-en7581-pcie-pbus-csr-v1-2-40d8fcb9360f@kernel.org/
> > 
> > > 
> > > > +
> > > >  patternProperties:
> > > >    "^ethernet@[1-4]$":
> > > >      type: object
> > > > @@ -132,6 +138,8 @@ examples:
> > > >                       <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
> > > >                       <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
> > > >  
> > > > +        airoha,npu = <&npu>;
> > > > +
> > > >          #address-cells = <1>;
> > > >          #size-cells = <0>;
> > > >  
> > > > 
> > > > -- 
> > > > 2.48.1
> > > > 
> > 
> > 
> 
>
Lorenzo Bianconi Feb. 5, 2025, 8:52 p.m. UTC | #5
> On Wed, Feb 05, 2025 at 08:33:13PM +0100, Lorenzo Bianconi wrote:
> > > On Wed, Feb 05, 2025 at 07:21:28PM +0100, Lorenzo Bianconi wrote:
> > > > Introduce the airoha,npu property for the npu syscon node available on
> > > > EN7581 SoC. The airoha Network Processor Unit (NPU) is used to offload
> > > > network traffic forwarded between Packet Switch Engine (PSE) ports.
> > > > 
> > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > ---
> > > >  Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml | 8 ++++++++
> > > >  1 file changed, 8 insertions(+)
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > > index c578637c5826db4bf470a4d01ac6f3133976ae1a..6388afff64e990a20230b0c4e58534aa61f984da 100644
> > > > --- a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > > +++ b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > > @@ -63,6 +63,12 @@ properties:
> > > >    "#size-cells":
> > > >      const: 0
> > > >  
> > > > +  airoha,npu:
> > > > +    $ref: /schemas/types.yaml#/definitions/phandle
> > > > +    description:
> > > > +      Phandle to the syscon node used to configure the NPU module
> > > > +      used for traffic offloading.
> > > 
> > > Why do you need a phandle for this, instead of a lookup by compatible?
> > > Do you have multiple instances of this ethernet controller on the
> > > device, that each need to look up a different npu?
> > 
> > actually not, but looking up via the compatible string has been naked by
> > Krzysztof on a different series [0].
> 
> Hmm, I disagree with adding phandles that are not needed. I don't agree
> that there's no reuse, if you can treat the phandle identically on a new
> device, in all likelihood, that node should have a fallback to the
> existing one.

honestly I do not have a strong opinion about it, I am fine both ways.

> 
> That said, the bigger problem in what you link is the ABI break caused by
> requiring the presence of a new node. I'd NAK that patch too.

there is no PCIe support in dts for this device upstream yet, so I guess there
is no ABI break, right?

Regards,
Lorenzo

> 
> > 
> > Regards,
> > Lorenzo
> > 
> > [0] https://patchwork.kernel.org/project/linux-pci/patch/20250115-en7581-pcie-pbus-csr-v1-2-40d8fcb9360f@kernel.org/
> > 
> > > 
> > > > +
> > > >  patternProperties:
> > > >    "^ethernet@[1-4]$":
> > > >      type: object
> > > > @@ -132,6 +138,8 @@ examples:
> > > >                       <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
> > > >                       <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
> > > >  
> > > > +        airoha,npu = <&npu>;
> > > > +
> > > >          #address-cells = <1>;
> > > >          #size-cells = <0>;
> > > >  
> > > > 
> > > > -- 
> > > > 2.48.1
> > > > 
> > 
> > 
> 
>
Lorenzo Bianconi Feb. 5, 2025, 8:54 p.m. UTC | #6
> On Wed, Feb 05, 2025 at 08:01:26PM +0000, Conor Dooley wrote:
> > On Wed, Feb 05, 2025 at 08:33:13PM +0100, Lorenzo Bianconi wrote:
> > > > On Wed, Feb 05, 2025 at 07:21:28PM +0100, Lorenzo Bianconi wrote:
> > > > > Introduce the airoha,npu property for the npu syscon node available on
> > > > > EN7581 SoC. The airoha Network Processor Unit (NPU) is used to offload
> > > > > network traffic forwarded between Packet Switch Engine (PSE) ports.
> > > > > 
> > > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > > ---
> > > > >  Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml | 8 ++++++++
> > > > >  1 file changed, 8 insertions(+)
> > > > > 
> > > > > diff --git a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > > > index c578637c5826db4bf470a4d01ac6f3133976ae1a..6388afff64e990a20230b0c4e58534aa61f984da 100644
> > > > > --- a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > > > +++ b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
> > > > > @@ -63,6 +63,12 @@ properties:
> > > > >    "#size-cells":
> > > > >      const: 0
> > > > >  
> > > > > +  airoha,npu:
> > > > > +    $ref: /schemas/types.yaml#/definitions/phandle
> > > > > +    description:
> > > > > +      Phandle to the syscon node used to configure the NPU module
> > > > > +      used for traffic offloading.
> > > > 
> > > > Why do you need a phandle for this, instead of a lookup by compatible?
> > > > Do you have multiple instances of this ethernet controller on the
> > > > device, that each need to look up a different npu?
> > > 
> > > actually not, but looking up via the compatible string has been naked by
> > > Krzysztof on a different series [0].
> > 
> > Hmm, I disagree with adding phandles that are not needed. I don't agree
> > that there's no reuse, if you can treat the phandle identically on a new
> > device, in all likelihood, that node should have a fallback to the
> > existing one.
> 
> Also, where is the binding for this npu? It looks like a brand-new
> module that you're adding a driver for in this series and a phandle to
> the node for here but I see no binding for it.

The driver loads the NPU node just as syscon so I have not added the binding
for it to the series. I will add it in v2.

Regards,
Lorenzo

> 
> > 
> > That said, the bigger problem in what you link is the ABI break caused by
> > requiring the presence of a new node. I'd NAK that patch too.
> > 
> > > 
> > > Regards,
> > > Lorenzo
> > > 
> > > [0] https://patchwork.kernel.org/project/linux-pci/patch/20250115-en7581-pcie-pbus-csr-v1-2-40d8fcb9360f@kernel.org/
> > > 
> > > > 
> > > > > +
> > > > >  patternProperties:
> > > > >    "^ethernet@[1-4]$":
> > > > >      type: object
> > > > > @@ -132,6 +138,8 @@ examples:
> > > > >                       <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
> > > > >                       <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
> > > > >  
> > > > > +        airoha,npu = <&npu>;
> > > > > +
> > > > >          #address-cells = <1>;
> > > > >          #size-cells = <0>;
> > > > >  
> > > > > 
> > > > > -- 
> > > > > 2.48.1
> > > > > 
> > > 
> > > 
> > 
> > 
> 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
index c578637c5826db4bf470a4d01ac6f3133976ae1a..6388afff64e990a20230b0c4e58534aa61f984da 100644
--- a/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
+++ b/Documentation/devicetree/bindings/net/airoha,en7581-eth.yaml
@@ -63,6 +63,12 @@  properties:
   "#size-cells":
     const: 0
 
+  airoha,npu:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle to the syscon node used to configure the NPU module
+      used for traffic offloading.
+
 patternProperties:
   "^ethernet@[1-4]$":
     type: object
@@ -132,6 +138,8 @@  examples:
                      <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
                      <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
 
+        airoha,npu = <&npu>;
+
         #address-cells = <1>;
         #size-cells = <0>;