summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemant Agrawal <hemant.agrawal@nxp.com>2019-07-25 16:36:44 +0530
committerKevin Traynor <ktraynor@redhat.com>2019-09-13 10:37:20 +0100
commitaae9f84f882732fafc37af9fc24b10b8a1d92251 (patch)
treec8e557634e1a15b70938dbf1f96fc17f93ae495c
parentee6f6640b6cf318405d8c06a7588ce4af172689c (diff)
downloaddpdk-stable-aae9f84f882732fafc37af9fc24b10b8a1d92251.zip
dpdk-stable-aae9f84f882732fafc37af9fc24b10b8a1d92251.tar.gz
dpdk-stable-aae9f84f882732fafc37af9fc24b10b8a1d92251.tar.xz
bus/fslmc: fix build with 0 headroom
[ upstream commit f4435e380d7cd51327051d2de3409ba83a2b690c ] 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: beb2a7865dda ("bus/fslmc: define hardware annotation area size") Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
-rw-r--r--drivers/bus/fslmc/portal/dpaa2_hw_pvt.h4
-rw-r--r--drivers/net/dpaa2/dpaa2_ethdev.c10
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index 2f52aca..473f779 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -67,10 +67,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 39f85ae..e326608 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -2098,6 +2098,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)