From patchwork Sun Mar 5 12:21:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 94898 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp988304qgd; Sun, 5 Mar 2017 04:22:39 -0800 (PST) X-Received: by 10.55.4.146 with SMTP id 140mr11820436qke.23.1488716559882; Sun, 05 Mar 2017 04:22:39 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q24si13377245qtb.106.2017.03.05.04.22.39; Sun, 05 Mar 2017 04:22:39 -0800 (PST) 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 7FCDA63D13; Sun, 5 Mar 2017 12:22:39 +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_H2, 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 99C4763603; Sun, 5 Mar 2017 12:21:37 +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 CDE5260AF3; Sun, 5 Mar 2017 12:21:32 +0000 (UTC) Received: from mail-wr0-f171.google.com (mail-wr0-f171.google.com [209.85.128.171]) by lists.linaro.org (Postfix) with ESMTPS id CB9BF60A16 for ; Sun, 5 Mar 2017 12:21:30 +0000 (UTC) Received: by mail-wr0-f171.google.com with SMTP id u108so99612183wrb.3 for ; Sun, 05 Mar 2017 04:21:30 -0800 (PST) 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=p/M9rCcaylRi7nYztl++Xnn3hfxLIZ1X7AFRwlxx30w=; b=f5+G3P0Z1xLMNKuKe5usAomaa2LsU1AA7mlF2gGUmCJs5/72DxMhxbz+OgvepQB6gg uk6Z6dMDTA6/7gFFpPSVkty8e58Xj38YQgraDecC+ApujvgXGTapm8aBppXVir3GQqmt ak5GAjrYuEBme6tplCnc2rgns7nOXjeWNPVD1vCF7/me2qdTg7t1uTmFc0cmeDViBITT 23TLPCExb4YTZQBeLg4E8n58nliuG5lAd1073jcBoXwWQYEBVB6rwlectx5YGJT2x82y HcYuFf5s0Y5frxrdie6sT5AL/B02gSF0nu+ugmS4UI+zPSVYBUe+FEM2FdAynThG6pud lfeg== X-Gm-Message-State: AMke39mBjfFNggkftLwo1PCpW9tewUEBHbMpI0pDJ6YXrgbJk5LHcAZf+NtVZpOU+4eYoAPqpC0= X-Received: by 10.223.148.193 with SMTP id 59mr9443657wrr.199.1488716489928; Sun, 05 Mar 2017 04:21:29 -0800 (PST) Received: from Ubuntu15.localdomain ([109.74.56.122]) by smtp.gmail.com with ESMTPSA id 127sm10686971wmt.20.2017.03.05.04.21.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 05 Mar 2017 04:21:29 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sun, 5 Mar 2017 13:21:16 +0100 Message-Id: <1488716485-15002-3-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1488716485-15002-1-git-send-email-bill.fischofer@linaro.org> References: <1488716485-15002-1-git-send-email-bill.fischofer@linaro.org> Subject: [lng-odp] [PATCH 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.5.0 diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 0a9f177..589e204 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 60eef3a..d0f7633 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,