From patchwork Tue Aug 19 13:01:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 35589 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C3048201EF for ; Tue, 19 Aug 2014 13:01:30 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf52670975pde.10 for ; Tue, 19 Aug 2014 06:01:29 -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:from:to:thread-topic:thread-index :date:message-id:references:in-reply-to:accept-language:mime-version :cc:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-language:content-type; bh=L051KbmGJT4CH2BnG8Se8BoXQSyxPhttTwwZ58SPQuM=; b=W0h1gLOHm1m/q1FUxh6Ens+S5T3xJqTJzp9ACK1FXbNl7IribGsBn/c0OP9FahofeU ZMBgIhpWetpCHdWvA7OAwpgMWj2PO0+9fQ2BAKavMIQADJimCcotgqhHKM35k0N3NMKR X5I0Wt0YVOFql3+QV/9rQYXHEI1S2ItgWQTIAd7aRIRSxeMtwjlBoZZFZ7YWEZ9RqqkB szgkjVJ8KBbcY5X967H9UUAlHF3vGsvXgnwUHpEPYSWxqCL68OZjiySKkMZrdxSHFMib OQLrQcWMuH+S0rZgvzY9RkGGdK6yK5k6IvYyZ19kQtYQ9PbkkThn6BWUp5jQFAZ4sDMh CR0w== X-Gm-Message-State: ALoCoQnXowXxM3PcOZ9p6x9O2YDmBwUOBFAQhBBjsyg4LTwLISHYODIhVU6XG/v5qSH2AbU6+F1v X-Received: by 10.70.130.135 with SMTP id oe7mr897681pdb.9.1408453289818; Tue, 19 Aug 2014 06:01:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.136 with SMTP id e8ls1552409qgf.36.gmail; Tue, 19 Aug 2014 06:01:29 -0700 (PDT) X-Received: by 10.220.114.5 with SMTP id c5mr29989067vcq.28.1408453289700; Tue, 19 Aug 2014 06:01:29 -0700 (PDT) Received: from mail-vc0-x235.google.com (mail-vc0-x235.google.com [2607:f8b0:400c:c03::235]) by mx.google.com with ESMTPS id fd7si8573663vdc.0.2014.08.19.06.01.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 06:01:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::235 as permitted sender) client-ip=2607:f8b0:400c:c03::235; Received: by mail-vc0-f181.google.com with SMTP id lf12so7281013vcb.40 for ; Tue, 19 Aug 2014 06:01:29 -0700 (PDT) X-Received: by 10.220.166.68 with SMTP id l4mr11046350vcy.20.1408453289556; Tue, 19 Aug 2014 06:01:29 -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.221.37.5 with SMTP id tc5csp236614vcb; Tue, 19 Aug 2014 06:01:29 -0700 (PDT) X-Received: by 10.221.5.137 with SMTP id og9mr30117788vcb.18.1408453288797; Tue, 19 Aug 2014 06:01:28 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id e9si21936175qcj.38.2014.08.19.06.01.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 Aug 2014 06:01:28 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XJj2U-0000Pq-0l; Tue, 19 Aug 2014 13:01:26 +0000 Received: from rcdn-iport-6.cisco.com ([173.37.86.77]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XJj2N-0000Pl-Tb for lng-odp@lists.linaro.org; Tue, 19 Aug 2014 13:01:20 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj4FADRK81OtJV2Z/2dsb2JhbABZgkcjI1NXBIJ4yAuBWQEJh1gBGXIWd4QDAQEBBAEBASAEBkELEAIBCBEEAQELHQMCAgIlAQoUCQgCBA4FCIg6AQysM5U0F48bFhsGAYJ5NoEdBZElhCaDdYRZkyyDXWyBSIEHAQEB X-IronPort-AV: E=Sophos;i="5.01,893,1400025600"; d="scan'208,217";a="348634803" Received: from rcdn-core-2.cisco.com ([173.37.93.153]) by rcdn-iport-6.cisco.com with ESMTP; 19 Aug 2014 13:01:15 +0000 Received: from xhc-aln-x09.cisco.com (xhc-aln-x09.cisco.com [173.36.12.83]) by rcdn-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id s7JD1D6H015863 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 19 Aug 2014 13:01:13 GMT Received: from xmb-aln-x01.cisco.com ([fe80::747b:83e1:9755:d453]) by xhc-aln-x09.cisco.com ([173.36.12.83]) with mapi id 14.03.0195.001; Tue, 19 Aug 2014 08:01:13 -0500 From: "Robbie King (robking)" To: Bill Fischofer Thread-Topic: [lng-odp] [PATCH] Add 64 bit context to packet Thread-Index: AQHPu6uM8/gpInF+Z0CwL7eHwDLF7pvYM4+AgAADPYD//6yngA== Date: Tue, 19 Aug 2014 13:01:12 +0000 Message-ID: References: <1408452365-8436-1-git-send-email-robking@cisco.com> <1408452365-8436-2-git-send-email-robking@cisco.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.82.209.70] MIME-Version: 1.0 X-Topics: patch Cc: lng-odp-forward Subject: Re: [lng-odp] [PATCH] Add 64 bit context to packet X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Original-Sender: robking@cisco.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::235 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@ Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Content-Language: en-US Pointer is really all I’m looking for. Just wanted to get as many ‘tidbits’ out of the way before the IPsec application patch. From: Bill Fischofer [mailto:bill.fischofer@linaro.org] Sent: Tuesday, August 19, 2014 8:58 AM To: Robbie King (robking) Cc: lng-odp-forward Subject: Re: [lng-odp] [PATCH] Add 64 bit context to packet Are you really wanting to define a 64-bit integer or are you looking for a pointer? uint64_t is not portable to 32-bit systems, however intptr_t is guaranteed to be a native pointer type of appropriate size. Bill On Tue, Aug 19, 2014 at 7:46 AM, Robbie King > wrote: Signed-off-by: Robbie King > --- include/odp_packet.h | 18 ++++++++++++++++++ .../linux-generic/include/odp_packet_internal.h | 2 ++ platform/linux-generic/odp_packet.c | 10 ++++++++++ 3 files changed, 30 insertions(+), 0 deletions(-) -- 1.7.7.6 _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org http://lists.linaro.org/mailman/listinfo/lng-odp diff --git a/include/odp_packet.h b/include/odp_packet.h index ef4be9e..db75540 100644 --- a/include/odp_packet.h +++ b/include/odp_packet.h @@ -98,6 +98,24 @@ void odp_packet_set_len(odp_packet_t pkt, size_t len); size_t odp_packet_get_len(odp_packet_t pkt); /** + * Set packet user context + * + * @param buf Packet handle + * @param ctx User context + * + */ +void odp_packet_set_ctx(odp_packet_t buf, uint64_t ctx); + +/** + * Get packet user context + * + * @param buf Packet handle + * + * @return User context + */ +uint64_t odp_packet_get_ctx(odp_packet_t buf); + +/** * Get address to the start of the packet buffer * * The address of the packet buffer is not necessarily the same as the start diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 0ab3be2..49c59b2 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -112,6 +112,8 @@ typedef struct { uint32_t frame_len; + uint64_t user_ctx; /* user context */ + odp_pktio_t input; uint32_t pad; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 13e2471..bbfef49 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -386,3 +386,13 @@ int odp_packet_copy(odp_packet_t pkt_dst, odp_packet_t pkt_src) return 0; } + +void odp_packet_set_ctx(odp_packet_t pkt, uint64_t ctx) +{ + odp_packet_hdr(pkt)->user_ctx = ctx; +} + +uint64_t odp_packet_get_ctx(odp_packet_t pkt) +{ + return odp_packet_hdr(pkt)->user_ctx; +}