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 CD855A0A04; Fri, 15 Jan 2021 15:00:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7F1F1410F9; Fri, 15 Jan 2021 15:00:49 +0100 (CET) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by mails.dpdk.org (Postfix) with ESMTP id EC3A11410F8 for ; Fri, 15 Jan 2021 15:00:47 +0100 (CET) Received: by mail-io1-f53.google.com with SMTP id b19so15733213ioa.9 for ; Fri, 15 Jan 2021 06:00:47 -0800 (PST) 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=szMMQufMl7jP5omfnEeWzRhrA+FYK4Z1tBDdviXDO98=; b=JY67O9BKl686PccDV47ea0pEM1flRgJwRcvqaN8vGIU40361fkuWYlDgN/RLMrB1tR mgehYVg12WK2rSNzfPbDMXW3pi/uHliAhnYzHxhEbfh2mA7Lk0ELsMzRuT7XzxbvEGph UUnOUUzjQqM6BEyh1UVxjQLzq/1yfUPT3Ii92a5Hb+mAAlfHHLDhBICoRZUhlXZQxGQO nJNh9aVMxXr5XL5H1VphZCAHcPzFb6ZwKqYSqdLKU24a9vEM1RxnTbgBKo8+4mYRVwmV KHpId9CDo62iWMHg+eS16mYh2q1cL1sONzRhKFRk6dcatrO5T2/hx1ALxIaynv4hucth 4RSA== 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=szMMQufMl7jP5omfnEeWzRhrA+FYK4Z1tBDdviXDO98=; b=Hn4gMa4+FsugcuEobn/qD+A4I6LsX7on5Iq+ZbnEQAbjaKgasDZNbFrKatyl9hSDF6 aNpS+f+7ek0UPpVwOnyOcFQUS9I1uyqnRJ+EGb+enaYAUX4yh9969emClkCvI8LqJghX tV/mAbNUVmtF0LEMzWA0k199cUmZdlSJ+8p0NGCIXqw3qAuh91e4bzeXrXBEBCDnyPY4 GEI5ymJskERsbT1EiNmvzF0H460/YcuqaYlqfwpAH0Uz96eaVcEmnuMeHIHb5RuQE9lm 9JrEj0vdlxHTU8yH6IiNMmTIp5vJg6WbB0ozcPjUV3g5cZpYgiP70/N3cj0DwxWQh1hg +FiQ== X-Gm-Message-State: AOAM5329OrXOX8c6WGzxM8py6by7X2CqYbfPfVpWN+B5EcbIdJVYakp9 mS0b/yH3lYRDTfOb0Suc/D/f2jTIzdxmMnKlFqI= X-Google-Smtp-Source: ABdhPJyz7IN8oX1GYbpuhU8p8doqVFQU5s3AkvXCR5PRHXvOji4vOlFAFrC7EvxwY9TLaaa5eH3OFYLYUspUnHa6G/s= X-Received: by 2002:a05:6e02:e52:: with SMTP id l18mr6317562ilk.130.1610719247160; Fri, 15 Jan 2021 06:00:47 -0800 (PST) MIME-Version: 1.0 References: <20210108063234.7679-1-akozyrev@nvidia.com> In-Reply-To: From: Jerin Jacob Date: Fri, 15 Jan 2021 19:30:30 +0530 Message-ID: To: Ori Kam Cc: Alexander Kozyrev , Cristian Dumitrescu , "aboyer@pensando.io" , dpdk-dev , Slava Ovsiienko , NBU-Contact-Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] ethdev: introduce generic copy rte flow action 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 Thu, Jan 14, 2021 at 8:32 PM Ori Kam wrote: > > Hi Jerin, > > > -----Original Message----- > > From: Jerin Jacob > > Sent: Thursday, January 14, 2021 4:00 PM > > Subject: Re: [dpdk-dev] [PATCH] ethdev: introduce generic copy rte flow action > > > > On Fri, Jan 8, 2021 at 12:02 PM Alexander Kozyrev > > wrote: > > > > > > Implement a generic copy flow API to allow copying of an arbitrary > > > header field (as well as mark, metadata or tag) to another item. > > > > > > This generic copy mechanism removes the necessity to implement a > > > separate RTE Flow action every time we need to modify a new packet > > > field in the future. A user-provided value can be used from a > > > specified tag/metadata or directly copied from other packet field. > > > > > > The number of bits to copy as well as the offset to start from can > > > be specified to allow a partial copy or copy into an arbitrary > > > place in a packet for greater flexibility. > > > > > > RFC: > > https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatches.d > > pdk.org%2Fpatch%2F85384%2F&data=04%7C01%7Corika%40nvidia.com% > > 7C62ab41b9ed5948d056c308d8b894af02%7C43083d15727340c1b7db39efd9cc > > c17a%7C0%7C0%7C637462296023413253%7CUnknown%7CTWFpbGZsb3d8eyJ > > WIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C > > 1000&sdata=ovpEss3%2B7TgZRYFiDkrvuMFW52747Gno5oOIeDLwrBQ%3D > > &reserved=0 > > > > > > Signed-off-by: Alexander Kozyrev > > > --- > > > > > > > > +Action: ``COPY_ITEM`` > > > +^^^^^^^^^^^^^^^^^^^^^ > > > + > > > +Copy ``width`` bits from ``src`` item to ``dst`` item. > > > + > > > +An arbitrary header field (as well as mark, metadata or tag values) > > > +can be used as both source and destination items as set by ``item``. > > > + > > > +Inner packet header fields can be accessed using the ``index`` and > > > +it is possible to start the copy from the ``offset`` bits in an item. > > > + > > > +.. _table_rte_flow_action_copy_item: > > > + > > > +.. table:: COPY_ITEM > > > + > > > + +-----------------------------------------+ > > > + | Field | Value | > > > + +===============+=========================+ > > > + | ``dst`` | destination item | > > > + | ``src`` | source item | > > > + | ``width`` | number of bits to copy | > > > > > > > > Overall it is a good improvement. > > > > I think, if we add transform "op" here then it can be more generic. In > > other words, A generic packet transform and copy operation is just one > > of the operations. > > ie.. making it as rte_flow_action_xform_item and introduce COPY, ADD, > > SUB, etc transform along with existing rte_flow_action_copy_item > > fields. > > > > It may useful for expressing P4 packet transforms to rte_flow. > > > > The current generation of Marvell HW does not have COPY transform so I > > am leaving suggestions to vendors with this HW capablity. > > > > > > +1 > Lest have dst, src, width, op members, > and change the action name to rte_flow_action_modify_field() > > also lest add new field name immediate so the copy can be used as set. > (copy of an immediate value is a set) > > Possible op = copy / add / sub +1 > > > > + +---------------+-------------------------+ > > > > > > > > > > > + > > > +.. _table_rte_flow_action_copy_data: > > > + > > > +.. table:: destination/source item definition > > > + > > > + +----------------------------------------------------------+ > > > + | Field | Value | > > > + +===============+==========================================+ > > > + | ``item`` | ID of a packet field/mark/metadata/tag | > > > + | ``index`` | index of outer/inner header or tag array | > > > + | ``offset`` | number of bits to skip during the copy | > > > + +---------------+------------------------------------------+ > > > +