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 6949BA0C55; Wed, 13 Oct 2021 18:44:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCFD3411C4; Wed, 13 Oct 2021 18:43:15 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id D422941134 for ; Wed, 13 Oct 2021 18:42:59 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.123.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 9C02C7F700; Wed, 13 Oct 2021 19:42:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 9C02C7F700 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1634143379; bh=ktFyv7d8HizZejHvQiiIF0gfDNzLibKo2KfVM3WC4Go=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DRjjvESG/c1ivuW9R4O7nm5GVSz2szcyYZUsyyDo+0IykZBEuatWAkoapM0dc1gPf RgmgqqvnSNCh1Rf7wkgxithUQH2WzrTGA6LA/G5L9pg4+IWDeKTVatVZbNMNPyqLSm X6cTnyKMebMPoz5Yu7np/4VlJpeOlD6gq0FR/6B8= From: Ivan Malov To: dev@dpdk.org Cc: Ferruh Yigit , Thomas Monjalon , Ori Kam , Andrew Rybchenko , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K Date: Wed, 13 Oct 2021 19:42:42 +0300 Message-Id: <20211013164243.21264-12-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211013164243.21264-1-ivan.malov@oktetlabs.ru> References: <20211001134716.1608857-1-andrew.rybchenko@oktetlabs.ru> <20211013164243.21264-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 11/12] net/octeontx2: support port representor flow action 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 Sender: "dev" From: Andrew Rybchenko Action PORT_ID implementation assumes ingress only. Its semantics suggests that support for equal action PORT_REPRESENTOR be added. Signed-off-by: Andrew Rybchenko --- doc/guides/nics/features/octeontx2.ini | 1 + doc/guides/nics/octeontx2.rst | 5 ++++- drivers/net/octeontx2/otx2_flow_parse.c | 16 ++++++++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/doc/guides/nics/features/octeontx2.ini b/doc/guides/nics/features/octeontx2.ini index fa32bc7890..9aa67cfb89 100644 --- a/doc/guides/nics/features/octeontx2.ini +++ b/doc/guides/nics/features/octeontx2.ini @@ -95,3 +95,4 @@ queue = Y rss = Y security = Y vf = Y +port_representor = Y diff --git a/doc/guides/nics/octeontx2.rst b/doc/guides/nics/octeontx2.rst index e35c8116f7..eae32f0afe 100644 --- a/doc/guides/nics/octeontx2.rst +++ b/doc/guides/nics/octeontx2.rst @@ -403,10 +403,13 @@ Actions: +----+-----------------------------------------+ | 12 | RTE_FLOW_ACTION_TYPE_PORT_ID | +----+-----------------------------------------+ + | 13 | RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR | + +----+-----------------------------------------+ .. note:: - ``RTE_FLOW_ACTION_TYPE_PORT_ID`` is only supported between PF and its VFs. + ``RTE_FLOW_ACTION_TYPE_PORT_ID``, ``RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR`` + are only supported between PF and its VFs. .. _table_octeontx2_supported_egress_action_types: diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c index 30a232f033..79b92fda8a 100644 --- a/drivers/net/octeontx2/otx2_flow_parse.c +++ b/drivers/net/octeontx2/otx2_flow_parse.c @@ -900,7 +900,6 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev, { struct otx2_eth_dev *hw = dev->data->dev_private; struct otx2_npc_flow_info *npc = &hw->npc_flow; - const struct rte_flow_action_port_id *port_act; const struct rte_flow_action_mark *act_mark; const struct rte_flow_action_queue *act_q; const struct rte_flow_action_vf *vf_act; @@ -977,9 +976,18 @@ otx2_flow_parse_actions(struct rte_eth_dev *dev, break; case RTE_FLOW_ACTION_TYPE_PORT_ID: - port_act = (const struct rte_flow_action_port_id *) - actions->conf; - port_id = port_act->id; + case RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR: + if (actions->type == RTE_FLOW_ACTION_TYPE_PORT_ID) { + const struct rte_flow_action_port_id *port_act; + + port_act = actions->conf; + port_id = port_act->id; + } else { + const struct rte_flow_action_ethdev *ethdev_act; + + ethdev_act = actions->conf; + port_id = ethdev_act->port_id; + } if (rte_eth_dev_get_name_by_port(port_id, if_name)) { errmsg = "Name not found for output port id"; errcode = EINVAL; -- 2.20.1