[v5,17/80] net/ntnic: add item port ID

Message ID 20241030213940.3470062-18-sil-plv@napatech.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series Provide flow filter and statistics support |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Serhii Iliushyk Oct. 30, 2024, 9:38 p.m. UTC
Add possibility to use RTE_FLOW_ITEM_TYPE_PORT_ID.

Signed-off-by: Serhii Iliushyk <sil-plv@napatech.com>
---
 doc/guides/nics/features/ntnic.ini                    |  1 +
 .../flow_api/profile_inline/flow_api_profile_inline.c | 11 +++++++++++
 2 files changed, 12 insertions(+)
  

Patch

diff --git a/doc/guides/nics/features/ntnic.ini b/doc/guides/nics/features/ntnic.ini
index d403ea01f3..cdf119c4ae 100644
--- a/doc/guides/nics/features/ntnic.ini
+++ b/doc/guides/nics/features/ntnic.ini
@@ -18,6 +18,7 @@  any                  = Y
 eth                  = Y
 icmp                 = Y
 ipv4                 = Y
+port_id              = Y
 
 [rte_flow actions]
 drop                 = Y
diff --git a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
index 88665dbf15..4fc5afcdaa 100644
--- a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
+++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c
@@ -928,6 +928,17 @@  static int interpret_flow_elements(const struct flow_eth_dev *dev,
 
 			break;
 
+		case RTE_FLOW_ITEM_TYPE_PORT_ID:
+			NT_LOG(DBG, FILTER, "Adap %i, Port %i: RTE_FLOW_ITEM_TYPE_PORT_ID",
+				dev->ndev->adapter_no, dev->port);
+
+			if (elem[eidx].spec) {
+				*in_port_id =
+					((const struct rte_flow_item_port_id *)elem[eidx].spec)->id;
+			}
+
+			break;
+
 		default:
 			NT_LOG(ERR, FILTER, "Invalid or unsupported flow request: %d",
 				(int)elem[eidx].type);