From c96e5ffc40585d463bea056f2fe02c29d43dcba7 Mon Sep 17 00:00:00 2001 From: Evgeny Grin Date: Mon, 3 Apr 2023 18:17:24 +0300 Subject: [PATCH] Backport kernel 5.19 compatibility --- src/r8125_n.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/r8125_n.c b/src/r8125_n.c index 0bc5eec..e35e557 100644 --- a/src/r8125_n.c +++ b/src/r8125_n.c @@ -12715,6 +12715,10 @@ rtl8125_init_one(struct pci_dev *pdev, #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) dev->hw_features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6; dev->features |= NETIF_F_IPV6_CSUM; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0) + netif_set_tso_max_size(dev, LSO_64K); + netif_set_tso_max_segs(dev, NIC_MAX_PHYS_BUF_COUNT_LSO2); +#else //LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0) netif_set_gso_max_size(dev, LSO_64K); #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0) dev->gso_max_segs = NIC_MAX_PHYS_BUF_COUNT_LSO2; @@ -12722,6 +12726,7 @@ rtl8125_init_one(struct pci_dev *pdev, dev->gso_min_segs = NIC_MIN_PHYS_BUF_COUNT; #endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0) #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0) +#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0) #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) #endif //LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) -- 2.40.0