]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
offloading: compress printing of iface offloading
authorVictor Julien <victor@inliniac.net>
Sun, 8 Nov 2015 07:58:26 +0000 (08:58 +0100)
committerVictor Julien <victor@inliniac.net>
Sun, 6 Dec 2015 09:49:29 +0000 (10:49 +0100)
src/util-ioctl.c

index 59e2bf2827288f6253c6c836ff0c5a287ec269b3..99a84a7e62c891b0726439e7b1e4546425147a11 100644 (file)
@@ -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 */