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 70E7445AE1; Tue, 8 Oct 2024 15:30:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D65B402F1; Tue, 8 Oct 2024 15:30:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 53797402D4 for ; Tue, 8 Oct 2024 15:30:47 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4988Vtkj031236; Tue, 8 Oct 2024 06:30:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=d QQ8tX3POVjgvGxVVkQ6HbTekbyxX+uEXjx9cj7GvDE=; b=Cs6CyvytL8mqvIBli p+t7fY2naPVIm+D1Kpc45O9Q8ckg1/oQw4/ntCRxXK7n/kl2B0KA4G5TH9EayPme sA3XhOt0mZ+TaBidNncPCS4kOj14uCj0kxc/leNj+9J1SyLwY76R4evTTyGUguEf XlQ0JwB8n0uB2tQXGklwD5oVgGeVA15dYmM2jSLuw85j13fwDz3Yb37t5eGQsODV Ij7WKdlV0LswkT1U4sk9fQbhcPgMI7T582qRTbaq3Ys60mp6usU8p2qO9ihGTJ2G xzBO9URbxLhlfP7nawgtIpk0iJLPL3wW6dM1fztumE9UaDK4ddt+mDq5KwWATt7i q6G8Q== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 4251a70hcd-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Oct 2024 06:30:43 -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; Tue, 8 Oct 2024 06:30:29 -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; Tue, 8 Oct 2024 06:30:29 -0700 Received: from cavium-PowerEdge-R640.. (unknown [10.28.36.207]) by maili.marvell.com (Postfix) with ESMTP id 3CB2A3F7070; Tue, 8 Oct 2024 06:30:27 -0700 (PDT) From: Nitin Saxena To: Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , Zhirun Yan CC: , Nitin Saxena , Pavan Nikhilesh Subject: [RFC PATCH v2 2/5] graph: add feature arc option in graph create Date: Tue, 8 Oct 2024 19:00:09 +0530 Message-ID: <20241008133020.814101-3-nsaxena@marvell.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241008133020.814101-1-nsaxena@marvell.com> References: <20240907073115.1531070-1-nsaxena@marvell.com> <20241008133020.814101-1-nsaxena@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: bTgGe1bcPAyV2kzDOCfG5ESy29Uz1WD- X-Proofpoint-ORIG-GUID: bTgGe1bcPAyV2kzDOCfG5ESy29Uz1WD- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 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 Added option in graph create to call feature-specific process node functions. This removes extra overhead for checking feature arc status in nodes where application is not using feature arc processing Signed-off-by: Pavan Nikhilesh Signed-off-by: Nitin Saxena --- lib/graph/graph.c | 1 + lib/graph/graph_populate.c | 7 ++++++- lib/graph/graph_private.h | 3 +++ lib/graph/node.c | 2 ++ lib/graph/rte_graph.h | 3 +++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/graph/graph.c b/lib/graph/graph.c index d5b8c9f918..b0ad3a83ae 100644 --- a/lib/graph/graph.c +++ b/lib/graph/graph.c @@ -455,6 +455,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm) graph->parent_id = RTE_GRAPH_ID_INVALID; graph->lcore_id = RTE_MAX_LCORE; graph->num_pkt_to_capture = prm->num_pkt_to_capture; + graph->feature_arc_enabled = prm->feature_arc_enable; if (prm->pcap_filename) rte_strscpy(graph->pcap_filename, prm->pcap_filename, RTE_GRAPH_PCAP_FILE_SZ); diff --git a/lib/graph/graph_populate.c b/lib/graph/graph_populate.c index ed596a7711..5d8aa7b903 100644 --- a/lib/graph/graph_populate.c +++ b/lib/graph/graph_populate.c @@ -79,8 +79,13 @@ graph_nodes_populate(struct graph *_graph) if (graph_pcap_is_enable()) { node->process = graph_pcap_dispatch; node->original_process = graph_node->node->process; - } else + if (_graph->feature_arc_enabled && graph_node->node->feat_arc_proc) + node->original_process = graph_node->node->feat_arc_proc; + } else { node->process = graph_node->node->process; + if (_graph->feature_arc_enabled && graph_node->node->feat_arc_proc) + node->process = graph_node->node->feat_arc_proc; + } memcpy(node->name, graph_node->node->name, RTE_GRAPH_NAMESIZE); pid = graph_node->node->parent_id; if (pid != RTE_NODE_ID_INVALID) { /* Cloned node */ diff --git a/lib/graph/graph_private.h b/lib/graph/graph_private.h index d557d55f2d..58ba0abeff 100644 --- a/lib/graph/graph_private.h +++ b/lib/graph/graph_private.h @@ -56,6 +56,7 @@ struct node { unsigned int lcore_id; /**< Node runs on the Lcore ID used for mcore dispatch model. */ rte_node_process_t process; /**< Node process function. */ + rte_node_process_t feat_arc_proc; /**< Node feature-arch process function. */ rte_node_init_t init; /**< Node init function. */ rte_node_fini_t fini; /**< Node fini function. */ rte_node_t id; /**< Allocated identifier for the node. */ @@ -126,6 +127,8 @@ struct graph { /**< Number of packets to be captured per core. */ char pcap_filename[RTE_GRAPH_PCAP_FILE_SZ]; /**< pcap file name/path. */ + uint8_t feature_arc_enabled; + /**< Graph feature arc. */ STAILQ_HEAD(gnode_list, graph_node) node_list; /**< Nodes in a graph. */ }; diff --git a/lib/graph/node.c b/lib/graph/node.c index 99a9622779..d8fd273543 100644 --- a/lib/graph/node.c +++ b/lib/graph/node.c @@ -90,6 +90,7 @@ __rte_node_register(const struct rte_node_register *reg) goto free; node->flags = reg->flags; node->process = reg->process; + node->feat_arc_proc = reg->feat_arc_proc; node->init = reg->init; node->fini = reg->fini; node->nb_edges = reg->nb_edges; @@ -137,6 +138,7 @@ node_clone(struct node *node, const char *name) /* Clone the source node */ reg->flags = node->flags; reg->process = node->process; + reg->feat_arc_proc = node->feat_arc_proc; reg->init = node->init; reg->fini = node->fini; reg->nb_edges = node->nb_edges; diff --git a/lib/graph/rte_graph.h b/lib/graph/rte_graph.h index ecfec2068a..ebbdbbea48 100644 --- a/lib/graph/rte_graph.h +++ b/lib/graph/rte_graph.h @@ -163,6 +163,8 @@ struct rte_graph_param { uint64_t num_pkt_to_capture; /**< Number of packets to capture. */ char *pcap_filename; /**< Filename in which packets to be captured.*/ + bool feature_arc_enable; /**< Enable Graph feature arc. */ + union { struct { uint64_t rsvd; /**< Reserved for rtc model. */ @@ -470,6 +472,7 @@ struct rte_node_register { uint64_t flags; /**< Node configuration flag. */ #define RTE_NODE_SOURCE_F (1ULL << 0) /**< Node type is source. */ rte_node_process_t process; /**< Node process function. */ + rte_node_process_t feat_arc_proc; /**< Node feature-arch process function. */ rte_node_init_t init; /**< Node init function. */ rte_node_fini_t fini; /**< Node fini function. */ rte_node_t id; /**< Node Identifier. */ -- 2.43.0