From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by dpdk.org (Postfix) with ESMTP id 206A11B4CB for ; Thu, 27 Sep 2018 15:48:47 +0200 (CEST) Received: by mail-lf1-f65.google.com with SMTP id x24-v6so2189095lfe.10 for ; Thu, 27 Sep 2018 06:48:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Q0UtHeOybLm3JhbCFDsJ0xKvCWfd3eytfFOr/srznss=; b=HwkpuVRaWgOKqDyAxKujCfagV2MDYs76FPJ+qvCAMMNzldp1ofXEzafJ9IikMpDvy3 776Uff6IZVdWN0ajx5K8Ew3ayedSC0oszwnv6zDtp6cei4hWw2TPKwtlu1AtM1D41Zh1 nhad+21HyZaxKZYMi/4AO/BGlSMiKgs9aNjWvtPDRfs4cGU3oNSQAFbqkWPJCmBjjdce d3eKkOdEx0JezQ+8y6C3SN9kFLkgtNDcxhkKG1Q0nCMrSF8ygQHrvF66Jys8U28fUEp0 n8L+b7vkx+wSQnjqVBR5Ft+TT5ARdZxjWvCYFQAtPomJeqbQnopv3FZ25j4AZmEu4msP BhZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Q0UtHeOybLm3JhbCFDsJ0xKvCWfd3eytfFOr/srznss=; b=GP3AruW6l8ehA+KdLkQuMihMcFOy7uNR41p8xLW8ArtrSMIDWcN4eOomTh/fbzGQ4n qXpD6iebBS/WX0RSpMtQQwb4K4ryR+JEjGrG2qT/M4gwZ2dNXWiTYrme/ABodjzGNp4D waT4b6mnYn6t+inMKLKTN7b6af9S37Fr2tF9HUNV7bSqLREJsIN4VaZvMt88FiceItyv 3YP1eXs2BkWAq5naT23y3FgPbnohrPqrR/GBBab1suaIUA9k2clR6AjYfpRSyazrFopZ JgbWCnSQwAsl0gokZMi2/WqC0pdV7BuTuSsTbvfdiZqE8KAbaKn8H7MGBfdVpmebyqax n6kg== X-Gm-Message-State: ABuFfoibBwsJeGtCi9f2xSNYbTnLOw/dEwAoidFysyUTpipAbvxkSU1e CkTMo875Kv6FJ7OAsjGhnfHiDs/1KKhYPQ== X-Google-Smtp-Source: ACcGV63h9YjDpUoKhad3+wf1iJ33GP3NbN64MgILdL7GQXSEQ9Q0OOeN3RAJr9kGGBpdoTWqqun31A== X-Received: by 2002:a19:f53:: with SMTP id e80-v6mr7934829lfi.80.1538056126366; Thu, 27 Sep 2018 06:48:46 -0700 (PDT) Received: from [10.0.0.72] (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id m132-v6sm452895lfg.24.2018.09.27.06.48.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 06:48:45 -0700 (PDT) To: dev@dpdk.org References: <201809270138.w8R1cJHm000890@ccmail04.silk.ntt-tx.co.jp> <1671413.72NatgAg1l@xps> <201809271040.w8RAegUP030722@ccmail04.silk.ntt-tx.co.jp> From: Andrzej Ostruszka Message-ID: <8e957dd2-547e-5184-5c35-18f6c1762425@semihalf.com> Date: Thu, 27 Sep 2018 15:48:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201809271040.w8RAegUP030722@ccmail04.silk.ntt-tx.co.jp> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Sep 2018 13:48:47 -0000 On 27.09.2018 12:40, Hideyuki Yamashita wrote: [...] >>> Is it correct understanding that race condition >>> includes >>> - read information before port is available >>> - other device may be plugged (or unplugged) >>> and so using "eth_dev_last_created_port" is >>> NOT reliable? >> >> I am thinking about the second one only. > > If we assume there is only one DPDK application > inside the host and within the application, only one thread > handles attach/detach of devices, then is it ok to use This depends also a bit on the PMD you intend to use. Some PMDs can create more than 1 port (e.g. for internal purposes) in which case eth_dev_last_created_port is not reliable. Best regards Andrzej