From: Stephen Hemminger Date: Mon, 9 Feb 2015 01:14:00 +0000 (+0800) Subject: virtio: check packet headroom at compile time X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=dec08c28c0b3;p=dpdk.git virtio: check packet headroom at compile time Better to check at compile time than fail at runtime. Signed-off-by: Stephen Hemminger Signed-off-by: Changchun Ouyang Acked-by: Huawei Xie --- diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c index 662a49ca89..427341b2dd 100644 --- a/lib/librte_pmd_virtio/virtio_ethdev.c +++ b/lib/librte_pmd_virtio/virtio_ethdev.c @@ -859,11 +859,7 @@ eth_virtio_dev_init(__rte_unused struct eth_driver *eth_drv, struct virtio_hw *hw = VIRTIO_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); - if (RTE_PKTMBUF_HEADROOM < sizeof(struct virtio_net_hdr)) { - PMD_INIT_LOG(ERR, - "MBUF HEADROOM should be enough to hold virtio net hdr\n"); - return -1; - } + RTE_BUILD_BUG_ON(RTE_PKTMBUF_HEADROOM < sizeof(struct virtio_net_hdr)); eth_dev->dev_ops = &virtio_eth_dev_ops; eth_dev->tx_pkt_burst = &virtio_xmit_pkts;