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 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) From patchwork Thu Jul 25 11:06:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 169708 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp11491259ilk; Thu, 25 Jul 2019 04:08:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9Xi1ajvwqh9bQCGIX0cdkgKShGPIexz7Lcd5OfgcOqI6bROoPehAGkWfFk8eMp40WJzxD X-Received: by 2002:a17:906:454d:: with SMTP id s13mr68186600ejq.255.1564052884391; Thu, 25 Jul 2019 04:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564052884; cv=none; d=google.com; s=arc-20160816; b=YNUN2rZKr/rZs/GyXadj689vGw2JrOP8RUTXXA1ASsdiSG4VqJjXBxxV0ZVXk5qanJ Dh3+sYd4b7WZLuyZRupvAJKL7Xfk/ORSxvCGQwwG3Gy4yM6Bg5ypvX4pXDGZ7KdD90na Jnj9XYU46KIY8IU8Q4+cMq/QToTh+ft/89EgmIYyJMfcM2GeTzqLSMg6nit0Wr1RJefm ClEu5MSFEivqZ2+P1h8veTD4ansbKky+eYPFG6fJUnfpOYHbAcN2KQCSeaHM7lGQLvA6 CzMjOjiFuI+5clRFzgA4MEPFF4IfiHwW5lgUhxbUt3afVz3sg+6Uf2Ic5UkrGdwutIbM kZNA== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:cc:to:from; bh=dkjWroPH5jlSG+Ny7GiawTOnG/sXO9hv7Zp99y8LIvo=; b=J6JSuv48pBtZTqCLTJoFsn6TAwrWI+8iNPd44nXhc6wMmgFnPmh+U3bdY0AJkxCVCG hyXnNoD/+RU4ElWwOxz/Y7gVHEaumCfm/HUGjL3lxSfKI8KondW2/2LijpIRZa3LDRDU HPkvWm7eMHbXAdNtKBgxTDjpVfCQxKAaQuQFSIjRmhMgPUGepzOWZbgmFI2ecy+23/zW SEB1X+ANW5o50PYeov1dpl0T/ggnpOvvFnio8+JGIXA64pkUDHo8AFopRBnIfzMDtNr0 bWP0/fARpV3EFucoNFTZsbZLzmVnFSOV0scK0ZoXrmOL1W5UkaA+EcBSl6vB9R1WzYD0 SewQ== 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 t29si10879867edb.20.2019.07.25.04.08.04; Thu, 25 Jul 2019 04:08:04 -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 663D31C336; Thu, 25 Jul 2019 13:07:55 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 63AAA1C308; Thu, 25 Jul 2019 13:07:51 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id ED1F32006B1; Thu, 25 Jul 2019 13:07:50 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 63DFD2006AD; Thu, 25 Jul 2019 13:07:48 +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 C9E1540307; Thu, 25 Jul 2019 19:07:44 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, matan@mellanox.com Cc: stable@dpdk.org, Olivier Matz Date: Thu, 25 Jul 2019 16:36:45 +0530 Message-Id: <20190725110645.8817-3-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> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH BUG 335 3/3] net/virtio: 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, virito ethdev driver throws compilation error virtio_ethdev.c:1851:2: note: in expansion of macro ‘RTE_BUILD_BUG_ON’ RTE_BUILD_BUG_ON(RTE_PKTMBUF_HEADROOM < sizeof(struct virtio_net_hdr_mrg_rxbuf)); This patch change it into run-time check. Reported as: https://bugs.dpdk.org/show_bug.cgi?id=335 Fixes: 198ab33677c9 ("net/virtio: move device initialization in a function") Cc: stable@dpdk.org Cc: Olivier Matz Signed-off-by: Hemant Agrawal --- drivers/net/virtio/virtio_ethdev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.17.1 Acked-by: Maxime Coquelin diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 62c827443..3e2e8bd2a 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1848,7 +1848,14 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) struct virtio_hw *hw = eth_dev->data->dev_private; int ret; - RTE_BUILD_BUG_ON(RTE_PKTMBUF_HEADROOM < sizeof(struct virtio_net_hdr_mrg_rxbuf)); + if (sizeof(struct virtio_net_hdr_mrg_rxbuf) > RTE_PKTMBUF_HEADROOM) { + PMD_INIT_LOG(ERR, + "Not sufficient headroom required = %d, avail = %d", + (int)sizeof(struct virtio_net_hdr_mrg_rxbuf), + RTE_PKTMBUF_HEADROOM); + + return -1; + } eth_dev->dev_ops = &virtio_eth_dev_ops;