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 9C1B4A0A02; Thu, 14 Jan 2021 15:00:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F8951412B0; Thu, 14 Jan 2021 15:00:00 +0100 (CET) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by mails.dpdk.org (Postfix) with ESMTP id A2BEB1412A7 for ; Thu, 14 Jan 2021 14:59:58 +0100 (CET) Received: by mail-io1-f52.google.com with SMTP id u26so11299187iof.3 for ; Thu, 14 Jan 2021 05:59:58 -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=wJCl4J/eDH9FzpXEZKaYst8eErYRY8q2gdf/8ntMIvM=; b=ngeTC9Wegh59+fDF+fi5GtTXSskeo5JpBQ39L6fHM0yKYgUsPS9p5ktb1nOeayukBi XvWvucfacJH9s1XtPjnL0/Xmh5uvK47BSXjdsJ/o7seBQdbgsc4KsMbGlrnMfcYM+d/8 ydFauxDe2egQeU8RoTxYaGonighN/x34GCqqyfDuCzjTiKXQpAW1BkKIr8eV0+n56ehv 4Hp2ZNrwlk1fyA58rQruqqtjBy0TqJoYkEhUvw+EM737CUKjWQbjjbDQl77khDxMybDE j1W2uxgqSOa0oS8zOMkRqEv4Js1p22inf6SwJB2ehL+900//xjzOFKVJAco4cQm+EIIc qyVg== 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=wJCl4J/eDH9FzpXEZKaYst8eErYRY8q2gdf/8ntMIvM=; b=Vna4fE/45xn3neP2ui1cFow3gAgmj+hIA9MpnqXW5STAGpR7yyKUIOYNRIjvpN39DB I7q68Tx5mtUXQ21NqeN3GbBVZ06qA/6VOMcESk8DhQTwTkCebf4K7J82NZ9r7hHHkq3Q VCR2zUQhMnVw/uM2GbRjJ5ey7Y7HbJY4larPCiis6ToaWTrGJJxKaUbZ84qx2/cWuI8j roK/6YPbXYvu2l7lbAYSu2o8zoQ1Md+cZLz+pVtgwkpVSVnIvWwx+glpAt16TfigTa05 yTUAwGapqOaCqD3r1zP9uYYSSvY75Qrh8vXjm13v8V9be/edKdbVNCTrHHRxHoOE2N/Q zZCw== X-Gm-Message-State: AOAM532eoWJlEDbp6j+uDeyg4P/QMpwbMjHx+Z4FohyLjgr8XSd+mA1p 3NAwjS8smSkdiIvWqk2w8aiRR6hiKGsnE9bpZ+8= X-Google-Smtp-Source: ABdhPJyJ1KQN7X66gpNJ+aqvdvJYJ/ED30LeFOQYQcoTx0RAzumf0PfUW2LrPzK4jp9IROxlPGnF4BLegyB/pkYkO0M= X-Received: by 2002:a92:1508:: with SMTP id v8mr6343193ilk.162.1610632797884; Thu, 14 Jan 2021 05:59:57 -0800 (PST) MIME-Version: 1.0 References: <20210108063234.7679-1-akozyrev@nvidia.com> In-Reply-To: <20210108063234.7679-1-akozyrev@nvidia.com> From: Jerin Jacob Date: Thu, 14 Jan 2021 19:29:41 +0530 Message-ID: To: Alexander Kozyrev , Cristian Dumitrescu , aboyer@pensando.io Cc: dpdk-dev , Viacheslav Ovsiienko , orika@nvidia.com, 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 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: http://patches.dpdk.org/patch/85384/ > > 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. > + +---------------+-------------------------+ > + > +.. _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 | > + +---------------+------------------------------------------+ > +