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 4DF5C423B5; Thu, 12 Jan 2023 13:18:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9C0642D22; Thu, 12 Jan 2023 13:18:57 +0100 (CET) Received: from mail-ua1-f42.google.com (mail-ua1-f42.google.com [209.85.222.42]) by mails.dpdk.org (Postfix) with ESMTP id C005F40E25 for ; Thu, 12 Jan 2023 13:18:56 +0100 (CET) Received: by mail-ua1-f42.google.com with SMTP id z13so3391709uav.3 for ; Thu, 12 Jan 2023 04:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=EulreHubdH5p1pMWNXUfve3spICNl4NIiJ/zdmvASDM=; b=HKLKzcGztW8HjpJCWIYysBUGZ3p7QkKWUbfTfWbpyTxEZWljbF+UyhKHWhK1rgR7Z/ AiGZikYOlVLFaVDjDXrUDzpGHOCQw4UVArmV7sXzgvhl0Ldbm/jXto903LwVhRnu9Wyu OOZlflO/qgQKVbeMVGmifRLVCIzTzHNZ+WnJXGkCDWaawY4QOMagAZoDKA31+wBKu1SB WDfncd21oLpmeBCDkM607ub/EhZTbcn27FFZmQQ8LNER3LxcaFPtxcyh3L+WXa5HmAeV FevnWxHCXgTGxEL8cNnZGpc+zeGB2Jtb/ZiQpM9YLQ3+YFErsCO+80goRiI4iVmpHcMj QJGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EulreHubdH5p1pMWNXUfve3spICNl4NIiJ/zdmvASDM=; b=PHyn3zJsjvqEa4npeBW8RO9NrqaRu3LJLcJaRdOs3AvgcHu2cbBQQuUNrT7L+dRRsE 2yXtnhBGDRkoxM3WbakdvJoPcKPysc0i7TlI+K5zTeHa/YWCYZ5DsnbQFHMS6p7BwlVh NN7IVeFYj5Ibt9nQ6E2Z1nNkR5ge4sw8Prg+P5Tf7bt0E2ocI25N9y3epDfbKrc5nWpX 33Fa7rz7QMLov4EAulVo4od/0IZxqtvhaeEVdOi77le3rXPYtL8SQXxz6xMzwliBcq7j TAkahtGYxO/Zzp/9qsZ3HybaS/apdoVONbycx+DxkoZTSvUpDEaY/bRAb0N+LkY3QPfz 4NrA== X-Gm-Message-State: AFqh2krUO2vRlDbbnmLuGrGS2M3wheizqbw9bn2eCiGvBAMxkxYi2OTz 0ZebEZqIIscDqEUpaAN2aH8a4CItSjOwO4BHOyTb1xurr84= X-Google-Smtp-Source: AMrXdXu3pT9IAPipOoZhVZHYo8/+VcnTHQRaWkwYqn91dZp7ZFp1qU7gzz/dUykQM2P7MuoL+ypjr0w8X6OLxZv2wHI= X-Received: by 2002:ab0:5b1e:0:b0:582:7c28:7c72 with SMTP id u30-20020ab05b1e000000b005827c287c72mr5342205uae.107.1673525936024; Thu, 12 Jan 2023 04:18:56 -0800 (PST) MIME-Version: 1.0 References: <20230111085343.2058993-1-amitprakashs@marvell.com> <20230112100106.2180665-1-amitprakashs@marvell.com> <20230112100106.2180665-2-amitprakashs@marvell.com> In-Reply-To: <20230112100106.2180665-2-amitprakashs@marvell.com> From: Jerin Jacob Date: Thu, 12 Jan 2023 17:48:29 +0530 Message-ID: Subject: Re: [PATCH v3 2/3] graph: pcap capture for graph nodes To: Amit Prakash Shukla Cc: Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , dev@dpdk.org Content-Type: text/plain; charset="UTF-8" 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 On Thu, Jan 12, 2023 at 3:31 PM Amit Prakash Shukla wrote: > > Implementation adds support to capture packets at each node with > packet metadata and node name. > > Signed-off-by: Amit Prakash Shukla > --- > v2: > - Fixed code style issue > - Fixed CI compilation issue on github-robot > > > diff --git a/lib/graph/graph_pcap_trace.c b/lib/graph/graph_pcap_trace.c > new file mode 100644 > index 0000000000..f7b81a7ad1 > --- /dev/null > +++ b/lib/graph/graph_pcap_trace.c > @@ -0,0 +1,155 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2022 Marvell International Ltd. 2023 > + > +#define GRAPH_PCAP_BUF_SZ 128 > +#define GRAPH_PCAP_NUM_PACKETS 1024 > +#define GRAPH_PCAP_FILE_NAME_SZ 128 > +#define GRAPH_PCAP_FILE_NAME "/tmp/graph_pcap_capture.pcapng" Expecting the filename from application. So no need to define here. > + > +static char file_name[GRAPH_PCAP_FILE_NAME_SZ]; > +static uint32_t pkt_buf_sz = RTE_MBUF_DEFAULT_BUF_SIZE; > +static uint64_t packet_to_capture = GRAPH_PCAP_NUM_PACKETS; > +static rte_pcapng_t *pcapng_fd; > +static struct rte_mempool *mp; > +static uint16_t port_id; > +static uint64_t packet_captured[RTE_MAX_LCORE]; > +static int pcap_trace_enable; See what it takes for multiprocess. If anything needs to be available in graph walk(which runs on secondary process) needs to be part of huge page. i.e part of rte_graph structure. > > + rte_node_process_t original_process; /**< Pcap enabled node callback */ Add comment like, "Used to store the original process when pcap is enabled" or so > + > /* Fast path area */ > #define RTE_NODE_CTX_SZ 16 > uint8_t ctx[RTE_NODE_CTX_SZ] __rte_cache_aligned; /**< Node Context. */ > diff --git a/lib/graph/version.map b/lib/graph/version.map > index 13b838752d..36153a75b2 100644 > --- a/lib/graph/version.map > +++ b/lib/graph/version.map > @@ -43,5 +43,12 @@ EXPERIMENTAL { > rte_node_next_stream_put; > rte_node_next_stream_move; > > + rte_pcap_trace_is_enable; > + rte_pcap_trace_enable; > + rte_graph_pcap_trace_init; > + rte_num_pkt_to_capture; > + rte_filename_to_capture_pkt; > + rte_graph_pcap_trace_exit; All of these public APIs are not needed. Since rte_graph is still experimental to make it clean, please add file name and number of packet to capture in struct rte_graph_param and update doc/guides/rel_notes/release_23_03.rst. See following example in doc/guides/rel_notes/release_22_07.rst API Changes ----------- * Experimental structures ``struct rte_mtr_params`` and ``struct rte_mtr_capabilities`` were updated to support protocol based input color for meter. > + > local: *; > }; > -- > 2.25.1 >