From 04965b564f0a739132164a9b8a0205446a092186 Mon Sep 17 00:00:00 2001 From: Bhavesh Davda Date: Fri, 29 Sep 2017 13:39:53 -0700 Subject: [PATCH] Leave TSO enabled for Linux AF_PACKET runmode TSO (TCP Segmentation Offload) is a commonly implemented offloads in most if not all NICs, and results in a huge gain in performance, both in terms of reduced CPU utilization, and increased throughput. There should not be any problems leaving it enabled, unlike other receive-side offloads. Signed-off-by: Bhavesh Davda --- src/util-ioctl.c | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/src/util-ioctl.c b/src/util-ioctl.c index 1e54cbc7..e277210e 100644 --- a/src/util-ioctl.c +++ b/src/util-ioctl.c @@ -354,7 +354,7 @@ static int GetIfaceOffloadingLinux(const char *dev, int csum, int other) } if (other) { - const char *lro = "unset", *gro = "unset", *tso = "unset", *gso = "unset"; + const char *lro = "unset", *gro = "unset", *gso = "unset"; const char *sg = "unset"; int other_ret = 0; #ifdef ETHTOOL_GGRO @@ -363,12 +363,6 @@ static int GetIfaceOffloadingLinux(const char *dev, int csum, int other) other_ret = 1; } #endif -#ifdef ETHTOOL_GTSO - if (GetEthtoolValue(dev, ETHTOOL_GTSO, &value) == 0 && value != 0) { - tso = "SET"; - other_ret = 1; - } -#endif #ifdef ETHTOOL_GGSO if (GetEthtoolValue(dev, ETHTOOL_GGSO, &value) == 0 && value != 0) { gso = "SET"; @@ -391,12 +385,12 @@ static int GetIfaceOffloadingLinux(const char *dev, int csum, int other) #endif if (other_ret == 0) { SCLogPerf("NIC offloading on %s: SG: %s, GRO: %s, LRO: %s, " - "TSO: %s, GSO: %s", dev, sg, gro, lro, tso, gso); + "GSO: %s", dev, sg, gro, lro, gso); } else { SCLogWarning(SC_ERR_NIC_OFFLOADING, "NIC offloading on %s: SG: %s, " - " GRO: %s, LRO: %s, TSO: %s, GSO: %s. Run: " - "ethtool -K %s sg off gro off lro off tso off gso off", - dev, sg, gro, lro, tso, gso, dev); + " GRO: %s, LRO: %s, GSO: %s. Run: " + "ethtool -K %s sg off gro off lro off gso off", + dev, sg, gro, lro, gso, dev); ret = 1; } } @@ -437,13 +431,6 @@ static int DisableIfaceOffloadingLinux(LiveDevice *ldev, int csum, int other) ldev->offload_orig |= OFFLOAD_FLAG_GRO; } #endif -#ifdef ETHTOOL_GTSO - if (GetEthtoolValue(dev, ETHTOOL_GTSO, &value) == 0 && value != 0) { - SCLogPerf("%s: disabling tso offloading", dev); - SetEthtoolValue(dev, ETHTOOL_STSO, 0); - ldev->offload_orig |= OFFLOAD_FLAG_TSO; - } -#endif #ifdef ETHTOOL_GGSO if (GetEthtoolValue(dev, ETHTOOL_GGSO, &value) == 0 && value != 0) { SCLogPerf("%s: disabling gso offloading", dev); @@ -496,12 +483,6 @@ static int RestoreIfaceOffloadingLinux(LiveDevice *ldev) SetEthtoolValue(dev, ETHTOOL_SGRO, 1); } #endif -#ifdef ETHTOOL_GTSO - if (ldev->offload_orig & OFFLOAD_FLAG_TSO) { - SCLogPerf("%s: restoring tso offloading", dev); - SetEthtoolValue(dev, ETHTOOL_STSO, 1); - } -#endif #ifdef ETHTOOL_GGSO if (ldev->offload_orig & OFFLOAD_FLAG_GSO) { SCLogPerf("%s: restoring gso offloading", dev); @@ -666,7 +647,7 @@ static int RestoreIfaceOffloadingBSD(LiveDevice *ldev) * * \param Name of link * \param csum check if checksums are offloaded - * \param other check if other things are offloaded: TSO, GRO, etc. + * \param other check if other things are offloaded: LRO, GRO, etc. * \retval -1 in case of error, 0 if none, 1 if some */ int GetIfaceOffloading(const char *dev, int csum, int other) -- 2.12.2.575.gb14f27f.dirty