From patchwork Wed Sep 6 13:00:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 111769 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp833092qge; Wed, 6 Sep 2017 06:03:09 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5Ojiu2WproYBBdhrxPeTFFY1u7TxX+ACEPvBtQn4DF8w2p8GFVt1lhN4a1xvWqAC0B6qMy X-Received: by 10.200.28.123 with SMTP id j56mr3261101qtk.299.1504702989680; Wed, 06 Sep 2017 06:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504702989; cv=none; d=google.com; s=arc-20160816; b=Hs+UDkgCN+2Gl+6zVFIz8Fie/1h+HFpxfNagRWHjyT/F1MSUo2k53whez6sEbiLKeI V7ZL8BIGMElUFMFaNKJov6bOOcy06PFs4Z1B+mYdBzdWO4jJ4EGSkb/8a+eDQUteZaXJ MwQ5PD+bwG2AA9h9J/jlu5NkNxnhcfbRHoQsrV5vvzkAncVW+SWZda6xhZcQhUbrPELl +yvgpbAhILJJcv7Sut072wdu3XLZMlPftMGJCVSV8XG1ZN+KxLWWvBJMmawbXrdMfKPf 6IfaaYfaArnTMACkhNc80o+tU4c+YWfEi1cwykGQ+iGRzcR/5P8GzZddeQQODpIkxbul mpcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=nugDkFq2on7RI9VEeIbNaSydbryNT0t+XbUbU7ACalM=; b=oqsp078WOrwYRsFJvE+2QR9SBDvshTYgtFr58qvBNdUFKpqwKlqxA+ww+XW9wTSQgA n3qmXdMZA9a/HwulYRq5jQxfX7+cr0yTxcYw5s5hAzP8aEWhx9PJ5os44nXA41OU7GuA ufHxDuvuI9nD/2WfMGbBqUbgorHBAH8HBNeftMqnvKe832ZrA36UN/SquaoFDmJcjIFT tCKrxOXS9s8peg24G0mPOuMCXPXBl2T1/phGg4d1W6ofEWcGyUSr5d13T8Gyd8Pm/9ZQ LagNefvUlpM3P8dPOaNfeC073+xucYdqqNLF0b/XI81YURjQdHkoveK/JotX6BFFZQex Yqag== ARC-Authentication-Results: i=1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d18si3135622qte.200.2017.09.06.06.03.09; Wed, 06 Sep 2017 06:03:09 -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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 1ABF164493; Wed, 6 Sep 2017 13:03:09 +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=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 867CA64467; Wed, 6 Sep 2017 13:00:46 +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 9E69F62DF4; Wed, 6 Sep 2017 13:00:29 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id A2D1361057 for ; Wed, 6 Sep 2017 13:00:19 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 438712D8450D for ; Wed, 6 Sep 2017 16:00:18 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id LpUAo3HoFE-0IeO2UvH; Wed, 06 Sep 2017 16:00:18 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rJPyfxy80y-0HouUWMH; Wed, 06 Sep 2017 16:00:17 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 6 Sep 2017 16:00:05 +0300 Message-Id: <1504702806-13800-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504702806-13800-1-git-send-email-odpbot@yandex.ru> References: <1504702806-13800-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 167 Subject: [lng-odp] [PATCH API-NEXT v1 2/3] api: packet: add checksum status 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" From: Petri Savolainen Added functions to request L3/L4 checksum check status for a packet. Even if checksum checking is enabled on an interface, all packets may not be checked - for example L4 checksum cannot be checked for fragments (before reassembly). Also it varies how e.g. IP options affect HW checksum capability. Signed-off-by: Petri Savolainen --- /** Email created from pull request 167 (psavol:next-pkt-checksum) ** https://github.com/Linaro/odp/pull/167 ** Patch: https://github.com/Linaro/odp/pull/167.patch ** Base sha: 4eae04e80a634c17ac276bb06bce468cbe28cde0 ** Merge commit sha: fb1526ce83d639bbbd28205b31145e0e15153508 **/ include/odp/api/spec/packet.h | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 95f5349b..b3e1449f 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -83,6 +83,22 @@ typedef struct odp_packet_data_range { } odp_packet_data_range_t; +/** + * Checksum check status in packet + */ +typedef enum odp_packet_chksum_status_t { + /** Checksum was not checked. Checksum check was not attempted or + * the attempt failed. */ + ODP_PACKET_CHKSUM_UNKNOWN = 0, + + /** Checksum was checked and it was not correct */ + ODP_PACKET_CHKSUM_BAD, + + /** Checksum was checked and it was correct */ + ODP_PACKET_CHKSUM_OK + +} odp_packet_chksum_status_t; + /* * * Alloc and free @@ -1378,6 +1394,34 @@ uint32_t odp_packet_l4_offset(odp_packet_t pkt); int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset); /** + * Layer 3 checksum check status + * + * Returns the result of the latest layer 3 checksum check done for the packet. + * The status tells if checksum check was attempted and the result of the + * attempt. It depends on packet input (or IPSEC) configuration, packet content + * and implementation capabilities if checksum check is attempted for a packet. + * + * @param pkt Packet handle + * + * @return L3 checksum check status + */ +odp_packet_chksum_status_t odp_packet_l3_chksum_status(odp_packet_t pkt); + +/** + * Layer 4 checksum check status + * + * Returns the result of the latest layer 4 checksum check done for the packet. + * The status tells if checksum check was attempted and the result of the + * attempt. It depends on packet input (or IPSEC) configuration, packet content + * and implementation capabilities if checksum check is attempted for a packet. + * + * @param pkt Packet handle + * + * @return L4 checksum check status + */ +odp_packet_chksum_status_t odp_packet_l4_chksum_status(odp_packet_t pkt); + +/** * Layer 3 checksum insertion override * * Override checksum insertion configuration per packet. This per packet setting