From: Hemant Agrawal Date: Thu, 25 Jul 2019 11:06:43 +0000 (+0530) Subject: net/dpaa: fix build with 0 headroom X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=47854c180349c3d41690e60aea9458a864572389;p=dpdk.git net/dpaa: fix build with 0 headroom 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. Bugzilla ID: 335 Fixes: ff9e112d7870 ("net/dpaa: add NXP DPAA PMD driver skeleton") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index adc0bd5ac9..7154fb9b4c 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 18bc7dfa8e..f63a5f164e 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