From patchwork Tue Aug 19 12:46:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robbie King X-Patchwork-Id: 35588 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 30CFF201EF for ; Tue, 19 Aug 2014 12:46:27 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf42512229obc.8 for ; Tue, 19 Aug 2014 05:46:26 -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:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=s5h7u0epRVZnE+loeek+SlU04WOk2dZgAEP2XOQELX8=; b=QnWgZyBB3981lh3OZ6Q0j29Jcx7HnyxnW4PUgd7UYQsAnFDKBUdYVcMBJxGS/UcVOh /DJF3yq9Ex6pka9pbll3d7AFEg7h9Ug4Tq9UyV4MdYWejSnF9rJ9WHcSaPshpAptdjCH NYs1w7f09wPuKnEOvzIfl3mF9dx69bd8DidNDm2lfh1JuqvtukEf+Z2YL9zWW0vr0Cr8 udCnl9obxpHCUOkpyq8II176+jT9FqTRVNSoOZE8kX8n8VqXC1j12FbI0hWVH+YU57di A10O/3n3B3RZcZF33RGtVM0XzgYcyyDgczDalYy+qpqCf0ALCarxqWsa0GPzCZbxFm4N ardw== X-Gm-Message-State: ALoCoQkMeOe9oTKGpktT3nXsFY0KmZpdbqeau40jDuc2R+u900SHs5dRk5/XnJIFV8F+L4EsRhNp X-Received: by 10.42.212.207 with SMTP id gt15mr838593icb.31.1408452386779; Tue, 19 Aug 2014 05:46:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.99 with SMTP id k90ls2954350qgk.78.gmail; Tue, 19 Aug 2014 05:46:26 -0700 (PDT) X-Received: by 10.220.172.8 with SMTP id j8mr10790754vcz.32.1408452386648; Tue, 19 Aug 2014 05:46:26 -0700 (PDT) Received: from mail-vc0-x232.google.com (mail-vc0-x232.google.com [2607:f8b0:400c:c03::232]) by mx.google.com with ESMTPS id ji10si8553780vdb.3.2014.08.19.05.46.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 05:46:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::232 as permitted sender) client-ip=2607:f8b0:400c:c03::232; Received: by mail-vc0-f178.google.com with SMTP id la4so7211298vcb.23 for ; Tue, 19 Aug 2014 05:46:26 -0700 (PDT) X-Received: by 10.220.200.71 with SMTP id ev7mr29898313vcb.24.1408452386564; Tue, 19 Aug 2014 05:46:26 -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 tc5csp235627vcb; Tue, 19 Aug 2014 05:46:26 -0700 (PDT) X-Received: by 10.229.53.133 with SMTP id m5mr6602969qcg.19.1408452386065; Tue, 19 Aug 2014 05:46:26 -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 n3si28777458qaz.49.2014.08.19.05.46.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 Aug 2014 05:46:26 -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 1XJinw-00009V-RZ; Tue, 19 Aug 2014 12:46:24 +0000 Received: from rcdn-iport-7.cisco.com ([173.37.86.78]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XJinl-00009B-AP for lng-odp@lists.linaro.org; Tue, 19 Aug 2014 12:46:13 +0000 X-IronPort-AV: E=Sophos;i="5.01,893,1400025600"; d="scan'208";a="348581641" Received: from alln-core-5.cisco.com ([173.36.13.138]) by rcdn-iport-7.cisco.com with ESMTP; 19 Aug 2014 12:46:09 +0000 Received: from cpp-rtpbld-55.cisco.com (cpp-rtpbld-55.cisco.com [172.18.5.199]) by alln-core-5.cisco.com (8.14.5/8.14.5) with ESMTP id s7JCk7n2017776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 Aug 2014 12:46:07 GMT Received: from cpp-rtpbld-55.cisco.com (localhost.localdomain [127.0.0.1]) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8) with ESMTP id s7JCk7Rw008478; Tue, 19 Aug 2014 08:46:07 -0400 Received: (from robking@localhost) by cpp-rtpbld-55.cisco.com (8.13.8/8.13.8/Submit) id s7JCk7AL008477; Tue, 19 Aug 2014 08:46:07 -0400 From: Robbie King To: lng-odp@lists.linaro.org Date: Tue, 19 Aug 2014 08:46:05 -0400 Message-Id: <1408452365-8436-2-git-send-email-robking@cisco.com> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1408452365-8436-1-git-send-email-robking@cisco.com> References: <1408452365-8436-1-git-send-email-robking@cisco.com> X-Topics: patch Subject: [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: , MIME-Version: 1.0 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::232 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=fail header.i=@cisco.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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(-) 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; +}