From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f194.google.com (mail-io0-f194.google.com [209.85.223.194]) by dpdk.org (Postfix) with ESMTP id D406D5F17 for ; Fri, 30 Mar 2018 17:30:20 +0200 (CEST) Received: by mail-io0-f194.google.com with SMTP id d6so9442492iog.1 for ; Fri, 30 Mar 2018 08:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SnJDIf1gQjrB5U2ToqNHd82ZuuVhz5e2tWbvCJdedls=; b=j4oSMdlONperadK8KoknId3VjauCChInEeaCQwuNw+8nNvxOfImXznVYLGnG4sLOjj /DfLs/Z+JsyDEmBpdM+xrfnXErRI1UUgSuc5Xa3AcRf5MeWtrYoryo+sJan3JmBq0cpF rhEq2wFmr8p7kxkKsur1orQdfBWCP0ZtVVOARQnjIkVWpN9oUsDKdlTAh9cdjYzburs4 Z/fyWO4OBfJrhHK6/FbMvY7rlYHFPnl71uwCJWOFx7so/vHoSmBajAGc14d1diuaamRg 1u3q9/6Bynbz4cPgPhV46FYuKX4lIOhNuAi1d8CKqX68ohQIGIWBHbu1jkCPgSC0yUTj hPSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SnJDIf1gQjrB5U2ToqNHd82ZuuVhz5e2tWbvCJdedls=; b=dLhbPmeXdKYngNVHnlEyscB6lILgpK8PffCaH861NPBc+EcXrfQs+DPANOzBJaTAd1 RdMf/JDOZ8FuuGhUHmMGfQz300WbVD2igCVvVLO3t0HzWex21oE1gn/kZmhkr+hqzSRr 9WS1fVR+5lZjE/MipVHTwB/g+NRyll9q+4XQXl546y5jP9vWmeSQDhEHOWLhdHNLuTI+ MGZdx5J6gTIvSB4ALwjT+hIZ2itSng9b+0p6jr1wUNuTKPMRzahXf52bZXgPoWPEVR4o kiSiSI4u/w/1sE7YR+q23d0xraaOe8PtMBqYjaPWQw9v4ClkLyU5Vp4qpJ9ks8decZFn Eh8Q== X-Gm-Message-State: AElRT7EBfgJF5gKb5kA+zmyskHi2T3wYxqluP+K6wrUTGoiFFIwLO4rk Rf1x4HkgFG37JcBFfy43ddc5HG2i/Z2XCgxovRJpBA== X-Google-Smtp-Source: AIpwx491pZxsRcTc/4tDk6ykWtojtjnFw6i1eeM84C94iduN5XsjPJ2PEV54SMl/v84HdISU5O1X8AxvhWbHlc24mGo= X-Received: by 10.107.30.135 with SMTP id e129mr30704621ioe.183.1522423820004; Fri, 30 Mar 2018 08:30:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.165.1 with HTTP; Fri, 30 Mar 2018 08:29:59 -0700 (PDT) In-Reply-To: <20180330151704.183495-1-ferruh.yigit@intel.com> References: <20180329175206.127943-1-ferruh.yigit@intel.com> <20180330151704.183495-1-ferruh.yigit@intel.com> From: David Marchand Date: Fri, 30 Mar 2018 17:29:59 +0200 Message-ID: To: Ferruh Yigit Cc: dev@dpdk.org, Shreyansh Jain , Allain Legacy , Tomasz Duszynski , Santosh Shukla Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v4] ethdev: replace bus specific struct with generic dev 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: Fri, 30 Mar 2018 15:30:21 -0000 On Fri, Mar 30, 2018 at 5:17 PM, Ferruh Yigit wrote: > Public struct rte_eth_dev_info has a "struct rte_pci_device" field in it > although it is common for all ethdev in all buses. > > Replacing pci specific struct with generic device struct and updating > places that are using pci device in a way to get this information from > generic device. > > Signed-off-by: Ferruh Yigit [snip] > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index 209796d46..68bdc3103 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -2421,6 +2421,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) > memset(dev_info, 0, sizeof(struct rte_eth_dev_info)); > dev_info->rx_desc_lim = lim; > dev_info->tx_desc_lim = lim; > + dev_info->device = dev->device; > > RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get); > (*dev->dev_ops->dev_infos_get)(dev, dev_info); Reviewed-by: David Marchand Just a little comment, do we want the pmd to be able to override this ? I can see we enforce the driver name by putting it after the call to .dev_infos_get. http://dpdk.org/browse/dpdk/tree/lib/librte_ether/rte_ethdev.c#n2399 octeontx pmd seems to try to do something about it: http://dpdk.org/browse/dpdk/tree/drivers/net/octeontx/octeontx_ethdev.c#n622 Not sure it does something, might be a thing to cleanup. -- David Marchand