From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id F07E01559; Tue, 4 Sep 2018 16:48:38 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 07:48:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,329,1531810800"; d="scan'208";a="254407996" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga005.jf.intel.com with ESMTP; 04 Sep 2018 07:45:25 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 4 Sep 2018 07:45:21 -0700 Received: from fmsmsx101.amr.corp.intel.com ([169.254.1.66]) by fmsmsx124.amr.corp.intel.com ([169.254.8.135]) with mapi id 14.03.0319.002; Tue, 4 Sep 2018 07:45:21 -0700 From: "Eads, Gage" To: "Zhang, Qi Z" , "dev@dpdk.org" CC: "thomas@monjalon.net" , "Burakov, Anatoly" , "stable@dpdk.org" Thread-Topic: [PATCH v2] bus/vdev: fix wrong error log on secondary device scan Thread-Index: AQHUQ2MGO5s5BAmai0yoO9NeGW5xSaTgMdEQ Date: Tue, 4 Sep 2018 14:45:20 +0000 Message-ID: <9184057F7FC11744A2107296B6B8EB1E44718085@fmsmsx101.amr.corp.intel.com> References: <20180827122732.5531-1-qi.z.zhang@intel.com> <20180903085022.45183-1-qi.z.zhang@intel.com> In-Reply-To: <20180903085022.45183-1-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDhiYjM4ZmUtYWRiZS00ZTA5LTg5OWQtY2U5MTIyYzg5MWI2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYU1rbDFuZ2VOWTRPQ3VScXlnd2cwVWNQaXN3U1VcL0JHKzJIMkhEeGtWQVVwWER2K0Z4UE5kY0NPMmFMWjdUK24ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH v2] bus/vdev: fix wrong error log on secondary device scan 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: Tue, 04 Sep 2018 14:48:39 -0000 Acked-by: Gage Eads Thanks! Gage > -----Original Message----- > From: Zhang, Qi Z > Sent: Monday, September 3, 2018 3:50 AM > To: dev@dpdk.org > Cc: thomas@monjalon.net; Burakov, Anatoly ; > Eads, Gage ; Zhang, Qi Z ; > stable@dpdk.org > Subject: [PATCH v2] bus/vdev: fix wrong error log on secondary device sca= n >=20 > When a secondary process handles VDEV_SCAN_ONE mp action, it is possible > the device is already be inserted. This happens when we have multiple sec= ondary > processes which cause multiple broadcasts from primary during > bus->scan. So we don't need to log any error for -EEXIST. >=20 > Bugzilla ID: 84 > Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel") > Cc: stable@dpdk.org >=20 > Reported-by: Eads Gage > Signed-off-by: Qi Zhang > --- >=20 > v2: > - change log level to DEBUG for the case device already exist. >=20 > drivers/bus/vdev/vdev.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index > 6139dd551..69dee89a8 100644 > --- a/drivers/bus/vdev/vdev.c > +++ b/drivers/bus/vdev/vdev.c > @@ -346,6 +346,7 @@ vdev_action(const struct rte_mp_msg *mp_msg, const > void *peer) > const struct vdev_param *in =3D (const struct vdev_param *)mp_msg- > >param; > const char *devname; > int num; > + int ret; >=20 > strlcpy(mp_resp.name, VDEV_MP_KEY, sizeof(mp_resp.name)); > mp_resp.len_param =3D sizeof(*ou); > @@ -380,7 +381,10 @@ vdev_action(const struct rte_mp_msg *mp_msg, const > void *peer) > break; > case VDEV_SCAN_ONE: > VDEV_LOG(INFO, "receive vdev, %s", in->name); > - if (insert_vdev(in->name, NULL, NULL) < 0) > + ret =3D insert_vdev(in->name, NULL, NULL); > + if (ret =3D=3D -EEXIST) > + VDEV_LOG(DEBUG, "device already exist, %s", in- > >name); > + else if (ret < 0) > VDEV_LOG(ERR, "failed to add vdev, %s", in->name); > break; > default: > -- > 2.13.6