From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2FD04A0350; Fri, 26 Jun 2020 12:35:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0C3611BEA9; Fri, 26 Jun 2020 12:35:40 +0200 (CEST) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id 3512A1BE9D for ; Fri, 26 Jun 2020 12:35:38 +0200 (CEST) Received: by mail-io1-f68.google.com with SMTP id h4so9261184ior.5 for ; Fri, 26 Jun 2020 03:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dUvydkm20v1YSgTb6S9qUE4iTVD02QDIop9bZ3U4QJM=; b=Ypvc+M0kDDHQ7nFS0imU26jX7xme2nJpFJu5w65KdSrTrnwg4QraxSEKD3iJp1dNAz k3h+Qp9YWkB2tGwj43IZn1ggUJTLc27UBeevuRMqTWERXOYr7FAY8M7cnc1HkhEiXIiB WxhVuGbgI1WpXXY6rtvDRDXE3D7YUM8RfGCEhlHS12tlfwOxA6JFLWHMdyZum7luyGub O1HnGlZd9IyfbjUZjDZy19M96khomUij1pmPE3kkEEt3X+yzp8mN2L5l1x6dKliqh49b WbGrSo/QSVEnjkpAnMOxsX50PnuM/380gIauJ+1VbX4U9a9HVquBVqGkqJM07C3uZKDq lvIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dUvydkm20v1YSgTb6S9qUE4iTVD02QDIop9bZ3U4QJM=; b=pYpeUkBm9hhOMGWX7Dkg+O14MsFB+9Mwx4jrR7/YLwjiNu2R3R93Qt/YZJ+HVYQxu5 HZor2Le83hlgGrD9mYdrAA3FJWgaruSMvBwOckhazXgue7Vbj7EP3KJvxuddxHKWMDVC uZirTXiZw7d0ry7bF1IBCHzkzKjSmUqFTUGeoUUOna/A41fpwdaPtP0R8e7T/g7VO2aA vUIuAi2cZSmvTGyHGaSagQhPQjeECaqRROMBwJBfOmt+kxoMHgDAfJHwciA5bQRmT0GC BPnSNSmilaLilbLnpUvA2ZBw01a6IWixEzkS0ixf2mrUoT500ZTo1igUGpRKbj6GDkvs 9Wqg== X-Gm-Message-State: AOAM531vCzobpuQcM0EgV7XHPFqtfPCArCth0bvrROej8GejJvCGmUyV 0xRtSoKt7c8gMW9RPtZmjiYOReMryW/wfJw+Cr0= X-Google-Smtp-Source: ABdhPJyCi6e4x8S+WOnB5ensy3WtkbkU8tmVH571HW63/p7pz2IUqL7m3LiTbOKAp5iOJ2hujYtCMqL3tmXTZbF9+SI= X-Received: by 2002:a5e:880f:: with SMTP id l15mr2653868ioj.94.1593167737346; Fri, 26 Jun 2020 03:35:37 -0700 (PDT) MIME-Version: 1.0 References: <1593102379-400132-1-git-send-email-jiaweiw@mellanox.com> <1593102379-400132-2-git-send-email-jiaweiw@mellanox.com> <17660414.AQMWyGVKyv@thomas> In-Reply-To: <17660414.AQMWyGVKyv@thomas> From: Jerin Jacob Date: Fri, 26 Jun 2020 16:05:21 +0530 Message-ID: To: Thomas Monjalon Cc: Jiawei Wang , Ori Kam , Slava Ovsiienko , Matan Azrad , dpdk-dev , Raslan Darawsheh , ian.stokes@intel.com, fbl@redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 1/8] ethdev: introduce sample action for rte flow 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 Fri, Jun 26, 2020 at 12:59 AM Thomas Monjalon wrote: > > 25/06/2020 19:55, Jerin Jacob: > > On Thu, Jun 25, 2020 at 10:20 PM Jiawei Wang wrote: > > > > > > When using full offload, all traffic will be handled by the HW, and > > > directed to the requested vf or wire, the control application loses > > > visibility on the traffic. > > > So there's a need for an action that will enable the control application > > > some visibility. > > > > > > The solution is introduced a new action that will sample the incoming > > > traffic and send a duplicated traffic in some predefined ratio to the > > > application, while the original packet will continue to the target > > > destination. > > > > > > The packets sampled equals is '1/ratio', if the ratio value be set to 1 > > > , means that the packets would be completely mirrored. The sample packet > > > can be assigned with different set of actions from the original packet. > > > > > > In order to support the sample packet in rte_flow, new rte_flow action > > > definition RTE_FLOW_ACTION_TYPE_SAMPLE and structure rte_flow_action_sample > > > > Isn't mirroring the packet? How about, RTE_FLOW_ACTION_TYPE_MIRROR > > I am not able to understand, Why it is called sample. > > Sampling is a partial mirroring. I think, By definition, _sampling_ is the _selection_ of items from a specific group. I think, _sampling_ is not dictating, what is the real action for the "selected" items. One can get confused with the selected ones can be for forward, drop any other action. So IMO, explicit mirror keyword usage makes it is clear. Some more related questions: 1) What is the real use case for ratio? I am not against adding a ratio attribute if the MLX hardware supports it. It will be good to know the use case from the application perspective? And what basics application set ratio != 1? 2) If it is for "rate-limiting" or "policing", why not use rte_mtr object (rte_mtr.h) via rte_flow action. 3) One of the issue for driver developers and application writers are overlapping APIs. This would overlap with rte_eth_mirror_rule_set() API. Can we deprecate rte_eth_mirror_rule_set() API? It will be a pain for all to have overlapping APIs. We have not fixed the VLAN filter API overlap with rte_flow in ethdev. Its being TODO for multiple releases now. > Full mirroring is sampling 100% packets (ratio = 1). > That's why only one action is enough. > >