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 8A4BC46128; Fri, 24 Jan 2025 15:27:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A3FD40E48; Fri, 24 Jan 2025 15:27:32 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id EFB81402A3 for ; Fri, 24 Jan 2025 15:27:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737728850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Ho9IqH34wPAkC+Lr7OcqJFxuX5ojd0AQuJLlRL4zko=; b=iVvV0hbq1p2PxpAFNyfIu5DEdLgjlaW6RagVvKmLq7WHUb5qTAL8uUBpkE387+IF+uN6k2 PKt53q5gtPi2Er+ec3WhAXfhTDBMALUJFv5F1Y1xHxmb7ZoxqZpsi3QZAuag1A2SkATIy8 hd+PFh2u5Qp6CD6z8zJcw0qH12aRHSU= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-587-Momgj-a_Pi6Neo7FM50QgA-1; Fri, 24 Jan 2025 09:27:19 -0500 X-MC-Unique: Momgj-a_Pi6Neo7FM50QgA-1 X-Mimecast-MFC-AGG-ID: Momgj-a_Pi6Neo7FM50QgA Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-3022cd152cdso11252931fa.1 for ; Fri, 24 Jan 2025 06:27:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737728838; x=1738333638; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+Ho9IqH34wPAkC+Lr7OcqJFxuX5ojd0AQuJLlRL4zko=; b=KDZoR0Va8FvfVuFKP1DdGa7G+2o+SrEoDaIhjO7oJQFGOhV7t+FW/G/H/qDjUfcUWs l+0YOHgMRnhPDTTcIFFBtoBdl7ZNTX++m1I7wj5HsP00pqu3Iitkraq3nyMxtDu2C574 1qphjL5HSCjiSPXeeQOxYl4Qbz5Ol6FpGZAY3+hB3cUBw34iUMRYNcRb/XX48oXU9ig6 GonYigrSms0KWKh4NA5SYOWUciojATqddYzVt3NbmzUtEKJfUl+qksLWfqH3oGxiLIS0 z2biX5SoJ505eN+rPDL9wOdYi/J/W3pqQ7wXjOr8gnilLDD6Kp734sDesXGb/u5LsdYQ LWEw== X-Forwarded-Encrypted: i=1; AJvYcCUtjedU31JRKWNQQXnVUPV79UJyb12133jdoRqIh42Mq8w2fFvqguRmXV77K8Ku/Enl0y8=@dpdk.org X-Gm-Message-State: AOJu0YyBCGeMawLd7bkmdvX/sG7i/hoxjzoioNanl8jRRf1T3qiw50Yw yK5SaTf12K9IZFJND4KS3lJdMF7fYcYCP0tiA+NspGzt8kI96/U3sX0I50Z84SexusQX4nNQLMj FsUzopd64VRWluqt9zqtbVvrbtdwNrF/bbiWvop7gs6y5u5aGpBUj2LAAZu0Sm5X4xBfwzA1Y6O U9T/brf4k5WwaeKyM= X-Gm-Gg: ASbGncuYnUwLSbgzF8v9tIMjJ69iJIj7jgRQtKDw/VwupNy/61ay8ehaRT6UN+SfcWZ McSuNTx/xG6c7L/y271tVoTXUZWTQRBu4J1eaZh2gdyldHE65mXOmRw== X-Received: by 2002:a2e:a987:0:b0:302:3d74:a1af with SMTP id 38308e7fff4ca-3072ca99b62mr120797341fa.20.1737728837889; Fri, 24 Jan 2025 06:27:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlWNLq7EDGzK5Of/ug8LS4+5YzKWzyIPEhwu2AZrPW6dmnShgjFkgIyBAEIwTeceMfa8LHYuUOqP+XKtsM5Sc= X-Received: by 2002:a2e:a987:0:b0:302:3d74:a1af with SMTP id 38308e7fff4ca-3072ca99b62mr120797221fa.20.1737728837474; Fri, 24 Jan 2025 06:27:17 -0800 (PST) MIME-Version: 1.0 References: <1733848355-19048-1-git-send-email-andremue@linux.microsoft.com> <1733848355-19048-2-git-send-email-andremue@linux.microsoft.com> In-Reply-To: <1733848355-19048-2-git-send-email-andremue@linux.microsoft.com> From: David Marchand Date: Fri, 24 Jan 2025 15:27:06 +0100 X-Gm-Features: AWEUYZkywSPbCjtU2YwLuoKILvJaXddGt57vHUDWQ-h7WQvxiONKQy_UEXLOUzg Message-ID: Subject: Re: [PATCH 1/3] lib/eal: add rte_atomic128_cmp_exchange compatible with MSVC To: Andre Muezerie Cc: Bruce Richardson , Konstantin Ananyev , dev@dpdk.org, Tyler Retzlaff X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 74iBy8YcLB_KbvlQlGPMM7nC-HIxwaLGocABpYZq3c8_1737728838 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Tue, Dec 10, 2024 at 5:33=E2=80=AFPM Andre Muezerie wrote: > > MSVC does not support inline assembly, which is used by the > implementation of rte_atomic128_cmp_exchange and is needed > by lib/stack. > > Error printed by MSVC: > > stack_rte_stack_lf.c.obj : error LNK2019: > unresolved external symbol rte_atomic128_cmp_exchange referenced > in function __rte_stack_lf_push_elems > > Fix is to provide an implementation for rte_atomic128_cmp_exchange > which uses an intrinsic function, which is used when compiling with > MSVC. For other compilers the existing implementation continues to > be used. > > Signed-off-by: Andre Muezerie > --- > lib/eal/x86/include/rte_atomic.h | 4 ++-- > lib/eal/x86/include/rte_atomic_64.h | 18 ++++++++++++++++++ > 2 files changed, 20 insertions(+), 2 deletions(-) > > diff --git a/lib/eal/x86/include/rte_atomic.h b/lib/eal/x86/include/rte_a= tomic.h > index c72c47c83e..e8e0e4c33c 100644 > --- a/lib/eal/x86/include/rte_atomic.h > +++ b/lib/eal/x86/include/rte_atomic.h > @@ -288,12 +288,12 @@ static inline int rte_atomic32_dec_and_test(rte_ato= mic32_t *v) > > #endif > > +#endif /* RTE_TOOLCHAIN_MSVC */ > + > #ifdef RTE_ARCH_I686 > #include "rte_atomic_32.h" > #else > #include "rte_atomic_64.h" > #endif > > -#endif > - This partially reverts 27da6a123414 ("eal: hide legacy atomics API for MSVC= "). It would be better to implement an equivalent to rte_atomic128_cmp_exchange in the DPDK "new" stdatomic API (rte_stdatomic.h). --=20 David Marchand