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 8778CA00C3; Wed, 21 Sep 2022 17:13:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7AE4540691; Wed, 21 Sep 2022 17:13:56 +0200 (CEST) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2061.outbound.protection.outlook.com [40.107.105.61]) by mails.dpdk.org (Postfix) with ESMTP id A62374281E for ; Wed, 21 Sep 2022 17:13:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M7yafoDHo0W46/GCoV8/gL5znmQH2mdCxDoruGxRF0Vacy7WJN8+JjKl3qhSyiawSYXWeS7yB+i7Ny0rFP5q59a8L6AVdDMwwtEl5uAjs90REwq2nHtYCZG9xz7IrvrhQAjHt4Rch7oe15bdJp/OsdnFEKA3GR3oMGQ5YLkkpc07BmOo5fXLNHOoCjMYlh80u0eNzoCgUXqEVGjHREDUBiJeyXO+0hrJqaSI8Ei+w0Pvkv8BNZZrKr1BrgYhsM5tvrnBo3U8tqDhVDG2S5g5yqN1P+/4qHx1eaF2ysqOEPyRNiHytLMiHoGxrjRHoxS04qSjY3k4yiRB19tt/DW/iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AxIA2UitECn43fT6n3PEqUnG7BFVeDMOtJtZme7sn7c=; b=OwpJdKVIsmgHMLkF6p5cdmAq7R8WnYl0aIIyI7z+ooj4JJr1wHcslShq533gvRH9X10qeZ5BbCbB4fmmnyGi1tIMbWi+tBv5CV+aaGf7IjU2rT0xjGTzxN7CWJdZLfkw31ufsuiaxb6u/NqRD+I6xvIDqqHeZcc3SwMixvZu7hM0BIFT/l581hD6K3SKlVg5DSUCsXOl1Rr9aJpfcNqYZo12jsljPH3H5UqGQDJbWudUMALjgcGrr27kvLkLq3cUe9X+ulY9es432TdXEujmbBrQgy8fiCjKYTSRSabhNPabvCxyn8R4c8Q/Lbr1dQA8QGoXv3N4GH00AjzTiVl6eQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AxIA2UitECn43fT6n3PEqUnG7BFVeDMOtJtZme7sn7c=; b=Z0IhiTKAZ0qa34Z3rsejrBViaScs51pTDWodveJRGOu/kxfT/UqGB8vfgVIApKuOJYClcflMuo8GC0+3h/DSF+WB4KEKJzCu/++WPFa0vgCvn5ZCfCKPQKdXQny9udDiNaojf+zRnEjDBiny1OLh716ifq8ns4C/U1GPTpXEEhhqHpL8HlpnIeK+WGt8Q3WH7GV58QK4yYDCmew/HCMGKM4X7y2hJAbHccG0GkT35JGJ+vr5PexglTvYg3uIQRmuxU1VGL0Cbn7/ZAaszd/peQIDdst4diJv7T2Y8IH+LzfB+KzNXVZyngPdVbgVLFUah+/eo7mW1hvJnLATj6Yqpw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siemens.com; Received: from PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:269::8) by AS2PR10MB7345.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:607::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16; Wed, 21 Sep 2022 15:13:06 +0000 Received: from PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM ([fe80::e4a0:49e4:2152:11b1]) by PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM ([fe80::e4a0:49e4:2152:11b1%5]) with mapi id 15.20.5632.021; Wed, 21 Sep 2022 15:13:06 +0000 Date: Wed, 21 Sep 2022 17:13:02 +0200 From: Henning Schild To: Jerin Jacob Cc: Felix Moessbauer , dev@dpdk.org, jan.kiszka@siemens.com, thomas@monjalon.net Subject: Re: [PATCH v6 2/2] Add l2reflect measurement application Message-ID: <20220921171302.5289665a@md1za8fc.ad001.siemens.net> In-Reply-To: References: <20220902084533.675698-1-felix.moessbauer@siemens.com> <20220902084533.675698-3-felix.moessbauer@siemens.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AS8P250CA0004.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:330::9) To PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:269::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR10MB5780:EE_|AS2PR10MB7345:EE_ X-MS-Office365-Filtering-Correlation-Id: 214bcce3-925d-4cd9-f7fb-08da9be3c910 X-LD-Processed: 38ae3bcd-9579-4fd4-adda-b42e1495d55a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uliae1Sh9CshL0Xa+0PWKW/ozWm5z+Rnm51bpbg6qU1hUOpT5GI11EVOcGAKuisWggyr4X4BaMQbxHJPq8lmeVeLuc7uR62Rt09SENazUdut+jZE3GRXuRRm8DqqWSG7BP42ZUxyBWEpoih05EQT9BAZAgBhoCN3D1eADw/D0m6Aqy2IUqmSmPL+0EEwhR5q2G6vblzlkmIqlGYquJRC18fV8mBnA5OC8JhqThc8FGAorWgsbGNDXWk9FsdDBv4d7RWzM6gBnkEFl5bqbUoN5l2cwB1vvWZauDuRCik1rxs231Ask59eSZCAjq+swUrpeg8ABpkvmaXRkKhE25Y9JlmFBCvDhtgd9l4sgifemUmO/xvv8cP2cf5psawGHwWn8+5GaHPdLxFqNEGf22Z8/OC9qfJmb01Y33L8z/3EE8jkxdui8OaGaoZz7BBvfV5oDHMuvUB1oB2TuRFsshj63vYNXOS8FffnXjAIBO1rwshkF1jvpZtkJZqx81gquxujW1jGHYe3VNeOgi3acK5G6zluVmkgtjSnz/bE9N8m8LcmKFhNx4GLMrWiDifRNB3vF2FijRx4MrPtyds/BQCJbXzAcq+nnu4wGAE58g49tDniZHj7dpYz7GOoVOSe8NUl5QtxXbC0kL7zOfaGZJ/beMhrcHXVBFJZ5Eh0nIbYA374Inibz6YjBt05LU6qsGOvMQD7iq9ifGYHdFZWs01wXQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(39860400002)(366004)(376002)(136003)(346002)(451199015)(38100700002)(8676002)(478600001)(6486002)(2906002)(6916009)(8936002)(66946007)(66476007)(4326008)(30864003)(44832011)(5660300002)(316002)(66556008)(82960400001)(9686003)(6512007)(6666004)(41300700001)(53546011)(83380400001)(6506007)(1076003)(186003)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?WfJ9d8wuo59NJ7gIUANCn2JP9eJEXqBifazU6yfGK19Le8aHQQPSWLU5/K0O?= =?us-ascii?Q?Mi+pmNQLYK3ojH6dnc99Y4uib0Be0fGP5B0tXsXLXB7D5boA7oOZFwrtuQt6?= =?us-ascii?Q?OYCEmCCCdd2DRn0z+/eRI/gRWo3e0daPkUBEggirGP8rEr3cckP1/o7o5b0q?= =?us-ascii?Q?visgvnFpKJPSvksxXKnG9JXFE4R8Zep/jNlsCSj/lhbXbu7kCj7KjTyRXxHC?= =?us-ascii?Q?Cf2ux0MyoZBtSvWX4c2riV7gOEWmZnwMEX6A2TPrDwyGh9yRJXqGQPvA+Hsh?= =?us-ascii?Q?Bh0QPg/wFKETVRzx4KUf/2XN/G5cYrP7xWvTUhWCiBe79Hr5Gh+doJseNBUl?= =?us-ascii?Q?MpF8K0bQrYCNicXTwFGFQf26XmOWbX2ei9eQjaUFofwoATB1BVo55xeZQvJd?= =?us-ascii?Q?A/P2NtlW6fsABM2kxwqsrRZfSQHEbvi5CH5JgASv3+lgDUtBjhsvcEXpDxO+?= =?us-ascii?Q?jl4Ei4YBWoCgp6ZwHhKaQH/ZkOUYhnFTMnKIeb8IQHQRl//36X6ca5M2Ck0A?= =?us-ascii?Q?MXYb3l2K5ETWspmjvKd6T6l+q7pCgRPL6NGO3gkryxXM1l4v8I0RxxiA6/We?= =?us-ascii?Q?M+Ovv//uBhazKQHAW6/ooD89qvn8x0FUW2y0lPi8DQY0ZR0RpF1jB7NGOC/U?= =?us-ascii?Q?gaRiBehC/ldMQTAwE+Cm/DdXlhXEcqTKfJmvOG41Mdo8WDsYQgIeVxPXIv4d?= =?us-ascii?Q?by2W34HPK4tBXLDyN4YeZhMlEcQNoF8JD4CD8pTtZNAh46LPuqxlSVqQ9jQx?= =?us-ascii?Q?i6E1qzYZJOJsywAwJCDTGqI7FU5p6B22Zt2UJnBiUOh9BAnbUrTTH1KUSWVo?= =?us-ascii?Q?oMQ5/LhS+ENPzqx97Re5osk1lHBxBmZtMA8JTHbQg9A0nhDAfWmDg7wS/eW/?= =?us-ascii?Q?J7DeLka7LayceD0U1m7YyFGll4EjJvZiM+dryaOR7p2p4w9uqpietcVEkE4c?= =?us-ascii?Q?VAmRiQ+EO7IdYEtT54T9BHd/NhtxB2m8FHOw1qG/Z8LThX3uLdeqkcIIUm/q?= =?us-ascii?Q?3O+wVOd3D/W4OhEHxpcO3tx0YOVnWSqwlavCNiKQD/oclo0FzQ6jniwxrU/U?= =?us-ascii?Q?MHL2vzfuJvEFuNEHIDGXcYnNDp0mnWvNj6RoY1uWxRUJK/4XF9b3H/BgEkS2?= =?us-ascii?Q?zNAWO89cJ5yPAYjzA6y2Ju9z6hPGjuWNaCcKyg5s0/etw044/fzvwxtqkVZ0?= =?us-ascii?Q?UxjM2l9qUGpbTwNHYer5+Aqo9q17NveKIZBy0zMjsKLO/D/fWvjZUcZs6F3p?= =?us-ascii?Q?nxy0lql4saSNry07S+OXt+vgiOvcXT6HyZkzM9QYvfpDtMu+cafbYk3rC6B3?= =?us-ascii?Q?tFGjXyM0aM/ZXRlkp5ZiKJAPi9b1kl4EnChhlP9bAPpqzN10FyBcuOLFtVpd?= =?us-ascii?Q?2NtsFa5crTNHy+Pp/yY+A8kE7AFFzqN4AYSl5FYzs8ZVNclnbgN7hrVqNBmE?= =?us-ascii?Q?8kiasBHa6ydCkaJv1Aib19evutd92KFXwfGG1YsMZz1qxYTG9F6jVDlT3WOw?= =?us-ascii?Q?N6ZA4WPTI9wnO3q+RKyPC/OI4bttennz33tGPTka+KIwAA8I5CHZr0cdSvSY?= =?us-ascii?Q?gDJxz/KSP/GlU/Wo8I5JvAqESZcLjxg9JwFALMWry5f5EGj2pZntEH6spvLU?= =?us-ascii?Q?kzCG1zU3r/ZXXF3HUQ4c6VGRP+gwmtm8cbdZgajA+DygqI4gD92C6rLRd+zP?= =?us-ascii?Q?rWcsPQ=3D=3D?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: 214bcce3-925d-4cd9-f7fb-08da9be3c910 X-MS-Exchange-CrossTenant-AuthSource: PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2022 15:13:06.0979 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1KG+sWwlZak3NVD4K6L7EwxNiE03An6K+jCKQZv0mGZXV0UjyQ5LMV+k38BiJHITmh9lQ8M4LQzYPbec+vgVGBuDKKaoFsJNbnPDqX9cNHI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR10MB7345 X-Mailman-Approved-At: Wed, 21 Sep 2022 17:13:55 +0200 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 Am Wed, 21 Sep 2022 20:12:21 +0530 schrieb Jerin Jacob : > On Fri, Sep 2, 2022 at 2:16 PM Felix Moessbauer > wrote: > > > > The l2reflect application implements a ping-pong benchmark to > > measure the latency between two instances. For communication, > > we use raw ethernet and send one packet at a time. The timing data > > is collected locally and min/max/avg values are displayed in a TUI. > > Finally, a histogram of the latencies is printed which can be > > One highlevel comment, > > IMO, We don't need to add code for capturing in histogram and analyze > it in C code. > We can simply use, rte_trace and so that we can visualize with > standard trace viewers. > Also add add python based script parse the CTF emitted by trace and > find min/max/avg values to simply the code. We need some logic in the application to have a live view of min/max/avg. More importantly for the break threshold where we stop the measurement and the tracing ... so you find the root-cause of your spike at the end of your trace. And a trace is only so long until the ring wraps. So tracing could be the input, but the processing should happen live. To react on a max threshold, to show live data, to not miss anything even when running for weeks. Given that trace processing would need to be live, would you still suggest to use traces as input and use python to process them? I guess that could be done with another process and IPC but not sure it would be nice or how much code it would save. Henning > > further processed with the jitterdebugger visualization scripts. > > To debug latency spikes, a max threshold can be defined. > > If it is hit, a trace point is created on both instances. > > > > Signed-off-by: Felix Moessbauer > > Signed-off-by: Henning Schild > > --- > > app/l2reflect/colors.c | 34 ++ > > app/l2reflect/colors.h | 19 + > > app/l2reflect/l2reflect.h | 53 ++ > > app/l2reflect/main.c | 1007 > > +++++++++++++++++++++++++++++++++++++ app/l2reflect/meson.build | > > 21 + app/l2reflect/payload.h | 26 + > > app/l2reflect/stats.c | 225 +++++++++ > > app/l2reflect/stats.h | 67 +++ > > app/l2reflect/utils.c | 67 +++ > > app/l2reflect/utils.h | 20 + > > app/meson.build | 1 + > > Need to add a doc for this example at doc/guides/sample_app_ug/ > > > > > diff --git a/app/l2reflect/colors.c b/app/l2reflect/colors.c > > new file mode 100644 > > index 0000000000..af881d8788 > > --- /dev/null > > +++ b/app/l2reflect/colors.c > > @@ -0,0 +1,34 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * Copyright(c) 2020 Siemens AG > > 2022. Please fix in all files. > > > diff --git a/app/l2reflect/l2reflect.h b/app/l2reflect/l2reflect.h > > new file mode 100644 > > index 0000000000..922bd7c281 > > --- /dev/null > > +++ b/app/l2reflect/l2reflect.h > > @@ -0,0 +1,53 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * Copyright(c) 2020 Siemens AG > > + */ > > + > > +#include > > + > > +#ifndef _L2REFLECT_L2REFLECT_H_ > > +#define _L2REFLECT_L2REFLECT_H_ > > + > > +#define RTE_LOGTYPE_L2REFLECT RTE_LOGTYPE_USER1 > > Don't define RTE_ symbols in application. > > > + > > +/* max size that common 1G NICs support */ > > +#define MAX_JUMBO_PKT_LEN 9600 > > + > > +/* Used to compare MAC addresses. */ > > +#define MAC_ADDR_CMP 0xFFFFFFFFFFFFull > > + > > +#define MAX(x, y) (((x) > (y)) ? (x) : (y)) > > +#define MIN(x, y) (((x) < (y)) ? (x) : (y)) > > > Use RTE_MAX and friends. Similar comments for other macros. > > > > +extern int l2reflect_hist; > > +extern unsigned int l2reflect_hist_buckets; > > +extern atomic_int l2reflect_output_hist; > > +extern int l2reflect_interrupt; > > +extern uint64_t l2reflect_sleep_msec; > > +extern uint64_t l2reflect_pkt_bytes; > > +extern uint16_t l2reflect_port_number; > > +extern atomic_int l2reflect_state; > > +extern struct rte_ether_addr l2reflect_port_eth_addr; > > +extern struct rte_ether_addr l2reflect_remote_eth_addr; > > It is better to move all global variables to app_ctx kind of > structure and allocate from hugepage as some of them are used in > fastpath and easy to track. > > > +/* Configurable number of RX/TX ring descriptors */ > > +#define RTE_TEST_RX_DESC_DEFAULT 128 > > +#define RTE_TEST_TX_DESC_DEFAULT 128 > > Don't define RTE_ symbols in application. > > > +/* Send a burst of one packet */ > > +static inline int > > +l2reflect_send_packet(struct rte_mbuf **m, uint16_t port) > > +{ > > + unsigned int ret; > > + struct rte_ether_hdr *eth; > > + struct my_magic_packet *pkt; > > + uint16_t type; > > + > > + eth = rte_pktmbuf_mtod(*m, struct rte_ether_hdr *); > > + pkt = (struct my_magic_packet *)eth; > > + type = pkt->type; > > + > > + if (likely(type == TRACE_TYPE_DATA)) > > + clock_gettime(CLOCK_MONOTONIC, &last_sent); > > Use rte_rdtsc_precise() instead of system call in fastpath > > > + ret = rte_eth_tx_burst(port, l2reflect_q, m, 1); > > + if (unlikely(ret < 1)) > > + rte_pktmbuf_free(*m); > > + return 0; > > +} > > + > > +static inline void > > +l2reflect_simple_forward(struct rte_mbuf *m) > > +{ > > + struct rte_ether_hdr *eth; > > + struct my_magic_packet *pkt; > > + > > + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); > > + pkt = (struct my_magic_packet *)eth; > > + > > + /* dst addr */ > > + rte_ether_addr_copy(ð->src_addr, ð->dst_addr); > > + /* src addr */ > > + rte_ether_addr_copy(&l2reflect_port_eth_addr, > > ð->src_addr); + > > + if (unlikely(pkt->magic == MAGIC_TRACE_PAYLOAD)) > > + rte_eal_trace_generic_str("sending traced packet"); > > > > Create app_trace tracepoint specific to application with new type to > avoid emit the string. > > > > + > > + l2reflect_send_packet(&m, l2reflect_port_number); > > +} > > > + > > +/* > > + * process a single packet. > > + * return false if latency threshold is hit > > + */ > > +static inline int > > +process_packet( > > + struct my_magic_packet *pkt, > > + struct timespec *rx_time, > > + uint64_t *diff) > > +{ > > + if (pkt->type == TRACE_TYPE_DATA) { > > + rte_memcpy(&last_recv, rx_time, sizeof(*rx_time)); > > + *diff = calcdiff_ns(last_recv, last_sent); > > + if (!unlikely(add_to_record(*diff))) { > > + /* TODO: improve tracing */ > > + > > rte_eal_trace_generic_u64(record.max_round_ns / 1000); > > Add a new trace point as an application specific item. > > > + return 0; > > + } > > + } > > + if (pkt->magic == MAGIC_TRACE_PAYLOAD) > > + rte_eal_trace_generic_str("received traced > > packet"); > > Add a new trace point as an application specific item. > > > + > > + return 1; > > +} > > + > > +/* > > + * free all packet buffers in the range [begin, end[. > > + */ > > +static void > > +free_pktbufs( > > + struct rte_mbuf **bufs, > > + int begin, > > + int end) > > +{ > > + int i = begin; > > + for (; i < end; i++) > > + rte_pktmbuf_free(bufs[0]); > > Freeing the same packet multiple times? > > Use burst varint if possible. > > > > > +} > > + > > +/* > > + * return 1 in case the ball was lost (cheap check) > > + */ > > +static inline void > > +check_ball_lost(const uint64_t dp_idle) { > > + /* only check if we are in running state and have a > > breakval */ > > + if (unlikely(dp_idle & RX_TIMEOUT_MASK) && > > + l2reflect_state == S_RUNNING && > > + l2reflect_break_usec && > > + record.rounds > WARMUP_ROUNDS) { > > + RTE_LOG(INFO, L2REFLECT, "lost ball after %" PRIu64 > > " rounds\n", record.rounds); > > + l2reflect_state = S_LOCAL_TERM; > > + } > > +} > > +} > > + > > + /* > > + * in quiet mode the primary executes the main packet loop > > + * otherwise the one worker does it and the primary prints > > stats > > + */ > > + if (quiet) { > > + assert(rte_lcore_count() == 1); > > +#ifdef HAS_SYS_IO > > + if (disable_int) { > > + iopl(3); > > + asm("cli"); > > Do we need x86 specific items in application? > > > + } > > +#endif > > + RTE_LOG(INFO, L2REFLECT, "PID %i, Parent %i\n", > > getpid(), getppid()); > > + l2reflect_launch_one_lcore(NULL); > > + } else { > > + assert(rte_lcore_count() == 2); > > + /* the worker reflects the packets */ > > + RTE_LCORE_FOREACH_WORKER(lcore_id) > > + { > > + > > rte_eal_remote_launch(l2reflect_launch_one_lcore, NULL, > > + lcore_id); > > + } > > + > > + /* the primary prints the stats */ > > + init_record(); > > + l2reflect_stats_loop(); > > + rte_eal_mp_wait_lcore(); > > + } > > + rte_eal_cleanup(); > > + > > + if (l2reflect_hist) > > + output_histogram_snapshot(); > > + > > + cleanup_record(); > > + > > + return 0; > > +} > > diff --git a/app/l2reflect/meson.build b/app/l2reflect/meson.build > > new file mode 100644 > > index 0000000000..14b154ef06 > > --- /dev/null > > +++ b/app/l2reflect/meson.build > > @@ -0,0 +1,21 @@ > > +# SPDX-License-Identifier: BSD-3-Clause > > +# Copyright(c) 2022 Siemens AG > > + > > +cc = meson.get_compiler('c') > > + > > +jansson = dependency('libjansson', required: false) > > + > > +if not jansson.found() > > + jansson = cc.find_library('jansson', required: false) > > +endif > > + > > +if cc.has_header('sys/io.h') > > + cflags += '-DHAS_SYS_IO' > > +endif > > + > > +sources = files('main.c', 'utils.c', 'stats.c', 'colors.c') > > +deps += ['ethdev'] > > +if jansson.found() > > + ext_deps += jansson > > + cflags += '-DRTE_HAS_JANSSON' > > +endif > > diff --git a/app/l2reflect/payload.h b/app/l2reflect/payload.h > > new file mode 100644 > > index 0000000000..c1fae5d5e4 > > --- /dev/null > > +++ b/app/l2reflect/payload.h > > @@ -0,0 +1,26 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * Copyright(c) 2022 Siemens AG > > + */ > > +#include > > + > > +#ifndef _L2REFLECT_PAYLOAD_H_ > > +#define _L2REFLECT_PAYLOAD_H_ > > + > > +#define MAGIC_TRACE_PAYLOAD 0xd00faffeaffed00full > > +/* IEEE Std 802 - Local Experimental Ethertype */ > > +#define ETHER_TYPE_L2REFLECT 0x88B5 > > + > > +struct my_magic_packet { > > + /* l2 packet header */ > > + struct rte_ether_hdr eth; > > + /* type of the l2reflect packet */ > > + uint8_t type; > > + /* magic easy-to-spot pattern for tracing */ > > + uint64_t magic; > > + /* break if latency is larger than this */ > > + uint64_t breakval; > > + /* intended size of the packet */ > > + uint64_t req_pkt_bytes; > > +}; > > + > > +#endif /* _L2REFLECT_PAYLOAD_H_ */