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轮询加中断);不支持ufolro; 

关键字: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命令

显示网卡所有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
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值