From: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
To: Rob Herring <robh@kernel.org>
Cc: OpenBMC Maillist <openbmc@lists.ozlabs.org>,
netdev <netdev@vger.kernel.org>,
devicetree@vger.kernel.org,
"David S . Miller" <davem@davemloft.net>,
Samuel Mendoza-Jonas <sam@mendozajonas.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 5/6] dt-bindings: net: Add NCSI bindings
Date: Tue, 14 Jun 2022 10:33:10 +0800 [thread overview]
Message-ID: <aff542a3-ac98-c33d-9612-63ebca180e17@linux.intel.com> (raw)
In-Reply-To: <CAL_Jsq+y3tkfLV8UpUe6jw7Fq7YDrzwoq3FKK4jeeZEBOxhM4g@mail.gmail.com>
On 2022-06-13 23:28, Rob Herring wrote:
> On Fri, Jun 10, 2022 at 9:09 PM Jiaqing Zhao
> <jiaqing.zhao@linux.intel.com> wrote:
>>
>> On 2022-06-11 07:19, Rob Herring wrote:
>>> On Sat, 11 Jun 2022 00:59:39 +0800, Jiaqing Zhao wrote:
>>>> Add devicetree bindings for NCSI VLAN modes. This allows VLAN mode to
>>>> be configured in devicetree.
>>>>
>>>> Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
>>>> ---
>>>> .../devicetree/bindings/net/ncsi.yaml | 34 +++++++++++++++++++
>>>> MAINTAINERS | 2 ++
>>>> include/dt-bindings/net/ncsi.h | 15 ++++++++
>>>> 3 files changed, 51 insertions(+)
>>>> create mode 100644 Documentation/devicetree/bindings/net/ncsi.yaml
>>>> create mode 100644 include/dt-bindings/net/ncsi.h
>>>>
>>>
>>> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
>>> on your patch (DT_CHECKER_FLAGS is new in v5.13):
>>>
>>> yamllint warnings/errors:
>>>
>>> dtschema/dtc warnings/errors:
>>> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/ncsi.yaml: 'oneOf' conditional failed, one must be fixed:
>>> 'unevaluatedProperties' is a required property
>>> 'additionalProperties' is a required property
>>> hint: Either unevaluatedProperties or additionalProperties must be present
>>> from schema $id: http://devicetree.org/meta-schemas/core.yaml#
>>> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/ncsi.yaml: ignoring, error in schema:
>>> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/ncsi.example.dtb: ethernet@1e660000: 'ncsi,vlan-mode' does not match any of the regexes
>>> From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/vendor-prefixes.yaml
>>
>> I saw vendor-prefix.yaml says do not add non-vendor prefixes to the list. Since "ncsi" is not a vendor, may I ask what is the suggested replacement for 'ncsi,vlan-mode'? Will 'ncsi-vlan-mode' be fine?
>
> I don't know. What is NCSI? Is it specific to certain MACs? Why do you
> need to set this up in DT? Network configuration is typically done in
> userspace, so putting VLAN config in DT doesn't seem right. All
> questions your commit message should answer.
NCSI is a protocol that uses an external MAC+PHY like a PHY, the
topology looks like:
Packets + NCSI commands Packets
MAC-------------------------External MAC---------PHY
Some MACs like ftgmac100 driver supports using NCSI instead of PHY,
the operation mode is configured by a DT option "use-ncsi". The NCSI
external MAC has its own configuration, like VLAN filter mode of it,
and all NCSI devices uses a generic driver. So I these external mac
configurations to DT as they are device properties to kernel. Userspace
is only able to configure the "internal" MAC.
>>> Documentation/devicetree/bindings/net/ncsi.example.dtb:0:0: /example-0/ethernet@1e660000: failed to match any schema with compatible: ['aspeed,ast2600-mac', 'faraday,ftgmac100']
>>> Documentation/devicetree/bindings/net/ncsi.example.dtb:0:0: /example-0/ethernet@1e660000: failed to match any schema with compatible: ['aspeed,ast2600-mac', 'faraday,ftgmac100']
>>
>> The ftgmac100 it depends on uses a txt document instead of an yaml schema. And I see there is other schemas having the same error, can this be ignored?
>
> No. Don't add to the list. Once all the existing warnings (~40) are
> fixed, then this will be turned on by default.
Sure, I'll put this to ftgmac100.txt instead of separate yaml file.
>>
>> And I've got one more question. The ncsi driver does not has its own compatible field, instead, it is enabled by setting the "use-ncsi" property of some specific mac drivers. Though currently only ftgmac100 supports ncsi in upstream kernel, it may be used by other mac drivers in the future. What do you think is a proper way for defining the ncsi schema? Having it in a separate yaml like this patch or add the properties to all the mac yamls that supports yaml? If the former way is preferred, how should the schema be defined without "compatible"?
>
> If it is a function of driver support or not, then it doesn't belong in DT.
>
> Rob
It's a hardware operation mode of the external MAC, I think it's
reasonable to put it in DT.
There is also a previous patch adding NCSI MAC config "mlx,multi-host"
in DT at https://lore.kernel.org/netdev/20200108234341.2590674-1-vijaykhemka@fb.com/T/
I referred this for my implementation, though it is undocumented.
Jiaqing
next prev parent reply other threads:[~2022-06-14 2:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 16:59 [PATCH v2 0/6] Configurable VLAN mode for NCSI driver Jiaqing Zhao
2022-06-10 16:59 ` [PATCH v2 1/6] net/ncsi: Fix value of NCSI_CAP_VLAN_ANY Jiaqing Zhao
2022-06-10 16:59 ` [PATCH v2 2/6] net/ncsi: Rename NCSI_CAP_VLAN_NO to NCSI_CAP_VLAN_FILTERED Jiaqing Zhao
2022-06-10 16:59 ` [PATCH v2 3/6] net/ncsi: Enable VLAN filtering when callback is registered Jiaqing Zhao
2022-06-10 16:59 ` [PATCH v2 4/6] ftgmac100: Remove enable NCSI VLAN filtering Jiaqing Zhao
2022-06-10 16:59 ` [PATCH v2 5/6] dt-bindings: net: Add NCSI bindings Jiaqing Zhao
2022-06-10 23:19 ` Rob Herring
2022-06-11 3:09 ` Jiaqing Zhao
2022-06-13 15:28 ` Rob Herring
2022-06-14 2:33 ` Jiaqing Zhao [this message]
2022-06-10 16:59 ` [PATCH v2 6/6] net/ncsi: Support VLAN mode configuration Jiaqing Zhao
2022-06-10 20:09 ` [PATCH v2 0/6] Configurable VLAN mode for NCSI driver Jakub Kicinski
2022-06-11 3:25 ` Jiaqing Zhao
2022-06-11 4:45 ` Jakub Kicinski
2022-06-11 5:18 ` Jiaqing Zhao
2022-06-11 5:44 ` Jakub Kicinski
2022-06-11 9:58 ` Jiaqing Zhao
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=aff542a3-ac98-c33d-9612-63ebca180e17@linux.intel.com \
--to=jiaqing.zhao@linux.intel.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=robh@kernel.org \
--cc=sam@mendozajonas.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).