From patchwork Wed Sep 15 21:40:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 98959 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D246DA0C41; Wed, 15 Sep 2021 23:41:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9E9F410E7; Wed, 15 Sep 2021 23:41:08 +0200 (CEST) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by mails.dpdk.org (Postfix) with ESMTP id 13B4E41109 for ; Wed, 15 Sep 2021 23:41:07 +0200 (CEST) Received: by mail-lf1-f54.google.com with SMTP id y28so10088977lfb.0 for ; Wed, 15 Sep 2021 14:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qQ68Ik6DTrBmJa8/GbTD2ABGc9AIBAKgl+SNiDC/JDY=; b=SlPsz159D49XvhYU0EtJXdcdXPoJTD7TLuFtGodfmDoabwGBvtUpOjzh1BFt+Yx5wg AxyyAn1wRPT1RQcgth+Hf8SzUT5K5qtwNORQ3ejiKre5LsZTKuRWeN9k7Pzh6hzNRzEs 9BYgHVxV0ERsrdB5R36to6iNonJbflYJR7PgqL+zaLEelfjJt1ZrLyQKfuzDs9HGRukB eFSkFA6TAxunRDoXoBjkpf22b6ojI8kZ2Bk2/MXq8CIDUkzEG0zmHhxHLmGa2X+cjIs6 XvtmYfRPd+mBHQTjnILAhELisrTwgqBf2aQrRGpSGtbGeYuKxKjukR8w13Rmq3e3sDXR 56Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qQ68Ik6DTrBmJa8/GbTD2ABGc9AIBAKgl+SNiDC/JDY=; b=YotK5X7QBX721zI7Px9JvthbQPpMVTfUDNWN+rwdsmniCTGNSF6E31rOl95E3OPd6I LgsaA0RVxEV/29junh27Z7gNhNElZz/cTs5htLz6BrcWgU+5rJceh70z97t3lRoIPqoy +clRvJN7DHidf+PGme6EZokH3FX4h+0qxusqAlNL2wuruoes8caB5/WUUuEW5v7wk8ZV OJbsO0AqbO7wMTlQ5ZzyHaBRSbJ9rVlhXfGpRrfvJjUO0tYjOoBQW8BcbIZryq7Z7idR oA9QM3BORfcq5mG1zdzqEjy+9GkOr7M1wG6Kfxwte8rC7niiEy1LZ/afu6A/YqiT//OG o9fQ== X-Gm-Message-State: AOAM531jea+SnIRTbAf2kb2x9Q7KPLIc30oL7ISXUfbeXhNwZeTLpKBM 2gV9dxwitDKJIShNa7Grvkq1bPGmyt2uQQ== X-Google-Smtp-Source: ABdhPJxynYl7sHGHh9YQE75DikS0vlZx5QvKEsvGrrEWbG0510qUXuo1u3RlipKi7k3T4oiyT4ldIw== X-Received: by 2002:a2e:b4a5:: with SMTP id q5mr1824066ljm.11.1631742066328; Wed, 15 Sep 2021 14:41:06 -0700 (PDT) Received: from sovereign.. (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id o4sm85989lfi.16.2021.09.15.14.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 14:41:04 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk , Honnappa Nagarahalli , Konstantin Ananyev Date: Thu, 16 Sep 2021 00:40:51 +0300 Message-Id: <20210915214052.143098-5-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.3 In-Reply-To: <20210915214052.143098-1-dmitry.kozliuk@gmail.com> References: <20210915214052.143098-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 4/5] ring: rename local variables for Windows compatibility 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 Sender: "dev" Windows SDK headers define `max` macro which breaks the definitions of `max` variable inside inline functions. Rename the variables to allow inclusion of both DPDK and Windows headers in the same file. Signed-off-by: Dmitry Kozlyuk Reviewed-by: Honnappa Nagarahalli --- lib/ring/rte_ring_c11_pvt.h | 8 ++++---- lib/ring/rte_ring_generic_pvt.h | 8 ++++---- lib/ring/rte_ring_rts_elem_pvt.h | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/ring/rte_ring_c11_pvt.h b/lib/ring/rte_ring_c11_pvt.h index 37e0b2afd6..ec6be12154 100644 --- a/lib/ring/rte_ring_c11_pvt.h +++ b/lib/ring/rte_ring_c11_pvt.h @@ -58,13 +58,13 @@ __rte_ring_move_prod_head(struct rte_ring *r, unsigned int is_sp, { const uint32_t capacity = r->capacity; uint32_t cons_tail; - unsigned int max = n; + unsigned int maximum = n; int success; *old_head = __atomic_load_n(&r->prod.head, __ATOMIC_RELAXED); do { /* Reset n to the initial burst count */ - n = max; + n = maximum; /* Ensure the head is read before tail */ __atomic_thread_fence(__ATOMIC_ACQUIRE); @@ -132,7 +132,7 @@ __rte_ring_move_cons_head(struct rte_ring *r, int is_sc, uint32_t *old_head, uint32_t *new_head, uint32_t *entries) { - unsigned int max = n; + unsigned int maximum = n; uint32_t prod_tail; int success; @@ -140,7 +140,7 @@ __rte_ring_move_cons_head(struct rte_ring *r, int is_sc, *old_head = __atomic_load_n(&r->cons.head, __ATOMIC_RELAXED); do { /* Restore n as it may change every loop */ - n = max; + n = maximum; /* Ensure the head is read before tail */ __atomic_thread_fence(__ATOMIC_ACQUIRE); diff --git a/lib/ring/rte_ring_generic_pvt.h b/lib/ring/rte_ring_generic_pvt.h index c95ad7e12c..beb3140e78 100644 --- a/lib/ring/rte_ring_generic_pvt.h +++ b/lib/ring/rte_ring_generic_pvt.h @@ -58,12 +58,12 @@ __rte_ring_move_prod_head(struct rte_ring *r, unsigned int is_sp, uint32_t *free_entries) { const uint32_t capacity = r->capacity; - unsigned int max = n; + unsigned int maximum = n; int success; do { /* Reset n to the initial burst count */ - n = max; + n = maximum; *old_head = r->prod.head; @@ -127,13 +127,13 @@ __rte_ring_move_cons_head(struct rte_ring *r, unsigned int is_sc, uint32_t *old_head, uint32_t *new_head, uint32_t *entries) { - unsigned int max = n; + unsigned int maximum = n; int success; /* move cons.head atomically */ do { /* Restore n as it may change every loop */ - n = max; + n = maximum; *old_head = r->cons.head; diff --git a/lib/ring/rte_ring_rts_elem_pvt.h b/lib/ring/rte_ring_rts_elem_pvt.h index 7164213ee0..6241f28dc0 100644 --- a/lib/ring/rte_ring_rts_elem_pvt.h +++ b/lib/ring/rte_ring_rts_elem_pvt.h @@ -53,11 +53,11 @@ static __rte_always_inline void __rte_ring_rts_head_wait(const struct rte_ring_rts_headtail *ht, union __rte_ring_rts_poscnt *h) { - uint32_t max; + uint32_t maximum; - max = ht->htd_max; + maximum = ht->htd_max; - while (h->val.pos - ht->tail.val.pos > max) { + while (h->val.pos - ht->tail.val.pos > maximum) { rte_pause(); h->raw = __atomic_load_n(&ht->head.raw, __ATOMIC_ACQUIRE); }