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 98353A0613 for ; Tue, 30 Jul 2019 15:35:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 65E7B1C134; Tue, 30 Jul 2019 15:35:36 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id ED7271B952; Tue, 30 Jul 2019 15:35:31 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C8F1730872DD; Tue, 30 Jul 2019 13:35:30 +0000 (UTC) Received: from [10.36.112.28] (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FC055D96F; Tue, 30 Jul 2019 13:35:28 +0000 (UTC) To: Olivier Matz , Hemant Agrawal Cc: dev@dpdk.org, matan@mellanox.com, stable@dpdk.org, Stephen Hemminger References: <20190725110645.8817-1-hemant.agrawal@nxp.com> <20190725110645.8817-3-hemant.agrawal@nxp.com> <20190726122538.GC4485@neon> From: Maxime Coquelin Message-ID: Date: Tue, 30 Jul 2019 15:35:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190726122538.GC4485@neon> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 30 Jul 2019 13:35:31 +0000 (UTC) Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH BUG 335 3/3] net/virtio: fix compilation error with 0 headroom X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 7/26/19 2:25 PM, Olivier Matz wrote: > 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") Indeed. > It looks this patch more or less reverts this old commit. > +CC Stephen I wonder whether we could have a warning at build time so that the one who builds DPDK is aware some driver may not be usable, in addition to the below patch that fails virtio-net init. Any thoughts? Thanks, Maxime >> 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 >> >