What's new

ethctl ->> phy-crossbar command

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

bluesky210

New Around Here
I'm wondering if someone might have some experience with this.
This looks like an interesting command that might be used to configure the switch on my AX86U, but I've found very little info on it. The only document was this which I found.
Yes, I'm in over my head, but I figure what the heck, won't hurt to ask.

1647960925499.png
 
To achieve what exactly?
Code:
# ethctl
Interface specific commands:
Usage: ethctl <interface> <command> [arguments...]

  media-type : Set/Get media type
  ethctl <interface> media-type [option] [port <sub_port#> ]
    [option]: auto - auto select
              10000FD - 10Gb, Full Duplex
              5000FD - 5Gb, Full Duplex
              2500FD - 2.5Gb, Full Duplex
              1000FD - 1000Mb, Full Duplex
              1000HD - 1000Mb, Half Duplex
              100FD - 100Mb, Full Duplex
              100HD - 100Mb, Half Duplex
              10FD  - 10Mb,  Full Duplex
              10HD  - 10Mb,  Half Duplex
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  phy-reset : Soft reset the transceiver
  ethctl <interface> phy-reset [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  phy-crossbar : Get/Move <interface> crossbar phys
  ethctl <interface> phy-crossbar [port <sub_port#>]
    [port <sub_port#>]: assign <sub_port#> to <interface>
  ethctl bcmsw phy-crossbar: list all port phy mapping


  reg : Set/Get port mii register
  ethctl <interface> reg <[0-31]> [0xhhhh] [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  phy-power : Phy power <up|down>/status
  ethctl <interface> phy-power [<up|down>] [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  eee : Get/Set local phy EEE (Energy Efficient Ethernet) status/<on|off>
  ethctl <interface> eee [<on|off>] [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  eee-resolution : Get phy EEE (Energy Efficient Ethernet) resolution status
  ethctl <interface> eee-resolution [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  apd : Get/Set local phy APD (Auto Power Down) status/<on|off>
  ethctl <interface> apd [<on|off>] [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  vport : Enable/disable/query Switch for VLAN port mapping
  ethctl <interface> vport <enable|disable|query>

  stats : Display software stats
  ethctl <interface> stats

  ethernet@wirespeed : Enable/Disable ethernet@wirespeed
  ethctl <interface> ethernet@wirespeed <show|enable|disable> [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  cable-diag   ethctl <interface> cable-diag <show|enable|disable|run> [port <sub_port#>]
: Enable/Disable/Run PHY Cable Diagnosis Function
    <interface>: Individual or "bcmsw" for all interfaces.
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath.
    show: Display current Cable Diagnosis Setting.
    enable/diable: Enable/Diable Auto Cable Diag function in driver during the link changes.
    run: Run specific port Cable Diag function once manually.


  phy-macsec : Phy macsec operations
  ethctl <interface> phy-macsec set_log_level <level>
  ethctl <interface> phy-macsec init
  ethctl <interface> phy-macsec enable <0|1>
  ethctl <interface> phy-macsec vport_add <direction> <sc_index>
  ethctl <interface> phy-macsec vport_remove <direction> <sc_index>
  ethctl <interface> phy-macsec sa_add <direction> <sc_index> <sa_index> <sci> <key> <hkey> <key_size>
  ethctl <interface> phy-macsec sa_remove <direction> <sc_index> <sa_index>
  ethctl <interface> phy-macsec rule_add <direction> <sc_index> <rule_index>
  ethctl <interface> phy-macsec rule_remove <direction> <sc_index> <rule_index>
  ethctl <interface> phy-macsec rule_enable <direction> <rule_index> <0|1>
  ethctl <interface> phy-macsec vport_e_stat_get <sc_index>
  ethctl <interface> phy-macsec vport_i_stat_get <sc_index>
  ethctl <interface> phy-macsec tcam_stat_get <direction> <rule_index>
  ethctl <interface> phy-macsec rxcam_stat_get <sa_index>
  ethctl <interface> phy-macsec sa_i_stat_get <sa_index>
  ethctl <interface> phy-macsec sa_e_stat_get <sa_index>
     <level>: 0=error, 1=info, 2=debug
     <direction>: 0=Egress, 1=Ingress
     <sc_index>: int
     <sa_index>: int
     <rule_index>: int
     <sci>: 8 bytes in hex
     <key>: AES key in hex
     <hkey>: in hex
     <key_size>: AES key length in bytes <16/24/32>



Common commands:
Usage: ethctl <command> [arguments...]

  tx_iudma : Set/Get number of Tx iuDMA channels
  ethctl tx_iudma <[1-4]>

  rx_iudma : Set/Get number of Rx iuDMA channels
  ethctl rx_iudma <[1-4]>


  phy : Phy Access
  ethctl phy int|ext|extsw|ext32 <phy_addr> <reg> [<value|reg2> [no_read_back]] [-d]
  ethctl phy i2c <bus_num> <reg> [<value|reg2> [no_read_back]] [-d]
      <reg>: 0-0x1f: CL22 IEEE register; 0x20-0xffff: Broadcom Extended Registers.
             0x1,0000-0x1f,ffff: CL45 IEEE Register, DeviceAddress + 2 byte Registers.
             0x20,0000-0xffff,ffff: Broadcom PHY 32bit address.
      <ext32>: Force to access Broadcom phy 32bit address.
      <bus_num>: I2C Bus Number:  0: 2.5G SFP Module
  ethctl phy serdespower <phy_addr> [<power_mode>]
      [<power_mode>]: 0 - Non power saving mode; for loop back, inter connection
                      1 - Basic power saving mode; default mode
                      2 - Device Forced Off
  ethctl phy 10gserdes 0 <reg> [<value|reg2>] [-d]
  ethctl phy 10gpcs 0 <reg> [<value|reg2>] [-d]
      Read/Write 10G Serdes/PCS registers
      <reg>: 10G AE register address including higher 16bits total 32bits
         Higher 16 Bit definitions:
             DEVID_0:0x0000, DEVID_1: 0x0800; PLL_0: 0x0000, PLL_1: 0x0100
             LANE_0-3: 0x0000-0x0003, LANE_BRDCST: 0x00FF
      -d: Dump registers started from <reg> to <reg2>.


  phy-map : Display PHY to Kernel Net Device mapping information
 
To achieve what exactly?
Code:
# ethctl
Interface specific commands:
Usage: ethctl <interface> <command> [arguments...]

  media-type : Set/Get media type
  ethctl <interface> media-type [option] [port <sub_port#> ]
    [option]: auto - auto select
              10000FD - 10Gb, Full Duplex
              5000FD - 5Gb, Full Duplex
              2500FD - 2.5Gb, Full Duplex
              1000FD - 1000Mb, Full Duplex
              1000HD - 1000Mb, Half Duplex
              100FD - 100Mb, Full Duplex
              100HD - 100Mb, Half Duplex
              10FD  - 10Mb,  Full Duplex
              10HD  - 10Mb,  Half Duplex
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  phy-reset : Soft reset the transceiver
  ethctl <interface> phy-reset [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  phy-crossbar : Get/Move <interface> crossbar phys
  ethctl <interface> phy-crossbar [port <sub_port#>]
    [port <sub_port#>]: assign <sub_port#> to <interface>
  ethctl bcmsw phy-crossbar: list all port phy mapping


  reg : Set/Get port mii register
  ethctl <interface> reg <[0-31]> [0xhhhh] [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  phy-power : Phy power <up|down>/status
  ethctl <interface> phy-power [<up|down>] [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  eee : Get/Set local phy EEE (Energy Efficient Ethernet) status/<on|off>
  ethctl <interface> eee [<on|off>] [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  eee-resolution : Get phy EEE (Energy Efficient Ethernet) resolution status
  ethctl <interface> eee-resolution [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  apd : Get/Set local phy APD (Auto Power Down) status/<on|off>
  ethctl <interface> apd [<on|off>] [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  vport : Enable/disable/query Switch for VLAN port mapping
  ethctl <interface> vport <enable|disable|query>

  stats : Display software stats
  ethctl <interface> stats

  ethernet@wirespeed : Enable/Disable ethernet@wirespeed
  ethctl <interface> ethernet@wirespeed <show|enable|disable> [port <sub_port#>]
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath


  cable-diag   ethctl <interface> cable-diag <show|enable|disable|run> [port <sub_port#>]
: Enable/Disable/Run PHY Cable Diagnosis Function
    <interface>: Individual or "bcmsw" for all interfaces.
    [port <sub_port#>]: required if <interface> has Crossbar or Trunk port underneath.
    show: Display current Cable Diagnosis Setting.
    enable/diable: Enable/Diable Auto Cable Diag function in driver during the link changes.
    run: Run specific port Cable Diag function once manually.


  phy-macsec : Phy macsec operations
  ethctl <interface> phy-macsec set_log_level <level>
  ethctl <interface> phy-macsec init
  ethctl <interface> phy-macsec enable <0|1>
  ethctl <interface> phy-macsec vport_add <direction> <sc_index>
  ethctl <interface> phy-macsec vport_remove <direction> <sc_index>
  ethctl <interface> phy-macsec sa_add <direction> <sc_index> <sa_index> <sci> <key> <hkey> <key_size>
  ethctl <interface> phy-macsec sa_remove <direction> <sc_index> <sa_index>
  ethctl <interface> phy-macsec rule_add <direction> <sc_index> <rule_index>
  ethctl <interface> phy-macsec rule_remove <direction> <sc_index> <rule_index>
  ethctl <interface> phy-macsec rule_enable <direction> <rule_index> <0|1>
  ethctl <interface> phy-macsec vport_e_stat_get <sc_index>
  ethctl <interface> phy-macsec vport_i_stat_get <sc_index>
  ethctl <interface> phy-macsec tcam_stat_get <direction> <rule_index>
  ethctl <interface> phy-macsec rxcam_stat_get <sa_index>
  ethctl <interface> phy-macsec sa_i_stat_get <sa_index>
  ethctl <interface> phy-macsec sa_e_stat_get <sa_index>
     <level>: 0=error, 1=info, 2=debug
     <direction>: 0=Egress, 1=Ingress
     <sc_index>: int
     <sa_index>: int
     <rule_index>: int
     <sci>: 8 bytes in hex
     <key>: AES key in hex
     <hkey>: in hex
     <key_size>: AES key length in bytes <16/24/32>



Common commands:
Usage: ethctl <command> [arguments...]

  tx_iudma : Set/Get number of Tx iuDMA channels
  ethctl tx_iudma <[1-4]>

  rx_iudma : Set/Get number of Rx iuDMA channels
  ethctl rx_iudma <[1-4]>


  phy : Phy Access
  ethctl phy int|ext|extsw|ext32 <phy_addr> <reg> [<value|reg2> [no_read_back]] [-d]
  ethctl phy i2c <bus_num> <reg> [<value|reg2> [no_read_back]] [-d]
      <reg>: 0-0x1f: CL22 IEEE register; 0x20-0xffff: Broadcom Extended Registers.
             0x1,0000-0x1f,ffff: CL45 IEEE Register, DeviceAddress + 2 byte Registers.
             0x20,0000-0xffff,ffff: Broadcom PHY 32bit address.
      <ext32>: Force to access Broadcom phy 32bit address.
      <bus_num>: I2C Bus Number:  0: 2.5G SFP Module
  ethctl phy serdespower <phy_addr> [<power_mode>]
      [<power_mode>]: 0 - Non power saving mode; for loop back, inter connection
                      1 - Basic power saving mode; default mode
                      2 - Device Forced Off
  ethctl phy 10gserdes 0 <reg> [<value|reg2>] [-d]
  ethctl phy 10gpcs 0 <reg> [<value|reg2>] [-d]
      Read/Write 10G Serdes/PCS registers
      <reg>: 10G AE register address including higher 16bits total 32bits
         Higher 16 Bit definitions:
             DEVID_0:0x0000, DEVID_1: 0x0800; PLL_0: 0x0000, PLL_1: 0x0100
             LANE_0-3: 0x0000-0x0003, LANE_BRDCST: 0x00FF
      -d: Dump registers started from <reg> to <reg2>.


  phy-map : Display PHY to Kernel Net Device mapping information
I was wondering if this might be a means to configure the ethernet ports on the router. Separate them, assign VLANs, etc.
 
I was wondering if this might be a means to configure the ethernet ports on the router. Separate them, assign VLANs, etc.
The official replacement to the legacy non-HND robocfg utility specifically for VLANs is
Bash:
vlanctl

Code:
VLAN Control Utility:

::: Usage:

vlanctl

    --if <if_name> Sets the target Interface of a composite vlanctl command to <if_name>.

    --rx Sets the direction of a composite vlanctl command to RECEIVE

    --tx Sets the direction of a composite vlanctl command to TRANSMIT

    --tags <nbr_of_tags> Sets the number of tags of a composite vlanctl command to <nbr_of_tags>

    --if-create <real_if_name> <if_index> Creates a new VOPI named <real_if_name>.v<if_index> and attaches it to the real device
     <real_if_name>. For instance, if this command were executed for the eth0 real interface and the VOPI interface index were
     set to 3, the resulting interface would have been named eth0.v3.

    --if-create-name <real_if_name> <vlan_if_name> Creates a new VOPI named <vlan_if_name> and attaches it to the real device

    --if-delete <vlan_if_name> Destroy the VOPI named <vlan_if_name>.

    --rule-append Inserts a new Tagging Rule as the last rule of the specified Tagging Rule Table. Dependencies: --if, --rx or
     --tx, and --tags.

    --rule-insert-before <rule-id> Inserts a new Tagging Rule before the Tagging Rule whose identifier matches <rule-id> in the
    specified Tagging Rule Table. Dependencies: --if, --rx or --tx, and --tags.

    --rule-insert-after <rule-id> Inserts a new Tagging Rule after the Tagging Rule whose identifier matches <rule-id> in the
    specified Tagging Rule Table. Dependencies: --if, --rx or --tx, and --tags.

    --rule-remove <rule-id> Removes the Tagging Rule that matches <rule-id> from the specified Tagging Rule Table. Dependencies:
    --if, --rx or --tx, and --tags.

    --rule-remove-all <real_if_name> <vlan_if_name> Removes all the Tagging Rules for the vlan device.

    --show-table Lists all Tagging Rules stored in the specified Tagging Rule Table. Dependencies: --if, --rx or --tx, and
    --tags.

    --rule-dump-all Lists all Tagging Rules

    --default-tpid <tpid> Sets the default TPID value of a tagging rule table to <tpid>. When a table is created, its default
    TPID value is set to 0x8100. Dependencies: --if, --rx or --tx, and --tags.

    --default-pbits <pbits> Sets the default PBITS value of a tagging rule table to <pbits>. When a table is created, its
    default PBITS value is set to 0. Dependencies: --if, --rx or --tx, and --tags.

    --default-cfi <cfi> Sets the default CFI value of a tagging rule table to <cfi>. When a table is created, its default CFI
    value is set to 0. Dependencies: --if, --rx or --tx, and --tags.

    --default-vid <vid> Sets the default VID value of a tagging rule table to <vid>. When a table is created, its default VID
    value is set to 1 (as per IEEE 802.1Q). Dependencies: --if, --rx or --tx, and --tags.

    --cfg-dscp2pbits <dscp> <pbits> Programs the entry number <dscp> of the DSCP-TO-PBITS translation table of a Real Device to
    the value specified by <pbits>. When a tagging rule table is created, the default values of the DSCP-TO-PBITS table are
    set by copying the lowest 3 bits of each DSCP value as the PBITS value, for each entry in the table. For instance, the
    following entries are programmed by default: DSCP=5:PBITS=5, DSCP=15:PBITS=7, etc. The DSCP-TO-PBITS translation table
    has 64 entries. Dependencies: --if.

    --show-dscp2pbits Lists the values programmed in the DSCP-TO-PBITS table of the specified Real Device. Dependencies:
    --if.

    --cfg-tpid <tpid0> <tpid1> <tpid2> <tpid3> Configures the TPID Table entries of a given Real Interface. The configured
    TPID values are used to identify VLAN Headers of packets received from and transmitted to the VOPIs created for a given
    Real Interface. Four values must always be specified. The default TPID values are 0x8100, 0x8100, 0x8100, and 0x8100.
    Dependencies: --if.

    --show-tpid Lists the values programmed in the TPID Table of the specified Real Device. Dependencies: --if.

    --local-stats <vlan_if_name> Shows the statistics counters maintained for the VOPI named <vlan_if_name>. These counters
    are complimentary to the standard counters maintained for the device, which can be read via the Linux ifconfig
    command.

    --filter-ethertype <ethertype> Match the Ethertype field in the Ethernet Header of incoming frames against <ethertype>.

    --filter-pbits <pbits> <tag_nbr> Match the PBITS value of VLAN Header number <tag_nbr> of incoming frames against
    <pbits>.

    --filter-cfi <cfi> <tag_nbr> Match the CFI bit of VLAN Header number <tag_nbr> of incoming frames against <cfi>.

    --filter-vid <vid> <tag_nbr> Match the VID value of VLAN Header number <tag_nbr> of incoming frames against <vid>.

    --filter-tag-ethertype <ethertype> <tag_nbr> Match the Ethertype field of the VLAN Header number <tag_nbr> of incoming
    frames against <ethertype>.

    --filter-dscp <dscp> Match the DSCP value in the IPv4 header of incoming frames against <dscp>.
    --filter-rxif <real_if_name> Match the rx VOPI of the transmitting packet against <real-if-name>. This filter can be used to bind a Tagging
    Rule to a specific rx VOPI on the TRANSMIT direction. This filter is not applicable for rules in the RECEIVE direction.

    --filter-txif <vlan_if_name> Match the transmitting VOPI against <vlan-if-name>. This filter can be used to bind a Tagging
    Rule to a specific VOPI on the TRANSMIT direction. This filter is not applicable for rules in the RECEIVE direction.
    TRANSMIT rules without this filter will apply to all frames transmitted from all VOPIs attached to the Real Device.

    --filter-skb-prio <priority> Match the SKB priority of incoming frames against <priority>.

    --filter-skb-mark-flowid <flowid> Match the Flow ID subfield of the SKB Mark field against <flowid>. The SKB Mark Flow ID
    subfield can be used as a way to correlate packet classification made by other Linux modules (such as ebtables and
    iptables) with Tagging Rules. A possible usage for this filter would be to direct packets generated by an application to
    a specific port of a real interface (such as a GPON port) based on layer 3 filters. In this example a socket would be
    created on a VOPI,IP Tables rules would be created to identify flows and set Flow IDs, and Tagging rules would be
    created to match on such Flow IDs and apply treatments, such as setting the destination GEM Port and Queue.

    --filter-skb-mark-port <port> Match the Port subfield of the SKB Mark field against <port>. This filter can be used to bind
     certain Tagging Rules with a specific Real Interface port (for instance a GPON Port).

    --filter-vlan-dev-mac-addr <ignore_if_multicast> Match the recv frame dest MAC addr against the recv virtual interface.
     Set <ignore_if_multicast> to 0 to apply filter on all recv frames.
     Set <ignore_if_multicast> to 1 to apply filter on unicast frames only.
     This filter is not applicable for rules in the TRANSMIT direction.

    --pop-tag Remove the outermost VLAN tag. If multiple tags are to be removed, this treatment should be specified for each
    VLAN tag to be removed.

    --push-tag Add the default VLAN tag of the corresponding Tagging Rule Table as the new outer tag. The default TPID value
    will be used as the new Ethertype value in the Ethernet header, the existing Ethertype of the Ethernet Header will be used
    as the Tag Ethertype field of the new tag, and the default PBITS, CFI and VID will be used as the TCI of the new tag. If
    multiple tags are to be inserted, this treatment must be specified for each VLAN tag to be inserted.

    --set-ethertype <ethertype> Set the Ethertype value of the Ethernet Header to <ethertype>.

    --set-pbits <pbits> <tag_nbr> Set the PBITS value of the VLAN Header number <tag_nbr> to <pbits>.

    --set-cfi <cfi> <tag_nbr> Set the CFI bit of the VLAN Heade number <tag_nbr> to <cfi>.

    --set-vid <vid> <tag_nbr> Set the VID of the VLAN Header number <tag_nbr> to <vid>.

    --set-tag-ethertype <ethertype> Set the Ethertype field of the VLAN Header number <tag_nbr> to <ethertype>.

    --set-dscp <dscp> Set the IPv4 DSCP value of the matching frame to <dscp>.

    --copy-pbits <from_tag_nbr> <to_tag_nbr> Copy the PBITS value from VLAN Header number <from_tag_nbr> to VLAN Header number
    <to_tag_nbr>.

    --copy-cfi <from_tag_nbr> <to_tag_nbr> Copy the CFI value from VLAN Header number <from_tag_nbr> to VLAN Header number
    <to_tag_nbr>.

    --copy-vid <from_tag_nbr> <to_tag_nbr> Copy the VID value from VLAN Header number <from_tag_nbr> to VLAN Header number
    <to_tag_nbr>.

    --copy-tag-ethertype <from_tag_nbr> <to_tag_nbr> Copy the Ethertype value from VLAN Header number <from_tag_nbr> to VLAN
    Header number <to_tag_nbr>.

    --dscp2pbits <tag_nbr> Translate the IPv4 DSCP into a PIBTS value, and write the translated PBITS value in the VLAN Header
    number <tag_nbr>. The DSCP-To-PBITS table of the respective Real Device is used for translation.

    --set-rxif <vlan_if_name> Forward frames in the RECEIVE direction that match this rule to the VOPI specified in
    <vlan_if_name>. If not specified, the frame will be forwarded to a randomly chosen VOPI. Using this treatment in the
    TRANSMIT direction has no effect.

    --set-iptv Set flag to indicate IPTV traffic will go through the mcast vlan instead of WAN vlan.

    --set-if-mode-ont Set real device mode to ONT.

    --set-if-mode-rg  Set real device mode to RG.

<snip>
 
I have an old router Linksys E4200. I installed DD-wrt on it and being able to assign ports to VLANs is so easy. Do you think someone will eventually make something like that available on the AX86U?
 
Similar threads
Thread starter Title Forum Replies Date
M Missing ethctl on 380.70 Asuswrt-Merlin 3
B Asus RT-AX86S DDNS Icon & AiMesh PHY Asuswrt-Merlin 0

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top