From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Long Wu <long.wu@corigine.com>,
stable@dpdk.org, Chaoyong He <chaoyong.he@corigine.com>,
Peng Zhang <peng.zhang@corigine.com>,
Zerun Fu <zerun.fu@corigine.com>
Subject: [PATCH] net/nfp: fix parsing non-exist meta data
Date: Mon, 15 Apr 2024 10:47:58 +0800 [thread overview]
Message-ID: <20240415024758.1001527-1-chaoyong.he@corigine.com> (raw)
From: Long Wu <long.wu@corigine.com>
If the packet without meta data, the initialization logic of
'meta->flags' will be skipped and lead to the wrong logic
because of 'meta->flags' has random value.
Fix it by make sure 'meta->flags' can be initialized in any situation.
Fixes: 5eed6ad5a7b9 ("net/nfp: use flag bits to control meta data parsing")
Cc: stable@dpdk.org
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Zerun Fu <zerun.fu@corigine.com>
---
drivers/net/nfp/nfp_net_meta.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/nfp/nfp_net_meta.c b/drivers/net/nfp/nfp_net_meta.c
index fa7e0d3d00..b31ef56f17 100644
--- a/drivers/net/nfp/nfp_net_meta.c
+++ b/drivers/net/nfp/nfp_net_meta.c
@@ -27,7 +27,6 @@ nfp_net_meta_parse_chained(uint8_t *meta_base,
meta_info = rte_be_to_cpu_32(meta_header);
meta_offset = meta_base + 4;
- meta->flags = 0;
for (; meta_info != 0; meta_info >>= NFP_NET_META_FIELD_SIZE, meta_offset += 4) {
switch (meta_info & NFP_NET_META_FIELD_MASK) {
@@ -237,6 +236,8 @@ nfp_net_meta_parse(struct nfp_net_rx_desc *rxds,
uint8_t *meta_base;
rte_be32_t meta_header;
+ meta->flags = 0;
+
if (unlikely(NFP_DESC_META_LEN(rxds) == 0))
return;
--
2.39.1
next reply other threads:[~2024-04-15 2:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 2:47 Chaoyong He [this message]
2024-04-19 0:54 ` 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=20240415024758.1001527-1-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 \
--cc=stable@dpdk.org \
--cc=zerun.fu@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).