找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 25950|回复: 210

[虚拟机相关] 开启RTL8125B的多队列支持和关闭ASPM。PVE 下J4125 测试有效

 火.. [复制链接]
发表于 2021-12-14 09:56 | 显示全部楼层 |阅读模式
本帖最后由 dominic 于 2022-12-30 13:27 编辑


2022-12-30更新:从9.008代码开始realtek 发布的代码又关闭了RSS功能,
r8125_n.c 代码以下代码片段确定了EnableRss 为0,也就是关闭了RSS功能。所以最后效果是1个rx队列 2个tx队列了,HwSuppNumTxQueues还是2

#ifndef ENABLE_LIB_SUPPORT
        switch (tp->mcfg) {
        case CFG_METHOD_4:
        case CFG_METHOD_5:
        case CFG_METHOD_7:
                if (tp->HwSuppIsrVer == 2) {
                        tp->RequireRduNonStopPatch = 1;
                        tp->EnableRss = 0;
                }
                break;
        }
#endif

ENABLE_LIB_SUPPORT 如果设置为y的话,源代码中却有缺少r8125_lib.h和r8125_lib.c文件。只能凑合用用吧。
========================

RTL8125B是realtek作为PC上使用的2.5G网卡芯片,2020年和 2021年,这芯片作为好多软路由设备或者轻NAS设备板载芯片很受欢迎。
realtek官方发布了r8125 驱动,最新版本是9.007.01,很可惜官方驱动默认关闭了RSS(rx 的多队列支持,)也关闭了TX的多队列。
RTL8125B硬件上设计是支持32个队列的,这个可以通过lspci -vv | grep MSI-X确认,观察/proc/interrupts 可以发现每块网卡都有32个队列,只有0和16号对了有数据而且都集中在cpu0上,这是典型的单队列运行模式
刚开始的时候我通过脚本来手动调整几块网卡的软中断分配到几个cpu核心上,前些时候处理ikuai 端口断开再连接的毛病的时候仔细看了一下官方驱动。驱动代码是支持RSS和TX驱动的,而且代码中对于RX使用4个队列
TX使用2个队列, 参见r8125_n.c中rtl8125_init_software_variable函数。
  1. switch (tp->mcfg) {
  2.         case CFG_METHOD_4:
  3.         case CFG_METHOD_5:
  4.         case CFG_METHOD_7:
  5.                 tp->HwSuppNumTxQueues = 2;
  6.                 tp->HwSuppNumRxQueues = 4;
  7.                 break;
  8.         default:
  9.                 tp->HwSuppNumTxQueues = 1;
  10.                 tp->HwSuppNumRxQueues = 1;
  11.                 break;
  12.         }
复制代码


这样就简单了,只需要更改官方代码的src目录下Makefile文件 再编译驱动就好了,Makefile中找到ENABLE_MULTIPLE_TX_QUEUE和 ENABLE_RSS_SUPPORT 后面更改为y就好
ENABLE_MULTIPLE_TX_QUEUE = y
ENABLE_RSS_SUPPORT = y

如果要同时关闭ASPM,修改CONFIG_ASPM 就好
CONFIG_ASPM = n

这样使用RTL8125B作为软路由或者ALLINONE的可以更改官方驱动文件 自编译驱动就可以更完美了。
如果使用pve或者unraid 且使用了DKMS,比如awesometic/realtek-r8125-dkms的deb包安装驱动的话,可以执行一下命令来完成修改

  1. cd /usr/src/r8125-9.007.01
  2. sed -i 's/ENABLE_MULTIPLE_TX_QUEUE = n/ENABLE_MULTIPLE_TX_QUEUE = y/g' src/Makefile
  3. sed -i 's/ENABLE_RSS_SUPPORT = n/ENABLE_RSS_SUPPORT = y/g' src/Makefile
  4. dkms remove r8125/9.007.01 -k 5.13.19-2-pve
  5. dkms build r8125/9.007.01 -k 5.13.19-2-pve --force-version-override
  6. dkms install r8125/9.007.01 -k 5.13.19-2-pve --force-version-override
复制代码

其中 5.13.19-2-pve为对应的内核名称 -k之后可以用Tab键补齐。这个时候modinfo r8125 应该可以看到输出信息version:        9.007.01-NAPI-RSS,在NAPI后面多了RSS。
重启后生效。

重启之后可以grep -E enp* /proc/interrupts 来查看效果,cpu0 cpu1 cpu2 cpu3 都有中断了。

这样开启rx tx的多队列支持。
我的J4125 CPU 和PVE7.1-8 拷机12小时稳定无错误。PVE对虚拟机开启多队列支持之后,虚拟机里面ethtool -L也可以开始多队列了。


补 自编译 dkms deb包: realtek-r8125-dkms_9.007.01-2_amd64.zip (95.85 KB, 下载次数: 439)
2022.03.18更新 : realtek-r8125-dkms_9.008.00-1_amd64.deb.zip (96.34 KB, 下载次数: 350)
2022.05.01更新: realtek-r8125-dkms_9.009.00-1_amd64.deb.zip (96.79 KB, 下载次数: 764)



评分

参与人数 8恩山币 +12 收起 理由
一根小香蕉 + 1 根据大佬的帖子,我总结了下 https://tohot.
我望云 + 2 666
await + 2 5.1版更新了,谢谢大佬
三叶猫 + 2 感谢你的分享,无论怎样,你都是最无私的人.
☆≈逍遥≈☆ + 1 感谢大佬,我的ikuai掉线的问题终于解决了!
virus1999 + 1 风清云淡、飘逸悠然…… 极爽!
474615686 + 1 一看就是觉得高端、大气、上档次!
smdx + 2 感谢你的分享

查看全部评分

本帖被以下淘专辑推荐:

  • · PVE|主题: 1, 订阅: 0
我的恩山、我的无线 The best wifi forum is right here.
发表于 2023-3-23 22:44 | 显示全部楼层
本帖最后由 威廉第三 于 2023-3-23 22:46 编辑

其实从高版本驱动借鉴几处修改,可以继续在PVE 6.2内核上编译9.007版本的驱动,开启4Rx 2Tx队列
  1. diff --git a/src/r8125.h b/src/r8125.h
  2. index 8b4085c..723c6f1 100755
  3. --- a/src/r8125.h
  4. +++ b/src/r8125.h
  5. @@ -616,7 +616,11 @@ typedef int *napi_budget;
  6. typedef struct napi_struct *napi_ptr;
  7. typedef int napi_budget;

  8. +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
  9. #define RTL_NAPI_CONFIG(ndev, priv, function, weight)   netif_napi_add(ndev, &priv->napi, function, weight)
  10. +#else
  11. +#define RTL_NAPI_CONFIG(ndev, priv, function, weight)   netif_napi_add_weight(ndev, &priv->napi, function, weight)
  12. +#endif
  13. #define RTL_NAPI_QUOTA(budget, ndev)            min(budget, budget)
  14. #define RTL_GET_PRIV(stuct_ptr, priv_struct)        container_of(stuct_ptr, priv_struct, stuct_ptr)
  15. #define RTL_GET_NETDEV(priv_ptr)            struct net_device *dev = priv_ptr->dev;
  16. diff --git a/src/r8125_n.c b/src/r8125_n.c
  17. index ec117a7..5c29a4b 100755
  18. --- a/src/r8125_n.c
  19. +++ b/src/r8125_n.c
  20. @@ -348,7 +348,7 @@ static int rtl8125_change_mtu(struct net_device *dev, int new_mtu);
  21. static void rtl8125_down(struct net_device *dev);

  22. static int rtl8125_set_mac_address(struct net_device *dev, void *p);
  23. -static void rtl8125_rar_set(struct rtl8125_private *tp, uint8_t *addr);
  24. +static void rtl8125_rar_set(struct rtl8125_private *tp, const u8 *addr);
  25. static void rtl8125_desc_addr_fill(struct rtl8125_private *);
  26. static void rtl8125_tx_desc_init(struct rtl8125_private *tp);
  27. static void rtl8125_rx_desc_init(struct rtl8125_private *tp);
  28. @@ -1746,7 +1746,11 @@ static void rtl8125_proc_module_init(void)
  29. static int rtl8125_proc_open(struct inode *inode, struct file *file)
  30. {
  31.          struct net_device *dev = proc_get_parent_data(inode);
  32. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
  33. +        int (*show)(struct seq_file *, void *) = pde_data(inode);
  34. +#else
  35.          int (*show)(struct seq_file *, void *) = PDE_DATA(inode);
  36. +#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)

  37.          return single_open(file, show, dev);
  38. }
  39. @@ -10720,6 +10724,16 @@ rtl8125_release_board(struct pci_dev *pdev,
  40.          free_netdev(dev);
  41. }

  42. +static void
  43. +rtl8125_hw_address_set(struct net_device *dev, u8 mac_addr[MAC_ADDR_LEN])
  44. +{
  45. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
  46. +        eth_hw_addr_set(dev, mac_addr);
  47. +#else
  48. +        memcpy(dev->dev_addr, mac_addr, MAC_ADDR_LEN);
  49. +#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
  50. +}
  51. +
  52. static int
  53. rtl8125_get_mac_address(struct net_device *dev)
  54. {
  55. @@ -10743,24 +10757,21 @@ rtl8125_get_mac_address(struct net_device *dev)
  56.          if (!is_valid_ether_addr(mac_addr)) {
  57.                  netif_err(tp, probe, dev, "Invalid ether addr %pM\n",
  58.                            mac_addr);
  59. -                eth_hw_addr_random(dev);
  60. -                ether_addr_copy(mac_addr, dev->dev_addr);
  61. +                eth_random_addr(mac_addr);
  62. +                dev->addr_assign_type = NET_ADDR_RANDOM;
  63.                  netif_info(tp, probe, dev, "Random ether addr %pM\n",
  64.                             mac_addr);
  65.                  tp->random_mac = 1;
  66.          }

  67. +        rtl8125_hw_address_set(dev, mac_addr);
  68.          rtl8125_rar_set(tp, mac_addr);

  69. -        for (i = 0; i < MAC_ADDR_LEN; i++) {
  70. -                dev->dev_addr[i] = RTL_R8(tp, MAC0 + i);
  71. -                tp->org_mac_addr[i] = dev->dev_addr[i]; /* keep the original MAC address */
  72. -        }
  73. +        /* keep the original MAC address */
  74. +        memcpy(tp->org_mac_addr, dev->dev_addr, MAC_ADDR_LEN);
  75. #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
  76.          memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
  77. #endif
  78. -//  memcpy(dev->dev_addr, dev->dev_addr, dev->addr_len);
  79. -
  80.          return 0;
  81. }

  82. @@ -10781,7 +10792,7 @@ rtl8125_set_mac_address(struct net_device *dev,
  83.          if (!is_valid_ether_addr(addr->sa_data))
  84.                  return -EADDRNOTAVAIL;

  85. -        memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
  86. +        rtl8125_hw_address_set(dev, addr->sa_data);

  87.          rtl8125_rar_set(tp, dev->dev_addr);

  88. @@ -10796,7 +10807,7 @@ rtl8125_set_mac_address(struct net_device *dev,
  89.   *****************************************************************************/
  90. void
  91. rtl8125_rar_set(struct rtl8125_private *tp,
  92. -                uint8_t *addr)
  93. +                const u8 *addr)
  94. {
  95.          uint32_t rar_low = 0;
  96.          uint32_t rar_high = 0;
  97. @@ -11476,6 +11487,57 @@ static int ethtool_ioctl(struct ifreq *ifr)
  98. }
  99. #endif //ETHTOOL_OPS_COMPAT

  100. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
  101. +static int rtl8125_siocdevprivate(struct net_device *dev, struct ifreq *ifr,
  102. +                                  void __user *data, int cmd)
  103. +{
  104. +        struct rtl8125_private *tp = netdev_priv(dev);
  105. +        int ret = 0;
  106. +
  107. +        switch (cmd) {
  108. +#ifdef ENABLE_DASH_SUPPORT
  109. +        case SIOCDEVPRIVATE_RTLDASH:
  110. +                if (!netif_running(dev)) {
  111. +                        ret = -ENODEV;
  112. +                        break;
  113. +                }
  114. +                if (!capable(CAP_NET_ADMIN)) {
  115. +                        ret = -EPERM;
  116. +                        break;
  117. +                }
  118. +
  119. +                ret = rtl8125_dash_ioctl(dev, ifr);
  120. +                break;
  121. +#endif
  122. +
  123. +#ifdef ENABLE_REALWOW_SUPPORT
  124. +        case SIOCDEVPRIVATE_RTLREALWOW:
  125. +                if (!netif_running(dev)) {
  126. +                        ret = -ENODEV;
  127. +                        break;
  128. +                }
  129. +
  130. +                ret = rtl8125_realwow_ioctl(dev, ifr);
  131. +                break;
  132. +#endif
  133. +
  134. +        case SIOCRTLTOOL:
  135. +                if (!capable(CAP_NET_ADMIN)) {
  136. +                        ret = -EPERM;
  137. +                        break;
  138. +                }
  139. +
  140. +                ret = rtl8125_tool_ioctl(tp, ifr);
  141. +                break;
  142. +
  143. +        default:
  144. +                ret = -EOPNOTSUPP;
  145. +        }
  146. +
  147. +        return ret;
  148. +}
  149. +#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
  150. +
  151. static int
  152. rtl8125_do_ioctl(struct net_device *dev,
  153.                   struct ifreq *ifr,
  154. @@ -11483,9 +11545,8 @@ rtl8125_do_ioctl(struct net_device *dev,
  155. {
  156.          struct rtl8125_private *tp = netdev_priv(dev);
  157.          struct mii_ioctl_data *data = if_mii(ifr);
  158. -        int ret;
  159. +        int ret = 0;

  160. -        ret = 0;
  161.          switch (cmd) {
  162.          case SIOCGMIIPHY:
  163.                  data->phy_id = 32; /* Internal PHY */
  164. @@ -11509,6 +11570,16 @@ rtl8125_do_ioctl(struct net_device *dev,
  165.                  break;
  166. #endif

  167. +#ifdef ENABLE_PTP_SUPPORT
  168. +        case SIOCSHWTSTAMP:
  169. +        case SIOCGHWTSTAMP:
  170. +                if (tp->EnablePtp)
  171. +                        ret = rtl8125_ptp_ioctl(dev, ifr, cmd);
  172. +                else
  173. +                        ret = -EOPNOTSUPP;
  174. +                break;
  175. +#endif
  176. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
  177. #ifdef ENABLE_DASH_SUPPORT
  178.          case SIOCDEVPRIVATE_RTLDASH:
  179.                  if (!netif_running(dev)) {
  180. @@ -11531,22 +11602,24 @@ rtl8125_do_ioctl(struct net_device *dev,
  181.                          break;
  182.                  }

  183. +                if (!capable(CAP_NET_ADMIN)) {
  184. +                        ret = -EPERM;
  185. +                        break;
  186. +                }
  187. +
  188.                  ret = rtl8125_realwow_ioctl(dev, ifr);
  189.                  break;
  190. #endif

  191. -#ifdef ENABLE_PTP_SUPPORT
  192. -        case SIOCSHWTSTAMP:
  193. -        case SIOCGHWTSTAMP:
  194. -                if (tp->EnablePtp)
  195. -                        ret = rtl8125_ptp_ioctl(dev, ifr, cmd);
  196. -                else
  197. -                        ret = -EOPNOTSUPP;
  198. -                break;
  199. -#endif
  200.          case SIOCRTLTOOL:
  201. +                if (!capable(CAP_NET_ADMIN)) {
  202. +                        ret = -EPERM;
  203. +                        break;
  204. +                }
  205. +
  206.                  ret = rtl8125_tool_ioctl(tp, ifr);
  207.                  break;
  208. +#endif //LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)

  209.          default:
  210.                  ret = -EOPNOTSUPP;
  211. @@ -11689,11 +11762,11 @@ rtl8125_init_board(struct pci_dev *pdev,

  212.          if ((sizeof(dma_addr_t) > 4) &&
  213.              use_dac &&
  214. -            !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
  215. -            !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
  216. +            !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
  217. +            !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
  218.                  dev->features |= NETIF_F_HIGHDMA;
  219.          } else {
  220. -                rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
  221. +                rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
  222.                  if (rc < 0) {
  223. #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
  224.                          if (netif_msg_probe(tp))
  225. @@ -11778,6 +11851,9 @@ rtl8125_esd_checker(struct rtl8125_private *tp)
  226.          u32 pci_sn_l;
  227.          u32 pci_sn_h;

  228. +        if (unlikely(tp->rtk_enable_diag))
  229. +                goto exit;
  230. +
  231.          tp->esd_flag = 0;

  232.          pci_read_config_byte(pdev, PCI_COMMAND, &cmd);
  233. @@ -12081,7 +12157,12 @@ static const struct net_device_ops rtl8125_netdev_ops = {
  234.          .ndo_tx_timeout     = rtl8125_tx_timeout,
  235.          .ndo_change_mtu     = rtl8125_change_mtu,
  236.          .ndo_set_mac_address    = rtl8125_set_mac_address,
  237. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
  238.          .ndo_do_ioctl       = rtl8125_do_ioctl,
  239. +#else
  240. +        .ndo_siocdevprivate = rtl8125_siocdevprivate,
  241. +        .ndo_eth_ioctl      = rtl8125_do_ioctl,
  242. +#endif //LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
  243. #if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
  244.          .ndo_set_multicast_list = rtl8125_set_rx_mode,
  245. #else
  246. @@ -12444,6 +12525,10 @@ rtl8125_init_one(struct pci_dev *pdev,
  247. #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
  248.                  dev->hw_features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
  249.                  dev->features |=  NETIF_F_IPV6_CSUM;
  250. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)
  251. +                netif_set_tso_max_size(dev, LSO_64K);
  252. +                netif_set_tso_max_segs(dev, NIC_MAX_PHYS_BUF_COUNT_LSO2);
  253. +#else //LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)
  254.                  netif_set_gso_max_size(dev, LSO_64K);
  255. #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
  256.                  dev->gso_max_segs = NIC_MAX_PHYS_BUF_COUNT_LSO2;
  257. @@ -12451,6 +12536,7 @@ rtl8125_init_one(struct pci_dev *pdev,
  258.                  dev->gso_min_segs = NIC_MIN_PHYS_BUF_COUNT;
  259. #endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
  260. #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
  261. +#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)

  262. #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
  263. #endif //LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
复制代码


我的恩山、我的无线 The best wifi forum is right here.
发表于 2022-12-15 14:26 | 显示全部楼层
大佬你好,PVE 7.3-3 版内核是5.18.15-pve。安装8125B驱动出错请问要怎么操作啊?谢谢



root@PVE:~# dpkg -i --force-overwrite realtek-r8125-dkms_9.009.00-1_amd64.deb
Selecting previously unselected package realtek-r8125-dkms.
(Reading database ... 77457 files and directories currently installed.)
Preparing to unpack realtek-r8125-dkms_9.009.00-1_amd64.deb ...
Unpacking realtek-r8125-dkms (9.009.00-1) ...
Setting up realtek-r8125-dkms (9.009.00-1) ...
Loading new realtek-r8125-9.009.00 DKMS files...
Building for 5.18.15-pve
Building for architecture amd64
Building initial module for 5.18.15-pve
Error! Bad return status for module build on kernel: 5.18.15-pve (amd64)
Consult /var/lib/dkms/realtek-r8125/9.009.00/build/make.log for more information.
dpkg: error processing package realtek-r8125-dkms (--install):
installed realtek-r8125-dkms package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:





以下是make.log
  1. DKMS make.log for realtek-r8125-9.009.00 for kernel 5.18.15-pve (amd64)
  2. Thu 15 Dec 2022 02:08:49 PM CST
  3. /bin/sh: 1: VER: not found
  4. make -C src/ KVER=5.18.15-pve BASEDIR=/lib/modules/5.18.15-pve modules
  5. make[1]: Entering directory '/var/lib/dkms/realtek-r8125/9.009.00/build/src'
  6. make -C /lib/modules/5.18.15-pve/build M=/var/lib/dkms/realtek-r8125/9.009.00/build/src modules
  7. make[2]: Entering directory '/usr/src/linux-headers-5.18.15-pve'
  8. warning: the compiler differs from the one used to build the kernel
  9.   The kernel was built by: cc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
  10.   You are using:           gcc (Debian 8.3.0-6) 8.3.0
  11.   CC [M]  /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_n.o
  12.   CC [M]  /var/lib/dkms/realtek-r8125/9.009.00/build/src/rtl_eeprom.o
  13.   CC [M]  /var/lib/dkms/realtek-r8125/9.009.00/build/src/rtltool.o
  14.   CC [M]  /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_rss.o
  15. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_rss.c: In function ‘rtl8125_get_rss_hash_opts’:
  16. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_rss.c:59:27: warning: this statement may fall through [-Wimplicit-fallthrough=]
  17.                  cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  18. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_rss.c:61:9: note: here
  19.          case UDP_V4_FLOW:
  20.          ^~~~
  21. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_rss.c:62:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
  22.                  if (tp->rss_flags & RTL_8125_RSS_FLAG_HASH_UDP_IPV4)
  23.                     ^
  24. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_rss.c:65:9: note: here
  25.          case IPV4_FLOW:
  26.          ^~~~
  27. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_rss.c:69:27: warning: this statement may fall through [-Wimplicit-fallthrough=]
  28.                  cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  29. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_rss.c:71:9: note: here
  30.          case UDP_V6_FLOW:
  31.          ^~~~
  32. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_rss.c:72:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
  33.                  if (tp->rss_flags & RTL_8125_RSS_FLAG_HASH_UDP_IPV6)
  34.                     ^
  35. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_rss.c:75:9: note: here
  36.          case IPV6_FLOW:
  37.          ^~~~
  38. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_rss.c: At top level:
  39. cc1: warning: unrecognized command line option ‘-Wno-alloc-size-larger-than’
  40. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_n.c: In function ‘rtl8125_init_board’:
  41. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_n.c:11955:14: error: implicit declaration of function ‘pci_set_dma_mask’; did you mean ‘pci_set_drvdata’? [-Werror=implicit-function-declaration]
  42.              !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
  43.               ^~~~~~~~~~~~~~~~
  44.               pci_set_drvdata
  45. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_n.c:11956:14: error: implicit declaration of function ‘pci_set_consistent_dma_mask’; did you mean ‘dma_set_coherent_mask’? [-Werror=implicit-function-declaration]
  46.              !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
  47.               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  48.               dma_set_coherent_mask
  49. /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_n.c: At top level:
  50. cc1: warning: unrecognized command line option ‘-Wno-alloc-size-larger-than’
  51. cc1: some warnings being treated as errors
  52. make[3]: *** [scripts/Makefile.build:289: /var/lib/dkms/realtek-r8125/9.009.00/build/src/r8125_n.o] Error 1
  53. make[2]: *** [Makefile:1844: /var/lib/dkms/realtek-r8125/9.009.00/build/src] Error 2
  54. make[2]: Leaving directory '/usr/src/linux-headers-5.18.15-pve'
  55. make[1]: *** [Makefile:176: modules] Error 2
  56. make[1]: Leaving directory '/var/lib/dkms/realtek-r8125/9.009.00/build/src'
  57. make: *** [Makefile:42: modules] Error 2
复制代码


我的恩山、我的无线 The best wifi forum is right here.
发表于 2022-2-15 21:23 | 显示全部楼层
大神:这算是成功了吗
root@pve:~# grep -E enp* /proc/interrupts
127:          0          0          0          0  IR-PCI-MSI 524288-edge      enp1s0
129:     659291          0          0          0  IR-PCI-MSI 1048576-edge      enp2s0
131:          0    3880663          0          0  IR-PCI-MSI 1572864-edge      enp3s0
TRM:          0          0          0          0   Thermal event interrupts
PIN:          0          0          0          0   Posted-interrupt notification event
NPI:          0          0          0          0   Nested posted-interrupt event
PIW:          0          0          0          0   Posted-interrupt wakeup event
root@pve:~# modinfo r8125
filename:       /lib/modules/5.13.19-4-pve/updates/dkms/r8125.ko
version:        9.007.01-NAPI-RSS
license:        GPL
description:    Realtek RTL8125 2.5Gigabit Ethernet driver
author:         Realtek and the Linux r8125 crew <netdev@vger.kernel.org>
srcversion:     0E15F698AAEA162D584BE18
alias:          pci:v000010ECd00003000sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008162sv*sd*bc*sc*i*
alias:          pci:v000010ECd00008125sv*sd*bc*sc*i*
depends:        
retpoline:      Y
name:           r8125
vermagic:       5.13.19-4-pve SMP mod_unload modversions
parm:           speed_mode:force phy operation. Deprecated by ethtool (8). (uint)
parm:           duplex_mode:force phy operation. Deprecated by ethtool (8). (uint)
parm:           autoneg_mode:force phy operation. Deprecated by ethtool (8). (uint)
parm:           advertising_mode:force phy operation. Deprecated by ethtool (8). (uint)
parm:           aspm:Enable ASPM. (int)
parm:           s5wol:Enable Shutdown Wake On Lan. (int)
parm:           s5_keep_curr_mac:Enable Shutdown Keep Current MAC Address. (int)
parm:           rx_copybreak:Copy breakpoint for copy-only-tiny-frames (int)
parm:           use_dac:Enable PCI DAC. Unsafe on 32 bit PCI slot. (int)
parm:           timer_count:Timer Interrupt Interval. (int)
parm:           eee_enable:Enable Energy Efficient Ethernet. (int)
parm:           hwoptimize:Enable HW optimization function. (ulong)
parm:           s0_magic_packet:Enable S0 Magic Packet. (int)
parm:           tx_no_close_enable:Enable TX No Close. (int)
parm:           enable_ptp_master_mode:Enable PTP Master Mode. (int)
parm:           disable_pm_supportisable PM support. (int)
parm:           debugebug verbosity level (0=none, ..., 16=all) (int)

点评

带RSS,成功了  详情 回复 发表于 2022-2-16 10:18
我的恩山、我的无线 The best wifi forum is right here.
发表于 2021-12-14 10:11 | 显示全部楼层
这个不错!
话说普通的8111F之类也是支持RSS的吧(好像4队列?),不知能不能也这么改。

点评

根据大佬的帖子,我总结了下安装方法 https://tohot.top/archives/26.html 给大家参考  发表于 2022-10-28 23:18
我去官网翻了下驱动 只有r8168的包,驱动代码里没提到 rss的配置,桑心。  发表于 2022-2-28 22:21
如果通过lspci确认硬件支持,那么查看驱动源代码看看代码是否支持。一般来说都可以这样改。 我仔细阅读了代码,代码本身就处理了多队列,改成这样并无啥毛病。 realtek把这些芯片默认作为pc网卡芯片,没有开启多队  详情 回复 发表于 2021-12-14 10:33
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2021-12-14 10:33 | 显示全部楼层
墨色之月 发表于 2021-12-14 10:11
这个不错!
话说普通的8111F之类也是支持RSS的吧(好像4队列?),不知能不能也这么改。

如果通过lspci确认硬件支持,那么查看驱动源代码看看代码是否支持。一般来说都可以这样改。
我仔细阅读了代码,代码本身就处理了多队列,改成这样并无啥毛病。
realtek把这些芯片默认作为pc网卡芯片,没有开启多队列可以理解。
我的恩山、我的无线 The best wifi forum is right here.
发表于 2021-12-14 11:08 来自手机 | 显示全部楼层
这样做的好处是 更适合做软路由了吗  回降低cpu占用吗  还是要和多核cpu配合

点评

多核cpu 会让CPU处理网卡的中断更加均衡,理论上讲会提高性能。同  详情 回复 发表于 2021-12-14 13:20
我的恩山、我的无线 The best wifi forum is right here.
发表于 2021-12-14 11:17 | 显示全部楼层
mark一下,这个日后会需要的。

刚开始Unraid用2.5g驱动有点问题。现在更新系统就已经很完善了

点评

开启RSS 和TX 队列会锦上添花。  详情 回复 发表于 2021-12-14 13:26
我的恩山、我的无线 The best wifi forum is right here.
发表于 2021-12-14 12:02 | 显示全部楼层
请问PVE7.0自带8125B驱动的怎么搞啊?谢谢

点评

pve 7.0 不自带r8125驱动的,应该是有安装的。 你看看你的是不是用dkms安装,如果是,按照操作就好。如果不是dkms安装,建议使用dkms安装r8125驱动。这样更新kernel的时候会一般来说自动更新。  详情 回复 发表于 2021-12-14 13:18
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2021-12-14 13:18 | 显示全部楼层
smdx 发表于 2021-12-14 12:02
请问PVE7.0自带8125B驱动的怎么搞啊?谢谢

pve 7.0 不自带r8125驱动的,应该是有安装的。
你看看你的是不是用dkms安装,如果是,按照操作就好。如果不是dkms安装,建议使用dkms安装r8125驱动。这样更新kernel的时候会一般来说自动更新。

点评

[attachimg]522523[/attachimg] 就官方的7.0安装包装完pve后直接识别网卡了不是应该自带驱动了吗?  详情 回复 发表于 2021-12-14 13:34
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2021-12-14 13:20 | 显示全部楼层
whoweasn 发表于 2021-12-14 11:08
这样做的好处是 更适合做软路由了吗  回降低cpu占用吗  还是要和多核cpu配合

多核cpu 会让CPU处理网卡的中断更加均衡,理论上讲会提高性能。同
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2021-12-14 13:26 | 显示全部楼层
yc01121 发表于 2021-12-14 11:17
mark一下,这个日后会需要的。

刚开始Unraid用2.5g驱动有点问题。现在更新系统就已经很完善了

开启RSS 和TX 队列会锦上添花。
我的恩山、我的无线 The best wifi forum is right here.
发表于 2021-12-14 13:34 | 显示全部楼层
本帖最后由 smdx 于 2021-12-14 13:38 编辑
dominic 发表于 2021-12-14 13:18
pve 7.0 不自带r8125驱动的,应该是有安装的。
你看看你的是不是用dkms安装,如果是,按照操作就好。如 ...

就官方的7.0安装包装完pve后直接识别网卡了不是应该自带驱动了吗?就下载你提供的安装包用dkms安装就行了对吧?谢谢

pve版本:
2021-12-14_133120.jpg

点评

要么有人帮你处理了,要么目前使用的linux官方的r8169驱动。  详情 回复 发表于 2021-12-14 13:36
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2021-12-14 13:36 | 显示全部楼层
smdx 发表于 2021-12-14 13:34
就官方的7.0安装包装完pve后直接识别网卡了不是应该自带驱动了吗?

要么有人帮你处理了,要么目前使用的linux官方的r8169驱动。

点评

按你说的用modinfo r8125命令没有输出信息,应该是用r8169驱动了。马上安装试试,谢谢  详情 回复 发表于 2021-12-14 13:49
我的恩山、我的无线 The best wifi forum is right here.
发表于 2021-12-14 13:49 | 显示全部楼层
dominic 发表于 2021-12-14 13:36
要么有人帮你处理了,要么目前使用的linux官方的r8169驱动。

按你说的用modinfo r8125命令没有输出信息,应该是用r8169驱动了。马上安装试试,谢谢

点评

记得black r8169驱动  详情 回复 发表于 2021-12-14 13:59
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2021-12-14 13:59 | 显示全部楼层
smdx 发表于 2021-12-14 13:49
按你说的用modinfo r8125命令没有输出信息,应该是用r8169驱动了。马上安装试试,谢谢

记得black r8169驱动

点评

楼主请教一下,貌似安装不了.... ------------------------------ Deleting module version: 9.007.01 completely from the DKMS tree. ------------------------------ Done. Unpacking realtek-r8125-dkms  详情 回复 发表于 2021-12-14 14:10
我的恩山、我的无线 The best wifi forum is right here.
发表于 2021-12-14 14:10 | 显示全部楼层
dominic 发表于 2021-12-14 13:59
记得black r8169驱动

楼主请教一下,貌似安装不了....

------------------------------
Deleting module version: 9.007.01
completely from the DKMS tree.
------------------------------
Done.
Unpacking realtek-r8125-dkms (9.007.01-1) over (9.007.01-1) ...
Setting up realtek-r8125-dkms (9.007.01-1) ...
Loading new realtek-r8125-9.007.01 DKMS files...
Building for 5.11.22-4-pve
Building for architecture amd64
Module build for kernel 5.11.22-4-pve was skipped since the
kernel headers for this kernel does not seem to be installed.

点评

你没有安装header。 apt update && apt install pve-headers-$(uname -r)  详情 回复 发表于 2021-12-14 16:25
我的恩山、我的无线 The best wifi forum is right here.
 楼主| 发表于 2021-12-14 16:25 | 显示全部楼层
smdx 发表于 2021-12-14 14:10
楼主请教一下,貌似安装不了....

------------------------------

你没有安装header。

apt update && apt install pve-headers-$(uname -r)

点评

谢谢,已经安装好了。 请问这样算是正常使用了吗? [attachimg]522594[/attachimg]  详情 回复 发表于 2021-12-14 19:13
我的恩山、我的无线 The best wifi forum is right here.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )|网站地图

GMT+8, 2023-6-10 14:59

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表