From patchwork Fri Jan 12 16:00:09 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: 124366 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2222444qgn; Fri, 12 Jan 2018 08:02:31 -0800 (PST) X-Google-Smtp-Source: ACJfBou6KXvVZx9auHihN9MDSTXgP7kIsgmBzC9a68MkjJd6R6INiQ1fGtV5kY2vBxG5Zv5sh+Ri X-Received: by 10.157.8.228 with SMTP id 91mr15203071otf.120.1515772951207; Fri, 12 Jan 2018 08:02:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515772951; cv=none; d=google.com; s=arc-20160816; b=hKzFpJGJaVYB+lAkHHn4Of1q+/+QvyO+mh47+bA+t1xKo3FAxNFOlePcOD9dsQALqA t6QMeGrgrlBUqNhyYeIR+OSJfyFBQjeP/pusGOfKZdYrtXA6dkGy0t3KypI8XTIoiIKN oSbRNKWpabeKzJ406p3ifFoJVuLThHHHAcbBDq7vF/d6UAh/dtpXLNyQ4j63ShQic14S XttfnmEMf49iZUuiskpLDB2/OFvVEhjJr62abslmJHl+0kc5YcL5NLI4ZidupTGaLtFx ECXlLRcMa0UecX1noCE9i9z0LkNP7UnCAsoViSh2l0xFcSpDCC1uLsUSxAoksBEqa7Mo L9mA== 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=gpcLKHXEf1+x4KrdAQ58E78murwiuxqQIrzBt/IWeYY=; b=L/zopIVtkYHW+yUdnLbYvPMW/jxvFIlU5DDFYqPNCntZ4UJh4QNjM5k3S6VRHirubR VM5z5ce3XLnspFXVMDEqIQDJ0DIFGr5xjWXItjuBdY+F7E88LX7DYZqZ7O580Q4aQJRn pxPKMWfTZxLMugsbbJXwdIqZ88I2LSvzzR8Kxveo1nfdnXkbplcVzUyKkUiEE1QNvJ5t QO1HUDOW0RrUZCgHLvdt6WfKF2g5tvlm/3TqypEBOYjESESmBgNK6xxvkMFInonAV1UM DBZyGy0pmbzHQAPb382jl0KmQUkeQfpebB8rgJiqZ5K6b0MfYmBhexl66pxFZ92tYA+N Z+/g== 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 l2si12605qtd.59.2018.01.12.08.02.30; Fri, 12 Jan 2018 08:02:31 -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 C34D4616F5; Fri, 12 Jan 2018 16:02:30 +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_H3, RCVD_IN_MSPIKE_WL 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 00D32608DE; Fri, 12 Jan 2018 16:01:06 +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 5E54F60961; Fri, 12 Jan 2018 16:00:55 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 8F5C86170E for ; Fri, 12 Jan 2018 16:00:16 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 9816D1842F0 for ; Fri, 12 Jan 2018 19:00:15 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id kb7Jq2vSU7-0Fme6JQh; Fri, 12 Jan 2018 19:00:15 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id rFPUuYkDkq-0Eh81hOI; Fri, 12 Jan 2018 19:00:14 +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: Fri, 12 Jan 2018 19:00:09 +0300 Message-Id: <1515772811-30441-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515772811-30441-1-git-send-email-odpbot@yandex.ru> References: <1515772811-30441-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 388 Subject: [lng-odp] [PATCH API-NEXT v1 3/5] 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 388 (psavol:next-user-ptr-init) ** https://github.com/Linaro/odp/pull/388 ** Patch: https://github.com/Linaro/odp/pull/388.patch ** Base sha: 6303c7d0e98fafe0f14c8c4dd9989b3b7633ebf4 ** Merge commit sha: 9eaabe631329dd5cc41960f7cfb5592d60ff0499 **/ 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 3655f5899..8aca552f6 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