Commit a353318e authored by Stanislav Fomichev's avatar Stanislav Fomichev Committed by Jakub Kicinski

tools: ynl: populate most of the ethtool spec

Things that are not implemented:
- cable tests
- bitmaks in the requests don't work (needs multi-attr support in ynl.py)
- stats-get seems to return nonsense (not passing a bitmask properly?)
- notifications are not tested
Signed-off-by: default avatarStanislav Fomichev <sdf@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 9f7cc57f
...@@ -6,6 +6,12 @@ protocol: genetlink-legacy ...@@ -6,6 +6,12 @@ protocol: genetlink-legacy
doc: Partial family for Ethtool Netlink. doc: Partial family for Ethtool Netlink.
definitions:
-
name: udp-tunnel-type
type: enum
entries: [ vxlan, geneve, vxlan-gpe ]
attribute-sets: attribute-sets:
- -
name: header name: header
...@@ -38,6 +44,7 @@ attribute-sets: ...@@ -38,6 +44,7 @@ attribute-sets:
- -
name: bit name: bit
type: nest type: nest
multi-attr: true
nested-attributes: bitset-bit nested-attributes: bitset-bit
- -
name: bitset name: bitset
...@@ -53,6 +60,22 @@ attribute-sets: ...@@ -53,6 +60,22 @@ attribute-sets:
type: nest type: nest
nested-attributes: bitset-bits nested-attributes: bitset-bits
-
name: u64-array
attributes:
-
name: u64
type: nest
multi-attr: true
nested-attributes: u64
-
name: s32-array
attributes:
-
name: s32
type: nest
multi-attr: true
nested-attributes: s32
- -
name: string name: string
attributes: attributes:
...@@ -234,118 +257,1351 @@ attribute-sets: ...@@ -234,118 +257,1351 @@ attribute-sets:
name: stats name: stats
type: nest type: nest
nested-attributes: mm-stat nested-attributes: mm-stat
-
name: linkinfo
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: port
type: u8
-
name: phyaddr
type: u8
-
name: tp-mdix
type: u8
-
name: tp-mdix-ctrl
type: u8
-
name: transceiver
type: u8
-
name: linkmodes
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: autoneg
type: u8
-
name: ours
type: nest
nested-attributes: bitset
-
name: peer
type: nest
nested-attributes: bitset
-
name: speed
type: u32
-
name: duplex
type: u8
-
name: master-slave-cfg
type: u8
-
name: master-slave-state
type: u8
-
name: master-slave-lanes
type: u32
-
name: rate-matching
type: u8
-
name: linkstate
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: link
type: u8
-
name: sqi
type: u32
-
name: sqi-max
type: u32
-
name: ext-state
type: u8
-
name: ext-substate
type: u8
-
name: down-cnt
type: u32
-
name: debug
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: msgmask
type: nest
nested-attributes: bitset
-
name: wol
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: modes
type: nest
nested-attributes: bitset
-
name: sopass
type: binary
-
name: features
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: hw
type: nest
nested-attributes: bitset
-
name: wanted
type: nest
nested-attributes: bitset
-
name: active
type: nest
nested-attributes: bitset
-
name: nochange
type: nest
nested-attributes: bitset
-
name: channels
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: rx-max
type: u32
-
name: tx-max
type: u32
-
name: other-max
type: u32
-
name: combined-max
type: u32
-
name: rx-count
type: u32
-
name: tx-count
type: u32
-
name: other-count
type: u32
-
name: combined-count
type: u32
operations: -
enum-model: directional name: coalesce
list: attributes:
- -
name: strset-get name: header
doc: Get string set from the kernel. type: nest
nested-attributes: header
attribute-set: strset -
name: rx-usecs
do: &strset-get-op type: u32
request: -
attributes: name: rx-max-frames
- header type: u32
- stringsets -
- counts-only name: rx-usecs-irq
reply: type: u32
attributes: -
- header name: rx-max-frames-irq
- stringsets type: u32
dump: *strset-get-op -
name: tx-usecs
# TODO: fill in the requests in between type: u32
-
- name: tx-max-frames
name: privflags-get type: u32
doc: Get device private flags. -
name: tx-usecs-irq
attribute-set: privflags type: u32
-
do: &privflag-get-op name: tx-max-frames-irq
request: type: u32
value: 13 -
attributes: name: stats-block-usecs
- header type: u32
reply: -
value: 14 name: use-adaptive-rx
attributes: type: u8
- header -
- flags name: use-adaptive-tx
dump: *privflag-get-op type: u8
- -
name: privflags-set name: pkt-rate-low
doc: Set device private flags. type: u32
-
attribute-set: privflags name: rx-usecs-low
type: u32
do: -
request: name: rx-max-frames-low
attributes: type: u32
- header -
- flags name: tx-usecs-low
- type: u32
name: privflags-ntf -
doc: Notification for change in device private flags. name: tx-max-frames-low
notify: privflags-get type: u32
-
- name: pkt-rate-high
name: rings-get type: u32
doc: Get ring params. -
name: rx-usecs-high
attribute-set: rings type: u32
-
do: &ring-get-op name: rx-max-frames-high
request: type: u32
attributes: -
- header name: tx-usecs-high
reply: type: u32
attributes: -
- header name: tx-max-frames-high
- rx-max type: u32
- rx-mini-max -
- rx-jumbo-max name: rate-sample-interval
- tx-max type: u32
- rx -
- rx-mini name: use-cqe-mode-tx
- rx-jumbo type: u8
- tx -
- rx-buf-len name: use-cqe-mode-rx
- tcp-data-split type: u8
- cqe-size -
- tx-push name: tx-aggr-max-bytes
- rx-push type: u32
- tx-push-buf-len -
- tx-push-buf-len-max name: tx-aggr-max-frames
dump: *ring-get-op type: u32
- -
name: rings-set name: tx-aggr-time-usecs
doc: Set ring params. type: u32
-
attribute-set: rings name: pause-stat
attributes:
do: -
request: name: pad
attributes: type: u32
- header -
- rx name: tx-frames
- rx-mini type: u64
- rx-jumbo -
- tx name: rx-frames
- rx-buf-len type: u64
- tcp-data-split -
- cqe-size name: pause
- tx-push attributes:
- rx-push -
- name: header
name: rings-ntf type: nest
doc: Notification for change in ring params. nested-attributes: header
notify: rings-get -
name: autoneg
# TODO: fill in the requests in between type: u8
-
name: rx
type: u8
-
name: tx
type: u8
-
name: stats
type: nest
nested-attributes: pause-stat
-
name: stats-src
type: u32
-
name: eee
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: modes-ours
type: nest
nested-attributes: bitset
-
name: modes-peer
type: nest
nested-attributes: bitset
-
name: active
type: u8
-
name: enabled
type: u8
-
name: tx-lpi-enabled
type: u8
-
name: tx-lpi-timer
type: u32
-
name: tsinfo
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: timestamping
type: nest
nested-attributes: bitset
-
name: tx-types
type: nest
nested-attributes: bitset
-
name: rx-filters
type: nest
nested-attributes: bitset
-
name: phc-index
type: u32
-
name: cable-test-nft-nest-result
attributes:
-
name: pair
type: u8
-
name: code
type: u8
-
name: cable-test-nft-nest-fault-length
attributes:
-
name: pair
type: u8
-
name: cm
type: u32
-
name: cable-test-nft-nest
attributes:
-
name: result
type: nest
nested-attributes: cable-test-nft-nest-result
-
name: fault-length
type: nest
nested-attributes: cable-test-nft-nest-fault-length
-
name: cable-test
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: status
type: u8
-
name: nest
type: nest
nested-attributes: cable-test-nft-nest
-
name: cable-test-tdr-cfg
attributes:
-
name: first
type: u32
-
name: last
type: u32
-
name: step
type: u32
-
name: pari
type: u8
-
name: cable-test-tdr
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: cfg
type: nest
nested-attributes: cable-test-tdr-cfg
-
name: tunnel-info-udp-entry
attributes:
-
name: port
type: u16
byte-order: big-endian
-
name: type
type: u32
enum: udp-tunnel-type
-
name: tunnel-info-udp-table
attributes:
-
name: size
type: u32
-
name: types
type: nest
nested-attributes: bitset
-
name: udp-ports
type: nest
nested-attributes: tunnel-info-udp-entry
-
name: tunnel-info
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: udp-ports
type: nest
nested-attributes: tunnel-info-udp-table
-
name: fec-stat
attributes:
-
name: pad
type: u8
-
name: corrected
type: nest
nested-attributes: u64-array
-
name: uncorr
type: nest
nested-attributes: u64-array
-
name: corr-bits
type: nest
nested-attributes: u64-array
-
name: fec
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: modes
type: nest
nested-attributes: bitset
-
name: auto
type: u8
-
name: active
type: u32
-
name: stats
type: nest
nested-attributes: fec-stat
-
name: module-eeprom
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: offset
type: u32
-
name: length
type: u32
-
name: page
type: u8
-
name: bank
type: u8
-
name: i2c-address
type: u8
-
name: data
type: binary
-
name: stats-grp
attributes:
-
name: pad
type: u32
-
name: id
type: u32
-
name: ss-id
type: u32
-
name: stat
type: nest
nested-attributes: u64
-
name: hist-rx
type: nest
nested-attributes: u64
-
name: hist-tx
type: nest
nested-attributes: u64
-
name: hist-bkt-low
type: u32
-
name: hist-bkt-hi
type: u32
-
name: hist-bkt-val
type: u64
-
name: stats
attributes:
-
name: pad
type: u32
-
name: header
type: nest
nested-attributes: header
-
name: groups
type: nest
nested-attributes: bitset
-
name: grp
type: nest
nested-attributes: stats-grp
-
name: src
type: u32
-
name: phc-vclocks
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: num
type: u32
-
name: index
type: nest
nested-attributes: s32-array
-
name: module
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: power-mode-policy
type: u8
-
name: power-mode
type: u8
-
name: pse
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: admin-state
type: u32
-
name: admin-control
type: u32
-
name: pw-d-status
type: u32
-
name: rss
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: context
type: u32
-
name: hfunc
type: u32
-
name: indir
type: binary
-
name: hkey
type: binary
-
name: plca
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: version
type: u16
-
name: enabled
type: u8
-
name: status
type: u8
-
name: node-cnt
type: u32
-
name: node-id
type: u32
-
name: to-tmr
type: u32
-
name: burst-cnt
type: u32
-
name: burst-tmr
type: u32
operations:
enum-model: directional
list:
-
name: strset-get
doc: Get string set from the kernel.
attribute-set: strset
do: &strset-get-op
request:
attributes:
- header
- stringsets
- counts-only
reply:
attributes:
- header
- stringsets
dump: *strset-get-op
-
name: linkinfo-get
doc: Get link info.
attribute-set: linkinfo
do: &linkinfo-get-op
request:
attributes:
- header
reply:
attributes: &linkinfo
- header
- port
- phyaddr
- tp-mdix
- tp-mdix-ctrl
- transceiver
dump: *linkinfo-get-op
-
name: linkinfo-set
doc: Set link info.
attribute-set: linkinfo
do:
request:
attributes: *linkinfo
-
name: linkinfo-ntf
doc: Notification for change in link info.
notify: linkinfo-get
-
name: linkmodes-get
doc: Get link modes.
attribute-set: linkmodes
do: &linkmodes-get-op
request:
attributes:
- header
reply:
attributes: &linkmodes
- header
- autoneg
- ours
- peer
- speed
- duplex
- master-slave-cfg
- master-slave-state
- master-slave-lanes
- rate-matching
dump: *linkmodes-get-op
-
name: linkmodes-set
doc: Set link modes.
attribute-set: linkmodes
do:
request:
attributes: *linkmodes
-
name: linkmodes-ntf
doc: Notification for change in link modes.
notify: linkmodes-get
-
name: linkstate-get
doc: Get link state.
attribute-set: linkstate
do: &linkstate-get-op
request:
attributes:
- header
reply:
attributes:
- header
- link
- sqi
- sqi-max
- ext-state
- ext-substate
- down-cnt
dump: *linkstate-get-op
-
name: debug-get
doc: Get debug message mask.
attribute-set: debug
do: &debug-get-op
request:
attributes:
- header
reply:
attributes: &debug
- header
- msgmask
dump: *debug-get-op
-
name: debug-set
doc: Set debug message mask.
attribute-set: debug
do:
request:
attributes: *debug
-
name: debug-ntf
doc: Notification for change in debug message mask.
notify: debug-get
-
name: wol-get
doc: Get WOL params.
attribute-set: wol
do: &wol-get-op
request:
attributes:
- header
reply:
attributes: &wol
- header
- modes
- sopass
dump: *wol-get-op
-
name: wol-set
doc: Set WOL params.
attribute-set: wol
do:
request:
attributes: *wol
-
name: wol-ntf
doc: Notification for change in WOL params.
notify: wol-get
-
name: features-get
doc: Get features.
attribute-set: features
do: &feature-get-op
request:
attributes:
- header
reply:
attributes: &feature
- header
# User-changeable features.
- hw
# User-requested features.
- wanted
# Currently active features.
- active
# Unchangeable features.
- nochange
dump: *feature-get-op
-
name: features-set
doc: Set features.
attribute-set: features
do: &feature-set-op
request:
attributes: *feature
reply:
attributes: *feature
-
name: features-ntf
doc: Notification for change in features.
notify: features-get
-
name: privflags-get
doc: Get device private flags.
attribute-set: privflags
do: &privflag-get-op
request:
attributes:
- header
reply:
attributes: &privflag
- header
- flags
dump: *privflag-get-op
-
name: privflags-set
doc: Set device private flags.
attribute-set: privflags
do:
request:
attributes: *privflag
-
name: privflags-ntf
doc: Notification for change in device private flags.
notify: privflags-get
-
name: rings-get
doc: Get ring params.
attribute-set: rings
do: &ring-get-op
request:
attributes:
- header
reply:
attributes: &ring
- header
- rx-max
- rx-mini-max
- rx-jumbo-max
- tx-max
- rx
- rx-mini
- rx-jumbo
- tx
- rx-buf-len
- tcp-data-split
- cqe-size
- tx-push
- rx-push
- tx-push-buf-len
- tx-push-buf-len-max
dump: *ring-get-op
-
name: rings-set
doc: Set ring params.
attribute-set: rings
do:
request:
attributes: *ring
-
name: rings-ntf
doc: Notification for change in ring params.
notify: rings-get
-
name: channels-get
doc: Get channel params.
attribute-set: channels
do: &channel-get-op
request:
attributes:
- header
reply:
attributes: &channel
- header
- rx-max
- tx-max
- other-max
- combined-max
- rx-count
- tx-count
- other-count
- combined-count
dump: *channel-get-op
-
name: channels-set
doc: Set channel params.
attribute-set: channels
do:
request:
attributes: *channel
-
name: channels-ntf
doc: Notification for change in channel params.
notify: channels-get
-
name: coalesce-get
doc: Get coalesce params.
attribute-set: coalesce
do: &coalesce-get-op
request:
attributes:
- header
reply:
attributes: &coalesce
- header
- rx-usecs
- rx-max-frames
- rx-usecs-irq
- rx-max-frames-irq
- tx-usecs
- tx-max-frames
- tx-usecs-irq
- tx-max-frames-irq
- stats-block-usecs
- use-adaptive-rx
- use-adaptive-tx
- pkt-rate-low
- rx-usecs-low
- rx-max-frames-low
- tx-usecs-low
- tx-max-frames-low
- pkt-rate-high
- rx-usecs-high
- rx-max-frames-high
- tx-usecs-high
- tx-max-frames-high
- rate-sample-interval
- use-cqe-mode-tx
- use-cqe-mode-rx
- tx-aggr-max-bytes
- tx-aggr-max-frames
- tx-aggr-time-usecs
dump: *coalesce-get-op
-
name: coalesce-set
doc: Set coalesce params.
attribute-set: coalesce
do:
request:
attributes: *coalesce
-
name: coalesce-ntf
doc: Notification for change in coalesce params.
notify: coalesce-get
-
name: pause-get
doc: Get pause params.
attribute-set: pause
do: &pause-get-op
request:
attributes:
- header
reply:
attributes: &pause
- header
- autoneg
- rx
- tx
- stats
- stats-src
dump: *pause-get-op
-
name: pause-set
doc: Set pause params.
attribute-set: pause
do:
request:
attributes: *pause
-
name: pause-ntf
doc: Notification for change in pause params.
notify: pause-get
-
name: eee-get
doc: Get eee params.
attribute-set: eee
do: &eee-get-op
request:
attributes:
- header
reply:
attributes: &eee
- header
- modes-ours
- modes-peer
- active
- enabled
- tx-lpi-enabled
- tx-lpi-timer
dump: *eee-get-op
-
name: eee-set
doc: Set eee params.
attribute-set: eee
do:
request:
attributes: *eee
-
name: eee-ntf
doc: Notification for change in eee params.
notify: eee-get
-
name: tsinfo-get
doc: Get tsinfo params.
attribute-set: tsinfo
do: &tsinfo-get-op
request:
attributes:
- header
reply:
attributes:
- header
- timestamping
- tx-types
- rx-filters
- phc-index
dump: *tsinfo-get-op
-
name: cable-test-act
doc: Cable test.
attribute-set: cable-test
do:
request:
attributes:
- header
reply:
attributes:
- header
- cable-test-nft-nest
-
name: cable-test-tdr-act
doc: Cable test TDR.
attribute-set: cable-test-tdr
do:
request:
attributes:
- header
reply:
attributes:
- header
- cable-test-tdr-cfg
-
name: tunnel-info-get
doc: Get tsinfo params.
attribute-set: tunnel-info
do: &tunnel-info-get-op
request:
attributes:
- header
reply:
attributes:
- header
- udp-ports
dump: *tunnel-info-get-op
-
name: fec-get
doc: Get FEC params.
attribute-set: fec
do: &fec-get-op
request:
attributes:
- header
reply:
attributes: &fec
- header
- modes
- auto
- active
- stats
dump: *fec-get-op
-
name: fec-set
doc: Set FEC params.
attribute-set: fec
do:
request:
attributes: *fec
-
name: fec-ntf
doc: Notification for change in FEC params.
notify: fec-get
-
name: module-eeprom-get
doc: Get module EEPROM params.
attribute-set: module-eeprom
do: &module-eeprom-get-op
request:
attributes:
- header
reply:
attributes:
- header
- offset
- length
- page
- bank
- i2c-address
- data
dump: *module-eeprom-get-op
-
name: stats-get
doc: Get statistics.
attribute-set: stats
do: &stats-get-op
request:
attributes:
- header
- groups
reply:
attributes:
- header
- groups
- grp
- src
dump: *stats-get-op
-
name: phc-vclocks-get
doc: Get PHC VCLOCKs.
attribute-set: phc-vclocks
do: &phc-vclocks-get-op
request:
attributes:
- header
reply:
attributes:
- header
- num
dump: *phc-vclocks-get-op
-
name: module-get
doc: Get module params.
attribute-set: module
do: &module-get-op
request:
attributes:
- header
reply:
attributes: &module
- header
- power-mode-policy
- power-mode
dump: *module-get-op
-
name: module-set
doc: Set module params.
attribute-set: module
do:
request:
attributes: *module
-
name: module-ntf
doc: Notification for change in module params.
notify: module-get
-
name: pse-get
doc: Get Power Sourcing Equipment params.
attribute-set: pse
do: &pse-get-op
request:
attributes:
- header
reply:
attributes: &pse
- header
- admin-state
- admin-control
- pw-d-status
dump: *pse-get-op
-
name: pse-set
doc: Set Power Sourcing Equipment params.
attribute-set: pse
do:
request:
attributes: *pse
-
name: rss-get
doc: Get RSS params.
attribute-set: rss
do: &rss-get-op
request:
attributes:
- header
reply:
attributes:
- header
- context
- hfunc
- indir
- hkey
dump: *rss-get-op
-
name: plca-get
doc: Get PLCA params.
attribute-set: plca
do: &plca-get-op
request:
attributes:
- header
reply:
attributes: &plca
- header
- version
- enabled
- status
- node-cnt
- node-id
- to-tmr
- burst-cnt
- burst-tmr
dump: *plca-get-op
-
name: plca-set
doc: Set PLCA params.
attribute-set: plca
do:
request:
attributes: *plca
-
name: plca-get-status
doc: Get PLCA status params.
attribute-set: plca
do: &plca-get-status-op
request:
attributes:
- header
reply:
attributes: *plca
dump: *plca-get-status-op
-
name: plca-ntf
doc: Notification for change in PLCA params.
notify: plca-get
- -
name: mm-get name: mm-get
doc: Get MAC Merge configuration and state doc: Get MAC Merge configuration and state
...@@ -354,11 +1610,9 @@ operations: ...@@ -354,11 +1610,9 @@ operations:
do: &mm-get-op do: &mm-get-op
request: request:
value: 42
attributes: attributes:
- header - header
reply: reply:
value: 42
attributes: attributes:
- header - header
- pmac-enabled - pmac-enabled
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment