From 14fec572a43844df96aa3219297df4f9ed4dcd63 Mon Sep 17 00:00:00 2001 From: Bhavesh Davda Date: Fri, 29 Sep 2017 17:34:02 -0700 Subject: [PATCH] Leave SG enabled for Linux AF_PACKET runmode TSO depends on SG, so if SG is disabled, TSO will get disabled by the Linux kernel even if we request TSO to remain enabled. Signed-off-by: Bhavesh Davda --- src/util-ioctl.c | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/util-ioctl.c b/src/util-ioctl.c index e277210e..09028d98 100644 --- a/src/util-ioctl.c +++ b/src/util-ioctl.c @@ -355,7 +355,6 @@ static int GetIfaceOffloadingLinux(const char *dev, int csum, int other) if (other) { const char *lro = "unset", *gro = "unset", *gso = "unset"; - const char *sg = "unset"; int other_ret = 0; #ifdef ETHTOOL_GGRO if (GetEthtoolValue(dev, ETHTOOL_GGRO, &value) == 0 && value != 0) { @@ -369,12 +368,6 @@ static int GetIfaceOffloadingLinux(const char *dev, int csum, int other) other_ret = 1; } #endif -#ifdef ETHTOOL_GSG - if (GetEthtoolValue(dev, ETHTOOL_GSG, &value) == 0 && value != 0) { - sg = "SET"; - other_ret = 1; - } -#endif #ifdef ETHTOOL_GFLAGS if (GetEthtoolValue(dev, ETHTOOL_GFLAGS, &value) == 0) { if (value & ETH_FLAG_LRO) { @@ -384,13 +377,13 @@ 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, " - "GSO: %s", dev, sg, gro, lro, gso); + SCLogPerf("NIC offloading on %s: GRO: %s, LRO: %s, " + "GSO: %s", dev, gro, lro, gso); } else { - SCLogWarning(SC_ERR_NIC_OFFLOADING, "NIC offloading on %s: SG: %s, " + SCLogWarning(SC_ERR_NIC_OFFLOADING, "NIC offloading on %s: " " GRO: %s, LRO: %s, GSO: %s. Run: " - "ethtool -K %s sg off gro off lro off gso off", - dev, sg, gro, lro, gso, dev); + "ethtool -K %s gro off lro off gso off", + dev, gro, lro, gso, dev); ret = 1; } } @@ -438,13 +431,6 @@ static int DisableIfaceOffloadingLinux(LiveDevice *ldev, int csum, int other) ldev->offload_orig |= OFFLOAD_FLAG_GSO; } #endif -#ifdef ETHTOOL_GSG - if (GetEthtoolValue(dev, ETHTOOL_GSG, &value) == 0 && value != 0) { - SCLogPerf("%s: disabling sg offloading", dev); - SetEthtoolValue(dev, ETHTOOL_SSG, 0); - ldev->offload_orig |= OFFLOAD_FLAG_SG; - } -#endif #ifdef ETHTOOL_GFLAGS if (GetEthtoolValue(dev, ETHTOOL_GFLAGS, &value) == 0) { if (value & ETH_FLAG_LRO) { @@ -489,12 +475,6 @@ static int RestoreIfaceOffloadingLinux(LiveDevice *ldev) SetEthtoolValue(dev, ETHTOOL_SGSO, 1); } #endif -#ifdef ETHTOOL_GSG - if (ldev->offload_orig & OFFLOAD_FLAG_SG) { - SCLogPerf("%s: restoring sg offloading", dev); - SetEthtoolValue(dev, ETHTOOL_SSG, 1); - } -#endif #ifdef ETHTOOL_GFLAGS if (ldev->offload_orig & OFFLOAD_FLAG_LRO) { uint32_t value = 0; -- 2.12.2.575.gb14f27f.dirty