mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Safonov <dima@arista.com>
To: linux-kernel@vger.kernel.org
Cc: Dmitry Safonov <dima@arista.com>, Arnd Bergmann <arnd@arndb.de>,
	"David S. Miller" <davem@davemloft.net>,
	David Windsor <dwindsor@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Ingo Molnar <mingo@kernel.org>,
	Johannes Berg <johannes.berg@intel.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Radu Rendec <rrendec@arista.com>,
	"Reshetova, Elena" <elena.reshetova@intel.com>,
	netdev@vger.kernel.org
Subject: [PATCHv2 2/5] pktgen: Add missing !flag parameters
Date: Thu, 18 Jan 2018 18:31:34 +0000	[thread overview]
Message-ID: <20180118183137.16053-3-dima@arista.com> (raw)
In-Reply-To: <20180118183137.16053-1-dima@arista.com>

o FLOW_SEQ now can be disabled with pgset "flag !FLOW_SEQ"
o FLOW_SEQ and FLOW_RND are antonyms, as it's shown by pktgen_if_show()
o IPSEC now may be disabled

Note, that IPV6 is enabled with dst6/src6 parameters, not with
a flag parameter.

Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 net/core/pktgen.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index f95a15086225..ab63943ffd03 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1285,9 +1285,12 @@ static ssize_t pktgen_if_write(struct file *file,
 		else if (strcmp(f, "!SVID_RND") == 0)
 			pkt_dev->flags &= ~F_SVID_RND;
 
-		else if (strcmp(f, "FLOW_SEQ") == 0)
+		else if (strcmp(f, "FLOW_SEQ") == 0 || strcmp(f, "!FLOW_RND") == 0)
 			pkt_dev->flags |= F_FLOW_SEQ;
 
+		else if (strcmp(f, "FLOW_RND") == 0 || strcmp(f, "!FLOW_SEQ") == 0)
+			pkt_dev->flags &= ~F_FLOW_SEQ;
+
 		else if (strcmp(f, "QUEUE_MAP_RND") == 0)
 			pkt_dev->flags |= F_QUEUE_MAP_RND;
 
@@ -1302,6 +1305,9 @@ static ssize_t pktgen_if_write(struct file *file,
 #ifdef CONFIG_XFRM
 		else if (strcmp(f, "IPSEC") == 0)
 			pkt_dev->flags |= F_IPSEC_ON;
+
+		else if (strcmp(f, "!IPSEC") == 0)
+			pkt_dev->flags &= ~F_IPSEC_ON;
 #endif
 
 		else if (strcmp(f, "!IPV6") == 0)
-- 
2.13.6

  parent reply	other threads:[~2018-01-18 18:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 18:31 [PATCHv2 0/5] pktgen: Behavior flags fixes Dmitry Safonov
2018-01-18 18:31 ` [PATCHv2 1/5] Documentation/pktgen: Clearify how-to use pktgen samples Dmitry Safonov
2018-01-18 18:31 ` Dmitry Safonov [this message]
2018-01-18 18:31 ` [PATCHv2 3/5] pktgen: Add behaviour flags macro to generate flags/names Dmitry Safonov
2018-01-18 18:31 ` [PATCHv2 4/5] pktgen: Remove brute-force printing of flags Dmitry Safonov
2018-01-18 18:31 ` [PATCHv2 5/5] pktgen: Clean read user supplied flag mess Dmitry Safonov
2018-01-24 20:03 ` [PATCHv2 0/5] pktgen: Behavior flags fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180118183137.16053-3-dima@arista.com \
    --to=dima@arista.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=dwindsor@gmail.com \
    --cc=edumazet@google.com \
    --cc=elena.reshetova@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rrendec@arista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome