From patchwork Thu Apr 21 00:14:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 66268 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2743260qge; Wed, 20 Apr 2016 17:20:33 -0700 (PDT) X-Received: by 10.140.98.117 with SMTP id n108mr1023267qge.16.1461198032731; Wed, 20 Apr 2016 17:20:32 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z38si2914010qge.114.2016.04.20.17.20.32; Wed, 20 Apr 2016 17:20:32 -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; 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 dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6EE7367574; Thu, 21 Apr 2016 00:20:32 +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 7A8AF68A5E; Thu, 21 Apr 2016 00:15:23 +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 286606742D; Thu, 21 Apr 2016 00:14:58 +0000 (UTC) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) by lists.linaro.org (Postfix) with ESMTPS id D9CB862C41 for ; Thu, 21 Apr 2016 00:14:26 +0000 (UTC) Received: by mail-oi0-f45.google.com with SMTP id r78so61173160oie.0 for ; Wed, 20 Apr 2016 17:14: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:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2P84Z3A6Ts1qmkVlX8u4FL7qa4NFITNNBjrOb9N84wI=; b=Dk7ztTKjHEHEwxFkP9Rk9r0cYNmdCACsmCdUhCKZ+e5ph2jwbcAQWaK+a+DAqmRFO8 iTekDA6ko4PHceopnWTAXQz33uUckgZV5+/tCn+8T+SuixLnmM1zkYKMtLyw5GBxttIf zfLF60qdrJ3OhHrGMkdtATfixBx/4gb5THhCjJSVjMBx4dEg+JpLmIXAcIiqt/FBGahF vIYyM5RCRfGSP09PNEx/0rj0VpY2ACcGa1tTKnnF/+gJVo39mEM+9FFlWL9JwPolfNMG fl1RHrY+WjGPkLKfI4QpcPmH9hM9uEW+vAix0jBigsmPiUNhsZkfXkwmLJy6NOsAM9mU YCJA== X-Gm-Message-State: AOPr4FXlxAEySsVR8+kyromDq2FdI9Vnc136fWyneb8pejW2Aa/is2vy2NPQNbtZghBQGzBATPs= X-Received: by 10.202.102.36 with SMTP id a36mr4861748oic.122.1461197666440; Wed, 20 Apr 2016 17:14:26 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id a34sm335otb.1.2016.04.20.17.14.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Apr 2016 17:14:25 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 20 Apr 2016 19:14:13 -0500 Message-Id: <1461197655-23743-10-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1461197655-23743-1-git-send-email-bill.fischofer@linaro.org> References: <1461197655-23743-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv4 09/11] linux-generic: packet: add inline helper function for setting packet timestamp 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Matias Elo Signed-off-by: Matias Elo Reviewed-and-tested-by: Bill Fischofer --- platform/linux-generic/include/odp_packet_internal.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 1005535..7421d71 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -285,6 +285,14 @@ static inline int packet_hdr_has_eth(odp_packet_hdr_t *pkt_hdr) return pkt_hdr->input_flags.eth; } +static inline void packet_set_ts(odp_packet_hdr_t *pkt_hdr, odp_time_t *ts) +{ + if (ts != NULL) { + pkt_hdr->timestamp = *ts; + pkt_hdr->input_flags.timestamp = 1; + } +} + int _odp_parse_common(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr); int _odp_cls_parse(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr);