From patchwork Fri Apr 15 13:04:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elo, Matias \(Nokia - FI/Espoo\)" X-Patchwork-Id: 65916 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1171317qge; Fri, 15 Apr 2016 06:09:25 -0700 (PDT) X-Received: by 10.55.75.12 with SMTP id y12mr25982510qka.73.1460725765423; Fri, 15 Apr 2016 06:09:25 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p63si5914544qkd.80.2016.04.15.06.09.23; Fri, 15 Apr 2016 06:09:25 -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=fail (p=NONE dis=NONE) header.from=nokia.com Received: by lists.linaro.org (Postfix, from userid 109) id 1350162025; Fri, 15 Apr 2016 13:09:23 +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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 C50DC674A9; Fri, 15 Apr 2016 13:04:57 +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 CF50B62041; Fri, 15 Apr 2016 13:04:38 +0000 (UTC) Received: from demumfd002.nsn-inter.net (demumfd002.nsn-inter.net [93.183.12.31]) by lists.linaro.org (Postfix) with ESMTPS id 09F9C62D30 for ; Fri, 15 Apr 2016 13:04:34 +0000 (UTC) Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by demumfd002.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id u3FD4XHd023261 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Apr 2016 13:04:33 GMT Received: from 10.144.19.15 ([10.144.104.112]) by demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id u3FD4UHm019910 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Fri, 15 Apr 2016 15:04:33 +0200 From: Matias Elo To: lng-odp@lists.linaro.org Date: Fri, 15 Apr 2016 16:04:28 +0300 Message-Id: <1460725470-4457-10-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460725470-4457-1-git-send-email-matias.elo@nokia.com> References: <1460725470-4457-1-git-send-email-matias.elo@nokia.com> X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 914 X-purgate-ID: 151667::1460725474-00002418-E6BBF93D/0/0 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v2 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" Signed-off-by: Matias Elo --- 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);