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 4D35445AE7; Tue, 8 Oct 2024 20:28:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D7264402BB; Tue, 8 Oct 2024 20:28:06 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id E766E40261 for ; Tue, 8 Oct 2024 20:28:05 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-20c593d6b1cso8328825ad.0 for ; Tue, 08 Oct 2024 11:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728412085; x=1729016885; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=1cpcvksXy1SuRMA14NyG96a0eli6afy5ddClvF46O1s=; b=0bmLBq/lCcJBUzlVyazUm7CzlZBD5JiVoGC62/1Xbbfb7twkiVvkCFqf8GCSPEI1gC saJOLWWh+UgHNlFWBzkaOiKneQNosreYv9Cxiky4jD6xiMY3jAlORy1XVFrRSlYcBTId 5rekywBWgkaLouHeB0ZoAHtY+LxmS2by6ZI7HLAIAlFwDewFOcdjabfa9UoRoCP/RNe5 mbkEyCsLQBL810aUXDt5Qw9Xu2YRmmEWn8Qg4uU+JAcaf+BSrpReanSuEAOGd40HSMvf XwBwdv4oA2mUVocHWTmwSv8jnzDk9pX90WAHIF54dAX/6k/mW7RZrAEvdpToKiCbLiHM /4ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728412085; x=1729016885; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1cpcvksXy1SuRMA14NyG96a0eli6afy5ddClvF46O1s=; b=Kc3ZMWgSPZiFCeeLZmSIaV7Gyma5EljDfV+VBnnkLiQE4N5e0pZQ7l3LWYbvzueA2Z 6NLkGf85FbQrZEYxrPWvgMnN+8GJDOgHyNHeRay5uPg2GTiojdP/N/jyzcds4jDW7dLK UWPxu7sdqK+CTpOhAfeHdRw67fyOZRL6AQGcXPONVhprVgo9Zg1sifu8QxfutvS9PtgW cgdJj4bwvpPhOX/SpJ9/F6GuMGEX07K+jH/idHBrMmUpQO9BueO0LyHxa6617kgEnzw1 W/IGRfMJg+OjO+jcThh5yMCS1ABeBrqKWfqEjDNiBMvujOAs6GZeH3Fk9ahPoyOs2PqK MZoQ== X-Gm-Message-State: AOJu0YymIvV/yRGYe+OHRxWJ3yNY2xogIYF7ngz1hYi8gv4NlRd+YYQX vzuwtjvr8r8lFFgrXzoBe64y3wLzSC+LRgHN0YAvXOntWalyFrmxRwgbDoA+0WM= X-Google-Smtp-Source: AGHT+IF30Jy3v7FOKJQVP6ePb5AZGYk5r9sojiPB5SAVZ2N44W8/nws1dlQdkdxSlbUl95RzqjMl7g== X-Received: by 2002:a17:903:22d2:b0:207:7eaa:d6bb with SMTP id d9443c01a7336-20bfe01feecmr259449975ad.29.1728412084937; Tue, 08 Oct 2024 11:28:04 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c61f8cbbasm870445ad.274.2024.10.08.11.28.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 11:28:04 -0700 (PDT) Date: Tue, 8 Oct 2024 11:28:02 -0700 From: Stephen Hemminger To: Vladimir Medvedkin Cc: dev@dpdk.org, rjarry@redhat.com, ruifeng.wang@arm.com, honnappa.nagarahalli@arm.com, david.marchand@redhat.com Subject: Re: [PATCH v2 1/2] fib: implement RCU rule reclamation Message-ID: <20241008112802.48bdd858@hermes.local> In-Reply-To: <20241008175524.450829-1-vladimir.medvedkin@intel.com> References: <20240906170907.1325808-1-vladimir.medvedkin@intel.com> <20241008175524.450829-1-vladimir.medvedkin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 8 Oct 2024 17:55:23 +0000 Vladimir Medvedkin wrote: > + if ((tbl8_idx == -ENOSPC) && dp->dq != NULL) { Better to either drop the parenthesis here, or put it on both conditions. > + /* If there are no tbl8 groups try to reclaim one. */ > + if (rte_rcu_qsbr_dq_reclaim(dp->dq, 1, > + NULL, NULL, NULL) == 0) > + tbl8_idx = tbl8_get_idx(dp); > + } Could add unlikely() to this expression. /* If there are no tbl8 groups try to reclaim one. */ if (unlikely(tbl8_idx == -ENOSPC && dp->dq && !rte_rcu_qsbr_dq_reclaim(dp->dq, 1, NULL, NULL, NULL))) tbl8_idx = tbl8_get_idx(dp); > +static void > +__rcu_qsbr_free_resource(void *p, void *data, unsigned int n) > +{ > + struct dir24_8_tbl *dp = p; > + uint64_t tbl8_idx = *(uint64_t *)data; > + RTE_SET_USED(n); > + > + tbl8_cleanup_and_free(dp, tbl8_idx); > +} My preference (not a requirement) is to use __rte_unused attribute instead of RTE_SET_USED > + if (dp->v == NULL) > + tbl8_cleanup_and_free(dp, tbl8_idx); > + else if (dp->rcu_mode == RTE_FIB_QSBR_MODE_SYNC) { > + rte_rcu_qsbr_synchronize(dp->v, > + RTE_QSBR_THRID_INVALID); > + tbl8_cleanup_and_free(dp, tbl8_idx); > + } else { /* RTE_FIB_QSBR_MODE_DQ */ > + if (rte_rcu_qsbr_dq_enqueue(dp->dq, > + (void *)&tbl8_idx)) Minor nit: cast to void * is not necessary in C (only in C++). And can fit on one line; max line length now for DPDK is 100 characters. Overall, looks good. Acked-by: Stephen Hemminger