From patchwork Fri Apr 15 00:25:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 65863 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp896796qge; Thu, 14 Apr 2016 17:29:48 -0700 (PDT) X-Received: by 10.55.72.148 with SMTP id v142mr22297816qka.102.1460680188219; Thu, 14 Apr 2016 17:29:48 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y101si34467387qge.123.2016.04.14.17.29.47; Thu, 14 Apr 2016 17:29:48 -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 DF44E67508; Fri, 15 Apr 2016 00:29:47 +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 65E9B67584; Fri, 15 Apr 2016 00:26:14 +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 CB35E6749F; Fri, 15 Apr 2016 00:26:08 +0000 (UTC) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) by lists.linaro.org (Postfix) with ESMTPS id 59AD56749F for ; Fri, 15 Apr 2016 00:25:39 +0000 (UTC) Received: by mail-oi0-f54.google.com with SMTP id s79so109923446oie.1 for ; Thu, 14 Apr 2016 17:25:39 -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=AMpkZR/30Mb+Eb9eZ7CLhCGY6qyiR+PhIu493peFSSc=; b=T8hvWq3rLJIcKja7JseTCHCP0jrD29r3/mWYgOMw5P8oK9dxGHOqEbqyCHbYRjckcv hVVIyfDbhw8WjjqnDM2Yh/0jzNesCkUzQCYkoEzgDBIL+N57RiAL6snBE9NbuLXNWOH9 e65CHcUY8KGOg4h4J6ZSOq4IA0r0Z+f2WVDlOfDx/Fj/YuifZM97DEyt4XABcDYijR0F e0kdsX0eO8b+LFTBqD9hEXj4VIBTk5XdTGFsJeZKgf27cJ6TBHkRnIhreVhHjic6w2Sb Ukc0SqFHjLKtP0LyeDPR+iEJdalE6JJ8UXn8yQUVOIMr/4HVWc1PfYzC+dIUo0uYrlRE LEBw== X-Gm-Message-State: AOPr4FUbvxF6gLh+JXb4ozwdjMuyXgRjFCI8riVLYG4BkpxDGxlkV+I+YltsHUDGVriK+V5FIIA= X-Received: by 10.202.178.135 with SMTP id b129mr8948729oif.139.1460679938933; Thu, 14 Apr 2016 17:25:38 -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 xd3sm2584743oeb.1.2016.04.14.17.25.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Apr 2016 17:25:38 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 14 Apr 2016 19:25:24 -0500 Message-Id: <1460679929-30653-6-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460679929-30653-1-git-send-email-bill.fischofer@linaro.org> References: <1460679929-30653-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv5 05/10] 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 Reviewed-by: Bala Manoharan --- 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)