From patchwork Thu Jul 25 11:06:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 169706 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp11490982ilk; Thu, 25 Jul 2019 04:07:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyITm6xG5XkEL/2y1njt1SMrAe3zggk2Tr/wKSCRKHe9TnZYfQDOTHGLxcbQWhx5ytzF3pU X-Received: by 2002:a17:906:31c9:: with SMTP id f9mr67988538ejf.168.1564052870735; Thu, 25 Jul 2019 04:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564052870; cv=none; d=google.com; s=arc-20160816; b=k92mFX61b9ZhCHPugtpsYLAk83AXqLoQhOYd8SDvmvdZvu+me/Yc79Yhgyr239cU+I 47rha3GPekMx0exTz7XMjIoN6eUmVTymsKiGcxUE1SHfG9JxKcdXpo2SR0blkuvd3NLY 1v7nztCqupeYxgkXPLVkm+eJJW9E5kqh4dN1g6RVh280EPL7vNffwRl79aG82oeCSfKI AGVn3Jsl3naZZ6SR6V5+Bh0LgNRoh7R0Qu86KLg7ELnve9ctZMJqMM8cQMGWwiCBOU70 sR/SskDxu+s2ad+kle06TjhhJ+Yxbwoa9RMOhyiQLEBGYOB/Kh02AuXS4g4Ywn8/1AcZ ZpeA== 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:message-id:date:cc:to :from; bh=HGzDT8gjtyUlM6gO1xxIsyE1qymPOAlKLlGhJXoGMbw=; b=W1XRpXKKAjnRlQ26LAkAAEeuxB48b3l+eMYqVpzN/KtGsf1WRYkNc9IHNGbrHRqx2N x4W7huRdf8PNQuHiWZo0fwxGLbk+gJC3PwUD+ihRGpF3EeVXCE5jiRXyaW43dYr6ovTv 5k69erVcCv1t6/CsJJqaTNiZ67P8X3UDVFnJqpUTS4VH9D4Q0iwNon7kOU12wvHDfzKj COTEaKfBg+GrXc20MMMmsooL3fxrpz1u8vyQ0uQe/ixt3r7ikDb2fdWNr2D1DO1P9iMA ObzTxCWtn1U+0O+nfNiM1kM8HsO09LR8Ds/znlBoyC76Zbg/XsbGw06X7iD9sN2szg8y u82A== 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 h4si5483460ejj.127.2019.07.25.04.07.50; Thu, 25 Jul 2019 04:07:50 -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 3EBEF1C2FD; Thu, 25 Jul 2019 13:07:50 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 280C51C2FC; 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 BE8EA1A0069; Thu, 25 Jul 2019 13:07:48 +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 A66941A0052; Thu, 25 Jul 2019 13:07:46 +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 9BDD2402F6; Thu, 25 Jul 2019 19:07:43 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, matan@mellanox.com Cc: stable@dpdk.org Date: Thu, 25 Jul 2019 16:36:43 +0530 Message-Id: <20190725110645.8817-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH BUG 335 1/3] net/dpaa: 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: ff9e112d7870 ("net/dpaa: add NXP DPAA PMD driver skeleton") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 10 ++++++++++ drivers/net/dpaa/dpaa_ethdev.h | 4 ---- 2 files changed, 10 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index adc0bd5ac..7154fb9b4 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1469,6 +1469,16 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused, PMD_INIT_FUNC_TRACE(); + if ((DPAA_MBUF_HW_ANNOTATION + DPAA_FD_PTA_SIZE) > + RTE_PKTMBUF_HEADROOM) { + DPAA_PMD_ERR( + "RTE_PKTMBUF_HEADROOM(%d) shall be > DPAA Annotation req(%d)", + RTE_PKTMBUF_HEADROOM, + DPAA_MBUF_HW_ANNOTATION + DPAA_FD_PTA_SIZE); + + return -1; + } + /* In case of secondary process, the device is already configured * and no further action is required, except portal initialization * and verifying secondary attachment to port name. diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 18bc7dfa8..f63a5f164 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -22,10 +22,6 @@ #define DPAA_MBUF_HW_ANNOTATION 64 #define DPAA_FD_PTA_SIZE 64 -#if (DPAA_MBUF_HW_ANNOTATION + DPAA_FD_PTA_SIZE) > RTE_PKTMBUF_HEADROOM -#error "Annotation requirement is more than RTE_PKTMBUF_HEADROOM" -#endif - /* mbuf->seqn will be used to store event entry index for * driver specific usage. For parallel mode queues, invalid * index will be set and for atomic mode queues, valid value