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, Long Wu <long.wu@corigine.com>,
	Chaoyong He <chaoyong.he@corigine.com>,
	stable@dpdk.org
Subject: [PATCH 1/2] net/nfp: fix IP flow rule failed
Date: Tue, 12 Mar 2024 16:02:44 +0800	[thread overview]
Message-ID: <20240312080245.2783410-2-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20240312080245.2783410-1-chaoyong.he@corigine.com>

From: Long Wu <long.wu@corigine.com>

If the flow rule dose not have 'spec' in IP layer, NFP will
set all IP flow control message type to 0.

Move up the IP flow control message setting code to fix it.

Fixes: 42eabda06b0f ("net/nfp: support IPv4 flow item")
Fixes: 9f27cb889246 ("net/nfp: support IPv6 flow item")
Cc: Chaoyong He <chaoyong.he@corigine.com>
Cc: stable@dpdk.org

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfp_net_flow.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_net_flow.c b/drivers/net/nfp/nfp_net_flow.c
index 3b33f3b6e9..bd983aaf6a 100644
--- a/drivers/net/nfp/nfp_net_flow.c
+++ b/drivers/net/nfp/nfp_net_flow.c
@@ -237,6 +237,8 @@ nfp_net_flow_merge_ipv4(struct rte_flow *nfp_flow,
 	const struct rte_flow_item_ipv4 *mask;
 	const struct rte_flow_item_ipv4 *spec;
 
+	nfp_flow->payload.cmsg_type = NFP_NET_CFG_MBOX_CMD_FS_ADD_V4;
+
 	spec = item->spec;
 	if (spec == NULL) {
 		PMD_DRV_LOG(DEBUG, "NFP flow merge ipv4: no item->spec!");
@@ -245,7 +247,6 @@ nfp_net_flow_merge_ipv4(struct rte_flow *nfp_flow,
 
 	mask = (item->mask != NULL) ? item->mask : proc->mask_default;
 
-	nfp_flow->payload.cmsg_type = NFP_NET_CFG_MBOX_CMD_FS_ADD_V4;
 	ipv4 = (struct nfp_net_cmsg_match_v4 *)nfp_flow->payload.match_data;
 
 	ipv4->l4_protocol_mask = mask->hdr.next_proto_id;
@@ -269,6 +270,8 @@ nfp_net_flow_merge_ipv6(struct rte_flow *nfp_flow,
 	const struct rte_flow_item_ipv6 *mask;
 	const struct rte_flow_item_ipv6 *spec;
 
+	nfp_flow->payload.cmsg_type = NFP_NET_CFG_MBOX_CMD_FS_ADD_V6;
+
 	spec = item->spec;
 	if (spec == NULL) {
 		PMD_DRV_LOG(DEBUG, "NFP flow merge ipv6: no item->spec!");
@@ -277,7 +280,6 @@ nfp_net_flow_merge_ipv6(struct rte_flow *nfp_flow,
 
 	mask = (item->mask != NULL) ? item->mask : proc->mask_default;
 
-	nfp_flow->payload.cmsg_type = NFP_NET_CFG_MBOX_CMD_FS_ADD_V6;
 	ipv6 = (struct nfp_net_cmsg_match_v6 *)nfp_flow->payload.match_data;
 
 	ipv6->l4_protocol_mask = mask->hdr.proto;
-- 
2.39.1


  reply	other threads:[~2024-03-12  8:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12  8:02 [PATCH 0/2] fix problems about flow steering Chaoyong He
2024-03-12  8:02 ` Chaoyong He [this message]
2024-03-12  8:02 ` [PATCH 2/2] net/nfp: fix incorrect queue index Chaoyong He
2024-03-13 18:10 ` [PATCH 0/2] fix problems about flow steering 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=20240312080245.2783410-2-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=stable@dpdk.org \
    /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).