All of lore.kernel.org
 help / color / mirror / Atom feed
From: Donald Hunter <donald.hunter@gmail.com>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: netdev@vger.kernel.org,  "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,  Jiri Pirko <jiri@resnulli.us>,
	 Jacob Keller <jacob.e.keller@intel.com>,
	 Stanislav Fomichev <sdf@google.com>
Subject: Re: [PATCHv2 net-next 2/2] doc/netlink/specs: Add vlan attr in rt_link spec
Date: Tue, 26 Mar 2024 09:34:39 +0000	[thread overview]
Message-ID: <m2o7b11gls.fsf@gmail.com> (raw)
In-Reply-To: <20240326024325.2008639-3-liuhangbin@gmail.com> (Hangbin Liu's message of "Tue, 26 Mar 2024 10:43:25 +0800")

Hangbin Liu <liuhangbin@gmail.com> writes:
>
> diff --git a/Documentation/netlink/specs/rt_link.yaml b/Documentation/netlink/specs/rt_link.yaml
> index 8e4d19adee8c..41b49f15236f 100644
> --- a/Documentation/netlink/specs/rt_link.yaml
> +++ b/Documentation/netlink/specs/rt_link.yaml
> @@ -50,7 +50,16 @@ definitions:
>          name: dormant
>        -
>          name: echo
> -
> +  -
> +    name: eth-protocols

I think this should be called vlan-protocols since the enum only
contains valid vlan protocol values.

> +    type: enum
> +    entries:
> +      -
> +        name: 8021Q

The convention with YNL specs is to use lower case for names and let
e.g. ynl-gen-c convert to upper case for the C domain. So these should
be '8021q' and '8021ad'.

> +        value: 33024
> +      -
> +        name: 8021AD
> +        value: 34984
>    -
>      name: rtgenmsg
>      type: struct
> @@ -729,6 +738,43 @@ definitions:
>        -
>          name: filter-mask
>          type: u32
> +  -
> +    name: ifla-vlan-flags
> +    type: struct
> +    members:
> +      -
> +        name: flags
> +        type: u32
> +        enum: vlan-flags
> +        enum-as-flags: true
> +      -
> +        name: mask
> +        type: u32
> +        display-hint: hex
> +  -
> +    name: vlan-flags
> +    type: flags
> +    entries:
> +      -
> +        name: reorder-hdr
> +      -
> +        name: gvrp
> +      -
> +        name: loose-binding
> +      -
> +        name: mvrp
> +      -
> +        name: bridge-binding

Nit: when you specify entries by name only, you can use the abbreviated
form:

   - reorder-hdr
   - gvrp
   - loose-binding
   - mvrp
   - bridge-binding

> +  -
> +    name: ifla-vlan-qos-mapping
> +    type: struct
> +    members:
> +      -
> +        name: from
> +        type: u32
> +      -
> +        name: to
> +        type: u32
>  
>  
>  attribute-sets:
> @@ -1507,6 +1553,38 @@ attribute-sets:
>        -
>          name: num-disabled-queues
>          type: u32
> +  -
> +    name: linkinfo-vlan-attrs
> +    name-prefix: ifla-vlan-
> +    attributes:
> +      -
> +        name: id
> +        type: u16
> +      -
> +        name: flag
> +        type: binary
> +        struct: ifla-vlan-flags
> +      -
> +        name: egress-qos
> +        type: nest
> +        nested-attributes: ifla-vlan-qos

I _think_ this needs 'multi-attr: true'

https://elixir.bootlin.com/linux/latest/source/net/8021q/vlan_netlink.c#L120

> +      -
> +        name: ingress-qos
> +        type: nest
> +        nested-attributes: ifla-vlan-qos

Same for ingress-qos.

> +      -
> +        name: protocol
> +        type: u16
> +        enum: eth-protocols
> +        byte-order: big-endian
> +  -
> +    name: ifla-vlan-qos
> +    name-prefix: ifla-vlan-qos
> +    attributes:
> +      -
> +        name: mapping
> +        type: binary
> +        struct: ifla-vlan-qos-mapping
>    -
>      name: linkinfo-vrf-attrs
>      name-prefix: ifla-vrf-
> @@ -1666,6 +1744,9 @@ sub-messages:
>        -
>          value: tun
>          attribute-set: linkinfo-tun-attrs
> +      -
> +        value: vlan
> +        attribute-set: linkinfo-vlan-attrs
>        -
>          value: vrf
>          attribute-set: linkinfo-vrf-attrs

  reply	other threads:[~2024-03-26  9:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26  2:43 [PATCHv2 net-next 0/2] doc/netlink/specs: Add vlan support Hangbin Liu
2024-03-26  2:43 ` [PATCHv2 net-next 1/2] ynl: support hex display_hint for integer Hangbin Liu
2024-03-26  9:13   ` Donald Hunter
2024-03-26  2:43 ` [PATCHv2 net-next 2/2] doc/netlink/specs: Add vlan attr in rt_link spec Hangbin Liu
2024-03-26  9:34   ` Donald Hunter [this message]
2024-03-27  3:34   ` Jakub Kicinski

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=m2o7b11gls.fsf@gmail.com \
    --to=donald.hunter@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.