From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 892A14C79 for ; Thu, 17 May 2018 09:37:39 +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 orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 May 2018 00:37:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,409,1520924400"; d="scan'208";a="224953169" Received: from dpdk-xiao-1.sh.intel.com ([10.67.111.90]) by orsmga005.jf.intel.com with ESMTP; 17 May 2018 00:37:37 -0700 From: Xiao Wang To: maxime.coquelin@redhat.com Cc: dev@dpdk.org, tiwei.bie@intel.com, lei.a.yao@intel.com, Xiao Wang Date: Thu, 17 May 2018 15:35:25 +0800 Message-Id: <20180517073525.103984-1-xiao.w.wang@intel.com> X-Mailer: git-send-email 2.15.1 Subject: [dpdk-dev] [PATCH] net/virtio-user: fix dev_init in legacy-mem mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 07:37:40 -0000 In legacy-mem mode, memory event callback registering is not supported, we should not return error in dev_init on this case. Fixes: 12ecb2f63b12 ("net/virtio-user: support memory hotplug") Signed-off-by: Xiao Wang Suggested-by: Tiwei Bie --- drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 992a68757..bd16fbb60 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -445,8 +445,11 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, if (rte_mem_event_callback_register(VIRTIO_USER_MEM_EVENT_CLB_NAME, virtio_user_mem_event_cb, dev)) { - PMD_INIT_LOG(ERR, "Failed to register mem event callback\n"); - return -1; + if (rte_errno != ENOTSUP) { + PMD_INIT_LOG(ERR, "Failed to register mem event" + " callback\n"); + return -1; + } } return 0; -- 2.15.1