# Toshiba Electronic Devices & Storage Corporation TC956X PCIe Ethernet Host Driver Release Date: 26 Dec 2023 Release Version: V_01-03-59 : Limited-tested version TC956X PCIe EMAC driver is based on "Fedora 39, kernel-6.6.1". # Compilation & Run: Need to be root user to execute the following steps. 1. By default, DMA_OFFLOAD_ENABLE is enabled. Execute following commands: #make clean #make 2. If IPA offload is not needed, disable macro DMA_OFFLOAD_ENABLE in common.h. set DMA_OFFLOAD = 0 in Makefile and execute following commands: #make clean #make To compile driver with load firmware header (fw.h) use the below command #make TC956X_LOAD_FW_HEADER=1 In order to compile the Driver to include the code for applying Gen3 setting, execute Make with below argument #make TC956X_PCIE_GEN3_SETTING=1 Please note, incase both fw.h and Gen3 settings are needed, then both arugments need to be specified. 3. Load phylink module #modprobe phylink 4. Load the driver #insmod tc956x_pcie_eth.ko pcie_link_speed=X In the module parameter pcie_link_speed, X is the desired PCIe Gen speed. X can be 3 or 2 or 1. Passing module parameter (pcie_link_speed=X) is optional. If module parameter is not passed, by default Gen3 speed will be selected by the driver. Please note that driver should be compiled using below command to use this feature: #make TC956X_PCIE_GEN3_SETTING=1 5. Remove the driver #rmmod tc956x_pcie_eth # Note: 1. Use below commands to advertise with Autonegotiation ON for speeds 10Gbps, 5Gbps, 2.5Gbps, 1Gbps, 100Mbps and 10Mbps as ethtool speed command does not support. ethtool -s advertise 0x7000 autoneg on --> changes the advertisement to 10Gbps ethtool -s advertise 0x1000000006000 autoneg on --> changes the advertisement to 5Gbps ethtool -s advertise 0x800000006000 autoneg on --> changes the advertisement to 2.5Gbps ethtool -s advertise 0x6020 autoneg on --> changes the advertisement to 1Gbps ethtool -s advertise 0x6008 autoneg on --> changes the advertisement to 100Mbps ethtool -s advertise 0x6002 autoneg on --> changes the advertisement 10Mbps 2. Use the below command to insert the kernel module with specific modes for interfaces: #insmod tc956x_pcie_eth.ko mac0_interface=x mac1_interface=y argument info: mac0_interface: For PORT0 interface mode setting mac1_interface: For PORT1 interface mode setting x = [0: USXGMII, 1: XFI (default), 2: RGMII (unsupported), 3: SGMII, 4: 2500Base-X] y = [0: USXGMII (unsupported), 1: XFI (unsupported), 2: RGMII, 3: SGMII(default), 4: 2500Base-X] If invalid and unsupported modes are passed as kernel module parameter, the default interface mode will be selected. 3. Regarding the performance, use the below command to increase the dynamic byte queue limit $echo "900000" > /sys/devices/pci0000\:00/0000\:00\:01.0/0000\:01\:00.0/0000\:02\:03.0/0000\:05\:00.0/net/enp5s0f0/queues/tx-0/byte_queue_limits/limit_min 900000 is the random value chosen. It needs to adjust this value on their system and check "0000\:00/0000\:00\:01.0/0000\:01\:00.0/0000\:02\:03.0/0000\:05\:00.0/" value can be obtained from the "lspci -t" command 4. The debug counters to check the interrupt count is available. "#ethtool -S " needs to be executed and sample output is as below total_interrupts: 120109 lpi_intr_n: 0 pmt_intr_n: 0 event_intr_n: 0 tx_intr_n: 120000 rx_intr_n: 51 xpcs_intr_n: 0 phy_intr_n: 46 sw_msi_n: 12 tx_intr_n = No of. Tx interrupts originating from eMAC sw_msi_n = No. of SW MSIs triggered by Systick Handler as part of optimized Tx Timer based on Systick approach. So total number of interrupts for Tx = tx_intr_n + sw_msi_n Please note that whenever Rx interruts are generated, the Host ISR will process the Tx completed descriptors too. 5. With V_01-00-07, when IPA API start_channel() is invoked for Rx direction, MAC_Address1_High is updated with 0xBF000000. This register setting is almost similar to promiscuous mode. So please install appropriate FRP instructions. 6. From V_01-00-08 onwards, Port0 ethernet interface will not be created only if there is no ethernet PHY attached to it 7. Enable TC956X_PHY_INTERRUPT_MODE_EMAC0 macro for supporting PORT0 Interrupt mode. Disable the macro if the phy driver supports only polling mode. Enable TC956X_PHY_INTERRUPT_MODE_EMAC1 macro for supporting PORT1 Interrupt mode. Disable the macro if the phy driver supports only polling mode. 8. Change below macro values for configuration of Link state L0 and L1 transaction delay. /* Link state change delay configuration for Upstream Port */ #define USP_L0s_ENTRY_DELAY (0x1FU) #define USP_L1_ENTRY_DELAY (0x3FFU) /* Link state change delay configuration for Downstream Port-1 */ #define DSP1_L0s_ENTRY_DELAY (0x1FU) #define DSP1_L1_ENTRY_DELAY (0x3FFU) /* Link state change delay configuration for Downstream Port-2 */ #define DSP2_L0s_ENTRY_DELAY (0x1FU) #define DSP2_L1_ENTRY_DELAY (0x3FFU) /* Link state change delay configuration for Virtual Downstream Port */ #define VDSP_L0s_ENTRY_DELAY (0x1FU) #define VDSP_L1_ENTRY_DELAY (0x3FFU) /* Link state change delay configuration for Internal Endpoint */ #define EP_L0s_ENTRY_DELAY (0x1FU) #define EP_L1_ENTRY_DELAY (0x3FFU) Formula: L0 entry delay = XXX_L0s_ENTRY_DELAY * 256 ns L1 entry delay = XXX_L1_ENTRY_DELAY * 256 ns XXX_L0s_ENTRY_DELAY range: 1-31 XXX_L1_ENTRY_DELAY: 1-1023 9. To check vlan feature status execute: ethtool -k | grep vlan To enable/disable following vlan features execute: (a) rx-vlan-filter: ethtool -K rx-vlan-filter (b) rx-vlan-offload: ethtool -K rxvlan (c) tx-vlan-offload: ethtool -K txvlan Use following to configure VLAN: (a) modprobe 8021q (b) vconfig add (c) vconfig set_flag . 1 0 (d) ifconfig . netmask 255.255.255.0 broadcast up Default Configuraton: (a) Rx vlan filter is disabled. (b) Rx valn offload (vlan stripping) is disabled. (c) Tx vlan offload is enabled. 10. Please use the below command to insert the kernel module for passing pause frames to application except pause frames from PHY: #insmod tc956x_pcie_eth.ko mac0_filter_phy_pause=x mac1_filter_phy_pause=x argument info: mac0_filter_phy_pause: For PORT0 mac1_filter_phy_pause: For PORT1 x = [0: DISABLE (default), 1: ENABLE] If invalid values are passed as kernel module parameter, the default value will be selected. 11. Use below commands to check WOL support and its type: #ethtool 12. WOL command Usage : #ethtool -s wol . Supported WOL options and meaning: | Option | Meaning | | :-----: | :----: | | p | Wake on phy activity | | g | Wake on MagicPacket(tm) | | d | Disable (wake on nothing). (Default) | Example - To wake on phy activity and magic packet use : ethtool -s eth0 wol pg 13. Please use the below command to insert the kernel module to enable EEE and configure LPI Auto Entry timer: #insmod tc956x_pcie_eth.ko mac0_eee_enable=X mac0_lpi_timer=Y mac1_eee_enable=X mac1_lpi_timer=Y argument info: mac0_eee_enable: For PORT0 mac1_eee_enable: For PORT1 X = [0: DISABLE (default), 1: ENABLE] This module parameter is to Enable/Disable EEE for Port 0/1 - default is 0. If invalid values are passed as kernel module parameter, the default value will be selected. mac0_lpi_timer: For PORT0 mac1_lpi_timer: For PORT1 Y = [0..1048568 (us)] This module parameter is to configure LPI Automatic Entry Timer for Port 0/1 - default is 600 (us). If invalid values are passed as kernel module parameter, the default value will be selected. In addition to above module parameter, use below ethtool command to configure EEE and LPI auto entry timer. #ethtool --set-eee eee tx-timer