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 70EB5456F7; Tue, 30 Jul 2024 14:53:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6413A40648; Tue, 30 Jul 2024 14:53:13 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by mails.dpdk.org (Postfix) with ESMTP id 5C273400D7; Tue, 30 Jul 2024 13:45:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722339946; x=1753875946; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+/WfOQiYRReK56TFsB+TDk7fjIOiDX0S+c5GNoI7Otw=; b=IWwp7vot0KZ2aZlm7Z9d6P8ryDppRIQz+/egCFwWOJlEDvaqGDCMgDcX Xozu4sPtJO+ALZD/vtMq5Kw2UZOTBzfrwAv+5YNjY5OSfdJUiQrEhwlcF XmWsG4H2QtYjbkB8eMGROJX5kx/lSgHPamtoT1xUaPfiarcHnV+CIUiXs Dw3iItktkDdyuryJ1r9SsP6ICQ8QpOOctX7MebYiI3WgEEsdum9vjaRrS b5I+p5kvR3xtnUGTxsJay/A4faquD3dTqO4FKf6jlpLIi+ImhlV145gnD SwKFPYwF+K+iBbcMBbESX/3Ea9rEl0ujXQe0hIm7gYt73zIYuctGGqy4F w==; X-CSE-ConnectionGUID: OufqVMNJQLi39/7lGOqJvw== X-CSE-MsgGUID: 3arvlN/CSg+qym6dit+Meg== X-IronPort-AV: E=McAfee;i="6700,10204,11148"; a="23937019" X-IronPort-AV: E=Sophos;i="6.09,248,1716274800"; d="scan'208";a="23937019" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2024 04:45:44 -0700 X-CSE-ConnectionGUID: k886GHrfTFeOT9rN6XQSsA== X-CSE-MsgGUID: yMiGdSNGSmeJL3H8tH6vmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,248,1716274800"; d="scan'208";a="91814767" Received: from silpixa00401164.ir.intel.com ([10.55.128.62]) by orviesa001.jf.intel.com with ESMTP; 30 Jul 2024 04:45:43 -0700 From: Praveen Shetty To: dev@dpdk.org, bruce.richardson@intel.com Cc: stable@dpdk.org Subject: [PATCH v1] net/cpfl: fix invalid action types Date: Tue, 30 Jul 2024 11:45:40 +0000 Message-Id: <20240730114540.1048785-1-praveen.shetty@intel.com> X-Mailer: git-send-email 2.34.1 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 In case of CPFL PMD, port_representor action is used for the local vport and represented_port action is used for the remote port(remote port in this case is either the idpf pf or the vf port that is being represeted by the cpfl pmd). Any mismatch in either of the cases PMD will throw an error. Fixes: 441e777b85f1 ("net/cpfl: support represented port action") Cc: stable@dpdk.org Signed-off-by: Praveen Shetty --- drivers/net/cpfl/cpfl_flow_engine_fxp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/cpfl/cpfl_flow_engine_fxp.c b/drivers/net/cpfl/cpfl_flow_engine_fxp.c index b9e825ef57..e760acd722 100644 --- a/drivers/net/cpfl/cpfl_flow_engine_fxp.c +++ b/drivers/net/cpfl/cpfl_flow_engine_fxp.c @@ -292,6 +292,17 @@ cpfl_fxp_parse_action(struct cpfl_itf *itf, is_vsi = (action_type == RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR || dst_itf->type == CPFL_ITF_TYPE_REPRESENTOR); + /* Added checks to throw an error for the invalid action types. */ + if (action_type == RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR && + dst_itf->type == CPFL_ITF_TYPE_REPRESENTOR) { + PMD_DRV_LOG(ERR, "Cannot use port_representor action for the represented_port"); + goto err; + } + if (action_type == RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT && + dst_itf->type == CPFL_ITF_TYPE_VPORT) { + PMD_DRV_LOG(ERR, "Cannot use represented_port action for the local vport"); + goto err; + } if (is_vsi) dev_id = cpfl_get_vsi_id(dst_itf); else -- 2.34.1