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 66FCF43F05; Thu, 25 Apr 2024 16:03:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 52BF7435F4; Thu, 25 Apr 2024 16:03:17 +0200 (CEST) Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) by mails.dpdk.org (Postfix) with ESMTP id D8E6340284 for ; Thu, 25 Apr 2024 16:03:15 +0200 (CEST) Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-2330f85c2ebso674044fac.1 for ; Thu, 25 Apr 2024 07:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714053795; x=1714658595; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kV9cChnFCsPiLMFpWMQezFwfbVBRgD+OAvDi4W9LrE8=; b=XCUyO/qqFvi7jqJYb7UwuQUe+LInoj6n8aAq3iN1KCDt/e+/RVPDMju/vvi3S8HlDj phCamoOEYBzRcUJ/pAo6PwFQwxpicNx/qnyonnLlbFLv3xdiq4EjZCfxp8uxhdzc0J+/ Z1pr+h0ei5AYTFDKkshBwrqzG0OPNeaQ79sWmGOTg3V1R5c6dJ+524lVLsZiaJDH6JCe bTQ/jfepcU5Cm4CXR/WfXc5m2yYfOMRhM2pZdoiMq3nrZcl8wtKgZ31dVoypoXI/riGE 8mJlyPdvGDpuEaLRZqE/WOy7wI7inHOrbN6YIfu5xAaPDcPXjQYYXqtLjqZin5Hz9BVe itgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714053795; x=1714658595; h=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=kV9cChnFCsPiLMFpWMQezFwfbVBRgD+OAvDi4W9LrE8=; b=bo5jBCc863rT0TCxs3c0OL8g99n98i3tnF3R3ALp6Tf/D/HpZtZutKRrm8zIbkzQer Xq2YCLPIAOACuy6rVoJrh2TY1vy2c0ep88Uv/ndvVCFe3v6aEYyGwjJHHfapOSgRvy8N nSOVn2Rzziyb/GXuqLXa9l7zaYZ++uudcODP5hvtmKIcwpFDS4FGHPEyF8omLSaEsusi 0ljJqsIm1TXqf2wMm2ClXl0UI9oTVUJH37wt8IXI4BuMSvOotsO6LYYQG9WUac/ySBw/ Izp7Oxa5v1dvQpQ3cuBcScHnZ2UKRI5hNK43kNCQTmK8gOzOGdl4p0BXktPyppMYGMdD U7UQ== X-Gm-Message-State: AOJu0YwwscY3J9dSuYqiKuFAQ7Tgu0tRa4XHRv3O/9KooaQAfZ7to3F5 sLvVr06Gx+wQQZVCV8EKXrGrBzoeiarUuhWMJpcLNM/Ib8wIEZvWBSTcf+1UCup+BT27+GF91yR v/qKw1WcFvaPIJ6zZEONCby1+dolxjQ== X-Google-Smtp-Source: AGHT+IEhoXnk7i10AGWWIUpxIo29zoj7lkpfA7dE1oM3DIzUNGyYe5bNeOoihOFvRQRdjiFV3bh/WVr+I2qLTq24zWc= X-Received: by 2002:a05:6870:a691:b0:229:ce58:477a with SMTP id i17-20020a056870a69100b00229ce58477amr6510142oam.19.1714053795089; Thu, 25 Apr 2024 07:03:15 -0700 (PDT) MIME-Version: 1.0 References: <20240415112602.690972-1-aomeryamac@gmail.com> <20240423142432.0fcedf20@hermes.local> In-Reply-To: <20240423142432.0fcedf20@hermes.local> From: =?UTF-8?B?QWJkdWxsYWggw5ZtZXIgWWFtYcOn?= Date: Thu, 25 Apr 2024 17:03:04 +0300 Message-ID: Subject: Re: [PATCH v4] lib/hash: add defer queue reclaim API To: Stephen Hemminger Cc: dev@dpdk.org Content-Type: multipart/alternative; boundary="0000000000009523870616ec3fbf" 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 --0000000000009523870616ec3fbf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the comments. This is due to the tab size, and I will fix them. On Wed, Apr 24, 2024 at 12:24=E2=80=AFAM Stephen Hemminger < stephen@networkplumber.org> wrote: > On Mon, 15 Apr 2024 11:26:02 +0000 > Abdullah =C3=96mer Yama=C3=A7 wrote: > > > + ret =3D rte_rcu_qsbr_dq_reclaim(h->dq, > h->hash_rcu_cfg->max_reclaim_size, > > + freed, > pending, available); > > Indention here is odd. I would expect "freed," to line up right under > h->dq. > Since rte_rcu_qsbrs_dq_reclaim logs error on invalid parameters, this > function should as well. > > Total indent fixes: > > diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c > index 4a44aadd9a..e1ea810024 100644 > --- a/lib/hash/rte_cuckoo_hash.c > +++ b/lib/hash/rte_cuckoo_hash.c > @@ -1590,21 +1590,20 @@ rte_hash_rcu_qsbr_add(struct rte_hash *h, struct > rte_hash_rcu_config *cfg) > > int > rte_hash_rcu_qsbr_dq_reclaim(struct rte_hash *h, unsigned int *freed, > - unsigned int *pending, unsigned > int *available) > + unsigned int *pending, unsigned int > *available) > { > int ret; > > if (h =3D=3D NULL || h->hash_rcu_cfg =3D=3D NULL) { > + HASH_LOG(ERR, "Invalid input parameter"); > rte_errno =3D EINVAL; > return 1; > } > > ret =3D rte_rcu_qsbr_dq_reclaim(h->dq, > h->hash_rcu_cfg->max_reclaim_size, > - freed, > pending, available); > + freed, pending, available); > if (ret !=3D 0) { > - HASH_LOG(ERR, > - "%s: could not reclaim the defer queue i= n > hash table", > - __func__); > + HASH_LOG(ERR, "%s: could not reclaim the defer queue in > hash table", __func__); > return 1; > } > > --0000000000009523870616ec3fbf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the comments. This is due to the tab size, and = I will fix them.

On Wed, Apr 24, 2024 at 12:24=E2=80=AFAM Stephen Hemminger = <stephen@networkplumber.or= g> wrote:
On Mon, 15 Apr 2024 11:26:02 +0000
Abdullah =C3=96mer Yama=C3=A7 <aomeryamac@gmail.com> wrote:

> +=C2=A0 =C2=A0 =C2=A0ret =3D rte_rcu_qsbr_dq_reclaim(h->dq, h->h= ash_rcu_cfg->max_reclaim_size,
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0freed, pending, available);

Indention here is odd. I would expect "freed," to line up right u= nder h->dq.
Since rte_rcu_qsbrs_dq_reclaim logs error on invalid parameters, this funct= ion should as well.

Total indent fixes:

diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 4a44aadd9a..e1ea810024 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -1590,21 +1590,20 @@ rte_hash_rcu_qsbr_add(struct rte_hash *h, struct rt= e_hash_rcu_config *cfg)

=C2=A0int
=C2=A0rte_hash_rcu_qsbr_dq_reclaim(struct rte_hash *h, unsigned int *freed,=
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned = int *pending, unsigned int *available)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 unsigned int *pending, unsigned int *available) =C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 int ret;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (h =3D=3D NULL || h->hash_rcu_cfg =3D=3D = NULL) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0HASH_LOG(ERR, "= ;Invalid input parameter");
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rte_errno =3D EINVA= L;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return 1;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 ret =3D rte_rcu_qsbr_dq_reclaim(h->dq, h->= ;hash_rcu_cfg->max_reclaim_size,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0freed, pending, available);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0freed, pending, = available);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ret !=3D 0) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0HASH_LOG(ERR,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "%s: could not reclaim the defe= r queue in hash table",
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __func__);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0HASH_LOG(ERR, "= ;%s: could not reclaim the defer queue in hash table", __func__);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return 1;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

--0000000000009523870616ec3fbf--