From patchwork Fri Dec 13 14:13:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 63846 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8A6EBA04F1; Fri, 13 Dec 2019 15:13:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DEF5C1BF9D; Fri, 13 Dec 2019 15:13:41 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 252971BF9A for ; Fri, 13 Dec 2019 15:13:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576246419; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VOzRomDJ/d2lg7k+EKYhCm+YSUUvwmsIsPy2lXBFQZI=; b=ClsjPxRjiA3DaMGRYcvv9g3n8FWi6A5lSU8YNIig8b92s/y11jARG4yMdPoRPcDGSvP6Ow eovAkYaTos6xqYImuurDB7wZxFZ6iN7aeJzJR40urDzA6T3s31Oy4YJwVi4l/ma4YrDGn1 U4diN6JBZzJPCkd+J1WMqq3dv3T8BZc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-392-zzyw3BAhM4-jFnZbk5Tyng-1; Fri, 13 Dec 2019 09:13:36 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 50620107B272; Fri, 13 Dec 2019 14:13:35 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C6DA60C05; Fri, 13 Dec 2019 14:13:32 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, tiwei.bie@intel.com, zhihong.wang@intel.com, anatoly.burakov@intel.com Cc: Maxime Coquelin Date: Fri, 13 Dec 2019 15:13:20 +0100 Message-Id: <20191213141322.32730-3-maxime.coquelin@redhat.com> In-Reply-To: <20191213141322.32730-1-maxime.coquelin@redhat.com> References: <20191213141322.32730-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: zzyw3BAhM4-jFnZbk5Tyng-1 X-Mimecast-Spam-Score: 0 Subject: [dpdk-dev] [PATCH 2/4] eal: allow getting memory segment FD with external memory 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Now that it is possible to associate a file descriptor when registering external and contiguous memory, let's allow it. If no FD is available for the memory segment, ENOENT error is returned. Signed-off-by: Maxime Coquelin --- lib/librte_eal/common/eal_common_memory.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c index 7a4b371828..cc660f5b85 100644 --- a/lib/librte_eal/common/eal_common_memory.c +++ b/lib/librte_eal/common/eal_common_memory.c @@ -691,12 +691,6 @@ rte_memseg_get_fd_thread_unsafe(const struct rte_memseg *ms) return -1; } - /* segment fd API is not supported for external segments */ - if (msl->external) { - rte_errno = ENOTSUP; - return -1; - } - ret = eal_memalloc_get_seg_fd(msl_idx, seg_idx); if (ret < 0) { rte_errno = -ret; @@ -746,12 +740,6 @@ rte_memseg_get_fd_offset_thread_unsafe(const struct rte_memseg *ms, return -1; } - /* segment fd API is not supported for external segments */ - if (msl->external) { - rte_errno = ENOTSUP; - return -1; - } - ret = eal_memalloc_get_seg_fd_offset(msl_idx, seg_idx, offset); if (ret < 0) { rte_errno = -ret;