From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0082.outbound.protection.outlook.com [104.47.36.82]) by dpdk.org (Postfix) with ESMTP id 3BD8C1B199 for ; Thu, 14 Sep 2017 10:29:31 +0200 (CEST) Received: from CY4PR03CA0010.namprd03.prod.outlook.com (10.168.162.20) by CY4PR03MB2695.namprd03.prod.outlook.com (10.173.43.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Thu, 14 Sep 2017 08:29:29 +0000 Received: from BL2FFO11OLC009.protection.gbl (2a01:111:f400:7c09::107) by CY4PR03CA0010.outlook.office365.com (2603:10b6:903:33::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.9 via Frontend Transport; Thu, 14 Sep 2017 08:29:29 +0000 Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11OLC009.mail.protection.outlook.com (10.173.160.145) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.13.11 via Frontend Transport; Thu, 14 Sep 2017 08:29:29 +0000 Received: from netperf2.ap.freescale.net ([10.232.133.164]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v8E8T36J025953; Thu, 14 Sep 2017 01:29:25 -0700 From: Akhil Goyal To: CC: , , , , , , , , Date: Thu, 14 Sep 2017 13:56:45 +0530 Message-ID: <20170914082651.26232-6-akhil.goyal@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170914082651.26232-1-akhil.goyal@nxp.com> References: <20170914082651.26232-1-akhil.goyal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131498513692160941; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(376002)(39380400002)(39860400002)(346002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(8676002)(81156014)(8936002)(81166006)(36756003)(77096006)(15650500001)(47776003)(305945005)(50986999)(498600001)(48376002)(50466002)(5003940100001)(2906002)(6666003)(110136004)(54906002)(53936002)(316002)(86362001)(76176999)(4326008)(7416002)(356003)(104016004)(2351001)(1076002)(97736004)(68736007)(33646002)(5660300001)(50226002)(105606002)(8656003)(6916009)(16586007)(189998001)(106466001)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2695; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC009; 1:CW2oar1AeDSjpwezCqTecobUfCNwC2F40oxtuIsRAQcBxPAJBt7J7FzbqIziHJlIfKhRG/RftWd9nJgY7cUP3hhqFqBdFD1xtuW9wCE47hukwglV5GwvxdbNeZbAHvgx MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d3e073ba-82dc-49ff-f3ad-08d4fb4ab793 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR03MB2695; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2695; 3:ZafypnzDcc5eSIZmvTLX/krVrxuvdsTdLDrVIbgydPZnljKNhUr5160oBtsVwEAJ2srgLPXV8Nvl4XGDUxuoemPbIMikeaFcy2X4ejIoCu/XOQsuYX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Mi8fCFFRK3LGRSTseeiDm9qyHwjDVJ36eVtwuZIfLDshLEpltsHQKrj1ZS/x7Hudo63n+c/blGzmw36556/W6iFkQ8dof9UVxMzH5xUrBxIr5FDXjB2Bj2m4+LGgnqjEeqGbM36Ccf+/ZgcTjcPbINoOxJzx63b3T44ETWPTnNEBGtMgPVg== X-Exchange-Antispam-Report-Test: UriScan:(192374486261705)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123565025)(20161123561025)(20161123563025)(20161123556025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB2695; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB2695; X-Forefront-PRVS: 0430FA5CB7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2695; 23:SegPkvFNbNHZCl2VoyH2Iwxq/eDteTwIr7CjuWb8i?= =?us-ascii?Q?v8lYPc/m4hJrXcaviaNzArWoP1bTiUL7erxEmt3/ileBSHX+W9JVYUd0N4g9?= =?us-ascii?Q?FMvwiquiPgwEpDctd/0obPgp1uEDAssBYSWZ3CM0BW6yoymkYWMg1UJ3tkOe?= =?us-ascii?Q?IfONTU0dG8mMFSyIb4yqhkqj32oKSDrO+mqRTnVa+2dNmxgmOHE+GGcQnDh5?= =?us-ascii?Q?t4PZKYZkjinEKfOyWVTgRskeLDMWDAOGZjI9mHxKkC42DzeQDSp8xLCkP9sd?= =?us-ascii?Q?6Xc4UPAVCy3YU3Hkac8OwcHxBPsDy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?= =?us-ascii?Q?Ea0EDwesS0w8rB5Pl9wR1Mt+yyLsFThOLVioJHZ6hD0hA4ixcNbzr+teA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2695; 6:me2p876bth3/esCir7lDAFV32X/c/QkVPSYV+53qBV0S8FTHXZAs0crOw0iascTcVO/RWcQZb8FteZ227u9t/vvwJueiJ0zemYp05WJjFcu96iZMIFBx/C+RXRkbhXbHuRHzIGBCzZ6/yibhB5v/BZyRCFIhH8JQyWSIeGx4PCMDVV97HBOqOwuqtktrIjpRiOZNCUXpTgJdr6vi2UoPJNmwQLmfHHG6LeQUox61Mg/TTDvFFRE1PF4nYtDDQ7ANe2GUj89FJAtUBuw3esOLyi2vna11vcWjH/1xruzveB/VU+6Ca6IwPc855DXKBKGYIJSULRBPIHytArl5IkVGKg==; 5:ROrYj1KMZDFwnUk6xOu2m1JcWMDhGzX2MW53OT4s7K7wLswEJ0tv8KsSXM9vin9a209G73QQ/OcGZSsRY5X65P8+CyX+qaPM/rukDokgQKEZaj/Z3JODJBh2KNUjjour0RWtnwkQPs3YuBCKNk1hNg==; 24:uOM6PKP2SLsKf3f4nGTyZDIBZ4lBgyyeNYrNJbgu6etwJFjecNkyTQWmZfzfSXvjIywFydVJj0qvKFp2rjWbo30aq957TcxVp1p2rXtuW7Y=; 7:cqriFN70QIFCAmFqt62LWDRqSntU+mUDlS9kJlF9HXlJ3m393l2XzD+0eaFWw7dCcL4yermjL2QglHnJDWYaN2TmWl8GM7mcVZ55wDHQ9E94KlX2N+SEx+NObsp1AjYRvNqNNIBHZfqJKXSBIezcwMaT0PcILusfNRyIm0tfL9EsA6PYzG86gRBPd8YENJmnm4yOYNP3Mv3UuPsFmnD7t/k1ODs/ypcgAHxE1E5ZDi0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2017 08:29:29.0444 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2695 Subject: [dpdk-dev] [PATCH 05/11] lib/librte_mbuf: add security crypto flags and mbuf fields 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: Thu, 14 Sep 2017 08:29:31 -0000 From: Boris Pismenny add security crypto flags and update mbuf fields to support IPsec crypto offload for transmitted packets, and to indicate crypto result for received packets. Signed-off-by: Aviad Yehezkel Signed-off-by: Boris Pismenny Signed-off-by: Radu Nicolau --- lib/librte_mbuf/rte_mbuf.c | 6 ++++++ lib/librte_mbuf/rte_mbuf.h | 32 +++++++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 26a62b8..bbd42a6 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -323,6 +323,8 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask) case PKT_RX_QINQ_STRIPPED: return "PKT_RX_QINQ_STRIPPED"; case PKT_RX_LRO: return "PKT_RX_LRO"; case PKT_RX_TIMESTAMP: return "PKT_RX_TIMESTAMP"; + case PKT_RX_SEC_OFFLOAD: return "PKT_RX_SECURITY_OFFLOAD"; + case PKT_RX_SEC_OFFLOAD_FAILED: return "PKT_RX_SECURITY_OFFLOAD_FAILED"; default: return NULL; } } @@ -358,6 +360,8 @@ rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen) { PKT_RX_QINQ_STRIPPED, PKT_RX_QINQ_STRIPPED, NULL }, { PKT_RX_LRO, PKT_RX_LRO, NULL }, { PKT_RX_TIMESTAMP, PKT_RX_TIMESTAMP, NULL }, + { PKT_RX_SEC_OFFLOAD, PKT_RX_SEC_OFFLOAD, NULL }, + { PKT_RX_SEC_OFFLOAD_FAILED, PKT_RX_SEC_OFFLOAD_FAILED, NULL }, }; const char *name; unsigned int i; @@ -410,6 +414,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask) case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE"; case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP"; case PKT_TX_MACSEC: return "PKT_TX_MACSEC"; + case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SECURITY_OFFLOAD"; default: return NULL; } } @@ -443,6 +448,7 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen) { PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK, "PKT_TX_TUNNEL_NONE" }, { PKT_TX_MACSEC, PKT_TX_MACSEC, NULL }, + { PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL }, }; const char *name; unsigned int i; diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index eaed7ee..9ce61ae 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -189,11 +189,26 @@ extern "C" { */ #define PKT_RX_TIMESTAMP (1ULL << 17) +/** + * Indicate that security offload processing was applied on the RX packet. + */ +#define PKT_RX_SEC_OFFLOAD (1ULL << 18) + +/** + * Indicate that security offload processing failed on the RX packet. + */ +#define PKT_RX_SEC_OFFLOAD_FAILED (1ULL << 19) + /* add new RX flags here */ /* add new TX flags here */ /** + * Request security offload processing on the TX packet. + */ +#define PKT_TX_SEC_OFFLOAD (1ULL << 43) + +/** * Offload the MACsec. This flag must be set by the application to enable * this offload feature for a packet to be transmitted. */ @@ -316,7 +331,8 @@ extern "C" { PKT_TX_QINQ_PKT | \ PKT_TX_VLAN_PKT | \ PKT_TX_TUNNEL_MASK | \ - PKT_TX_MACSEC) + PKT_TX_MACSEC | \ + PKT_TX_SEC_OFFLOAD) #define __RESERVED (1ULL << 61) /**< reserved for future mbuf use */ @@ -456,8 +472,18 @@ struct rte_mbuf { uint32_t l3_type:4; /**< (Outer) L3 type. */ uint32_t l4_type:4; /**< (Outer) L4 type. */ uint32_t tun_type:4; /**< Tunnel type. */ - uint32_t inner_l2_type:4; /**< Inner L2 type. */ - uint32_t inner_l3_type:4; /**< Inner L3 type. */ + RTE_STD_C11 + union { + uint8_t inner_esp_next_proto; + + __extension__ + struct { + uint8_t inner_l2_type:4; + /**< Inner L2 type. */ + uint8_t inner_l3_type:4; + /**< Inner L3 type. */ + }; + }; uint32_t inner_l4_type:4; /**< Inner L4 type. */ }; }; -- 2.9.3