From patchwork Wed Sep 17 23:05:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 37554 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 ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4912A2054D for ; Wed, 17 Sep 2014 23:06:47 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf104348wib.6 for ; Wed, 17 Sep 2014 16:06:46 -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=hUayAg5/HzM6+GitAAl9AaZNaw5dOyjlesa0+tTBSKY=; b=SEKJKgh7DknWXspUOGkMSJW4UZUGIUCt+4aRoSdkqqzfDeC2GBzStp/7/759EupCTB C7+DTFn7pLfTBzqx32cYzpwCSFYkQjPskALNnLTUpEQpeM7MV58PhLbiDnkNPBYDqPIj cwOrqp58mK7zEwa3peP2crxvCeT2MrEJwMVOVjsUYqo26qo9gdWkXcVwfD2G61zoABw6 4ot8/8/E4mRKTzR9e/W+Nrbh9CBJRIjZHoInDjXFwgXTWzWOhomzbfY43ZbkIqPQp/Qv opPIyY3YyvfWQVmxEM20c260/1ARefecyKvDnsZZrVlrfZlbdnOSFti+kfbcYGePeXpg 6gfA== X-Gm-Message-State: ALoCoQkxqAxK5Qjt9LSMqWs8DBQSX0mFGnMde39MXSi5+85+ZVpQ/GnK4vdGLZIZGYyvVx1kllNF X-Received: by 10.112.48.41 with SMTP id i9mr1078lbn.22.1410995206510; Wed, 17 Sep 2014 16:06:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.2.226 with SMTP id 2ls175499lax.61.gmail; Wed, 17 Sep 2014 16:06:46 -0700 (PDT) X-Received: by 10.112.76.6 with SMTP id g6mr465538lbw.22.1410995206252; Wed, 17 Sep 2014 16:06:46 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) by mx.google.com with ESMTPS id a7si30388047lae.59.2014.09.17.16.06.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 16:06:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id el20so65842lab.5 for ; Wed, 17 Sep 2014 16:06:46 -0700 (PDT) X-Received: by 10.112.184.161 with SMTP id ev1mr384202lbc.82.1410995206172; Wed, 17 Sep 2014 16:06:46 -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.130.169 with SMTP id of9csp668029lbb; Wed, 17 Sep 2014 16:06:45 -0700 (PDT) X-Received: by 10.224.38.68 with SMTP id a4mr780793qae.85.1410995205047; Wed, 17 Sep 2014 16:06:45 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id l1si23852480qaf.73.2014.09.17.16.06.43 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 17 Sep 2014 16:06:45 -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-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XUOJ9-0005hC-2d; Wed, 17 Sep 2014 23:06:43 +0000 Received: from mail-pa0-f48.google.com ([209.85.220.48]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XUOIl-0005fT-8v for lng-odp@lists.linaro.org; Wed, 17 Sep 2014 23:06:19 +0000 Received: by mail-pa0-f48.google.com with SMTP id hz1so82544pad.7 for ; Wed, 17 Sep 2014 16:06:13 -0700 (PDT) X-Received: by 10.70.10.100 with SMTP id h4mr548005pdb.162.1410995173675; Wed, 17 Sep 2014 16:06:13 -0700 (PDT) Received: from localhost.localdomain (70-35-38-154.static.wiline.com. [70.35.38.154]) by mx.google.com with ESMTPSA id f1sm17894333pdn.62.2014.09.17.16.06.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 16:06:13 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 18 Sep 2014 03:05:57 +0400 Message-Id: <1410995157-6905-5-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 In-Reply-To: <1410995157-6905-1-git-send-email-maxim.uvarov@linaro.org> References: <1410995157-6905-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: crypto patch Subject: [lng-odp] [PATCH 4/4] dpdk: add generic crypto 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-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.46 as permitted sender) smtp.mail=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 Signed-off-by: Maxim Uvarov --- platform/linux-dpdk/Makefile.am | 2 ++ platform/linux-dpdk/include/api/odp_packet.h | 18 ++++++++++++++++++ platform/linux-dpdk/include/odp_packet_internal.h | 2 ++ platform/linux-dpdk/odp_packet.c | 10 ++++++++++ 4 files changed, 32 insertions(+) diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index a59435f..1240404 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -32,6 +32,7 @@ include_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/api/odp_compiler.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_config.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_coremask.h \ + $(top_srcdir)/platform/linux-generic/include/api/odp_crypto.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_debug.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_hints.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_init.h \ @@ -67,6 +68,7 @@ __LIB__libodp_la_SOURCES = \ odp_buffer.c \ odp_buffer_pool.c \ ../linux-generic/odp_coremask.c \ + ../linux-generic/odp_crypto.c \ odp_init.c \ odp_linux.c \ odp_packet.c \ diff --git a/platform/linux-dpdk/include/api/odp_packet.h b/platform/linux-dpdk/include/api/odp_packet.h index 5545bdc..64a92e8 100644 --- a/platform/linux-dpdk/include/api/odp_packet.h +++ b/platform/linux-dpdk/include/api/odp_packet.h @@ -80,6 +80,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, const void *ctx); + +/** + * Get packet user context + * + * @param buf Packet handle + * + * @return User context + */ +void *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-dpdk/include/odp_packet_internal.h b/platform/linux-dpdk/include/odp_packet_internal.h index 9357f90..ccaba5a 100644 --- a/platform/linux-dpdk/include/odp_packet_internal.h +++ b/platform/linux-dpdk/include/odp_packet_internal.h @@ -115,6 +115,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-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c index edfd06d..458b0db 100644 --- a/platform/linux-dpdk/odp_packet.c +++ b/platform/linux-dpdk/odp_packet.c @@ -372,3 +372,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, const void *ctx) +{ + odp_packet_hdr(pkt)->user_ctx = (intptr_t)ctx; +} + +void *odp_packet_get_ctx(odp_packet_t pkt) +{ + return (void *)(intptr_t)odp_packet_hdr(pkt)->user_ctx; +}