From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0078.outbound.protection.outlook.com [104.47.2.78]) by dpdk.org (Postfix) with ESMTP id 691E61F63E for ; Sun, 10 Jun 2018 10:22:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0Le/LCoSK3t0cyWMSbETSCMdbNY2iMM3DLHhmuf79xY=; b=slfCDvOOPAbFc8MVNE5vdPE5ovdwy79payowZCOq6pSCzZsXMB78Tn+3Wi9mF+wTKIlqSB2LAGKJ50a/oG1/CTeY3Z846VGWGL1DGqU4KIOgWYzsRdIO0T0yjo4G8KV9wDWdZq0tp96+yL2ypmIL291VLhr618ep4TjaeWbXCxI= Received: from localhost.localdomain (141.226.120.58) by DB6PR05MB3429.eurprd05.prod.outlook.com (2603:10a6:6:1e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.17; Sun, 10 Jun 2018 08:22:04 +0000 From: Ori Kam To: ferruh.yigit@intel.com, declan.doherty@intel.com, dev@dpdk.org, adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, orika@mellanox.com, shahafsh@mellanox.com, matan@mellanox.com Date: Sun, 10 Jun 2018 11:21:31 +0300 Message-Id: <1528618891-978-1-git-send-email-orika@mellanox.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [141.226.120.58] X-ClientProxiedBy: AM5PR0701CA0055.eurprd07.prod.outlook.com (2603:10a6:203:2::17) To DB6PR05MB3429.eurprd05.prod.outlook.com (2603:10a6:6:1e::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR05MB3429; X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3429; 3:SiHEoi5+/NafKa4tV5MdicRRbflg9Fcjg6UNkVwQkptU39Fxv5yWX8ASYyvZJh3TjSO4MMXDRalmsU3w0QSWofNp8IzbWGMd/iEmtUiu/Tlfnk0XfyZLz3S9MWpFOl66nBrnxekuZdakeu6fR4Jp8sBVLHUgPcva0f+cVIqZ2OJAre0ODercnRIBAOD0DTYg0DE92hjuh4HF+6ktNLcYNq140eZzyCpp2YvHcZznUSCDGD7yQpVu9d88yIH9gzk5; 25:5kbUWTNb+if502zxtG+P9PS+4B50tlGK7dD7Xbb+1/3YEPPnb1s5MTnbDfDlVqoLwKkv9OTncJikWD01ElOC5zm1jb2buppalwKs/ZvZPImHsXKrd9sBfxxXv/XGmeF3KEopEmNIpoark0tTtDgGJ+CR4fnnX3ZBDykV9V+RD7LBnlLhsm7qpcBSbp0UwwbAp9vMd1wqvZutxLxvoOUDxyfwraEldI+Dw1s7PETE3u2nLevJopKcPuwILbthYtiDvw837kSqL5sGfSONtyz+mxPfo+wvU53ObW4UNbleg0J0f2R/9t6sLjjaM/OZeh/pGZphlTS8Ss/IJgE7euDBoA==; 31:FQ4QVD3wnFmLytiPkryDKXBHcwgAkbAcKsTAiQU4YpL+c9qneovlpqO1JsHtr4NdQpQ5jLgyVmumsYV4D+DjPg2r/NV7KIWqmWszCznFfCvrdED53EsrQ3I1UtKXLdY4Fd0EnRVAfwMDXxkKgl2sddSjI53VlzLIrLUPZ+fSDIPLYquWFMK4bStTaMvr/vIZ2yafRBRZtrPNQgRzGP807sFH9N2Km36yQljnxMPlU88= X-MS-TrafficTypeDiagnostic: DB6PR05MB3429: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3429; 20:x087RRCpap6+QSX3taBAR7kqv5Rkw4iVbpr9iVR88BNvFBq5oWYz/rMvduHUAwL7oNwuLYueAnLKC4K7rV1V88QL/N/XvNhwsJnKvnCUuGDtRvpooolJQQP1Rr0K1NDCH/ZtLbF0aPHc3HoQSJKxvWcgL1RrGYmuntvhFv9XfySgMm0v4Rlj2/XG0zGT0pZ7JTn87JWG6LvlaNGgFx3m1ipVP/T7kpg1tUfGwwjGLE+JRrEjoDQZd/0bl4G3ESNdBPTWSmfmCcioFKvDKDCh2tvEG7Pd29oyoSBN3o7ux+VyTtS3nTSCbJe9yzpB+FBFNHDPG6r/ZemeGIYeWCuUwBEE5T5v8IOCciil02uzISkcW5G4qgrkV/sZogVFbeuWMTgON3uNFJLH0PIK5TCy9eCW7GUCPzGoell3NDwnqoGLVFSGM9r8AIsZ7a9pQd8bjVAMetap2S1bcSi5s2rC36/r9SawmgE7naXXuI8X/cpW0MfW6eRBG6MPIb23YUqJ; 4:5kwo77LGVhP60lDt1gRWjHwrtsfOSU+Lj46G8qa5nT+aRmVqPUFYPvIyaYiP5LG/6LxjCYq3lt6sKdtxyeUaox0RPvx/zWxtZ1Si+1YzkW7RHlEi3HDkaqTHQ7S8QPgBmH63e6xXcXrAD6XCZMzUlVUlQ2TakOfZL6tqoreUXc34ezWrZkgOpelbYEXgr6HkjJSYmYiDbPz+i8hwKztah5hZ+WJVPPd/9aRVH+VWw55FsQVXssn5Acrxj9lFCguKUbb469qHOeM/4N0zDThpbQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DB6PR05MB3429; BCL:0; PCL:0; RULEID:; SRVR:DB6PR05MB3429; X-Forefront-PRVS: 0699FCD394 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(6069001)(39380400002)(396003)(39860400002)(346002)(376002)(366004)(189003)(199004)(48376002)(47776003)(966005)(53376002)(66066001)(478600001)(50226002)(8676002)(6636002)(81166006)(6486002)(8936002)(81156014)(6512007)(6306002)(97736004)(305945005)(68736007)(7736002)(2906002)(26005)(52116002)(51416003)(5660300001)(486006)(476003)(16526019)(106356001)(6666003)(2616005)(186003)(6506007)(386003)(956004)(59450400001)(50466002)(16586007)(25786009)(3846002)(105586002)(6116002)(316002)(53936002)(86362001)(36756003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR05MB3429; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR05MB3429; 23:8RM4xwYQdo4LrPMna5wB5dfGTsofUfREWRDJkxWo1?= =?us-ascii?Q?TBUy9f8mirp7iOIpw0gtATEy9B99hv6St/7/nVQZac1A0kfaf13TtqL4N/eh?= =?us-ascii?Q?XFReqqOQ5qZWx/E9+dJvHyBn4vlp1Qy15A94ky0fHXjVW1izlFgscpGYeuB+?= =?us-ascii?Q?rKu4MdIpUNUpYGeYTVrURcw4SfmUq7WRbxslP2Sc2JXlKnEG65YaXTDurnI+?= =?us-ascii?Q?okX8elFc44Kj3FzT3uc9iipcq2ehGOrXET6fOh6DAgEBKRFHX46EUqyJOyZH?= =?us-ascii?Q?KzAe6QdMa1RCjxOWEq1vLbGuA2S4NaX1uuPGt9GWowpA7UU7XZgSKrdv4n0j?= =?us-ascii?Q?Cb+4sOo6YJUj+ksoEnzmcIcFDEQeKl0DQerbwrP4Rz9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nPetYmM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3429; 7:y/cLmAtiyxh9rQdleoLPLaJUplivAnS0hzlWjiVBsj8YdgA1onX8lO0YVT/5jOrL/03AqgfDRQ8Sw8+8uHCDyyWkjSoyIZ6OjkC3BFkaii982E89rNzzeOj1lC/I9uCeVn1qGydLXQcoY/wh2+nhy0XNg10+woOtZG5iPZI7uNr8idNFeEg9Um5upEYrhfpzVJ/I08bdIkb1GhKeJatohIWwDpgT6Z9U3n6okXKimjuv/dfVL+zYgHW3PLVRaOGg X-MS-Office365-Filtering-Correlation-Id: cbeab233-c37c-46e5-9fde-08d5ceab4031 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2018 08:22:04.3579 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbeab233-c37c-46e5-9fde-08d5ceab4031 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR05MB3429 Subject: [dpdk-dev] [RFC] ethdev: support MPLS tunnel encapsulation action 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: , X-List-Received-Date: Sun, 10 Jun 2018 08:22:08 -0000 Due to time risk and to enable more discussion over the proposed generic tunnel encapsulation [1] This RFC only adds encapsulation for MPLS tunnel type, which is based on the current tunnel encapsulaiton actions. [1] http://dpdk.org/ml/archives/dev/2018-June/103485.html Signed-off-by: Ori Kam --- doc/guides/prog_guide/rte_flow.rst | 54 ++++++++++++++++++++++++++++++++++++ lib/librte_ethdev/rte_flow.h | 54 ++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 0 deletions(-) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index b305a72..e40f9fe 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -2076,6 +2076,60 @@ RTE_FLOW_ERROR_TYPE_ACTION error should be returned. This action modifies the payload of matched flows. +Action: ``MPLS_L2_ENCAP`` +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Performs MPLS encapsulation action over L2 inner packet by encapsulating +the matched flow with the requested MPLS tunnel as defined in +the``rte_flow_action_mpls_l2_encap`` flow item +definition. + +This action modifies the payload of matched flows. The flow definition specified +in the ``rte_flow_action_mpls_l2_encap`` action structure must defined a valid +MPLS network overlay. The pattern must be +terminated with the RTE_FLOW_ITEM_TYPE_END item type. + +.. _table_rte_flow_action_mpls_l2_encap: + +.. table:: MPLS_ENCAP + + +----------------+-------------------------------------+ + | Field | Value | + +================+=====================================+ + | ``definition`` | MPLS end-point overlay definition | + +----------------+-------------------------------------+ + +.. _table_rte_flow_action_mpls_l2_encap_example: + +.. table:: IPv4 GRE MPLS flow pattern example. + + +-------+----------+ + | Index | Item | + +=======+==========+ + | 0 | Ethernet | + +-------+----------+ + | 1 | IPv4 | + +-------+----------+ + | 2 | GRE | + +-------+----------+ + | 3 | MPLS | + +-------+----------+ + | 4 | END | + +-------+----------+ + +Action: ``MPLS_l2_DECAP`` +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Performs a decapsulation action by stripping all headers of the MPLS tunnel +network overlay from the matched flow. + +The flow items pattern defined for the flow rule with which a ``MPLS_DECAP`` +action is specified, must define a valid MPLS tunnel. If the +flow pattern does not specify a valid MPLS tunnel then a +RTE_FLOW_ERROR_TYPE_ACTION error should be returned. + +This action modifies the payload of matched flows. + Negative types ~~~~~~~~~~~~~~ diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index f8ba71c..6edce68 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -1505,6 +1505,23 @@ enum rte_flow_action_type { * error. */ RTE_FLOW_ACTION_TYPE_NVGRE_DECAP, + + /** + * Encapsulate flow in MPLS L2 tunnel defined in the + * rte_flow_action_mpls_l2_encap action structure. + * + * See struct rte_flow_action_mpls_l2_encap. + */ + RTE_FLOW_ACTION_TYPE_MPLS_L2_ENCAP, + + /** + * Decapsulate outer most MPLS L2 tunnel from matched flow. + * + * If flow pattern does not define a valid MPLS L2 tunnel + * then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION + * error. + */ + RTE_FLOW_ACTION_TYPE_MPLS_L2_DECAP, }; /** @@ -1868,6 +1885,43 @@ struct rte_flow_action_nvgre_encap { struct rte_flow_item *definition; }; +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ACTION_TYPE_MPLS_L2_ENCAP + * + * MPLS l2 tunnel end-point encapsulation data definition + * + * The tunnel definition is provided through the flow item pattern. + * This action includes both MPLSoGRE and MPLSoUDP. + * The flow definition must be provided in order from the + * RTE_FLOW_ITEM_TYPE_ETH definition up the end item, + * which is specified by RTE_FLOW_ITEM_TYPE_END. + * + * The mask field allows user to specify which fields in the flow item + * definitions can be ignored and which have valid data and can be used + * verbatim. + * + * Note: the last field is not used in the definition of a tunnel and can be + * ignored. + * + * Example of valid flow definition for RTE_FLOW_ACTION_TYPE_MPLS_L2_ENCAP: + * + * - ETH / IPV4 / GRE / MPLS / END + * - ETH / VLAN / IPV4 / GRE / MPLS / END + * - ETH / IPV4 / UDP / MPLS / END + * - ETH / VLAN / IPV4 / UDP / MPLS / END + * + */ +struct rte_flow_action_mpls_l2_encap { + /** + * Encapsulating mpls tunnel definition + * (terminated by the END pattern item). + */ + struct rte_flow_item *definition; +}; + /* * Definition of a single action. * -- 1.7.1