1
我嘗試從我的程序通過ETHTOOL API和 命令ETHTOOL_GCHANNELS獲得NIC RX環的計數,但程序返回錯誤:「操作不受支持」。 示例代碼:如何獲得Linux中的NIC RX環的數量
echannels.cmd = ETHTOOL_GCHANNELS;
req.ifr_data = (void*)&echannels;
if (ioctl(sock, SIOCETHTOOL, &req) != 0)
ERR("Can't get %s channels info! %s", nic, strerror(errno));
else
rx_no = echannels.rx_count;
而且我已經嘗試使用相同的結果,從的ethtool 「的ethtool eth0的-l」 得到它:
#ethtool -l eth0
Channel parameters for eth0:
Cannot get device channel parameters
: Operation not supported
,但在/ proc /中斷我看到NIC有多個RX環綁定到不同的CPU核心。 任何人都可以告訴我正確的方法來從C代碼中獲取RX環的數量?