From patchwork Fri Apr 26 12:22:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nitin Saxena X-Patchwork-Id: 892 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 14D1343F15; Fri, 26 Apr 2024 14:23:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3FD143DBC; Fri, 26 Apr 2024 14:23:43 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id B107943DB6 for ; Fri, 26 Apr 2024 14:23:41 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 43Q6DF6i016504; Fri, 26 Apr 2024 05:23:37 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=pfpt0220; bh=B2nAnS+G CwvIWtB6i/UGh92h0voY+dD1XWuNPoBuoFk=; b=I5P2nuVgpruIPXAM2gnEMSPP RO3pHND9WqSFLlAC/5CRksrDl4Y86xPTIykobBeEfxj/fES5r8Nmd3NVBZKyNaB/ OtY7MSui1jd8BYl6K3OP1jMrkZgXTzlLGyD2cNQmbHJe5+i/ufeOVQEIgmuZfsdg G0UfqGDBwOLaY6KQj8jWgdcveLe7Vq6dh5VhacjqYG3zXy8bkr+SNmuzkqIB3Tf9 OQasjKDH1ICVNbn/ESPX9JrPmloO5tbprquYysLQhsYt/o06wMjJjdrLEg4Cz6te 8qJxCdgwDKUXFaE8ck3I1XNQWS7yOy4ESH72RnE8yRORjONp+hZzu3MFJg0F3w== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3xpxn1npaw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Apr 2024 05:23:32 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 26 Apr 2024 05:22:06 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 26 Apr 2024 05:22:06 -0700 Received: from localhost.localdomain (unknown [10.28.36.207]) by maili.marvell.com (Postfix) with ESMTP id D4C803F7069; Fri, 26 Apr 2024 05:22:04 -0700 (PDT) From: Nitin Saxena To: Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , Zhirun Yan CC: Subject: [RFC PATCH 0/2] add feature arc in rte_graph Date: Fri, 26 Apr 2024 17:52:01 +0530 Message-ID: <20240426122203.32357-1-nsaxena@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: T_U5jgvILwGZxoruyEJikoy_uU3uytxo X-Proofpoint-ORIG-GUID: T_U5jgvILwGZxoruyEJikoy_uU3uytxo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-26_12,2024-04-26_02,2023-05-22_02 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 Feature arc represents an ordered list of features/protocols at a given networking layer. It is a high level abstraction to connect various rte_graph nodes, as feature nodes, and allow packets steering across these nodes in a generic manner. Features (or feature nodes) are nodes which handles partial or complete handling of a protocol in fast path. Like ipv4-rewrite node, which adds rewrite data to an outgoing IPv4 packet. However in above example, outgoing interface(say "eth0") may have outbound IPsec policy enabled, hence packets must be steered from ipv4-rewrite node to ipsec-outbound-policy node for outbound IPsec policy lookup. On the other hand, packets routed to another interface (eth1) will not be sent to ipsec-outbound-policy node as IPsec feature is disabled on eth1. Feature-arc allows rte_graph applications to manage such constraints easily Feature arc abstraction allows rte_graph based application to 1. Seamlessly steer packets across feature nodes based on wheter feature is enabled or disabled on an interface. Features enabled on one interface may not be enabled on another interface with in a same feature arc. 2. Allow enabling/disabling of features on an interface at runtime, so that if a feature is disabled, packets associated with that interface won't be steered to corresponding feature node. 3. Provides mechanism to hook custom/user-defined nodes to a feature node and allow packet steering from feature node to custom node without changing former's fast path function 4. Allow expressing features in a particular sequential order so that packets are steered in an ordered way across nodes in fast path. For eg: if IPsec and IPv4 features are enabled on an ingress interface, packets must be sent to IPsec inbound policy node first and then to ipv4 lookup node. This patch series adds feature arc library in rte_graph and also adds "ipv4-output" feature arc handling in "ipv4-rewrite" node. Nitin Saxena (2): graph: add feature arc support graph: add ip4 output feature arc lib/graph/graph_feature_arc.c | 834 +++++++++++++++++++++++ lib/graph/meson.build | 2 + lib/graph/rte_graph_feature_arc.h | 310 +++++++++ lib/graph/rte_graph_feature_arc_worker.h | 483 +++++++++++++ lib/graph/version.map | 16 + lib/node/ip4_rewrite.c | 278 ++++++-- lib/node/ip4_rewrite_priv.h | 10 +- lib/node/node_private.h | 10 +- lib/node/rte_node_ip4_api.h | 3 + 9 files changed, 1878 insertions(+), 68 deletions(-) create mode 100644 lib/graph/graph_feature_arc.c create mode 100644 lib/graph/rte_graph_feature_arc.h create mode 100644 lib/graph/rte_graph_feature_arc_worker.h