patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
To: dev@dpdk.org
Cc: stable@dpdk.org,
	Venkata Suresh Kumar P <venkata.suresh.kumar.p@intel.com>,
	Churchill Khangar <churchill.khangar@intel.com>
Subject: [dpdk-stable] [PATCH] pipeline: fix table entry read
Date: Mon,  5 Jul 2021 23:51:09 +0100	[thread overview]
Message-ID: <20210705225109.92180-1-cristian.dumitrescu@intel.com> (raw)

The rte_swx_pipeline_table_entry_read() function is used to read from
a character string a table entry that is to be added to the table,
deleted from the table or set as the default entry of teh table.
Addition needs both the match and the part of the entry, deletion
ignores the action part, while the default set ignores the match part,
hence the need to make both the match and the action part optional.
The logic for skipping the match or the action part was broken, hence
the current fix.

Fixes: b32c0a2c5e4c ("pipeline: add SWX table update high level API")
Cc: stable@dpdk.org

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Venkata Suresh Kumar P <venkata.suresh.kumar.p@intel.com>
Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>
---
 lib/pipeline/rte_swx_ctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/pipeline/rte_swx_ctl.c b/lib/pipeline/rte_swx_ctl.c
index 8cabce2b9..4ee47df10 100644
--- a/lib/pipeline/rte_swx_ctl.c
+++ b/lib/pipeline/rte_swx_ctl.c
@@ -2282,7 +2282,7 @@ rte_swx_ctl_pipeline_table_entry_read(struct rte_swx_ctl_pipeline *ctl,
 	/*
 	 * Match.
 	 */
-	if (n_tokens && strcmp(tokens[0], "match"))
+	if (!(n_tokens && !strcmp(tokens[0], "match")))
 		goto action;
 
 	if (n_tokens < 1 + table->info.n_match_fields)
@@ -2365,7 +2365,7 @@ rte_swx_ctl_pipeline_table_entry_read(struct rte_swx_ctl_pipeline *ctl,
 	 * Action.
 	 */
 action:
-	if (n_tokens && strcmp(tokens[0], "action"))
+	if (!(n_tokens && !strcmp(tokens[0], "action")))
 		goto other;
 
 	if (n_tokens < 2)
-- 
2.17.1


             reply	other threads:[~2021-07-05 22:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 22:51 Cristian Dumitrescu [this message]
2021-07-05 22:56 ` [dpdk-stable] [PATCH V2] " Cristian Dumitrescu
2021-07-09 21:12   ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

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=20210705225109.92180-1-cristian.dumitrescu@intel.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=churchill.khangar@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=venkata.suresh.kumar.p@intel.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;
as well as URLs for NNTP newsgroup(s).