2. Ethernet Operation Guide¶
2.1. Operation Example¶
The Ethernet module is built into the kernel by default and does not require a separate load operation.
The steps for using the Ethernet port from the kernel are as follows:
Configure the IP address and subnet mask
ifconfig eth0 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx up
Set the default gateway
route add default gw xxx.xxx.xxx.xxx
Verify network connectivity
ping xxx.xxx.xxx.xxx # ping Gatewayor IP,ConfirmNetworkcan after after NFS/TFTP OperationMount NFS
mount -t nfs -o nolock xxx.xxx.xxx.xxx:/your/path /mount-dir
Use TFTP from the shell to upload and download files
A TFTP service must be running on the server.
Download a file:
tftp -g -r [remote file name] [server ip]
Note: remote file name is under ofFileName,server ipisunder File inserverofipAddress (Ex:tftp -g -r test.txt 192.168.0.11)。
Upload a file:
tftp -p -l [local file name] [server ip]
Note: local file name is on ofFileName,server ipison Fileof serverofipAddress (Ex:tftp -p -l test.txt 192.168.0.11)。
Note: The CV184x Ethernet module does not support TSO.
Note: The NFS tool is not included in the file system by default and must be added when needed.
2.2. IPv6Description¶
SDK inDefaultDisableIPv6Function。If IPv6,Need toModifyKernelOption。 Operationas follows:
CV184x
Modify
build/boards/cv184x/{board_name}/linux/cvitek_{board_name}_defconfig。
Ex: build/boards/cv184x/cv1842hp_wevb_0014a_spinor/linux/
cvitek_cv1842hp_wevb_0014a_spinor_defconfig AddorModify CONFIG_IPV6=y。 afterRebuildKernelSoftware。
IPv6 Configuration as follows:
ConfigurationipAddresswithandGateway
ip -6 addr add <ipv6 address>/ipv6 prefixlen dev <port name> Ex: ip -6 addr add 2020:abc:102::8888/24 dev eth0
Ping ofIPv6Address
ping -6 <ipv6 address> Ex: ping -6 2020:abc:102::6666
2.3. IEEE 802.3xFlow Control¶
2.3.1. Flow Control Description¶
CV184x EthernetSupportIEEE 802.3x DefinitionofFlow Control, Flow control withand ofFlow control method toFlow controlofPurpose。
Flow control :
in of of in,If before of can after of , Flow control , not , 。
Flow control :
to ofFlow control , ofFlow control Description ,etc.to Flow control after, 。IfinWait in to ofFlow control DescriptionofFlow control is0 , 。
2.3.2. Flow Control Configuration¶
Flow control FunctionDefault Disableof, ProvideSoftwareInterfaceConfiguration。
Flow control FunctionofRelated FilesConfigurationinlinux/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
static int flow_ctrl = FLOW_OFF;
module_param(flow_ctrl, int, 0644);
MODULE_PARM_DESC(flow_ctrl, "Flow control ability [on/off]");
static int pause =PAUSE_TIME;
module_param(pause, int, 0644);
MODULE_PARM_DESC(pause, "Flow Control Pause Time");
If Default Flow Control,canModifyflow_ctrl = FLOW_AUTO。
If ModifyDefaultpause time,canConfiguration pause Value。
2.3.3. ethtoolConfigure Flow Control Through the Interface¶
UserCanThrough ethtoolToolsInterface Flow ControlofEnable。
ethtool -a eth0 CommandsVieweth0 Flow ControlStatus; as follows
# ethtool -a eth0
Pause parameters for eth0:
Autonegotiate: on
RX: off
TX: off
in,RXFlow control Disableof,TXFlow control Disableof;UserCanThroughfollowingCommandsEnableorDisableTXFlow control:
# ethtool -A eth0 tx off(DisableTXFlow control)
# ethtool -A eth0 tx on(EnableTXFlow control)
Note:ethtoolToolsDefaultnot FileSystem,Need toUserinNeed to 。