From patchwork Mon Nov 13 16:15:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 397 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 07EDA4331C; Mon, 13 Nov 2023 17:15:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF8284067D; Mon, 13 Nov 2023 17:15:32 +0100 (CET) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id EF397402D6 for ; Mon, 13 Nov 2023 17:15:30 +0100 (CET) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6c320a821c4so3817484b3a.2 for ; Mon, 13 Nov 2023 08:15:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1699892130; x=1700496930; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dm6Nn4L6j3yf0md474G5ykZ+1mCqLVHXiwO8I3ethpo=; b=GRArb6igTQ6lW+kHZQNY/NNceIt8xO5J3SvHhff+FEPagu9qzt+1GwLliaUuw0Cans R3YTbu7QsTJWFbM4gmcSqZfDXBz4l18io1e4N8/FnCnIBsOmKoWvUefPBYpPb6p09TiU Lu4FVt8rHaApNfhntDnwK+6Fn+ZwyMS6PeASydhrkmxWBG5seTIxaBbImkDTA4rg1KtE b7DMN4AwN0RRAVAYlr6E06gFBZUm8LMZ5wxaOAMJupeO3rIAkkC8b+37PaoXDDOxW2zf lwbWkVxjy79275e8mxGyTbEiNayPZmUPlN0wMbZ8GNUlHcpsXfaBXZLPmc+GRzZM0a6J tptg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699892130; x=1700496930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dm6Nn4L6j3yf0md474G5ykZ+1mCqLVHXiwO8I3ethpo=; b=q+XRQjTOAmurxVxfHSzZPiELlHjBAQTCWMxPQo/rV7VZpaZ71ttuZ0/VthCzgTRkCW IN10kqyXqgu0YB0xOG1cih/F0uwiFOcD6qexWNOnfKfOs7jRiBuVEK2EGBN43+1NavNm 4LlGnlJmCZU9CfSHMd/ZN22AIWia7WTEMgTGK1eFpsRJm3rjRob0u7yVAI3w7zFXS+h9 tqaomTyoCcS027Q7lQVwsKbRt0f4BVXuQHWs14Q+IzMDxdq9ccGKoHcBfTYWsdyI4XNu 9BSLhRAmqBJlrieiOntoEbW1B+hJi1JaNjOHPXLBdmlXkKVQD3XQ6HkCT79A5objPvRj jG1A== X-Gm-Message-State: AOJu0YyqWf0HuivZ+UVPMV1wVYrywnJy0pHH9EIO12slz3BP59NkJDP8 xkKRpFqZSHDzXQihkybhRzC5s9eCyvH9GQqqo/0= X-Google-Smtp-Source: AGHT+IHn5riZRXHw7SsCs4wfyyrfMsuR0LSyTEX+0wChh5fQqq7cw9cQDLZNMznUviPWj0zMlJNkJQ== X-Received: by 2002:aa7:8b5a:0:b0:6c6:ad85:4abb with SMTP id i26-20020aa78b5a000000b006c6ad854abbmr3332628pfd.23.1699892129374; Mon, 13 Nov 2023 08:15:29 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id hq11-20020a056a00680b00b006c69bbf03e2sm3350043pfb.192.2023.11.13.08.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 08:15:28 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v6 0/5] dumpcap and pcapng fixes Date: Mon, 13 Nov 2023 08:15:14 -0800 Message-Id: <20231113161519.242272-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230921042349.104150-1-stephen@networkplumber.org> References: <20230921042349.104150-1-stephen@networkplumber.org> MIME-Version: 1.0 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 It fixes issues related to timestamping. The design choices are to maximize performance in the primary process; and do all the time adjustment in the secondary (dumpcap) since the dumpcap needs to system calls anyway to write the result. This patches set changes where the adjustment is calculated into the pcapng portion that opens the output file. All details of the format of timestamp are contained inside pcapng (data hiding). v6 - make sure all steps compile v5 - fix format of getpid in capture name v4 - incorporate review feedback v3 - don't use alloca() since can have VLA type issues Stephen Hemminger (5): pdump: fix setting rte_errno on mp error dumpcap: allow multiple invocations pcapng: modify timestamp calculation pcapng: avoid using alloca() test: cleanups to pcapng test app/dumpcap/main.c | 53 ++--- app/test/meson.build | 2 +- app/test/test_pcapng.c | 417 +++++++++++++++++++++++++++------------- lib/graph/graph_pcap.c | 2 +- lib/pcapng/rte_pcapng.c | 156 ++++++--------- lib/pcapng/rte_pcapng.h | 19 +- lib/pdump/rte_pdump.c | 9 +- 7 files changed, 373 insertions(+), 285 deletions(-)