From patchwork Tue Jan 23 09:00:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 125481 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1632361ljf; Tue, 23 Jan 2018 01:02:25 -0800 (PST) X-Google-Smtp-Source: AH8x224GmTgj0d115QSOdkLIB2NAAI9xLalwVedtNqJQVYmkUuihcSyyd2UBAaJtA5EAvcrRVege X-Received: by 10.55.187.135 with SMTP id l129mr2552260qkf.322.1516698145308; Tue, 23 Jan 2018 01:02:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516698145; cv=none; d=google.com; s=arc-20160816; b=o738QkSN4m0UUTQeFtyysFuNRcyLEovpzBu4JwtXQxOfLw6/Ulc0KYSwzXafMF6Nhv MHxf/aAP8Gb+a00z/jZG/Vgj/IR0QDWI12ohJqUVW4xQ4aIzBnQiyw0Khl0s8tDeWPA4 2P0WsuB0Xep14xv3mG3SySM1dMffkfGPU848xCoLvoL4UZ0XO6MFepSUE2pXrsOzaXzD s0i2gdCh78RuxDmiCiugkPi2+rnT8Rvfiv93aUQvoaELlahlR/MMlGosgy4/sLPvFg/U zvEuHptTQUs8Bygr+TkHk+efkU6KsmlErUuHdFcCxI6ytjHgb0t3C7HDiYt16z+Zk1Lz JY+A== 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=a50hUqk/KZJQ06rrunCTH65n3czHJU2KdIbtqroTsZs=; b=clsXMTFBZ7whCNiMsPf9WXwMB5iTV92Hr8VNw7Pjibb8blxZekhrT9NYW/KXYYMad5 qOPQ44+jwvdtkMTpLibSzUMD6hyz2wBU4i4HmkSIJMTCQBi8JgNoiiNMrUBwjwtj3hmv MCfCrbExt9XFgCacByDgUzFABDLnPbrh65YtmVpYK7MNSneTxOBs7gUZ1bGhGVQOenzd ltfweAfwyzh/LZpbDP2EJ/Afi15wfDdeBricps2aI8uWb6pc34V4/JzEWSIRCrK4TfpX MhbeIQgeQfsGo/CRh8nbC9JxLouKbsA+BRk0Te16ZwGkUdf0L07sr0c50/FC2waQjUNm 2H5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 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 (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id l2si6818041qtd.285.2018.01.23.01.02.25; Tue, 23 Jan 2018 01:02:25 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 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 EE44E61719; Tue, 23 Jan 2018 09:02:24 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 B9FF961751; Tue, 23 Jan 2018 09:00:37 +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 A11E660953; Tue, 23 Jan 2018 09:00:23 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 55FFD60855 for ; Tue, 23 Jan 2018 09:00:20 +0000 (UTC) Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net [IPv6:2a02:6b8:0:1619::84]) by forward104p.mail.yandex.net (Yandex) with ESMTP id E25261821FF for ; Tue, 23 Jan 2018 12:00:18 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id vl3Rpt91te-0IeSNo63; Tue, 23 Jan 2018 12:00:18 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id VKzM4bguQ1-0IDufHcV; Tue, 23 Jan 2018 12:00:18 +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: Tue, 23 Jan 2018 12:00:12 +0300 Message-Id: <1516698014-28886-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516698014-28886-1-git-send-email-odpbot@yandex.ru> References: <1516698014-28886-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 392 Subject: [lng-odp] [PATCH API-NEXT v4 4/6] api: packet: initialize user ptr to NULL 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 Require that implementation initializes the pointer value to NULL. Application can use the pointer more robustly when it can tell if the pointer has been set previously or not. Signed-off-by: Petri Savolainen --- /** Email created from pull request 392 (psavol:next-user-ptr-init-rebase) ** https://github.com/Linaro/odp/pull/392 ** Patch: https://github.com/Linaro/odp/pull/392.patch ** Base sha: 4508f410a04cf1657d607d24aa2530a42ef011f7 ** Merge commit sha: 3781732a78e4a3f0347b6b4299e9753da3929a42 **/ include/odp/api/spec/packet.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index a1111325e..3222ff5c2 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -1341,7 +1341,10 @@ int odp_packet_input_index(odp_packet_t pkt); /** * User context pointer * - * Return previously stored user context pointer. + * Return previously stored user context pointer. If not otherwise documented, + * the pointer value is maintained over packet manipulating operations. + * Implementation initializes the pointer value to NULL during new packet + * creation (e.g. alloc and packet input) and reset. * * @param pkt Packet handle * @@ -1357,10 +1360,10 @@ void *odp_packet_user_ptr(odp_packet_t pkt); * value of type intptr_t. ODP may use the pointer for data prefetching, but * must ignore any invalid addresses. * - * @param pkt Packet handle - * @param ctx User context pointer + * @param pkt Packet handle + * @param user_ptr User context pointer */ -void odp_packet_user_ptr_set(odp_packet_t pkt, const void *ctx); +void odp_packet_user_ptr_set(odp_packet_t pkt, const void *user_ptr); /** * User area address