From: Victor Julien Date: Sun, 8 Nov 2015 07:58:26 +0000 (+0100) Subject: offloading: compress printing of iface offloading X-Git-Tag: suricata-3.0RC2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf2588acc40823849d90ad4db12b64a507701ef2;p=thirdparty%2Fsuricata.git offloading: compress printing of iface offloading --- diff --git a/src/util-ioctl.c b/src/util-ioctl.c index 59e2bf2827..99a84a7e62 100644 --- a/src/util-ioctl.c +++ b/src/util-ioctl.c @@ -157,6 +157,7 @@ int GetIfaceOffloading(const char *pcap_dev) int fd; struct ethtool_value ethv; int ret = 0; + char *lro = "unset", *gro = "unset"; fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd == -1) { @@ -175,10 +176,8 @@ int GetIfaceOffloading(const char *pcap_dev) return -1; } else { if (ethv.data) { - SCLogInfo("Generic Receive Offload is set on %s", pcap_dev); + gro = "SET"; ret = 1; - } else { - SCLogInfo("Generic Receive Offload is unset on %s", pcap_dev); } } @@ -194,15 +193,13 @@ int GetIfaceOffloading(const char *pcap_dev) return -1; } else { if (ethv.data & ETH_FLAG_LRO) { - SCLogInfo("Large Receive Offload is set on %s", pcap_dev); + lro = "SET"; ret = 1; - } else { - SCLogInfo("Large Receive Offload is unset on %s", pcap_dev); } } close(fd); - + SCLogInfo("NIC offloading on %s: GRO: %s, LRO: %s", pcap_dev, gro, lro); return ret; #else /* ioctl is not defined, let's pretend returning 0 is ok */