patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Qiming Yang <qiming.yang@intel.com>
To: qi.z.zhang@intel.com, dev@dpdk.org
Cc: Qiming Yang <qiming.yang@intel.com>, stable@dpdk.org
Subject: [PATCH] net/ice: fix VLAN mode parser
Date: Sun, 25 Jun 2023 08:23:08 +0000	[thread overview]
Message-ID: <20230625082308.2674971-1-qiming.yang@intel.com> (raw)

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


             reply	other threads:[~2023-06-25  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-25  8:23 Qiming Yang [this message]
2023-06-28  6:48 ` Zhang, Qi Z

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=20230625082308.2674971-1-qiming.yang@intel.com \
    --to=qiming.yang@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.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).