From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E2A1345E32; Wed, 4 Dec 2024 20:09:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A50140A6D; Wed, 4 Dec 2024 20:09:15 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 349B5402EF for ; Wed, 4 Dec 2024 20:09:13 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 3DF0720BCAF9; Wed, 4 Dec 2024 11:09:12 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3DF0720BCAF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1733339352; bh=PQ2eACQhjetYLgatc/2PyIu8qmUrnp6Zvfc4avPNmOM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kNY77Gir695Hv2fNkcuDBtdVPqugfzHf0gjqAcSDB3r8952jjS7yQtE47in4EXvBE tP3uIr6MaSWCpZkYSn07cqL/+B2G+o2qsaSr82t3uIr1/JZyHRm9DRx/KyU7DpNsKU a+RgJyxp9U24RBTvhwpmpJ+dPkB6OTrsf707jBaw= Date: Wed, 4 Dec 2024 11:09:12 -0800 From: Andre Muezerie To: Bruce Richardson Cc: David Marchand , Vladimir Medvedkin , dev@dpdk.org Subject: Re: [PATCH] lib/lpm: use standard atomic_store_explicit Message-ID: <20241204190912.GA27343@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1733278801-19296-1-git-send-email-andremue@linux.microsoft.com> <20241204162019.GA28551@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Dec 04, 2024 at 04:52:43PM +0000, Bruce Richardson wrote: > On Wed, Dec 04, 2024 at 08:20:19AM -0800, Andre Muezerie wrote: > > On Wed, Dec 04, 2024 at 08:56:35AM +0100, David Marchand wrote: > > > Hello Andre, > > > > > > On Wed, Dec 4, 2024 at 3:20 AM Andre Muezerie > > > wrote: > > > > > > > > MSVC issues the warning below: > > > > > > > > ../lib/lpm/rte_lpm.c(297): warning C4013 > > > > '__atomic_store' undefined; assuming extern returning int > > > > ../lib/lpm/rte_lpm.c(298): error C2065: > > > > '__ATOMIC_RELAXED': undeclared identifier > > > > > > > > The fix is to use standard atomic_store_explicit() instead of > > > > gcc specific __atomic_store(). > > > > atomic_store_explicit() was already being used in other parts > > > > of DPDK and is compatible > > > > with many compilers, including MSVC. > > > > > > > > Signed-off-by: Andre Muezerie > > > > > > With this change, is there anything remaining that blocks this library > > > compilation with MSVC? > > > If not, please update meson.build so that CI can test lpm compilation > > > with MSVC on this patch (and that will detect regressions once > > > merged). > > > > > > > > > -- > > > David Marchand > > > > Hi David, > > > > I'm eager to enable lpm to be compiled with MSVC. Even though > > this was the last issue I observed for this lib on my machine, > > lpm depends on hash, which depends on net, which depends on mbuf and > > mbuf is not enabled for MSVC yet. > > > I was a bit curious about this dependency chain and decided to investigate > a bit. The "weak link" in this chain appears to me to be the link between > the hash library and the net library. Within the hash library, I believe > only the thash functionality depends on net, for definitions of the ipv6 > headers and address fields. > > If we want to break that dependency (temporarily, since net is pretty much > an essential DPDK lib), the following patch should work. > > Regards, > /Bruce > > diff --git a/lib/hash/meson.build b/lib/hash/meson.build > index e6cb1ebe3b..f9096edd67 100644 > --- a/lib/hash/meson.build > +++ b/lib/hash/meson.build > @@ -6,24 +6,34 @@ headers = files( > 'rte_hash_crc.h', > 'rte_hash.h', > 'rte_jhash.h', > - 'rte_thash.h', > - 'rte_thash_gfni.h', > ) > indirect_headers += files( > 'rte_crc_arm64.h', > 'rte_crc_generic.h', > 'rte_crc_sw.h', > 'rte_crc_x86.h', > - 'rte_thash_x86_gfni.h', > ) > > sources = files( > 'rte_cuckoo_hash.c', > 'rte_hash_crc.c', > 'rte_fbk_hash.c', > +) > + > +deps = ['rcu'] > + > +if dpdk_conf.has('RTE_LIB_NET') > + headers += files( > + 'rte_thash.h', > + 'rte_thash_gfni.h', > + ) > + indirect_headers += files( > + 'rte_thash_x86_gfni.h', > + ) > + sources += files( > 'rte_thash.c', > 'rte_thash_gfni.c', > 'rte_thash_gf2_poly_math.c', > -) > - > -deps = ['net', 'rcu'] > + ) > + deps += ['net'] > +endif That's a great suggestion. Unfortunately hash also directly depends on rcu, which is also not yet enabled for MSVC due to pending reviews. Regards, Andre Muezerie