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 714EDA0503; Wed, 18 May 2022 14:07:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 12E3540156; Wed, 18 May 2022 14:07:25 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 1EAC8400D6 for ; Wed, 18 May 2022 14:07:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652875643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=v/BkYjj2IO82j424AbDzyl00RnGd7Qz+mDZbx0EVIJs=; b=EAnVg8KY2x5lFgccZu8dvCqjhReC9pT+16tVnCOsronx8nGVR4kODRVMbt2+i0EXuSd17v Vw7VXeCkWGa8D1tBnKNJbqJ9grZXrgLSY1iwLXCLemL+V6Nf4n6x7yUPABwygTYDWltCTT 0s0XmgLonor/5UOVXNzcIZtMCLCh8Ms= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-106-aMDxYf90Oxisn5n5X0p_uQ-1; Wed, 18 May 2022 08:07:19 -0400 X-MC-Unique: aMDxYf90Oxisn5n5X0p_uQ-1 Received: by mail-lf1-f72.google.com with SMTP id 21-20020ac24d55000000b00473e75f3331so986394lfp.15 for ; Wed, 18 May 2022 05:07:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=v/BkYjj2IO82j424AbDzyl00RnGd7Qz+mDZbx0EVIJs=; b=cCsYNB9w3vsd/+evzPQBc52FVpSeCiX0gBqHXrgoHsnIqhHmEnUIhzQmPdRHXCBUIp EjIRejI5py0vi+hYBr6ZGyJLHkJvOn0ZCqmSg/J6DzfRgM73MYIk5TAqxhC96IB+tGN0 2tGr9dLbeUMGlqXA66+JsSNAXBAv78cG81pEGXI4rkAUEVqquE/2JcwFpjMF59CrUxJJ DAGk+vlOFuqOGccjkZZARkS44fxkEbI2xAr26XEpK9VdqloZAP33MzxAvKwJ/d6okhZU r/x2yoqtAiwlP0HJbUi35exLA2KyYUR+BGks1IkFyLBebwHP9boNI8sLyvGd/8P5DcVi cRZg== X-Gm-Message-State: AOAM533D5czN5fcyQ0vi4LVeqVwEqYlzqvJibtLgVh4Tq8VSVcwfIzi4 CytIvSOFUfDHHny2Mb+4bfgf1NlYBROwuw5NBrWk1kv9sNCrDg4bEjI66hE8upOSHt/Ln5yhgqu kXsIW3E3dTXvPsOsN/XY= X-Received: by 2002:a2e:9d90:0:b0:24f:224:8dfa with SMTP id c16-20020a2e9d90000000b0024f02248dfamr16864886ljj.46.1652875638427; Wed, 18 May 2022 05:07:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHehxJeZwm0RVRImk+jgejSsPmM9cz34Aq8zu41rcBAebTgzmTmJuSNS1A8nIcLSrwADk+x0gvGOBImBUThuw= X-Received: by 2002:a2e:9d90:0:b0:24f:224:8dfa with SMTP id c16-20020a2e9d90000000b0024f02248dfamr16864873ljj.46.1652875638139; Wed, 18 May 2022 05:07:18 -0700 (PDT) MIME-Version: 1.0 References: <20220512121958.2491-1-taoyunxiang@cmss.chinamobile.com> <2022051709543807022424@cmss.chinamobile.com> In-Reply-To: <2022051709543807022424@cmss.chinamobile.com> From: David Marchand Date: Wed, 18 May 2022 14:07:07 +0200 Message-ID: Subject: Re: Re: [PATCH] bus: fix code unused To: "taoyunxiang@cmss.chinamobile.com" Cc: dev Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Tue, May 17, 2022 at 3:54 AM taoyunxiang@cmss.chinamobile.com wrote: > >> @@ -143,7 +143,7 @@ local_dev_probe(const char *devargs, struct rte_device **new_dev) > >> if (ret) > >> goto err_devarg; > >> > >> - if (da->bus->plug == NULL) { > >> + if (da->bus->plug != 0) { > > > > >The current (before patch) check is correct: it is allowed that a bus > >does not support hotplug. > >Inverting this check as you propose breaks hotplug. > > "da->bus->plug" will call pci_plug and pci_probe_all_drivers in pci_common.c , is it right ? Checking for da->bus->plug value is different from calling da->bus->plug(dev). > > The pci_probe_all_drivers will never return NULL, so the check and related code will not go throuth, > no matter the plug is ok or not. This check is needed, and is correct in its current form. Thanks. -- David Marchand