From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 80F075F16 for ; Thu, 20 Sep 2018 11:09:37 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id y2-v6so9127791wma.1 for ; Thu, 20 Sep 2018 02:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=AkfimWMF9Afd7GyGy53xyOJe8x5IA07MbmhUx0orsZA=; b=NSTCw1PUmiW8PiQQIW6AofFGydUDga+zJD2urUg8rM2BgogKP5/fRaAHwpAH98bkj5 Ii/0SCmX8rAzTInnynexovHclNamaXlomUMb59vOWmb9C2KT1xfm15Fh9SOzzvCXlANa KlycbTS9RJzGoWJ2oQjNm2hOlrduGCq5u2N0YW9HrTUOolWrTx5L0qXC7Jer9Ilt9+d+ h6uOvsllAucVsXhAzR2fUU2utu1VWlw61J4bUYSErFKb/9MpXlPQcboitJYsQchDRYoh LYUfzVjpHsEqgvVGfyCzwOPWOnI80uTeDaSClBiJsR+MlvNUSiPWMdeLP5UNBdV79z11 P3lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=AkfimWMF9Afd7GyGy53xyOJe8x5IA07MbmhUx0orsZA=; b=nsCgMwBGortKzGXalIlKa4EWvxICJZiyo6ie6lz65gqe1aQR5+xEKFSU5dvRUvJnVD xEQBI9ahi1roGPKf8o2EFCCFEwZmWQMxb6yrHokysFLDdVZ/F8gTuJh5Q2p9g/5Ns6nm 7hCYjRYiTekQYWNpUKP/j0uXZuEur4WD8/kBYjM9Fm9pM4eIeqB1C+hW2ErXircVT5nd H9+0KyvmNZJba2HcZH7b5RoScjm6SlWOLVW0bTVVr7mgAA7pN03Y7BYLwLIXSSXPWjN9 GPWMsIV08IuFh9PtfAE2DhGhx2mc/1N/9kQ67kgb+F0FQ8H5RKI/iiQ7SE0fMySI9IP7 lJFA== X-Gm-Message-State: APzg51DK12jnJJOyWU8A8KRjb0baKDxmnfx19NH4jZu1WV/8oDWAN6SA 6YIiaJZ0j4+ylvHyJ6eW0BUUWL911pg= X-Google-Smtp-Source: ANB0VdYxzpxmIvD6+FBdqSEAIySPQvh+36GpCZotxnSTLXEfJlW26jCz+LqjRBLFVIgeialCRsVlKg== X-Received: by 2002:a1c:9f41:: with SMTP id i62-v6mr1520789wme.87.1537434576862; Thu, 20 Sep 2018 02:09:36 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id y17-v6sm20689621wrh.49.2018.09.20.02.09.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 02:09:36 -0700 (PDT) Date: Thu, 20 Sep 2018 11:09:19 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Hideyuki Yamashita Cc: dev@dpdk.org Message-ID: <20180920090919.qigxfgy4qaw6p5om@bidouze.vm.6wind.com> References: <201809200846.w8K8kbJW030890@ccmail04.silk.ntt-tx.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201809200846.w8K8kbJW030890@ccmail04.silk.ntt-tx.co.jp> User-Agent: NeoMutt/20170113 (1.7.2) 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, 20 Sep 2018 09:09:37 -0000 On Thu, Sep 20, 2018 at 05:46:37PM +0900, Hideyuki Yamashita wrote: > Hello, > > From dpdk 18.08 release rte_eth_dev_attach and > rte_eth_dev_detach becom deprecated API and > it is recommended to replace with rte_eal_hotplug_add > and rte_eal_hotplug_remove. > > My program uses above mentioned deprecated APIs > and have to replace those. > Note that my program uses attach to attach vhost, pcap pmd. > > My question is whether it is correct to replace those as following: > find rte_eth_dev_attach function in rte_ethdev.c and > migrate those content into my program. > > e.g. > lib/librte_ethdev/rte_ethdev.c line 643-686 for attach > lib/librte_ethdev/rte_ethdev.c line 690-720 for detach > > Your advice/guidance are much appreciated. > Thanks! > > BR, > Hideyuki Yamashita > ----------------------------------------- > Hideyuki Yamashita > NTT TechnoCross > ----------------------------------------- > > Hello Hideyuki, You could use this code for guidance, while leaving the ethdev specificities such as verifying the eth_dev_count_total(). The hotplug function would already return an error if the PMD was not able to create the necessary devices. The main issue might be to find the port_id of your new port. You won't be able to use eth_dev_last_created_port, so you would have to iterate over the ethdev using RTE_ETH_FOREACH_DEV and find the one matching your parameters (you might for example match the rte_device name with the name you used in hotplug_add, as there is no standard naming scheme at the ethdev level). An possible issue with the deprecation planned for those two functions is that the hotplug API is also meant to evolve [1] this release (not in a big way however, it would mostly simplify your usage of it). [1]: https://mails.dpdk.org/archives/dev/2018-September/111142.html Best, -- Gaëtan Rivet 6WIND