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 2E243A0350; Wed, 24 Jun 2020 20:10:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A26CE1D9AC; Wed, 24 Jun 2020 20:10:06 +0200 (CEST) Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by dpdk.org (Postfix) with ESMTP id C03E11D936 for ; Wed, 24 Jun 2020 20:10:05 +0200 (CEST) Received: by mail-pj1-f66.google.com with SMTP id ft14so434742pjb.1 for ; Wed, 24 Jun 2020 11:10:05 -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=o48VdNIA9Aw1iQ7rKga2S5jV9cDFfgDzvjVmWBazK7s=; b=Fqj6lIdbn1s4IB8CBWDmuIns55inm1vqIKHwAZiy/EwwvZoIFAhx6VeoDzKw2Knh2c T7vLElcKQSi79cmPsXkWhYeTZM4aOlI15TT9uJmwGpREDOGtE8rRdDMB7l0Kt7xr9yVZ qcz46mbU9sLxv4p9X9yzje5/ds/9VAoo7XKm/KGGxU7pZBt2qHmT8iRoe4+UEPZ60opv BlujoocSFrd/3NBNcq2crhf64iKz4FL2IY03OLeuR+60ubJfwcfV0Ai1m3thMIYz6pd/ Sa4O8IgppVISBZm32jnR9sXBIw9PkoeB28UIiV4P4xs59/mVV6IN8f29j8rC6GXEYYiT k3KA== 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=o48VdNIA9Aw1iQ7rKga2S5jV9cDFfgDzvjVmWBazK7s=; b=UfO2wBgD/WqNMXz8PrjnVmxVQwk/MXcLVsKZOTpZLCpgwjyvuqDm45G3m3WMcGN1Jq WR8WfZR6njnuTbnbgYlxNiD/Ug+v4u1UNZX852ypCgZbmrGGRaUWo66dV4nw0cJ8vUnf K/3nT9bEJRRqcd1fIMKkf9t6M4XPGGQzKCOQ2lCzOQmlrNPkh1KbQ9wokW/oyb1LXKCl FPuc80RFU1mp+VUhKdwAn4vn0LSxTEYsZJ3QXVR4SLqVI4OGeDWpfecDyKeYwK/57F3J 0g/ow5RZBVQO/o0qUc4OqIAdD9kGHotGwLxCA4uUYwTfVov0TsdzGS7uyMrQRFjjcYJX VCUg== X-Gm-Message-State: AOAM530xU5upcDaDS+pahaNCKYtDrOs1wRNhJwN+Lwl/7JiaKTqTOWc/ DmPY1MRe5VJ5A7hlj2+qvnQOyg== X-Google-Smtp-Source: ABdhPJwvw+WsV2bOzxOTsR3c9Pkz1CJcF6d0PwIOOfwq1ZFI08fELHKg+A2CiMEx9K6G5qBoVMLIyQ== X-Received: by 2002:a17:902:b698:: with SMTP id c24mr14364241pls.28.1593022204717; Wed, 24 Jun 2020 11:10:04 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id h17sm16834802pgv.41.2020.06.24.11.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 11:10:04 -0700 (PDT) Date: Wed, 24 Jun 2020 11:09:56 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: dev@dpdk.org, orika@mellanox.com, viacheslavo@mellanox.com, matan@mellanox.com, rasland@mellanox.com, Jiawei Wang , ian.stokes@intel.com, fbl@redhat.com Message-ID: <20200624110956.28b821db@hermes.lan> In-Reply-To: <7858203.UFLHXkIILB@thomas> References: <20200611131946.11629-1-jiaweiw@mellanox.com> <7858203.UFLHXkIILB@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC] 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 Wed, 24 Jun 2020 19:07:49 +0200 Thomas Monjalon wrote: > > > > +/** > > + * @warning > > + * @b EXPERIMENTAL: this structure may change without prior notice > > + * > > + * RTE_FLOW_ACTION_TYPE_SAMPLE > > + * > > + * 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 */ > > + const struct rte_flow_action *actions; > > +}; Putting const on the ratio value is not necessary. Other flow_actions don't do that. Note: rte_flow action structures seem to have lots of holes. The value of those holes is undefined. You may want to swap the fields.