From patchwork Wed Sep 16 07:53:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 53717 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 6938822A0D for ; Wed, 16 Sep 2015 07:53:43 +0000 (UTC) Received: by wisv5 with SMTP id v5sf17931248wis.0 for ; Wed, 16 Sep 2015 00:53:42 -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=xZE/20qEeMD5UiwiJSvTn/0PZzxTBP7/I/smfwqbIlk=; b=Z813ZL/AquPdmAmNjocmgT+KXrn4DCy7CVNib2nB43Nl1kluwQUIG99T7Gz3uBl2Od wEoCLNgyP8vpiWJJy85fBYgjDvg6E+DbRAIYlalkflY1Owt/RLHE5geHt68OsZfNyOHW pcOlImYAwvNJY+IVyOwgzAX5Q3nwUfQ+zLc4/HDmlKE+dUYXNLn9CgHP+1r9ts3mvdHH EGRatxMNqWKbhHmmA+QK/MPWnj18reEaFfxWCczb7fo8cesuh82nsilJv7TZr6Bc3Itn XjtY0tB3cHB4/jKs8lqAda2icczLGc439G5jNp7cmS8PJPwy8qzlTyiRkpNbW4cpNoj6 VPQQ== X-Gm-Message-State: ALoCoQl5yh6odvNhmd9BguP/F2RvnHYSrTLeWXu8uBsuKjQsCiRemywOXXPCJPmzOnZjUq/ujoLK X-Received: by 10.180.210.71 with SMTP id ms7mr1659884wic.4.1442390022766; Wed, 16 Sep 2015 00:53:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.199 with SMTP id 7ls751531lao.67.gmail; Wed, 16 Sep 2015 00:53:42 -0700 (PDT) X-Received: by 10.112.151.106 with SMTP id up10mr27540056lbb.106.1442390022593; Wed, 16 Sep 2015 00:53:42 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id ab1si8363828lbc.108.2015.09.16.00.53.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 00:53:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by lahg1 with SMTP id g1so94154724lah.1 for ; Wed, 16 Sep 2015 00:53:42 -0700 (PDT) X-Received: by 10.152.18.130 with SMTP id w2mr17910834lad.88.1442390022471; Wed, 16 Sep 2015 00:53:42 -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.59.35 with SMTP id w3csp2269720lbq; Wed, 16 Sep 2015 00:53:41 -0700 (PDT) X-Received: by 10.50.143.1 with SMTP id sa1mr13955766igb.32.1442390021401; Wed, 16 Sep 2015 00:53:41 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id rs6si2246310igb.81.2015.09.16.00.53.41; Wed, 16 Sep 2015 00:53:41 -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 D5AB662D42; Wed, 16 Sep 2015 07:53:40 +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, RCVD_IN_DNSWL_LOW, 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 6F8EC62D40; Wed, 16 Sep 2015 07:53:35 +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 7A3276197B; Wed, 16 Sep 2015 07:53:32 +0000 (UTC) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by lists.linaro.org (Postfix) with ESMTPS id 6AB866197B for ; Wed, 16 Sep 2015 07:53:10 +0000 (UTC) Received: by lbcao8 with SMTP id ao8so98526392lbc.3 for ; Wed, 16 Sep 2015 00:53:09 -0700 (PDT) X-Received: by 10.152.181.2 with SMTP id ds2mr27297182lac.48.1442389989193; Wed, 16 Sep 2015 00:53:09 -0700 (PDT) Received: from localhost.localdomain (ppp91-76-161-180.pppoe.mtu-net.ru. [91.76.161.180]) by smtp.gmail.com with ESMTPSA id v3sm2330971lae.13.2015.09.16.00.53.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Sep 2015 00:53:08 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 16 Sep 2015 10:53:00 +0300 Message-Id: <1442389983-17007-2-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442389983-17007-1-git-send-email-maxim.uvarov@linaro.org> References: <1442389983-17007-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 1/4] api: packet reference count support 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: maxim.uvarov@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.51 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 Add api for packet reference count support. Which is useful in case: - multicast support - TCP retransmission - traffic generator Introduced new call: newpkt = odp_packet_create_ref(pkt) which creates reference to original packet, but handles for reference packet and original are different. Signed-off-by: Maxim Uvarov --- include/odp/api/config.h | 5 +++++ include/odp/api/packet.h | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/include/odp/api/config.h b/include/odp/api/config.h index 302eaf5..2441f72 100644 --- a/include/odp/api/config.h +++ b/include/odp/api/config.h @@ -126,6 +126,11 @@ extern "C" { */ #define ODP_CONFIG_PACKET_BUF_LEN_MAX (ODP_CONFIG_PACKET_SEG_LEN_MIN*6) +/** + * Maximum packet references. + */ +#define ODP_CONFIG_PACKET_REFS 2 + /** Maximum number of shared memory blocks. * * This the the number of separate SHM areas that can be reserved concurrently diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h index 5d46b7b..f9745fb 100644 --- a/include/odp/api/packet.h +++ b/include/odp/api/packet.h @@ -125,6 +125,15 @@ odp_packet_t odp_packet_from_event(odp_event_t ev); */ odp_event_t odp_packet_to_event(odp_packet_t pkt); +/** + * Create reference for packet handle + * + * @param pkt Packet handle + * + * @return New packet handle + */ +odp_packet_t odp_packet_create_ref(odp_packet_t pkt); + /* * * Pointers and lengths