From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D70EF45599; Fri, 5 Jul 2024 15:52:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C82242ED8; Fri, 5 Jul 2024 15:52:46 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by mails.dpdk.org (Postfix) with ESMTP id BB538410D4; Fri, 5 Jul 2024 15:52:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720187565; x=1751723565; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HTZdzChnomsi8HQgfmnp7vAP7Vifntg46GdZFso8M2w=; b=gd2DxgjKoxaKdfUol1ZWrsLElNPDOJ7KWHd1pd/aPOZJY0bdA3A2AEnb IYRUZadCk/O61dGPMX4PBg6lwjGRFTm1NO3C2srDM79hoMzVapjAhJsXt HL5uJ5CEAGy96sGQJl3fFqfmf6H7FGzmV8Sv1GR8HJ9LPotuPDDyi1wgr JSiVmLC6P/bOLT9qSexmA/Ch46utWPRk7ZHQ9J9Nm7efqHpJRWw9qnXhw 8WkCYEpM6zgc9kp57XYJKsnCj0drYLkYLJycbAzDhW3I/PV/f7wUrwvbY 0ntcgPXb+YBTfC7bBAdTACzx6KKRNt9iO2Rq5wNTqIhhfAtcmWsg7P6yY w==; X-CSE-ConnectionGUID: oL4grt7zSdSVg8StmSLvnw== X-CSE-MsgGUID: 03TCp0TQQEqhjJ3BmdKAZA== X-IronPort-AV: E=McAfee;i="6700,10204,11123"; a="28636690" X-IronPort-AV: E=Sophos;i="6.09,184,1716274800"; d="scan'208";a="28636690" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2024 06:52:40 -0700 X-CSE-ConnectionGUID: 2N1bOfIOTrmCg755lszP/g== X-CSE-MsgGUID: KlBpCjvvQhmntxlvFrsgSw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,184,1716274800"; d="scan'208";a="46884316" Received: from unknown (HELO npf-hyd-clx-03..) ([10.145.170.182]) by fmviesa009.fm.intel.com with ESMTP; 05 Jul 2024 06:52:38 -0700 From: Soumyadeep Hore To: bruce.richardson@intel.com, aman.deep.singh@intel.com Cc: dev@dpdk.org, stable@dpdk.org Subject: [PATCH v4 1/2] net/cpfl: fix check for opcodes of received ctlq messages Date: Fri, 5 Jul 2024 13:05:14 +0000 Message-ID: <20240705130515.3090598-2-soumyadeep.hore@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240705130515.3090598-1-soumyadeep.hore@intel.com> References: <20240705083032.2756071-3-soumyadeep.hore@intel.com> <20240705130515.3090598-1-soumyadeep.hore@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Include checks for error status returned for specific opcodes and display error messages accordingly. Fixes: db042ef09d26 ("net/cpfl: implement FXP rule creation and destroying") Cc: stable@dpdk.org Signed-off-by: Soumyadeep Hore --- drivers/net/cpfl/cpfl_fxp_rule.c | 8 ++++++++ drivers/net/cpfl/cpfl_rules.h | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/drivers/net/cpfl/cpfl_fxp_rule.c b/drivers/net/cpfl/cpfl_fxp_rule.c index 0e710a007b..f48ecd5656 100644 --- a/drivers/net/cpfl/cpfl_fxp_rule.c +++ b/drivers/net/cpfl/cpfl_fxp_rule.c @@ -92,6 +92,14 @@ cpfl_receive_ctlq_msg(struct idpf_hw *hw, struct idpf_ctlq_info *cq, u16 num_q_m /* TODO - process rx controlq message */ for (i = 0; i < num_q_msg; i++) { + ret = q_msg[i].status; + if (ret && + q_msg[i].opcode != cpfl_ctlq_sem_query_del_rule_hash_addr) { + PMD_INIT_LOG(ERR, "Failed to process rx_ctrlq msg: %s", + cpfl_cfg_pkt_errormsg[ret]); + return ret; + } + if (q_msg[i].data_len > 0) dma = q_msg[i].ctx.indirect.payload; else diff --git a/drivers/net/cpfl/cpfl_rules.h b/drivers/net/cpfl/cpfl_rules.h index d23eae8e91..10569b1fdc 100644 --- a/drivers/net/cpfl/cpfl_rules.h +++ b/drivers/net/cpfl/cpfl_rules.h @@ -62,6 +62,17 @@ enum cpfl_cfg_pkt_error_code { CPFL_CFG_PKT_ERR_EMAXCOL = 9 /* Max Hash Collision */ }; +static const char * const cpfl_cfg_pkt_errormsg[] = { + [CPFL_CFG_PKT_ERR_ESRCH] = "Bad opcode", + [CPFL_CFG_PKT_ERR_EEXIST] = "The rule conflicts with already existed one", + [CPFL_CFG_PKT_ERR_ENOSPC] = "No space left in the table", + [CPFL_CFG_PKT_ERR_ERANGE] = "Parameter out of range", + [CPFL_CFG_PKT_ERR_ESBCOMP] = "Completion error", + [CPFL_CFG_PKT_ERR_ENOPIN] = "Entry cannot be pinned in cache", + [CPFL_CFG_PKT_ERR_ENOTFND] = "Entry does not exist", + [CPFL_CFG_PKT_ERR_EMAXCOL] = "Maximum Hash Collisions reached", +}; + /* macros for creating context for rule descriptor */ #define MEV_RULE_VSI_ID_S 0 #define MEV_RULE_VSI_ID_M \ -- 2.43.0