本文主要是介绍ralink/MKT ethtool接口,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一:常规属性, MII设置/读写只支持Port0 ~Port4的PHY; [ Port6/Port7是cpu port,不能设置PHY,但可以设置MAC]
ei_local->mii_info.phy_id = 0; // Port 0 ~ 5;
ei_local->mii_info.supports_gmii = 1; //支持千兆;
ethtool eth0
二:offload的特性,(大于MTU数值,分片)
mt7621支持gso(硬件TCP包分片 tso,软件分片),sg(使用DMA),gro(NAPI轮询加中断);不支持ufo,lro;
关键字:NETIF_F_HW_CSUM,NETIF_F_IP_CSUM, NETIF_F_RX_CSUM,
NETIF_F_TSO, NETIF_F_TSO6,NETIF_F_GRO,NETIF_F_SG,NETIF_F_GSO
http://blog.csdn.net/u011955950/article/details/16800015
先参考一下IBM的patch: http://www.spinics.net/lists/netdev/msg382179.html
主要是完善这个函数指针
static const struct net_device_ops ei_netdev_ops = {
+// .ndo_fix_features= ei_fix_features, //暂时不使用
+ .ndo_set_features= ei_set_features,
}
ei_set_features() 先异或,在判断01;修改的 是dev->features的数值,不要修改dev->hw_features的数值;
显示网卡所有offload特性:
ethtool -k eth0
设置属性
ethtool -K eth0 gso off;ethtool -k eth0 | grep "generic-segmentation-offload"ethtool -K eth0 gso on;ethtool -k eth0 | grep "generic-segmentation-offload"
ethtool -K eth0 gro off;ethtool -k eth0 | grep "generic-receive-offload"
ethtool -K eth0 gro on;ethtool -k eth0 | grep "generic-receive-offload"
ethtool -K eth0 tso off;ethtool -k eth0 | grep "tcp-segmentation-offload"
ethtool -K eth0 tso on; ethtool -k eth0 | grep "tcp-segmentation-offload"
ethtool -K eth0 sg off;ethtool -k eth0 | grep "scatter-gather";
ethtool -K eth0 sg on; ethtool -k eth0 | grep "scatter-gather";
ethtool -K eth0 rx on tx on; ethtool -k eth0 | grep checksumming
ethtool -K eth0 rx off tx off;ethtool -k eth0 | grep checksumming
这篇关于ralink/MKT ethtool接口的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!