From patchwork Wed Feb 15 00:26:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 93984 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1804925qgi; Tue, 14 Feb 2017 16:27:03 -0800 (PST) X-Received: by 10.237.46.161 with SMTP id k30mr1731484qtd.152.1487118423559; Tue, 14 Feb 2017 16:27:03 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l92si1648791qte.291.2017.02.14.16.27.02; Tue, 14 Feb 2017 16:27:03 -0800 (PST) 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id CE9C86350E; Wed, 15 Feb 2017 00:27:02 +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, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 E482F62CB7; Wed, 15 Feb 2017 00:26:58 +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 0F3DD63506; Wed, 15 Feb 2017 00:26:57 +0000 (UTC) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) by lists.linaro.org (Postfix) with ESMTPS id 1EA2D60DC9 for ; Wed, 15 Feb 2017 00:26:56 +0000 (UTC) Received: by mail-oi0-f42.google.com with SMTP id w204so79793108oiw.0 for ; Tue, 14 Feb 2017 16:26:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cr46VwK0XyLDp3HIN68NEj58JLbfPb35fGcal8B0DHU=; b=VqkB494Si+NGoSioGaZdwG95zhHcwKxhc5Mo6Lu9d0EyV66bYnzLzgBgf62pb/SCpV IDpl6oHHbriWgQDew+qVCA8KDjGJtTM3/sW0LSpUWh5V+6Vrt4wOF/ngcELfxI7L/eXu m8fGiJ0j8rhpFfqN7lS1ltTk6w4lSmLCw3glD1QrcAJJOuQKqHeCeOe4FU4t6kLAiA/I wlsqCf6a6sdldiDi5yR4XoxfYoW2OxnoUjctKOdeNOZV9DQdYKIMAeYvc4zJoIv4c9uY 5L3ByIt7Z4FehNwQhtyCPeN3AW15ymuFUBYKTOYB19i0uNqbKK02he3hOu3eKVpSIp4w kHYg== X-Gm-Message-State: AMke39kncfr1+BsoSGv5lgelSBbIVEXPC0a3tG7jR8UFTL8kaRCC8I06Kre5gKPkIT5KUDOEEQw= X-Received: by 10.202.177.215 with SMTP id a206mr15931786oif.147.1487118415575; Tue, 14 Feb 2017 16:26:55 -0800 (PST) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id f198sm849520oic.41.2017.02.14.16.26.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Feb 2017 16:26:54 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 14 Feb 2017 18:26:51 -0600 Message-Id: <20170215002651.15346-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.12.0.rc1 Subject: [lng-odp] [API-NEXT PATCH] doc: userguide: clarify packet reference operation 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" Clarify usage information around packet references in cases where implementations simulate references by returning copies of packets. Signed-off-by: Bill Fischofer --- doc/users-guide/users-guide-packet.adoc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.12.0.rc1 diff --git a/doc/users-guide/users-guide-packet.adoc b/doc/users-guide/users-guide-packet.adoc index d5f2ff19..44dd4e3e 100644 --- a/doc/users-guide/users-guide-packet.adoc +++ b/doc/users-guide/users-guide-packet.adoc @@ -336,9 +336,9 @@ The key characteristic of a static reference is that because there are multiple independent handles that refer to the same packet, the caller should treat the packet as read only following the creation of a static reference until all other references to it are freed. This is because all static -references are simply aliases of the same packet, so if multiple threads were -independently manipulating the packet this would lead to unpredictable race -conditions. +references are simply aliases of the same packet and associated metadata, so +if multiple threads were independently manipulating the packet this would lead +to unpredictable race conditions. To assist in determining whether there are other references to a packet, ODP provides the API: @@ -513,7 +513,10 @@ packets as part of any reference creation call. The `odp_packet_unshared_len()` API will always provide an authoritative answer to the question of how many bytes of a packet may safely be modified in any context, so whether or not copies have been performed applications can be -assured of portability across all conforming ODP implementations. +assured of portability across all conforming ODP implementations. In addition, +if a reference call returns a copy of a packet for whatever reason, the +`odp_packet_has_ref()` API will return 0 to confirm that this is an +independent packet. Note also that a packet may not reference itself, nor may circular reference relationships be formed, _e.g.,_ packet A is used as a header for a reference