From patchwork Tue Aug 11 18:31:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 52321 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 1EC2722FEC for ; Tue, 11 Aug 2015 18:32:16 +0000 (UTC) Received: by wicja10 with SMTP id ja10sf27210535wic.2 for ; Tue, 11 Aug 2015 11:32:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=g1Oa/3fqISaE7rwXyAmFL6lkd5D7qAOuP0ekMnYLf8s=; b=k21I83udgdB8vIhzitqgkl5crQZofSMNxZAvUAdLzfqGe5+OoD3KQ4+wbqBt2kCa7r d06Gz8kN0M/AyOsq3cnYXzHgmoDgD/91i6c85MlnO9a+YW4ET+8h7eigj0VYNHcO2Srb 9fzaadvor5nLRK2LFaLeA0lgp1qmvZMq6/06F1ypvbcd/SaAhD4ts6cMHkgXw9ygDjQl W8M/Gl1nOSgmiLXeu81ZnWK2uMQwx4o3/WInNB3PMFAB9om1EDAHGFElEfc7g7S7P1va pqcjTqkdsJNJ6lpfXDxG91XaPX9pjvJ+Z9wKg5qO4cPJgQ8+BaNIw+lTXTMejwKMoaiD 58LQ== X-Gm-Message-State: ALoCoQkZSrEFWFvAm1ZZpUVBHxZ6upJru8OvU1dhTybMN3Daz2ubJYAm7pZqK8rs9UjroEoPpjTa X-Received: by 10.112.161.35 with SMTP id xp3mr5398758lbb.2.1439317935322; Tue, 11 Aug 2015 11:32:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.185.67 with SMTP id fa3ls841345lac.76.gmail; Tue, 11 Aug 2015 11:32:15 -0700 (PDT) X-Received: by 10.112.85.204 with SMTP id j12mr27344218lbz.47.1439317935043; Tue, 11 Aug 2015 11:32:15 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id 7si1949770laq.112.2015.08.11.11.32.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Aug 2015 11:32:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by labd1 with SMTP id d1so62388444lab.1 for ; Tue, 11 Aug 2015 11:32:15 -0700 (PDT) X-Received: by 10.152.29.132 with SMTP id k4mr7774845lah.88.1439317934822; Tue, 11 Aug 2015 11:32:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp2689120lba; Tue, 11 Aug 2015 11:32:13 -0700 (PDT) X-Received: by 10.107.153.206 with SMTP id b197mr35502477ioe.71.1439317933841; Tue, 11 Aug 2015 11:32:13 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id vf13si2233524igb.16.2015.08.11.11.32.13; Tue, 11 Aug 2015 11:32:13 -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; Received: by lists.linaro.org (Postfix, from userid 109) id D302961FCF; Tue, 11 Aug 2015 18:32:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id A7D1A62090; Tue, 11 Aug 2015 18:31:42 +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 4E54461F96; Tue, 11 Aug 2015 18:31:40 +0000 (UTC) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by lists.linaro.org (Postfix) with ESMTPS id 4D2F461E93 for ; Tue, 11 Aug 2015 18:31:39 +0000 (UTC) Received: by wicja10 with SMTP id ja10so79692174wic.1 for ; Tue, 11 Aug 2015 11:31:38 -0700 (PDT) X-Received: by 10.194.175.233 with SMTP id cd9mr20581316wjc.68.1439317898006; Tue, 11 Aug 2015 11:31:38 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id lk16sm4571230wic.6.2015.08.11.11.31.37 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Aug 2015 11:31:37 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Tue, 11 Aug 2015 19:31:23 +0100 Message-Id: <1439317883-9334-2-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439317883-9334-1-git-send-email-zoltan.kiss@linaro.org> References: <1439317883-9334-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH] api: packet: allow access to packet hash values X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zoltan.kiss@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Applications can access the computed hash (if any) through these functions, and query the length the platform supports to store. Signed-off-by: Zoltan Kiss --- include/odp/api/packet.h | 16 ++++++++++++++++ include/odp/api/packet_io.h | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h index 3a454b5..66fa2a9 100644 --- a/include/odp/api/packet.h +++ b/include/odp/api/packet.h @@ -615,6 +615,22 @@ int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset); int odp_packet_is_segmented(odp_packet_t pkt); /** + * Hash pointer + * + * Returns pointer to the hash of the packet. Optionally returns the length of + * the hash as well. + * + * @param pkt Packet handle + * @param[out] len Length of hash area (output). + * Ignored when NULL. + * + * @return Hash pointer + * + * @see odp_pktio_hash_len() + */ +void *odp_packet_hash_ptr(odp_packet_t pkt, uint32_t *len); + +/** * Number of segments * * Returns number of segments in the packet. A packet has always at least one diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index e00d011..a065567 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -321,6 +321,20 @@ int odp_pktio_skip_set(odp_pktio_t pktio, uint32_t offset); int odp_pktio_headroom_set(odp_pktio_t pktio, uint32_t headroom); /** + * Hash length + * + * Returns length of hash space for this packet IO. + * + * @param pkt Packet handle + * Ignored when NULL. + * + * @return Hash length + * + * @see odp_packet_hash_ptr() + */ +uint32_t odp_pktio_hash_len(odp_pktio_t pktio); + +/** * Get printable value for an odp_pktio_t * * @param pktio odp_pktio_t handle to be printed