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 77F2D42338; Mon, 9 Oct 2023 10:14:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A88A40E09; Mon, 9 Oct 2023 10:14:03 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mails.dpdk.org (Postfix) with ESMTP id D760F40E09 for ; Mon, 9 Oct 2023 10:14:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696839242; x=1728375242; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=kOTpgao6KPJd3SoSyyNEi8XWy4dPxfrvQjdc1KbJGiY=; b=TuVdPTehV+9OzIwOfDm+jWlwHpno/tTrJvNUgszuCFoQnvgaSRiVNw+3 ydNEe9oBegdHiOr3RrP3h2G9U+1PdgHDjKBjserdkRI+noUc6P1NTsODI XfvlBl8DoXFIUj1D4KYium1aIuYLCIKiUrEplHGIMLd7Rrr38oSdn9BL2 V8espM3noPcPd8PQSc18iCYoC6xInuCn78FkjlTNIGQuMxuZwVJqim6Dj mBhAo3TknUHH1EUdkzw/1JPn1F4upOqKtBXc8PAwSPiNwdKl7R9uwWnNF 4zL1bnu32oKkH7btz/auQ4vIzORiIh2TnmZP9heT3fLC1vaGEBPrfCkfU Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10857"; a="5641861" X-IronPort-AV: E=Sophos;i="6.03,209,1694761200"; d="scan'208";a="5641861" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2023 01:14:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10857"; a="702801771" X-IronPort-AV: E=Sophos;i="6.03,209,1694761200"; d="scan'208";a="702801771" Received: from dpdk-pengyuan-mev.sh.intel.com ([10.67.119.132]) by orsmga003.jf.intel.com with ESMTP; 09 Oct 2023 01:13:59 -0700 From: "Zhang, Yuying" To: yuying.zhang@intel.com, dev@dpdk.org, qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Subject: [PATCH v10 9/9] net/cpfl: support represented port action Date: Mon, 9 Oct 2023 04:00:18 +0000 Message-Id: <20231009040018.149689-10-yuying.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231009040018.149689-1-yuying.zhang@intel.com> References: <20230928084458.2333663-1-yuying.zhang@intel.com> <20231009040018.149689-1-yuying.zhang@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 From: Yuying Zhang Support RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT action for forwarding packet to APF/CPF/VF representors. Signed-off-by: Yuying Zhang Acked-by: Qi 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 7a3376f9f6..ddede2f553 100644 --- a/drivers/net/cpfl/cpfl_flow_engine_fxp.c +++ b/drivers/net/cpfl/cpfl_flow_engine_fxp.c @@ -266,6 +266,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; @@ -276,6 +277,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 @@ -294,12 +296,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; -- 2.34.1