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 B7A52A0350; Thu, 25 Jun 2020 19:55:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 74BA0E07; Thu, 25 Jun 2020 19:55:20 +0200 (CEST) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by dpdk.org (Postfix) with ESMTP id 7E372CF3 for ; Thu, 25 Jun 2020 19:55:19 +0200 (CEST) Received: by mail-io1-f66.google.com with SMTP id v8so6927708iox.2 for ; Thu, 25 Jun 2020 10:55:19 -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=8VJe5CBoGEJJ1eBokkDVdPow6yQtT9gBaXGNkF9kvqI=; b=rMgNT9Vhb61pje+giOUjbMer4xn6qVK1AQw+fsQmVydCB3WU1DHkkRBU2vrDgZA2h1 jSp72EIjYl/MrQIsl3k5zeQuo6rF5QjdpH+pz+8Iofiacs3y8GVKsE0Rx6M0PpqEDLee rpvNhNDiL52kK4+lssZC30MWv4EsuJhlCDF0u98CraVu9Os+VqNlQcjyw9fdAVtRoINs tRdTvqKwkLcuXxmC/2d6dAuq9RtgZcgLZxpCaCuGdiphtUiJ/GQdTymqc3F78AInx3nl iAqduMo/BE2NCgbuu6vFMVnEnQ6e9uAEVSd78gTQGPW333f1HENphrbwwhHeBdDNclgK 9b5A== 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=8VJe5CBoGEJJ1eBokkDVdPow6yQtT9gBaXGNkF9kvqI=; b=DIA/Hq1yI04xW0ZXWAfQovuKU7rzoxuMhVEnpjCtz+UO01UKuj+VaHrY0SDgNOlf2N dg7C4Md9GmNmXUhXlv4bdy2mhAk0kvfQbeY8PUs0dIboHAeHCynWGOCko+dYFQzfStZX rDOpJqRqpN2W6DwYQTnIlN1KyD7W94eGssPvPiQp4I+EX02maCmuBWcAzMPqpnX5kUvQ aDFnvVxszbDRnhu5/VGG7gof3LvBjQbPmg7RFda9p9BOg+cxb3j9ONYRzVKmLQVY+abt e/rQqQ3FWlz/zE7lw1LBwOdNUGW8hZ3QLNDHKuaqvk+B++UT2WshDtAiD9LgKozA44Px DGnA== X-Gm-Message-State: AOAM532/m10TnYnrLylHLkohRQ8NWvcG/uxND9LhGPRGstwedSC9O1NB snD1F28U9w2w2a4a46Cswj3eGBkbMIcNIDmu5OQ= X-Google-Smtp-Source: ABdhPJwQ0QUG8/85teGr9OWPW3kGnfK10bfJvK067WiF0c+ZqDh/HcweM+V0uB2PL7zqp2TRYEb7iLYYdkLrOZmlapE= X-Received: by 2002:a05:6602:2dca:: with SMTP id l10mr38050114iow.163.1593107718656; Thu, 25 Jun 2020 10:55:18 -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> In-Reply-To: <1593102379-400132-2-git-send-email-jiaweiw@mellanox.com> From: Jerin Jacob Date: Thu, 25 Jun 2020 23:25:02 +0530 Message-ID: To: Jiawei Wang Cc: Ori Kam , Slava Ovsiienko , Matan Azrad , dpdk-dev , Thomas Monjalon , 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 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. > will be introduced. > > Signed-off-by: Jiawei Wang > --- > lib/librte_ethdev/rte_flow.c | 1 + > lib/librte_ethdev/rte_flow.h | 29 +++++++++++++++++++++++++++++ > 2 files changed, 30 insertions(+) > > + * Adds a sample action to a matched flow. > + * > + * The matching packets will be duplicated to a special queue or vport > + * in the predefined probabiilty, All the packets continues processing > + * on the default flow path. > + * > + * When the sample ratio is set to 1 then the packets will be 100% mirrored. > + * Additional action list be supported to add for sampled or mirrored packets. > + */ > +struct rte_flow_action_sample { > + /* packets sampled equals to '1/ratio' */ > + const uint32_t ratio; > + /* sub-action list specific for the sampling hit cases */ Why not use, RTE_FLOW_ACTION_TYPE_PASSTHRU action to append further action for this ACTION. > + const struct rte_flow_action *actions; > +}; > + > +/** > * Verbose error types. > * > * Most of them provide the type of the object referenced by struct > -- > 1.8.3.1 >