summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemant Agrawal <hemant.agrawal@nxp.com>2019-07-25 16:36:43 +0530
committerKevin Traynor <ktraynor@redhat.com>2019-09-13 10:37:20 +0100
commitee6f6640b6cf318405d8c06a7588ce4af172689c (patch)
tree021a0853f8cc0e23094e0d287efd6dac723de040
parentc336efcff6b519e73c555b671788c93db865fb34 (diff)
downloaddpdk-stable-ee6f6640b6cf318405d8c06a7588ce4af172689c.zip
dpdk-stable-ee6f6640b6cf318405d8c06a7588ce4af172689c.tar.gz
dpdk-stable-ee6f6640b6cf318405d8c06a7588ce4af172689c.tar.xz
net/dpaa: fix build with 0 headroom
[ upstream commit 47854c180349c3d41690e60aea9458a864572389 ] 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") Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
-rw-r--r--drivers/net/dpaa/dpaa_ethdev.c10
-rw-r--r--drivers/net/dpaa/dpaa_ethdev.h4
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 5448a2c..5fbf152 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1460,6 +1460,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 2fc7231..acbcaf6 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -21,10 +21,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