From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E3A2A046B for ; Fri, 26 Jul 2019 14:24:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8EA8F1C438; Fri, 26 Jul 2019 14:24:23 +0200 (CEST) Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id B0D9E1C431; Fri, 26 Jul 2019 14:24:21 +0200 (CEST) Received: from lfbn-lil-1-176-160.w90-45.abo.wanadoo.fr ([90.45.26.160] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hqzJs-0000gL-Ik; Fri, 26 Jul 2019 14:27:34 +0200 Received: by droids-corp.org (sSMTP sendmail emulation); Fri, 26 Jul 2019 14:25:38 +0200 Date: Fri, 26 Jul 2019 14:25:38 +0200 From: Olivier Matz To: Hemant Agrawal Cc: dev@dpdk.org, matan@mellanox.com, stable@dpdk.org, Stephen Hemminger Message-ID: <20190726122538.GC4485@neon> References: <20190725110645.8817-1-hemant.agrawal@nxp.com> <20190725110645.8817-3-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190725110645.8817-3-hemant.agrawal@nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH BUG 335 3/3] net/virtio: fix compilation error with 0 headroom X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, On Thu, Jul 25, 2019 at 04:36:45PM +0530, Hemant Agrawal wrote: > When using RTE_PKTMBUF_HEADROOM as 0, virito ethdev driver throws > compilation error > virtio_ethdev.c:1851:2: note: in expansion of macro ‘RTE_BUILD_BUG_ON’ > RTE_BUILD_BUG_ON(RTE_PKTMBUF_HEADROOM > < sizeof(struct virtio_net_hdr_mrg_rxbuf)); > > This patch change it into run-time check. > Reported as: https://bugs.dpdk.org/show_bug.cgi?id=335 > > Fixes: 198ab33677c9 ("net/virtio: move device initialization in a function") I think the proper commit is: Fixes: dec08c28c0b3 ("virtio: check packet headroom at compile time") It looks this patch more or less reverts this old commit. +CC Stephen > Cc: stable@dpdk.org > Cc: Olivier Matz > > Signed-off-by: Hemant Agrawal > --- > drivers/net/virtio/virtio_ethdev.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index 62c827443..3e2e8bd2a 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1848,7 +1848,14 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) > struct virtio_hw *hw = eth_dev->data->dev_private; > int ret; > > - RTE_BUILD_BUG_ON(RTE_PKTMBUF_HEADROOM < sizeof(struct virtio_net_hdr_mrg_rxbuf)); > + if (sizeof(struct virtio_net_hdr_mrg_rxbuf) > RTE_PKTMBUF_HEADROOM) { > + PMD_INIT_LOG(ERR, > + "Not sufficient headroom required = %d, avail = %d", > + (int)sizeof(struct virtio_net_hdr_mrg_rxbuf), > + RTE_PKTMBUF_HEADROOM); > + > + return -1; > + } > > eth_dev->dev_ops = &virtio_eth_dev_ops; > > -- > 2.17.1 >