From patchwork Fri Aug 14 18:42:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 52457 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id 9D42422B12 for ; Fri, 14 Aug 2015 18:42:54 +0000 (UTC) Received: by lbcli1 with SMTP id li1sf29248018lbc.2 for ; Fri, 14 Aug 2015 11:42:53 -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=8zIuF56TRXgXUxFByBhG+UoBCGFvsJ1x60URLxMq3eU=; b=RSRt2GI0cs5F/HJXknV1pD4FtA7Z3ljeZUxGR3xgi+NpJzws8kJ9Cmf0UgiI9BKK/s nl056nTTFulVY8ezmjrde90MWic0+hOwr5pG6+RMRILX5kqO25cV1WfW+ibWlJiih6bN Q09WFRhpIX1xm7pnqc1U+QXAnVsdrQ+xObVI5fXl5HwEr1BQE4WWRK2lxwnVtCvJ7FPG wwS9MUBx8Vwxs531P8i4t10iIhVW6iF0RPKoAMuoRdtSB+9Bj5n+JHzGUhIwqn0/dJdq WBzP88WHLpGkjOkUF7VTYiN7lgqkn2XziUGlZTj5Q1PiLMtEtjMEh8tpgKFbP2i/UbFR MDXw== X-Gm-Message-State: ALoCoQkn34g282tQsl5BdeGz4Qg1KXKZFckO/ca/lEZ/n0EaHpN+sXzUpGrMTx+c3NKjCqHCe6xQ X-Received: by 10.152.27.10 with SMTP id p10mr8324827lag.6.1439577773557; Fri, 14 Aug 2015 11:42:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.40 with SMTP id kv8ls391358lac.94.gmail; Fri, 14 Aug 2015 11:42:53 -0700 (PDT) X-Received: by 10.112.154.106 with SMTP id vn10mr34860499lbb.38.1439577773402; Fri, 14 Aug 2015 11:42:53 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id cr8si6485680lad.24.2015.08.14.11.42.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Aug 2015 11:42:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbcbn3 with SMTP id bn3so50198892lbc.2 for ; Fri, 14 Aug 2015 11:42:53 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr46521422lbc.32.1439577773293; Fri, 14 Aug 2015 11:42:53 -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 l6csp1810504lba; Fri, 14 Aug 2015 11:42:52 -0700 (PDT) X-Received: by 10.140.238.85 with SMTP id j82mr33682375qhc.77.1439577772046; Fri, 14 Aug 2015 11:42:52 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d199si10860592qhc.67.2015.08.14.11.42.50; Fri, 14 Aug 2015 11:42:52 -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 60BA262295; Fri, 14 Aug 2015 18:42:50 +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 D3ED561E02; Fri, 14 Aug 2015 18:42:43 +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 DBD786227F; Fri, 14 Aug 2015 18:42:40 +0000 (UTC) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by lists.linaro.org (Postfix) with ESMTPS id 14B8B61DA1 for ; Fri, 14 Aug 2015 18:42:40 +0000 (UTC) Received: by wicne3 with SMTP id ne3so26418644wic.0 for ; Fri, 14 Aug 2015 11:42:39 -0700 (PDT) X-Received: by 10.180.75.78 with SMTP id a14mr9427575wiw.43.1439577759323; Fri, 14 Aug 2015 11:42:39 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id mc18sm4282281wic.23.2015.08.14.11.42.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Aug 2015 11:42:38 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Fri, 14 Aug 2015 19:42:24 +0100 Message-Id: <1439577746-21499-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439488346-5676-1-git-send-email-zoltan.kiss@linaro.org> References: <1439488346-5676-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 1/3] api: packet: allow access to packet RSS 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.217.170 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 read the computed hash (if any) and set it if they changed the packet headers or if the platform haven't calculated the hash. Signed-off-by: Zoltan Kiss --- v2: - focus on RSS hash only - use setter/getter's v3: - do not mention pointers - add a note - add new patches for implementation and test include/odp/api/packet.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h index 3a454b5..1ae24bc 100644 --- a/include/odp/api/packet.h +++ b/include/odp/api/packet.h @@ -48,6 +48,11 @@ extern "C" { * Invalid packet segment */ +/** + * @def ODP_PACKET_RSS_INVALID + * RSS hash is not set + */ + /* * * Alloc and free @@ -605,6 +610,31 @@ uint32_t odp_packet_l4_offset(odp_packet_t pkt); int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset); /** + * RSS hash value + * + * Returns the RSS hash stored for the packet. + * + * @param pkt Packet handle + * + * @return Hash value + * @retval ODP_PACKET_RSS_INVALID if RSS hash is not set. + */ +uint32_t odp_packet_rss_hash(odp_packet_t pkt); + +/** + * Set RSS hash value + * + * Store the RSS hash for the packet. + * + * @param pkt Packet handle + * @param rss_hash Hash value to set + * + * @note If the application changes the packet header, it might want to + * recalculate this value and set it. + */ +void odp_packet_rss_hash_set(odp_packet_t pkt, uint32_t rss_hash); + +/** * Tests if packet is segmented * * @param pkt Packet handle