From patchwork Wed Apr 13 01:55:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 65676 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2242813qge; Tue, 12 Apr 2016 18:58:23 -0700 (PDT) X-Received: by 10.233.237.135 with SMTP id c129mr7526465qkg.59.1460512703824; Tue, 12 Apr 2016 18:58:23 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z17si3260724qka.125.2016.04.12.18.58.20; Tue, 12 Apr 2016 18:58:23 -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 1E4206180B; Wed, 13 Apr 2016 01:58:20 +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 9835667541; Wed, 13 Apr 2016 01:56:25 +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 B19026753A; Wed, 13 Apr 2016 01:56:17 +0000 (UTC) Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) by lists.linaro.org (Postfix) with ESMTPS id 6C7A76753A for ; Wed, 13 Apr 2016 01:55:51 +0000 (UTC) Received: by mail-ob0-f169.google.com with SMTP id j9so23750677obd.3 for ; Tue, 12 Apr 2016 18:55:51 -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=8xqElmzm6ObltIOKkIr8KRFQWaIgHdf0swggDkgcrOE=; b=h2xsAB1PDphyZ467z2m86KGFu/uB2JTwz+Jpf9duXa0pPn0gZ01e0imEdpxrkJuvY/ el7nf3c+jmHC4ux7vmz4MNdapsiS4Ip92Hq4a+TxXkONcdtpQvn7uxDXiG0qq3YmAnos Z2jmZNl+35d0khfynlyHx7wSiBvXdEUb7oNqJ9UEE9znACp+8Ml2haa9ts638EySifVy eC/afZUQqNkfl1O8CPDCpDxalSHLAUkWGn9Zzu2yddTCPz9ISyzxq+BoaTC+88JH0rL8 +VkhxXlo8EIanWBoETXS7t8FNjhgbdbBqp/a8ysMqDYXqeJCSUzHXioLi7J+ooxQBBxS j8qQ== X-Gm-Message-State: AOPr4FUX+olkdJVShq6t898ruu8tMsgRDuDg2Wxckx6xBrTde7O0r93v4eonT4i5RLZEbObK2Ds= X-Received: by 10.182.104.194 with SMTP id gg2mr2991146obb.5.1460512551003; Tue, 12 Apr 2016 18:55:51 -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 o59sm10922460ota.4.2016.04.12.18.55.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Apr 2016 18:55:50 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 12 Apr 2016 20:55:39 -0500 Message-Id: <1460512542-16544-5-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460512542-16544-1-git-send-email-bill.fischofer@linaro.org> References: <1460512542-16544-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 4/7] linux-generic: packet: correct odp_packet_buf_len 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" odp_packet_buf_len() must return buffer length over all segments Signed-off-by: Bill Fischofer --- platform/linux-generic/odp_packet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 4202a90..2abb227 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -211,7 +211,9 @@ void *odp_packet_head(odp_packet_t pkt) uint32_t odp_packet_buf_len(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->buf_hdr.size; + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->buf_hdr.size * pkt_hdr->buf_hdr.segcount; } void *odp_packet_data(odp_packet_t pkt)