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 AFF13A034E; Thu, 6 Jan 2022 13:27:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 405CE4114F; Thu, 6 Jan 2022 13:27:40 +0100 (CET) Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) by mails.dpdk.org (Postfix) with ESMTP id 07EBA4114E for ; Thu, 6 Jan 2022 13:27:39 +0100 (CET) Received: by mail-il1-f172.google.com with SMTP id o1so1757937ilo.6 for ; Thu, 06 Jan 2022 04:27:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vQFAke/ks1ZnjpWMtWiL60d7Vn6j4ALvSltlG0KfJ4g=; b=KnS75axRPuL8pBeybH+c1u6SA2/qV15THBD8NpbTNTXr2Fk4RpFH4tjmytzaVGxEqt PywaXjlfjuz04iZpX/RG5uTbU5ShVuy0JED8YqXDGT2dPnBR66BVlw45ig9JwkttI1aY gFbmxJzZyaYIel439M7mHIkRi50Uox0C+DD1kn/rsLgS0qUXv5iFW53AuxmBuJx4lIDL nghWHOiX2PMQmZ+kqROooaKj00/55np1n9xh2Dx6tZGlC5OApClA5XeHN8lO/6/4sRTx nf/5JZ5jeBwxzNZWRbnuGYIahQSxDv21qjFZTMbxkW6aaA68yTZQuphQ4N95Sszu9vrI O1Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vQFAke/ks1ZnjpWMtWiL60d7Vn6j4ALvSltlG0KfJ4g=; b=z5JSWkBJlmmmJuPYZJ9aYxfpsnC5RmOTyaF7gzXI+FV4NUOpmKgne7FmwQ9+z7kVId aB0NzH7jVxStjGw60VtJTCU1j/crso5OQ3XlVjAPvEX6JAW9Pg4AVX7iKvkPCWXkpvhT ypdOX4Qm+WliSoWAx9gP5KVaMixTS/Z0HYFFw182Glkcdk08Na9rdwHMrzmDR7mxwZjV +/JKn7ywWFMWH2J1yBv+l7x+X9O1dbJ2Z8NH4zJmoae19P0zfgZneti5D1LnKX7GUKyF BG4FfIhQ1eURbeF4Snln/xNpM82UoH3JPqVsi2y61LRd50Xyp64YYj4xi3yJXZemduRS tfvw== X-Gm-Message-State: AOAM533rr0qwR44VFN4vwgM6dgY3v41R+gSU6F/hSgziAoRfBUU0x3Yd KT2vDwA4Bvy3lNq8mWqGpg+N1FTbzYgTTlWYuxU= X-Google-Smtp-Source: ABdhPJy6uPjAJhAGNLuvnVI4p5ROrMJJTzErx4lqNhukInShdPX4LscbEvXPey20e3vX+S+rckpeoui0rDTPhQ5g6o8= X-Received: by 2002:a05:6e02:1a2c:: with SMTP id g12mr27134120ile.192.1641472058382; Thu, 06 Jan 2022 04:27:38 -0800 (PST) MIME-Version: 1.0 References: <20211130054527.2696881-1-asekhar@marvell.com> In-Reply-To: <20211130054527.2696881-1-asekhar@marvell.com> From: Jerin Jacob Date: Thu, 6 Jan 2022 17:57:11 +0530 Message-ID: Subject: Re: [PATCH] common/cnxk: use cas with release semantics for batch alloc To: Ashwin Sekhar T K , Andrew Rybchenko , Ferruh Yigit Cc: dpdk-dev , Nithin Dabilpuram , Jerin Jacob , Sunil Kumar Kori , Satha Koteswara Rao Kottidi , Pavan Nikhilesh , Kiran Kumar K , Satheesh Paul , Anoob Joseph , Akhil Goyal Content-Type: text/plain; charset="UTF-8" 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, Nov 30, 2021 at 11:17 AM Ashwin Sekhar T K wrote: > > Before issuing the batch alloc, we clear the first word of > cache lines so that NPA can update the status. Make sure that > this line clear is flushed before the batch alloc is issued. > > Signed-off-by: Ashwin Sekhar T K Changed cas -> CAS in git commit Acked-by: Jerin Jacob Applied to dpdk-next-net-mrvl/for-next-net. Thanks > --- > drivers/common/cnxk/roc_io.h | 12 ++++++++++++ > drivers/common/cnxk/roc_io_generic.h | 9 +++++++++ > drivers/common/cnxk/roc_npa.h | 2 +- > 3 files changed, 22 insertions(+), 1 deletion(-) > > diff --git a/drivers/common/cnxk/roc_io.h b/drivers/common/cnxk/roc_io.h > index fe5f7f46d0..4f15503c29 100644 > --- a/drivers/common/cnxk/roc_io.h > +++ b/drivers/common/cnxk/roc_io.h > @@ -78,6 +78,18 @@ roc_atomic64_cas(uint64_t compare, uint64_t swap, int64_t *ptr) > return compare; > } > > +static __plt_always_inline uint64_t > +roc_atomic64_casl(uint64_t compare, uint64_t swap, int64_t *ptr) > +{ > + asm volatile(PLT_CPU_FEATURE_PREAMBLE > + "casl %[compare], %[swap], [%[ptr]]\n" > + : [compare] "+r"(compare) > + : [swap] "r"(swap), [ptr] "r"(ptr) > + : "memory"); > + > + return compare; > +} > + > static __plt_always_inline uint64_t > roc_atomic64_add_nosync(int64_t incr, int64_t *ptr) > { > diff --git a/drivers/common/cnxk/roc_io_generic.h b/drivers/common/cnxk/roc_io_generic.h > index ceaa3a38d8..5f90835c09 100644 > --- a/drivers/common/cnxk/roc_io_generic.h > +++ b/drivers/common/cnxk/roc_io_generic.h > @@ -41,6 +41,15 @@ roc_atomic64_cas(uint64_t compare, uint64_t swap, int64_t *ptr) > return compare; > } > > +static __plt_always_inline uint64_t > +roc_atomic64_casl(uint64_t compare, uint64_t swap, int64_t *ptr) > +{ > + PLT_SET_USED(swap); > + PLT_SET_USED(ptr); > + > + return compare; > +} > + > static inline uint64_t > roc_atomic64_add_nosync(int64_t incr, int64_t *ptr) > { > diff --git a/drivers/common/cnxk/roc_npa.h b/drivers/common/cnxk/roc_npa.h > index 46350fdb48..19b9a9352c 100644 > --- a/drivers/common/cnxk/roc_npa.h > +++ b/drivers/common/cnxk/roc_npa.h > @@ -218,7 +218,7 @@ roc_npa_aura_batch_alloc_issue(uint64_t aura_handle, uint64_t *buf, > cmp.compare_s.dis_wait = dis_wait; > cmp.compare_s.count = num; > > - res = roc_atomic64_cas(cmp.u, (uint64_t)buf, addr); > + res = roc_atomic64_casl(cmp.u, (uint64_t)buf, addr); > if (res != ALLOC_RESULT_ACCEPTED && res != ALLOC_RESULT_NOCORE) > return -1; > > -- > 2.32.0 >