pktgen: adjust flag NO_TIMESTAMP to be more pktgen compliant
authorJesper Dangaard Brouer <brouer@redhat.com>
Thu, 7 May 2015 14:34:51 +0000 (16:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 10 May 2015 02:26:06 +0000 (22:26 -0400)
Allow flag NO_TIMESTAMP to turn timestamping on again, like other flags,
with a negation of the flag like !NO_TIMESTAMP.

Also document the option flag NO_TIMESTAMP.

Fixes: afb84b626184 ("pktgen: add flag NO_TIMESTAMP to disable timestamping")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/pktgen.txt
net/core/pktgen.c

index 0344f1d45b3765b016f0388a830e3a8e48af31ce..6199ee6a040b2c067528ec510926c50be4838185 100644 (file)
@@ -145,6 +145,7 @@ Examples:
                               UDPCSUM,
                               IPSEC # IPsec encapsulation (needs CONFIG_XFRM)
                               NODE_ALLOC # node specific memory allocation
+                              NO_TIMESTAMP # disable timestamping
 
  pgset spi SPI_VALUE     Set specific SA used to transform packet.
 
@@ -287,6 +288,7 @@ flag
   UDPCSUM
   IPSEC
   NODE_ALLOC
+  NO_TIMESTAMP
 
 dst_min
 dst_max
index 508155b283ddcc73a967a2bc8068e67cb8cada7d..43bb2150737307219548cef34d407f11f157c5d3 100644 (file)
@@ -1267,6 +1267,9 @@ static ssize_t pktgen_if_write(struct file *file,
                else if (strcmp(f, "NO_TIMESTAMP") == 0)
                        pkt_dev->flags |= F_NO_TIMESTAMP;
 
+               else if (strcmp(f, "!NO_TIMESTAMP") == 0)
+                       pkt_dev->flags &= ~F_NO_TIMESTAMP;
+
                else {
                        sprintf(pg_result,
                                "Flag -:%s:- unknown\nAvailable flags, (prepend ! to un-set flag):\n%s",