From patchwork Thu Jul 25 11:06:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 169707 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp11491152ilk; Thu, 25 Jul 2019 04:07:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqypHQA5WXTe8W3TlP5UU3IV4cFPAl+ESZpWp+irw3iKD5MZ+AfVJoU3FQ9oZ2cFHwMF6+ti X-Received: by 2002:a17:906:5391:: with SMTP id g17mr37606522ejo.61.1564052878937; Thu, 25 Jul 2019 04:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564052878; cv=none; d=google.com; s=arc-20160816; b=toGd7Zb+afSyE/DXxlmop/bXui9/nwVUGGvuVVbvYl+uyyGXjVOmGdV6xlUzqbJo5E 4EbPDvSbSL7UVZfzCO1Ywx5EakNdqgiH9v6Vadyo8FyBUDASX0p2xCceAF1+dOaq0Vau MJfRtMsklBjlvd9zvFnzM6DbqmbVQpkr/DTcXyQvooH6ZzAFN3TQBsiuH+sGpT6J3v0u RYllxjd4wj94eMUjpgn1iC8PssTeCHPQfbLGAG/XzcVVl4Xe+MF2tpnIQvaTE0W3x4Lq 6RSSDcrbsV4MQyENoQmoD0sjxdcxHrwStqqd1FpJaK2cFwcBjp0WLL7Rf0OgJ31/jsma +Eag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=oCsxHTIkhxXnjjAnG7+h1rYwQZ512aKMbUNacuVVmO0=; b=Ct47C92g3clOxhTYB4BDryNIZ+JccLxqHH6fkLcGSDvA1vkYBFrCgEICb/I3qnfvU1 8txmlGe8RFAo+EtL6eoIYrALw9RpCACFKn/N1DYsFoRKNbwbaVb4AevhvrEN4DYNlhbL Syxp0xWLE/G8qsqb/Fq44IroxnqQntak19DKHTov8DbFRMCa4wj39W8mUxxY+QEwUK9P qmpUKDeGvH6pHVELf+hbHTUxCiKP46iY04ogk8dV3tM/OhgS3bGKZ+zRrP/PXWer1PKV AckfEw2VdxgYZz73iDIyHCJ/1gNIfu2ym6HvFVkCd6AC++buLjpEKtvBZUDK50VBLH9T ps4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id k25si8929528ejz.54.2019.07.25.04.07.58; Thu, 25 Jul 2019 04:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2C5871C311; Thu, 25 Jul 2019 13:07:53 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 9C74E1C2FC; Thu, 25 Jul 2019 13:07:49 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5EE931A0052; Thu, 25 Jul 2019 13:07:49 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 43D011A00D9; Thu, 25 Jul 2019 13:07:47 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 37E7C40302; Thu, 25 Jul 2019 19:07:44 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, matan@mellanox.com Cc: stable@dpdk.org Date: Thu, 25 Jul 2019 16:36:44 +0530 Message-Id: <20190725110645.8817-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190725110645.8817-1-hemant.agrawal@nxp.com> References: <20190725110645.8817-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH BUG 335 2/3] bus/fslmc: fix compilation error with 0 headroom X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When using RTE_PKTMBUF_HEADROOM as 0, dpaa driver throws compilation error error "Annotation requirement is more than RTE_PKTMBUF_HEADROOM" This patch change it into run-time check. Reported as: https://bugs.dpdk.org/show_bug.cgi?id=335 Fixes: beb2a7865dda ("bus/fslmc: define hardware annotation area size") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 4 ---- drivers/net/dpaa2/dpaa2_ethdev.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 8644761db..4bb6b26c7 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -72,10 +72,6 @@ #define DPAA2_MBUF_HW_ANNOTATION 64 #define DPAA2_FD_PTA_SIZE 0 -#if (DPAA2_MBUF_HW_ANNOTATION + DPAA2_FD_PTA_SIZE) > RTE_PKTMBUF_HEADROOM -#error "Annotation requirement is more than RTE_PKTMBUF_HEADROOM" -#endif - /* we will re-use the HEADROOM for annotation in RX */ #define DPAA2_HW_BUF_RESERVE 0 #define DPAA2_PACKET_LAYOUT_ALIGN 64 /*changing from 256 */ diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 03f69599c..dd6a78f9f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -2319,6 +2319,16 @@ rte_dpaa2_probe(struct rte_dpaa2_driver *dpaa2_drv, struct rte_eth_dev *eth_dev; int diag; + if ((DPAA2_MBUF_HW_ANNOTATION + DPAA2_FD_PTA_SIZE) > + RTE_PKTMBUF_HEADROOM) { + DPAA2_PMD_ERR( + "RTE_PKTMBUF_HEADROOM(%d) shall be > DPAA2 Annotation req(%d)", + RTE_PKTMBUF_HEADROOM, + DPAA2_MBUF_HW_ANNOTATION + DPAA2_FD_PTA_SIZE); + + return -1; + } + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { eth_dev = rte_eth_dev_allocate(dpaa2_dev->device.name); if (!eth_dev)