From patchwork Sun Mar 12 12:30:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 95169 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp783357qgd; Sun, 12 Mar 2017 05:32:09 -0700 (PDT) X-Received: by 10.237.34.125 with SMTP id o58mr27114044qtc.108.1489321929342; Sun, 12 Mar 2017 05:32:09 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y2si12328712qta.108.2017.03.12.05.32.09; Sun, 12 Mar 2017 05:32:09 -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 sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 082BD63C94; Sun, 12 Mar 2017 12:32:09 +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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 0C21E63C95; Sun, 12 Mar 2017 12:31:02 +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 06EFB62D0B; Sun, 12 Mar 2017 12:30:54 +0000 (UTC) Received: from mail-ot0-f180.google.com (mail-ot0-f180.google.com [74.125.82.180]) by lists.linaro.org (Postfix) with ESMTPS id 102DA62D0B for ; Sun, 12 Mar 2017 12:30:53 +0000 (UTC) Received: by mail-ot0-f180.google.com with SMTP id 19so99643156oti.0 for ; Sun, 12 Mar 2017 05:30:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cT4Pj146x43Qg6YKe3Z/UNUWeIXm0rKuzF7pcGWO5r8=; b=cImGmn4MdR2WGUWNoMYIPfNN+VmI6dJxhD/f/ejD6XoSupBnZ8903L8VQt8MS/ZjGY nlOs9wjFurXID0Si+0UDSFuUgwg3MEm+XJCeCGPZYVYe0KUdkAliCQAIFAomzVJDE20U Np5bCxLJ2xlY9rzkrziiVWRmdb/b7lBtSAiRv4QxHOEwMOkjFgIlRDAkcyx8pI4kNyD2 FJ+N448IcqhWm2w3PFYX/77b8uCIB+mj2ctl3sSCEYiZswohtbrHmcHL8MVueBhwK6im wFMMdhCcao3742IUGbNRAw/nnebV3DeRO0d7/RwcHfwh03UPuMMHQIWwW/iPsd/xpXuY 55EQ== X-Gm-Message-State: AFeK/H3Wq3639YaPbfVsAFZnY2StjgNlRewU+32gYWc48lR3V4EMGh88fmYH5PXb+SN14uQ/HgO6yw== X-Received: by 10.157.41.65 with SMTP id d59mr13696513otb.154.1489321852360; Sun, 12 Mar 2017 05:30:52 -0700 (PDT) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id 62sm6663155otq.34.2017.03.12.05.30.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Mar 2017 05:30:51 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sun, 12 Mar 2017 07:30:36 -0500 Message-Id: <20170312123045.3852-3-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.12.0.rc1 In-Reply-To: <20170312123045.3852-1-bill.fischofer@linaro.org> References: <20170312123045.3852-1-bill.fischofer@linaro.org> Subject: [lng-odp] [PATCHv2 02/11] linux-generic: packet: move pull_tail to packet mainline for consistency 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Move the pull_tail() internal routine to odp_packet.c for consistency with other internal head/tail manipulation routines. Signed-off-by: Bill Fischofer --- platform/linux-generic/include/odp_packet_internal.h | 9 --------- platform/linux-generic/odp_packet.c | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) -- 2.12.0.rc1 diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 0a9f1779..589e204a 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -184,15 +184,6 @@ static inline void copy_packet_cls_metadata(odp_packet_hdr_t *src_hdr, dst_hdr->op_result = src_hdr->op_result; } -static inline void pull_tail(odp_packet_hdr_t *pkt_hdr, uint32_t len) -{ - int last = pkt_hdr->buf_hdr.segcount - 1; - - pkt_hdr->tailroom += len; - pkt_hdr->frame_len -= len; - pkt_hdr->buf_hdr.seg[last].len -= len; -} - static inline uint32_t packet_len(odp_packet_hdr_t *pkt_hdr) { return pkt_hdr->frame_len; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 60eef3a6..d0f76332 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -145,6 +145,15 @@ static inline void push_tail(odp_packet_hdr_t *pkt_hdr, uint32_t len) pkt_hdr->buf_hdr.seg[last].len += len; } +static inline void pull_tail(odp_packet_hdr_t *pkt_hdr, uint32_t len) +{ + int last = pkt_hdr->buf_hdr.segcount - 1; + + pkt_hdr->tailroom += len; + pkt_hdr->frame_len -= len; + pkt_hdr->buf_hdr.seg[last].len -= len; +} + /* Copy all metadata for segmentation modification. Segment data and lengths * are not copied. */ static inline void packet_seg_copy_md(odp_packet_hdr_t *dst,