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 89677A0C41; Sun, 10 Oct 2021 02:06:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 903DC41140; Sun, 10 Oct 2021 02:05:35 +0200 (CEST) Received: from shelob.oktetlabs.ru (unknown [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id BA8A2410E1 for ; Sun, 10 Oct 2021 02:05:23 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.122.166]) (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 3FFC57F6DD; Sun, 10 Oct 2021 03:05:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 3FFC57F6DD DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1633824314; bh=ntsKNuJ0W1I42ZxkNcKCrKMzA+dlyZEsFdIA3McueII=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nivWSU0sGFCZsDfgdqZ9fSW6+mERDlcArTW3bQLzTq5Sua1rVHAfTISnm23PTV/zF vLMuA7nKvVWPzdllaq4uib5fJNMQj6x1/Lx3ANk9FQgtLFOL6vcvAmMIwIzWqQpxpp YZVk+n0qRw2nGFY8oLlQjgIBP0N8sBu6MYMAPRtc= From: Ivan Malov To: dev@dpdk.org Cc: Thomas Monjalon , Ori Kam , Andrew Rybchenko , Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K Date: Sun, 10 Oct 2021 03:05:02 +0300 Message-Id: <20211010000503.28712-12-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211010000503.28712-1-ivan.malov@oktetlabs.ru> References: <20211001134716.1608857-1-andrew.rybchenko@oktetlabs.ru> <20211010000503.28712-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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/octeontx2.rst | 5 ++++- drivers/net/octeontx2/otx2_flow_parse.c | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) 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 63a33142a5..890c6d0719 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_count *act_count; const struct rte_flow_action_mark *act_mark; const struct rte_flow_action_queue *act_q; @@ -987,9 +986,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