From patchwork Fri Jul 5 05:08:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hore, Soumyadeep" X-Patchwork-Id: 142126 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5805345591; Fri, 5 Jul 2024 07:55:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE5B642F57; Fri, 5 Jul 2024 07:55:54 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 660DE4021D; Fri, 5 Jul 2024 07:55:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720158954; x=1751694954; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PpHYkSj3bLTBZz0b9BmG85n5SfJXQ3neMWV2rJqtPH0=; b=OtO94cJmU5N96P8JzUvE7I3aIn6ivz3cOAB5X0PSDJP3j5xXuBD1Gm5Y Zr7BClFmhqiC0T46JIgcJ+JNCpm5tO+fIGQ3IPq8x8C4Vasyl1b4akiUr oQqCVSt3FMABIyuCsglcDirDn/YqVTsJVQ1f1wlLWXzbQkgXEoFyBCI1o Rk/m05CG935y4P3eScejWBvk+Wjg7CHdvKuyYuL/fX/zNl4qQtc2xI8OC 1AY8/dUc8a3y/YIfATOxES+VjRPU8fdjeYGxFx792VHea8EW4SkFvO0V5 w5IhyYmpAvCw7D1QhBbEXF0ak2eeb+B8kn7S8fhQP19K5YQA9+EaK00M9 A==; X-CSE-ConnectionGUID: c7tZo0DyTSmyZ16/cZgfVw== X-CSE-MsgGUID: fz/v35FURDWjQ2hzACD4yw== X-IronPort-AV: E=McAfee;i="6700,10204,11123"; a="17163138" X-IronPort-AV: E=Sophos;i="6.09,184,1716274800"; d="scan'208";a="17163138" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2024 22:55:53 -0700 X-CSE-ConnectionGUID: 81FUYiLeSx6B35aNr49Uew== X-CSE-MsgGUID: g6DMGHwDQbO+VyC4GIvo3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,184,1716274800"; d="scan'208";a="46746016" Received: from unknown (HELO npf-hyd-clx-03..) ([10.145.170.182]) by fmviesa008.fm.intel.com with ESMTP; 04 Jul 2024 22:55:51 -0700 From: Soumyadeep Hore To: bruce.richardson@intel.com, aman.deep.singh@intel.com Cc: dev@dpdk.org, stable@dpdk.org Subject: [PATCH v2 1/2] net/cpfl: fix check for opcodes of received ctlq messages Date: Fri, 5 Jul 2024 05:08:30 +0000 Message-ID: <20240705050831.2639342-2-soumyadeep.hore@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240705050831.2639342-1-soumyadeep.hore@intel.com> References: <20240704051835.2630052-1-soumyadeep.hore@intel.com> <20240705050831.2639342-1-soumyadeep.hore@intel.com> MIME-Version: 1.0 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 cpfl_process_rx_ctlq_msg() is used to check error status returned for specific opcodes and return 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 | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/drivers/net/cpfl/cpfl_fxp_rule.c b/drivers/net/cpfl/cpfl_fxp_rule.c index 0e710a007b..4232b192ed 100644 --- a/drivers/net/cpfl/cpfl_fxp_rule.c +++ b/drivers/net/cpfl/cpfl_fxp_rule.c @@ -60,6 +60,52 @@ cpfl_send_ctlq_msg(struct idpf_hw *hw, struct idpf_ctlq_info *cq, u16 num_q_msg, return ret; } +static int +cpfl_process_rx_ctlq_msg(u16 msg_opcode, u16 msg_status) +{ + int ret = CPFL_CFG_PKT_ERR_OK; + + if (msg_status && + msg_opcode == cpfl_ctlq_sem_query_rule_hash_addr) + return ret; + + switch (msg_status) { + case CPFL_CFG_PKT_ERR_EEXIST: + PMD_INIT_LOG(ERR, "The rule has confliction with already existed one"); + ret = CPFL_CFG_PKT_ERR_EEXIST; + break; + case CPFL_CFG_PKT_ERR_ENOSPC: + PMD_INIT_LOG(ERR, "No space left in the table"); + ret = CPFL_CFG_PKT_ERR_ENOSPC; + break; + case CPFL_CFG_PKT_ERR_ESRCH: + PMD_INIT_LOG(ERR, "Bad opcode"); + ret = CPFL_CFG_PKT_ERR_ESRCH; + break; + case CPFL_CFG_PKT_ERR_ERANGE: + PMD_INIT_LOG(ERR, "Parameter are out of"); + ret = CPFL_CFG_PKT_ERR_ERANGE; + break; + case CPFL_CFG_PKT_ERR_ESBCOMP: + PMD_INIT_LOG(ERR, "Completion error"); + ret = CPFL_CFG_PKT_ERR_ESBCOMP; + break; + case CPFL_CFG_PKT_ERR_ENOPIN: + PMD_INIT_LOG(ERR, "Entry cannot be pinned in the cache"); + ret = CPFL_CFG_PKT_ERR_ENOPIN; + break; + case CPFL_CFG_PKT_ERR_ENOTFND: + PMD_INIT_LOG(ERR, "Entry does not exists"); + ret = CPFL_CFG_PKT_ERR_ENOTFND; + break; + case CPFL_CFG_PKT_ERR_EMAXCOL: + PMD_INIT_LOG(ERR, "Maximum number of hash collisions reached"); + ret = CPFL_CFG_PKT_ERR_EMAXCOL; + break; + } + return ret; +} + int cpfl_receive_ctlq_msg(struct idpf_hw *hw, struct idpf_ctlq_info *cq, u16 num_q_msg, struct idpf_ctlq_msg q_msg[]) @@ -92,6 +138,12 @@ 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 = cpfl_process_rx_ctlq_msg(q_msg[i].opcode, q_msg[i].status); + if (ret) { + PMD_INIT_LOG(ERR, "failed to process rx_ctrlq msg"); + return ret; + } + if (q_msg[i].data_len > 0) dma = q_msg[i].ctx.indirect.payload; else From patchwork Fri Jul 5 05:08:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hore, Soumyadeep" X-Patchwork-Id: 142127 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F38F845591; Fri, 5 Jul 2024 07:56:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D879542F73; Fri, 5 Jul 2024 07:55:58 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 1DC8942F67; Fri, 5 Jul 2024 07:55:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720158956; x=1751694956; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wtJGR+GlOtDn1w3Eh7iXNQxzcpKGGZ5rqiJKwhWECF0=; b=hSUgw7/5dFPbkMdjhBSdS97jtzN6+XqiSB8frX3tHSd05ElGObZyMnAP p5KctCauHckJYPa7MtmJXvW+4RtuydmCua/jSj+DJko+xbBLKxfL+pBAA CwP5U+rOLO4vani8opzhjhwbBsv9ndn/Qdo0qHV+sBkDsAPcRUQioJu3t b642NgH5islp6IMkWiotNSezz39Xh3JNE/GD4HJpz1KOy/5qS63+0aIz5 4Hrbhb8PY4yni5nDZjWF0ZtPVf8++9j4z2qfh5zzCSxlbij1MMuYaSEnU uc/ZnAxtO9k27zmq70cDIyrTpVlBJy05GR1AXsKr+BTHEhhNmtFs/GqfB w==; X-CSE-ConnectionGUID: ud2oI6QcTrqRFDfSfStWlQ== X-CSE-MsgGUID: 5qTp6ZBqQTu5rEr3be/EnQ== X-IronPort-AV: E=McAfee;i="6700,10204,11123"; a="17163140" X-IronPort-AV: E=Sophos;i="6.09,184,1716274800"; d="scan'208";a="17163140" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2024 22:55:55 -0700 X-CSE-ConnectionGUID: np7bEybKR2ygf2QF3slNdA== X-CSE-MsgGUID: TFF9k3hATka1IYKsx5ckog== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,184,1716274800"; d="scan'208";a="46746023" Received: from unknown (HELO npf-hyd-clx-03..) ([10.145.170.182]) by fmviesa008.fm.intel.com with ESMTP; 04 Jul 2024 22:55:53 -0700 From: Soumyadeep Hore To: bruce.richardson@intel.com, aman.deep.singh@intel.com Cc: dev@dpdk.org, stable@dpdk.org Subject: [PATCH v2 2/2] net/cpfl: fix +ve error codes for received ctlq messages Date: Fri, 5 Jul 2024 05:08:31 +0000 Message-ID: <20240705050831.2639342-3-soumyadeep.hore@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240705050831.2639342-1-soumyadeep.hore@intel.com> References: <20240704051835.2630052-1-soumyadeep.hore@intel.com> <20240705050831.2639342-1-soumyadeep.hore@intel.com> MIME-Version: 1.0 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 Previously error codes were only -ve for cpfl_receive_ctlq_msg() but now there are +ve error codes. Hence code changes are made accordingly. Fixes: db042ef09d26 ("net/cpfl: implement FXP rule creation and destroying") Cc: stable@dpdk.org Signed-off-by: Soumyadeep Hore --- drivers/net/cpfl/cpfl_flow_engine_fxp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/cpfl/cpfl_flow_engine_fxp.c b/drivers/net/cpfl/cpfl_flow_engine_fxp.c index 39a281fa61..983b4188e4 100644 --- a/drivers/net/cpfl/cpfl_flow_engine_fxp.c +++ b/drivers/net/cpfl/cpfl_flow_engine_fxp.c @@ -95,7 +95,7 @@ cpfl_fxp_create(struct rte_eth_dev *dev, ret = cpfl_rule_process(itf, ad->ctlqp[cpq_id], ad->ctlqp[cpq_id + 1], rim->rules, rim->rule_num, true); - if (ret < 0) { + if (ret) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_HANDLE, NULL, "cpfl filter create flow fail"); rte_free(rim);