offloading: reduce verbosity to 'perf'

pull/2266/head
Victor Julien 9 years ago
parent 2b2984dae9
commit 5e3b61cc65

@ -414,14 +414,14 @@ static int DisableIfaceOffloadingLinux(LiveDevice *ldev, int csum, int other)
if (csum) { if (csum) {
#ifdef ETHTOOL_GRXCSUM #ifdef ETHTOOL_GRXCSUM
if (GetEthtoolValue(dev, ETHTOOL_GRXCSUM, &value) == 0 && value != 0) { if (GetEthtoolValue(dev, ETHTOOL_GRXCSUM, &value) == 0 && value != 0) {
SCLogInfo("%s: disabling rxcsum offloading", dev); SCLogPerf("%s: disabling rxcsum offloading", dev);
SetEthtoolValue(dev, ETHTOOL_SRXCSUM, 0); SetEthtoolValue(dev, ETHTOOL_SRXCSUM, 0);
ldev->offload_orig |= OFFLOAD_FLAG_RXCSUM; ldev->offload_orig |= OFFLOAD_FLAG_RXCSUM;
} }
#endif #endif
#ifdef ETHTOOL_GTXCSUM #ifdef ETHTOOL_GTXCSUM
if (GetEthtoolValue(dev, ETHTOOL_GTXCSUM, &value) == 0 && value != 0) { if (GetEthtoolValue(dev, ETHTOOL_GTXCSUM, &value) == 0 && value != 0) {
SCLogInfo("%s: disabling txcsum offloading", dev); SCLogPerf("%s: disabling txcsum offloading", dev);
SetEthtoolValue(dev, ETHTOOL_STXCSUM, 0); SetEthtoolValue(dev, ETHTOOL_STXCSUM, 0);
ldev->offload_orig |= OFFLOAD_FLAG_TXCSUM; ldev->offload_orig |= OFFLOAD_FLAG_TXCSUM;
} }
@ -430,28 +430,28 @@ static int DisableIfaceOffloadingLinux(LiveDevice *ldev, int csum, int other)
if (other) { if (other) {
#ifdef ETHTOOL_GGRO #ifdef ETHTOOL_GGRO
if (GetEthtoolValue(dev, ETHTOOL_GGRO, &value) == 0 && value != 0) { if (GetEthtoolValue(dev, ETHTOOL_GGRO, &value) == 0 && value != 0) {
SCLogInfo("%s: disabling gro offloading", dev); SCLogPerf("%s: disabling gro offloading", dev);
SetEthtoolValue(dev, ETHTOOL_SGRO, 0); SetEthtoolValue(dev, ETHTOOL_SGRO, 0);
ldev->offload_orig |= OFFLOAD_FLAG_GRO; ldev->offload_orig |= OFFLOAD_FLAG_GRO;
} }
#endif #endif
#ifdef ETHTOOL_GTSO #ifdef ETHTOOL_GTSO
if (GetEthtoolValue(dev, ETHTOOL_GTSO, &value) == 0 && value != 0) { if (GetEthtoolValue(dev, ETHTOOL_GTSO, &value) == 0 && value != 0) {
SCLogInfo("%s: disabling tso offloading", dev); SCLogPerf("%s: disabling tso offloading", dev);
SetEthtoolValue(dev, ETHTOOL_STSO, 0); SetEthtoolValue(dev, ETHTOOL_STSO, 0);
ldev->offload_orig |= OFFLOAD_FLAG_TSO; ldev->offload_orig |= OFFLOAD_FLAG_TSO;
} }
#endif #endif
#ifdef ETHTOOL_GGSO #ifdef ETHTOOL_GGSO
if (GetEthtoolValue(dev, ETHTOOL_GGSO, &value) == 0 && value != 0) { if (GetEthtoolValue(dev, ETHTOOL_GGSO, &value) == 0 && value != 0) {
SCLogInfo("%s: disabling gso offloading", dev); SCLogPerf("%s: disabling gso offloading", dev);
SetEthtoolValue(dev, ETHTOOL_SGSO, 0); SetEthtoolValue(dev, ETHTOOL_SGSO, 0);
ldev->offload_orig |= OFFLOAD_FLAG_GSO; ldev->offload_orig |= OFFLOAD_FLAG_GSO;
} }
#endif #endif
#ifdef ETHTOOL_GSG #ifdef ETHTOOL_GSG
if (GetEthtoolValue(dev, ETHTOOL_GSG, &value) == 0 && value != 0) { if (GetEthtoolValue(dev, ETHTOOL_GSG, &value) == 0 && value != 0) {
SCLogInfo("%s: disabling sg offloading", dev); SCLogPerf("%s: disabling sg offloading", dev);
SetEthtoolValue(dev, ETHTOOL_SSG, 0); SetEthtoolValue(dev, ETHTOOL_SSG, 0);
ldev->offload_orig |= OFFLOAD_FLAG_SG; ldev->offload_orig |= OFFLOAD_FLAG_SG;
} }
@ -459,7 +459,7 @@ static int DisableIfaceOffloadingLinux(LiveDevice *ldev, int csum, int other)
#ifdef ETHTOOL_GFLAGS #ifdef ETHTOOL_GFLAGS
if (GetEthtoolValue(dev, ETHTOOL_GFLAGS, &value) == 0) { if (GetEthtoolValue(dev, ETHTOOL_GFLAGS, &value) == 0) {
if (value & ETH_FLAG_LRO) { if (value & ETH_FLAG_LRO) {
SCLogInfo("%s: disabling lro offloading", dev); SCLogPerf("%s: disabling lro offloading", dev);
SetEthtoolValue(dev, ETHTOOL_SFLAGS, value & ~ETH_FLAG_LRO); SetEthtoolValue(dev, ETHTOOL_SFLAGS, value & ~ETH_FLAG_LRO);
ldev->offload_orig |= OFFLOAD_FLAG_LRO; ldev->offload_orig |= OFFLOAD_FLAG_LRO;
} }
@ -478,37 +478,37 @@ static int RestoreIfaceOffloadingLinux(LiveDevice *ldev)
#ifdef ETHTOOL_GRXCSUM #ifdef ETHTOOL_GRXCSUM
if (ldev->offload_orig & OFFLOAD_FLAG_RXCSUM) { if (ldev->offload_orig & OFFLOAD_FLAG_RXCSUM) {
SCLogInfo("%s: restoring rxcsum offloading", dev); SCLogPerf("%s: restoring rxcsum offloading", dev);
SetEthtoolValue(dev, ETHTOOL_SRXCSUM, 1); SetEthtoolValue(dev, ETHTOOL_SRXCSUM, 1);
} }
#endif #endif
#ifdef ETHTOOL_GTXCSUM #ifdef ETHTOOL_GTXCSUM
if (ldev->offload_orig & OFFLOAD_FLAG_TXCSUM) { if (ldev->offload_orig & OFFLOAD_FLAG_TXCSUM) {
SCLogInfo("%s: restoring txcsum offloading", dev); SCLogPerf("%s: restoring txcsum offloading", dev);
SetEthtoolValue(dev, ETHTOOL_STXCSUM, 1); SetEthtoolValue(dev, ETHTOOL_STXCSUM, 1);
} }
#endif #endif
#ifdef ETHTOOL_GGRO #ifdef ETHTOOL_GGRO
if (ldev->offload_orig & OFFLOAD_FLAG_GRO) { if (ldev->offload_orig & OFFLOAD_FLAG_GRO) {
SCLogInfo("%s: restoring gro offloading", dev); SCLogPerf("%s: restoring gro offloading", dev);
SetEthtoolValue(dev, ETHTOOL_SGRO, 1); SetEthtoolValue(dev, ETHTOOL_SGRO, 1);
} }
#endif #endif
#ifdef ETHTOOL_GTSO #ifdef ETHTOOL_GTSO
if (ldev->offload_orig & OFFLOAD_FLAG_TSO) { if (ldev->offload_orig & OFFLOAD_FLAG_TSO) {
SCLogInfo("%s: restoring tso offloading", dev); SCLogPerf("%s: restoring tso offloading", dev);
SetEthtoolValue(dev, ETHTOOL_STSO, 1); SetEthtoolValue(dev, ETHTOOL_STSO, 1);
} }
#endif #endif
#ifdef ETHTOOL_GGSO #ifdef ETHTOOL_GGSO
if (ldev->offload_orig & OFFLOAD_FLAG_GSO) { if (ldev->offload_orig & OFFLOAD_FLAG_GSO) {
SCLogInfo("%s: restoring gso offloading", dev); SCLogPerf("%s: restoring gso offloading", dev);
SetEthtoolValue(dev, ETHTOOL_SGSO, 1); SetEthtoolValue(dev, ETHTOOL_SGSO, 1);
} }
#endif #endif
#ifdef ETHTOOL_GSG #ifdef ETHTOOL_GSG
if (ldev->offload_orig & OFFLOAD_FLAG_SG) { if (ldev->offload_orig & OFFLOAD_FLAG_SG) {
SCLogInfo("%s: restoring sg offloading", dev); SCLogPerf("%s: restoring sg offloading", dev);
SetEthtoolValue(dev, ETHTOOL_SSG, 1); SetEthtoolValue(dev, ETHTOOL_SSG, 1);
} }
#endif #endif
@ -516,7 +516,7 @@ static int RestoreIfaceOffloadingLinux(LiveDevice *ldev)
if (ldev->offload_orig & OFFLOAD_FLAG_LRO) { if (ldev->offload_orig & OFFLOAD_FLAG_LRO) {
uint32_t value = 0; uint32_t value = 0;
if (GetEthtoolValue(dev, ETHTOOL_GFLAGS, &value) == 0) { if (GetEthtoolValue(dev, ETHTOOL_GFLAGS, &value) == 0) {
SCLogInfo("%s: restoring lro offloading", dev); SCLogPerf("%s: restoring lro offloading", dev);
SetEthtoolValue(dev, ETHTOOL_SFLAGS, value & ETH_FLAG_LRO); SetEthtoolValue(dev, ETHTOOL_SFLAGS, value & ETH_FLAG_LRO);
} }
} }
@ -580,18 +580,18 @@ static int DisableIfaceOffloadingBSD(LiveDevice *ldev)
SCLogDebug("if_caps %X", if_caps); SCLogDebug("if_caps %X", if_caps);
if (if_caps & IFCAP_RXCSUM) { if (if_caps & IFCAP_RXCSUM) {
SCLogInfo("%s: disabling rxcsum offloading", ifname); SCLogPerf("%s: disabling rxcsum offloading", ifname);
set_caps &= ~IFCAP_RXCSUM; set_caps &= ~IFCAP_RXCSUM;
} }
#ifdef IFCAP_TOE #ifdef IFCAP_TOE
if (if_caps & (IFCAP_TSO|IFCAP_TOE|IFCAP_LRO)) { if (if_caps & (IFCAP_TSO|IFCAP_TOE|IFCAP_LRO)) {
SCLogInfo("%s: disabling tso|toe|lro offloading", ifname); SCLogPerf("%s: disabling tso|toe|lro offloading", ifname);
set_caps &= ~(IFCAP_TSO|IFCAP_LRO); set_caps &= ~(IFCAP_TSO|IFCAP_LRO);
} }
#else #else
if (if_caps & (IFCAP_TSO|IFCAP_LRO)) { if (if_caps & (IFCAP_TSO|IFCAP_LRO)) {
SCLogInfo("%s: disabling tso|lro offloading", ifname); SCLogPerf("%s: disabling tso|lro offloading", ifname);
set_caps &= ~(IFCAP_TSO|IFCAP_LRO); set_caps &= ~(IFCAP_TSO|IFCAP_LRO);
} }
#endif #endif
@ -628,21 +628,21 @@ static int RestoreIfaceOffloadingBSD(LiveDevice *ldev)
SCLogDebug("if_caps %X", if_caps); SCLogDebug("if_caps %X", if_caps);
if (ldev->offload_orig & OFFLOAD_FLAG_RXCSUM) { if (ldev->offload_orig & OFFLOAD_FLAG_RXCSUM) {
SCLogInfo("%s: restoring rxcsum offloading", ifname); SCLogPerf("%s: restoring rxcsum offloading", ifname);
set_caps |= IFCAP_RXCSUM; set_caps |= IFCAP_RXCSUM;
} }
if (ldev->offload_orig & OFFLOAD_FLAG_TSO) { if (ldev->offload_orig & OFFLOAD_FLAG_TSO) {
SCLogInfo("%s: restoring tso offloading", ifname); SCLogPerf("%s: restoring tso offloading", ifname);
set_caps |= IFCAP_TSO; set_caps |= IFCAP_TSO;
} }
#ifdef IFCAP_TOE #ifdef IFCAP_TOE
if (ldev->offload_orig & OFFLOAD_FLAG_TOE) { if (ldev->offload_orig & OFFLOAD_FLAG_TOE) {
SCLogInfo("%s: restoring toe offloading", ifname); SCLogPerf("%s: restoring toe offloading", ifname);
set_caps |= IFCAP_TOE; set_caps |= IFCAP_TOE;
} }
#endif #endif
if (ldev->offload_orig & OFFLOAD_FLAG_LRO) { if (ldev->offload_orig & OFFLOAD_FLAG_LRO) {
SCLogInfo("%s: restoring lro offloading", ifname); SCLogPerf("%s: restoring lro offloading", ifname);
set_caps |= IFCAP_LRO; set_caps |= IFCAP_LRO;
} }

Loading…
Cancel
Save