From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 1B9204C8E; Wed, 13 Mar 2019 14:46:05 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2019 06:46:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,474,1544515200"; d="scan'208";a="133723612" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 13 Mar 2019 06:46:04 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Mar 2019 06:46:04 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 13 Mar 2019 06:46:03 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.134]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.57]) with mapi id 14.03.0415.000; Wed, 13 Mar 2019 21:46:01 +0800 From: "Zhang, Qi Z" To: Thomas Monjalon , "dev@dpdk.org" CC: "Stojaczyk, Dariusz" , "stable@dpdk.org" Thread-Topic: [PATCH 1/3] eal: remove useless checks for already probed device Thread-Index: AQHU0KG8iZzaXeKUcUmpxo+C3aAT96YJo2kQ Date: Wed, 13 Mar 2019 13:46:01 +0000 Message-ID: <039ED4275CED7440929022BC67E706115334BEC4@SHSMSX103.ccr.corp.intel.com> References: <20190302024253.15594-1-thomas@monjalon.net> <20190302024253.15594-2-thomas@monjalon.net> In-Reply-To: <20190302024253.15594-2-thomas@monjalon.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWRjNWM1YmMtYTRlYi00M2Q0LTlkZDQtZWQyY2M0ZjM3NzYxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiXC9hU2VHWlRkbVFzVjBSYkVZYktkcGhNXC9tZXZsNFNYWXdtdms4OEFSZFZzYnhMSlRpQWs4RFFcL24ycVpBc3E1WSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH 1/3] eal: remove useless checks for already probed device X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Mar 2019 13:46:06 -0000 Hi: > -----Original Message----- > From: Thomas Monjalon [mailto:thomas@monjalon.net] > Sent: Saturday, March 2, 2019 10:43 AM > To: dev@dpdk.org > Cc: Stojaczyk, Dariusz ; Zhang, Qi Z > ; stable@dpdk.org > Subject: [PATCH 1/3] eal: remove useless checks for already probed device >=20 > The function eal_dev_hotplug_request_to_secondary() never returns -EEXIST > result. The case of already probed device is filtered out. >=20 > The test in __handle_secondary_request() was always true. > The test in rte_dev_probe() was never true, and that's fine not returning= -EEXIST > if device is already attached in secondary processes. I didn't get this. eal_dev_hotplug_request_to_secondary() never return -EEXIST, but req->resul= t could be -EEXIST. This happens when secondary try to attach an already attached device=20 (__handle_primary_request --> local_dev_probe --> dev->bus->plug ) >=20 > Fixes: 494db286f37d ("eal: fix multi-process hotplug if attached in secon= dary") > Cc: dariusz.stojaczyk@intel.com > Cc: qi.z.zhang@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Thomas Monjalon > --- > lib/librte_eal/common/eal_common_dev.c | 9 +-------- > lib/librte_eal/common/hotplug_mp.c | 3 +-- > 2 files changed, 2 insertions(+), 10 deletions(-) >=20 > diff --git a/lib/librte_eal/common/eal_common_dev.c > b/lib/librte_eal/common/eal_common_dev.c > index fd7f5ca7d5..048c0b025f 100644 > --- a/lib/librte_eal/common/eal_common_dev.c > +++ b/lib/librte_eal/common/eal_common_dev.c > @@ -247,18 +247,11 @@ rte_dev_probe(const char *devargs) > goto rollback; > } >=20 > - /** > - * if any secondary failed to attach, we need to consider if rollback > - * is necessary. > - */ > + /* if any secondary failed to attach, need to rollback. */ > if (req.result !=3D 0) { > RTE_LOG(ERR, EAL, > "Failed to attach device on secondary process\n"); > ret =3D req.result; > - > - /* for -EEXIST, we don't need to rollback. */ > - if (ret =3D=3D -EEXIST) > - return ret; > goto rollback; > } >=20 > diff --git a/lib/librte_eal/common/hotplug_mp.c > b/lib/librte_eal/common/hotplug_mp.c > index 4052a5c7fb..94bd1d896e 100644 > --- a/lib/librte_eal/common/hotplug_mp.c > +++ b/lib/librte_eal/common/hotplug_mp.c > @@ -110,8 +110,7 @@ __handle_secondary_request(void *param) > if (tmp_req.result !=3D 0) { > ret =3D tmp_req.result; > RTE_LOG(ERR, EAL, "Failed to hotplug add device on > secondary\n"); > - if (ret !=3D -EEXIST) > - goto rollback; > + goto rollback; > } > } else if (req->t =3D=3D EAL_DEV_REQ_TYPE_DETACH) { > ret =3D rte_devargs_parse(&da, req->devargs); > -- > 2.20.1