From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id C68E11BB9D for ; Tue, 26 Jun 2018 18:34:06 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id k16-v6so17923790wro.0 for ; Tue, 26 Jun 2018 09:34:06 -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=YzQbDpAEKwxtBShkp7S1pnIm/kfXTh+5gPhp/gIj02Y=; b=DBe+QhB+DDzVf3S7zCwX+UOewasGemzHfNMQmcjuw+2OWTecN1iSsI00CSdpJn32/y w6v9ryQypXjzWFstj/1okllPqOz3y4m5/R25cCZ5Rr6yLVv5IsQ5rVasPxT5N4wKKk3c V7uXibq0muY5LyY2nJgXNyY8LNkgArfN+0daHB6IimsbHJIE5lCBGalWCFf6PQaorZhm jgDaDouCCks0OU72gsYXYK1U54P6TSY7S82h7y8fxPvNOreI3+/szSunrdpniLtRAEah XYpX38goBfYU5TaEuf0CxRg2qqpUUDO5HP4rLc2pjKJvKqnbjMCenhvEA2K9Vwfve5Pk yZhg== 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=YzQbDpAEKwxtBShkp7S1pnIm/kfXTh+5gPhp/gIj02Y=; b=Ap+aq8EORJfTGnviOccIdRxjBjKH0MRJvtlyFHTcDRrnehmHVp6peqzeCEcezD0yU9 PYOHqSe+bSEgNofqEeS4Gvl3ER5FvkFJA8gh7tB9vh5lPkX9MCMEVxEi/Qwggfb6SBjL o1qC1FtNUSA59YAxZ6DARf7MBSvU05dS23l2N34kSk2fGAGQUflrlxQ6MDIUP3c17ENt ECVTgu3ni22zA83YTevnYJRAbAV3I1opV+FujANE3NyO+5xBOzWALisO4p3Z9ebd9rps 9qi7Zd0/s+cCKQjEWiZuW99dg6zU1lWpkuUIlVvcdkktIJ+W/O05/QUkIiyz7Hyta/7M x4Ag== X-Gm-Message-State: APt69E0E2OqysnjyF3Y6XGRTMcUV5XQT8cGFgCk2xSNkPegDHge2beiX qQMNQ+TT80mT+XQcUNWO5bzEcg== X-Google-Smtp-Source: AAOMgpdickCKUXSIvDMXAlT635Li4YHf7lSXHFggi9vfly+KTp+yG85mkJZtDxMxqM/mimEBtnTNlA== X-Received: by 2002:adf:dd07:: with SMTP id a7-v6mr2216688wrm.2.1530030846207; Tue, 26 Jun 2018 09:34:06 -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 s10-v6sm3541839wmb.12.2018.06.26.09.34.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jun 2018 09:34:05 -0700 (PDT) Date: Tue, 26 Jun 2018 18:33:48 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: "Zhang, Qi Z" Cc: "Burakov, Anatoly" , "thomas@monjalon.net" , "Ananyev, Konstantin" , "dev@dpdk.org" , "Richardson, Bruce" , "Yigit, Ferruh" , "Shelton, Benjamin H" , "Vangati, Narender" Message-ID: <20180626163348.ds35fttkd5easc6k@bidouze.vm.6wind.com> References: <20180607123849.14439-1-qi.z.zhang@intel.com> <20180626070832.3055-1-qi.z.zhang@intel.com> <20180626070832.3055-2-qi.z.zhang@intel.com> <039ED4275CED7440929022BC67E706115323E74C@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <039ED4275CED7440929022BC67E706115323E74C@SHSMSX103.ccr.corp.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v4 01/24] eal: introduce one device scan 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: Tue, 26 Jun 2018 16:34:06 -0000 On Tue, Jun 26, 2018 at 12:26:05PM +0000, Zhang, Qi Z wrote: > > > > -----Original Message----- > > From: Burakov, Anatoly > > Sent: Tuesday, June 26, 2018 7:48 PM > > To: Zhang, Qi Z ; thomas@monjalon.net > > Cc: Ananyev, Konstantin ; dev@dpdk.org; > > Richardson, Bruce ; Yigit, Ferruh > > ; Shelton, Benjamin H > > ; Vangati, Narender > > > > Subject: Re: [PATCH v4 01/24] eal: introduce one device scan > > > > On 26-Jun-18 8:08 AM, Qi Zhang wrote: > > > When hot plug a new device, it is not necessary to scan everything on > > > the bus since the devname and devargs are already there. So new > > > rte_bus ops "scan_one" is introduced, bus driver can implement this > > > function to simplify the hotplug process. > > > > > > Signed-off-by: Qi Zhang > > > --- > > > > > > > > > > > > + * NULL for unsuccessful scan > > > + */ > > > +typedef struct rte_device *(*rte_bus_scan_one_t)(struct rte_devargs > > > +*devargs); > > > + > > > +/** > > > * Implementation specific probe function which is responsible for linking > > > * devices on that bus with applicable drivers. > > > * > > > @@ -204,6 +219,7 @@ struct rte_bus { > > > TAILQ_ENTRY(rte_bus) next; /**< Next bus object in linked list */ > > > const char *name; /**< Name of the bus */ > > > rte_bus_scan_t scan; /**< Scan for devices attached to > > bus */ > > > + rte_bus_scan_one_t scan_one; /**< Scan one device using devargs */ > > > rte_bus_probe_t probe; /**< Probe devices on bus */ > > > rte_bus_find_device_t find_device; /**< Find a device on the bus */ > > > rte_bus_plug_t plug; /**< Probe single device for drivers > > */ > > > > > > > Does changing this structure break ABI for bus drivers? > > For bus driver, I think yes, but I'm not sure what I should do for this, since this is not for application > > This should be appropriately announced in advance, in general. However, it seems there is some leeway if the new field will not move the others and not make the structure grow (i.e. replace a padding). There is an ABI check script that can be used. This however breaks the bus ABI, which breaks the EAL ABI. This is usually an issue. More generally, I was in favor of changing the whole bus scan process to a per-device iteration. I was shut down on this when adding hotplug. As a result, bus->scan() process was made to require the operation to be idempotent. Adding a new ops adds noise to the bus API. It should be kept as clean as possible. This new one seems unnecessary, now that all bus scans are idempotent (when supporting hotplug). Regards, -- Gaëtan Rivet 6WIND