From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 59267423AC; Wed, 11 Jan 2023 13:51:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4174040E25; Wed, 11 Jan 2023 13:51:45 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 2DF7F40A7D for ; Wed, 11 Jan 2023 13:51:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gyja7h8rgPjJhPQEXWNZrvew+G+tQFEeFFn9CO0tiAP/tYMg7t/i1Juyq0kKuPxT9YjR4z9fa406FpAQZS7sfWn6fR8M0fyhwL6Xoa1RPrgIS7Zi5MOb2mIY0Q4KPn0KNioyOGbr9KsW463jhAY9cuMgc7VvLBF50EOaQIaAbmCNMW0wUo+3+AZCGlGg2VLJlJadL146CdmkOD0YOzeXa+O8bHgzye0fJ90FDjsXKuqwXfPUBBFbUv3ZrWYP5v2jvgYzfd4Dcxr+crzUE7cmy7KjThJ1bpIuVlJTdh2TUbeThZgON8HWwqlGSmF/qwuPDq6naMqfrNtmUX/OWTBKNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TZNffeXzkpjNu7L0LRukpJcoqzx3rVJii9FR1kZZxDU=; b=eT6kChcMqwPfQ+VNxtu6o3QMB5jo4TQuOO6dPC/xFpuSw2bMfPjaYfYnWpagySVoKNtOFjKvkb/l36rlav5sM+DpJOF951Oh3rtLzsmA5Ru7yf653HFTjge5IN7Rv1IB4i3cSLx1Fgf/rxLIMlPJk/2NpeTnvqdGZal5VgrUPCd+8INcm96R/VvyX4il/7y1f3a/AmUzPxHq444ZcLoo0SZDJ+hcf2tK6DIa/+IGllS77GGHcphK8eQ92/CxLNIyGsRBYXVt3PAM9UqWdT9GNto/UXM+8nY1kXs6dIZF08DbbH+s7MApHxb+vW7zkhvPqnGEBBCb4kOmlkLyEe2/vw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TZNffeXzkpjNu7L0LRukpJcoqzx3rVJii9FR1kZZxDU=; b=mL4cqfdgD8tMWXAb1To/0/ouVUUOxzIw0FHuVC84ZI3L0hJbFQ0txbnYMJ8CDKVqkWD2d0TpHA02C8uESPuB6HHHWX5qrGJqCXjuTgoKTVE4sM5XPZoH72LBF6BmhBAzg3i9vztvLatMk6FrxLh3iEHD/hgOAf1gr72EF9yO5lM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by CH0PR12MB5332.namprd12.prod.outlook.com (2603:10b6:610:d7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Wed, 11 Jan 2023 12:51:41 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%9]) with mapi id 15.20.5986.018; Wed, 11 Jan 2023 12:51:41 +0000 Message-ID: <79192ffa-eb80-e56c-5c64-4a22374c7a1a@amd.com> Date: Wed, 11 Jan 2023 12:51:35 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US To: Huisong Li , dev@dpdk.org, andrew.rybchenko@oktetlabs.ru Cc: thomas@monjalon.net, liudongdong3@huawei.com, huangdaode@huawei.com, fengchengwen@huawei.com References: <20220825024425.10534-1-lihuisong@huawei.com> <20221206092649.8287-1-lihuisong@huawei.com> <20221206092649.8287-2-lihuisong@huawei.com> From: Ferruh Yigit Subject: Re: [PATCH V4 1/5] drivers/bus: restore driver assignment at front of probing In-Reply-To: <20221206092649.8287-2-lihuisong@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P123CA0094.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:139::9) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CH0PR12MB5332:EE_ X-MS-Office365-Filtering-Correlation-Id: a2afeec8-ed6c-4e37-f8b8-08daf3d2961a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pnFxfPjWx6XhqI+pnFyQwVSS2wPqf8vzzhtqK57mOUeDtba03nACOrghAP+RTfaCTj+RfBE16lHLxq4HrBaMWQUxEXhs/kZ2Pne2LamiYMT8IzauLYTgy7oeY2xR/UvL7RlGBipFB9lbSFSg766jIQfDfu8H3oMoI8zuIDTmZOjxkjVmaAcGWauvkAkFvgSuZ3EvlE7PUyxGPAQEK0jS/7wpTDRrOJg5gaJHeJHrktkKir46JOhvodh234F41AVfdAkkrniNYJluT+SpqCXXU2L0JP2HzvjG2IbM1BSgG3ARFBJE0Zd3LIxr9CDoZsdlAYwCmJyhQ4EwGJYMz9vGIdz086v7QAgQ373WVcDsCzCqFY7/EwFd0rd4jbulK+gPpV+2h7o4bs7sCnPu7A3tzXxaeVIhkzhZMD98wcx7bhKCEJBxsI23J8qLg7swjib1Hu3X6Mrztt7MfhqaJHYoI4Ep+538JEWi2xNbTFQp3RFB2cTcpaSdk3vUZUfoTkvLDd22vj+LCmJCX5Hd//Tvn/jmVDjnRrccxViBBSr15km/XlIQZ6QCoYizxaL3VuNQWZPFV3+c0JAKPIhG/U7UMfMxLUi40lxEs8aqqalU79z5EcdiFKB8nGrY+Jg8smlac+JsiQxsTPbm9BprasngtDDq4/hlhxBntDRwWl2mve4kuvDxma1IdVUCbPgoatuYhGDclJwfN2/eE4FWQNJIPDp2zip3sw+kyopn1W9TnEw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(396003)(39860400002)(136003)(366004)(376002)(451199015)(6506007)(38100700002)(6666004)(53546011)(31686004)(2906002)(44832011)(478600001)(2616005)(6486002)(186003)(6512007)(26005)(316002)(5660300002)(31696002)(83380400001)(8936002)(36756003)(86362001)(66476007)(4326008)(8676002)(41300700001)(66556008)(66946007)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Uy9GVUlPcktrUGFwWjZWUWFXd1dqSHVoZlppbTNQMjJ2WUg1MGZvemhDNUUw?= =?utf-8?B?d1lEcTN5eU1Hc0ZmbzF4TDFJOFpZejdPaHo4TjdtR1lKK29aOHEzRFArV3Vi?= =?utf-8?B?cXczaThGdjJUR2IxY1A1WVdXZExLV1pmV3ZmdUkzREJYSHdQTmRIYVpwSHRo?= =?utf-8?B?RWJGREdaOHZxK3VDMnFXb25BRVc5dCswSmxkK1gzZENNWnpDUVd1M25MUGxF?= =?utf-8?B?blN6dDBl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BY?= =?utf-8?B?UFF4VVI4aHF3ZWtaUUQ1OVFqdHYwTjRnL2VWa0tHQldnZi9HbVZ6R1pPSkxP?= =?utf-8?Q?Qn5Sh9flVmJg3Q6iKFl/eVFpl?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2afeec8-ed6c-4e37-f8b8-08daf3d2961a X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2023 12:51:41.5889 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: r7wCYtBFFIWeFghHgBTZOsazC5DzD7QJU/tdCgG8MhHCwgnrnaEcriRWV+VlGYx6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5332 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 12/6/2022 9:26 AM, Huisong Li wrote: > The driver assignment was moved back at the end of the device probing > because there is no something to use rte_driver during the phase of > probing. See commit 391797f04208 ("drivers/bus: move driver assignment > to end of probing") > > However, it is necessary for probing callback to reference rte_driver > before probing. For example, probing callback may call some APIs which > access the rte_pci_driver::driver by the device::driver pointer to get > driver information. In this case, a segment fault will occur in probing > callback if there is not this assignment. > Probing callback gets driver as parameter, so callback function can access it via 'drv->driver', is there a specific usecase that 'dev->device->driver' needs to be accessed explicitly? I assume this is related to coming patches that setting up device in testpmd event callback, but can you please clarify exact need. > Further, some comments in code need to be updated if we do that. The > driver pointer in rte_device is set before probing and needs to be reset > if probing failed. And rte_dev_is_probed can not be called inside probing. > > Fixes: 391797f04208 ("drivers/bus: move driver assignment to end of probing") > Cc: stable@dpdk.org > > Signed-off-by: Huisong Li > --- > drivers/bus/auxiliary/auxiliary_common.c | 9 +++++++-- > drivers/bus/dpaa/dpaa_bus.c | 9 +++++++-- > drivers/bus/fslmc/fslmc_bus.c | 8 +++++++- > drivers/bus/ifpga/ifpga_bus.c | 12 +++++++++--- > drivers/bus/pci/pci_common.c | 9 +++++++-- > drivers/bus/vdev/vdev.c | 10 ++++++++-- > drivers/bus/vmbus/vmbus_common.c | 9 +++++++-- > 7 files changed, 52 insertions(+), 14 deletions(-) > > diff --git a/drivers/bus/auxiliary/auxiliary_common.c b/drivers/bus/auxiliary/auxiliary_common.c > index ff1369353a..13cb3fe0f8 100644 > --- a/drivers/bus/auxiliary/auxiliary_common.c > +++ b/drivers/bus/auxiliary/auxiliary_common.c > @@ -132,16 +132,21 @@ rte_auxiliary_probe_one_driver(struct rte_auxiliary_driver *drv, > } > > dev->driver = drv; > + /* > + * Reference rte_driver before probing so as to this pointer can > + * be used to get driver information in case of segment fault in > + * probing callback. > + */ > + dev->device.driver = &drv->driver; > > AUXILIARY_LOG(INFO, "Probe auxiliary driver: %s device: %s (NUMA node %i)", > drv->driver.name, dev->name, dev->device.numa_node); > ret = drv->probe(drv, dev); > if (ret != 0) { > dev->driver = NULL; > + dev->device.driver = NULL; > rte_intr_instance_free(dev->intr_handle); > dev->intr_handle = NULL; > - } else { > - dev->device.driver = &drv->driver; > } > > return ret; > diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c > index e57159f5d8..f1b817e58c 100644 > --- a/drivers/bus/dpaa/dpaa_bus.c > +++ b/drivers/bus/dpaa/dpaa_bus.c > @@ -693,17 +693,22 @@ rte_dpaa_bus_probe(void) > (dev->device.devargs && > dev->device.devargs->policy == RTE_DEV_BLOCKED)) > continue; > - > + /* > + * Reference rte_driver before probing so as to this > + * pointer can be used to get driver information in case > + * of segment fault in probing callback. > + */ > + dev->device.driver = &drv->driver; > if (probe_all || > (dev->device.devargs && > dev->device.devargs->policy == RTE_DEV_ALLOWED)) { > ret = drv->probe(drv, dev); > if (ret) { > + dev->device.driver = NULL; > DPAA_BUS_ERR("unable to probe:%s", > dev->name); > } else { > dev->driver = drv; > - dev->device.driver = &drv->driver; > } > } > break; > diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c > index 57bfb5111a..4bc0c6d3d4 100644 > --- a/drivers/bus/fslmc/fslmc_bus.c > +++ b/drivers/bus/fslmc/fslmc_bus.c > @@ -471,15 +471,21 @@ rte_fslmc_probe(void) > continue; > } > > + /* > + * Reference rte_driver before probing so as to this > + * pointer can be used to get driver information in case > + * of segment fault in probing callback. > + */ > + dev->device.driver = &drv->driver; > if (probe_all || > (dev->device.devargs && > dev->device.devargs->policy == RTE_DEV_ALLOWED)) { > ret = drv->probe(drv, dev); > if (ret) { > + dev->device.driver = NULL; > DPAA2_BUS_ERR("Unable to probe"); > } else { > dev->driver = drv; > - dev->device.driver = &drv->driver; > } > } > break; > diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c > index bb943b58b5..5f23446f41 100644 > --- a/drivers/bus/ifpga/ifpga_bus.c > +++ b/drivers/bus/ifpga/ifpga_bus.c > @@ -293,13 +293,19 @@ ifpga_probe_one_driver(struct rte_afu_driver *drv, > > /* reference driver structure */ > afu_dev->driver = drv; > + /* > + * Reference rte_driver before probing so as to this pointer can > + * be used to get driver information in case of segment fault in > + * probing callback. > + */ > + afu_dev->device.driver = &drv->driver; > > /* call the driver probe() function */ > ret = drv->probe(afu_dev); > - if (ret) > + if (ret) { > afu_dev->driver = NULL; > - else > - afu_dev->device.driver = &drv->driver; > + afu_dev->device.driver = NULL; > + } > > return ret; > } > diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c > index bc3a7f39fe..efaa1792e9 100644 > --- a/drivers/bus/pci/pci_common.c > +++ b/drivers/bus/pci/pci_common.c > @@ -302,6 +302,12 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, > return ret; > } > } > + /* > + * Reference rte_driver before probing so as to this pointer can > + * be used to get driver information in case of segment fault in > + * probing callback. > + */ > + dev->device.driver = &dr->driver; > } > > RTE_LOG(INFO, EAL, "Probe PCI driver: %s (%x:%x) device: "PCI_PRI_FMT" (socket %i)\n", > @@ -314,6 +320,7 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, > return ret; /* no rollback if already succeeded earlier */ > if (ret) { > dev->driver = NULL; > + dev->device.driver = NULL; > if ((dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) && > /* Don't unmap if device is unsupported and > * driver needs mapped resources. > @@ -325,8 +332,6 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, > dev->vfio_req_intr_handle = NULL; > rte_intr_instance_free(dev->intr_handle); > dev->intr_handle = NULL; > - } else { > - dev->device.driver = &dr->driver; > } > > return ret; > diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c > index 41bc07dde7..2e3f0f2e12 100644 > --- a/drivers/bus/vdev/vdev.c > +++ b/drivers/bus/vdev/vdev.c > @@ -207,9 +207,15 @@ vdev_probe_all_drivers(struct rte_vdev_device *dev) > return -1; > } > > + /* > + * Reference rte_driver before probing so as to this pointer can > + * be used to get driver information in case of segment fault in > + * probing callback. > + */ > + dev->device.driver = &driver->driver; > ret = driver->probe(dev); > - if (ret == 0) > - dev->device.driver = &driver->driver; > + if (ret != 0) > + dev->device.driver = NULL; > return ret; > } > > diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c > index 8d32d66504..feb1651984 100644 > --- a/drivers/bus/vmbus/vmbus_common.c > +++ b/drivers/bus/vmbus/vmbus_common.c > @@ -110,6 +110,12 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr, > > /* reference driver structure */ > dev->driver = dr; > + /* > + * Reference rte_driver before probing so as to this pointer can > + * be used to get driver information in case of segment fault in > + * probing callback. > + */ > + dev->device.driver = &dr->driver; > > if (dev->device.numa_node < 0 && rte_socket_count() > 1) > VMBUS_LOG(INFO, "Device %s is not NUMA-aware", guid); > @@ -119,9 +125,8 @@ vmbus_probe_one_driver(struct rte_vmbus_driver *dr, > ret = dr->probe(dr, dev); > if (ret) { > dev->driver = NULL; > + dev->device.driver = NULL; > rte_vmbus_unmap_device(dev); > - } else { > - dev->device.driver = &dr->driver; > } > > return ret;