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 4732A45B42; Tue, 15 Oct 2024 17:05:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D14AE400D7; Tue, 15 Oct 2024 17:05:02 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 40B10400D6 for ; Tue, 15 Oct 2024 17:05:02 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 00D1E21B39; Tue, 15 Oct 2024 17:05:01 +0200 (CEST) Subject: RE: [PATCH v5 1/6] ring: common functions for 'move head' ops Date: Tue, 15 Oct 2024 17:04:59 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F7E1@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable In-Reply-To: <20241015130111.826-2-konstantin.v.ananyev@yandex.ru> X-MS-Has-Attach: Content-class: urn:content-classes:message X-MS-TNEF-Correlator: Thread-Topic: [PATCH v5 1/6] ring: common functions for 'move head' ops Thread-Index: AdsfAljfqBcUzvd4Rn6rAPoNrUWodQAEGY3g References: <20240917120946.1212-1-konstantin.v.ananyev@yandex.ru> <20241015130111.826-1-konstantin.v.ananyev@yandex.ru> <20241015130111.826-2-konstantin.v.ananyev@yandex.ru> From: =?iso-8859-1?Q?Morten_Br=F8rup?= X-MimeOLE: Produced By Microsoft Exchange V6.5 To: "Konstantin Ananyev" , Cc: , , , , , , , , "Konstantin Ananyev" 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 > From: Konstantin Ananyev [mailto:konstantin.v.ananyev@yandex.ru] > Sent: Tuesday, 15 October 2024 15.01 Cleaning up is good. :-) Only a few initial comments; haven't reviewed in depth. > +__rte_ring_headtail_move_head(struct rte_ring_headtail *d, > + const struct rte_ring_headtail *s, uint32_t capacity, > + unsigned int is_st, unsigned int n, > + enum rte_ring_queue_behavior behavior, > + uint32_t *old_head, uint32_t *new_head, uint32_t *entries) No description for the new function? Also in the other files. > { > - const uint32_t capacity =3D r->capacity; > - uint32_t cons_tail; > - unsigned int max =3D n; > + uint32_t stail; > int success; > + unsigned int max =3D n; >=20 > - *old_head =3D rte_atomic_load_explicit(&r->prod.head, > rte_memory_order_relaxed); > + *old_head =3D rte_atomic_load_explicit(&d->head, > + rte_memory_order_relaxed); > do { > /* Reset n to the initial burst count */ > n =3D max; > @@ -73,112 +51,36 @@ __rte_ring_move_prod_head(struct rte_ring *r, > unsigned int is_sp, > /* load-acquire synchronize with store-release of ht->tail > * in update_tail. > */ > - cons_tail =3D rte_atomic_load_explicit(&r->cons.tail, > + stail =3D rte_atomic_load_explicit(&s->tail, > rte_memory_order_acquire); >=20 > /* The subtraction is done between two unsigned 32bits > value > * (the result is always modulo 32 bits even if we have > - * *old_head > cons_tail). So 'free_entries' is always > between 0 > + * *old_head > s->tail). So 'free_entries' is always > between 0 The comment refers to 'free_entries', which was renamed to 'entries' in = the code. Also in the other files.