From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id E926DA0C4E;
	Mon, 25 Oct 2021 16:28:55 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id CF20D41125;
	Mon, 25 Oct 2021 16:28:55 +0200 (CEST)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.129.124])
 by mails.dpdk.org (Postfix) with ESMTP id 479FD410DA
 for <dev@dpdk.org>; Mon, 25 Oct 2021 16:28:54 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1635172133;
 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=K/GtGNGhN4WpnNlbtpAPw9vu/tbV27uYSa8lzCrKX7Y=;
 b=OczHQ3BpcgycXx02/ijTH78IDxuZcYaldZv+CX4ZA277kCYCHqDElf0+cyuOVoV9z4fazP
 8rj8YDcFbucFRe8JmSJdHmIOa8cbrWgr7XBFQ0rx8SJM3ds2SDUH6C7ZdeJFKTvaTWL1fV
 vXk+PvCyjr8wdElvyoItkI/orngDgTY=
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-25-uWVKlNWMPPOxEwMe83X-Cw-1; Mon, 25 Oct 2021 10:28:50 -0400
X-MC-Unique: uWVKlNWMPPOxEwMe83X-Cw-1
Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com
 [10.5.11.23])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D38958018AC;
 Mon, 25 Oct 2021 14:28:48 +0000 (UTC)
Received: from dmarchan.remote.csb (unknown [10.40.192.64])
 by smtp.corp.redhat.com (Postfix) with ESMTP id A69C719C79;
 Mon, 25 Oct 2021 14:28:46 +0000 (UTC)
From: David Marchand <david.marchand@redhat.com>
To: hkalra@marvell.com,
	dev@dpdk.org
Cc: dmitry.kozliuk@gmail.com,
	rasland@nvidia.com,
	thomas@monjalon.net
Date: Mon, 25 Oct 2021 16:27:11 +0200
Message-Id: <20211025142712.1273-9-david.marchand@redhat.com>
In-Reply-To: <20211025142712.1273-1-david.marchand@redhat.com>
References: <20211022204934.132186-1-hkalra@marvell.com>
 <20211025142712.1273-1-david.marchand@redhat.com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23
Authentication-Results: relay.mimecast.com;
 auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="US-ASCII"
Subject: [dpdk-dev] [PATCH v8 8/9] interrupts: rename device specific file
 descriptor
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

From: Harman Kalra <hkalra@marvell.com>

VFIO/UIO are mutually exclusive, storing file descriptor in a single
field is enough.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v5:
- split from patch5,

---
 lib/eal/common/eal_common_interrupts.c | 6 +++---
 lib/eal/common/eal_interrupts.h        | 8 +-------
 lib/eal/include/rte_eal_trace.h        | 8 ++++----
 3 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/lib/eal/common/eal_common_interrupts.c b/lib/eal/common/eal_common_interrupts.c
index 5886376d84..2146b933bb 100644
--- a/lib/eal/common/eal_common_interrupts.c
+++ b/lib/eal/common/eal_common_interrupts.c
@@ -72,7 +72,7 @@ struct rte_intr_handle *rte_intr_instance_dup(const struct rte_intr_handle *src)
 	intr_handle = rte_intr_instance_alloc(src->alloc_flags);
 
 	intr_handle->fd = src->fd;
-	intr_handle->vfio_dev_fd = src->vfio_dev_fd;
+	intr_handle->dev_fd = src->dev_fd;
 	intr_handle->type = src->type;
 	intr_handle->max_intr = src->max_intr;
 	intr_handle->nb_efd = src->nb_efd;
@@ -139,7 +139,7 @@ int rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd)
 {
 	CHECK_VALID_INTR_HANDLE(intr_handle);
 
-	intr_handle->vfio_dev_fd = fd;
+	intr_handle->dev_fd = fd;
 
 	return 0;
 fail:
@@ -150,7 +150,7 @@ int rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle)
 {
 	CHECK_VALID_INTR_HANDLE(intr_handle);
 
-	return intr_handle->vfio_dev_fd;
+	return intr_handle->dev_fd;
 fail:
 	return -1;
 }
diff --git a/lib/eal/common/eal_interrupts.h b/lib/eal/common/eal_interrupts.h
index beacc04b62..1a4e5573b2 100644
--- a/lib/eal/common/eal_interrupts.h
+++ b/lib/eal/common/eal_interrupts.h
@@ -9,13 +9,7 @@ struct rte_intr_handle {
 	RTE_STD_C11
 	union {
 		struct {
-			RTE_STD_C11
-			union {
-				/** VFIO device file descriptor */
-				int vfio_dev_fd;
-				/** UIO cfg file desc for uio_pci_generic */
-				int uio_cfg_fd;
-			};
+			int dev_fd; /**< VFIO/UIO cfg device file descriptor */
 			int fd;	/**< interrupt event file descriptor */
 		};
 		void *windows_handle; /**< device driver handle */
diff --git a/lib/eal/include/rte_eal_trace.h b/lib/eal/include/rte_eal_trace.h
index af7b2d0bf0..5ef4398230 100644
--- a/lib/eal/include/rte_eal_trace.h
+++ b/lib/eal/include/rte_eal_trace.h
@@ -151,7 +151,7 @@ RTE_TRACE_POINT(
 	RTE_TRACE_POINT_ARGS(const struct rte_intr_handle *handle,
 		rte_intr_callback_fn cb, void *cb_arg, int rc),
 	rte_trace_point_emit_int(rc);
-	rte_trace_point_emit_int(handle->vfio_dev_fd);
+	rte_trace_point_emit_int(handle->dev_fd);
 	rte_trace_point_emit_int(handle->fd);
 	rte_trace_point_emit_int(handle->type);
 	rte_trace_point_emit_u32(handle->max_intr);
@@ -164,7 +164,7 @@ RTE_TRACE_POINT(
 	RTE_TRACE_POINT_ARGS(const struct rte_intr_handle *handle,
 		rte_intr_callback_fn cb, void *cb_arg, int rc),
 	rte_trace_point_emit_int(rc);
-	rte_trace_point_emit_int(handle->vfio_dev_fd);
+	rte_trace_point_emit_int(handle->dev_fd);
 	rte_trace_point_emit_int(handle->fd);
 	rte_trace_point_emit_int(handle->type);
 	rte_trace_point_emit_u32(handle->max_intr);
@@ -176,7 +176,7 @@ RTE_TRACE_POINT(
 	rte_eal_trace_intr_enable,
 	RTE_TRACE_POINT_ARGS(const struct rte_intr_handle *handle, int rc),
 	rte_trace_point_emit_int(rc);
-	rte_trace_point_emit_int(handle->vfio_dev_fd);
+	rte_trace_point_emit_int(handle->dev_fd);
 	rte_trace_point_emit_int(handle->fd);
 	rte_trace_point_emit_int(handle->type);
 	rte_trace_point_emit_u32(handle->max_intr);
@@ -186,7 +186,7 @@ RTE_TRACE_POINT(
 	rte_eal_trace_intr_disable,
 	RTE_TRACE_POINT_ARGS(const struct rte_intr_handle *handle, int rc),
 	rte_trace_point_emit_int(rc);
-	rte_trace_point_emit_int(handle->vfio_dev_fd);
+	rte_trace_point_emit_int(handle->dev_fd);
 	rte_trace_point_emit_int(handle->fd);
 	rte_trace_point_emit_int(handle->type);
 	rte_trace_point_emit_u32(handle->max_intr);
-- 
2.23.0