From patchwork Sat Jul 19 19:37:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkatesh Vivekanandan X-Patchwork-Id: 33931 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f71.google.com (mail-qg0-f71.google.com [209.85.192.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B656D20B8D for ; Sat, 19 Jul 2014 19:37:58 +0000 (UTC) Received: by mail-qg0-f71.google.com with SMTP id f51sf10580355qge.6 for ; Sat, 19 Jul 2014 12:37:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id :mime-version:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=xT/UtJ9lzH421YRLHLNQEoqwC+s3kxglTzhUnh1+La4=; b=VHYPOab/GgmxT1gmbEgpqQdmLkXrsfOoMVWo7bcKl+H7/M2T44YrfTRB28UsCQaG8h ElHIA0940YOpEPSBt6CsOOLkBi1Ebe2z0YFE/yVesY2fPExv9eFuXnquQVst8+mjnJkQ zUcvyZcDlTDxc+hWifrJihTs4fzRqihp4n/TFKt6lIXfKCfbevy6WZwFzig4yV3aHdg4 4m3ogoEN9FgK3AITLylDnlUm9QUkjAV0XtBqqKn4q/4FcHyk0fmDNRvlty0UzgDnNSLH petmRdmF2qKLYZ4AalBKVjBPUCFsw+0j0rJoXsyUPbxkTfYtFElMTKuCcobveh0HIoh3 mcwA== X-Gm-Message-State: ALoCoQnk2zESMUjhAnJOHJqmCakmU+6o3E4+4sR0+2Syaxcf7u9KIYv83BxEyfXBMf6FJYQvMTu6 X-Received: by 10.236.19.7 with SMTP id m7mr5729221yhm.35.1405798678490; Sat, 19 Jul 2014 12:37:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.108.228 with SMTP id j91ls1409418qgf.31.gmail; Sat, 19 Jul 2014 12:37:58 -0700 (PDT) X-Received: by 10.220.118.136 with SMTP id v8mr4610100vcq.50.1405798678415; Sat, 19 Jul 2014 12:37:58 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id s10si8322319vek.70.2014.07.19.12.37.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 19 Jul 2014 12:37:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ij19so9791840vcb.39 for ; Sat, 19 Jul 2014 12:37:58 -0700 (PDT) X-Received: by 10.220.15.8 with SMTP id i8mr4699230vca.45.1405798678318; Sat, 19 Jul 2014 12:37:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp1419vcb; Sat, 19 Jul 2014 12:37:58 -0700 (PDT) X-Received: by 10.140.23.198 with SMTP id 64mr21199482qgp.84.1405798677775; Sat, 19 Jul 2014 12:37:57 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id r3si5734537qat.53.2014.07.19.12.37.56 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 19 Jul 2014 12:37:57 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1X8aPl-0006If-Gh; Sat, 19 Jul 2014 19:35:25 +0000 Received: from mail-gw2-out.broadcom.com ([216.31.210.63]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1X8aPg-0006I3-6h for lng-odp@lists.linaro.org; Sat, 19 Jul 2014 19:35:20 +0000 X-IronPort-AV: E=Sophos;i="5.01,692,1400050800"; d="scan'208";a="39956884" Received: from irvexchcas07.broadcom.com (HELO IRVEXCHCAS07.corp.ad.broadcom.com) ([10.9.208.55]) by mail-gw2-out.broadcom.com with ESMTP; 19 Jul 2014 12:46:54 -0700 Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS07.corp.ad.broadcom.com (10.9.208.55) with Microsoft SMTP Server (TLS) id 14.3.174.1; Sat, 19 Jul 2014 12:37:45 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.3.174.1; Sat, 19 Jul 2014 12:37:45 -0700 Received: from localhost.localdomain (unknown [10.131.61.80]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 5BECA9F9F7; Sat, 19 Jul 2014 12:37:44 -0700 (PDT) From: To: Date: Sun, 20 Jul 2014 01:07:33 +0530 Message-ID: <1405798653-32492-1-git-send-email-venkatesh.vivekanandan@linaro.org> X-Mailer: git-send-email 1.8.1.2 MIME-Version: 1.0 X-Topics: patch Subject: [lng-odp] [PATCHv6 2/2] ODP-DPDK compilation fix X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: venkatesh.vivekanandan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Venkatesh Vivekanandan - Added new file platform/linux-dpdk/include/odp_debug.h - ODP_ASSERT complains of array getting a negative value. Root cause is, struct rte_mbuf { . . } __rte_cache_aligned; <-- this alignment causes the error. Since dpdk code can't be changed, added new file odp_debug.h as a temporary fix. Further analysis will be done and fixed cleanly later. Signed-off-by: Venkatesh Vivekanandan --- platform/linux-dpdk/include/odp_debug.h | 70 +++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 platform/linux-dpdk/include/odp_debug.h diff --git a/platform/linux-dpdk/include/odp_debug.h b/platform/linux-dpdk/include/odp_debug.h new file mode 100644 index 0000000..e37ca8d --- /dev/null +++ b/platform/linux-dpdk/include/odp_debug.h @@ -0,0 +1,70 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ +/** + * @file + * + * ODP debug + */ + +#ifndef ODP_DEBUG_H_ +#define ODP_DEBUG_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __GNUC__ + +/** + * Indicate deprecated variables, functions or types + */ +#define ODP_DEPRECATED __attribute__((__deprecated__)) + +/** + * Intentionally unused variables ot functions + */ +#define ODP_UNUSED __attribute__((__unused__)) + +#else + +#define ODP_DEPRECATED +#define ODP_UNUSED + +#endif + +/** + * Compile time assertion-macro - fail compilation if cond is false. + */ +#define ODP_ASSERT(cond, msg) typedef char msg[(cond) ? 1 : 0] + +/** + * Compile time assertion-macro - fail compilation if cond is false. + * @note This macro has zero runtime overhead + */ +#define ODP_STATIC_ASSERT(cond, msg) _static_assert(cond, msg) + +/** + * Debug printing macro, which prints output when DEBUG flag is set. + */ +#define ODP_DBG(fmt, ...) \ + do { if (ODP_DEBUG_PRINT == 1) \ + printf(fmt, ##__VA_ARGS__); \ + } while (0) + +/** + * Print output to stderr (file, line and function). + */ +#define ODP_ERR(fmt, ...) \ + fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \ + __LINE__, __func__, ##__VA_ARGS__) + +#ifdef __cplusplus +} +#endif + +#endif