ethtool 是用于查询及设置网卡参数的命令。

 

使用ethtool需要两个条件:

1)网卡驱动支持ethtool,实现了ethtool的接口函数

2)用户安装ethtool可执行程序

 

dwmac驱动已在stmmac_ethtool.c中实现了相关函数,现在我们只需要在编译ethtool工具,在用户空间使用即可。

编译使用ethtool

 

 

1. 下载ethtool

https://mirrors.edge.kernel.org/pub/software/network/ethtool/

根据需要、下载相应版本:ethtool-4.15.tar.gz

解压:tar -zxvf ethtool-4.15.tar.gz

 

 

2. 编译ethtool

1)./autogen.sh

2)./configure   --host=arm-linux  CC=aarch64-linux-gnu-gcc  LDFLAGS=-static

3)make

编译生成的ethtool在当前目录下

 

 

3. 测试

1)./ethtool --version

2)./ethtool -i eth0

3) ./ethtool eth0

 

相关文章:

  • 2021-05-20
  • 2021-06-11
  • 2021-05-28
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
猜你喜欢
  • 2021-07-29
  • 2021-12-29
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2021-06-25
相关资源
相似解决方案