From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 1/2] ethdev: fix hotplug attach Date: Mon, 10 Oct 2016 11:52:36 +0200 Message-ID: <7074047.vLQ6C6IQvl@xps13> References: <1475845276-25527-1-git-send-email-david.marchand@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, danielx.t.mrzyglod@intel.com, shreyansh.jain@nxp.com To: David Marchand Return-path: Received: from mail-qk0-f170.google.com (mail-qk0-f170.google.com [209.85.220.170]) by dpdk.org (Postfix) with ESMTP id D8EA758D4 for ; Mon, 10 Oct 2016 11:52:38 +0200 (CEST) Received: by mail-qk0-f170.google.com with SMTP id f128so80557732qkb.1 for ; Mon, 10 Oct 2016 02:52:38 -0700 (PDT) In-Reply-To: <1475845276-25527-1-git-send-email-david.marchand@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-10-07 15:01, David Marchand: > If a pci probe operation creates a port but, for any reason, fails to > finish this operation and decides to delete the newly created port, then > the last created port id can not be trusted anymore and any subsequent > attach operations will fail. > > This problem was noticed while working on a vm that had a virtio-net > management interface bound to the virtio-net kernel driver and no port > whitelisted in the commandline: [...] > Two solutions: > - either update the last created port index to something invalid > (when freeing a ethdev port), > - or rely on the port count, before and after the eal attach. > > The latter solution seems (well not really more robust but at least) > less fragile than the former. > We still have some issues with drivers that create multiple ethdev > ports with a single probe operation, but this was already the case. > > Fixes: b0fb26685570 ("ethdev: convert to EAL hotplug") > > Reported-by: Daniel Mrzyglod > Signed-off-by: David Marchand Series applied, thanks