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 8168C45B04; Thu, 10 Oct 2024 17:10:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6FA10402F1; Thu, 10 Oct 2024 17:10:48 +0200 (CEST) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mails.dpdk.org (Postfix) with ESMTP id 45BCA402E8 for ; Thu, 10 Oct 2024 17:10:47 +0200 (CEST) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-7e9ff6fb4c6so1286010a12.3 for ; Thu, 10 Oct 2024 08:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728573046; x=1729177846; 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=BuoAZWmsXEq4yw684P6+eo3P4K44i6kPoC6UCKWG81Y=; b=KpTgfesPqvCszEar7mi6zce2QgR8r4xNajIKeCXGUljSOhByCstJcInDRFBKHXa1cp vP6fEBXIMZVucMSWTAt/Df2FAxAdiPnrfJp6S4CymvgqE1Inz7wmu+agYUa3YL47o2m5 ugaQcX2cgB2XENLkbSbuVNDUIBkXfchI8bg/eXHBEzuuV8Y92VFlkArmaVeCqN/jHM3B exR5WmfSbIFxC/kI+zwlFdRBUqA877XgbHeKuf91FbSf4hfx6LQs0si6Qpm6pc9Cndnc O5oV0H46KOXks1T6xwAGxhzc0m9ZKqFETg4PEwhblOEo7b6hKuYL/RyTVfAae8QqAYGF IqJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728573046; x=1729177846; 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=BuoAZWmsXEq4yw684P6+eo3P4K44i6kPoC6UCKWG81Y=; b=Hy10cO9dDmyXf1OfS5hrS8A1ebqLQsJP9EC8g5vaA3uqki1Rs9CWsIWzHn+kBKc0yM w1UolzTM4LX2IFHqfq/6F+O5NoIBZfZnDzDHczmhHWt7dkfGUsFkLmqetGd7UWXmxcZw zv/u8G5KwgSO59lr8IWN3S2Otrhp9QX0QqKhpkCz3PQvwpiKKI2cwSHIs8tpuuIMDBRG kH/gGJqPwx8B5CVfa/CsBISQdMezghYZGRMN9KVUTsceJn9HQMcr8ty9MJa0euH+fRFG A+ioMQK0K9Jt1bcVXn2FFf4Q4X9NvLRZogmb3sNJ3ul1kuRgk2eMwUG9kEYhDXE/fcWV qGUA== X-Gm-Message-State: AOJu0YzVpp1o+n6FzdOWZfpYeirSe1LRoFdFgshe7L1rFFHUN14gbLmk vIbQx7uB8Oec4VrBjcaHgQ2WctT5o6FVknfhAg9xBSMeLiIGTl39C2F+d0VbhYE= X-Google-Smtp-Source: AGHT+IFX7sphgwWoR95DQSgPO4sZecao0QbB8tPYc/LT3n5CjiVIDX5PWz2tuqbRRQPUkamFRlnWqw== X-Received: by 2002:a05:6a20:7190:b0:1d8:a759:524d with SMTP id adf61e73a8af0-1d8a759532cmr7156163637.18.1728573046472; Thu, 10 Oct 2024 08:10:46 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2aaba5d4sm1157551b3a.174.2024.10.10.08.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 08:10:46 -0700 (PDT) Date: Thu, 10 Oct 2024 08:10:44 -0700 From: Stephen Hemminger To: Chaoyong He Cc: dev@dpdk.org, oss-drivers@corigine.com, Long Wu , Peng Zhang Subject: Re: [PATCH 04/10] net/nfp: improve the logic readability Message-ID: <20241010081044.2acd3bd9@hermes.local> In-Reply-To: <20241010091716.3631747-5-chaoyong.he@corigine.com> References: <20241010091716.3631747-1-chaoyong.he@corigine.com> <20241010091716.3631747-5-chaoyong.he@corigine.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 Thu, 10 Oct 2024 17:17:10 +0800 Chaoyong He wrote: > + > +port_cleanup: > + for (uint32_t j = 0; j < i; j++) { > + struct rte_eth_dev *eth_dev; > + > + nfp_port_name_generate(port_name, sizeof(port_name), j, pf_dev); > + eth_dev = rte_eth_dev_get_by_name(port_name); > + if (eth_dev != NULL) > + rte_eth_dev_destroy(eth_dev, NULL); > + } > + You could skip the lookup if you kept an array of eth_dev's that were created?