From patchwork Fri Aug 12 19:18:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 114937 X-Patchwork-Delegate: thomas@monjalon.net 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 5C0A9A0543; Fri, 12 Aug 2022 21:19:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67ADF42C29; Fri, 12 Aug 2022 21:18:35 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id B9D9240A83 for ; Fri, 12 Aug 2022 21:18:30 +0200 (CEST) Received: from bree.oktetlabs.ru (bree.oktetlabs.ru [192.168.34.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPS id 5AFA7B9; Fri, 12 Aug 2022 22:18:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 5AFA7B9 Authentication-Results: shelob.oktetlabs.ru/5AFA7B9; dkim=none; dkim-atps=neutral From: Ivan Malov To: dev@dpdk.org Cc: Ori Kam , Eli Britstein , Ilya Maximets , Thomas Monjalon , Stephen Hemminger , Jerin Jacob , Andrew Rybchenko , Hemant Agrawal , Sachin Saxena Subject: [PATCH 04/13] net/dpaa2: support represented port flow action Date: Fri, 12 Aug 2022 22:18:18 +0300 Message-Id: <20220812191827.3187441-5-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220812191827.3187441-1-ivan.malov@oktetlabs.ru> References: <20220812191827.3187441-1-ivan.malov@oktetlabs.ru> 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 There's been support for similar actions PHY_PORT and PORT_ID for some time already, but these actions are being deprecated. Support action REPRESENTED_PORT to prepare for the transition. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko --- doc/guides/nics/features/dpaa2.ini | 1 + doc/guides/rel_notes/release_22_11.rst | 4 ++++ drivers/net/dpaa2/dpaa2_flow.c | 12 +++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini index 4c06841a87..53148ad467 100644 --- a/doc/guides/nics/features/dpaa2.ini +++ b/doc/guides/nics/features/dpaa2.ini @@ -48,4 +48,5 @@ drop = Y phy_port = Y port_id = Y queue = Y +represented_port = Y rss = Y diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index b74e90d27f..6ab0cae78b 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -55,6 +55,10 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Updated dpaa2 PMD.** + + * Added support for flow action REPRESENTED_PORT. + Removed Items ------------- diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c index bf55eb70a3..25616b0035 100644 --- a/drivers/net/dpaa2/dpaa2_flow.c +++ b/drivers/net/dpaa2/dpaa2_flow.c @@ -85,6 +85,7 @@ enum rte_flow_action_type dpaa2_supported_action_type[] = { RTE_FLOW_ACTION_TYPE_QUEUE, RTE_FLOW_ACTION_TYPE_PHY_PORT, RTE_FLOW_ACTION_TYPE_PORT_ID, + RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, RTE_FLOW_ACTION_TYPE_RSS }; @@ -92,7 +93,8 @@ static const enum rte_flow_action_type dpaa2_supported_fs_action_type[] = { RTE_FLOW_ACTION_TYPE_QUEUE, RTE_FLOW_ACTION_TYPE_PHY_PORT, - RTE_FLOW_ACTION_TYPE_PORT_ID + RTE_FLOW_ACTION_TYPE_PORT_ID, + RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT, }; /* Max of enum rte_flow_item_type + 1, for both IPv4 and IPv6*/ @@ -3294,6 +3296,11 @@ dpaa2_flow_redirect_dev(struct dpaa2_dev_priv *priv, action->conf; if (!port_id->original) idx = port_id->id; + } else if (action->type == RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT) { + const struct rte_flow_action_ethdev *ethdev; + + ethdev = (const struct rte_flow_action_ethdev *)action->conf; + idx = ethdev->port_id; } else { return NULL; } @@ -3337,6 +3344,7 @@ dpaa2_flow_verify_action( return -1; } break; + case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT: case RTE_FLOW_ACTION_TYPE_PHY_PORT: case RTE_FLOW_ACTION_TYPE_PORT_ID: if (!dpaa2_flow_redirect_dev(priv, &actions[j])) { @@ -3514,6 +3522,7 @@ dpaa2_generic_flow_set(struct rte_flow *flow, while (!end_of_list) { switch (actions[j].type) { case RTE_FLOW_ACTION_TYPE_QUEUE: + case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT: case RTE_FLOW_ACTION_TYPE_PHY_PORT: case RTE_FLOW_ACTION_TYPE_PORT_ID: memset(&action, 0, sizeof(struct dpni_fs_action_cfg)); @@ -4088,6 +4097,7 @@ int dpaa2_flow_destroy(struct rte_eth_dev *dev, switch (flow->action) { case RTE_FLOW_ACTION_TYPE_QUEUE: + case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT: case RTE_FLOW_ACTION_TYPE_PHY_PORT: case RTE_FLOW_ACTION_TYPE_PORT_ID: if (priv->num_rx_tc > 1) {