From patchwork Fri Mar 24 15:04:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 95957 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp87984qgd; Fri, 24 Mar 2017 08:05:16 -0700 (PDT) X-Received: by 10.55.157.75 with SMTP id g72mr1183586qke.177.1490367916130; Fri, 24 Mar 2017 08:05:16 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l2si2113575qkc.235.2017.03.24.08.05.15; Fri, 24 Mar 2017 08:05:16 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 53E28642CF; Fri, 24 Mar 2017 15:05:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 8BEBA60D39; Fri, 24 Mar 2017 15:05:09 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2A2A960F59; Fri, 24 Mar 2017 15:05:06 +0000 (UTC) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40123.outbound.protection.outlook.com [40.107.4.123]) by lists.linaro.org (Postfix) with ESMTPS id CF76B60D27 for ; Fri, 24 Mar 2017 15:04:59 +0000 (UTC) Received: from DB6PR07CA0018.eurprd07.prod.outlook.com (10.175.239.28) by VI1PR07MB1005.eurprd07.prod.outlook.com (10.161.110.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.2; Fri, 24 Mar 2017 15:04:58 +0000 Received: from DB5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::205) by DB6PR07CA0018.outlook.office365.com (2603:10a6:6:2d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14 via Frontend Transport; Fri, 24 Mar 2017 15:04:57 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning linaro.org discourages use of 131.228.2.241 as permitted sender) Received: from mailrelay.int.nokia.com (131.228.2.241) by DB5EUR03FT042.mail.protection.outlook.com (10.152.21.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.7 via Frontend Transport; Fri, 24 Mar 2017 15:04:57 +0000 Received: from fihe3nok0735.emea.nsn-net.net (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v2OF4fag018379 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 24 Mar 2017 17:04:41 +0200 Received: from 10.144.19.15 ([10.144.104.219]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id v2OF4fE7018344 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NOT) for ; Fri, 24 Mar 2017 17:04:41 +0200 X-HPESVCS-Source-Ip: 10.144.104.219 From: Petri Savolainen To: Date: Fri, 24 Mar 2017 17:04:41 +0200 Message-ID: <1490367881-16266-4-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1490367881-16266-1-git-send-email-petri.savolainen@linaro.org> References: <1490367881-16266-1-git-send-email-petri.savolainen@linaro.org> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:131.228.2.241; IPV:CAL; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(2980300002)(189002)(199003)(9170700003)(33646002)(50466002)(5003940100001)(50226002)(6916009)(81166006)(47776003)(305945005)(8676002)(77096006)(38730400002)(106466001)(8936002)(2351001)(105596002)(110136004)(48376002)(2906002)(53936002)(50986999)(86362001)(76176999)(22756006)(189998001)(36756003)(2950100002)(356003)(5660300001)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR07MB1005; H:mailrelay.int.nokia.com; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB5EUR03FT042; 1:ssSVncWIXLqX7ZjKnyKyVFukODcHyDU9T6pH2Q5Yo4qTecKLGlpXLaTL5ICW3MS/tpCz31lq7LoT1C3YsPNjJ1eY9N+LkzOWc+bk3bvAUygEVTKmtKNLYoUhbimSOZqUAhTrlZczc2oWXolXO+0tw9ehfe5fio6tagj0ZeLEoX+WcWYZt8AALHPTgTHfJRk2cqQgz/10xutwAY6PMBxO7Kis/Eb9x4sBw3Bh0Hiq0UqXarU4iZEfnUFV3MyvaYWMhy4DEMUpNP5JWiwIqIcOPj/8VGIdH1y4rtlsuXrNqbIy5Gq/zQcJ1zwZcUYWLI0GVtP9Zw3TFKXaRfaoBkiBjXZtLVRbheNH80GaXDSue4fgvi9CZEolb9cszrId+zIhgdqoQLjQV1bN91yWI4GOR4MnjnOswjPypNcqnZrxxOsKGo/KzDnuNRvZEhot4Z+sTKALLJqJjHg6g8tXpg2Z6npqZ64LORSr0UOX/s40yN+yd2r7wnL6aZ8TJa2MdcBB MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: e7ec8322-2a4f-4698-df2b-08d472c7230f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075); SRVR:VI1PR07MB1005; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB1005; 3:G8XTCs6ZtOnG8Kl1lZ8PEg7TPPecG9TvKsBuZtmgB1rbsMDSLeWTXTsmj4wpMpoFKHk48yUbQr6HwpP9Qm+JaOa1TzK6/bKRcg09GCA1XB5eCb7C47pExs3PCA0lPPiURuE3OIGWK89QIo41HoPdWWqZFcMVYIS0+u0eDAAklF8v9vMVWr0QfqJV/NMfvUBo11TX71sNTsx6CuPTyH96Ni8faBN4ggWOu2lazuTwZ3B7j9C4BL0bEHoOdHc+KKNfdjBwLG8WEX8jlCLGdotaVfDHAUNBqqe7P3Ui2GbW00Ye9dq0BM9pVywr0XEb7uXimgqTPRlvo9LK3SuRL8sONDM77LaYtOkDqo3Gs1pgVxR6x2tqM9R+8ToZiQ1OWavaz4LlT1kN5q+m6mTlkjwLQA==; 25:MK5DPpjLU8q1++fM1QFKXxpQsxTI+PrvHVDGpDaorz8xIO6swrMQ1cWj3S4GHLIe53XbjJeYIN4OKkUOfc6i6jQkpf/dUWmDPatH8q98zsmOHUUx3bXx8ToLCysY5LKErVBmUMMy+ZsrRN8SorZ7Z4U9jSo0fqGHg6piSs/OdmrxwPomj/QYp8xKvD6aFEK6N22RTRnYyOtpDgm2HVj7HTRWYQHqtvOL4sPKZZHZnnfJRInoTCTLgJJHomWUTSIUaaO3tMhZuZJVCZRG6lk07sspkumE5NWb+0c7aXNfN8CNAR2uB0y44FjR34tZpzSLsefBMKKTshYmZGFZOlFVGPscLGnA4WnnrCYr6NUyw7t3SXCaBxOuMyiUBT4Ltk0vTzwgRLFnDD8kmZgTjtf6a5lkAlkmgj/68gJvwXKGbfSZgaKFguLZjFibC/D+4kRAxTWB8e2RF6OBQihTJgFRhg== X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB1005; 31:sttGTQmfx+N/YLtqsUfFJB8I1tHpXHT1r00Kkq4xnSNgtQcORLlSQHdRO7I+LJjd0BdVIrsakBDfV9hWH11SpPzUl+k/8u/ORE13GkQ8n6HUyxfuGz1BrE5D4VOr5aVnHoRMz7n4ccAQaZXjdsmFD19YRPHbRYCDHk3WWQAndbMe4yu7VXwjHwFmt97DimYQiMiDsKQUp79K94C3qNnkj7lfKeh6oyGxLNo2LPtOaKEJXiAjfoS7MwBroofb+6W/6j9vF4qQpBMf9YWZGKQ00riwM2L+kYVVrzlR3EGKynY=; 20:X49E1jQYIacbxCOMbbfce36H9AyJD9an1I3m3+1KLx1pMqfd82Tc0a9H1bB5eemrlIrAIOq3HpP8sPSoC7abDhsococ0dUp+FAt3GSjUZes6kMhnrUd97RtCFMrME1dVkW/3LJQaYsNsWFJ6fF+x/gh8jnB6W7u4DNL3lWOUDUyQ+BYAjTDVxc6PWbGW8a6ak/N39cGIJaC9vGgqQ1KCmNlDJAI7g70V3lATaEmZelSH5zm7rZ2vCHlWCxERxs1PMczZsXIyyQs0vFPfqhnW0xe8ghPuLAnYhGG3XQwuPUUxqJBFTgJGk0dI3whxXiEqV5XVOHexhdDLt67k9kNj8g2Q4w6tnFW85FBMI6QT0myoLN2tn1Hu0Kt7qlfqXt6//BkBmdBdP7YLEora8MjweU+vTbTcFivlc5CpMNCabC23Yp3U5Jn60/jwXzf2nqLH9mG33Z4YpGY3QFblA86ag7YzdCPqhgeN9R4P5PHGP8DagFQdTESJ13ik5XB3+hH2apFYXmJTpKCfQBJB6ydb6h51joW17mEwomUlyHnBXizMoeLMlOyL4aDm2P3iV3RuOruUAX1vDq5kLJ727fRBOUtbn2cONmIEkiTmCETtjio= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(13023025)(13021025)(13013025)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123560025)(20161123558025)(20161123555025)(20161123564025)(6072148); SRVR:VI1PR07MB1005; BCL:0; PCL:0; RULEID:; SRVR:VI1PR07MB1005; X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB1005; 4:3+R7qnBvTFUKDP4akpIDbhpqTHDarctZEfNX142EqR43ylrenUzjfeLqfOdIR87KlmWe2yYU/rsVOjr62UIIjv184obNbfVkoX9NSoir9J14HSkE9sQLatqEH5niln9j1gabbukMzbq+tZezkNYYWFVwi75L5kAro9Yc8LcTZvfX7jN8swKnjNY/iTYYUBcl6mgopSZqVhiwtVwGidwTdnUgBGg9S4rRRKzEnmdCGivU8L7pubbWu0Pt4SDkymKl/lnBJtC/s5jvzKVz5Strs5/WOSg/A4swD0fY4Ywvn0+CmAOQYeTxKYML9yM/7mgeUqGF7kYJKmcPKNikrDi+xRhCDoSCTkqgnx2VMA833pjB/peu89VKZJUJJAtsZcutkkcUzBDpkQD46bcvm9mA0tcGNogaDRXlwoCSHcWLJAWu220fA5UBnJh0SWI4L8Za0+r8cFSCdlIb5LtyutBTCMk8dm8UdWRENF+ZqhvRmS13jcWCKwIoblKlaASMTITMGxB3eGkZaebtFAmekJoTK42cvx6xOafcn7Ow6kHDNQwwhbvCQeybXPgOhKXnn99dki1pgvyh+pWqH84gf6dXNdCVrBpBygtDs8oR5Jj7wIIhJoJ2IfD/dm5fBe9NjwKQ5PMSpgYP49DDaN26xA/IBtyZdvWthZk3IPUAwWGy5RNTZQ2ys4iCvqObJTQjGF3d X-Forefront-PRVS: 0256C18696 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR07MB1005; 23:cUy96QLCTSi4u4B2Tap4TEhspAjR99SPITfelZHC7?= jpFdJIsGs33c6ejFWmPm1v3Xh9466E8BP8j0ylzFXXjxkToaraW4Ea06vuDi2ug1W7aux8q/ry2OwdwO7klh/LYh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dNxSysAo+jm0wCztjOxgS6UmxrHAn2YeuVxuXAgyZ31SsAlFpDyUr4USKu0cm0kn5+89uHnGUHGVA9M4WEuQQNQHXPhUWBzo0ZcCWGuyvSQXw0zU+Pgye4cnuLOqbvQ1GawNXXv/CdyM161v50hvgvZKZikO0+HRzJnVK+j8W6pYUHbNFMsvGqpPMmyBNKwmClL2wU29popP0aVBp0O2y+j9BAdOqOXhu7QxHMp7NZsi5VvystQmEYYPQ7c/dSHgdUULe3nEvIc=; 5:IlQ/jts3kRbC2V9Bvl330jff8F2InPi23ny9WMMFhnyvtb1FdagP5IcLkX159qh1Jgsc/1sDevP43t2JeGGHlOFdHrX2BMGwZnlaeuAqpGvm7oaT4R+ROelNL8cPsTb5Zs0JHCI7RqIl5HEhTYYAEQ==; 24:S9eGG6N97IHs9ACznOnAkh/lIoffkTLyShuJOJzmDGHI0NFru8Wfr8gkwLALskyg00e1kW/juJLayM+PmsC1o8W56eE2kIF8QPMbYa7mCEQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR07MB1005; 7:ml65d5QQM8cBmBRV4G6bg3A9pEA7ePb1ZxbAfg/jBFwCEq5+OF6u3fWF35Zvg14Kpxq2zPLLKGUcRFQBbvHu5A4mhaV0RFb4EpBrnbKllK1aST0bMY5+WoymwSC19ziWQrMw/VJ4DWFFDuLHoYD9I6c4EWGT14kYQ30ztjb7yPObx76foXenc/Y4uWP1nZkyIXSRb0Lgy9AVqkbE6YjXCz0DXm68hg3mihpa2d70mhgwMg460n9L0y4NQQVESwAgQgOuOCTsPqRjJBfVJIL706ChQOzH+AyYPY/w9plP7KLztsPWNZ6R7ZuYWXJjGmAA1LXf0f13XEu5FbFYfY71Sw== X-OriginatorOrg: nokia.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2017 15:04:57.6508 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.241]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB1005 Subject: [lng-odp] [API-NEXT PATCH v3 4/4] api: packet: add per packet checksum control X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Checksum insertion has pktio interface level configuration options. Per packet override is needed for example when L4 checksumming is enabled and application forwards packets. Forwarded packets need to maintain original, end-to-end checksum value. Signed-off-by: Petri Savolainen --- include/odp/api/spec/packet.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.8.1 diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 92c35ae..42ef51f 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -1366,6 +1366,25 @@ uint32_t odp_packet_l4_offset(odp_packet_t pkt); int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset); /** + * Force checksum insertion + * + * Override checksum insertion configuration per packet. + * + * @param pkt Packet handle + * @param l3 0: do not insert L3 checksum + * 1: insert L3 checksum + * -1: use default L3 checksum configuration + * + * @param l4 0: do not insert L4 checksum + * 1: insert L4 checksum + * -1: use default L4 checksum configuration + * + * @retval 0 on success + * @retval <0 on failure + */ +int odp_packet_chksum_force(odp_packet_t pkt, int l3, int l4); + +/** * Packet flow hash value * * Returns the hash generated from the packet header. Use