From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94E8AC433E6 for ; Tue, 14 Jul 2020 17:39:38 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 0D44422518 for ; Tue, 14 Jul 2020 17:39:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20150623.gappssmtp.com header.i=@networkplumber-org.20150623.gappssmtp.com header.b="gYcoZgcz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D44422518 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=networkplumber.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 53AF51D159; Tue, 14 Jul 2020 19:39:37 +0200 (CEST) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by dpdk.org (Postfix) with ESMTP id 23D4A1D147 for ; Tue, 14 Jul 2020 19:39:36 +0200 (CEST) Received: by mail-pg1-f177.google.com with SMTP id l63so7872357pge.12 for ; Tue, 14 Jul 2020 10:39:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1BOZsmuDTjSY24hwC+evKrdedpNuxkT4aQU7JkFCz1s=; b=gYcoZgczVxQQ5pazrd/vLSx9wOaP24VFdUoGownHwz3HL3+x4SdI5VKIXiJd0WM854 muGQMgGMyzZDRykTHx0c43NsyxrR7a3OWfJ6y755SBo1Xt9VAcBpfn0+psB+2UheG79z u3Mb0vuwiwKpbUtS/C7tV8RCWJPvWybHXR72V+BrObHi+FazhsVluj9rbKsKK61YGFsx hJ6YgkNovK8oKzZ2HOuq70ZioRp1XS7fODSJB82oAukn292qLWXdGc898mmpm0n8Uf/k Ro98+LTEIICfMMEscZA6cuv8sb3xdnxtABW8s/TF2y2qq7P3FES8JBLXmihmguHT8VVS kh5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1BOZsmuDTjSY24hwC+evKrdedpNuxkT4aQU7JkFCz1s=; b=nGjzLn+3/AdP5gD0CFs+AaWLWSh+HeGFvnqPRmaYJv9dwCR1O/SRZYRnW2EEjtbhhX l24GpWfwN8I5c1mIaKwYSlEjC5EKY3WBek/fNoOtY4u6l6bTpvHXzuX1ahPt4WEgkjyi JAPpoX6OgdHxQlMQ1UtWQfqqNCw3mGU51yl9LtLKUXEJuYAMoZEZa38ys6Snuh8jFzjQ JwjGmtNzyU33wBbsN2twoLPI5X8gWuv6KB0VQC5B3Ey46mREruSfEIIrZOP4HnxTypM9 C/JpR6GAQJkufU2amo4aTUy8nlUlhSmSi3fPYtdzvW1889NAu8hAd0V3k44nwut9T1Y5 vkEw== X-Gm-Message-State: AOAM531N5Ilzu/1/vzLl3xlMYmMP/PoxfPv+G0NZalf4w98zMk7ncVLo Vcd0hgGvOl8suGx7BKkz3XR8+w== X-Google-Smtp-Source: ABdhPJxuOJn9CgzviKyNtvH66Z/E2cPtZppACf+I65LSVgIekRrt/+n/n7R2QFajq4T1nF+bTBERuw== X-Received: by 2002:a65:644d:: with SMTP id s13mr4261726pgv.103.1594748375086; Tue, 14 Jul 2020 10:39:35 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id f3sm3095203pju.54.2020.07.14.10.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 10:39:34 -0700 (PDT) Date: Tue, 14 Jul 2020 10:39:26 -0700 From: Stephen Hemminger To: "Pattan, Reshma" Cc: Zhike Wang , "dev@dpdk.org" , "Yigit, Ferruh" Message-ID: <20200714103926.032d7cd1@hermes.lan> In-Reply-To: References: <1593758842-6306-1-git-send-email-wangzhike@jd.com> <1594715212-29438-1-git-send-email-wangzhike@jd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4] net/pcap: support snaplen option to truncate packet X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On Tue, 14 Jul 2020 11:46:00 +0000 "Pattan, Reshma" wrote: > > -----Original Message----- > > From: wangzk320@163.com On Behalf Of Zhike Wang > > + "[snaplen=default:0, meaning no > > truncation]'\n", > > From pdump changes, below are couple of comments. > > Bit more descriptive would be nice, how about, disables truncation of captured packets.? > > > + if (cnt1 == 1) { > > + v.min = 1; > > Min should be 0. User still can pass 0 value. > > > + v.max = UINT16_MAX; > > Instead of allowing big max number, isn't it good to have some restricted max value? > > Thanks, > Reshma An easier way to do the same thing. Just set the mbuf pool for the copied packets to be sized to the snaplen, then modify pdump to only copy the truncated header.