patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/nfp: fix parsing non-exist meta data
@ 2024-04-15  2:47 Chaoyong He
  2024-04-19  0:54 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Chaoyong He @ 2024-04-15  2:47 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Long Wu, stable, Chaoyong He, Peng Zhang, Zerun Fu

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/nfp: fix parsing non-exist meta data
  2024-04-15  2:47 [PATCH] net/nfp: fix parsing non-exist meta data Chaoyong He
@ 2024-04-19  0:54 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2024-04-19  0:54 UTC (permalink / raw)
  To: Chaoyong He, dev; +Cc: oss-drivers, Long Wu, stable, Peng Zhang, Zerun Fu

On 4/15/2024 3:47 AM, Chaoyong He wrote:
> 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>
>

Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-19  0:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-15  2:47 [PATCH] net/nfp: fix parsing non-exist meta data Chaoyong He
2024-04-19  0:54 ` Ferruh Yigit

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).