Skip to content

Commit

Permalink
bus/fslmc: fix build with 0 headroom
Browse files Browse the repository at this point in the history
[ upstream commit f4435e3 ]

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: beb2a78 ("bus/fslmc: define hardware annotation area size")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  • Loading branch information
hemantagr authored and kevintraynor committed Sep 4, 2019
1 parent 205ce87 commit c52e584
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
Expand Up @@ -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 */
Expand Down
10 changes: 10 additions & 0 deletions drivers/net/dpaa2/dpaa2_ethdev.c
Expand Up @@ -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)
Expand Down

0 comments on commit c52e584

Please sign in to comment.