DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/ice: fix VLAN mode parser
@ 2023-06-25  8:23 Qiming Yang
  2023-06-28  6:48 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Qiming Yang @ 2023-06-25  8:23 UTC (permalink / raw)
  To: qi.z.zhang, dev; +Cc: Qiming Yang, stable

Parser will not be ctreated if raw packet filter is not support.
This patch add NULL pointer check for parser structure when VLAN
mode configure.

Fixes: 6e753d777ffc ("net/ice: initialize parser for double VLAN")
Cc: stable@dpdk.org

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/ice_generic_flow.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index ed3075d555..91bf1d6fcb 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -1836,10 +1836,12 @@ ice_flow_init(struct ice_adapter *ad)
 	if (ice_parser_create(&ad->hw, &ad->psr) != ICE_SUCCESS)
 		PMD_INIT_LOG(WARNING, "Failed to initialize DDP parser, raw packet filter will not be supported");
 
-	if (ice_is_dvm_ena(&ad->hw))
-		ice_parser_dvm_set(ad->psr, true);
-	else
-		ice_parser_dvm_set(ad->psr, false);
+	if (ad->psr) {
+		if (ice_is_dvm_ena(&ad->hw))
+			ice_parser_dvm_set(ad->psr, true);
+		else
+			ice_parser_dvm_set(ad->psr, false);
+	}
 
 	RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
 		if (engine->init == NULL) {
-- 
2.25.1


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

end of thread, other threads:[~2023-06-28  6:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-25  8:23 [PATCH] net/ice: fix VLAN mode parser Qiming Yang
2023-06-28  6:48 ` Zhang, Qi Z

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