您好!
(1)我的 J3 SDK 里面没有提供 ethtool 这个应用程序(即我的 /userdata 目录下没有这个app);
(2)我自己写了一个测试程序,按照 est.cfg 的数据来填充了一个 struct xj3_est_cfg 结构体,并用这个结构体通过 ioctl 函数来设置 J3 的 EST,结果发现这个配置无效,相关代码如下:
......
struct ifreq ifstruct;
struct xj3_est_cfg test_est_cfg;
test_est_cfg.cmd = 0x00000006;
test_est_cfg.enabled = 1;
test_est_cfg.btr_offset[0] = 0;
test_est_cfg.btr_offset[1] = 2;
test_est_cfg.ctr[0] = 100000000; // 100 ms
test_est_cfg.ctr[0] = 0;
test_est_cfg.ter = 0;
test_est_cfg.gcl_size = 11;
test_est_cfg.gcl[0] = 0x08989680; //对应于 ENTRY 1 0 0 0 10000000
test_est_cfg.gcl[1] = 0x00989680; //对应于 ENTRY 0 0 0 0 10000000
test_est_cfg.gcl[2] = 0x00989680;
test_est_cfg.gcl[3] = 0x00989680;
test_est_cfg.gcl[4] = 0x00989680;
test_est_cfg.gcl[5] = 0x00989680;
test_est_cfg.gcl[6] = 0x00989680;
test_est_cfg.gcl[7] = 0x00989680;
test_est_cfg.gcl[8] = 0x00989680;
test_est_cfg.gcl[9] = 0x00989680;
test_est_cfg.gcl[10] = 0x00989680;
ifstruct.ifr_data = (void *)(&test_est_cfg);
......
ioctl(rawsock, 0x89F0, &ifstruct); // 这个会最终调用J3 以太网驱动里面的 xj3_set_est() 函数
在完成上面配置以后,我的测试程序会往 Tx Queue 0/1/2/3 这 4 个队列里面发数据,结果通过 tcpdump 工具发现 4 个 Tx Queue 都有数据发送出来,而预期是经过 EST 控制后,仅有 Tx Queue 3有数据发送出来。
所以我想问,是我这配置填充不对(我个人感觉配置按结构体去填的,应该没啥问题。如果填充不对,该怎么填?),还是 J3 的以太网驱动不支持 EST?