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 9E578A034F; Wed, 31 Mar 2021 11:45:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37852140E28; Wed, 31 Mar 2021 11:45:08 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 26CC9406A3 for ; Wed, 31 Mar 2021 11:45:05 +0200 (CEST) IronPort-SDR: iaSSflFFKCoEZdAJO5XEM2zZ8EnjjEj6kAz4W6vLS4sGIN+rtMHdr74BRur3C0rD+boTOKvcPP kaN7ay8CzTcQ== X-IronPort-AV: E=McAfee;i="6000,8403,9939"; a="179507410" X-IronPort-AV: E=Sophos;i="5.81,293,1610438400"; d="scan'208";a="179507410" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 02:45:04 -0700 IronPort-SDR: HTNWI9q4A3BfaeVURHkX1Q7BfcU6XTL3d3xqlMOrKRdlIJoO32ud6xnbazDt/AjJwH26puHnxU /7nFC3XDG0gg== X-IronPort-AV: E=Sophos;i="5.81,293,1610438400"; d="scan'208";a="445602167" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.249.9]) ([10.213.249.9]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2021 02:45:02 -0700 To: "Jiawei(Jonny) Wang" , Slava Ovsiienko , "xiaoyun.li@intel.com" , Ori Kam Cc: "dev@dpdk.org" , Andrew Rybchenko , NBU-Contact-Thomas Monjalon References: <1615295935-11197-1-git-send-email-jiaweiw@nvidia.com> <05ca2fef-575c-7e95-2033-2a09dcc453c3@intel.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <4725b578-d381-0c36-9696-9dd9a16d049a@intel.com> Date: Wed, 31 Mar 2021 10:44:58 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] doc: add sampling and mirroring in testpmd guide 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" On 3/31/2021 7:38 AM, Jiawei(Jonny) Wang wrote: > Hi Ferruh, > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Friday, March 26, 2021 1:11 AM >> To: Jiawei(Jonny) Wang ; Slava Ovsiienko >> ; xiaoyun.li@intel.com; Ori Kam >> >> Cc: dev@dpdk.org; Andrew Rybchenko ; NBU- >> Contact-Thomas Monjalon >> Subject: Re: [PATCH] doc: add sampling and mirroring in testpmd guide >> >> On 3/9/2021 1:18 PM, Jiawei Wang wrote: >>> Update documentation for sample action usage in testpmd and show the >>> command line example. >>> >> >> +1 to document this. >> >> Indeed for all testpmd flow update, it must be mandatory to update "Flow >> rules management" section for it, Ori what do you think? >> >>> Signed-off-by: Jiawei Wang >>> Acked-by: Viacheslav Ovsiienko >> >> <...> >> >>> +Sample Sampling/Mirroring rules >>> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> + >>> +Sample/Mirroring rules can be set by the following commands >>> + >>> +NIC-RX Sampling rule, the matched ingress packets are duplicated and >>> +sent to the queue 1, and each second packets are marked with 0x1234 >>> +and sent to queue 0. >>> + >> >> Also each second packets duplicated to queue 1, isn't it, because of 'ratio 2'? >> > > Yes, 'ratio=2' means that 50% packet will be sampled. > I thought 'sample' action also applies to the "queue index 1" but most probably it only applies to 'sample_actions', so original paragraph is correct, perhaps except the 'duplicated' detail, and my comment "each second packets duplicated to queue 1" is wrong. Can you please confirm if below is correct: Assume 10 packets are received, from 1 to 10, after below rule queue status will be: Queue0: 2, 4, 6, 8, 10 [All marked with 0x1234, duplicated packets] Queue1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 [Original packets] >>> +:: >>> + >>> + testpmd> set sample_actions 0 mark id 0x1234 / queue index 0 / end >>> + testpmd> flow create 0 ingress group 1 pattern eth / end actions >>> + sample ratio 2 index 0 / queue index 1 / end >>> + >>> +E-Switch Sampling rule, the matched ingress packets are duplicated >>> +and sent to port id 2, and each second packets are sent to eswitch >> manager. >>> + >> >> what is 'E-Switch', or "eswitch manager", isn't the mirror rule generic? > > Here E-Switch means 'transfer=1' in flow attribute, I will remove it since the concept is for Mellanox HW. >