From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <rosen.xu@intel.com>
Received: from mga18.intel.com (mga18.intel.com [134.134.136.126])
 by dpdk.org (Postfix) with ESMTP id D75314C80
 for <dev@dpdk.org>; Fri, 29 Mar 2019 17:00:00 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 29 Mar 2019 09:00:00 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,284,1549958400"; d="scan'208";a="156992774"
Received: from dpdkx8602.sh.intel.com ([10.67.110.200])
 by fmsmga004.fm.intel.com with ESMTP; 29 Mar 2019 08:59:58 -0700
From: Rosen Xu <rosen.xu@intel.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, tianfei.zhang@intel.com, dan.wei@intel.com,
 rosen.xu@intel.com, andy.pei@intel.com, qiming.yang@intel.com,
 haiyue.wang@intel.com, santos.chen@intel.com, zhang.zhang@intel.com
Date: Fri, 29 Mar 2019 23:58:05 +0800
Message-Id: <1553875099-166351-2-git-send-email-rosen.xu@intel.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1553875099-166351-1-git-send-email-rosen.xu@intel.com>
References: <1551338000-120348-1-git-send-email-rosen.xu@intel.com>
 <1553875099-166351-1-git-send-email-rosen.xu@intel.com>
Subject: [dpdk-dev] [PATCH v2 01/15] drivers/bus/ifpga: add AFU shared data
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
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>
X-List-Received-Date: Fri, 29 Mar 2019 16:00:01 -0000

AFU can be implemented into many different acceleration
devices, these devices need shared data to store private
information when they are handled by users.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
---
 drivers/bus/ifpga/rte_bus_ifpga.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/bus/ifpga/rte_bus_ifpga.h b/drivers/bus/ifpga/rte_bus_ifpga.h
index 0bf43ba..820eeaa 100644
--- a/drivers/bus/ifpga/rte_bus_ifpga.h
+++ b/drivers/bus/ifpga/rte_bus_ifpga.h
@@ -17,6 +17,7 @@
 
 #include <rte_bus.h>
 #include <rte_pci.h>
+#include <rte_spinlock.h>
 
 /** Name of Intel FPGA Bus */
 #define IFPGA_BUS_NAME ifpga
@@ -60,6 +61,11 @@ struct rte_afu_pr_conf {
 
 #define AFU_PRI_STR_SIZE (PCI_PRI_STR_SIZE + 8)
 
+struct rte_afu_shared {
+	rte_spinlock_t lock;
+	void *data;
+};
+
 /**
  * A structure describing a AFU device.
  */
@@ -71,6 +77,7 @@ struct rte_afu_device {
 	uint32_t num_region;   /**< number of regions found */
 	struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE];
 						/**< AFU Memory Resource */
+	struct rte_afu_shared shared;
 	struct rte_intr_handle intr_handle;     /**< Interrupt handle */
 	struct rte_afu_driver *driver;          /**< Associated driver */
 	char path[IFPGA_BUS_BITSTREAM_PATH_MAX_LEN];
-- 
1.8.3.1

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 28D0AA05D3
	for <public@inbox.dpdk.org>; Fri, 29 Mar 2019 17:00:09 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id E72F54C93;
	Fri, 29 Mar 2019 17:00:04 +0100 (CET)
Received: from mga18.intel.com (mga18.intel.com [134.134.136.126])
 by dpdk.org (Postfix) with ESMTP id D75314C80
 for <dev@dpdk.org>; Fri, 29 Mar 2019 17:00:00 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 29 Mar 2019 09:00:00 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,284,1549958400"; d="scan'208";a="156992774"
Received: from dpdkx8602.sh.intel.com ([10.67.110.200])
 by fmsmga004.fm.intel.com with ESMTP; 29 Mar 2019 08:59:58 -0700
From: Rosen Xu <rosen.xu@intel.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, tianfei.zhang@intel.com, dan.wei@intel.com,
 rosen.xu@intel.com, andy.pei@intel.com, qiming.yang@intel.com,
 haiyue.wang@intel.com, santos.chen@intel.com, zhang.zhang@intel.com
Date: Fri, 29 Mar 2019 23:58:05 +0800
Message-Id: <1553875099-166351-2-git-send-email-rosen.xu@intel.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1553875099-166351-1-git-send-email-rosen.xu@intel.com>
References: <1551338000-120348-1-git-send-email-rosen.xu@intel.com>
 <1553875099-166351-1-git-send-email-rosen.xu@intel.com>
Subject: [dpdk-dev] [PATCH v2 01/15] drivers/bus/ifpga: add AFU shared data
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
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>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <20190329155805.4pBWFxeswidAP9UT9NyyyyPYHhfw6uO4B3pHurFDsYY@z>

AFU can be implemented into many different acceleration
devices, these devices need shared data to store private
information when they are handled by users.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
---
 drivers/bus/ifpga/rte_bus_ifpga.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/bus/ifpga/rte_bus_ifpga.h b/drivers/bus/ifpga/rte_bus_ifpga.h
index 0bf43ba..820eeaa 100644
--- a/drivers/bus/ifpga/rte_bus_ifpga.h
+++ b/drivers/bus/ifpga/rte_bus_ifpga.h
@@ -17,6 +17,7 @@
 
 #include <rte_bus.h>
 #include <rte_pci.h>
+#include <rte_spinlock.h>
 
 /** Name of Intel FPGA Bus */
 #define IFPGA_BUS_NAME ifpga
@@ -60,6 +61,11 @@ struct rte_afu_pr_conf {
 
 #define AFU_PRI_STR_SIZE (PCI_PRI_STR_SIZE + 8)
 
+struct rte_afu_shared {
+	rte_spinlock_t lock;
+	void *data;
+};
+
 /**
  * A structure describing a AFU device.
  */
@@ -71,6 +77,7 @@ struct rte_afu_device {
 	uint32_t num_region;   /**< number of regions found */
 	struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE];
 						/**< AFU Memory Resource */
+	struct rte_afu_shared shared;
 	struct rte_intr_handle intr_handle;     /**< Interrupt handle */
 	struct rte_afu_driver *driver;          /**< Associated driver */
 	char path[IFPGA_BUS_BITSTREAM_PATH_MAX_LEN];
-- 
1.8.3.1