From patchwork Wed Sep 27 12:54:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Yuying" X-Patchwork-Id: 132026 X-Patchwork-Delegate: qi.z.zhang@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 7F18142651; Wed, 27 Sep 2023 14:55:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5BA8140F35; Wed, 27 Sep 2023 14:55:09 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 99BC040FDE for ; Wed, 27 Sep 2023 14:55:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695819303; x=1727355303; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=lDzbXBfbC6t427VX10E8BLcdFmwP+d6CgFm31sKL7x4=; b=NMRcS8F291MuAyhBp2nyozw2/QRm9p449U5urXLbkk0kDnhEwOAqoEJN NKd9Razdus0vVKW/DKyHPNrcpDGCx6rn7uNwRiCWPcKCWItRn9m7sdoOs wrxys5+oQwqsvJJp8MOcnWghRaOuOAQV/4C47+5FkYfSXAjPKBVZOgkGg ecPtdHzxuWvr1Eb9h4TlTh5a3AlWvkZj5Fp++M9Lgr9cMcjgIdqJt3snk OV7+kHIbsj0NspsutqRPDW1Dfwdr0CbrSXxUt+UgkIgsmwwzYMdAfglmA RGh1KL76qlZdodj8J6xGSzTqUReYDqodCiDYVVCKM11jb8VM7Te9SLTWS Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="361204114" X-IronPort-AV: E=Sophos;i="6.03,181,1694761200"; d="scan'208";a="361204114" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2023 05:55:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="872873979" X-IronPort-AV: E=Sophos;i="6.03,181,1694761200"; d="scan'208";a="872873979" Received: from dpdk-wenjing-02.sh.intel.com ([10.67.119.3]) by orsmga004.jf.intel.com with ESMTP; 27 Sep 2023 05:55:01 -0700 From: yuying.zhang@intel.com To: yuying.zhang@intel.com, dev@dpdk.org, qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Subject: [PATCH v8 9/9] net/cpfl: add support of to represented port action Date: Wed, 27 Sep 2023 12:54:16 +0000 Message-Id: <20230927125416.2308974-10-yuying.zhang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230927125416.2308974-1-yuying.zhang@intel.com> References: <20230926181703.2268199-1-yuying.zhang@intel.com> <20230927125416.2308974-1-yuying.zhang@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 From: Yuying Zhang Add support of to represented port action for forwarding packet to APF/CPF/VF representors. Signed-off-by: Yuying Zhang --- drivers/net/cpfl/cpfl_flow_engine_fxp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/cpfl/cpfl_flow_engine_fxp.c b/drivers/net/cpfl/cpfl_flow_engine_fxp.c index c460e6b5c6..fed18d8349 100644 --- a/drivers/net/cpfl/cpfl_flow_engine_fxp.c +++ b/drivers/net/cpfl/cpfl_flow_engine_fxp.c @@ -267,6 +267,7 @@ cpfl_fxp_parse_action(struct cpfl_itf *itf, int queue_id = -1; bool fwd_vsi = false; bool fwd_q = false; + bool is_vsi; uint32_t i; struct cpfl_rule_info *rinfo = &rim->rules[index]; union cpfl_action_set *act_set = (void *)rinfo->act_bytes; @@ -277,6 +278,7 @@ cpfl_fxp_parse_action(struct cpfl_itf *itf, action_type = action->type; switch (action_type) { case RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR: + case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT: if (!fwd_vsi) fwd_vsi = true; else @@ -295,12 +297,20 @@ cpfl_fxp_parse_action(struct cpfl_itf *itf, queue_id = CPFL_INVALID_QUEUE_ID; } - dev_id = cpfl_get_vsi_id(dst_itf); + is_vsi = (action_type == RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR || + dst_itf->type == CPFL_ITF_TYPE_REPRESENTOR); + if (is_vsi) + dev_id = cpfl_get_vsi_id(dst_itf); + else + dev_id = cpfl_get_port_id(dst_itf); if (dev_id == CPFL_INVALID_HW_ID) goto err; - *act_set = cpfl_act_fwd_vsi(0, priority, 0, dev_id); + if (is_vsi) + *act_set = cpfl_act_fwd_vsi(0, priority, 0, dev_id); + else + *act_set = cpfl_act_fwd_port(0, priority, 0, dev_id); act_set++; rinfo->act_byte_len += sizeof(union cpfl_action_set); break;