From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 488095A6A; Mon, 3 Sep 2018 10:49:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2018 01:49:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,324,1531810800"; d="scan'208";a="85582226" Received: from dpdk51.sh.intel.com ([10.67.110.190]) by fmsmga004.fm.intel.com with ESMTP; 03 Sep 2018 01:49:28 -0700 From: Qi Zhang To: dev@dpdk.org Cc: thomas@monjalon.net, anatoly.burakov@intel.com, gage.eads@intel.com, Qi Zhang , stable@dpdk.org Date: Mon, 3 Sep 2018 16:50:22 +0800 Message-Id: <20180903085022.45183-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180827122732.5531-1-qi.z.zhang@intel.com> References: <20180827122732.5531-1-qi.z.zhang@intel.com> Subject: [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: Mon, 03 Sep 2018 08:49:30 -0000 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 secondary processes which cause multiple broadcasts from primary during bus->scan. So we don't need to log any error for -EEXIST. Bugzilla ID: 84 Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel") Cc: stable@dpdk.org Reported-by: Eads Gage Signed-off-by: Qi Zhang --- v2: - change log level to DEBUG for the case device already exist. drivers/bus/vdev/vdev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 = (const struct vdev_param *)mp_msg->param; const char *devname; int num; + int ret; strlcpy(mp_resp.name, VDEV_MP_KEY, sizeof(mp_resp.name)); mp_resp.len_param = 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 = insert_vdev(in->name, NULL, NULL); + if (ret == -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