From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id 1C2A85F45 for ; Thu, 28 Jun 2018 15:05:09 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id u6-v6so4436315lju.13 for ; Thu, 28 Jun 2018 06:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=D9O1DiyradqoX9Dq8QQiSZpcYXpmG/4ujc1RP+jS+/w=; b=wRl5nH9BYV0MXJF7e/XvnURk3acn3sL5aZkbrdF17iZKmnsZpzOXm8yfqrp+4iRWEj c0rL8X9YBb5SylQI77VHwDXj3ADOtXmgxJRH0eyth9JJFQg55Y/hbZiikSP81OHHC8d2 AYuiBWmhh5MqqtOAGzJ19ap/hTzHMFw5x9JQX2BJKUiffxtbI5651ft5sZSwqjG4+16y 4GSSx8FEBklRA6H5aYJvJpalrTtvggR8Ih7iD19aADFFfTE9A0RDOSnhJzarIUwOIJA5 yiNid7mww0vSwgm33rhqvMtIQj+SAfClznc3enjD2+MPWSZVsjd2/F5tf9IYxPJaU4is bczQ== 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=D9O1DiyradqoX9Dq8QQiSZpcYXpmG/4ujc1RP+jS+/w=; b=Kn0RKHt3boQ7JiU4xKFMKeQplVwtXfyEsfCUsbiBkLHLY24kDLjKtaQAvPK1RnQFxh W6pn5f/c2JYgBbH0/SGmjykByVhiSfQRDZ44JysOEcRNTzgAh6PFmDVCNXvO7k18jpr6 zZ37ne1A0xbT4bQVvauRpnNFKAvMB2e61bBrKk1S4idN+C+KCtjjmmPKGNHaKGGAAdrT U2M12YU+Cq3gnu8LjM0UquDXVu51A0glLGXXFvh6uGbrm/eIrdO78SIcsXPP0DJzb2ba dCgQqELKFt2J2A8ZUoiqvEuumnOqZ58iTysirqnzLssjetdvxwhcMA1wYmzUGwnaVeo0 sWxw== X-Gm-Message-State: APt69E31z4wQxYGQ6d7iN5wXpUBsLSnCMZ96OGUpsxAybwvRvBLcMZwk OkPoBde/gj2e5FgE45DL5xqPPmOk10Hk3j0C0ds3YreqxOE= X-Google-Smtp-Source: AAOMgpd2L8WKWIVnWScnnEtir3qSn5aSEdG+5QQAJwSfBLd1iTEjoSSc47Eyzji+myob6LbfbhOKYxE+2x3xrRFJWLg= X-Received: by 2002:a2e:1b03:: with SMTP id b3-v6mr7005400ljb.24.1530191108756; Thu, 28 Jun 2018 06:05:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:4a95:0:0:0:0:0 with HTTP; Thu, 28 Jun 2018 06:05:08 -0700 (PDT) In-Reply-To: <3c81fa25-5508-5111-0c24-b022665b507a@intel.com> References: <1523455637-31719-1-git-send-email-rk@semihalf.com> <1523455637-31719-3-git-send-email-rk@semihalf.com> <3c81fa25-5508-5111-0c24-b022665b507a@intel.com> From: =?UTF-8?B?UmFmYcWCIEtvemlr?= Date: Thu, 28 Jun 2018 15:05:08 +0200 Message-ID: To: Ferruh Yigit Cc: dev@dpdk.org, Marcin Wojtas , =?UTF-8?Q?Micha=C5=82_Krawczyk?= , "Tzalik, Guy" , "Schmeilin, Evgeny" , "Matushevsky, Alexander" , "Chauskin, Igor" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 2/4] bus/pci: reference driver structure 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, 28 Jun 2018 13:05:09 -0000 2018-06-27 18:36 GMT+02:00 Ferruh Yigit : > On 4/11/2018 3:07 PM, Rafal Kozik wrote: >> Reference driver structure before calling rte_pci_map_device. >> It allow to use driver flags for adjusting configuration. >> >> Signed-off-by: Rafal Kozik >> --- >> drivers/bus/pci/pci_common.c | 13 ++++++++----- >> 1 file changed, 8 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c >> index 2a00f36..15e9a47 100644 >> --- a/drivers/bus/pci/pci_common.c >> +++ b/drivers/bus/pci/pci_common.c >> @@ -159,17 +159,20 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, >> RTE_LOG(INFO, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id, >> dev->id.device_id, dr->driver.name); >> >> + /* reference driver structure */ >> + dev->driver = dr; >> + dev->device.driver = &dr->driver; > > It can be good to comment that this needs to be before rte_pci_map_device() > incase someone wants to refactor code later. > I will fix it in new, rebased patch set. >> + >> if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) { >> /* map resources for devices that use igb_uio */ >> ret = rte_pci_map_device(dev); >> - if (ret != 0) >> + if (ret != 0) { >> + dev->driver = NULL; >> + dev->device.driver = NULL; >> return ret; >> + } >> } >> >> - /* reference driver structure */ >> - dev->driver = dr; >> - dev->device.driver = &dr->driver; >> - >> /* call the driver probe() function */ >> ret = dr->probe(dr, dev); >> if (ret) { >> >