Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 0ffc9dfa authored by Grygorii Strashko's avatar Grygorii Strashko Committed by Praneeth Bajjuri
Browse files

TI: HACK: net: ethernet: ti: am65-cpsw-nuss: add debugfs to cfg cut-thru params


Introduce debugfs interface to configure cut-thru Port parameters - RX/TX
prio mask.
During probe the debugfs directory is populated for device and every phys
Ports as below
 debug\
 | - <dev name> (8000000.ethernet)
   |- Port1\
	|- <dbgfs files>
   ...
   |- PortN\

For every port following parameters are defined:
 PortN\
 |- [all] disabled [Y/N]
	 Y - port is disabled
 |- [if supported] cut_thru_rx_pri_mask
	 Receive Priority Cut Through Enables
 |- [if supported] cut_thru_tx_pri_mask
	 Transmit Priority Cut Through Enables

cut_thru_rx/tx_pri_mask available only for devices which:
- support "Cut-thru";
- configured in "switch-mode";
and can be configured only when cut-thru is not enabled
  ethtool --show-priv-flags ethX
  cut-thru            : off

Overall configuration sequence example:
 ifconfig ethX down
 devlink dev param set platform/8000000.ethernet name \
  switch_mode value true cmode runtime
 echo 0xc0 > /sys/kernel/debug/8000000.ethernet/PortY/cut_thru_tx_pri_mask
 echo 0xc0 > /sys/kernel/debug/8000000.ethernet/PortY/cut_thru_rx_pri_mask
 ethtool --set-priv-flags ethZ cut-thru on
 ifconfig ethX up

Note. The intended way upstream is to use devlink port params, but this
part of devlink is broken and not easy to fix, so debugfs is used as temp
solution and interface is subject to change.

Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: default avatarChintan Vankar <c-vankar@ti.com>
parent b205b27e
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