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 D0C7B4265E; Thu, 28 Sep 2023 10:46:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE4F040E5E; Thu, 28 Sep 2023 10:45:42 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id AE11140E13 for ; Thu, 28 Sep 2023 10:45:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695890732; x=1727426732; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=lDzbXBfbC6t427VX10E8BLcdFmwP+d6CgFm31sKL7x4=; b=OpynFzXDMQwQcgNGyxizxd5lmL0YwcVksCcyXdxhMuTejk153M/OHWHW I4qPwJlEGQ6Ab9BwgTaYL3KS9qkl5HxttugKd70I8JCfdiKiSd9SayUf/ 0TLVoLuC+IYOwhYI8Jk4CITZWhKM0U7RfWaiU7+3TvLVQQu+mwrV4azxq PIqMyLDcQkwjcJiIP4fUF0VeTL9rrMaCLPo5NDrKydeYtWbSVAP3coiDm LaiJTQH6cjY6jBVhSY+9l8kfdQfGWLnwKEcHkhhkkadO4JP2mC/WA5FpH hVqaW2I7sULpyLzcvaH/0xIzDe6D2K7wjt0ayicvlGyXRclDEDB3ByrRy g==; X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="468299528" X-IronPort-AV: E=Sophos;i="6.03,183,1694761200"; d="scan'208";a="468299528" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 01:45:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="784622230" X-IronPort-AV: E=Sophos;i="6.03,183,1694761200"; d="scan'208";a="784622230" Received: from dpdk-wenjing-02.sh.intel.com ([10.67.119.3]) by orsmga001.jf.intel.com with ESMTP; 28 Sep 2023 01:45:30 -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 v9 9/9] net/cpfl: add support of to represented port action Date: Thu, 28 Sep 2023 08:44:58 +0000 Message-Id: <20230928084458.2333663-10-yuying.zhang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928084458.2333663-1-yuying.zhang@intel.com> References: <20230927125416.2308974-1-yuying.zhang@intel.com> <20230928084458.2333663-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 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; -- 2.34.1