DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
	Long Wu <long.wu@corigine.com>,
	Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH 2/7] net/nfp: exit as soon as possible
Date: Wed, 19 Jun 2024 17:19:36 +0800	[thread overview]
Message-ID: <20240619091941.3479371-3-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20240619091941.3479371-1-chaoyong.he@corigine.com>

Add log message and exit as soon as possible.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower_flow.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c
index e5ee6f1fb9..f1388620d6 100644
--- a/drivers/net/nfp/flower/nfp_flower_flow.c
+++ b/drivers/net/nfp/flower/nfp_flower_flow.c
@@ -1479,7 +1479,7 @@ nfp_flow_key_layers_calculate(const struct rte_flow_item items[],
 		const struct rte_flow_action actions[],
 		struct nfp_fl_key_ls *key_ls)
 {
-	int ret = 0;
+	int ret;
 
 	key_ls->key_layer_two = 0;
 	key_ls->key_layer = NFP_FLOWER_LAYER_PORT;
@@ -1490,10 +1490,19 @@ nfp_flow_key_layers_calculate(const struct rte_flow_item items[],
 	key_ls->vlan = 0;
 	key_ls->tun_type = NFP_FL_TUN_NONE;
 
-	ret |= nfp_flow_key_layers_calculate_items(items, key_ls);
-	ret |= nfp_flow_key_layers_calculate_actions(actions, key_ls);
+	ret = nfp_flow_key_layers_calculate_items(items, key_ls);
+	if (ret != 0) {
+		PMD_DRV_LOG(ERR, "flow items calculate failed");
+		return ret;
+	}
 
-	return ret;
+	ret = nfp_flow_key_layers_calculate_actions(actions, key_ls);
+	if (ret != 0) {
+		PMD_DRV_LOG(ERR, "flow actions check failed");
+		return ret;
+	}
+
+	return 0;
 }
 
 static bool
-- 
2.39.1


  parent reply	other threads:[~2024-06-19  9:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19  9:19 [PATCH 0/7] refactor flow validate and create interface Chaoyong He
2024-06-19  9:19 ` [PATCH 1/7] net/nfp: remove the unused parameter Chaoyong He
2024-06-19  9:19 ` Chaoyong He [this message]
2024-06-19  9:19 ` [PATCH 3/7] net/nfp: remove the duplicate logic of output action Chaoyong He
2024-06-19  9:19 ` [PATCH 4/7] net/nfp: split out the flow item check logic Chaoyong He
2024-06-19  9:19 ` [PATCH 5/7] net/nfp: simplify the flow item calculate logic Chaoyong He
2024-06-19  9:19 ` [PATCH 6/7] net/nfp: split out the flow action check logic Chaoyong He
2024-06-19  9:19 ` [PATCH 7/7] net/nfp: simplify the flow action calculate logic Chaoyong He
2024-07-07  2:11 ` [PATCH 0/7] refactor flow validate and create interface Ferruh Yigit

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=20240619091941.3479371-3-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.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).