From patchwork Wed Oct 27 18:08:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 103082 X-Patchwork-Delegate: thomas@monjalon.net 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 6D18FA0C47; Wed, 27 Oct 2021 20:08:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E80714068C; Wed, 27 Oct 2021 20:08:52 +0200 (CEST) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id F36154003F for ; Wed, 27 Oct 2021 20:08:51 +0200 (CEST) Received: by mail-pj1-f41.google.com with SMTP id v10so2067930pjr.3 for ; Wed, 27 Oct 2021 11:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ojb2iOV7bpTCFOlFDCRyPKsBZL2dZp7zt5/FaC1S3zg=; b=yNf0TWk8h5WpQuVEN7/CFnQnjySAMbcK29kFYocyAD6Sz9jdonaDO9uOUqbEwCP9BK +SnJH/OqQty5zMwW4Ew7rD26zSxFThVBll4f5ma+DtCaWH6BLZohFCES+J3D2OiqHtyl YXVbMl0OcQXXQByALpj2kd8x9PVBE/Qw3E+y9Tk+WDRbEp2IGXpvPKs5tqJhxi45zHNC uYgb5IYUU4aPwCoN76gvyHh1JgbZdZ1N02J6g39b8WsjXEyrk+HAS0EidMgTvxvbAYY7 iVvXUBc62L1gN3uF3uyagD5fn4r1rpf8uheqPC3dZhyRJzdawF5syBhELrD9ePo5Y3Ur jVbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ojb2iOV7bpTCFOlFDCRyPKsBZL2dZp7zt5/FaC1S3zg=; b=y9YUrVPwwejOYqQcYDC67yXf5qHqOlauTXEbg8z0FipPIJO7Ji00cNgx4NqF015KUD RhMrdhVHYUBITOMToIjUiYO87jzzOB3+LriVopzHGJ/YuuzDmdiKLrxnPOeXSZb0sPP3 klnLg4agH9PEoiObmdzCMhlzbJT/Yk3QF14qhs9cS/osb7eM/3tbxHc+0jJD5GOwOE2O vw+TCestb6wijOlGM5FAyjD97107WCXbYwxSvw+yDX/ZlzBlICy8ysXlP3adJ/cAgaMG wszvoicKNKKwoOQlRvH1gESPgWiiM4gP++DC7ygH3OqCrvfhtkDH440MBh+9VacQeWPq gqMg== X-Gm-Message-State: AOAM531RpNNZ9z7RjRxy8rHbkpOawVNaOGBMeMxPpF8TFt+m+pnatAY1 ETVwBMP+OFWLCyZs87FYbrBJyXoDn4q7Vw== X-Google-Smtp-Source: ABdhPJwim4oDLy6fkurcRtsF1vuBd86/fEw355QN8h/Xzxj1NtQ0v8JDQ0SyisJ/146dbb4C8PS1Cg== X-Received: by 2002:a17:90b:4ad0:: with SMTP id mh16mr3680891pjb.2.1635358130595; Wed, 27 Oct 2021 11:08:50 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id t13sm402017pgn.94.2021.10.27.11.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 11:08:49 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 27 Oct 2021 11:08:47 -0700 Message-Id: <20211027180847.66572-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] pdump: initialize snaplen if enabled by device id 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 Sender: "dev" If packet dump was enabled via pdump_enable_by_deviceid the packet snapshot length was not being set. Bugzilla ID: 840 Fixes: 10f726efe26c ("pdump: support pcapng and filtering") Signed-off-by: Stephen Hemminger --- lib/pdump/rte_pdump.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c index 71602685d544..3086b2a1688b 100644 --- a/lib/pdump/rte_pdump.c +++ b/lib/pdump/rte_pdump.c @@ -631,6 +631,9 @@ pdump_enable_by_deviceid(const char *device_id, uint16_t queue, if (ret < 0) return ret; + if (snaplen == 0) + snaplen = UINT32_MAX; + return pdump_prepare_client_request(device_id, queue, flags, snaplen, ENABLE, ring, mp, prm); }